<div class="content">
    <div class="dailies{{#if hasAlert}} has-alert{{/if}}">
        {{#if hasDailies}}
        {{#if rows.length}}
        <div class="group rows">
            {{#each rows as | row |}}
            {{> (concat row.type 'Row') row}}
            {{/each}}
        </div>
        {{/if}}
        {{#each groups as | group |}}
        <div class="group {{group.type}}">
            <h3>{{group.label}}</h3>
            {{#each group.rows as | row |}}
            {{> (concat row.type 'Row') row}}
            {{/each}}
        </div>
        {{/each}}
        {{else}}
        <div class="nothing">
            {{@root.i18n 'noDailies'}}
        </div>
        {{/if}}
    </div>
    <div class="buttons{{#unless canAccept}} no-accept{{/unless}}">
        {{#if canAccept}}
        <button data-action="accept">
            <i class="fas fa-mug-saucer"></i>
            {{@root.i18n 'accept'}}
        </button>
        {{/if}}
        <button data-action="cancel"><i class="fas fa-times"></i> {{@root.i18n 'cancel'}}</button>
    </div>
</div>
<div class="cover">
    <div class="loader"></div>
</div>


{{#*inline 'randomRow'}}
<label>{{this.label}}</label>
<div>
    <select class="random" {{{this.data}}}>
        {{#each this.options as |option|}}
        <option value="{{option.value}}">{{option.label}}</option>
        {{/each}}
    </select>
    <div class="die" data-tooltip="{{@root.i18n 'tooltip.random'}}">
        <i class="fa-solid fa-dice-d20"></i>
    </div>
</div>
{{/inline}}

{{#*inline 'inputRow'}}
<label>{{label}}</label>
<div class="input">
    <input type="text" {{{this.data}}} value="{{this.value}}" />
    <a class="clear{{#unless value}} disabled{{/unless}}" data-action="clear-field"
        data-tooltip="{{@root.i18n 'tooltip.clear'}}">
        <i class="fa-regular fa-times"></i>
    </a>
</div>
{{/inline}}

{{#*inline 'alertRow'}}
<div class="alert">
    <input type="text" value="{{this.value}}" disabled>
    <a data-action="resolve-alert" {{{this.data}}} data-tooltip="{{@root.i18n 'tooltip.alert'}}">
        <i class="fa-solid fa-circle-exclamation"></i>
    </a>
</div>
{{/inline}}

{{#*inline 'notifyRow'}}
<div class="notify">
    <input type="text" {{{this.data}}} value="{{this.value}}" disabled
        style="color: {{this.color}}">
    <span data-tooltip="{{@root.i18n 'tooltip.notify'}}" style="color: {{this.color}}">
        <i class="fa-solid fa-triangle-exclamation"></i>
    </span>
</div>
{{/inline}}

{{#*inline 'dropRow'}}
<label data-row="{{this.row}}">{{this.label}}</label>
<div class="drop">
    {{#if this.note}}
    <span class="note">
        <i class="fa-solid fa-info" data-tooltip="{{this.note}}"
            data-tooltip-class="pf2e-dailies-note"></i>
    </span>
    {{/if}}
    <input type="text" data-cache-tooltip="{{@root.i18n 'tooltip.exists'}}" value="{{this.value}}"
        {{{this.data}}} readonly />
    <a class="browser" data-action="open-browser" data-tooltip="{{@root.i18n 'tooltip.search'}}">
        <i class="fa-solid fa-search"></i>
    </a>
    <a class="clear{{#unless value}} disabled{{/unless}}" data-action="clear-field"
        data-tooltip="{{@root.i18n 'tooltip.clear'}}">
        <i class="fa-regular fa-times"></i>
    </a>
</div>
{{/inline}}

{{#*inline 'comboRow'}}
<label data-row="{{this.row}}">{{this.label}}</label>
<div class="combo">
    <select data-dailykey="{{this.daily}}" {{#if this.unique}} data-unique="{{this.unique}}" {{/if}}
        {{#unless this.options.length}}data-tooltip="{{@root.i18n 'tooltip.noSelect'}}"
        disabled{{/unless}}>
        <option value="" data-skip-unique="true"></option>
        {{> selectOptions this}}
    </select>
    <input type="text" value="{{this.value}}" {{{this.data}}} class="input" />
</div>
{{/inline}}

{{#*inline 'selectRow'}}
<label data-row="{{this.row}}">{{this.label}}</label>
<select {{{this.data}}} data-dailykey="{{this.daily}}" {{#if this.unique}}
    data-unique="{{this.unique}}" {{/if}} {{disabled (lte this.options.length 1)}}>
    {{> selectOptions this}}
</select>
{{/inline}}

{{#*inline 'selectOptions'}}
{{#each this.options as |option|}}
{{#if option.group}}
<optgroup label="{{option.group}}"></optgroup>
{{else if option.groupEnd}}
</optgroup>
{{else}}
<option value="{{option.value}}" {{#if option.skipUnique}}data-skip-unique="{{option.skipUnique}}"
    {{/if}} {{#if option.unique}}data-unique="{{option.unique}}" {{/if}} {{#if (eq ../this.selected
    option.value)}}selected{{/if}}>
    {{option.label}}
</option>
{{/if}}
{{/each}}
{{/inline}}