<section class="tab {{tab.cssClass}}" data-tab="{{tab.id}}" data-group="{{tab.group}}">

  {{#if isGM}}
    <fieldset data-section="time-realtime">
      <legend>
        {{localize "CALENDARIA.SettingsPanel.Section.RealTimeSpeed"}}
        <button type="button" class="reset-section" data-action="resetSection" data-section="time-realtime" data-tooltip
          aria-label="{{localize "CALENDARIA.SettingsPanel.ResetSection.Tooltip"}}"><i class="fas fa-undo"></i></button>
      </legend>

      <div class="form-group">
        <label for="timeSpeedMultiplier">{{localize "CALENDARIA.Settings.TimeSpeedMultiplier.Name"}}</label>
        <div class="form-fields">
          <input type="number" id="timeSpeedMultiplier" name="timeSpeedMultiplier" value="{{timeSpeedMultiplier}}"
            min="0" step="any">
          <select id="timeSpeedIncrement" name="timeSpeedIncrement">
            {{#each timeSpeedIncrements}}
              <option value="{{key}}" {{#if selected}}selected{{/if}}>{{label}}</option>
            {{/each}}
          </select>
        </div>
        <p class="hint">{{localize "CALENDARIA.Settings.TimeSpeedMultiplier.Hint"}}</p>
      </div>

      <div class="form-group">
        <label for="timeAdvanceInterval">{{localize "CALENDARIA.Settings.TimeAdvanceInterval.Name"}}</label>
        <div class="form-fields">
          <input type="number" id="timeAdvanceInterval" name="timeAdvanceInterval" value="{{timeAdvanceInterval}}"
            min="1" max="120" step="1">
        </div>
        <p class="hint">{{localize "CALENDARIA.Settings.TimeAdvanceInterval.Hint"}}</p>
      </div>
    </fieldset>

    <fieldset data-section="time-integration">
      <legend>
        {{localize "CALENDARIA.SettingsPanel.Section.TimeIntegration"}}
        <button type="button" class="reset-section" data-action="resetSection" data-section="time-integration"
          data-tooltip aria-label="{{localize "CALENDARIA.SettingsPanel.ResetSection.Tooltip"}}"><i
            class="fas fa-undo"></i></button>
      </legend>

      <div class="form-group">
        <label for="advanceTimeOnRest">{{localize "CALENDARIA.Settings.AdvanceTimeOnRest.Name"}}</label>
        <div class="form-fields">
          <input type="checkbox" id="advanceTimeOnRest" name="advanceTimeOnRest"
            {{#if advanceTimeOnRest}}checked{{/if}}>
        </div>
        <p class="hint">{{localize "CALENDARIA.Settings.AdvanceTimeOnRest.Hint"}}</p>
      </div>

      <div class="form-group" data-depends-on="advanceTimeOnRest">
        <label for="restAdvanceMode">{{localize "CALENDARIA.Settings.RestAdvanceMode.Name"}}</label>
        <div class="form-fields">
          <select id="restAdvanceMode" name="restAdvanceMode">
            <option value="automatic" {{#if (eq restAdvanceMode "automatic")}}selected{{/if}}>
              {{localize "CALENDARIA.Settings.RestAdvanceMode.Automatic"}}
            </option>
            <option value="newDay" {{#if (eq restAdvanceMode "newDay")}}selected{{/if}}>
              {{localize "CALENDARIA.Settings.RestAdvanceMode.NewDay"}}
            </option>
            <option value="sunrise" {{#if (eq restAdvanceMode "sunrise")}}selected{{/if}}>
              {{localize "CALENDARIA.Settings.RestAdvanceMode.Sunrise"}}
            </option>
            <option value="fixed" {{#if (eq restAdvanceMode "fixed")}}selected{{/if}}>
              {{localize "CALENDARIA.Settings.RestAdvanceMode.Fixed"}}
            </option>
          </select>
        </div>
        <p class="hint">{{localize "CALENDARIA.Settings.RestAdvanceMode.Hint"}}</p>
      </div>

      <div class="form-group" data-depends-on="restAdvanceMode:fixed">
        <label for="restFixedHours">{{localize "CALENDARIA.Settings.RestFixedHours.Name"}}</label>
        <div class="form-fields">
          <input type="number" id="restFixedHours" name="restFixedHours" value="{{restFixedHours}}" min="0" step="1">
        </div>
        <p class="hint">{{localize "CALENDARIA.Settings.RestFixedHours.Hint"}}</p>
      </div>

      <div class="form-group" data-depends-on="advanceTimeOnRest">
        <label for="shortRestAdvanceMode">{{localize "CALENDARIA.Settings.ShortRestAdvanceMode.Name"}}</label>
        <div class="form-fields">
          <select id="shortRestAdvanceMode" name="shortRestAdvanceMode">
            <option value="automatic" {{#if (eq shortRestAdvanceMode "automatic")}}selected{{/if}}>
              {{localize "CALENDARIA.Settings.RestAdvanceMode.Automatic"}}
            </option>
            <option value="fixed" {{#if (eq shortRestAdvanceMode "fixed")}}selected{{/if}}>
              {{localize "CALENDARIA.Settings.RestAdvanceMode.Fixed"}}
            </option>
          </select>
        </div>
        <p class="hint">{{localize "CALENDARIA.Settings.ShortRestAdvanceMode.Hint"}}</p>
      </div>

      <div class="form-group" data-depends-on="shortRestAdvanceMode:fixed">
        <label for="shortRestFixedMinutes">{{localize "CALENDARIA.Settings.ShortRestFixedMinutes.Name"}}</label>
        <div class="form-fields">
          <input type="number" id="shortRestFixedMinutes" name="shortRestFixedMinutes" value="{{shortRestFixedMinutes}}" min="0" step="1">
        </div>
        <p class="hint">{{localize "CALENDARIA.Settings.ShortRestFixedMinutes.Hint"}}</p>
      </div>

      {{#if showBastionSetting}}
        <div class="form-group">
          <label for="advanceBastionOrders">{{localize "CALENDARIA.Settings.AdvanceBastionOrders.Name"}}</label>
          <div class="form-fields">
            <input type="checkbox" id="advanceBastionOrders" name="advanceBastionOrders"
              {{#if advanceBastionOrders}}checked{{/if}}>
          </div>
          <p class="hint">{{localize "CALENDARIA.Settings.AdvanceBastionOrders.Hint"}}</p>
        </div>
      {{/if}}

      <div class="form-group">
        <label for="syncClockPause">{{localize "CALENDARIA.Settings.SyncClockPause.Name"}}</label>
        <div class="form-fields">
          <input type="checkbox" id="syncClockPause" name="syncClockPause" {{#if syncClockPause}}checked{{/if}}>
        </div>
        <p class="hint">{{localize "CALENDARIA.Settings.SyncClockPause.Hint"}}</p>
      </div>

      <div class="form-group">
        <label for="clockRunDuringCombat">{{localize "CALENDARIA.Settings.ClockRunDuringCombat.Name"}}</label>
        <div class="form-fields">
          <input type="checkbox" id="clockRunDuringCombat" name="clockRunDuringCombat"
            {{#if clockRunDuringCombat}}checked{{/if}}>
        </div>
        <p class="hint">{{localize "CALENDARIA.Settings.ClockRunDuringCombat.Hint"}}</p>
      </div>
    </fieldset>

    {{#if roundTimeDisabled}}
      <div class="notification warning">
        <i class="fas fa-exclamation-triangle"></i>
        <p>{{localize "CALENDARIA.SettingsPanel.TimeTab.RoundTimeDisabledWarning"}}</p>
      </div>
    {{/if}}
  {{/if}}

  {{#unless isGM}}
    <div class="info-box">
      <i class="fas fa-info-circle"></i>
      <p>{{localize "CALENDARIA.SettingsPanel.TimeTab.PlayerMessage"}}</p>
    </div>
  {{/unless}}

</section>
