<form class="{{cssClass}}" autocomplete="off">

  {{!-- Sheet Header --}}
  <header class="sheet-header">
    <div class="header-fields">
      <div class="flexrow">
        <img class="profile-img" src="{{img}}" data-edit="img" title="{{name}}" />
        <h1 class="charname"><input name="name" type="text" value="{{name}}" placeholder="Name" /></h1>
      </div>
    </div>
  </header>

  {{!-- Sheet Tab Navigation --}}
  <nav class="sheet-tabs tabs" data-group="primary">
    <a class="item" data-tab="statistics">Statistics</a>
    <a class="item" data-tab="specs">Specialisations</a>
    <a class="item" data-tab="powers">Powers</a>
    <a class="item" data-tab="combat">Combat</a>
    <a class="item" data-tab="equipment">Equipment</a>
    <a class="item" data-tab="biodata">Biography</a>
  </nav>

  {{!-- Sheet Body --}}
  <section class="sheet-body">

    {{!-- Carac Tab --}}
    <div class="tab items" data-group="primary" data-tab="statistics">

      <span><a class="lock-unlock-sheet"><img class="small-button-container"
            src="systems/fvtt-weapons-of-the-gods/images/icons/{{#if editScore}}unlocked.svg{{else}}locked.svg{{/if}}"
            alt="Unlocked/Locked">{{#if editScore}}Unlocked{{else}}Locked{{/if}}</a>
      </span>

      <div class="grid grid-2col">
        <div class="">
          <ul>
            {{#each data.statistics as |stat key|}}
            <li class="item flexrow list-item" data-attr-key="{{key}}">
              <span class="stat-label flexrow" name="{{key}}">
                <h4><a class="roll-stat" data-stat-key="{{key}}">{{stat.label}} [{{stat.abbrev}}]</a></h4></span>
              <select class=" carac-base flexrow" type="text" name="data.statistics.{{key}}.value"
                    value="{{stat.value}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
                    {{#select stat.value}}
                    {{{@root.optionsDiceList}}}
                    {{/select}}
                    </select>
                    <input type="text" class="input-numeric-short padd-right" name="data.statistics.{{key}}.mod"
                      value="{{stat.mod}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}} />
            </li>
            {{/each}}
          </ul>
        </div>

        <div class="">
          <ul>
            <li class="item flexrow list-item"><span></span><span>Current</span><span>Max</span></li>
            <li class="item flexrow list-item"></li>
            <li class="item flexrow list-item"></li>
            {{#each data.secondary as |stat2 key|}}
            <li class="item flexrow list-item" data-attr-key="{{key}}">
              <span class="stat-label flexrow" name="{{key}}">
                <h4>{{stat2.label}}</h4>
              </span>
              <input type="text" class="padd-right" name="data.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/>
              <input type="text" class="padd-right" name="data.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/>
            </li>
            {{/each}}
          </ul>

          <ul>
            <li class="item flexrow list-item" data-key="nrg">
              <span class="stat-label flexrow" name="nrg">                 <h4>{{data.nrg.label}}</h4>               </span>
              <input type="text" class="padd-right" name="data.nrg.activated" value="{{data.nrg.activated}}" data-dtype="Number"/>
              <input type="text" class="padd-right" name="data.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/>
              <input type="text" class="padd-right" name="data.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
            </li>
          </ul>

          <ul>
            <li class="item flexrow list-item" data-key="momentum">
              <span class="stat-label flexrow" name="momentum">                 <h4>{{data.momentum.label}}</h4>               </span>
              <input type="text" class="padd-right" name="data.momentum.value" value="{{data.momentum.value}}" data-dtype="Number"/>
              <input type="text" class="padd-right" name="data.momentum.max" value="{{data.momentum.max}}" data-dtype="Number"/>
            </li>
          </ul>

          <ul>
            <li class="item flexrow list-item" data-key="mr">
              <span class="stat-label flexrow" name="mr">
                <a class="roll-mr" data-stat-key="{{mr}}"><h4>{{data.mr.label}}</h4></a>
              </span>
              <select class="carac-base flexrow" type="text" name="data.mr.value" value="{{data.mr.value}}"
                data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
                {{#select data.mr.value}}
                {{{@root.optionsDiceList}}}
                {{/select}}
              </select>
              <input type="text" class="padd-right" name="data.mr.mod" value="{{data.mr.mod}}" data-dtype="Number"/>
            </li>
          </ul>

        </div>

      </div>

    </div>


    {{!-- Other Tab --}}
    <div class="tab items" data-group="primary" data-tab="specs">

      <div class="grid grid-2col">

        <div>
          <span class="generic-label">
            <h3>Specialisations</h3>
          </span>
          <ul class="stat-list alternate-list">
            {{#each specs as |spec key|}}
            <li class="item stat flexrow list-item" data-item-id="{{spec._id}}">
              <img class="sheet-competence-img" src="{{spec.img}}" />
              <span class="stat-label"><a class="roll-spec">{{spec.name}}</a></span>
              <span class="stat-label">{{upper spec.data.statistic}}</span>
              <span class="stat-label">{{spec.data.dice}}</span>
              <div class="item-controls">
                <a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
        </div>

        <div>
          <span class="generic-label">
            <h3>Perks</h3>
          </span>
          <ul class="stat-list alternate-list">
            {{#each perks as |perk key|}}
            <li class="item stat flexrow list-item" data-item-id="{{perk._id}}">
              <img class="sheet-competence-img" src="{{perk.img}}" />
              <span class="stat-label">{{perk.name}}</span>
              <span class="stat-label">Lvl:{{perk.data.level}}</span>
              <span class="stat-label">Rounds:
                <select class="competence-base flexrow park-round-count" type="text" value="{{perk.data.roundcount}}" data-dtype="Number">
                  {{#select perk.data.roundcount}}
                  <option value="3">Ready</option>
                  <option value="2">Activated</option>
                  <option value="1">2 Rounds left</option>
                  <option value="0">1 Round left</option>
                  {{/select}}
                </select>   
              </span>
              <div class="item-controls">
                <a class="item-control perk-active" title="active">{{#if perk.data.active}}<i
                    class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
                <a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
                <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
              </div>
            </li>
            {{/each}}
          </ul>
        </div>
      </div>

      <div>
        <span class="generic-label">
          <h3>Abilities</h3>
        </span>
        <ul class="stat-list alternate-list">
          {{#each abilities as |ability key|}}
          <li class="item stat flexrow list-item" data-item-id="{{ability._id}}">
            <img class="sheet-competence-img" src="{{ability.img}}" />
            <span class="stat-label">{{ability.name}}</span>
            <div class="item-controls">
              <a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
              <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
            </div>
          </li>
          {{/each}}
        </ul>
      </div>
    </div>

    </div>

    {{!-- Combat Tab --}}
    <div class="tab fight" data-group="primary" data-tab="combat">
      <div class="flexcol">

        <span class="generic-label">
          <h3>Basic Actions</h3>
        </span>
        <ul class="stat-list alternate-list">
          <li class="item stat flexrow list-item">
            <span class="generic-label"><a class="attack-melee">Melee Attack</a></span>
            <span class="generic-label"><a class="attack-ranged">Ranged Attack</a></span>
          </li>
          <li class="item stat flexrow list-item">
          </li>
          <li class="item stat flexrow list-item">
            <span class="generic-label"><a class="defense-roll">Defense</a></span>
            <span class="generic-label"><a class="damage-resistance">Damage Resistance</a></span>
          </li>
          <li class="item stat flexrow list-item">
            <span class="generic-label"><a class="damage-melee">Melee/Thrown Damage</a></span>
            <span class="generic-label"><a class="damage-ranged">Ranged Damage</a></span>
          </li>
        </ul>

        <span class="generic-label">
          <h3>Stun</h3>
        </span>
        <ul class="stat-list alternate-list">
          <li class="item stat flexrow list-item">
            <span class="generic-label">Stun Level</span>
            <input type="text" class="" name="data.combat.stunlevel" value="{{data.combat.stunlevel}}" data-dtype="Number" />
          </li>
          <li class="item stat flexrow list-item">
            <span class="generic-label">Stun Threshold</span>
            <input type="text" class="" name="data.combat.stunthreshold" value="{{data.combat.stunthreshold}}" data-dtype="Number" />
          </li>
        </ul>

        <span class="generic-label">
          <h3>Effects</h3>
        </span>
        <ul class="stat-list alternate-list">
          {{#each effects as |effect key|}}
          <li class="item stat flexrow list-item" data-arme-id="{{effect.id}}" data-item-id="{{effect._id}}">
            <img class="sheet-competence-img" src="{{effect.img}}" />
            <span class="generic-label">{{effect.name}}</span>
            <span class="generic-label">{{upperFirst effect.data.type}}</span>
            <span class="generic-label">{{upperFirst effect.data.genre}}</span>
            <span class="generic-label">Lvl:{{effect.data.effectlevel}}</span>
            <span class="generic-label">{{upper effect.data.stataffected}}</span>
            <div class="item-controls">
              <a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
              <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
            </div>
          </li>
          {{/each}}
        </ul>

        <span class="generic-label">
          <h3>Weapons</h3>
        </span>
        <ul class="stat-list alternate-list">
          {{#each weapons as |weapon key|}}
          <li class="item stat flexrow list-item" data-arme-id="{{weapon.id}}" data-item-id="{{weapon._id}}">
            <img class="sheet-competence-img" src="{{weapon.img}}" />
            <span class="generic-label"><a class="weapon-roll">{{weapon.name}}</a></span>
            <span class="generic-label">{{weapon.data.typeText}}</span>
            <span class="generic-label">Speed {{weapon.data.speed}}</span>
            <span class="generic-label">Damage {{weapon.data.damage}}</span>
            <div class="item-controls">
              <a class="item-control item-equip" title="Equip">{{#if weapon.data.equipped}}<i
                  class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
              <a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
              <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
            </div>
          </li>
          {{/each}}
        </ul>

        <span class="generic-label">
          <h3>Armor</h3>
        </span>
        <ul class="item-list alternate-list">
          {{#each armors as |armor key|}}
          <li class="item stat flexrow list-item" data-item-id="{{armor._id}}">
            <img class="sheet-competence-img" src="{{armor.img}}" />
            <span class="stat-label outfit-label">{{armor.name}}</span>
            <div class="item-controls">
              <a class="item-control item-equip" title="Worn">{{#if armor.data.equipped}}<i
                  class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
              <a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
              <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
            </div>
          </li>
          {{/each}}
        </ul>
      </div>
    </div>

    {{!-- Powers Tab --}}
    <div class="tab fight" data-group="primary" data-tab="powers">

      <div class="flexcol">

        <span class="generic-label">
          <h3>Powers</h3>
        </span>
        <ul class="stat-list alternate-list">
          {{#each powers as |power key|}}
          <li class="item stat flexrow list-item" data-item-id="{{power._id}}">
            <img class="sheet-competence-img" src="{{power.img}}" />
            <span class="stat-label">
              {{#if power.data.rollneeded}}
              <a class="power-roll">{{power.name}}</a>
              {{else}}
              {{power.name}}
              {{/if}}
            </span>
            <div class="item-controls">
              <a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
              <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
            </div>
          </li>
          {{/each}}
        </ul>

      </div>
    </div>

    {{!-- Equipement Tab --}}
    <div class="tab equipment" data-group="primary" data-tab="equipment">

      <div>
        <h4>Equipment</h4>
      </div>
      <ul class="item-list alternate-list">
        <li class="item flexrow list-item">
          <span class="equipement-label">Name</span>
          <span class="equipement-label">Type</span>
          <div class="item-controls">
            <span class="equipement-label">&nbsp;</span>
            <span class="equipement-label">&nbsp;</span>
            <span class="equipement-label">&nbsp;</span>
          </div>
        </li>
        {{#each equipments as |equip key|}}
        <li class="item flexrow list-item" data-item-id="{{equip._id}}">
          <img class="sheet-competence-img" src="{{equip.img}}" />
          <span class="equipement-label">{{equip.name}}</span>
          <span class="equipement-label">{{equip.type}}</span>
          <div class="item-controls">
            <a class="item-control item-equip" title="Worn">{{#if equip.data.equipped}}<i
                class="fas fa-circle"></i>{{else}}<i class="fas fa-genderless"></i>{{/if}}</a>
            <a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
            <a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
          </div>
        </li>
        {{/each}}
      </ul>
    </div>

    {{!-- Biography Tab --}}
    <div class="tab biodata" data-group="primary" data-tab="biodata">
      <div class="grid grid-2col">
        <div>
          <ul>
            <li class="flexrow">
              <label class="generic-label">Origin</label>
              <input type="text" class="" name="data.biodata.origin" value="{{data.biodata.origin}}"
                data-dtype="String" />
            </li>
            <li class="flexrow">
              <label class="generic-label">Age</label>
              <input type="text" class="" name="data.biodata.age" value="{{data.biodata.age}}" data-dtype="String" />
            </li>
            <li class="flexrow">
              <label class="generic-label">Height</label>
              <input type="text" class="" name="data.biodata.size" value="{{data.biodata.size}}" data-dtype="String" />
            </li>
            <li class="flexrow">
              <label class="generic-label">Eyes</label>
              <input type="text" class="" name="data.biodata.eyes" value="{{data.biodata.eyes}}" data-dtype="String" />
            </li>
            <li class="flexrow">
              <label class="generic-label">Hair</label>
              <input type="text" class="" name="data.biodata.hair" value="{{data.biodata.hair}}" data-dtype="String" />
            </li>
          </ul>
        </div>
        <div>
          <ul>
            <li class="flexrow">
              <label class="generic-label">Weight</label>
              <input type="text" class="" name="data.biodata.weight" value="{{data.biodata.weight}}"
                data-dtype="String" />
            </li>
            <li class="flexrow">
              <label class="generic-label">Sex</label>
              <input type="text" class="" name="data.biodata.sex" value="{{data.biodata.sex}}" data-dtype="String" />
            </li>
            <li class="flexrow">
              <label class="generic-label">Preferred Hand</label>
              <input type="text" class="" name="data.biodata.preferredhand" value="{{data.biodata.preferredhand}}" data-dtype="String" />
            </li>            
            <li class="flexrow item list_item" data-item-id="{{race._id}}">
              <label class="generic-label">Race</label>
              <input type="text" class="" name="data.racename" value="{{data.racename}}" data-dtype="String" />
              <div class="item-controls">
                <a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
              </div>
            </li>
            <li class="flexrow item list_item" data-item-id="{{role._id}}">
              <label class="generic-label">Role</label>
              <input type="text" class="" name="data.rolename" value="{{data.rolename}}" data-dtype="String" />
              <div class="item-controls">
                <a class="item-control item-edit" title="Edit Item"><i class="fas fa-edit"></i></a>
              </div>
            </li>
          </ul>
        </div>
      </div>
      <hr>

      <h3>Psychology : </h3>
      <ul>
        <li class="flexrow">
          <label class="short-label">Worst Fear </label>
          <input type="text" class="" name="data.biodata.worstfear" value="{{datadata.biodata.worstfear}}"
            data-dtype="Number" />
        </li>
        <li class="flexrow">
          <label class="short-label">Desires </label>
          <input type="text" class="" name="data.biodata.desires" value="{{data.biodata.desires}}"
            data-dtype="Number" />
        </li>
      </ul>

      <h3>Catchphrase : </h3>
      <ul>
        <li class="flexrow">
          <label class="short-label">Catchphrase </label>
          <input type="text" class="" name="data.biodata.catchphrase" value="{{datadata.biodata.catchphrase}}"
            data-dtype="Number" />
        </li>
        <li class="flexrow">
          <label class="short-label">Catchphrase Trigger : </label>
          <input type="text" class="" name="data.biodata.catchphrasetrigger" value="{{data.biodata.catchphrasetrigger}}"
            data-dtype="Number" />
        </li>
        <li class="flexrow">
          <label class="short-label">Catchphrase used </label>
          <label class="attribute-value checkbox"><input type="checkbox" name="data.biodata.catchphraseused" {{checked data.biodata.catchphraseused}}/></label>
        </li>
      </ul>

      <hr>
      <h3>Development : </h3>
      <ul>
        <li class="flexrow">
          <label class="short-label">Character Value : </label>
          <input type="text" class="" name="data.biodata.charactervalue" value="{{data.biodata.charactervalue}}"
            data-dtype="String" />
        </li>
        <li class="flexrow">
          <label class="short-label">Character Development Points Total (CDP total) : </label>
          <input type="text" class="" name="data.biodata.cdp" value="{{data.biodata.cdp}}"
            data-dtype="Number" />
        </li>
        <li class="flexrow">
          <label class="short-label">Hero Level : </label>
          <input type="text" class="" name="data.biodata.level" value="{{data.biodata.level}}"
            data-dtype="Number" />
        </li>
        <li class="flexrow">
          <label class="short-label">Hero Levels Remaining : </label>
          <input type="text" class="" name="data.biodata.cdpused" value="{{data.biodata.cdpused}}"
            data-dtype="Number" />
        </li>
      </ul>

      <hr>
      <h3>Background : </h3>
      <div class="form-group editor">
        {{editor content=data.biodata.description target="data.biodata.description" button=true owner=owner
        editable=editable}}
      </div>
      <hr>
      <h3>Notes : </h3>
      <div class="form-group editor">
        {{editor content=data.biodata.notes target="data.biodata.notes" button=true owner=owner editable=editable}}
      </div>
      <hr>
      </article>
    </div>

  </section>
</form>