import{f as e,p as t}from"./lit-runtime-DA0-mbwP.js";import{o as n}from"./string-coerce-kcFITeCw.js";import{A as r,C as i,D as a,E as o,I as s,O as c,S as l,T as u,_ as d,b as f,k as p,v as m,w as h,x as g,y as _}from"./index-x7xgmgRf.js";var v=5,y=v*v-1,b=new Set([6,8,12,16,18]),x=[{id:`bugfix`,title:`Fix: `,notes:`Symptom:
Cause:
Acceptance:
Proof:`,labels:`fix, test`,priority:`high`},{id:`docs`,title:`Docs: `,notes:`Page:
Change:
Source proof:`,labels:`docs`,priority:`normal`},{id:`release`,title:`Release: `,notes:`Scope:
Verification:
Closeout:`,labels:`release`,priority:`urgent`},{id:`pr_review`,title:`Review PR `,notes:`Surface:
Risks:
Proof:`,labels:`review`,priority:`normal`},{id:`plugin`,title:`Plugin: `,notes:`Boundary:
Config/docs:
Tests:`,labels:`plugin`,priority:`normal`}];function S(e){return n(`workboard.status.${e}`)}function C(e){return e?s(e,{month:`short`,day:`numeric`},``):``}function w(e){return e.canWrite!==!1}function T(e){switch(e.kind){case`created`:return n(`workboard.eventCreated`);case`edited`:return n(`workboard.eventEdited`);case`moved`:return e.toStatus?n(`workboard.eventMovedTo`,{status:S(e.toStatus)}):n(`workboard.eventMoved`);case`linked`:return n(`workboard.eventLinked`);case`specified`:return n(`workboard.eventSpecified`);case`decomposed`:return n(`workboard.eventDecomposed`);case`claimed`:return n(`workboard.eventClaimed`);case`heartbeat`:return n(`workboard.eventHeartbeat`);case`execution_updated`:return n(`workboard.eventExecutionUpdated`);case`attempt_started`:return n(`workboard.eventAttemptStarted`);case`attempt_updated`:return n(`workboard.eventAttemptUpdated`);case`comment_added`:return n(`workboard.eventCommentAdded`);case`link_added`:return n(`workboard.eventLinkAdded`);case`proof_added`:return n(`workboard.eventProofAdded`);case`artifact_added`:return n(`workboard.eventArtifactAdded`);case`attachment_added`:return n(`workboard.eventAttachmentAdded`);case`diagnostic`:return n(`workboard.eventDiagnostic`);case`notification`:return n(`workboard.eventNotification`);case`dispatch`:return n(`workboard.eventDispatch`);case`orchestration`:return n(`workboard.eventOrchestration`);case`protocol_violation`:return n(`workboard.eventProtocolViolation`);case`archived`:return n(`workboard.eventArchived`);case`unarchived`:return n(`workboard.eventUnarchived`);case`stale`:return n(`workboard.eventStale`)}return``}function E(r){let i=(r.events??[]).toReversed().slice(0,4);return i.length===0?e:t`
    <ol class="workboard-events" aria-label=${n(`workboard.eventsLabel`)}>
      ${i.map(e=>t`
          <li>
            <span>${T(e)}</span>
            <time>${C(e.at)}</time>
          </li>
        `)}
    </ol>
  `}function D(r){let i=r.metadata;if(!i)return e;let a=[i.templateId?n(`workboard.template.${i.templateId}`):null,i.attempts?.length?n(`workboard.badgeAttempts`,{count:String(i.attempts.length)}):null,i.failureCount?n(`workboard.badgeFailures`,{count:String(i.failureCount)}):null,i.comments?.length?n(`workboard.badgeComments`,{count:String(i.comments.length)}):null,i.links?.length?n(`workboard.badgeLinks`,{count:String(i.links.length)}):null,i.proof?.length?n(`workboard.badgeProof`,{count:String(i.proof.length)}):null,i.artifacts?.length?n(`workboard.badgeArtifacts`,{count:String(i.artifacts.length)}):null,i.attachments?.length?n(`workboard.badgeAttachments`,{count:String(i.attachments.length)}):null,i.workerLogs?.length?n(`workboard.badgeWorkerLogs`,{count:String(i.workerLogs.length)}):null,i.workerProtocol?.state?n(`workboard.badgeWorkerProtocol`,{state:i.workerProtocol.state}):null,i.automation?.tenant?n(`workboard.badgeTenant`,{tenant:i.automation.tenant}):null,i.automation?.skills?.length?n(`workboard.badgeSkills`,{count:String(i.automation.skills.length)}):null,i.automation?.dispatchCount?n(`workboard.badgeDispatches`,{count:String(i.automation.dispatchCount)}):null,i.claim?n(`workboard.badgeClaimed`,{owner:i.claim.ownerId}):null,i.diagnostics?.length?n(`workboard.badgeDiagnostics`,{count:String(i.diagnostics.length)}):null,i.stale?n(`workboard.badgeStale`):null].filter(e=>!!e);return a.length===0?e:t`
    <div class="workboard-card__badges">${a.map(e=>t`<span>${e}</span>`)}</div>
  `}function O(e,t){if(t.priority!==`all`&&e.priority!==t.priority)return!1;let n=t.query.trim().toLowerCase();return n?[e.title,e.notes,e.agentId,e.sessionKey,e.execution?.engine,e.execution?.mode,e.execution?.model,e.execution?.sessionKey,e.metadata?.templateId,e.metadata?.automation?.tenant,e.metadata?.automation?.idempotencyKey,e.metadata?.automation?.workspace?.kind,e.metadata?.automation?.workspace?.path,e.metadata?.automation?.workspace?.branch,...e.metadata?.automation?.skills??[],...e.metadata?.automation?.createdCardIds??[],...(e.metadata?.comments??[]).map(e=>e.body),...(e.metadata?.links??[]).flatMap(e=>[e.title,e.url,e.targetCardId]),...(e.metadata?.proof??[]).flatMap(e=>[e.label,e.command,e.url,e.note]),...(e.metadata?.artifacts??[]).flatMap(e=>[e.label,e.url,e.path,e.mimeType]),...(e.metadata?.attachments??[]).flatMap(e=>[e.fileName,e.mimeType,e.note]),...(e.metadata?.workerLogs??[]).map(e=>e.message),e.metadata?.workerProtocol?.state,e.metadata?.workerProtocol?.detail,e.metadata?.claim?.ownerId,...(e.metadata?.diagnostics??[]).flatMap(e=>[e.kind,e.severity,e.title,e.detail]),...(e.metadata?.notifications??[]).map(e=>e.message),...e.labels].filter(e=>typeof e==`string`).some(e=>e.toLowerCase().includes(n)):!0}function k(e,t){let n=e.filter(e=>e.status===t).map(e=>e.position);return(n.length?Math.max(...n):0)+1e3}function A(e){if(e.archived||e.kind===`global`)return!1;let t=[e.key,e.label,e.displayName].filter(e=>typeof e==`string`).join(`:`).toLowerCase();return!/(^|:)heartbeat(:|$)/.test(t)}function j(e){return e.target instanceof Element?!!e.target.closest(`button, a, input, select, textarea`):!1}function M(e,t){let n=t.sessionKey??t.execution?.sessionKey;return n?(e.onOpenSession(n),!0):!1}function N(e){e.draftOpen=!1,e.editingCardId=null,e.draftTitle=``,e.draftNotes=``,e.draftStatus=`todo`,e.draftPriority=`normal`,e.draftLabels=``,e.draftAgentId=``,e.draftSessionKey=``,e.draftTemplateId=``}function P(e){N(e),e.draftOpen=!0}function F(e){e.gamePlayerIndex=0,e.gameMoves=0,e.gameMessage=`workboard.gameStart`}function I(e,t){e.gamePlayerIndex===y&&F(e);let n=Math.floor(e.gamePlayerIndex/v),r=e.gamePlayerIndex+t,i=Math.floor(r/v);if(r<0||r>y||t===-1&&i!==n||t===1&&i!==n){e.gameMessage=`workboard.gameBoundary`;return}if(b.has(r)){e.gameMessage=`workboard.gameBlocked`;return}e.gamePlayerIndex=r,e.gameMoves+=1,e.gameMessage=r===y?`workboard.gameWin`:`workboard.gameContinue`,r===y&&(e.gameWins+=1)}function L(e,t){e.draftOpen=!0,e.editingCardId=t.id,e.draftTitle=t.title,e.draftNotes=t.notes??``,e.draftStatus=t.status,e.draftPriority=t.priority,e.draftLabels=t.labels.join(`, `),e.draftAgentId=t.agentId??``,e.draftSessionKey=t.sessionKey??``,e.draftTemplateId=t.metadata?.templateId??``}function R(e,t){let n=x.find(e=>e.id===t);n&&(e.draftTemplateId=n.id,e.draftTitle=n.title,e.draftNotes=n.notes,e.draftLabels=n.labels,e.draftPriority=n.priority)}function z(e,n,r,i){let a=h(i.host);return t`
    <button
      class="btn btn--icon workboard-game__arrow ${n}"
      type="button"
      title=${e}
      aria-label=${e}
      @click=${()=>{I(a,r),i.onRequestUpdate?.()}}
    >
      ${d.arrowDown}
    </button>
  `}function B(r){let i=h(r.host);return i.gameOpen?t`
    <div
      class="workboard-modal"
      role="presentation"
      @click=${e=>{e.target===e.currentTarget&&(i.gameOpen=!1,r.onRequestUpdate?.())}}
    >
      <div
        class="workboard-game"
        role="dialog"
        aria-modal="true"
        aria-labelledby="workboard-game-title"
        tabindex="0"
        @keydown=${e=>{let t={ArrowDown:v,ArrowLeft:-1,ArrowRight:1,ArrowUp:-5}[e.key];typeof t==`number`&&(e.preventDefault(),I(i,t),r.onRequestUpdate?.())}}
      >
        <div class="workboard-modal__header">
          <div>
            <h2 id="workboard-game-title">${n(`workboard.gameTitle`)}</h2>
            <p>${n(i.gameMessage)}</p>
          </div>
          <button
            class="btn btn--icon workboard-card__icon"
            type="button"
            title=${n(`common.cancel`)}
            @click=${()=>{i.gameOpen=!1,r.onRequestUpdate?.()}}
          >
            ${d.x}
          </button>
        </div>
        <div class="workboard-game__stats">
          <span>${n(`workboard.gameMoves`,{count:String(i.gameMoves)})}</span>
          <span>${n(`workboard.gameWins`,{count:String(i.gameWins)})}</span>
        </div>
        <div class="workboard-game__grid" role="grid" aria-label=${n(`workboard.gameBoard`)}>
          ${Array.from({length:v*v},(e,r)=>{let a=r===i.gamePlayerIndex,o=r===y,s=b.has(r);return t`
              <div
                class="workboard-game__cell ${a?`workboard-game__cell--player`:``} ${o?`workboard-game__cell--goal`:``} ${s?`workboard-game__cell--blocker`:``}"
                role="gridcell"
                aria-label=${n(a?`workboard.gameAgent`:o?`workboard.gameLaunch`:s?`workboard.gameBlockedCell`:`workboard.gameOpenCell`)}
              >
                ${a?`A`:o?`L`:``}
              </div>
            `})}
        </div>
        <div class="workboard-game__controls" aria-label=${n(`workboard.gameControls`)}>
          ${z(n(`workboard.gameMoveUp`),`workboard-game__arrow--up`,-5,r)}
          ${z(n(`workboard.gameMoveLeft`),`workboard-game__arrow--left`,-1,r)}
          ${z(n(`workboard.gameMoveDown`),``,v,r)}
          ${z(n(`workboard.gameMoveRight`),`workboard-game__arrow--right`,1,r)}
        </div>
        <div class="workboard-modal__actions">
          <button
            class="btn"
            type="button"
            @click=${()=>{F(i),r.onRequestUpdate?.()}}
          >
            ${n(`common.reset`)}
          </button>
        </div>
      </div>
    </div>
  `:e}function V(r){let i=h(r.host),o=r.agentsList?.agents??[],s=r.sessions.filter(A);if(!i.draftOpen)return e;let c=!!i.editingCardId;return t`
    <div
      class="workboard-modal"
      role="presentation"
      @click=${e=>{e.target===e.currentTarget&&(N(i),r.onRequestUpdate?.())}}
    >
      <form
        class="workboard-draft"
        role="dialog"
        aria-modal="true"
        aria-labelledby="workboard-card-modal-title"
        @submit=${e=>{e.preventDefault(),a({host:r.host,client:r.client,requestUpdate:r.onRequestUpdate})}}
      >
        <div class="workboard-modal__header">
          <div>
            <h2 id="workboard-card-modal-title">
              ${n(c?`workboard.editCard`:`workboard.newCard`)}
            </h2>
            <p>${n(c?`workboard.editCardHelp`:`workboard.newCardHelp`)}</p>
          </div>
          <button
            class="btn btn--icon workboard-card__icon"
            type="button"
            title=${n(`common.cancel`)}
            @click=${()=>{N(i),r.onRequestUpdate?.()}}
          >
            ${d.x}
          </button>
        </div>
        ${c?e:t`
              <div class="workboard-template-strip" aria-label=${n(`workboard.templatesLabel`)}>
                ${x.map(e=>t`
                    <button
                      class="btn btn--xs ${i.draftTemplateId===e.id?`workboard-template-strip__button--active`:``}"
                      type="button"
                      @click=${()=>{R(i,e.id),r.onRequestUpdate?.()}}
                    >
                      ${n(`workboard.template.${e.id}`)}
                    </button>
                  `)}
              </div>
            `}
        <div class="workboard-draft__main">
          <label class="workboard-field">
            <span>${n(`workboard.fieldTitle`)}</span>
            <input
              class="input workboard-draft__title"
              placeholder=${n(`workboard.titlePlaceholder`)}
              .value=${i.draftTitle}
              @input=${e=>{i.draftTitle=e.currentTarget.value,r.onRequestUpdate?.()}}
            />
          </label>
          <label class="workboard-field">
            <span>${n(`workboard.fieldNotes`)}</span>
            <textarea
              class="input workboard-draft__notes"
              placeholder=${n(`workboard.notesPlaceholder`)}
              .value=${i.draftNotes}
              @input=${e=>{i.draftNotes=e.currentTarget.value,r.onRequestUpdate?.()}}
            ></textarea>
          </label>
        </div>
        <div class="workboard-draft__meta">
          <label class="workboard-field">
            <span>${n(`workboard.fieldStatus`)}</span>
            <select
              class="input"
              .value=${i.draftStatus}
              @change=${e=>{i.draftStatus=e.currentTarget.value,r.onRequestUpdate?.()}}
            >
              ${i.statuses.map(e=>t`<option value=${e}>${S(e)}</option>`)}
            </select>
          </label>
          <label class="workboard-field">
            <span>${n(`workboard.fieldPriority`)}</span>
            <select
              class="input"
              .value=${i.draftPriority}
              @change=${e=>{i.draftPriority=e.currentTarget.value,r.onRequestUpdate?.()}}
            >
              ${m.map(e=>t`<option value=${e}>${e}</option>`)}
            </select>
          </label>
          <label class="workboard-field">
            <span>${n(`workboard.fieldAgent`)}</span>
            <select
              class="input"
              .value=${i.draftAgentId}
              @change=${e=>{i.draftAgentId=e.currentTarget.value,r.onRequestUpdate?.()}}
            >
              <option value="">${n(`workboard.defaultAgent`)}</option>
              ${o.map(e=>t`<option value=${e.id}>
                    ${e.name??e.identity?.name??e.id}
                  </option>`)}
            </select>
          </label>
          <label class="workboard-field">
            <span>${n(`workboard.fieldSession`)}</span>
            <select
              class="input"
              .value=${i.draftSessionKey}
              @change=${e=>{i.draftSessionKey=e.currentTarget.value,r.onRequestUpdate?.()}}
            >
              <option value="">${n(`workboard.noLinkedSession`)}</option>
              ${s.map(e=>t`<option value=${e.key}>
                    ${e.displayName??e.label??e.key}
                  </option>`)}
            </select>
          </label>
          <label class="workboard-field workboard-field--wide">
            <span>${n(`workboard.fieldLabels`)}</span>
            <input
              class="input"
              placeholder=${n(`workboard.labelsPlaceholder`)}
              .value=${i.draftLabels}
              @input=${e=>{i.draftLabels=e.currentTarget.value,r.onRequestUpdate?.()}}
            />
          </label>
        </div>
        <div class="workboard-modal__actions">
          <button class="btn primary" ?disabled=${i.loading||!i.draftTitle.trim()}>
            ${n(c?`common.save`:`common.create`)}
          </button>
          <button
            class="btn"
            type="button"
            @click=${()=>{N(i),r.onRequestUpdate?.()}}
          >
            ${n(`common.cancel`)}
          </button>
        </div>
      </form>
    </div>
  `}function H(e){switch(e.state){case`running`:return{label:n(`workboard.lifecycleRunning`),detail:n(`workboard.lifecycleRunningDetail`),tone:`live`};case`succeeded`:return{label:n(`workboard.lifecycleDone`),detail:n(`workboard.lifecycleDoneDetail`),tone:`done`};case`failed`:return{label:n(`workboard.lifecycleNeedsReview`),detail:n(`workboard.lifecycleNeedsReviewDetail`),tone:`blocked`};case`stale`:return{label:n(`workboard.lifecycleStale`),detail:n(`workboard.lifecycleStaleDetail`),tone:`blocked`};case`idle`:return{label:n(`workboard.lifecycleLinked`),detail:n(`workboard.lifecycleIdleDetail`),tone:`idle`};case`missing`:return{label:n(`workboard.lifecycleMissing`),detail:n(`workboard.lifecycleMissingDetail`),tone:`blocked`};case`unlinked`:return{label:n(`workboard.lifecycleUnlinked`),detail:n(`workboard.lifecycleUnlinkedDetail`),tone:`idle`}}throw Error(`Unknown workboard lifecycle state.`)}function U(e,n){let r=i(e,n),a=H(r),o=r.session,s=e.execution,c=r.state===`stale`;return t`
    <div class="workboard-card__lifecycle">
      <span class="workboard-lifecycle workboard-lifecycle--${a.tone}">
        ${c||!s?a.label:`${s.engine} ${s.mode}`}
      </span>
      <span class="workboard-card__lifecycle-detail">
        ${c?a.detail:o?.displayName??o?.label??a.detail}
      </span>
    </div>
  `}function W(e,r,i,a){let o=h(e.host).busyCardId===r.id,s=i?n(a===`autonomous`?`workboard.runEngine`:`workboard.openEngine`,{engine:i}):n(`workboard.runDefaultAgent`);return t`
    <button
      class="btn btn--xs workboard-card__start workboard-card__start--${a} ${i?``:`workboard-card__start--default`}"
      title=${s}
      ?disabled=${o||!e.connected}
      @click=${async()=>{let t=await c({host:e.host,client:e.client,card:r,...i?{engine:i}:{},mode:a,requestUpdate:e.onRequestUpdate});t&&e.onOpenSession(t)}}
    >
      ${a===`autonomous`?d.play:d.penLine} ${i??n(`workboard.start`)}
    </button>
  `}function G(e,n){return t`
    <div class="workboard-card__execution-controls">
      ${W(e,n,null,`autonomous`)}
      ${W(e,n,`codex`,`autonomous`)}
      ${W(e,n,`claude`,`autonomous`)}
      ${W(e,n,`codex`,`manual`)}
      ${W(e,n,`claude`,`manual`)}
    </div>
  `}function K(r,i){let a=h(r.host),o=l(i,r.sessions),s=a.busyCardId===i.id,c=a.syncingCardIds.has(i.id),u=o?.hasActiveRun===!0||o?.hasActiveRun!==!1&&o?.status===`running`,m=i.sessionKey??i.execution?.sessionKey,g=!!m,v=w(r),y=v&&(!g||!o);return t`
    <article
      class="workboard-card priority-${i.priority} ${s?`workboard-card--busy`:``} ${g?`workboard-card--openable`:``}"
      role=${g?`button`:e}
      tabindex=${g?0:e}
      title=${g?n(`workboard.openLinkedSession`):e}
      draggable=${v?`true`:`false`}
      @click=${e=>{j(e)||M(r,i)}}
      @keydown=${e=>{j(e)||e.key!==`Enter`&&e.key!==` `||M(r,i)&&e.preventDefault()}}
      @dragstart=${e=>{if(!v){e.preventDefault();return}a.draggedCardId=i.id,e.dataTransfer?.setData(`text/plain`,i.id),e.dataTransfer?.setDragImage(e.currentTarget,16,16),r.onRequestUpdate?.()}}
      @dragend=${()=>{a.draggedCardId=null,r.onRequestUpdate?.()}}
    >
      <div class="workboard-card__top">
        <span class="workboard-card__priority">${i.priority}</span>
        ${u?t`<span class="workboard-live">${n(`workboard.live`)}</span>`:e}
        ${c?t`<span class="workboard-live">${n(`common.saving`)}</span>`:e}
      </div>
      <h3>${i.title}</h3>
      ${i.notes?t`<p>${i.notes}</p>`:e} ${U(i,r.sessions)}
      ${i.labels.length?t`<div class="workboard-labels">
            ${i.labels.map(e=>t`<span>${e}</span>`)}
          </div>`:e}
      ${D(i)}
      <div class="workboard-card__meta">
        ${i.agentId?t`<span>${i.agentId}</span>`:t`<span>${n(`workboard.defaultAgent`)}</span>`}
        <span>${C(i.updatedAt)}</span>
      </div>
      ${E(i)}
      <div class="workboard-card__actions">
        ${v?t`
              <button
                class="btn btn--icon workboard-card__icon"
                title=${n(`workboard.editCard`)}
                @click=${()=>{L(a,i),r.onRequestUpdate?.()}}
              >
                ${d.edit}
              </button>
            `:e}
        ${g?t`
              <button
                class="btn btn--icon workboard-card__icon"
                title=${n(`workboard.openSession`)}
                @click=${()=>r.onOpenSession(m)}
              >
                ${d.messageSquare}
              </button>
              ${v&&u?t`
                    <button
                      class="btn btn--icon workboard-card__icon"
                      title=${n(`workboard.stopSession`)}
                      ?disabled=${s||!r.connected}
                      @click=${()=>p({host:r.host,client:r.client,card:i,requestUpdate:r.onRequestUpdate})}
                    >
                      ${d.stop}
                    </button>
                  `:e}
            `:e}
        ${y?G(r,i):e}
        ${v?t`
              <button
                class="btn btn--icon workboard-card__icon"
                title=${n(`workboard.archiveCard`)}
                ?disabled=${s}
                @click=${()=>_({host:r.host,client:r.client,cardId:i.id,requestUpdate:r.onRequestUpdate})}
              >
                ${d.check}
              </button>
              <button
                class="btn btn--icon workboard-card__icon workboard-card__delete"
                title=${n(`workboard.deleteCard`)}
                ?disabled=${s}
                @click=${()=>f({host:r.host,client:r.client,cardId:i.id,requestUpdate:r.onRequestUpdate})}
              >
                ${d.trash}
              </button>
            `:e}
      </div>
    </article>
  `}function q(e,r,i){let a=h(e.host),s=w(e);return t`
    <section
      class="workboard-column ${a.draggedCardId?`workboard-column--drop`:``}"
      @dragover=${e=>{s&&a.draggedCardId&&e.preventDefault()}}
      @drop=${t=>{if(t.preventDefault(),!s)return;let n=t.dataTransfer?.getData(`text/plain`)||a.draggedCardId;n&&o({host:e.host,client:e.client,cardId:n,status:r,position:k(a.cards,r),requestUpdate:e.onRequestUpdate})}}
    >
      <div class="workboard-column__header">
        <h2>${S(r)}</h2>
        <span>${i.length}</span>
      </div>
      <div class="workboard-column__cards">
        ${i.length?i.map(t=>K(e,t)):t`<div class="workboard-empty">${n(`workboard.emptyColumn`)}</div>`}
      </div>
    </section>
  `}function J(i){let a=h(i.host);if(i.pluginEnabled&&(u({host:i.host,client:i.client,requestUpdate:i.onRequestUpdate}),r({host:i.host,client:i.client,sessions:i.sessions,canWrite:i.canWrite,requestUpdate:i.onRequestUpdate})),!i.pluginEnabled)return t`
      <section class="workboard">
        <div class="callout">
          ${n(`workboard.disabledHelpStart`)}
          <code>${n(`workboard.enableConfigKey`)}</code>${n(`workboard.disabledHelpEnd`)}
        </div>
      </section>
    `;let o=a.cards.filter(e=>!e.metadata?.archivedAt).filter(e=>O(e,{query:a.query,priority:a.priorityFilter})),s=w(i),c=new Map;for(let e of a.statuses)c.set(e,[]);for(let e of o)c.get(e.status)?.push(e);return t`
    <section class="workboard">
      <div class="workboard-toolbar">
        <div class="workboard-toolbar__filters">
          <input
            class="input"
            type="search"
            placeholder=${n(`workboard.searchPlaceholder`)}
            .value=${a.query}
            @input=${e=>{a.query=e.currentTarget.value,i.onRequestUpdate?.()}}
          />
          <select
            class="input"
            .value=${a.priorityFilter}
            @change=${e=>{a.priorityFilter=e.currentTarget.value,i.onRequestUpdate?.()}}
          >
            <option value="all">${n(`workboard.allPriorities`)}</option>
            ${m.map(e=>t`<option value=${e}>${e}</option>`)}
          </select>
        </div>
        <div class="workboard-toolbar__actions">
          <button
            class="btn"
            ?disabled=${a.loading}
            @click=${()=>u({host:i.host,client:i.client,requestUpdate:i.onRequestUpdate,force:!0})}
          >
            ${a.loading?n(`common.refreshing`):n(`common.refresh`)}
          </button>
          ${s?t`
                <button
                  class="btn"
                  ?disabled=${a.loading}
                  @click=${()=>g({host:i.host,client:i.client,requestUpdate:i.onRequestUpdate})}
                >
                  ${d.zap} ${n(`workboard.dispatch`)}
                </button>
              `:e}
          <button
            class="btn"
            @click=${()=>{a.gameOpen=!0,i.onRequestUpdate?.()}}
          >
            ${d.play} ${n(`workboard.gameButton`)}
          </button>
          ${s?t`
                <button
                  class="btn primary"
                  @click=${()=>{P(a),i.onRequestUpdate?.()}}
                >
                  ${d.plus} ${n(`workboard.newCard`)}
                </button>
              `:e}
        </div>
      </div>
      ${a.error?t`<div class="callout danger">${a.error}</div>`:e}
      ${B(i)} ${V(i)}
      <div class="workboard-board">
        ${a.statuses.map(e=>q(i,e,c.get(e)??[]))}
      </div>
    </section>
  `}export{J as renderWorkboard};
//# sourceMappingURL=workboard-82FPi8BV.js.map