{{log "*** header.hbs ***" this}}
{{! Sheet Header }}
<header class="actor-header">
  <div class="prototype-actor">
    {{#if actor.token}}{{localize 'SR6.label.token'}}{{else}}{{#if linkedToken}}{{localize 'SR6.label.unique'}}{{else}}{{localize 'SR6.label.template'}}{{/if}}{{/if}}
  </div>
  <div class="hud-shell">
    <section class="hud">
  
      <div class="hud-meta{{#if (not editable)}} inactive{{/if}}">
        <span class="meta-icon battery" style="--level: 72;"></span>
        <span class="meta-icon wifi" style="--signal-strength: 3;">
          <span></span><span></span><span></span><span></span>
        </span>
        <span class="meta-icon persona-mode public" data-action="togglePersonaMode" title="{{localize 'SR6.title.personaModeToggle'}}">
          <span class="meta-icon public"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
              <path fill="currentColor"
                d="M320 64C306.7 64 296 74.7 296 88L296 97.7C214.6 109.3 152 179.4 152 264L152 278.5C152 316.2 142 353.2 123 385.8L101.1 423.2C97.8 429 96 435.5 96 442.2C96 463.1 112.9 480 133.8 480L506.2 480C527.1 480 544 463.1 544 442.2C544 435.5 542.2 428.9 538.9 423.2L517 385.7C498 353.1 488 316.1 488 278.4L488 263.9C488 179.3 425.4 109.2 344 97.6L344 87.9C344 74.6 333.3 63.9 320 63.9zM488.4 432L151.5 432L164.4 409.9C187.7 370 200 324.6 200 278.5L200 264C200 197.7 253.7 144 320 144C386.3 144 440 197.7 440 264L440 278.5C440 324.7 452.3 370 475.5 409.9L488.4 432zM252.1 528C262 556 288.7 576 320 576C351.3 576 378 556 387.9 528L252.1 528z" />
            </svg></span>
          <span class="meta-icon silent"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><svg
                fill="currentColor" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
                <path
                  d="M73 39.1C63.6 29.7 48.4 29.7 39.1 39.1C29.8 48.5 29.7 63.7 39 73.1L567 601.1C576.4 610.5 591.6 610.5 600.9 601.1C610.2 591.7 610.3 576.5 600.9 567.2L513.1 479.4C530.6 476.1 543.9 460.7 543.9 442.3C543.9 435.6 542.1 429 538.8 423.3L517 385.7C498 353.1 488 316.1 488 278.4L488 263.9C488 179.3 425.4 109.2 344 97.6L344 87.9C344 74.6 333.3 63.9 320 63.9C306.7 63.9 296 74.6 296 87.9L296 97.6C253.8 103.6 216.6 125.4 190.6 156.7L73 39.1zM224.8 190.9C246.7 162.4 281.2 144 320 144C386.3 144 440 197.7 440 264L440 278.5C440 324.7 452.3 370 475.5 409.9L488.4 432L465.8 432L224.7 190.9zM164.5 409.9C184 376.5 195.8 339.2 199.1 300.9L152.4 254.2C152.2 257.5 152.1 260.8 152.1 264.1L152.1 278.6C152.1 316.3 142.1 353.3 123.1 385.9L101.1 423.2C97.7 429 96 435.5 96 442.2C96 463.1 112.9 480 133.8 480L378.2 480L330.2 432L151.6 432L164.5 409.9zM252.1 528C262 556 288.7 576 320 576C351.3 576 378 556 387.9 528L252.1 528z" />
              </svg></span>
        </span>
        <span class="meta-icon clock"></span>
        <span class="meta-time disabled" data-world-time="">00:00:00</span>
        {{#if (ne system.nuyen undefined)}}
        <span class="meta-nuyen"><span class="value">125,840</span>¥</span>
        {{/if}}
      </div>
  
      <div class="portrait-panel{{#if system.isDead}} dead{{/if}}">
        <div class="track-delta disabled">{{#if system.isDead}}{{localize 'SR6.label.RIP'}}{{/if}}</div>
        <div class="portrait-wrap">
          <div class="portrait">
            <div class="portrait-edit"><i class="fa-solid fa-image fa-fw"></i></div>
            {{#if editMode}}
            {{/if}}
            <img
              class='profile-img'
              src='{{actor.img}}'
              {{#if editMode}}
              data-edit='img'
              data-action='onEditImage'
              title='{{localize 'SR6.title.editImage'}}'
              {{else}}
              data-action='onShowImage'
              title='{{localize 'SR6.title.showImage'}}'
              {{/if}}
            />
          </div>
        </div>
      </div>
  
      <div class="status-panel{{#if (not editable)}} inactive{{/if}}">
        <div class="status-panel-header">
          <div class="status-panel-header-left">
            <div class="designation-name">      
              {{#if editMode}}
              {{formInput fields.name value=actor.name placeholder=fields.name.label}}
              {{else}}
              {{span actor.name fields.name}}
              {{/if}}
            </div>
  
            <div class="traits">
              <div>
                <label for="system.level">{{localize systemFields.level.label}}:</label>
                {{#if editMode}}
                {{formInput systemFields.level value=source.level}}
                {{else}}
                {{span system.level systemFields.level}}
                {{/if}}
              </div>
              <div>
                <label for="system.type">{{localize systemFields.type.label}}:</label>
                {{#if editMode}}
                {{formInput systemFields.type value=source.type localize=true}}
                {{else}}
                {{span system.type systemFields.type}}
                {{/if}}
              </div>
            </div>
          </div>
  
          <div class="status-panel-header-right">
            {{#if tracks.matrix}}
            <div class="hud-overwatch" style="--overwatch-color: var(--hud-color-bright); --os-color: var(--accent);" data-action="onClickOS">
              <span class="overwatch-side overwatch-side-left disabled" title="{{localize 'SR6.title.decreaseOS'}}" data-os-control="decrease">
                <svg viewBox="0 0 12 24">
                  <path d="M9 4 L3 12 L9 20" fill="none" stroke="currentColor" stroke-width="5" stroke-linecap="round" stroke-linejoin="round" />
                </svg>
              </span>
              <span class="overwatch-eye" title="{{localize 'SR6.title.showOS'}}" data-os-control="show">
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">
                  <path fill="currentColor" d="M320 96C239.2 96 174.5 132.8 127.4 176.6C80.6 220.1 49.3 272 34.4 307.7C31.1 315.6 31.1 324.4 34.4 332.3C49.3 368 80.6 420 127.4 463.4C174.5 507.1 239.2 544 320 544C400.8 544 465.5 507.2 512.6 463.4C559.4 419.9 590.7 368 605.6 332.3C608.9 324.4 608.9 315.6 605.6 307.7C590.7 272 559.4 220 512.6 176.6C465.5 132.9 400.8 96 320 96zM176 320C176 240.5 240.5 176 320 176C399.5 176 464 240.5 464 320C464 399.5 399.5 464 320 464C240.5 464 176 399.5 176 320zM320 256C320 291.3 291.3 320 256 320C244.5 320 233.7 317 224.3 311.6C223.3 322.5 224.2 333.7 227.2 344.8C240.9 396 293.6 426.4 344.8 412.7C396 399 426.4 346.3 412.7 295.1C400.5 249.4 357.2 220.3 311.6 224.3C316.9 233.6 320 244.4 320 256z" />
                </svg>
              </span>
              <span class="overwatch-side overwatch-side-right disabled" title="{{localize 'SR6.title.increaseOS'}}" data-os-control="increase">
                <svg viewBox="0 0 12 24">
                  <path d="M3 4 L9 12 L3 20" fill="none" stroke="currentColor" stroke-width="5" stroke-linecap="round" stroke-linejoin="round" />
                </svg>
              </span>
              <div class="overwatch-score disabled">{{system.matrix.overwatchScore}}</div>
            </div>
            {{/if}}
          </div>

        </div>
  
        <div class="tracks">
          {{#iff system.health.overflow.dmg '>' 0}}
          
          <div class="track red overflow{{#if system.isDead}} dead{{/if}}"
               data-condition-monitor="overflow"
               data-action="onTrackClick"
               {{#if (and system.isDead (not isGM))}}title="{{localize 'SR6.title.onlyGmCanRevive'}}"{{/if}}
          >
            <div class="slots{{#if (and system.isDead (not isGM))}} inactive{{/if}}">
              {{#each tracks.overflow}}
                <div class="slot{{#if active}} active{{/if}}" style="height: 24px; --slot-index: {{@index}};">
                  {{#if active}}
                  <div class="heart-rate">
                    <svg version="1.0" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 150 73" preserveAspectRatio="xMidYMid meet">
                      <polyline fill="none" stroke="#009B9E" stroke-width="3" stroke-miterlimit="10" points="0,45.486 38.514,45.486 44.595,33.324 50.676,45.486 57.771,45.486 62.838,55.622 71.959,9 80.067,63.729 84.122,45.486 97.297,45.486 103.379,40.419 110.473,45.486 150,45.486" />
                    </svg>
                    <div class="fade-in"></div>
                    <div class="fade-out"></div>
                  </div>
                  {{/if}}
                  <i class="fa-solid {{#if (or first @root.system.isDead)}}fa-skull{{else}}{{#if last}}fa-heart{{/if}}{{/if}}"></i>
                </div>
              {{/each}}
            </div>
            <div class="track-value{{#if (and system.isDead (not isGM))}} inactive{{/if}}" title="{{localize 'SR6.title.CM.phys.dmg'}}" data-action="selectInputText">
              {{localize 'SR6.label.CM.phys.short'}}:
              <input type="text" name="system.health.physicalCM.dmg" value="{{system.health.physicalCM.dmg}}">
            </div>
          </div>

          {{else}}

          {{#if tracks.physical}}
          <div class="track red {{#if (not editable)}}inactive{{/if}}" data-condition-monitor="physical" data-action="onTrackClick">
            <div class="slots">
              {{#each tracks.physical}}
                <div class="slot{{#if active}} active{{/if}}" style="--slot-index: {{@index}};">
                  {{#if penalty}}<span>{{penalty}}</span>{{/if}}
                </div>
              {{/each}}
            </div>
            <div class="track-value" title="{{localize 'SR6.title.CM.phys.dmg'}}" data-action="selectInputText">
              {{localize 'SR6.label.CM.phys.short'}}:
              <input type="text" name="system.health.physicalCM.dmg" value="{{system.health.physicalCM.dmg}}">
            </div>
          </div>
          {{/if}}
  
          {{#if tracks.stun}}
          <div class="track blue" data-condition-monitor="stun" data-action="onTrackClick">
            <div class="slots">
              {{#each tracks.stun}}
                <div class="slot{{#if active}} active{{/if}}" style="--slot-index: {{@index}};">
                  {{#if penalty}}<span>{{penalty}}</span>{{/if}}
                </div>
              {{/each}}
            </div>
            <div class="track-value" title="{{localize 'SR6.title.CM.stun.dmg'}}" data-action="selectInputText">
              {{localize 'SR6.label.CM.stun.short'}}:
              <input type="text" name="system.health.stunCM.dmg" value="{{system.health.stunCM.dmg}}">
            </div>
          </div>
          {{/if}}

          {{/iff}}
  
          {{#if tracks.matrix}}
          <div class="track green" data-condition-monitor="matrix" data-action="onTrackClick">
            <div class="slots">
              {{#each tracks.matrix}}
                <div class="slot{{#if active}} active{{/if}}" style="--slot-index: {{@index}};">
                  {{#if penalty}}<span>{{penalty}}</span>{{/if}}
                </div>
              {{/each}}
            </div>
            <div class="track-value" title="{{localize 'SR6.title.CM.matrix.dmg'}}" data-action="selectInputText">
              {{localize 'SR6.label.CM.matrix.short'}}:
              <input type="text" name="system.matrix.matrixCM.dmg" value="{{system.matrix.matrixCM.dmg}}">
            </div>
          </div>
          {{/if}}
          
        </div>
      </div>
  
    </section>
  </div>
  {{> "systems/shadowrun-de/templates/sheets/actor/edge-token.hbs"}}
</header>