sliccy 6.96.4 → 6.96.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/node-server/bridge-security.js +6 -0
- package/dist/node-server/fetch-proxy-headers.d.ts +18 -2
- package/dist/node-server/fetch-proxy-headers.js +39 -4
- package/dist/node-server/routes/fetch-proxy.js +12 -1
- package/dist/ui/.vite/manifest.json +132 -132
- package/dist/ui/assets/SKILL-BCDMrL-b.js +1 -0
- package/dist/ui/assets/{account-store-CCKUJ4ge.js → account-store-DRj2SDg8.js} +1 -1
- package/dist/ui/assets/{account-store-DNHiaFJE.js → account-store-f_5Y3loE.js} +1 -1
- package/dist/ui/assets/{adobe-ChIBeQy8.js → adobe-BaKxV1Cm.js} +1 -1
- package/dist/ui/assets/{adobe-D9gzgSMY.js → adobe-DPqPVXTP.js} +1 -1
- package/dist/ui/assets/{apply-layout-BYNMmQ2A.js → apply-layout-Sl4iOs_f.js} +1 -1
- package/dist/ui/assets/{apps-BTXuGdF5.js → apps-BRfZSCY-.js} +1 -1
- package/dist/ui/assets/{azure-openai-BOCtD00s.js → azure-openai-BDGu5Z5A.js} +1 -1
- package/dist/ui/assets/{azure-openai-D6mfW32f.js → azure-openai-D6hCRHFS.js} +1 -1
- package/dist/ui/assets/{cerebras-9vVsMtpx.js → cerebras-BNuGY5Ld.js} +1 -1
- package/dist/ui/assets/{cerebras-xACPHJt5.js → cerebras-DEmdsUe4.js} +1 -1
- package/dist/ui/assets/{connect-surface-iUF4mFkU.js → connect-surface-C1tEQKLv.js} +1 -1
- package/dist/ui/assets/{fs-p11iQ-3k.js → fs-CfQp9efi.js} +2 -2
- package/dist/ui/assets/{fs-BOhjDrbI.js → fs-ChobgFEy.js} +1 -1
- package/dist/ui/assets/{github-ChJr1NBx.js → github-DUTugm3d.js} +1 -1
- package/dist/ui/assets/{github-copilot-Dz9cMkle.js → github-copilot-C101PYye.js} +1 -1
- package/dist/ui/assets/{github-copilot-CugymeLI.js → github-copilot-iVypX4UI.js} +1 -1
- package/dist/ui/assets/{github-install-Bnv462s_.js → github-install-BrTBTu2h.js} +1 -1
- package/dist/ui/assets/{github-CeKa_YoJ.js → github-n1RJGQHw.js} +2 -2
- package/dist/ui/assets/{github-zip-BmdjNKOq.js → github-zip-Ch3k6-sU.js} +1 -1
- package/dist/ui/assets/{js-realm-worker-BgF1E62V.js → js-realm-worker-CSuRptA4.js} +1 -1
- package/dist/ui/assets/{kernel-worker-BM4k_Mq_.js → kernel-worker-DA5hRJup.js} +30 -30
- package/dist/ui/assets/{local-llm-DWKa_3BZ.js → local-llm-Bp0r9Ihd.js} +1 -1
- package/dist/ui/assets/{local-llm-DP54TeOF.js → local-llm-DV5e3ywb.js} +1 -1
- package/dist/ui/assets/{main-CfMjfj4c.js → main-C6rR0w1B.js} +3 -3
- package/dist/ui/assets/{mount-B7OZ-qqc.js → mount-CApaXxHd.js} +2 -2
- package/dist/ui/assets/{mount-hjgE1SBL.js → mount-DuGV4gCw.js} +1 -1
- package/dist/ui/assets/{mount-recovery-BI-fVIQh.js → mount-recovery-CniXIkTB.js} +1 -1
- package/dist/ui/assets/{new-session-BYOnwOXr.js → new-session-CMaZ3GOC.js} +2 -2
- package/dist/ui/assets/{oauth-bootstrap-BJGdx242.js → oauth-bootstrap-k6EdFR1N.js} +2 -2
- package/dist/ui/assets/{openai-codex-bsR-NUrt.js → openai-codex-DXTTx20O.js} +1 -1
- package/dist/ui/assets/{openai-codex-BmtQpGAy.js → openai-codex-LPnPLUIv.js} +1 -1
- package/dist/ui/assets/{openrouter-BIGJTAft.js → openrouter-CmmwIHPt.js} +1 -1
- package/dist/ui/assets/{openrouter-3jV1AeTR.js → openrouter-DyEZMa_B.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-BifFmgDz.js → openrouter-oauth-C5YDWZza.js} +1 -1
- package/dist/ui/assets/{openrouter-oauth-BjZyQkXX.js → openrouter-oauth-CtAjoPMF.js} +1 -1
- package/dist/ui/assets/{panel-rpc-handlers-DvIejPh8.js → panel-rpc-handlers-D25baSPS.js} +2 -2
- package/dist/ui/assets/{panelize-shell-C2n0OG-k.js → panelize-shell-COz1Z7LB.js} +1 -1
- package/dist/ui/assets/{provider-Dse-s6lF.js → provider-Cy1-3xDc.js} +2 -2
- package/dist/ui/assets/{provider-CAkXxgvX.js → provider-lR4XaVo1.js} +1 -1
- package/dist/ui/assets/{provider-settings-DmMxRhIP.js → provider-settings-B_Av8-kE.js} +1 -1
- package/dist/ui/assets/{provider-settings-CnqPrGj-.js → provider-settings-DvBcrGSB.js} +1 -1
- package/dist/ui/assets/provider-store-access-BYG_vWXq.js +1 -0
- package/dist/ui/assets/{provider-store-access-RCssR_-b.js → provider-store-access-Dm9fer4P.js} +2 -2
- package/dist/ui/assets/{providers-Lvr_kwE3.js → providers-DMRr-d6b.js} +1 -1
- package/dist/ui/assets/{providers-hAtFQPTZ.js → providers-De4bg3HH.js} +2 -2
- package/dist/ui/assets/{quick-llm-BnASRrSi.js → quick-llm-DMWkcwCn.js} +1 -1
- package/dist/ui/assets/{recovery-screen-CMJdkCU-.js → recovery-screen-B33brCeF.js} +1 -1
- package/dist/ui/assets/{redirect-uri-B_tPO0rL.js → redirect-uri-DAG9cXSm.js} +1 -1
- package/dist/ui/assets/{session-freezer-oBR8W8ed.js → session-freezer-BxNDkAZg.js} +3 -3
- package/dist/ui/assets/{setup-feature-flags-remote-Bt8QE81j.js → setup-feature-flags-remote-BGZFr89t.js} +1 -1
- package/dist/ui/assets/{setup-standalone-prelude-MfnCRaqV.js → setup-standalone-prelude-DEhT6zS-.js} +1 -1
- package/dist/ui/assets/{setup-sudo-B17RSZcJ.js → setup-sudo-BD3B0lOG.js} +2 -2
- package/dist/ui/assets/{skills-DH5JJQCz.js → skills-BIpfkJWi.js} +1 -1
- package/dist/ui/assets/slicc-version-Ak3sAJAN.js +1 -0
- package/dist/ui/assets/{src-Bw7lN3n5.js → src-CG9Sp0SZ.js} +80 -76
- package/dist/ui/assets/{store-Bll-_FQw.js → store-Dl7CDFTf.js} +1 -1
- package/dist/ui/assets/{store-Yo1YLTQ2.js → store-pShZ-44M.js} +1 -1
- package/dist/ui/assets/{sudo-Cd1lq7Ra.js → sudo-CQOJDuEr.js} +1 -1
- package/dist/ui/assets/{upgrade-detection-D5v0RaIF.js → upgrade-detection-o_fxk_9R.js} +1 -1
- package/dist/ui/assets/{wc-attach-CtIH1DsM.js → wc-attach-BbEnzTrf.js} +2 -2
- package/dist/ui/assets/{wc-extension-B-i04xyf.js → wc-extension-iLGxpkq2.js} +2 -2
- package/dist/ui/assets/{wc-float-label-Bj-0-MZA.js → wc-float-label-BATxvSb5.js} +1 -1
- package/dist/ui/assets/{wc-floatbar-online-Do-_H9l4.js → wc-floatbar-online-Dogbrrqe.js} +1 -1
- package/dist/ui/assets/{wc-follower-ZYKc5Ngx.js → wc-follower-ouRFKSCy.js} +3 -3
- package/dist/ui/assets/{wc-live-BZ6K2oFF.js → wc-live-ClwxmXsg.js} +4 -4
- package/dist/ui/assets/{wc-nav-Dx9PQgcL.js → wc-nav-Ck57tmuN.js} +2 -2
- package/dist/ui/assets/{wc-onboarding-CMR8g6kB.js → wc-onboarding-CCJ1abTB.js} +2 -2
- package/dist/ui/assets/{wc-placeholder-CSxAzoAY.js → wc-placeholder-Du-3aOoc.js} +2 -2
- package/dist/ui/assets/{wc-settings--E4BUh2C.js → wc-settings-B9elNpIP.js} +2 -2
- package/dist/ui/assets/{wc-shell-BMEagEUk.js → wc-shell-DcossCvn.js} +3 -3
- package/dist/ui/assets/{wc-sprinkles-CgSplLen.js → wc-sprinkles-CGBq_Unu.js} +2 -2
- package/dist/ui/assets/{wc-tray-D7hcyDlz.js → wc-tray-BSghTy-9.js} +2 -2
- package/dist/ui/assets/{xai-grok-CJOfI1UD.js → xai-grok-BqZBRbDW.js} +1 -1
- package/dist/ui/assets/{xai-grok-C3BzCcaL.js → xai-grok-CAWad06z.js} +1 -1
- package/dist/ui/index.html +6 -6
- package/dist/ui/packages/webapp/index.html +6 -6
- package/package.json +1 -1
- package/dist/ui/assets/SKILL-DhKtVqb-.js +0 -1
- package/dist/ui/assets/provider-store-access-BOwZ1eu6.js +0 -1
- package/dist/ui/assets/slicc-version-CUg0SEkq.js +0 -1
|
@@ -694,7 +694,7 @@ slicc-agent-message .dots i:nth-child(3) { animation-delay: .32s; }
|
|
|
694
694
|
@keyframes slicc-am-bdot { 0%, 75%, 100% { transform: translateY(0); opacity: .45; } 38% { transform: translateY(-8px); opacity: 1; } }
|
|
695
695
|
slicc-agent-message .tw-caret { display: inline-block; width: 2px; height: 1.05em; vertical-align: -2px; margin-left: 1px; background: var(--ink); animation: slicc-am-cblink .9s steps(1) infinite; }
|
|
696
696
|
@keyframes slicc-am-cblink { 50% { opacity: 0; } }
|
|
697
|
-
`,Ue=`slicc-agent-message-style`;function We(e){if(e.getElementById(Ue))return;let t=e.createElement(`style`);t.id=Ue,t.textContent=He,(e.head??e.documentElement).appendChild(t)}var Ge=[`#f43f5e`,`#06b6d4`,`#8b5cf6`],Ke=new Set([``,`r`,`cy`,`vi`,`am`]);function qe(){let e=j(`div`,{class:`dots`,part:`dots`,"aria-hidden":`true`});for(let t of Ge)e.append(j(`i`,{style:`--d:${t}`}));return e}function Je(e){let t=j(`ul`,{class:`plan`,part:`plan`});for(let n of e)t.append(j(`li`,null,n));return t}function
|
|
697
|
+
`,Ue=`slicc-agent-message-style`;function We(e){if(e.getElementById(Ue))return;let t=e.createElement(`style`);t.id=Ue,t.textContent=He,(e.head??e.documentElement).appendChild(t)}var Ge=[`#f43f5e`,`#06b6d4`,`#8b5cf6`],Ke=new Set([``,`r`,`cy`,`vi`,`am`]);function qe(){let e=j(`div`,{class:`dots`,part:`dots`,"aria-hidden":`true`});for(let t of Ge)e.append(j(`i`,{style:`--d:${t}`}));return e}function Je(e){let t=j(`ul`,{class:`plan`,part:`plan`});for(let n of e)t.append(j(`li`,null,n));return t}function Ye(e){let t=j(`ul`,{class:`check`,part:`check`});for(let n of e){let e=n.variant&&Ke.has(n.variant)?n.variant:``,r=e?`ck ${e}`:`ck`,i=n.glyph??`✓`;t.append(j(`li`,null,j(`span`,{class:r},i),j(`span`,{class:`ctext`},n.text)))}return t}A(`slicc-agent-message`,class extends HTMLElement{static observedAttributes=[`thinking`,`streaming`,`progress`,`timestamp`];#e;#t=null;#n=null;#r=null;#i=!1;connectedCallback(){We(this.ownerDocument),this.#o(),this.#s(),this.#l()}attributeChangedCallback(e,t,n){t===n||!this.isConnected||(e===`thinking`?(this.#s(),this.dispatchEvent(new CustomEvent(`slicc-agent-message-thinking`,{bubbles:!0,composed:!0,detail:{thinking:n!==null}}))):e===`progress`?this.#c():e===`streaming`?(this.#l(),this.dispatchEvent(new CustomEvent(`slicc-agent-message-streaming`,{bubbles:!0,composed:!0,detail:{streaming:n!==null}}))):e===`timestamp`&&this.#u())}get thinking(){return this.hasAttribute(`thinking`)}set thinking(e){e?this.setAttribute(`thinking`,``):this.removeAttribute(`thinking`)}get streaming(){return this.hasAttribute(`streaming`)}set streaming(e){e?this.setAttribute(`streaming`,``):this.removeAttribute(`streaming`)}get progress(){return this.getAttribute(`progress`)}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,e)}get body(){return this.#o(),this.#e}setBodyHtml(e){this.#o();let t=this.ownerDocument.createRange();t.selectNodeContents(this.#e),this.#a(t.createContextualFragment(e))}setPlan(e){this.#a(Je(e))}setCheck(e){this.#a(Ye(e))}#a(e){this.#o(),this.#e.replaceChildren(e),this.#l()}#o(){if(this.#i)return;this.#i=!0,this.classList.add(`msg`,`bot`);let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`body`))),t=this.getAttribute(`timestamp`);if(t){let e=this.ownerDocument.createElement(`span`);e.className=`msg-ts`,e.setAttribute(`part`,`timestamp`),e.textContent=t,this.appendChild(e)}this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`body`,this.#e.setAttribute(`part`,`body`);for(let t of e)this.#e.appendChild(t);this.appendChild(this.#e)}#s(){let e=this.thinking;this.classList.toggle(`thinkrow`,e),e?(this.#e.style.display=`none`,this.#t||(this.#t=this.ownerDocument.createElement(`div`),this.#t.className=`thinkrow-row`,this.#t.appendChild(qe()),this.insertBefore(this.#t,this.#e)),this.#c()):(this.#e.style.removeProperty(`display`),this.#t&&(this.#t.remove(),this.#t=null,this.#n=null))}#c(){if(!this.#t)return;let e=this.progress;e?(this.#n||(this.#n=this.ownerDocument.createElement(`span`),this.#n.className=`progress`,this.#n.setAttribute(`part`,`progress`),this.#n.setAttribute(`aria-live`,`polite`),this.#t.appendChild(this.#n)),this.#n.textContent=e):this.#n&&=(this.#n.remove(),null)}#l(){this.streaming?this.#r?.isConnected?this.#e.appendChild(this.#r):(this.#r=this.ownerDocument.createElement(`span`),this.#r.className=`tw-caret`,this.#r.setAttribute(`part`,`caret`),this.#r.setAttribute(`aria-hidden`,`true`),this.#e.appendChild(this.#r)):this.#r&&=(this.#r.remove(),null)}#u(){let e=this.querySelector(`.msg-ts`),t=this.getAttribute(`timestamp`);if(t)if(e)e.textContent=t;else{let e=this.ownerDocument.createElement(`span`);e.className=`msg-ts`,e.setAttribute(`part`,`timestamp`),e.textContent=t,this.insertBefore(e,this.#e)}else e?.remove()}});var Xe=`
|
|
698
698
|
slicc-chat-table { display: block; }
|
|
699
699
|
slicc-chat-table > .ctable {
|
|
700
700
|
width: 100%;
|
|
@@ -735,7 +735,7 @@ slicc-chat-table > .ctable code {
|
|
|
735
735
|
overflow-wrap: anywhere;
|
|
736
736
|
word-break: break-word;
|
|
737
737
|
}
|
|
738
|
-
`,
|
|
738
|
+
`,Ze=`slicc-chat-table-style`;function Qe(e){if(e.getElementById(Ze))return;let t=e.createElement(`style`);t.id=Ze,t.textContent=Xe,(e.head??e.documentElement).appendChild(t)}function $e(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}A(`slicc-chat-table`,class extends HTMLElement{static observedAttributes=[`headers`];#e;#t;#n;#r=!1;connectedCallback(){Qe(this.ownerDocument),this.#i()}attributeChangedCallback(e,t,n){e===`headers`&&t!==n&&(this.#r&&this.#a(),this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-chat-table-change`,{bubbles:!0,composed:!0,detail:{headers:this.headers}})))}get headers(){let e=this.getAttribute(`headers`);return e?$e(e):[]}set headers(e){e==null?this.removeAttribute(`headers`):Array.isArray(e)?this.setAttribute(`headers`,e.join(`,`)):this.setAttribute(`headers`,e)}#i(){if(this.#r)return;this.#r=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLTableElement&&e.classList.contains(`ctable`)));this.#e=this.ownerDocument.createElement(`table`),this.#e.className=`ctable`,this.#e.setAttribute(`part`,`table`),this.#t=this.ownerDocument.createElement(`thead`),this.#t.setAttribute(`part`,`head`),this.#n=this.ownerDocument.createElement(`tbody`),this.#n.setAttribute(`part`,`body`),this.#e.append(this.#t,this.#n);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`head`?this.#t.appendChild(t):this.#n.appendChild(t);this.#a(),this.appendChild(this.#e)}#a(){if(!this.#r)return;let e=this.#t.querySelector(`tr`);if(e&&!e.hasAttribute(`data-slicc-generated`))return;let t=this.headers;if(t.length===0){this.#t.replaceChildren();return}let n=j(`tr`,{"data-slicc-generated":``});for(let e of t)n.append(j(`th`,null,e));this.#t.replaceChildren(n)}});function et(e){if(typeof window>`u`||!window.location)return null;try{return new URLSearchParams(window.location.search).get(e)}catch{return null}}function tt(e,t,n={}){if(!(typeof window>`u`||!window.history?.replaceState))try{let r=new URL(window.location.href),i=r.searchParams.get(e);if(i===t||i===null&&(t===null||t===``))return;t==null||t===``?r.searchParams.delete(e):r.searchParams.set(e,t),n.push?window.history.pushState(window.history.state,``,r):window.history.replaceState(window.history.state,``,r)}catch{}}var nt=`
|
|
739
739
|
slicc-chat-thread {
|
|
740
740
|
flex: 1 1 auto;
|
|
741
741
|
display: block;
|
|
@@ -833,7 +833,7 @@ slicc-chat-thread[open] > .slicc-thread__inner {
|
|
|
833
833
|
padding: 16px 14px;
|
|
834
834
|
}
|
|
835
835
|
}
|
|
836
|
-
`,
|
|
836
|
+
`,rt=`slicc-chat-thread-style`,it=120;function at(e){if(e.getElementById(rt))return;let t=e.createElement(`style`);t.id=rt,t.textContent=nt,(e.head??e.documentElement).appendChild(t)}A(`slicc-chat-thread`,class e extends HTMLElement{static observedAttributes=[`open`,`context`,`accent`,`url-state`];#e;#t=!1;#n=null;#r=null;#i=null;#a=!1;#o=!1;#s=0;#c=null;#l=null;#u=null;#d=null;#f=null;#p=()=>{this.#d=null,this.#f=performance.now(),tt(`at`,String(Math.round(this.scrollTop)))};#m=()=>{if(!this.urlState)return;let e=this.#f==null?it:performance.now()-this.#f;if(e>=it){this.#d!=null&&clearTimeout(this.#d),this.#p();return}this.#d??=setTimeout(this.#p,it-e)};#h=()=>{if(!this.urlState)return;let e=et(`ctx`);if(e&&e!==this.context)this.dispatchEvent(new CustomEvent(`slicc-url-context`,{bubbles:!0,composed:!0,detail:{context:e}}));else{let e=et(`at`);e!=null&&(this.scrollTop=Number.parseInt(e,10)||0)}};#g=null;#_=new Map;connectedCallback(){at(this.ownerDocument),this.#E(),this.#T(),this.#b(),this.scrollToBottom(),this.urlState&&(this.#r=et(`at`),this.#i=et(`ctx`),this.addEventListener(`scroll`,this.#m,{passive:!0}),window.addEventListener(`popstate`,this.#h))}disconnectedCallback(){this.#n&&=(this.#e?.removeEventListener(`click`,this.#n),null),this.removeEventListener(`scroll`,this.#m),window.removeEventListener(`popstate`,this.#h),this.#d!=null&&(clearTimeout(this.#d),this.#d=null),this.#f=null,this.#u?.disconnect(),this.#u=null,this.#C()}attributeChangedCallback(e,t,n){t!==n&&(e===`accent`&&this.#t&&this.#T(),e===`open`&&this.#t&&this.isConnected&&this.#x(),e===`context`&&this.urlState&&n!=null&&this.isConnected&&(n!==this.#i&&(this.#r=null),tt(`ctx`,n,{push:!0})))}get urlState(){return this.hasAttribute(`url-state`)}set urlState(e){this.toggleAttribute(`url-state`,e)}get urlContext(){return this.urlState?et(`ctx`):null}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get context(){return this.getAttribute(`context`)}set context(e){e==null?this.removeAttribute(`context`):this.setAttribute(`context`,e)}get accent(){return this.getAttribute(`accent`)}set accent(e){e==null?this.removeAttribute(`accent`):this.setAttribute(`accent`,e)}get inner(){return this.#E(),this.#e}switchContext(e){this.#E();let t=this.context;if(e===t)return;t!=null&&this.#_.set(t,this.#w());let n=this.#_.get(e);this.#e.replaceChildren(...n?Array.from(n.cloneNode(!0).childNodes):[]),this.context=e,this.removeAttribute(`has-new`),this.dispatchEvent(new CustomEvent(`slicc-context-change`,{bubbles:!0,composed:!0,detail:{context:e,previous:t}})),this.scrollToBottom()}append(...e){this.#E(),e.length>0&&(this.#r=null),this.#e.append(...e),this.requestFollow()}static FOLLOW_SLACK=80;#v(){return this.scrollHeight-this.scrollTop-this.clientHeight<=e.FOLLOW_SLACK}requestFollow(){this.#E(),this.#a?(this.#S(this.scrollHeight),this.removeAttribute(`has-new`)):this.setAttribute(`has-new`,``)}#y=()=>{if(this.#o&&Math.abs(this.scrollTop-this.#s)<=1){this.#C();return}this.#C(),this.#a=this.#v(),this.#a&&this.removeAttribute(`has-new`)};replaceContent(...e){this.#E(),this.#e.replaceChildren(...e),this.removeAttribute(`has-new`),this.scrollToBottom();let t=this.#r;t!=null&&e.length>0&&requestAnimationFrame(()=>{this.#r===t&&(this.#a=!1,this.#S(Number.parseInt(t,10)||0),this.#a=this.#v())})}scrollToBottom(){this.#a=!0,this.removeAttribute(`has-new`),this.#S(this.scrollHeight)}#b(){this.#u?.disconnect(),typeof ResizeObserver==`function`&&(this.#u=new ResizeObserver(()=>this.#x()),this.#u.observe(this.#e))}#x(){if(!this.#a)return;let t=this.#s-this.scrollTop;this.#o&&t>e.FOLLOW_SLACK||this.#S(this.scrollHeight)}#S(e){this.#o=!0,this.scrollTop=e,this.#s=this.scrollTop,this.#c!=null&&cancelAnimationFrame(this.#c),this.#l!=null&&clearTimeout(this.#l),`onscrollend`in HTMLElement.prototype?this.#l=setTimeout(()=>this.#C(),100):this.#c=requestAnimationFrame(()=>this.#C())}#C(){this.#o=!1,this.#c!=null&&cancelAnimationFrame(this.#c),this.#c=null,this.#l!=null&&clearTimeout(this.#l),this.#l=null}#w(){let e=this.ownerDocument.createDocumentFragment();for(let t of Array.from(this.#e.childNodes))e.appendChild(t.cloneNode(!0));return e}#T(){let e=this.accent;e?this.style.setProperty(`--ctx`,e):this.style.removeProperty(`--ctx`)}#E(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-thread__inner`);if(e instanceof HTMLElement)this.#e=e;else{let e=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-thread__inner`,this.#e.setAttribute(`part`,`inner`);for(let t of e)this.#e.appendChild(t);this.appendChild(this.#e)}this.#g=this.ownerDocument.createElement(`div`),this.#g.className=`slicc-thread__follow`;let t=this.ownerDocument.createElement(`button`);t.type=`button`;let r=n(`chevron-down`,{size:14,strokeWidth:2});t.append(`New messages`,r),t.addEventListener(`click`,()=>{this.scrollToBottom()}),this.#g.append(t),this.appendChild(this.#g),this.addEventListener(`scroll`,this.#y,{passive:!0}),this.addEventListener(`scrollend`,()=>this.#C(),{passive:!0}),this.#n=e=>{let t=e.target;t instanceof HTMLElement&&this.dispatchEvent(new CustomEvent(`slicc-thread-action`,{bubbles:!0,composed:!0,detail:{target:t}}))},this.#e.addEventListener(`click`,this.#n)}});var ot=M(`
|
|
837
837
|
:host {
|
|
838
838
|
display: flex;
|
|
839
839
|
align-items: center;
|
|
@@ -871,7 +871,7 @@ code {
|
|
|
871
871
|
overflow-wrap: anywhere;
|
|
872
872
|
word-break: break-word;
|
|
873
873
|
}
|
|
874
|
-
`),
|
|
874
|
+
`),st=[`feed`,`scoop`,`drop`,`sprinkle`],ct={feed:`arrow-right`,scoop:`circle-plus`,drop:`circle-check`,sprinkle:`sparkles`},lt={feed:`Delegated to`,scoop:`Spun up`,drop:`Wrapped up`,sprinkle:``},ut={feed_scoop:`Delegated to`,scoop_scoop:`Spun up`,drop_scoop:`Wrapped up`,"sprinkle-opened":`Opened`};function P(e){return ut[e]??e}function F(e){return st.includes(e??``)?e:`feed`}function dt(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e.length>0)}A(`slicc-delegation-line`,class extends HTMLElement{static observedAttributes=[`kind`,`hue`,`verb`,`scoop`,`label`,`args`,`source`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ot]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get kind(){return F(this.getAttribute(`kind`))}set kind(e){this.setAttribute(`kind`,F(e))}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get verb(){return this.getAttribute(`verb`)}set verb(e){e==null?this.removeAttribute(`verb`):this.setAttribute(`verb`,e)}get scoop(){return this.getAttribute(`scoop`)}set scoop(e){e==null?this.removeAttribute(`scoop`):this.setAttribute(`scoop`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get args(){return this.getAttribute(`args`)}set args(e){e==null?this.removeAttribute(`args`):this.setAttribute(`args`,e)}get source(){return this.hasAttribute(`source`)}set source(e){this.toggleAttribute(`source`,e)}#t(){let e=this.kind,t=this.hue,r=this.verb,i=r==null?lt[e]:P(r),a=this.scoop,o=this.label,s=this.args?dt(this.args):[];t?this.style.setProperty(`--c`,t):this.style.removeProperty(`--c`);let c=j(`span`,{class:`darrow`,part:`arrow`},j(`slot`,{name:`arrow`},n(ct[e],{size:13}))),l=j(`slot`,{name:`label`});i&&l.append(j(`span`,{class:`verb`},i)),a&&l.append(j(`b`,{class:`scoop`,part:`scoop`,style:t?`color:${t}`:void 0},a)),o&&l.append(j(`span`,{class:`prose`},o));let u=j(`span`,{class:`label`,part:`label`},l),d=j(`slot`,{name:`args`});for(let e of s)d.append(j(`code`,{part:`code`},e));this.#e.replaceChildren(c,u,d)}});var ft=M(`
|
|
875
875
|
:host {
|
|
876
876
|
display: block;
|
|
877
877
|
border: 1px solid var(--line);
|
|
@@ -897,7 +897,7 @@ code {
|
|
|
897
897
|
/* palette chips carry inline-style light backgrounds — tone them down for dark mode */
|
|
898
898
|
:host-context(.dark) .ch,
|
|
899
899
|
:host-context([data-theme="dark"]) .ch { filter: brightness(.55) saturate(.85); }
|
|
900
|
-
`);A(`slicc-palette-cell`,class extends HTMLElement{static observedAttributes=[`color`,`label`,`group`,`selected`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
900
|
+
`);A(`slicc-palette-cell`,class extends HTMLElement{static observedAttributes=[`color`,`label`,`group`,`selected`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ft]}connectedCallback(){this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`),this.setAttribute(`role`,`button`),this.#o(),this.#i()}disconnectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#o()}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get group(){return this.getAttribute(`group`)}set group(e){e==null?this.removeAttribute(`group`):this.setAttribute(`group`,e)}get selected(){return this.hasAttribute(`selected`)}set selected(e){this.toggleAttribute(`selected`,e)}select(){this.#r(),this.selected=!0,this.dispatchEvent(new CustomEvent(`palette-select`,{bubbles:!0,composed:!0,detail:{color:this.color,label:this.label,group:this.group}}))}#r(){let e=this.group;if(!e)return;let t=this.getRootNode().querySelectorAll(`slicc-palette-cell[group="${CSS.escape(e)}"][selected]`);for(let e of t)e!==this&&(e.selected=!1)}#i(){this.#t||(this.#t=()=>this.select(),this.#n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.select())},this.addEventListener(`click`,this.#t),this.addEventListener(`keydown`,this.#n))}#a(){this.#t&&this.removeEventListener(`click`,this.#t),this.#n&&this.removeEventListener(`keydown`,this.#n),this.#t=null,this.#n=null}#o(){this.setAttribute(`aria-pressed`,this.selected?`true`:`false`);let e=this.color??`transparent`,t=this.label,n=j(`div`,{class:`ch`,part:`chip`,style:`background:${e}`}),r=j(`div`,{class:`cl`,part:`label`},t??j(`slot`));this.#e.replaceChildren(n,r)}});var pt=[`#f43f5e`,`#f59e0b`,`#06b6d4`,`#8b5cf6`,`#ec4899`,`#22c55e`],mt=46,ht=72,gt=6.283185;function _t(e,t){return e+Math.random()*(t-e)}var vt=[{color:`#faf6f1`,label:`paper`},{color:`#fff7ed`,label:`cream`},{color:`#f5f3ff`,label:`lilac`},{color:`#fef2f2`,label:`blush`}],yt=[{color:`#8b5cf6`,label:`violet`},{color:`#f43f5e`,label:`rose`},{color:`#06b6d4`,label:`cyan`},{color:`#ef7000`,label:`cone`}],I=0,bt=M(`
|
|
901
901
|
:host {
|
|
902
902
|
position: relative;
|
|
903
903
|
display: block;
|
|
@@ -984,7 +984,7 @@ canvas.sprk {
|
|
|
984
984
|
@media (prefers-reduced-motion: reduce) {
|
|
985
985
|
canvas.sprk { display: none; }
|
|
986
986
|
}
|
|
987
|
-
`);A(`slicc-dip`,class extends HTMLElement{static observedAttributes=[`name`,`hue`,`prompt`];#e;#t=`d${++
|
|
987
|
+
`);A(`slicc-dip`,class extends HTMLElement{static observedAttributes=[`name`,`hue`,`prompt`];#e;#t=`d${++I}`;#n=null;#r=null;#i=0;#a=null;#o=[];#s=0;#c=0;#l=-999;#u=-999;#d=null;#f=null;#p=null;#m=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[bt]}connectedCallback(){this.#v(),this.#b(),this.#w()}disconnectedCallback(){this.#T(),this.#x()}attributeChangedCallback(){this.isConnected&&(this.#v(),this.#b(),this.#w())}get name(){return this.getAttribute(`name`)??`palette.shtml`}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get prompt(){return this.getAttribute(`prompt`)}set prompt(e){e==null?this.removeAttribute(`prompt`):this.setAttribute(`prompt`,e)}get selectedCanvas(){return this.#h(`canvas:${this.#t}`)}get selectedAccent(){return this.#h(`accent:${this.#t}`)}#h(e){let t=this.querySelector(`slicc-palette-cell[group="${CSS.escape(e)}"][selected]`);return t?{color:t.getAttribute(`color`)??``,label:t.getAttribute(`label`)??``}:null}#g(e,t,n){let r=e.startsWith(`canvas`)?`canvas`:`accent`;if(!this.querySelector(`slicc-palette-cell[slot="${r}"]`))for(let i of t){let t=this.ownerDocument.createElement(`slicc-palette-cell`);t.setAttribute(`slot`,r),t.setAttribute(`color`,i.color),t.setAttribute(`label`,i.label),t.setAttribute(`group`,e),i.label===n&&t.setAttribute(`selected`,``),this.appendChild(t)}}#_(){return[document.createTextNode(`Tune the hero’s `),j(`b`,null,`canvas`),document.createTextNode(` & `),j(`b`,null,`accent`),document.createTextNode(`, then apply:`)]}#v(){let e=this.hue,t=e?`--c:${e}`:void 0,r=j(`slot`,{name:`prompt`});this.prompt?r.append(this.prompt):r.append(...this.#_()),this.#e.replaceChildren(j(`canvas`,{class:`sprk`,part:`field`,"aria-hidden":`true`}),j(`div`,{class:`dh`,part:`header`,style:t},j(`span`,{class:`sg`,part:`glyph`},n(`sparkles`,{size:12})),j(`span`,{class:`nm`,part:`name`},this.name),j(`span`,{class:`tag`,part:`tag`},`sprinkle · dip`)),j(`div`,{class:`dbody`,part:`body`,style:t},j(`p`,{class:`dprompt`,part:`prompt`},r),j(`div`,{class:`pgrid canvas`,part:`grid-canvas`},j(`slot`,{name:`canvas`})),j(`div`,{class:`pgrid accent`,part:`grid-accent`},j(`slot`,{name:`accent`})),j(`div`,{class:`dfoot`},j(`button`,{class:`dapply`,part:`apply`,type:`button`},`Apply to hero →`),j(`span`,{class:`dnote`,part:`note`})))),this.#g(`canvas:${this.#t}`,vt,`paper`),this.#g(`accent:${this.#t}`,yt,`cone`),this.#y()}#y(){let e=this.#e.querySelector(`.dnote`);e&&(e.textContent=`${this.selectedCanvas?.label??`paper`} · ${this.selectedAccent?.label??`violet`}`)}#b(){this.#p||(this.#p=()=>this.#y(),this.addEventListener(`palette-select`,this.#p)),this.#m||=()=>this.#S(),this.#e.querySelector(`.dapply`)?.addEventListener(`click`,this.#m)}#x(){this.#p&&=(this.removeEventListener(`palette-select`,this.#p),null),this.#m=null}#S(){this.#y(),this.dispatchEvent(new CustomEvent(`slicc-dip-apply`,{bubbles:!0,composed:!0,detail:{canvas:this.selectedCanvas,accent:this.selectedAccent}}))}#C(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}#w(){if(this.#T(),this.#C())return;let e=this.#e.querySelector(`canvas.sprk`),t=e?.getContext(`2d`)??null;!e||!t||(this.#n=e,this.#r=t,this.#o=[],this.#E(),typeof ResizeObserver==`function`&&(this.#a=new ResizeObserver(()=>this.#E()),this.#a.observe(this)),this.#d=e=>{let t=this.getBoundingClientRect();this.#l=e.clientX-t.left,this.#u=e.clientY-t.top},this.#f=()=>{this.#l=-999,this.#u=-999},this.addEventListener(`pointermove`,this.#d),this.addEventListener(`pointerleave`,this.#f),this.#i=requestAnimationFrame(()=>this.#O()))}#T(){this.#i&&cancelAnimationFrame(this.#i),this.#i=0,this.#a?.disconnect(),this.#a=null,this.#d&&this.removeEventListener(`pointermove`,this.#d),this.#f&&this.removeEventListener(`pointerleave`,this.#f),this.#d=null,this.#f=null}#E(){let e=this.#n,t=this.#r;if(!e||!t)return;let n=this.getBoundingClientRect(),r=Math.min(typeof devicePixelRatio==`number`?devicePixelRatio:1,2);if(this.#s=n.width,this.#c=n.height||90,e.width=Math.max(1,Math.round(this.#s*r)),e.height=Math.max(1,Math.round(this.#c*r)),t.setTransform(r,0,0,r,0,0),!this.#o.length)for(let e=0;e<mt;e++)this.#o.push({x:_t(0,this.#s),y:_t(0,this.#c),vx:_t(-.1,.1),vy:_t(-.08,.08),rot:_t(0,gt),rv:_t(-.014,.014),s:_t(1.2,2.2),col:pt[e%pt.length]})}#D(e,t,n,r,i){let a=this.#r;a&&(a.roundRect?(a.beginPath(),a.roundRect(e,t,n,r,i)):(a.beginPath(),a.moveTo(e+i,t),a.arcTo(e+n,t,e+n,t+r,i),a.arcTo(e+n,t+r,e,t+r,i),a.arcTo(e,t+r,e,t,i),a.arcTo(e,t,e+n,t,i),a.closePath()))}#O(){let e=this.#r;if(e){e.clearRect(0,0,this.#s,this.#c);for(let t of this.#o){let n=t.x-this.#l,r=t.y-this.#u,i=n*n+r*r;if(i<5184){let e=Math.sqrt(i)||1,a=(ht-e)/ht*.5;t.vx+=n/e*a,t.vy+=r/e*a}t.vx*=.95,t.vy*=.95,t.x+=t.vx+.04,t.y+=t.vy,t.rot+=t.rv,t.x<-6&&(t.x=this.#s+6),t.x>this.#s+6&&(t.x=-6),t.y<-6&&(t.y=this.#c+6),t.y>this.#c+6&&(t.y=-6);let a=t.s*4,o=t.s*1.55;e.save(),e.translate(t.x,t.y),e.rotate(t.rot),e.globalAlpha=.5,e.fillStyle=t.col,this.#D(-a/2,-o/2,a,o,o/2),e.fill(),e.globalAlpha=.85,e.fillStyle=`#fff`,this.#D(-a/2+o*.3,-o*.34,a-o*.6,o*.3,o*.15),e.fill(),e.restore(),e.globalAlpha=1}this.#i=requestAnimationFrame(()=>this.#O())}}});var L=14,xt=12,St=`Something went wrong`,Ct={retry:`Try again`,settings:`Open Settings`,"change-model":`Change model`,login:`Log in again`},wt={retry:`rotate-ccw`,settings:`settings`,"change-model":`sparkles`,login:`log-in`},Tt=M(`
|
|
988
988
|
:host{
|
|
989
989
|
/* Error cards sit in the assistant column (left-aligned). Tokens default to
|
|
990
990
|
the light palette and flip in dark mode via the library's outer scopes
|
|
@@ -1043,7 +1043,7 @@ canvas.sprk {
|
|
|
1043
1043
|
.retry:hover{filter:brightness(1.08);}
|
|
1044
1044
|
.retry:focus-visible{outline:2px solid color-mix(in srgb,var(--err-btn-bg) 60%,var(--ink));outline-offset:2px;}
|
|
1045
1045
|
.retry svg{display:block;}
|
|
1046
|
-
`);A(`slicc-error-card`,class extends HTMLElement{static observedAttributes=[`label`,`message`,`button-label`,`message-id`,`action`,`no-action`,`theme`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
1046
|
+
`);A(`slicc-error-card`,class extends HTMLElement{static observedAttributes=[`label`,`message`,`button-label`,`message-id`,`action`,`no-action`,`theme`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Tt]}connectedCallback(){this.#n()}disconnectedCallback(){this.#i()}attributeChangedCallback(){this.isConnected&&this.#n()}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get message(){return this.getAttribute(`message`)}set message(e){e==null?this.removeAttribute(`message`):this.setAttribute(`message`,e)}get buttonLabel(){return this.getAttribute(`button-label`)}set buttonLabel(e){e==null?this.removeAttribute(`button-label`):this.setAttribute(`button-label`,e)}get messageId(){return this.getAttribute(`message-id`)}set messageId(e){e==null?this.removeAttribute(`message-id`):this.setAttribute(`message-id`,e)}get action(){let e=this.getAttribute(`action`);return e===`settings`||e===`change-model`||e===`login`?e:`retry`}set action(e){e==null?this.removeAttribute(`action`):this.setAttribute(`action`,e)}get noAction(){return this.hasAttribute(`no-action`)}set noAction(e){this.toggleAttribute(`no-action`,e)}get theme(){let e=this.getAttribute(`theme`);return e===`light`||e===`dark`?e:null}set theme(e){e==null?this.removeAttribute(`theme`):this.setAttribute(`theme`,e)}retry(){this.dispatchEvent(new CustomEvent(`slicc-error-retry`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}openSettings(){this.dispatchEvent(new CustomEvent(`slicc-error-open-settings`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}changeModel(){this.dispatchEvent(new CustomEvent(`slicc-error-change-model`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}login(){this.dispatchEvent(new CustomEvent(`slicc-error-login`,{detail:{messageId:this.getAttribute(`message-id`)??null},bubbles:!0,composed:!0}))}#n(){let e=this.action,t=this.label??St,r=this.message,i=this.buttonLabel??Ct[e],a=wt[e],o=j(`span`,{class:`ic`,part:`icon`,"aria-hidden":!0});o.append(n(`triangle-alert`,{size:L}));let s=j(`div`,{class:`eh`,part:`header`},o,j(`span`,{class:`lbl`,part:`label`},t)),c=j(`div`,{class:`eb`,part:`body`},r??j(`slot`)),l=j(`button`,{type:`button`,class:`retry`,part:`button`,"aria-label":i},n(a,{size:xt}),i),u=[s,c];this.noAction||u.push(j(`div`,{class:`foot`},l));let d=j(`div`,{class:`err`,part:`card`},...u);this.#e.replaceChildren(d),this.#r()}#r(){this.#i();let e=this.#e.querySelector(`.retry`);if(!e)return;let t=this.action;this.#t=()=>{t===`settings`?this.openSettings():t===`change-model`?this.changeModel():t===`login`?this.login():this.retry()},e.addEventListener(`click`,this.#t)}#i(){let e=this.#e.querySelector(`.retry`);e&&this.#t&&e.removeEventListener(`click`,this.#t),this.#t=null}});var Et=9,Dt=3,Ot=45,kt=M(`
|
|
1047
1047
|
:host {
|
|
1048
1048
|
display: inline-flex;
|
|
1049
1049
|
align-items: center;
|
|
@@ -1124,7 +1124,7 @@ canvas.sprk {
|
|
|
1124
1124
|
@media (prefers-reduced-motion: reduce) {
|
|
1125
1125
|
:host([blink]) .eye { animation: none; }
|
|
1126
1126
|
}
|
|
1127
|
-
`);A(`slicc-googly-eyes`,class extends HTMLElement{static observedAttributes=[`inverted`,`tracking`,`blink`,`eyes`,`size`];#e;#t=[];#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
1127
|
+
`);A(`slicc-googly-eyes`,class extends HTMLElement{static observedAttributes=[`inverted`,`tracking`,`blink`,`eyes`,`size`];#e;#t=[];#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[kt]}connectedCallback(){this.#r(),this.#i()}disconnectedCallback(){this.#o()}attributeChangedCallback(e,t,n){this.isConnected&&(e===`size`||e===`eyes`?(this.#r(),this.#i()):e===`tracking`&&this.#i())}get inverted(){return this.hasAttribute(`inverted`)}set inverted(e){this.toggleAttribute(`inverted`,e)}get tracking(){return this.getAttribute(`tracking`)!==`off`}set tracking(e){e?this.setAttribute(`tracking`,`on`):this.setAttribute(`tracking`,`off`)}get blink(){return this.hasAttribute(`blink`)}set blink(e){this.toggleAttribute(`blink`,e)}get eyes(){return this.getAttribute(`eyes`)===`dead`?`dead`:`open`}set eyes(e){this.setAttribute(`eyes`,e===`dead`?`dead`:`open`)}get size(){let e=Number.parseFloat(this.getAttribute(`size`)??``);return Number.isFinite(e)&&e>0?e:Et}set size(e){this.setAttribute(`size`,String(e))}#r(){let e=this.size,t=1.3/Et*e,n=this.eyes===`dead`,r=e=>j(`span`,{class:`eye`,part:e},n?j(`span`,{class:`x`,"aria-hidden":`true`},`×`):null),i=j(`span`,{class:`eyes`,part:`eyes`,style:`--_eye:${e}px;--_border:${t}px`,role:`img`,"aria-label":n?`dead eyes`:`googly eyes`},r(`eye eye-left`),j(`slot`),r(`eye eye-right`));this.#e.replaceChildren(i),this.#t=Array.from(this.#e.querySelectorAll(`.eye`)),this.#s()}#i(){this.tracking&&this.eyes===`open`?this.#a():(this.#o(),this.#s())}#a(){this.#n||(this.#n=e=>this.#c(e),document.addEventListener(`mousemove`,this.#n))}#o(){this.#n&&=(document.removeEventListener(`mousemove`,this.#n),null)}#s(){for(let e of this.#t)e.style.setProperty(`--px`,`0px`),e.style.setProperty(`--py`,`0px`)}#c(e){for(let t of this.#t){let n=t.getBoundingClientRect(),r=n.left+n.width/2,i=n.top+n.height/2,a=Math.atan2(e.clientY-i,e.clientX-r),o=Math.min(Dt,Math.hypot(e.clientX-r,e.clientY-i)/Ot);t.style.setProperty(`--px`,`${(Math.cos(a)*o).toFixed(2)}px`),t.style.setProperty(`--py`,`${(Math.sin(a)*o).toFixed(2)}px`)}}});var At=M(`
|
|
1128
1128
|
:host{display:block;font-family:var(--ui);}
|
|
1129
1129
|
:host([hidden]){display:none;}
|
|
1130
1130
|
.handoff{border:1px solid var(--line);border-radius:13px;padding:13px 15px;margin:2px 0 18px;}
|
|
@@ -1144,7 +1144,7 @@ canvas.sprk {
|
|
|
1144
1144
|
.opened .sg{width:20px;height:20px;border-radius:6px;display:grid;place-items:center;color:#fff;background:var(--rainbow);flex:0 0 auto;}
|
|
1145
1145
|
.opened .sg svg{display:block;}
|
|
1146
1146
|
.opened b{color:var(--ink);font-weight:600;}
|
|
1147
|
-
`),
|
|
1147
|
+
`),jt=`Handoff request from`;A(`slicc-handoff-card`,class extends HTMLElement{static observedAttributes=[`variant`,`name`,`pre`,`text`,`eyes`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[At]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get variant(){return this.getAttribute(`variant`)===`opened`?`opened`:`handoff`}set variant(e){this.setAttribute(`variant`,e===`opened`?`opened`:`handoff`)}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get pre(){return this.getAttribute(`pre`)}set pre(e){e==null?this.removeAttribute(`pre`):this.setAttribute(`pre`,e)}get text(){return this.getAttribute(`text`)}set text(e){e==null?this.removeAttribute(`text`):this.setAttribute(`text`,e)}get eyes(){return this.getAttribute(`eyes`)===`dead`?`dead`:`open`}set eyes(e){this.setAttribute(`eyes`,e===`dead`?`dead`:`open`)}#t(){this.variant===`opened`?this.#i():this.#r()}#n(){let e=this.text;return e==null?j(`slot`):document.createTextNode(e)}#r(){let e=this.pre??jt,t=this.name,r=j(`slicc-googly-eyes`,{class:`eyes`});this.eyes===`dead`&&r.setAttribute(`eyes`,`dead`);let i=j(`div`,{class:`top`,part:`top`},j(`span`,{class:`av`,part:`avatar`},r),j(`span`,{class:`lbl2`,part:`label`},j(`span`,{class:`hand`,part:`hand`,"aria-hidden":`true`},n(`hand`,{size:13})),j(`span`,{class:`pre`},e),` `,t==null?null:j(`b`,{part:`name`},t))),a=j(`p`,{part:`text`},this.#n());this.#e.replaceChildren(j(`div`,{class:`handoff`,part:`card`},i,a))}#i(){let e=this.name,t=j(`span`,{class:`sg`,part:`glyph`,"aria-hidden":`true`},n(`sparkles`,{size:12})),r=j(`span`,{part:`text`},e==null?null:j(`b`,{part:`name`},e),e==null?null:` `,this.#n());this.#e.replaceChildren(j(`div`,{class:`opened`,part:`card`},t,r))}});var Mt=14,Nt=`event`,Pt={webhook:`webhook`,cron:`clock`,workflow:`workflow`,bash:`square-terminal`,"session-reload":`rotate-ccw`,navigate:`compass`,discovery:`radar`,upgrade:`circle-arrow-up`,sprinkle:`sparkles`,fswatch:`eye`,"scoop-notify":`bell-ring`,"scoop-idle":`moon`,"scoop-wait":`hourglass`,"sudo-request":`key-round`},Ft=`bell`;function It(e){return e&&Pt[e.toLowerCase()]||Ft}var Lt={confirmed:`circle-check`,dismissed:`circle-x`},Rt=M(`
|
|
1148
1148
|
:host{
|
|
1149
1149
|
/* Licks are right-aligned in the chat column (mirroring the lickIn slide-in
|
|
1150
1150
|
from the right): the host is a full-width flex row that pushes the card to
|
|
@@ -1251,7 +1251,7 @@ canvas.sprk {
|
|
|
1251
1251
|
:host([collapsed]) .lb{display:none;}
|
|
1252
1252
|
|
|
1253
1253
|
@keyframes lickIn{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}
|
|
1254
|
-
`),
|
|
1254
|
+
`),zt=`
|
|
1255
1255
|
slicc-lick-card pre{
|
|
1256
1256
|
white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;
|
|
1257
1257
|
max-width:100%;overflow-x:auto;margin:6px 0;
|
|
@@ -1262,7 +1262,7 @@ slicc-lick-card a{overflow-wrap:anywhere;}
|
|
|
1262
1262
|
slicc-lick-card img{max-width:100%;height:auto;}
|
|
1263
1263
|
slicc-lick-card table{display:block;max-width:100%;width:fit-content;overflow-x:auto;}
|
|
1264
1264
|
slicc-lick-card > *{min-width:0;max-width:100%;}
|
|
1265
|
-
`,
|
|
1265
|
+
`,Bt=`slicc-lick-card-slotted-style`;function Vt(e){if(e.getElementById(Bt))return;let t=e.createElement(`style`);t.id=Bt,t.textContent=zt,(e.head??e.documentElement).appendChild(t)}var Ht=`·`;A(`slicc-lick-card`,class extends HTMLElement{static observedAttributes=[`kind`,`event-label`,`body`,`count`,`no-animate`,`collapsible`,`collapsed`,`theme`,`hue`,`state`];#e;#t=null;#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Rt]}connectedCallback(){Vt(this.ownerDocument),this.#r()}disconnectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#r()}get kind(){return this.getAttribute(`kind`)}set kind(e){e==null?this.removeAttribute(`kind`):this.setAttribute(`kind`,e)}get eventLabel(){return this.getAttribute(`event-label`)}set eventLabel(e){e==null?this.removeAttribute(`event-label`):this.setAttribute(`event-label`,e)}get body(){return this.getAttribute(`body`)}set body(e){e==null?this.removeAttribute(`body`):this.setAttribute(`body`,e)}get count(){let e=Number.parseInt(this.getAttribute(`count`)??``,10);return Number.isFinite(e)&&e>0?e:1}set count(e){e>1?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`)}get noAnimate(){return this.hasAttribute(`no-animate`)}set noAnimate(e){this.toggleAttribute(`no-animate`,e)}get collapsible(){return this.hasAttribute(`collapsible`)}set collapsible(e){this.toggleAttribute(`collapsible`,e)}get collapsed(){return this.hasAttribute(`collapsed`)}set collapsed(e){this.toggleAttribute(`collapsed`,e)}get theme(){let e=this.getAttribute(`theme`);return e===`light`||e===`dark`?e:null}set theme(e){e==null?this.removeAttribute(`theme`):this.setAttribute(`theme`,e)}get state(){let e=this.getAttribute(`state`);return e===`confirmed`||e===`dismissed`?e:`pending`}set state(e){e==null||e===`pending`?this.removeAttribute(`state`):this.setAttribute(`state`,e)}toggle(){this.collapsible&&(this.collapsed=!this.collapsed,this.dispatchEvent(new CustomEvent(`slicc-lick-toggle`,{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0})))}#r(){let e=this.kind??``,t=this.count,r=this.getAttribute(`hue`);r?(this.style.setProperty(`--lick-pill`,r),this.style.setProperty(`--lick-pill-ink`,`#fff`)):(this.style.removeProperty(`--lick-pill`),this.style.removeProperty(`--lick-pill-ink`));let i=this.eventLabel??Nt,a=t>1?`${i} ×${t}`:i,o=this.body,s=this.collapsible,c=e?`lick ${Ht} ${e}`:`lick ${Ht}`,l=j(`span`,{class:`bell`,part:`bell`,"aria-hidden":!0});l.append(n(It(e),{size:Mt}));let u={class:`lh`,part:`header`};s&&(u.tabindex=`0`,u.role=`button`,u[`aria-expanded`]=this.collapsed?`false`:`true`);let d=j(`div`,u,l,` `,j(`span`,{class:`kind`,part:`kind`},`${c} `),j(`span`,{class:`lk`,part:`event`},a)),f=this.state;if(f!==`pending`){let e=j(`span`,{class:`status`,part:`status`,"aria-hidden":!0});e.append(n(Lt[f],{size:Mt})),d.append(e)}let p=j(`div`,{class:`lick`,part:`card`},d,j(`div`,{class:`lb`,part:`body`},o??j(`slot`)));this.#e.replaceChildren(p),this.#i()}#i(){if(this.#a(),!this.collapsible)return;let e=this.#e.querySelector(`.lh`);e&&(this.#t=()=>this.toggle(),this.#n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.toggle())},e.addEventListener(`click`,this.#t),e.addEventListener(`keydown`,this.#n))}#a(){let e=this.#e.querySelector(`.lh`);e&&this.#t&&e.removeEventListener(`click`,this.#t),e&&this.#n&&e.removeEventListener(`keydown`,this.#n),this.#t=null,this.#n=null}});var Ut=`
|
|
1266
1266
|
slicc-tool-cluster {
|
|
1267
1267
|
display: block;
|
|
1268
1268
|
margin: -2px 0 16px;
|
|
@@ -1338,7 +1338,7 @@ slicc-tool-cluster[open] .slicc-cluster__body {
|
|
|
1338
1338
|
slicc-tool-cluster .slicc-cluster__body slicc-action-row {
|
|
1339
1339
|
margin-bottom: 4px;
|
|
1340
1340
|
}
|
|
1341
|
-
`,
|
|
1341
|
+
`,Wt=`slicc-tool-cluster-style`;function Gt(e){if(e.getElementById(Wt))return;let t=e.createElement(`style`);t.id=Wt,t.textContent=Ut,(e.head??e.documentElement).appendChild(t)}var Kt=`A few quick steps`;A(`slicc-tool-cluster`,class extends HTMLElement{static observedAttributes=[`open`,`label`,`count`];#e;#t;#n;#r;#i=!1;#a=()=>{this.open=!this.open};connectedCallback(){Gt(this.ownerDocument),this.#o(),this.#s(),this.#e?.addEventListener(`click`,this.#a)}disconnectedCallback(){this.#e?.removeEventListener(`click`,this.#a)}attributeChangedCallback(e,t,n){t===n||!this.#i||(e===`open`?(this.#e.setAttribute(`aria-expanded`,String(n!==null)),this.dispatchEvent(new CustomEvent(`slicc-tool-cluster-toggle`,{bubbles:!0,composed:!0,detail:{open:n!==null}}))):this.#s())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get label(){return this.getAttribute(`label`)??Kt}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get count(){let e=Number.parseInt(this.getAttribute(`count`)??``,10);return Number.isFinite(e)&&e>0?e:0}set count(e){e>0?this.setAttribute(`count`,String(e)):this.removeAttribute(`count`)}get body(){return this.#o(),this.#r}append(...e){this.#o(),this.#r.append(...e),this.#s()}#o(){if(this.#i)return;this.#i=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-cluster__head`))&&!(e instanceof HTMLElement&&e.classList.contains(`slicc-cluster__body`)));this.#e=this.ownerDocument.createElement(`button`),this.#e.type=`button`,this.#e.className=`slicc-cluster__head`,this.#e.setAttribute(`part`,`head`),this.#t=j(`span`,{class:`slicc-cluster__label`,part:`label`}),this.#n=j(`span`,{class:`slicc-cluster__count`,part:`count`}),we(this.#e,[j(`span`,{class:`slicc-cluster__ic`,part:`icon`},n(`layers`,{size:12})),this.#t,this.#n,j(`span`,{class:`slicc-cluster__chev`,part:`chevron`,"aria-hidden":`true`},`▸`)]),this.#r=this.ownerDocument.createElement(`div`),this.#r.className=`slicc-cluster__body`,this.#r.setAttribute(`part`,`body`);for(let t of e)this.#r.appendChild(t);this.replaceChildren(this.#e,this.#r),this.#e.addEventListener(`click`,this.#a)}#s(){if(!this.#i)return;this.#t.textContent=this.label;let e=this.count||this.#r.children.length;this.#n.textContent=e>0?`${e} steps`:``,this.#e.setAttribute(`aria-expanded`,String(this.open))}});var qt=400,Jt=M(`
|
|
1342
1342
|
:host{position:fixed;inset:0;z-index:1000;display:none;}
|
|
1343
1343
|
:host([open]){display:block;}
|
|
1344
1344
|
.overlay{position:fixed;inset:0;z-index:1000;display:flex;align-items:center;justify-content:center;cursor:pointer;}
|
|
@@ -1346,7 +1346,7 @@ slicc-tool-cluster .slicc-cluster__body slicc-action-row {
|
|
|
1346
1346
|
.overlay.visible .backdrop{opacity:1;}
|
|
1347
1347
|
.overlay.closing .backdrop{opacity:0;}
|
|
1348
1348
|
.image{position:absolute;border-radius:6px;box-shadow:0 20px 60px rgba(0,0,0,.4),0 8px 20px rgba(0,0,0,.3);max-width:90vw;max-height:90vh;object-fit:contain;transform-origin:center center;will-change:transform;transition:transform .35s cubic-bezier(.2,0,.13,1),border-radius .35s cubic-bezier(.2,0,.13,1);}
|
|
1349
|
-
`),
|
|
1349
|
+
`),Yt=null,Xt=class extends HTMLElement{#e;#t=null;#n=null;#r=null;#i=null;#a=!1;#o=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Jt]}disconnectedCallback(){this.#l(),Yt===this&&(Yt=null)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get isOpen(){return this.hasAttribute(`open`)}open(e,t){Yt&&Yt!==this&&Yt.#s(),this.#l(),this.#a=!1,this.src=e,this.setAttribute(`open`,``),Yt=this,this.#r=t??this;let n=document.createElement(`div`);n.className=`overlay`,n.setAttribute(`part`,`overlay`);let r=document.createElement(`div`);r.className=`backdrop`,r.setAttribute(`part`,`backdrop`),n.appendChild(r);let i=document.createElement(`img`);i.className=`image`,i.setAttribute(`part`,`image`),i.src=e,i.alt=`Image preview`,n.appendChild(i),this.#e.appendChild(n),this.#t=n,this.#n=i;let a=this.#r.getBoundingClientRect(),o=()=>{let e=window.innerWidth,t=window.innerHeight,r=e*.9,o=t*.9,s=i.naturalWidth||a.width*4,c=i.naturalHeight||a.height*4,l=Math.min(r/s,o/c,1),u=s*l,d=c*l,f=(e-u)/2,p=(t-d)/2,m=a.width/u,h=a.height/d,g=a.left+a.width/2,_=a.top+a.height/2,v=f+u/2,y=p+d/2,b=g-v,x=_-y;i.style.position=`absolute`,i.style.width=`${u}px`,i.style.height=`${d}px`,i.style.left=`${f}px`,i.style.top=`${p}px`,i.style.transform=`translate(${b}px, ${x}px) scale(${m}, ${h})`,i.style.borderRadius=`${6/Math.min(m,h)}px`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{i.style.transform=`translate(0, 0) scale(1, 1)`,i.style.borderRadius=`6px`,n.classList.add(`visible`)})})};i.complete&&i.naturalWidth>0?o():(i.onload=()=>o(),i.onerror=()=>this.#s()),this.#i=e=>{e.key===`Escape`&&this.close()},n.addEventListener(`click`,()=>this.close()),document.addEventListener(`keydown`,this.#i),this.dispatchEvent(new CustomEvent(`slicc-image-preview-open`,{bubbles:!0,composed:!0,detail:{src:e}}))}close(){let e=this.#t,t=this.#n;if(this.#a||!e||!t||Yt!==this)return;this.#a=!0,e.classList.add(`closing`),e.classList.remove(`visible`);let n=this.#r,r=n?n.getBoundingClientRect():null;if(r&&r.width>0&&r.height>0){let e=t.getBoundingClientRect(),n=r.width/e.width,i=r.height/e.height,a=r.left+r.width/2,o=r.top+r.height/2,s=e.left+e.width/2,c=e.top+e.height/2,l=a-s,u=o-c;t.style.transform=`translate(${l}px, ${u}px) scale(${n}, ${i})`,t.style.borderRadius=`${6/Math.min(n,i)}px`}this.dispatchEvent(new CustomEvent(`slicc-image-preview-close`,{bubbles:!0,composed:!0,detail:{src:this.src}}));let i=()=>this.#c();this.#o=setTimeout(i,qt),e.addEventListener(`transitionend`,e=>{e.propertyName===`transform`&&(this.#o&&clearTimeout(this.#o),i())})}#s(){this.#l()}#c(){this.#l()}#l(){this.#o&&=(clearTimeout(this.#o),null),this.#i&&=(document.removeEventListener(`keydown`,this.#i),null),this.#t&&=(this.#t.remove(),null),this.#n=null,this.#r=null,this.removeAttribute(`open`),this.removeAttribute(`src`),Yt===this&&(Yt=null)}static show(e,t){let n=document.querySelector(`slicc-image-preview[data-shared]`);return n||(n=document.createElement(`slicc-image-preview`),n.setAttribute(`data-shared`,``),document.body.appendChild(n)),n.open(e,t),()=>n.close()}};A(`slicc-image-preview`,Xt);var Zt=M(`
|
|
1350
1350
|
:host{display:block;margin-bottom:18px;font-family:var(--ui);font-size:15px;line-height:1.5;}
|
|
1351
1351
|
:host([hidden]){display:none;}
|
|
1352
1352
|
.msg{display:flex;justify-content:flex-end;}
|
|
@@ -1387,7 +1387,7 @@ slicc-tool-cluster .slicc-cluster__body slicc-action-row {
|
|
|
1387
1387
|
:host([queued]) .b{opacity:.62;}
|
|
1388
1388
|
.queued-tag{display:inline-flex;align-items:center;gap:4px;font-size:10.5px;color:var(--txt-3);}
|
|
1389
1389
|
.queued-tag svg{display:block;}
|
|
1390
|
-
`),
|
|
1390
|
+
`),Qt={image:`image`,text:`file-text`,file:`file`};function $t(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}A(`slicc-user-message`,class extends HTMLElement{static observedAttributes=[`text`,`queued`,`timestamp`];#e;#t=null;#n=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Zt]}connectedCallback(){this.#a()}attributeChangedCallback(){this.isConnected&&this.#a()}get text(){return this.getAttribute(`text`)}set text(e){e==null?this.removeAttribute(`text`):this.setAttribute(`text`,e)}get queued(){return this.hasAttribute(`queued`)}set queued(e){this.toggleAttribute(`queued`,e)}setBodyHtml(e){this.#t=e,this.#a()}setAttachments(e){this.#n=e.slice(),this.#a()}#r(){if(this.#t!=null)return this.ownerDocument.createRange().createContextualFragment(this.#t);let e=this.text;return e==null?j(`slot`):this.ownerDocument.createTextNode(e)}#i(e){let t=e.kind??`file`,r=j(`span`,{class:`attachment-chip__visual`});if(t===`image`&&e.src){let t=j(`img`,{src:e.src,alt:e.name||`Attached image`});t.addEventListener(`click`,n=>{n.stopPropagation(),Xt.show(e.src,t)}),r.append(t)}else r.append(n(Qt[t],{size:16}));let i=e.size==null?e.mime:`${e.mime||`file`} · ${$t(e.size)}`,a=j(`span`,{class:`attachment-chip__body`},j(`span`,{class:`attachment-chip__name`},e.name),i?j(`span`,{class:`attachment-chip__meta`},i):null);return j(`div`,{class:`attachment-chip attachment-chip--${t}`},r,a)}#a(){let e=this.#n.length>0,t=this.text!=null||this.#t!=null,r=this.childNodes.length>0,i=t||r||!e,a=j(`div`,{class:`stack`,part:`stack`}),o=this.getAttribute(`timestamp`);if(o&&a.append(j(`span`,{class:`ts`,part:`timestamp`},o)),e){let e=j(`div`,{class:`attachments`,part:`attachments`});for(let t of this.#n)e.append(this.#i(t));a.append(e)}i&&a.append(j(`div`,{class:`b`,part:`bubble`},this.#r())),this.queued&&a.append(j(`span`,{class:`queued-tag`,part:`queued`},n(`clock`,{size:11}),`queued`));let s=j(`div`,{class:`msg user`,part:`message`},a);this.#e.replaceChildren(s)}});var en=`
|
|
1391
1391
|
slicc-composer {
|
|
1392
1392
|
flex: 0 0 auto;
|
|
1393
1393
|
display: block;
|
|
@@ -1709,7 +1709,7 @@ slicc-composer .slicc-composer__ptt.is-picking {
|
|
|
1709
1709
|
animation-name: none;
|
|
1710
1710
|
}
|
|
1711
1711
|
}
|
|
1712
|
-
`,en=`slicc-composer-style`;function tn(e){if(e.getElementById(en))return;let t=e.createElement(`style`);t.id=en,t.textContent=$t,(e.head??e.documentElement).appendChild(t)}var nn=1e3,rn=60,an=1e4,on=45e3,sn=1500;function cn(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>i(n),t);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e instanceof Error?e:Error(String(e)))})})}var ln=`slicc-composer:mic-device`;function un(){try{return typeof localStorage>`u`?null:localStorage.getItem(ln)}catch{return null}}function dn(e){try{if(typeof localStorage>`u`)return;e?localStorage.setItem(ln,e):localStorage.removeItem(ln)}catch{}}function fn(e){return e==null||!Number.isFinite(e)?``:e<60?`~${Math.max(1,Math.round(e))}s`:`~${Math.floor(e/60)}m ${Math.round(e%60)}s`}A(`slicc-composer`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=!1;#n=null;#r=`idle`;#i=!1;#a=0;#o=null;#s=null;#c=null;#l=null;#u=null;#d=`unknown`;#f=un();#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=null;#w=[];connectedCallback(){tn(this.ownerDocument),this.#T(),this.addEventListener(`pointerdown`,this.#E)}disconnectedCallback(){this.removeEventListener(`pointerdown`,this.#E),this.#c?.cancel(),this.#c=null,this.#j(),this.#i=!1,this.#o=null,this.#a++,this.#z(),this.#L(),this.#m&&clearTimeout(this.#m),this.#m=null,this.#R(),this.#G(),this.#ee()}attributeChangedCallback(){}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get speech(){return this.#u??=s(),this.#u}set speech(e){this.#u=e,this.#d=`unknown`}get device(){return this.#f}set device(e){this.#f=e,dn(e)}get inner(){return this.#T(),this.#e}append(...e){this.#T(),this.#e.append(...e)}#T(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-composer__inner`);if(e instanceof HTMLElement){this.#e=e;return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-composer__inner`,this.#e.setAttribute(`part`,`inner`);for(let e of t)this.#e.appendChild(e);this.appendChild(this.#e)}#E=e=>{if(!this.hasAttribute(`ptt`)||!e.isPrimary||this.#i||e.button!==0||this.#r===`finalizing`||this.#r===`picking`)return;let t=e.target?.closest?.(`textarea`);if(!(t instanceof HTMLTextAreaElement)||!this.contains(t)||t.value!==``)return;this.#i=!0,this.#a++,this.#o=t,this.#s=e.pointerId;try{this.setPointerCapture(e.pointerId)}catch{}let n=this.ownerDocument;n.addEventListener(`pointerup`,this.#M),this.addEventListener(`pointercancel`,this.#N),n.addEventListener(`selectionchange`,this.#D);let r=this.#a;this.#h=setTimeout(()=>{this.#L(),this.#O(this.speech,r)},400)};#D=()=>{if(!this.#h)return;let e=this.ownerDocument.getSelection();!e||e.isCollapsed||e.toString()===``||(this.#i=!1,this.#a++,this.#o=null,this.#L(),this.#z(),this.#R())};async#O(e,t){let n=await Promise.race([e.permission().then(e=>(this.#d=e,e)),new Promise(e=>setTimeout(()=>e(`pending`),rn))]);if(!(t!==this.#a||!this.#i)){if(n===`granted`){this.#A(e,t);return}if(n===`denied`){this.#q(`denied`);return}this.#q(`enable`),this.#m=setTimeout(()=>{this.#m=null,this.#k(e,t)},nn),n===`pending`&&e.permission().then(n=>{this.#d=n,!(t!==this.#a||!this.#i||this.#r!==`enable`)&&(n===`granted`?(this.#I(),this.#A(e,t)):n===`denied`&&(this.#I(),this.#q(`denied`)))})}}#k(e,t){t!==this.#a||!this.#i||this.#r!==`enable`||(this.#v=null,this.#q(`prompting`),cn(e.requestPermission(),an,Error(`Microphone didn't respond. Check your mic, then hold again.`)).then(n=>{this.#d=n?`granted`:`denied`,n&&e.warmup(),t===this.#a&&(n&&this.#i?this.#A(e,t):n?this.#ee():this.#i?this.#q(`denied`):this.#ee())}).catch(e=>{this.#d=`denied`,t===this.#a&&(this.#i?(this.#v=e instanceof Error?e.message:String(e),this.#q(`denied`)):this.#ee())}))}#A(e,t){this.#r=`recording`,this.#q(`recording`),e.warmup(),this.#g?.(),this.#g=e.onStatus(e=>{this.#_=e,this.#Q()});let n=e.microphones();n.then(e=>{t===this.#a&&(this.#f??(this.#p=o(e)),i(e)&&this.#$(e))}).catch(()=>{});let r=(this.#f==null?cn(n,sn,Error(`microphone enumeration timed out`)).then(e=>o(e)).catch(()=>null):Promise.resolve(this.#f)).then(n=>e.start({deviceId:n??void 0,onPartial:e=>{t===this.#a&&this.#Z(e)},onError:e=>{t===this.#a&&this.#Z(e,!0)}}));this.#l=r,r.then(e=>{if(this.#l===r){if(this.#l=null,t!==this.#a||this.#r!==`recording`){e.cancel();return}this.#c=e}}).catch(e=>{this.#l===r&&(this.#l=null,t===this.#a&&this.#Z(e instanceof Error?e.message:String(e),!0))})}#j(){let e=this.#l;this.#l=null,e!==null&&e.then(e=>e.cancel(),()=>{})}#M=e=>{if(!this.#i||this.#s!=null&&e.pointerId!==this.#s)return;let t=this.#S,n=!1;if(this.#r===`recording`&&t&&!t.hidden)if(e.composedPath().includes(t))n=!0;else{let r=this.ownerDocument.elementFromPoint(e.clientX,e.clientY);n=r!=null&&t.contains(r)}if(n){this.#i=!1,this.#z(),this.#R(),this.#c?.cancel(),this.#c=null,this.#j(),this.#o=null,this.#B();return}this.#P(!0)};#N=e=>{(this.#s==null||e.pointerId===this.#s)&&this.#P(!1)};#P(e){if(!this.#i)return;switch(this.#i=!1,this.#L(),this.#z(),this.#R(),this.#r){case`enable`:this.#I(),this.#o=null,this.#ee();return;case`prompting`:this.#o=null;return;case`denied`:this.#o=null,this.#ee();return;case`recording`:break;default:this.#o=null,this.#ee();return}let t=this.#c;this.#c=null;let n=this.#l;if(this.#l=null,!e){t?.cancel(),n!==null&&n.then(e=>e.cancel(),()=>{}),this.#o=null,this.#ee();return}if(!t&&n===null){this.#o=null,this.#ee();return}this.#r=`finalizing`,this.#Z(`Transcribing…`);let r=this.#a;cn((t?Promise.resolve(t):n).then(e=>e.stop()),on,Error(`finalize timed out`)).then(e=>{r===this.#a&&(this.#ee(),this.#F(e))}).catch(()=>{r===this.#a&&(this.#ee(),this.#o=null)})}#F(e){let t=this.#o;if(this.#o=null,!t)return;let n=e.trim();if(!n){t.focus();return}t.value=t.value?/\s$/.test(t.value)?t.value+n:`${t.value} ${n}`:n,t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.focus();let r=t.closest(`slicc-input-card`);r&&typeof r.submit==`function`?r.submit(`dictation`):t.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:t.value,source:`dictation`}}))}#I(){this.#m&&clearTimeout(this.#m),this.#m=null}#L(){this.#h&&clearTimeout(this.#h),this.#h=null,this.ownerDocument.removeEventListener(`selectionchange`,this.#D)}#R(){this.ownerDocument.removeEventListener(`pointerup`,this.#M),this.removeEventListener(`pointercancel`,this.#N)}#z(){let e=this.#s;if(this.#s=null,e!=null)try{this.releasePointerCapture(e)}catch{}}#B(){this.#r=`picking`,this.#X(`picking`),this.#y&&(this.#y.textContent=`Choose a microphone`),this.#b&&(this.#b.hidden=!0),this.#V();let e=this.ownerDocument;e.addEventListener(`pointerdown`,this.#U,!0),e.addEventListener(`keydown`,this.#W,!0)}#V(){let e=this.#S;if(!e||this.#C)return;let t=j(`div`,{class:`slicc-composer__ptt-device-menu`,role:`menu`}),r=null,i=this.#f??this.#p;for(let e of this.#w){let a=e.deviceId===i,o=j(`button`,{type:`button`,class:`slicc-composer__ptt-device-item`,role:`menuitemradio`,"aria-checked":a?`true`:`false`,"data-device-id":e.deviceId},e.label,j(`span`,{class:`tick`},n(`check`,{size:14})));o.addEventListener(`click`,()=>{this.device=e.deviceId,this.#K()}),(a||!r)&&(r=o),t.appendChild(o)}this.#C=t,e.appendChild(t),this.#H(t,e),r?.focus()}#H(e,t){let n=t.getBoundingClientRect(),r=(window.innerHeight||document.documentElement.clientHeight)-n.bottom-6-8,i=n.top-6-8,a=e.offsetHeight>r&&i>r;e.classList.toggle(`slicc-composer__ptt-device-menu--up`,a);let o=Math.max(a?i:r,0);e.style.maxHeight=`${Math.min(320,o)}px`}#U=e=>{this.#S&&e.composedPath().includes(this.#S)||this.#K()};#W=e=>{e.key===`Escape`&&(e.stopPropagation(),this.#K())};#G(){let e=this.ownerDocument;e.removeEventListener(`pointerdown`,this.#U,!0),e.removeEventListener(`keydown`,this.#W,!0)}#K(){this.#G(),this.#ee()}#q(e){switch(this.#r=e,this.#n||(this.#n=j(`div`,{class:`slicc-composer__ptt`,"data-ptt":!0,role:`button`}),this.appendChild(this.#n)),this.#X(e),e){case`enable`:this.#J(n(`mic`,{size:28}),`Hold to enable push to talk`,this.#Y(`Requesting microphone access when the bar fills`)),this.#n.setAttribute(`aria-label`,`Hold to enable push to talk`);break;case`prompting`:this.#J(n(`mic`,{size:28}),`Allow microphone access in the browser prompt`,this.#Y(`Waiting for permission…`)),this.#n.setAttribute(`aria-label`,`Waiting for microphone permission`);break;case`denied`:{let e=this.#v?`Microphone unavailable`:`Microphone access is blocked`,t=this.#v??`Enable the microphone for this site in your browser settings, then hold again.`;this.#J(n(`mic-off`,{size:28}),e,j(`div`,{class:`slicc-composer__ptt-load-text`},t)),this.#n.setAttribute(`aria-label`,e);break}case`recording`:{this.#S=j(`div`,{class:`slicc-composer__ptt-device`,hidden:!0}),this.#b=j(`div`,{class:`slicc-composer__ptt-caption`,"aria-live":`polite`,hidden:!0}),this.#x=j(`div`,{class:`slicc-composer__ptt-status`,hidden:!0});let e=j(`div`,{class:`slicc-composer__ptt-microw`},j(`div`,{class:`slicc-composer__ptt-mic`},n(`mic`,{size:28})),this.#S);this.#y=j(`div`,{class:`slicc-composer__ptt-label`},`Listening — release to send`),this.#n.replaceChildren(e,this.#y,this.#b,this.#x),this.#n.setAttribute(`aria-label`,`Listening — release to send`),this.#Q();break}}}#J(e,t,n){this.#n&&(this.#y=j(`div`,{class:`slicc-composer__ptt-label`},t),this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=[],this.#n.replaceChildren(j(`div`,{class:`slicc-composer__ptt-mic`},e),this.#y,n))}#Y(e){return j(`div`,{class:`slicc-composer__ptt-load`},j(`span`,{class:`slicc-composer__ptt-load-text`},e),j(`div`,{class:`slicc-composer__ptt-bar`},j(`div`,{class:`slicc-composer__ptt-bar-fill`})))}#X(e){this.#n&&(this.#n.classList.remove(`is-enable`,`is-prompting`,`is-denied`,`is-recording`,`is-finalizing`,`is-picking`),e!==`idle`&&this.#n.classList.add(`is-${e}`))}#Z(e,t=!1){let n=this.#b;if(!n)return;let r=e.trim().split(/\s+/).filter(Boolean);if(r.length===0){n.hidden=!0;return}n.textContent=r.slice(-8).join(` `),n.classList.toggle(`is-error`,t),n.hidden=!1}#Q(){let e=this.#x;if(!e)return;let t=this.#_;if(t?.state===`downloading`){if(t.download){let n=fn(t.download.etaSeconds??null);e.textContent=n?`Better speech recognition downloading · ready in ${n}`:`Better speech recognition downloading…`}else e.textContent=`Preparing enhanced speech…`;e.classList.remove(`is-error`),e.hidden=!1}else t?.state===`ready`&&t.engine===`enhanced`?(e.textContent=`Enhanced speech recognition`,e.classList.remove(`is-error`),e.hidden=!1):t?.state===`unavailable`&&t.message?(e.textContent=t.message,e.classList.add(`is-error`),e.hidden=!1):(e.classList.remove(`is-error`),e.hidden=!0)}#$(e){let t=this.#S;if(!t)return;this.#w=e;let r=j(`button`,{type:`button`,class:`slicc-composer__ptt-device-btn`,"aria-label":`Choose a microphone`,"aria-haspopup":`menu`,title:`Choose a microphone`},n(`chevron-down`,{size:12}));r.addEventListener(`pointerdown`,e=>e.stopPropagation()),t.replaceChildren(r),t.hidden=!1}#ee(){this.#g?.(),this.#g=null,this.#n?.remove(),this.#n=null,this.#y=null,this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=[],this.#p=null,this.#v=null,this.#r=`idle`}});var pn=`
|
|
1712
|
+
`,tn=`slicc-composer-style`;function nn(e){if(e.getElementById(tn))return;let t=e.createElement(`style`);t.id=tn,t.textContent=en,(e.head??e.documentElement).appendChild(t)}var rn=1e3,an=60,on=1e4,sn=45e3,cn=1500;function ln(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>i(n),t);e.then(e=>{clearTimeout(a),r(e)},e=>{clearTimeout(a),i(e instanceof Error?e:Error(String(e)))})})}var un=`slicc-composer:mic-device`;function dn(){try{return typeof localStorage>`u`?null:localStorage.getItem(un)}catch{return null}}function fn(e){try{if(typeof localStorage>`u`)return;e?localStorage.setItem(un,e):localStorage.removeItem(un)}catch{}}function pn(e){return e==null||!Number.isFinite(e)?``:e<60?`~${Math.max(1,Math.round(e))}s`:`~${Math.floor(e/60)}m ${Math.round(e%60)}s`}A(`slicc-composer`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=!1;#n=null;#r=`idle`;#i=!1;#a=0;#o=null;#s=null;#c=null;#l=null;#u=null;#d=`unknown`;#f=dn();#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=null;#w=[];connectedCallback(){nn(this.ownerDocument),this.#T(),this.addEventListener(`pointerdown`,this.#E)}disconnectedCallback(){this.removeEventListener(`pointerdown`,this.#E),this.#c?.cancel(),this.#c=null,this.#j(),this.#i=!1,this.#o=null,this.#a++,this.#z(),this.#L(),this.#m&&clearTimeout(this.#m),this.#m=null,this.#R(),this.#G(),this.#ee()}attributeChangedCallback(){}get open(){return this.hasAttribute(`open`)}set open(e){e?this.setAttribute(`open`,``):this.removeAttribute(`open`)}get speech(){return this.#u??=s(),this.#u}set speech(e){this.#u=e,this.#d=`unknown`}get device(){return this.#f}set device(e){this.#f=e,fn(e)}get inner(){return this.#T(),this.#e}append(...e){this.#T(),this.#e.append(...e)}#T(){if(this.#t)return;this.#t=!0;let e=this.querySelector(`:scope > .slicc-composer__inner`);if(e instanceof HTMLElement){this.#e=e;return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-composer__inner`,this.#e.setAttribute(`part`,`inner`);for(let e of t)this.#e.appendChild(e);this.appendChild(this.#e)}#E=e=>{if(!this.hasAttribute(`ptt`)||!e.isPrimary||this.#i||e.button!==0||this.#r===`finalizing`||this.#r===`picking`)return;let t=e.target?.closest?.(`textarea`);if(!(t instanceof HTMLTextAreaElement)||!this.contains(t)||t.value!==``)return;this.#i=!0,this.#a++,this.#o=t,this.#s=e.pointerId;try{this.setPointerCapture(e.pointerId)}catch{}let n=this.ownerDocument;n.addEventListener(`pointerup`,this.#M),this.addEventListener(`pointercancel`,this.#N),n.addEventListener(`selectionchange`,this.#D);let r=this.#a;this.#h=setTimeout(()=>{this.#L(),this.#O(this.speech,r)},400)};#D=()=>{if(!this.#h)return;let e=this.ownerDocument.getSelection();!e||e.isCollapsed||e.toString()===``||(this.#i=!1,this.#a++,this.#o=null,this.#L(),this.#z(),this.#R())};async#O(e,t){let n=await Promise.race([e.permission().then(e=>(this.#d=e,e)),new Promise(e=>setTimeout(()=>e(`pending`),an))]);if(!(t!==this.#a||!this.#i)){if(n===`granted`){this.#A(e,t);return}if(n===`denied`){this.#q(`denied`);return}this.#q(`enable`),this.#m=setTimeout(()=>{this.#m=null,this.#k(e,t)},rn),n===`pending`&&e.permission().then(n=>{this.#d=n,!(t!==this.#a||!this.#i||this.#r!==`enable`)&&(n===`granted`?(this.#I(),this.#A(e,t)):n===`denied`&&(this.#I(),this.#q(`denied`)))})}}#k(e,t){t!==this.#a||!this.#i||this.#r!==`enable`||(this.#v=null,this.#q(`prompting`),ln(e.requestPermission(),on,Error(`Microphone didn't respond. Check your mic, then hold again.`)).then(n=>{this.#d=n?`granted`:`denied`,n&&e.warmup(),t===this.#a&&(n&&this.#i?this.#A(e,t):n?this.#ee():this.#i?this.#q(`denied`):this.#ee())}).catch(e=>{this.#d=`denied`,t===this.#a&&(this.#i?(this.#v=e instanceof Error?e.message:String(e),this.#q(`denied`)):this.#ee())}))}#A(e,t){this.#r=`recording`,this.#q(`recording`),e.warmup(),this.#g?.(),this.#g=e.onStatus(e=>{this.#_=e,this.#Q()});let n=e.microphones();n.then(e=>{t===this.#a&&(this.#f??(this.#p=o(e)),i(e)&&this.#$(e))}).catch(()=>{});let r=(this.#f==null?ln(n,cn,Error(`microphone enumeration timed out`)).then(e=>o(e)).catch(()=>null):Promise.resolve(this.#f)).then(n=>e.start({deviceId:n??void 0,onPartial:e=>{t===this.#a&&this.#Z(e)},onError:e=>{t===this.#a&&this.#Z(e,!0)}}));this.#l=r,r.then(e=>{if(this.#l===r){if(this.#l=null,t!==this.#a||this.#r!==`recording`){e.cancel();return}this.#c=e}}).catch(e=>{this.#l===r&&(this.#l=null,t===this.#a&&this.#Z(e instanceof Error?e.message:String(e),!0))})}#j(){let e=this.#l;this.#l=null,e!==null&&e.then(e=>e.cancel(),()=>{})}#M=e=>{if(!this.#i||this.#s!=null&&e.pointerId!==this.#s)return;let t=this.#S,n=!1;if(this.#r===`recording`&&t&&!t.hidden)if(e.composedPath().includes(t))n=!0;else{let r=this.ownerDocument.elementFromPoint(e.clientX,e.clientY);n=r!=null&&t.contains(r)}if(n){this.#i=!1,this.#z(),this.#R(),this.#c?.cancel(),this.#c=null,this.#j(),this.#o=null,this.#B();return}this.#P(!0)};#N=e=>{(this.#s==null||e.pointerId===this.#s)&&this.#P(!1)};#P(e){if(!this.#i)return;switch(this.#i=!1,this.#L(),this.#z(),this.#R(),this.#r){case`enable`:this.#I(),this.#o=null,this.#ee();return;case`prompting`:this.#o=null;return;case`denied`:this.#o=null,this.#ee();return;case`recording`:break;default:this.#o=null,this.#ee();return}let t=this.#c;this.#c=null;let n=this.#l;if(this.#l=null,!e){t?.cancel(),n!==null&&n.then(e=>e.cancel(),()=>{}),this.#o=null,this.#ee();return}if(!t&&n===null){this.#o=null,this.#ee();return}this.#r=`finalizing`,this.#Z(`Transcribing…`);let r=this.#a;ln((t?Promise.resolve(t):n).then(e=>e.stop()),sn,Error(`finalize timed out`)).then(e=>{r===this.#a&&(this.#ee(),this.#F(e))}).catch(()=>{r===this.#a&&(this.#ee(),this.#o=null)})}#F(e){let t=this.#o;if(this.#o=null,!t)return;let n=e.trim();if(!n){t.focus();return}t.value=t.value?/\s$/.test(t.value)?t.value+n:`${t.value} ${n}`:n,t.dispatchEvent(new Event(`input`,{bubbles:!0})),t.focus();let r=t.closest(`slicc-input-card`);r&&typeof r.submit==`function`?r.submit(`dictation`):t.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:t.value,source:`dictation`}}))}#I(){this.#m&&clearTimeout(this.#m),this.#m=null}#L(){this.#h&&clearTimeout(this.#h),this.#h=null,this.ownerDocument.removeEventListener(`selectionchange`,this.#D)}#R(){this.ownerDocument.removeEventListener(`pointerup`,this.#M),this.removeEventListener(`pointercancel`,this.#N)}#z(){let e=this.#s;if(this.#s=null,e!=null)try{this.releasePointerCapture(e)}catch{}}#B(){this.#r=`picking`,this.#X(`picking`),this.#y&&(this.#y.textContent=`Choose a microphone`),this.#b&&(this.#b.hidden=!0),this.#V();let e=this.ownerDocument;e.addEventListener(`pointerdown`,this.#U,!0),e.addEventListener(`keydown`,this.#W,!0)}#V(){let e=this.#S;if(!e||this.#C)return;let t=j(`div`,{class:`slicc-composer__ptt-device-menu`,role:`menu`}),r=null,i=this.#f??this.#p;for(let e of this.#w){let a=e.deviceId===i,o=j(`button`,{type:`button`,class:`slicc-composer__ptt-device-item`,role:`menuitemradio`,"aria-checked":a?`true`:`false`,"data-device-id":e.deviceId},e.label,j(`span`,{class:`tick`},n(`check`,{size:14})));o.addEventListener(`click`,()=>{this.device=e.deviceId,this.#K()}),(a||!r)&&(r=o),t.appendChild(o)}this.#C=t,e.appendChild(t),this.#H(t,e),r?.focus()}#H(e,t){let n=t.getBoundingClientRect(),r=(window.innerHeight||document.documentElement.clientHeight)-n.bottom-6-8,i=n.top-6-8,a=e.offsetHeight>r&&i>r;e.classList.toggle(`slicc-composer__ptt-device-menu--up`,a);let o=Math.max(a?i:r,0);e.style.maxHeight=`${Math.min(320,o)}px`}#U=e=>{this.#S&&e.composedPath().includes(this.#S)||this.#K()};#W=e=>{e.key===`Escape`&&(e.stopPropagation(),this.#K())};#G(){let e=this.ownerDocument;e.removeEventListener(`pointerdown`,this.#U,!0),e.removeEventListener(`keydown`,this.#W,!0)}#K(){this.#G(),this.#ee()}#q(e){switch(this.#r=e,this.#n||(this.#n=j(`div`,{class:`slicc-composer__ptt`,"data-ptt":!0,role:`button`}),this.appendChild(this.#n)),this.#X(e),e){case`enable`:this.#J(n(`mic`,{size:28}),`Hold to enable push to talk`,this.#Y(`Requesting microphone access when the bar fills`)),this.#n.setAttribute(`aria-label`,`Hold to enable push to talk`);break;case`prompting`:this.#J(n(`mic`,{size:28}),`Allow microphone access in the browser prompt`,this.#Y(`Waiting for permission…`)),this.#n.setAttribute(`aria-label`,`Waiting for microphone permission`);break;case`denied`:{let e=this.#v?`Microphone unavailable`:`Microphone access is blocked`,t=this.#v??`Enable the microphone for this site in your browser settings, then hold again.`;this.#J(n(`mic-off`,{size:28}),e,j(`div`,{class:`slicc-composer__ptt-load-text`},t)),this.#n.setAttribute(`aria-label`,e);break}case`recording`:{this.#S=j(`div`,{class:`slicc-composer__ptt-device`,hidden:!0}),this.#b=j(`div`,{class:`slicc-composer__ptt-caption`,"aria-live":`polite`,hidden:!0}),this.#x=j(`div`,{class:`slicc-composer__ptt-status`,hidden:!0});let e=j(`div`,{class:`slicc-composer__ptt-microw`},j(`div`,{class:`slicc-composer__ptt-mic`},n(`mic`,{size:28})),this.#S);this.#y=j(`div`,{class:`slicc-composer__ptt-label`},`Listening — release to send`),this.#n.replaceChildren(e,this.#y,this.#b,this.#x),this.#n.setAttribute(`aria-label`,`Listening — release to send`),this.#Q();break}}}#J(e,t,n){this.#n&&(this.#y=j(`div`,{class:`slicc-composer__ptt-label`},t),this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=[],this.#n.replaceChildren(j(`div`,{class:`slicc-composer__ptt-mic`},e),this.#y,n))}#Y(e){return j(`div`,{class:`slicc-composer__ptt-load`},j(`span`,{class:`slicc-composer__ptt-load-text`},e),j(`div`,{class:`slicc-composer__ptt-bar`},j(`div`,{class:`slicc-composer__ptt-bar-fill`})))}#X(e){this.#n&&(this.#n.classList.remove(`is-enable`,`is-prompting`,`is-denied`,`is-recording`,`is-finalizing`,`is-picking`),e!==`idle`&&this.#n.classList.add(`is-${e}`))}#Z(e,t=!1){let n=this.#b;if(!n)return;let r=e.trim().split(/\s+/).filter(Boolean);if(r.length===0){n.hidden=!0;return}n.textContent=r.slice(-8).join(` `),n.classList.toggle(`is-error`,t),n.hidden=!1}#Q(){let e=this.#x;if(!e)return;let t=this.#_;if(t?.state===`downloading`){if(t.download){let n=pn(t.download.etaSeconds??null);e.textContent=n?`Better speech recognition downloading · ready in ${n}`:`Better speech recognition downloading…`}else e.textContent=`Preparing enhanced speech…`;e.classList.remove(`is-error`),e.hidden=!1}else t?.state===`ready`&&t.engine===`enhanced`?(e.textContent=`Enhanced speech recognition`,e.classList.remove(`is-error`),e.hidden=!1):t?.state===`unavailable`&&t.message?(e.textContent=t.message,e.classList.add(`is-error`),e.hidden=!1):(e.classList.remove(`is-error`),e.hidden=!0)}#$(e){let t=this.#S;if(!t)return;this.#w=e;let r=j(`button`,{type:`button`,class:`slicc-composer__ptt-device-btn`,"aria-label":`Choose a microphone`,"aria-haspopup":`menu`,title:`Choose a microphone`},n(`chevron-down`,{size:12}));r.addEventListener(`pointerdown`,e=>e.stopPropagation()),t.replaceChildren(r),t.hidden=!1}#ee(){this.#g?.(),this.#g=null,this.#n?.remove(),this.#n=null,this.#y=null,this.#b=null,this.#x=null,this.#S=null,this.#C=null,this.#w=[],this.#p=null,this.#v=null,this.#r=`idle`}});var mn=`
|
|
1713
1713
|
slicc-composer-capture {
|
|
1714
1714
|
position: relative;
|
|
1715
1715
|
display: block;
|
|
@@ -1913,7 +1913,7 @@ slicc-composer-capture .slicc-capture__timer {
|
|
|
1913
1913
|
slicc-composer-capture .slicc-capture__timer[hidden] {
|
|
1914
1914
|
display: none;
|
|
1915
1915
|
}
|
|
1916
|
-
`,mn=`slicc-composer-capture-style`;function hn(e){if(e.getElementById(mn))return;let t=e.createElement(`style`);t.id=mn,t.textContent=pn,(e.head??e.documentElement).appendChild(t)}var gn=`photo`,_n=[`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`,`video/webm`];function vn(){if(typeof MediaRecorder>`u`)return`video/webm`;for(let e of _n)if(MediaRecorder.isTypeSupported?.(e))return e;return`video/webm`}function yn(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}A(`slicc-composer-capture`,class extends HTMLElement{static observedAttributes=[`mode`,`preferred-device`,`preferred-audio-device`];media=null;recorderFactory=null;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=!1;#u=null;#d=null;#f=null;#p=[];#m=0;#h=null;#g=null;#_=e=>{e.key===`Escape`&&this.#g&&this.#L()};connectedCallback(){hn(this.ownerDocument),this.#H(),this.ownerDocument.addEventListener(`keydown`,this.#_)}disconnectedCallback(){if(this.ownerDocument.removeEventListener(`keydown`,this.#_),this.#N(),this.#P(),this.#I(),this.#g){let e=this.#g;this.#g=null,e(null)}}attributeChangedCallback(e,t,n){e===`mode`&&this.#l&&this.#z(n??gn)}get mode(){return this.getAttribute(`mode`)===`video`?`video`:`photo`}set mode(e){e==null?this.removeAttribute(`mode`):this.setAttribute(`mode`,e)}get preferredDevice(){return this.getAttribute(`preferred-device`)}set preferredDevice(e){e==null?this.removeAttribute(`preferred-device`):this.setAttribute(`preferred-device`,e)}get preferredAudioDevice(){return this.getAttribute(`preferred-audio-device`)}set preferredAudioDevice(e){e==null?this.removeAttribute(`preferred-audio-device`):this.setAttribute(`preferred-audio-device`,e)}#v(){return this.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}#y(e,t){return this.recorderFactory?this.recorderFactory(e,t):new MediaRecorder(e,t)}async open(e){this.#H(),e&&(this.mode=e),this.#z(this.mode);let t=this.#v();if(!t)return null;try{this.#u=await this.#b(t,this.preferredDevice,this.preferredAudioDevice,this.mode)}catch{return null}return this.#S(),this.#C(this.#u),await this.#w(t),await this.#T(t),this.hidden=!1,new Promise(e=>{this.#g=e})}async#b(e,t,n,r){let i=await this.#x(e,n,r);if(t)try{return await e.getUserMedia({video:{deviceId:{exact:t}},audio:i})}catch{}try{return await e.getUserMedia({video:!0,audio:i})}catch(t){if(i===!1)throw t;return this.#r.textContent=`Microphone unavailable — recording video only.`,e.getUserMedia({video:!0,audio:!1})}}async#x(e,t,n){if(n!==`video`)return!1;if(t)return{deviceId:{exact:t}};let r=[];try{r=(await e.enumerateDevices()).filter(e=>e.kind===`audioinput`)}catch{r=[]}let i=o(a(r,`microphone`));return!i||{deviceId:{exact:i}}}#S(){this.#d=this.#u?.getAudioTracks()[0]??null}#C(e){this.#e.srcObject=e,this.#e.muted=!0,this.#e.play?.()?.catch(()=>void 0);let t=e.getVideoTracks()[0]?.getSettings?.().facingMode;this.#e.toggleAttribute(`data-mirrored`,t!==`environment`)}async#w(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`videoinput`)}catch{t=[]}let n=a(t,`camera`);this.#t.replaceChildren(...n.map(e=>j(`option`,{value:e.deviceId},e.label)));let r=this.#u?.getVideoTracks()[0]?.getSettings?.().deviceId;r&&(this.#t.value=r),this.#t.toggleAttribute(`hidden`,!i(n))}async#T(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`audioinput`)}catch{t=[]}let n=a(t,`microphone`);this.#n.replaceChildren(...n.map(e=>j(`option`,{value:e.deviceId},e.label)));let r=this.#d?.getSettings?.().deviceId??this.preferredAudioDevice??o(n);r&&n.some(e=>e.deviceId===r)&&(this.#n.value=r),this.#E()}#E(){if(!this.#n)return;let e=this.#n.options.length>=2,t=this.mode===`video`&&e;this.#n.toggleAttribute(`hidden`,!t)}async#D(e){let t=this.#v();if(t){this.#r.textContent=``;try{let n=await t.getUserMedia({video:{deviceId:{exact:e}}});this.#F();let r=n;if(this.mode===`video`&&this.#d&&this.#d.readyState===`live`)r.addTrack(this.#d);else if(this.mode===`video`)try{let e=await t.getUserMedia({audio:await this.#x(t,this.preferredAudioDevice,`video`)});for(let t of e.getAudioTracks())this.#d=t,r.addTrack(t)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}this.#u=r,this.#C(r),this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`camera`},bubbles:!0,composed:!0}))}catch{this.#r.textContent=`Could not switch camera — keeping the current one.`}}}async#O(e){let t=this.#v();if(!t||!this.#u)return;this.#r.textContent=``;let n;try{n=await t.getUserMedia({audio:{deviceId:{exact:e}}})}catch{this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}let r=n.getAudioTracks()[0];if(!r){this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}if(this.#d){try{this.#u.removeTrack(this.#d)}catch{}this.#d.stop()}this.#u.addTrack(r),this.#d=r,this.preferredAudioDevice=e,this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`microphone`},bubbles:!0,composed:!0}))}#k(){let e=this.ownerDocument.createElement(`canvas`);if(e.width=this.#e.videoWidth,e.height=this.#e.videoHeight,e.width===0||e.height===0){this.#r.textContent=`No frame yet — give the camera a moment.`;return}e.getContext(`2d`)?.drawImage(this.#e,0,0);let t=`image/png`,n=e.toDataURL(t);this.#R({kind:`image`,dataUrl:n,mimeType:t,width:e.width,height:e.height})}#A(){if(!this.#u||this.#f)return;this.#p=[];let e=vn(),t;try{t=this.#y(this.#u,{mimeType:e})}catch{this.#r.textContent=`Recording is not supported in this browser.`;return}t.ondataavailable=e=>{e.data&&e.data.size>0&&this.#p.push(e.data)},t.onstop=()=>this.#M(e);try{t.start()}catch{this.#r.textContent=`Could not start recording.`;return}this.#f=t,this.#m=Date.now(),this.#n.disabled=!0,this.#t.disabled=!0,this.#i.hidden=!1,this.#i.textContent=yn(0),this.#h=setInterval(()=>{this.#i.textContent=yn(Date.now()-this.#m)},250),this.#B()}#j(){let e=this.#f;if(e)try{e.state!==`inactive`&&e.stop()}catch{this.#M(e.mimeType||`video/webm`)}}#M(e){let t=this.#m?Date.now()-this.#m:0;this.#N();let n=this.#f?.mimeType||e||`video/webm`,r=new Blob(this.#p,{type:n});this.#p=[],this.#f=null,this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1);let i=typeof URL<`u`?URL.createObjectURL(r):void 0;this.#R({kind:`video`,blob:r,dataUrl:i,mimeType:n,width:this.#e.videoWidth,height:this.#e.videoHeight,durationMs:t})}#N(){this.#h!=null&&(clearInterval(this.#h),this.#h=null),this.#i.hidden=!0,this.#i.textContent=``,this.#m=0}#P(){let e=this.#f;if(this.#f=null,this.#p=[],this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1),e){e.ondataavailable=null,e.onstop=null;try{e.state!==`inactive`&&e.stop()}catch{}}}#F(){for(let e of this.#u?.getVideoTracks()??[])e.stop()}#I(){for(let e of this.#u?.getTracks()??[])e.stop();this.#u=null,this.#d=null,this.#e&&(this.#e.srcObject=null)}#L(){this.dispatchEvent(new CustomEvent(`slicc-capture-cancel`,{bubbles:!0,composed:!0})),this.#R(null)}#R(e){e&&this.dispatchEvent(new CustomEvent(`slicc-capture`,{detail:e,bubbles:!0,composed:!0})),this.#N(),this.#P(),this.#I();let t=this.#g;this.#g=null,this.hidden=!0,t?.(e)}#z(e){let t=e===`video`;this.#s.setAttribute(`aria-pressed`,String(!t)),this.#c.setAttribute(`aria-pressed`,String(t)),this.#r.textContent=t?`Mic on — video will record audio.`:``,this.#B(),this.#E()}#B(){let e=this.#a;if(e.replaceChildren(),this.mode===`photo`){e.className=`slicc-capture__btn slicc-capture__btn--primary`,e.setAttribute(`part`,`snap`),e.setAttribute(`aria-label`,`Snap photo`),e.append(n(`camera`,{size:14}),document.createTextNode(` Snap`));return}this.#f?(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`stop`),e.setAttribute(`aria-label`,`Stop recording`),e.append(j(`span`,{class:`slicc-capture__square`}),document.createTextNode(` Stop`))):(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`record`),e.setAttribute(`aria-label`,`Start recording`),e.append(j(`span`,{class:`slicc-capture__dot`}),document.createTextNode(` Record`)))}#V(){if(this.mode===`photo`){this.#k();return}this.#f?this.#j():this.#A()}#H(){if(this.#l)return;this.#l=!0,this.#e=j(`video`,{class:`slicc-capture__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#e.muted=!0,this.#r=j(`div`,{class:`slicc-capture__status`}),this.#t=j(`select`,{class:`slicc-capture__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#t.addEventListener(`change`,()=>{this.#D(this.#t.value)}),this.#n=j(`select`,{class:`slicc-capture__select`,part:`audio-picker`,"aria-label":`Microphone`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#O(this.#n.value)}),this.#s=j(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`true`,"aria-label":`Photo`},n(`image`,{size:14})),this.#s.addEventListener(`click`,()=>{this.mode=`photo`}),this.#c=j(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`false`,"aria-label":`Video`},n(`video`,{size:14})),this.#c.addEventListener(`click`,()=>{this.#U()});let e=j(`div`,{class:`slicc-capture__mode`,role:`group`,"aria-label":`Capture mode`},this.#s,this.#c);this.#i=j(`span`,{class:`slicc-capture__timer`,hidden:!0}),this.#o=j(`button`,{type:`button`,class:`slicc-capture__close`,part:`cancel`,"aria-label":`Cancel`},n(`x`,{size:14})),this.#o.addEventListener(`click`,()=>this.#L()),this.#a=j(`button`,{type:`button`,class:`slicc-capture__btn slicc-capture__btn--primary`,part:`snap`,"aria-label":`Snap photo`}),this.#a.addEventListener(`click`,()=>this.#V());let t=j(`div`,{class:`slicc-capture__bar`},this.#t,this.#n,j(`span`,{class:`slicc-capture__spacer`}),this.#i,this.#a,e);this.replaceChildren(this.#e,this.#r,t,this.#o),this.#z(this.mode)}async#U(){if(this.mode=`video`,!this.#u||this.#u.getAudioTracks().length>0)return;let e=this.#v();if(!e)return;let t=this.#u.getVideoTracks()[0]?.getSettings?.().deviceId??this.preferredDevice??null,n=await this.#x(e,this.preferredAudioDevice,`video`);try{let r=t?await e.getUserMedia({video:{deviceId:{exact:t}},audio:n}):await e.getUserMedia({video:!0,audio:n});this.#I(),this.#u=r,this.#S(),this.#C(r),await this.#T(e)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}}});var bn=[`off`,`low`,`medium`,`high`,`xhigh`,`max`],xn={off:{label:`Secco`,gloss:`bone dry — not a drop (ask any prosecco)`,tint:`var(--txt-3)`},low:{label:`Goccia`,gloss:`one drop — bar-speak: «macchiato, solo una goccia»`,tint:`color-mix(in srgb, var(--violet) 20%, var(--txt-3))`},medium:{label:`Bagnato`,gloss:`properly wet`,tint:`color-mix(in srgb, var(--violet) 40%, var(--txt-3))`},high:{label:`Affogato`,gloss:`drowned — the menu item itself`,tint:`color-mix(in srgb, var(--violet) 60%, var(--txt-3))`},xhigh:{label:`Inzuppato`,gloss:`soaked through, biscotto-style`,tint:`color-mix(in srgb, var(--violet) 80%, var(--txt-3))`},max:{label:`Sprofondato`,gloss:`sunk to the bottom`,tint:`var(--violet)`}},Sn=`max`,Cn=`Opus 4.8`,wn=[{name:`Opus 4.8`,provider:`Anthropic`,id:`claude-opus-4-8`},{name:`Sonnet 4.6`,provider:`Anthropic`,id:`claude-sonnet-4-6`},{name:`Haiku 4.5`,provider:`Anthropic`,id:`claude-haiku-4-5`}],Tn=8;function En(e){let t=typeof e==`string`?{name:e}:e;return{...t,name:t.name,id:t.id??t.name}}var Dn=`max`,On=13;function kn(){return n(`sparkles`,{size:On,class:`ic`,part:`model-icon`})}function An(){return n(`brain`,{size:On,class:`brain`,part:`brain`})}function jn(){return n(`chevron-down`,{size:11,part:`caret`})}var Mn=`http://www.w3.org/2000/svg`;function Nn(){let e=document.createElementNS(Mn,`svg`);e.setAttribute(`width`,`0`),e.setAttribute(`height`,`0`),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`style`,`position:absolute`);let t=document.createElementNS(Mn,`defs`),n=document.createElementNS(Mn,`linearGradient`);n.setAttribute(`id`,`meta-rainbow`),n.setAttribute(`x1`,`0`),n.setAttribute(`y1`,`0`),n.setAttribute(`x2`,`1`),n.setAttribute(`y2`,`0`);for(let[e,t]of[[`0%`,`#f43f5e`],[`28%`,`#f59e0b`],[`64%`,`#06b6d4`],[`100%`,`#8b5cf6`]]){let r=document.createElementNS(Mn,`stop`);r.setAttribute(`offset`,e),r.setAttribute(`stop-color`,t),n.appendChild(r)}return t.appendChild(n),e.appendChild(t),e}var Pn=M(`
|
|
1916
|
+
`,hn=`slicc-composer-capture-style`;function gn(e){if(e.getElementById(hn))return;let t=e.createElement(`style`);t.id=hn,t.textContent=mn,(e.head??e.documentElement).appendChild(t)}var _n=`photo`,vn=[`video/webm;codecs=vp9,opus`,`video/webm;codecs=vp8,opus`,`video/webm`];function yn(){if(typeof MediaRecorder>`u`)return`video/webm`;for(let e of vn)if(MediaRecorder.isTypeSupported?.(e))return e;return`video/webm`}function bn(e){let t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}A(`slicc-composer-capture`,class extends HTMLElement{static observedAttributes=[`mode`,`preferred-device`,`preferred-audio-device`];media=null;recorderFactory=null;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=!1;#u=null;#d=null;#f=null;#p=[];#m=0;#h=null;#g=null;#_=e=>{e.key===`Escape`&&this.#g&&this.#L()};connectedCallback(){gn(this.ownerDocument),this.#H(),this.ownerDocument.addEventListener(`keydown`,this.#_)}disconnectedCallback(){if(this.ownerDocument.removeEventListener(`keydown`,this.#_),this.#N(),this.#P(),this.#I(),this.#g){let e=this.#g;this.#g=null,e(null)}}attributeChangedCallback(e,t,n){e===`mode`&&this.#l&&this.#z(n??_n)}get mode(){return this.getAttribute(`mode`)===`video`?`video`:`photo`}set mode(e){e==null?this.removeAttribute(`mode`):this.setAttribute(`mode`,e)}get preferredDevice(){return this.getAttribute(`preferred-device`)}set preferredDevice(e){e==null?this.removeAttribute(`preferred-device`):this.setAttribute(`preferred-device`,e)}get preferredAudioDevice(){return this.getAttribute(`preferred-audio-device`)}set preferredAudioDevice(e){e==null?this.removeAttribute(`preferred-audio-device`):this.setAttribute(`preferred-audio-device`,e)}#v(){return this.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}#y(e,t){return this.recorderFactory?this.recorderFactory(e,t):new MediaRecorder(e,t)}async open(e){this.#H(),e&&(this.mode=e),this.#z(this.mode);let t=this.#v();if(!t)return null;try{this.#u=await this.#b(t,this.preferredDevice,this.preferredAudioDevice,this.mode)}catch{return null}return this.#S(),this.#C(this.#u),await this.#w(t),await this.#T(t),this.hidden=!1,new Promise(e=>{this.#g=e})}async#b(e,t,n,r){let i=await this.#x(e,n,r);if(t)try{return await e.getUserMedia({video:{deviceId:{exact:t}},audio:i})}catch{}try{return await e.getUserMedia({video:!0,audio:i})}catch(t){if(i===!1)throw t;return this.#r.textContent=`Microphone unavailable — recording video only.`,e.getUserMedia({video:!0,audio:!1})}}async#x(e,t,n){if(n!==`video`)return!1;if(t)return{deviceId:{exact:t}};let r=[];try{r=(await e.enumerateDevices()).filter(e=>e.kind===`audioinput`)}catch{r=[]}let i=o(a(r,`microphone`));return!i||{deviceId:{exact:i}}}#S(){this.#d=this.#u?.getAudioTracks()[0]??null}#C(e){this.#e.srcObject=e,this.#e.muted=!0,this.#e.play?.()?.catch(()=>void 0);let t=e.getVideoTracks()[0]?.getSettings?.().facingMode;this.#e.toggleAttribute(`data-mirrored`,t!==`environment`)}async#w(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`videoinput`)}catch{t=[]}let n=a(t,`camera`);this.#t.replaceChildren(...n.map(e=>j(`option`,{value:e.deviceId},e.label)));let r=this.#u?.getVideoTracks()[0]?.getSettings?.().deviceId;r&&(this.#t.value=r),this.#t.toggleAttribute(`hidden`,!i(n))}async#T(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`audioinput`)}catch{t=[]}let n=a(t,`microphone`);this.#n.replaceChildren(...n.map(e=>j(`option`,{value:e.deviceId},e.label)));let r=this.#d?.getSettings?.().deviceId??this.preferredAudioDevice??o(n);r&&n.some(e=>e.deviceId===r)&&(this.#n.value=r),this.#E()}#E(){if(!this.#n)return;let e=this.#n.options.length>=2,t=this.mode===`video`&&e;this.#n.toggleAttribute(`hidden`,!t)}async#D(e){let t=this.#v();if(t){this.#r.textContent=``;try{let n=await t.getUserMedia({video:{deviceId:{exact:e}}});this.#F();let r=n;if(this.mode===`video`&&this.#d&&this.#d.readyState===`live`)r.addTrack(this.#d);else if(this.mode===`video`)try{let e=await t.getUserMedia({audio:await this.#x(t,this.preferredAudioDevice,`video`)});for(let t of e.getAudioTracks())this.#d=t,r.addTrack(t)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}this.#u=r,this.#C(r),this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`camera`},bubbles:!0,composed:!0}))}catch{this.#r.textContent=`Could not switch camera — keeping the current one.`}}}async#O(e){let t=this.#v();if(!t||!this.#u)return;this.#r.textContent=``;let n;try{n=await t.getUserMedia({audio:{deviceId:{exact:e}}})}catch{this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}let r=n.getAudioTracks()[0];if(!r){this.#r.textContent=`Could not switch microphone — keeping the current one.`;return}if(this.#d){try{this.#u.removeTrack(this.#d)}catch{}this.#d.stop()}this.#u.addTrack(r),this.#d=r,this.preferredAudioDevice=e,this.dispatchEvent(new CustomEvent(`slicc-capture-device-change`,{detail:{deviceId:e,kind:`microphone`},bubbles:!0,composed:!0}))}#k(){let e=this.ownerDocument.createElement(`canvas`);if(e.width=this.#e.videoWidth,e.height=this.#e.videoHeight,e.width===0||e.height===0){this.#r.textContent=`No frame yet — give the camera a moment.`;return}e.getContext(`2d`)?.drawImage(this.#e,0,0);let t=`image/png`,n=e.toDataURL(t);this.#R({kind:`image`,dataUrl:n,mimeType:t,width:e.width,height:e.height})}#A(){if(!this.#u||this.#f)return;this.#p=[];let e=yn(),t;try{t=this.#y(this.#u,{mimeType:e})}catch{this.#r.textContent=`Recording is not supported in this browser.`;return}t.ondataavailable=e=>{e.data&&e.data.size>0&&this.#p.push(e.data)},t.onstop=()=>this.#M(e);try{t.start()}catch{this.#r.textContent=`Could not start recording.`;return}this.#f=t,this.#m=Date.now(),this.#n.disabled=!0,this.#t.disabled=!0,this.#i.hidden=!1,this.#i.textContent=bn(0),this.#h=setInterval(()=>{this.#i.textContent=bn(Date.now()-this.#m)},250),this.#B()}#j(){let e=this.#f;if(e)try{e.state!==`inactive`&&e.stop()}catch{this.#M(e.mimeType||`video/webm`)}}#M(e){let t=this.#m?Date.now()-this.#m:0;this.#N();let n=this.#f?.mimeType||e||`video/webm`,r=new Blob(this.#p,{type:n});this.#p=[],this.#f=null,this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1);let i=typeof URL<`u`?URL.createObjectURL(r):void 0;this.#R({kind:`video`,blob:r,dataUrl:i,mimeType:n,width:this.#e.videoWidth,height:this.#e.videoHeight,durationMs:t})}#N(){this.#h!=null&&(clearInterval(this.#h),this.#h=null),this.#i.hidden=!0,this.#i.textContent=``,this.#m=0}#P(){let e=this.#f;if(this.#f=null,this.#p=[],this.#n&&(this.#n.disabled=!1),this.#t&&(this.#t.disabled=!1),e){e.ondataavailable=null,e.onstop=null;try{e.state!==`inactive`&&e.stop()}catch{}}}#F(){for(let e of this.#u?.getVideoTracks()??[])e.stop()}#I(){for(let e of this.#u?.getTracks()??[])e.stop();this.#u=null,this.#d=null,this.#e&&(this.#e.srcObject=null)}#L(){this.dispatchEvent(new CustomEvent(`slicc-capture-cancel`,{bubbles:!0,composed:!0})),this.#R(null)}#R(e){e&&this.dispatchEvent(new CustomEvent(`slicc-capture`,{detail:e,bubbles:!0,composed:!0})),this.#N(),this.#P(),this.#I();let t=this.#g;this.#g=null,this.hidden=!0,t?.(e)}#z(e){let t=e===`video`;this.#s.setAttribute(`aria-pressed`,String(!t)),this.#c.setAttribute(`aria-pressed`,String(t)),this.#r.textContent=t?`Mic on — video will record audio.`:``,this.#B(),this.#E()}#B(){let e=this.#a;if(e.replaceChildren(),this.mode===`photo`){e.className=`slicc-capture__btn slicc-capture__btn--primary`,e.setAttribute(`part`,`snap`),e.setAttribute(`aria-label`,`Snap photo`),e.append(n(`camera`,{size:14}),document.createTextNode(` Snap`));return}this.#f?(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`stop`),e.setAttribute(`aria-label`,`Stop recording`),e.append(j(`span`,{class:`slicc-capture__square`}),document.createTextNode(` Stop`))):(e.className=`slicc-capture__btn slicc-capture__btn--rec`,e.setAttribute(`part`,`record`),e.setAttribute(`aria-label`,`Start recording`),e.append(j(`span`,{class:`slicc-capture__dot`}),document.createTextNode(` Record`)))}#V(){if(this.mode===`photo`){this.#k();return}this.#f?this.#j():this.#A()}#H(){if(this.#l)return;this.#l=!0,this.#e=j(`video`,{class:`slicc-capture__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#e.muted=!0,this.#r=j(`div`,{class:`slicc-capture__status`}),this.#t=j(`select`,{class:`slicc-capture__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#t.addEventListener(`change`,()=>{this.#D(this.#t.value)}),this.#n=j(`select`,{class:`slicc-capture__select`,part:`audio-picker`,"aria-label":`Microphone`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#O(this.#n.value)}),this.#s=j(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`true`,"aria-label":`Photo`},n(`image`,{size:14})),this.#s.addEventListener(`click`,()=>{this.mode=`photo`}),this.#c=j(`button`,{type:`button`,class:`slicc-capture__mode-btn`,part:`mode`,"aria-pressed":`false`,"aria-label":`Video`},n(`video`,{size:14})),this.#c.addEventListener(`click`,()=>{this.#U()});let e=j(`div`,{class:`slicc-capture__mode`,role:`group`,"aria-label":`Capture mode`},this.#s,this.#c);this.#i=j(`span`,{class:`slicc-capture__timer`,hidden:!0}),this.#o=j(`button`,{type:`button`,class:`slicc-capture__close`,part:`cancel`,"aria-label":`Cancel`},n(`x`,{size:14})),this.#o.addEventListener(`click`,()=>this.#L()),this.#a=j(`button`,{type:`button`,class:`slicc-capture__btn slicc-capture__btn--primary`,part:`snap`,"aria-label":`Snap photo`}),this.#a.addEventListener(`click`,()=>this.#V());let t=j(`div`,{class:`slicc-capture__bar`},this.#t,this.#n,j(`span`,{class:`slicc-capture__spacer`}),this.#i,this.#a,e);this.replaceChildren(this.#e,this.#r,t,this.#o),this.#z(this.mode)}async#U(){if(this.mode=`video`,!this.#u||this.#u.getAudioTracks().length>0)return;let e=this.#v();if(!e)return;let t=this.#u.getVideoTracks()[0]?.getSettings?.().deviceId??this.preferredDevice??null,n=await this.#x(e,this.preferredAudioDevice,`video`);try{let r=t?await e.getUserMedia({video:{deviceId:{exact:t}},audio:n}):await e.getUserMedia({video:!0,audio:n});this.#I(),this.#u=r,this.#S(),this.#C(r),await this.#T(e)}catch{this.#r.textContent=`Microphone unavailable — recording video only.`}}});var xn=[`off`,`low`,`medium`,`high`,`xhigh`,`max`],Sn={off:{label:`Secco`,gloss:`bone dry — not a drop (ask any prosecco)`,tint:`var(--txt-3)`},low:{label:`Goccia`,gloss:`one drop — bar-speak: «macchiato, solo una goccia»`,tint:`color-mix(in srgb, var(--violet) 20%, var(--txt-3))`},medium:{label:`Bagnato`,gloss:`properly wet`,tint:`color-mix(in srgb, var(--violet) 40%, var(--txt-3))`},high:{label:`Affogato`,gloss:`drowned — the menu item itself`,tint:`color-mix(in srgb, var(--violet) 60%, var(--txt-3))`},xhigh:{label:`Inzuppato`,gloss:`soaked through, biscotto-style`,tint:`color-mix(in srgb, var(--violet) 80%, var(--txt-3))`},max:{label:`Sprofondato`,gloss:`sunk to the bottom`,tint:`var(--violet)`}},Cn=`max`,wn=`Opus 4.8`,Tn=[{name:`Opus 4.8`,provider:`Anthropic`,id:`claude-opus-4-8`},{name:`Sonnet 4.6`,provider:`Anthropic`,id:`claude-sonnet-4-6`},{name:`Haiku 4.5`,provider:`Anthropic`,id:`claude-haiku-4-5`}],En=8;function Dn(e){let t=typeof e==`string`?{name:e}:e;return{...t,name:t.name,id:t.id??t.name}}var On=`max`,kn=13;function An(){return n(`sparkles`,{size:kn,class:`ic`,part:`model-icon`})}function jn(){return n(`brain`,{size:kn,class:`brain`,part:`brain`})}function Mn(){return n(`chevron-down`,{size:11,part:`caret`})}var Nn=`http://www.w3.org/2000/svg`;function Pn(){let e=document.createElementNS(Nn,`svg`);e.setAttribute(`width`,`0`),e.setAttribute(`height`,`0`),e.setAttribute(`aria-hidden`,`true`),e.setAttribute(`style`,`position:absolute`);let t=document.createElementNS(Nn,`defs`),n=document.createElementNS(Nn,`linearGradient`);n.setAttribute(`id`,`meta-rainbow`),n.setAttribute(`x1`,`0`),n.setAttribute(`y1`,`0`),n.setAttribute(`x2`,`1`),n.setAttribute(`y2`,`0`);for(let[e,t]of[[`0%`,`#f43f5e`],[`28%`,`#f59e0b`],[`64%`,`#06b6d4`],[`100%`,`#8b5cf6`]]){let r=document.createElementNS(Nn,`stop`);r.setAttribute(`offset`,e),r.setAttribute(`stop-color`,t),n.appendChild(r)}return t.appendChild(n),e.appendChild(t),e}var Fn=M(`
|
|
1917
1917
|
:host{display:block;}
|
|
1918
1918
|
*{box-sizing:border-box;}
|
|
1919
1919
|
.meta{display:flex;align-items:center;gap:8px;max-width:680px;margin:11px auto 0;font-family:var(--ui);}
|
|
@@ -1970,7 +1970,7 @@ slicc-composer-capture .slicc-capture__timer[hidden] {
|
|
|
1970
1970
|
/* Narrow / extension-sidebar: the ⏎ / ⇧⏎ keyboard hints don't fit (and touch
|
|
1971
1971
|
users have no keyboard) — drop them regardless of the narrow-chat attribute. */
|
|
1972
1972
|
@media (max-width: 560px){ .hint{display:none;} }
|
|
1973
|
-
`);A(`slicc-composer-meta`,class extends HTMLElement{static observedAttributes=[`model`,`thinking`,`narrow`,`no-thinking`];#e;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=null;#c=null;#l=!1;#u=!1;#d=``;#f=e=>{let t=e.composedPath();this.#l&&!t.includes(this)&&this.#S(),this.#u&&!t.includes(this)&&this.#D()};#p=e=>{e.key===`Escape`&&(this.#l&&(e.stopPropagation(),this.#S(),this.#r?.focus()),this.#u&&(e.stopPropagation(),this.#D(),this.#i?.focus()))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
1973
|
+
`);A(`slicc-composer-meta`,class extends HTMLElement{static observedAttributes=[`model`,`thinking`,`narrow`,`no-thinking`];#e;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=null;#c=null;#l=!1;#u=!1;#d=``;#f=e=>{let t=e.composedPath();this.#l&&!t.includes(this)&&this.#S(),this.#u&&!t.includes(this)&&this.#D()};#p=e=>{e.key===`Escape`&&(this.#l&&(e.stopPropagation(),this.#S(),this.#r?.focus()),this.#u&&(e.stopPropagation(),this.#D(),this.#i?.focus()))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Fn]}connectedCallback(){this.#g()}disconnectedCallback(){this.#y(),document.removeEventListener(`mousedown`,this.#f),document.removeEventListener(`keydown`,this.#p,!0)}attributeChangedCallback(){this.isConnected&&this.#g()}get model(){return this.getAttribute(`model`)??wn}set model(e){e==null?this.removeAttribute(`model`):this.setAttribute(`model`,e)}get models(){return(this.#c??[...Tn]).map(e=>typeof e==`string`?e:{...e})}set models(e){this.#c=Array.isArray(e)?e.slice():null,this.isConnected&&this.#g()}get#m(){return(this.#c??Tn).map(Dn)}get#h(){return this.#c!==null&&this.#c.length===0}get thinking(){let e=this.getAttribute(`thinking`);return xn.includes(e??``)?e:On}set thinking(e){this.setAttribute(`thinking`,e)}get narrow(){return this.hasAttribute(`narrow`)}set narrow(e){this.toggleAttribute(`narrow`,e)}get noThinking(){return this.hasAttribute(`no-thinking`)}set noThinking(e){this.toggleAttribute(`no-thinking`,e)}get accented(){return this.thinking===Cn}#g(){this.#y();let e=this.model,t=this.thinking,r=Sn[t],i=t===Cn,a=this.#h,o=a?j(`button`,{type:`button`,class:`ctl msel`,part:`model`},An(),` `,`Add AI`):j(`button`,{type:`button`,class:`ctl msel`,part:`model`,"aria-haspopup":`menu`,"aria-expanded":`false`},An(),` `,e,` `,j(`span`,{class:`cx`},Mn())),s=j(`div`,{class:`menu`,part:`model-menu`,role:`menu`});if(this.#m.length>En){let e=j(`input`,{class:`msearch`,part:`model-search`,type:`text`,placeholder:`Search models…`,"aria-label":`Search models`});e.value=this.#d,e.addEventListener(`input`,()=>{this.#d=e.value,this.#_()}),e.addEventListener(`click`,e=>e.stopPropagation()),s.append(e)}this.#s=j(`div`,{class:`mlist`,role:`none`}),s.append(this.#s);let c=j(`div`,{class:`mwrap`},o,s),l=!this.noThinking&&!a,u=null;if(l){let e=jn();e.style.color=r.tint;let a=j(`button`,{type:`button`,class:`ctl tsel${i?` x`:``}`,part:`thinking`,title:r.gloss,"aria-haspopup":`menu`,"aria-expanded":`false`},e,` `,j(`span`,{class:`tlabel`},r.label),` `,j(`span`,{class:`cx`},Mn()));a.style.setProperty(`--tw`,r.tint);let o=j(`div`,{class:`menu tmenu`,part:`thinking-menu`,role:`menu`}),s=j(`div`,{class:`mlist`,role:`none`});for(let e of xn){let r=Sn[e],i=j(`button`,{type:`button`,class:`mitem titem`,role:`menuitemradio`,"data-level":e,"aria-selected":e===t?`true`:`false`,title:r.gloss},j(`span`,{class:`mname`},r.label),j(`span`,{class:`tick`},n(`check`,{size:14})));i.addEventListener(`click`,()=>this.#k(e)),s.append(i)}o.append(s),u=j(`div`,{class:`twrap`},a,o)}let d=j(`slot`,{name:`hint`});we(d,[j(`span`,{class:`kbd`},`⏎`),` send `,j(`span`,{class:`sep`}),` `,j(`span`,{class:`kbd`},`⇧⏎`),` newline`]);let f=j(`div`,{class:`meta`,part:`meta`},c,u??!1,j(`div`,{class:`mspacer`}),j(`span`,{class:`hint`,part:`hint`},d));this.#e.replaceChildren(Pn(),f),this.#a=c,this.#o=this.#e.querySelector(`.twrap`),this.#r=this.#e.querySelector(`.msel`),this.#i=this.#e.querySelector(`.tsel`),this.#_(),this.#C(),this.#O(),this.#v()}#_(){let e=this.#s;if(!e)return;let t=this.#d.trim().toLowerCase(),r=this.#m.filter(e=>!t||`${e.name} ${e.provider??``}`.toLowerCase().includes(t)),i=this.model,a=[];for(let e of r){let t=e.name===i,r=j(`button`,{type:`button`,class:`mitem`,role:`menuitemradio`,"data-id":e.id,"aria-selected":t?`true`:`false`},j(`span`,{class:`mname`},e.name),e.provider?j(`span`,{class:`mprov`},e.provider):!1,j(`span`,{class:`tick`},n(`check`,{size:14})));r.addEventListener(`click`,()=>this.#w(e.id)),a.push(r)}e.replaceChildren(...a.length?a:[j(`div`,{class:`mempty`},`No models match.`)])}#v(){this.#r&&(this.#t=e=>{if(e.stopPropagation(),this.#h){this.dispatchEvent(new CustomEvent(`add-ai`,{bubbles:!0,composed:!0}));return}this.#b()},this.#r.addEventListener(`click`,this.#t)),this.#i&&(this.#n=()=>this.#T(),this.#i.addEventListener(`click`,this.#n))}#y(){this.#r&&this.#t&&this.#r.removeEventListener(`click`,this.#t),this.#i&&this.#n&&this.#i.removeEventListener(`click`,this.#n),this.#t=null,this.#n=null,this.#r=null,this.#i=null,this.#a=null,this.#o=null,this.#s=null}get menuOpen(){return this.#l}openMenu(){this.#h||this.#x()}#b(){this.#l?this.#S():this.#x()}#x(){if(this.#l)return;this.#D(),this.#l=!0,this.#d=``,this.#_(),this.#C();let e=this.#e.querySelector(`.msearch`);e&&(e.value=``,requestAnimationFrame(()=>e.focus())),document.addEventListener(`mousedown`,this.#f),document.addEventListener(`keydown`,this.#p,!0)}#S(){this.#l&&(this.#l=!1,this.#C(),this.#u||(document.removeEventListener(`mousedown`,this.#f),document.removeEventListener(`keydown`,this.#p,!0)))}#C(){this.#a?.classList.toggle(`open`,this.#l),this.#r?.setAttribute(`aria-expanded`,this.#l?`true`:`false`)}#w(e){let t=this.#m.find(t=>t.id===e)??{name:e,id:e,provider:void 0};this.#S(),t.name!==this.model&&(this.model=t.name),this.dispatchEvent(new CustomEvent(`model-change`,{detail:{model:t.name,provider:t.provider,id:t.id},bubbles:!0,composed:!0}))}#T(){this.#u?this.#D():this.#E()}#E(){this.#u||(this.#S(),this.#u=!0,this.#O(),document.addEventListener(`mousedown`,this.#f),document.addEventListener(`keydown`,this.#p,!0))}#D(){this.#u&&(this.#u=!1,this.#O(),this.#l||(document.removeEventListener(`mousedown`,this.#f),document.removeEventListener(`keydown`,this.#p,!0)))}#O(){this.#o?.classList.toggle(`open`,this.#u),this.#i?.setAttribute(`aria-expanded`,this.#u?`true`:`false`)}#k(e){this.#D(),this.thinking=e,this.dispatchEvent(new CustomEvent(`thinking-change`,{detail:{thinking:e,label:Sn[e].label,accented:e===Cn},bubbles:!0,composed:!0}))}});async function In(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}async function Ln(e,t={}){let n=(e??``).trim().toLowerCase();if(n===``)return null;let r=await In(n),i=t.size??80,a=t.fallback??`mp`;return`https://www.gravatar.com/avatar/${r}?s=${i}&d=${encodeURIComponent(a)}`}var Rn=M(`
|
|
1974
1974
|
:host { display: inline-flex; }
|
|
1975
1975
|
:host([hidden]) { display: none; }
|
|
1976
1976
|
|
|
@@ -2173,7 +2173,7 @@ slicc-composer-capture .slicc-capture__timer[hidden] {
|
|
|
2173
2173
|
}
|
|
2174
2174
|
.glyph.is-press { transform: none; }
|
|
2175
2175
|
}
|
|
2176
|
-
`),
|
|
2176
|
+
`),zn=18,Bn=72,Vn=`http://www.w3.org/2000/svg`,Hn=15,Un=.25;function Wn(e){let t=document.createElementNS(Vn,`svg`);t.setAttribute(`width`,`36`),t.setAttribute(`height`,`36`),t.setAttribute(`viewBox`,`0 0 36 36`),t.setAttribute(`fill`,`none`),t.setAttribute(`aria-hidden`,`true`);let n=2*Math.PI*Hn,r=e=>{let t=document.createElementNS(Vn,`circle`);return t.setAttribute(`cx`,`18`),t.setAttribute(`cy`,`18`),t.setAttribute(`r`,String(Hn)),t.setAttribute(`fill`,`none`),t.setAttribute(`stroke-width`,`2.5`),t.setAttribute(`stroke-linecap`,`round`),t.setAttribute(`class`,e),t};t.appendChild(r(`ring-track`));let i=r(`ring-arc`),a=e==null?Un:Math.max(0,Math.min(1,e));return i.setAttribute(`stroke-dasharray`,`${n*a} ${n}`),e!=null&&i.setAttribute(`transform`,`rotate(-90 18 18)`),t.appendChild(i),t}function Gn(e){return e===`tool`?`tool`:`thinking`}function Kn(e){if(e==null||e.trim()===``)return null;let t=Number(e);return Number.isFinite(t)?Math.max(0,Math.min(1,t)):null}A(`slicc-send-button`,class extends HTMLElement{static observedAttributes=[`disabled`,`busy`,`phase`,`progress`,`email`,`src`,`label`];#e;#t=null;#n=0;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Rn]}connectedCallback(){this.#d()}attributeChangedCallback(){this.isConnected&&this.#d()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}get busy(){return this.hasAttribute(`busy`)}set busy(e){this.toggleAttribute(`busy`,!!e)}get phase(){return Gn(this.getAttribute(`phase`))}set phase(e){this.setAttribute(`phase`,Gn(e))}get progress(){return Kn(this.getAttribute(`progress`))}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,String(e))}get email(){return this.getAttribute(`email`)}set email(e){e==null?this.removeAttribute(`email`):this.setAttribute(`email`,e)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#r=()=>{if(!this.disabled){if(this.busy){this.dispatchEvent(new CustomEvent(`stop`,{bubbles:!0,composed:!0}));return}this.#l(),this.dispatchEvent(new CustomEvent(`send`,{bubbles:!0,composed:!0}))}};#i(){return this.#e.querySelector(`.glyph`)}#a=()=>{this.disabled||this.busy||this.#i()?.classList.add(`is-hover`)};#o=()=>{this.#i()?.classList.remove(`is-hover`,`is-press`)};#s=()=>{if(this.disabled||this.busy)return;let e=this.#i();e?.classList.add(`is-press`),e?.classList.remove(`is-hover`)};#c=()=>{this.#i()?.classList.remove(`is-press`)};#l(){let e=this.#e.querySelector(`.glyph`);e&&(e.classList.remove(`is-whoosh`),e.offsetWidth,e.classList.add(`is-whoosh`),e.addEventListener(`animationend`,()=>e.classList.remove(`is-whoosh`),{once:!0}))}#u(){let e=++this.#n;if(!this.#t)return;let t=t=>{if(e!==this.#n)return;let n=this.#t;if(n)if(n.querySelector(`.face`)?.remove(),t){let e=document.createElement(`img`);e.className=`face`,e.setAttribute(`part`,`face`),e.alt=``,e.src=t,n.prepend(e),n.classList.add(`has-face`)}else n.classList.remove(`has-face`)},n=this.src;if(n){t(n);return}let r=this.email;if(!r||r.trim()===``){t(null);return}t(null),Ln(r,{size:Bn}).then(t).catch(()=>t(null))}#d(){let e=this.busy,t=this.disabled,r=e&&this.phase===`tool`,i=this.label??(e?`Stop`:`Send`),a;if(r){let e=this.progress,t=e==null;a=j(`slot`,{name:`busy`},j(`span`,{class:`stop`,part:`stop`},n(`square`,{size:zn})),j(`span`,{class:`spinner${t?` is-indeterminate`:``}`,part:`spinner`},Wn(e)))}else a=e?j(`slot`,{name:`busy`},j(`span`,{class:`stop`,part:`stop`},n(`square`,{size:zn}),j(`span`,{class:`stop-fill`},n(`square`,{size:zn})))):j(`slot`,null,j(`span`,{class:`glyph`,part:`glyph`},n(`arrow-up`,{size:zn})));let o=j(`button`,{part:`button`,class:`send${e?` is-busy`:``}${r?` is-tool`:``}`,type:`button`,title:i,"aria-label":i,disabled:t||void 0},a);this.#e.replaceChildren(o),this.#t=o,this.#t.addEventListener(`click`,this.#r),this.#t.addEventListener(`pointerenter`,this.#a),this.#t.addEventListener(`pointerleave`,this.#o),this.#t.addEventListener(`pointerdown`,this.#s),this.#t.addEventListener(`pointerup`,this.#c),this.#u()}});var qn=`
|
|
2177
2177
|
slicc-input-card {
|
|
2178
2178
|
display: block;
|
|
2179
2179
|
}
|
|
@@ -2227,7 +2227,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2227
2227
|
flex: 1;
|
|
2228
2228
|
min-width: 0;
|
|
2229
2229
|
}
|
|
2230
|
-
`,
|
|
2230
|
+
`,Jn=`slicc-input-card-style`;function Yn(e){if(e.getElementById(Jn))return;let t=e.createElement(`style`);t.id=Jn,t.textContent=qn,(e.head??e.documentElement).appendChild(t)}var Xn=`Ask sliccy, or describe a change…`;A(`slicc-input-card`,class extends HTMLElement{static observedAttributes=[`value`,`placeholder`,`suggestion`,`disabled`];#e;#t;#n;#r=!1;connectedCallback(){Yn(this.ownerDocument),this.#i(),this.#a(),this.#u()}attributeChangedCallback(e,t,n){!this.#r||t===n||(this.#a(),e===`value`&&this.#u())}get value(){return this.#r?this.#t.value:this.getAttribute(`value`)??``}set value(e){let t=e??``;this.#r&&(this.#t.value=t,this.#u()),t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t)}get placeholder(){return this.getAttribute(`placeholder`)??Xn}set placeholder(e){e==null?this.removeAttribute(`placeholder`):this.setAttribute(`placeholder`,e)}get suggestion(){return this.getAttribute(`suggestion`)}set suggestion(e){e==null||e===``?this.removeAttribute(`suggestion`):this.setAttribute(`suggestion`,e)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,!!e)}focus(e){this.#i(),this.#t.focus(e)}clear(){this.value=``}#i(){if(this.#r)return;this.#r=!0;let e=this.ownerDocument,t=Array.from(this.children).filter(e=>e.getAttribute(`slot`)===`toolbar`);if(this.replaceChildren(),this.#e=e.createElement(`div`),this.#e.className=`slicc-input-card__card`,this.#e.setAttribute(`part`,`card`),this.#t=e.createElement(`textarea`),this.#t.className=`ta`,this.#t.setAttribute(`part`,`textarea`),this.#t.rows=1,this.#n=e.createElement(`div`),this.#n.className=`toolbar`,this.#n.setAttribute(`part`,`toolbar`),t.length>0)for(let e of t)this.#n.appendChild(e);else this.#n.append(j(`slicc-add-menu`),j(`slicc-send-button`));this.#e.append(this.#t,this.#n),this.appendChild(this.#e),this.#t.addEventListener(`input`,this.#o),this.#t.addEventListener(`keydown`,this.#s),this.#n.addEventListener(`send`,this.#c)}#a(){if(!this.#r)return;let e=this.#t;e.placeholder=this.suggestion??this.placeholder,e.disabled=this.disabled;let t=this.getAttribute(`value`)??``;e.value!==t&&(e.value=t)}#o=e=>{e.stopPropagation();let t=this.#t.value;t===``?this.removeAttribute(`value`):this.setAttribute(`value`,t),this.#u(),this.dispatchEvent(new CustomEvent(`input`,{bubbles:!0,composed:!0,detail:{value:t}}))};#s=e=>{if(e.isComposing)return;if(e.key===`Enter`&&!e.shiftKey&&!e.altKey){e.preventDefault(),this.#l(void 0,e.ctrlKey||e.metaKey);return}if(e.key===`Tab`&&!e.shiftKey&&!e.altKey&&!e.ctrlKey&&!e.metaKey){let t=this.suggestion;if(t&&this.#t.value===``){e.preventDefault(),this.removeAttribute(`suggestion`);let n=this.#t;n.value=t,n.setSelectionRange(t.length,t.length),n.dispatchEvent(new Event(`input`,{bubbles:!0}))}return}let t=this.#t,n=t.selectionStart===t.selectionEnd;e.key===`ArrowUp`&&n&&t.selectionStart===0?(e.preventDefault(),this.dispatchEvent(new CustomEvent(`history-up`,{bubbles:!0,composed:!0}))):e.key===`ArrowDown`&&n&&t.selectionStart===t.value.length&&this.dispatchEvent(new CustomEvent(`history-down`,{bubbles:!0,composed:!0}))};#c=e=>{e.stopPropagation(),this.#l()};submit(e){this.#i(),this.#l(e)}focusEnd(){if(!this.#r)return;let e=this.#t;e.focus();let t=e.value.length;e.setSelectionRange(t,t)}#l(e,t){if(this.disabled)return;let n=this.#t.value;n.trim()!==``&&(this.removeAttribute(`suggestion`),this.dispatchEvent(new CustomEvent(`submit`,{bubbles:!0,composed:!0,detail:{value:n,...e?{source:e}:{},...t?{steer:!0}:{}}})))}#u(){if(!this.#r)return;let e=this.#t;e.style.height=`auto`;let t=e.scrollHeight;e.style.height=`${Math.min(t,140)}px`,e.style.overflowY=t>140?`auto`:`hidden`}});var Zn=M(`
|
|
2231
2231
|
:host{display:block;font-family:var(--ui);}
|
|
2232
2232
|
:host(:not([count])),:host([count="0"]),:host([count="-0"]){display:none;}
|
|
2233
2233
|
.wrap{display:flex;flex-direction:column;align-items:stretch;gap:6px;}
|
|
@@ -2248,7 +2248,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2248
2248
|
:host-context(body.dark) .dismiss:hover,:host-context(body.dark) .dismiss:focus-visible,
|
|
2249
2249
|
:host-context(.dark) .dismiss:hover,:host-context(.dark) .dismiss:focus-visible,
|
|
2250
2250
|
:host-context([data-theme="dark"]) .dismiss:hover,:host-context([data-theme="dark"]) .dismiss:focus-visible{background:color-mix(in srgb,#0a0a0a 14%,transparent);}
|
|
2251
|
-
`),
|
|
2251
|
+
`),Qn=[{rot:0,x:0,y:0},{rot:-2,x:-3,y:-2},{rot:2,x:3,y:-4},{rot:-3,x:-5,y:-6},{rot:3,x:5,y:-8},{rot:-1,x:-2,y:-10},{rot:1,x:2,y:-12}];function $n(e){return Qn[Math.min(e,Qn.length-1)]??Qn[0]}A(`slicc-queued-stack`,class extends HTMLElement{#e;#t=[];constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Zn]}connectedCallback(){this.#i()}get count(){return this.#t.length}setMessages(e){this.#t=e.slice(),this.setAttribute(`count`,String(this.#t.length)),this.#i()}#n(e){this.dispatchEvent(new CustomEvent(`slicc-queued-remove`,{detail:{id:e},bubbles:!0,composed:!0}))}#r(e,t,r,i){let{rot:a,x:o,y:s}=$n(t),c=r?`none`:`translate(${o}px, ${s}px) rotate(${a}deg)`,l=`card${r?` is-front`:``}${t===0?``:t===1?` is-back`:` is-deep`}`,u=r?`card front`:`card`,d=`transform:${c};z-index:${i};`,f=[j(`span`,{class:`bubble`},e.text)];if(e.attachments&&e.attachments>0&&f.push(j(`span`,{class:`attach`},`+${e.attachments}`)),r){let t=j(`button`,{type:`button`,class:`dismiss`,part:`dismiss`,"aria-label":`Remove queued message`},n(`x`,{size:14}));t.addEventListener(`click`,t=>{t.stopPropagation(),this.#n(e.id)}),f.push(t)}return j(`div`,{class:l,part:u,style:d},...f)}#i(){if(this.#t.length===0){this.#e.replaceChildren();return}let e=this.#t.length,t=[];for(let n=e-1;n>=0;n--){let r=e-1-n,i=r===0,a=n+1,o=this.#t[n];o&&t.push(this.#r(o,r,i,a))}let r=j(`div`,{class:`stack`,part:`stack`},...t),i=j(`div`,{class:`wrap`},j(`span`,{class:`badge`,part:`badge`},n(`clock`,{size:11}),`${e} queued`),r);this.#e.replaceChildren(i)}});var er=1e3;function tr(e,t){let n=t.longPressMs??1e3,r=t.modifierClickAsLongPress??!0,i=null,a=!1,o=()=>{t.onPressEnd?.()},s=()=>{i!==null&&(clearTimeout(i),i=null),o()},c=e=>{e.button===0&&(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(a=!1,s(),t.onPressStart?.(e),i=setTimeout(()=>{a=!0,o(),i=null,t.onLongPress()},n)))},l=()=>s(),u=()=>s(),d=()=>s(),f=()=>s(),p=e=>{if(a){a=!1,e.preventDefault();return}if((e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)&&r){e.preventDefault(),t.onLongPress();return}t.onShortClick(e)};return e.addEventListener(`mousedown`,c),e.addEventListener(`mouseup`,l),e.addEventListener(`mouseleave`,u),e.addEventListener(`blur`,d),e.addEventListener(`contextmenu`,f),e.addEventListener(`click`,p),{destroy:()=>{s(),e.removeEventListener(`mousedown`,c),e.removeEventListener(`mouseup`,l),e.removeEventListener(`mouseleave`,u),e.removeEventListener(`blur`,d),e.removeEventListener(`contextmenu`,f),e.removeEventListener(`click`,p)}}}var nr=M(`
|
|
2252
2252
|
:host { display: inline-grid; }
|
|
2253
2253
|
:host([hidden]) { display: none; }
|
|
2254
2254
|
|
|
@@ -2330,7 +2330,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2330
2330
|
|
|
2331
2331
|
.glyph { display: grid; place-items: center; line-height: 1; }
|
|
2332
2332
|
.glyph svg { display: block; }
|
|
2333
|
-
`),
|
|
2333
|
+
`),rr=`square`,ir=18;A(`slicc-dock-item`,class extends HTMLElement{static observedAttributes=[`item-id`,`kind`,`hue`,`icon`,`tip`,`active`,`lit`];#e;#t=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[nr]}disconnectedCallback(){this.#t?.destroy(),this.#t=null}connectedCallback(){this.#n()}attributeChangedCallback(){this.isConnected&&this.#n()}get itemId(){return this.getAttribute(`item-id`)}set itemId(e){e==null?this.removeAttribute(`item-id`):this.setAttribute(`item-id`,e)}get kind(){return this.getAttribute(`kind`)===`sprinkle`?`sprinkle`:`tool`}set kind(e){this.setAttribute(`kind`,e===`sprinkle`?`sprinkle`:`tool`)}get hue(){return this.getAttribute(`hue`)}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get icon(){return this.getAttribute(`icon`)??rr}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get tip(){return this.getAttribute(`tip`)}set tip(e){e==null?this.removeAttribute(`tip`):this.setAttribute(`tip`,e)}get active(){return this.hasAttribute(`active`)}set active(e){this.toggleAttribute(`active`,!!e)}get lit(){return this.hasAttribute(`lit`)}set lit(e){this.toggleAttribute(`lit`,!!e)}#n(){let e=[`di`];this.kind===`sprinkle`&&e.push(`sp`),this.active&&e.push(`on`),this.lit&&e.push(`lit`);let t=this.tip,r=n(this.icon,{size:ir,part:`icon`}),i=t??this.itemId??`dock item`,a=j(`button`,{type:`button`,part:`button`,class:e.join(` `),"aria-label":i,"aria-pressed":this.active?`true`:`false`},j(`span`,{class:`glyph`,part:`glyph`},j(`slot`,null,r)),t?j(`span`,{class:`tip`,part:`tip`},t):null),o=this.hue;o&&a.style.setProperty(`--h`,o),this.#t?.destroy(),this.#t=tr(a,{onShortClick:this.#r,onLongPress:()=>this.#i(`longpress`)}),this.#e.replaceChildren(a)}#r=()=>{this.#i(this.active?`collapse`:`select`)};#i(e){this.dispatchEvent(new CustomEvent(e,{detail:{id:this.itemId},bubbles:!0,composed:!0}))}});var ar=[{id:`browser`,icon:`globe`,label:`Browser · CDP`,kind:`tool`},{id:`files`,icon:`folder`,label:`Files · VFS`,kind:`tool`},{id:`term`,icon:`square-terminal`,label:`Terminal`,kind:`tool`},{id:`memory`,icon:`brain`,label:`Memory`,kind:`tool`},{id:`monitor`,icon:`activity`,label:`Monitor`,kind:`tool`}],or={id:`new`,icon:`plus`,label:`New sprinkle`,kind:`sprinkle`},sr=`
|
|
2334
2334
|
.slicc-dock {
|
|
2335
2335
|
flex: 0 0 48px;
|
|
2336
2336
|
box-sizing: border-box;
|
|
@@ -2351,7 +2351,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2351
2351
|
margin: 2px 0;
|
|
2352
2352
|
}
|
|
2353
2353
|
.slicc-dock .grow { flex: 1; }
|
|
2354
|
-
`,
|
|
2354
|
+
`,cr=`slicc-dock-style`;function lr(e){if(e.getElementById(cr))return;let t=e.createElement(`style`);t.id=cr,t.textContent=sr,(e.head??e.documentElement).appendChild(t)}function ur(e){return e===`sprinkle`?`sprinkle`:`tool`}A(`slicc-dock`,class extends HTMLElement{static get observedAttributes(){return[`active`,`system-tools`]}#e=[];#t=null;#n=null;#r=null;#i=!1;connectedCallback(){lr(this.ownerDocument),this.classList.add(`slicc-dock`),this.setAttribute(`part`,`rail`),this.setAttribute(`role`,`toolbar`),this.setAttribute(`aria-orientation`,`vertical`),this.#i||=(this.#a(),!0),this.#t||(this.#t=e=>this.#u(e),this.#n=e=>this.#d(e),this.#r=e=>this.#f(e),this.addEventListener(`select`,this.#t),this.addEventListener(`collapse`,this.#n),this.addEventListener(`longpress`,this.#r)),this.#c()}disconnectedCallback(){this.#t&&=(this.removeEventListener(`select`,this.#t),null),this.#n&&=(this.removeEventListener(`collapse`,this.#n),null),this.#r&&=(this.removeEventListener(`longpress`,this.#r),null)}attributeChangedCallback(e){this.#i&&(e===`active`?this.#l():e===`system-tools`&&this.#c())}get items(){return this.#e.map(e=>({...e}))}set items(e){this.#e=Array.isArray(e)?e.map(e=>({...e})):[],this.#i&&this.isConnected&&this.#c()}get active(){return this.getAttribute(`active`)}set active(e){e==null?this.removeAttribute(`active`):this.setAttribute(`active`,e)}get systemTools(){return this.hasAttribute(`system-tools`)}set systemTools(e){this.toggleAttribute(`system-tools`,!!e)}selectItem(e){this.active=e,this.dispatchEvent(new CustomEvent(`slicc-dock-select`,{detail:{id:e,kind:this.#o(e)},bubbles:!0,composed:!0}))}clearActive(){this.active=null}collapse(){let e=this.active;this.active=null,e!=null&&this.dispatchEvent(new CustomEvent(`slicc-dock-collapse`,{detail:{id:e},bubbles:!0,composed:!0}))}#a(){let e=[...this.querySelectorAll(`slicc-dock-item`)];if(e.length===0)return;let t=[];for(let n of e){let e=ur(n.getAttribute(`kind`)),r=n.getAttribute(`item-id`)??n.dataset.t??n.getAttribute(`tip`)??``;e!==`tool`&&r!==`new`&&r!==``&&t.push({id:r,icon:n.getAttribute(`icon`)??void 0,label:n.getAttribute(`tip`)??void 0,kind:`sprinkle`,hue:n.getAttribute(`hue`)??void 0})}for(let t of e)t.remove();this.#e.length===0&&(this.#e=t)}#o(e){return ar.some(t=>t.id===e)?`tool`:e===or.id?`sprinkle`:this.#e.find(t=>t.id===e)?.kind??`tool`}#s(e,t){let n=e.id,r=ur(e.kind),i=e.icon??``,a=e.label??n,o=t!=null&&t===n,s=e.hue;return j(`slicc-dock-item`,{"data-t":n,"item-id":n,kind:r,icon:i||!1,tip:a,hue:s||!1,active:o})}#c(){let e=this.active,t=[];for(let n of this.#e)ur(n.kind)===`sprinkle`&&t.push(this.#s(n,e));if(t.push(this.#s(or,e)),t.push(j(`div`,{class:`grow`})),this.systemTools){t.push(j(`div`,{class:`div`}));for(let n of ar)t.push(this.#s(n,e))}this.replaceChildren(),we(this,t)}#l(){let e=this.active;for(let t of this.querySelectorAll(`slicc-dock-item`))t.toggleAttribute(`active`,t.dataset.t===e)}#u(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.selectItem(t))}#d(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.active!==t&&(this.active=t),this.collapse())}#f(e){let t=this.#p(e);t!=null&&(e.stopPropagation(),this.active!==t&&this.selectItem(t),this.dispatchEvent(new CustomEvent(`slicc-dock-longpress`,{detail:{id:t,kind:this.#o(t)},bubbles:!0,composed:!0})))}#p(e){let t=e.detail;if(t&&typeof t.id==`string`)return t.id;let n=e.target?.closest(`slicc-dock-item`);return n&&this.contains(n)?n.dataset.t??null:null}});var dr=M(`
|
|
2355
2355
|
:host { display: none; }
|
|
2356
2356
|
:host([open]) { display: block; }
|
|
2357
2357
|
.overlay {
|
|
@@ -2438,7 +2438,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2438
2438
|
color: rgba(255,255,255,.7); font-family: var(--ui); font-size: 14px;
|
|
2439
2439
|
}
|
|
2440
2440
|
@media (prefers-reduced-motion: reduce) { .overlay, .card { transition: none; } }
|
|
2441
|
-
`),
|
|
2441
|
+
`),fr=`Open tabs`;A(`slicc-tab-overlay`,class extends HTMLElement{static observedAttributes=[`open`,`heading`];#e;#t=[];#n=null;#r=null;#i=e=>{e.key===`Escape`&&this.open&&(e.stopPropagation(),this.#u(`escape`))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[dr]}connectedCallback(){this.#s(),this.#c()}disconnectedCallback(){document.removeEventListener(`keydown`,this.#i,!0)}attributeChangedCallback(e){this.isConnected&&(e===`open`?this.#c():this.#s())}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get heading(){return this.getAttribute(`heading`)??fr}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get tabs(){return this.#t.map(e=>({...e}))}set tabs(e){this.#t=Array.isArray(e)?e.map(e=>({...e})):[],this.isConnected&&this.#s()}show(){this.open||=!0}hide(){this.open&&this.#u(`api`)}#a(){let e=j(`button`,{class:`close`,part:`close`,type:`button`,"aria-label":`Close tabs overlay`},n(`x`,{size:18}));return e.addEventListener(`click`,()=>this.#u(`close-button`)),e}#o(e){let t=e.title??e.id,r=e.screenshot?j(`img`,{class:`shot`,part:`shot`,src:e.screenshot,alt:t,loading:`lazy`}):j(`div`,{class:`shot ph`,part:`shot`},n(`globe`,{size:28})),i=j(`button`,{class:`x`,part:`card-close`,type:`button`,"aria-label":`Close ${t}`},n(`x`,{size:14}));i.addEventListener(`click`,t=>{t.stopPropagation(),this.#l(`tab-close`,e.id)});let a=j(`div`,{class:`label`},j(`span`,{class:`name`,part:`title`},t),e.url?j(`span`,{class:`url`},e.url):null),o=j(`div`,{class:e.active?`card on`:`card`,part:`card`,role:`button`,tabindex:`0`,"data-tab-id":e.id,"aria-label":t,"aria-current":e.active?`true`:!1},r,j(`div`,{class:`meta`},a,i));return o.addEventListener(`click`,()=>this.#l(`tab-activate`,e.id)),o.addEventListener(`keydown`,t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),this.#l(`tab-activate`,e.id))}),o}#s(){let e=j(`div`,{class:`bar`,part:`bar`},j(`span`,{class:`title`},this.heading),j(`span`,{class:`count`},String(this.#t.length)),j(`span`,{class:`grow`}),this.#a()),t;if(this.#t.length===0)t=j(`div`,{class:`empty`},`No open tabs.`);else{t=j(`div`,{class:`grid`,part:`grid`,role:`list`});for(let e of this.#t)t.appendChild(this.#o(e))}this.#n=j(`div`,{class:`overlay`,part:`overlay`},e,t),this.#n.addEventListener(`mousedown`,e=>{e.target===this.#n&&this.#u(`backdrop`)}),this.#e.replaceChildren(this.#n)}#c(){this.open?(this.#r=this.getRootNode().activeElement,document.addEventListener(`keydown`,this.#i,!0),requestAnimationFrame(()=>this.#n?.querySelector(`.close`)?.focus())):(document.removeEventListener(`keydown`,this.#i,!0),this.#r?.focus?.(),this.#r=null)}#l(e,t){this.dispatchEvent(new CustomEvent(e,{detail:{id:t},bubbles:!0,composed:!0}))}#u(e){this.open=!1,this.dispatchEvent(new CustomEvent(`overlay-close`,{detail:{reason:e},bubbles:!0,composed:!0}))}});var pr=`#3b6cb2`,mr=`
|
|
2442
2442
|
.slicc-freezer {
|
|
2443
2443
|
position: fixed;
|
|
2444
2444
|
left: 0;
|
|
@@ -2540,12 +2540,12 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2540
2540
|
|
|
2541
2541
|
/* ice-blue accent while a freezer context is active (prototype _ctxAccent) —
|
|
2542
2542
|
tints the toggle + the new-chat icon; cards keep their snow palette. */
|
|
2543
|
-
.slicc-freezer[ctx] .fztgl { color: var(--fz-ctx, ${
|
|
2543
|
+
.slicc-freezer[ctx] .fztgl { color: var(--fz-ctx, ${pr}); border-color: color-mix(in srgb, var(--fz-ctx, ${pr}) 40%, var(--line)); }
|
|
2544
2544
|
.slicc-freezer[ctx] ::part(new-icon),
|
|
2545
2545
|
.slicc-freezer[ctx] slicc-freezer-new::part(new-icon) {
|
|
2546
|
-
background: color-mix(in srgb, var(--fz-ctx, ${
|
|
2547
|
-
border-color: color-mix(in srgb, var(--fz-ctx, ${
|
|
2548
|
-
color: var(--fz-ctx, ${
|
|
2546
|
+
background: color-mix(in srgb, var(--fz-ctx, ${pr}) 14%, var(--canvas));
|
|
2547
|
+
border-color: color-mix(in srgb, var(--fz-ctx, ${pr}) 40%, var(--line));
|
|
2548
|
+
color: var(--fz-ctx, ${pr});
|
|
2549
2549
|
}
|
|
2550
2550
|
|
|
2551
2551
|
/* match-hidden: search filtered a session row out (only meaningful when open,
|
|
@@ -2553,7 +2553,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2553
2553
|
prototype .fzcard row. */
|
|
2554
2554
|
.slicc-freezer[open] slicc-freezer-card.match-hidden,
|
|
2555
2555
|
.slicc-freezer[open] .fzcard.match-hidden { display: none; }
|
|
2556
|
-
`,
|
|
2556
|
+
`,hr=`slicc-freezer-style`;function gr(e){if(e.getElementById(hr))return;let t=e.createElement(`style`);t.id=hr,t.textContent=mr,(e.head??e.documentElement).appendChild(t)}var _r=`http://www.w3.org/2000/svg`;function vr(){let e=document.createElementNS(_r,`svg`);for(let[t,n]of[[`width`,`14`],[`height`,`14`],[`viewBox`,`0 0 16 16`],[`fill`,`none`],[`stroke`,`currentColor`],[`stroke-width`,`1.6`],[`stroke-linecap`,`round`],[`stroke-linejoin`,`round`],[`aria-hidden`,`true`]])e.setAttribute(t,n);let t=document.createElementNS(_r,`rect`);for(let[e,n]of[[`x`,`2.5`],[`y`,`3.5`],[`width`,`11`],[`height`,`9`],[`rx`,`1.5`]])t.setAttribute(e,n);let n=document.createElementNS(_r,`line`);for(let[e,t]of[[`x1`,`6`],[`y1`,`3.5`],[`x2`,`6`],[`y2`,`12.5`]])n.setAttribute(e,t);let r=document.createElementNS(_r,`polyline`);return r.setAttribute(`points`,`9,6.5 10.5,8 9,9.5`),e.append(t,n,r),e}A(`slicc-freezer`,class extends HTMLElement{static observedAttributes=[`open`,`ctx`,`search-placeholder`];#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){gr(this.ownerDocument),this.classList.add(`slicc-freezer`),this.setAttribute(`part`,`freezer`),this.hasAttribute(`aria-label`)||this.setAttribute(`aria-label`,`Past sessions (freezer)`),this.#s(),this.#l(),this.#u()}disconnectedCallback(){this.#a&&this.#t&&(this.#t.removeEventListener(`click`,this.#a),this.#a=null),this.#o&&this.#n&&(this.#n.removeEventListener(`input`,this.#o),this.#o=null)}attributeChangedCallback(e,t,n){this.#i&&(e===`open`?(this.#l(),this.#u()):e===`search-placeholder`&&(this.#n.placeholder=n??`search past sessions`))}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get ctx(){return this.hasAttribute(`ctx`)}set ctx(e){this.toggleAttribute(`ctx`,e)}get searchPlaceholder(){return this.getAttribute(`search-placeholder`)??`search past sessions`}set searchPlaceholder(e){e==null?this.removeAttribute(`search-placeholder`):this.setAttribute(`search-placeholder`,e)}get query(){return this.#i?this.#n.value:``}set query(e){this.#s(),this.#n.value=e,this.#d()}get rail(){return this.#s(),this.#r}toggle(e){let t=e??!this.open;t===this.open&&this.#l(),this.open=t,this.#l(),this.#u(),this.dispatchEvent(new CustomEvent(`freezer-toggle`,{detail:{open:t},bubbles:!0,composed:!0}))}append(...e){this.#s(),this.#r.append(...e),this.#u()}#s(){if(this.#i)return;let e=this.querySelector(`:scope > .fzh`),t=this.querySelector(`:scope > .fzrail`);if(e instanceof HTMLElement&&t instanceof HTMLElement){this.#c(e,t);return}let n=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&(e.classList.contains(`fzh`)||e.classList.contains(`fzrail`)))),r=this.ownerDocument,i=r.createElement(`div`);i.className=`fzh`,i.setAttribute(`part`,`header`);let a=r.createElement(`button`);a.className=`fztgl`,a.type=`button`,a.setAttribute(`part`,`toggle`),a.setAttribute(`aria-label`,`Toggle freezer`),a.append(vr());let o=r.createElement(`input`);o.className=`fzsearch`,o.type=`text`,o.setAttribute(`part`,`search`),o.placeholder=this.searchPlaceholder,o.setAttribute(`aria-label`,`Search past sessions`),i.append(a,o);let s=r.createElement(`div`);s.className=`fzrail`,s.setAttribute(`part`,`rail`);for(let e of n)s.appendChild(e);this.replaceChildren(i,s),this.#c(i,s)}#c(e,t){this.#i=!0,this.#e=e,this.#r=t;let n=e.querySelector(`.fztgl`),r=e.querySelector(`.fzsearch`);n&&(this.#t=n),r&&(this.#n=r),this.#t&&!this.#a&&(this.#a=()=>this.toggle(),this.#t.addEventListener(`click`,this.#a)),this.#n&&!this.#o&&(this.#o=()=>this.#d(),this.#n.addEventListener(`input`,this.#o))}#l(){if(!this.#t)return;let e=this.open;this.#t.setAttribute(`aria-expanded`,e?`true`:`false`),this.#t.title=e?`Collapse freezer`:`Expand freezer`}#u(){if(!this.#i)return;let e=this.open,t=this.#r.querySelectorAll(`slicc-freezer-card, slicc-freezer-new`);for(let n of t)n.toggleAttribute(`expanded`,e)}#d(){let e=this.#n.value.trim().toLowerCase(),t=this.#r.querySelectorAll(`slicc-freezer-card, .fzcard`);for(let n of t){let t=(n.textContent??``).toLowerCase();n.classList.toggle(`match-hidden`,e.length>0&&!t.includes(e))}}});var yr=14,br=M(`
|
|
2557
2557
|
:host {
|
|
2558
2558
|
display: inline-grid;
|
|
2559
2559
|
place-items: center;
|
|
@@ -2589,7 +2589,7 @@ slicc-input-card .toolbar slicc-add-menu {
|
|
|
2589
2589
|
nothing is slotted */
|
|
2590
2590
|
::slotted(*), .ic { line-height: 1; }
|
|
2591
2591
|
.ic { display: block; }
|
|
2592
|
-
`);A(`slicc-snowflake`,class extends HTMLElement{static observedAttributes=[`thawed`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
2592
|
+
`);A(`slicc-snowflake`,class extends HTMLElement{static observedAttributes=[`thawed`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[br];let e=j(`span`,{class:`snow`,part:`badge`},j(`slot`,null,n(`snowflake`,{size:yr,part:`glyph`,class:`ic`})));this.#e.replaceChildren(e)}get thawed(){return this.hasAttribute(`thawed`)}set thawed(e){this.toggleAttribute(`thawed`,e)}});var xr=`
|
|
2593
2593
|
slicc-freezer-card {
|
|
2594
2594
|
position: relative;
|
|
2595
2595
|
display: flex;
|
|
@@ -2682,7 +2682,7 @@ slicc-freezer-card .slicc-fzcard__meta {
|
|
|
2682
2682
|
slicc-freezer-card[thawed] {
|
|
2683
2683
|
background: color-mix(in srgb, var(--rose) 12%, transparent);
|
|
2684
2684
|
}
|
|
2685
|
-
`,
|
|
2685
|
+
`,Sr=`slicc-freezer-card-style`;function Cr(e){if(e.getElementById(Sr))return;let t=e.createElement(`style`);t.id=Sr,t.textContent=xr,(e.head??e.documentElement).appendChild(t)}var wr=1400,Tr=14;A(`slicc-freezer-card`,class extends HTMLElement{static observedAttributes=[`title`,`meta`,`slug`,`icon`,`thawed`];#e;#t;#n;#r;#i=null;#a=null;#o=!1;#s=null;#c=()=>this.#u();#l=()=>{if(!this.#i)return;let e=this.getBoundingClientRect();this.#i.style.setProperty(`--tip-x`,`${e.right+8}px`),this.#i.style.setProperty(`--tip-y`,`${e.top+e.height/2}px`)};connectedCallback(){Cr(this.ownerDocument),this.#d(),this.#f()}disconnectedCallback(){this.removeEventListener(`click`,this.#c),this.removeEventListener(`pointerenter`,this.#l),this.removeEventListener(`focusin`,this.#l),this.#s!=null&&(clearTimeout(this.#s),this.#s=null)}attributeChangedCallback(e,t,n){t===n||!this.#o||(e===`thawed`?this.#e.toggleAttribute(`thawed`,n!==null):e===`icon`?this.#p():this.#f())}get title(){return this.getAttribute(`title`)??``}set title(e){e==null?this.removeAttribute(`title`):this.setAttribute(`title`,e)}get meta(){return this.getAttribute(`meta`)??``}set meta(e){e==null?this.removeAttribute(`meta`):this.setAttribute(`meta`,e)}get slug(){return this.getAttribute(`slug`)??``}set slug(e){e==null?this.removeAttribute(`slug`):this.setAttribute(`slug`,e)}get icon(){return this.getAttribute(`icon`)}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}get thawed(){return this.hasAttribute(`thawed`)}set thawed(e){this.toggleAttribute(`thawed`,e)}get hidden(){return this.hasAttribute(`hidden`)}set hidden(e){this.toggleAttribute(`hidden`,e)}get badge(){return this.#d(),this.#e}#u(){this.dispatchEvent(new CustomEvent(`freezer-card-select`,{bubbles:!0,composed:!0,detail:{slug:this.slug}})),this.flashThaw()}flashThaw(e=wr){this.#s!=null&&clearTimeout(this.#s),this.thawed=!0,this.#s=setTimeout(()=>{this.thawed=!1,this.#s=null},e)}#d(){if(this.#o)return;this.#o=!0;let e=this.querySelector(`:scope > .slicc-fzcard__text`);if(e instanceof HTMLElement){this.#t=e,this.#n=e.querySelector(`.slicc-fzcard__title`),this.#r=e.querySelector(`.slicc-fzcard__meta`),this.#e=this.querySelector(`:scope > slicc-snowflake`),this.#i=this.querySelector(`:scope > .slicc-fzcard__tip`),this.addEventListener(`click`,this.#c),this.addEventListener(`pointerenter`,this.#l),this.addEventListener(`focusin`,this.#l);return}let t=Array.from(this.childNodes);this.#e=this.ownerDocument.createElement(`slicc-snowflake`),this.#e.setAttribute(`part`,`badge`),this.#n=j(`div`,{class:`slicc-fzcard__title`,part:`title`}),this.#r=j(`div`,{class:`slicc-fzcard__meta`,part:`meta`}),this.#t=j(`div`,{class:`slicc-fzcard__text`,part:`text`},this.#n,this.#r);for(let e of t)this.#n.appendChild(e);this.#i=j(`span`,{class:`slicc-fzcard__tip`,part:`tip`,"aria-hidden":`true`}),this.replaceChildren(this.#e,this.#t,this.#i),this.addEventListener(`click`,this.#c),this.addEventListener(`pointerenter`,this.#l),this.addEventListener(`focusin`,this.#l)}#f(){if(!this.#o)return;let e=this.getAttribute(`title`);e!=null&&(this.#n.textContent=e),this.#r.textContent=this.meta,this.#i&&(this.#i.textContent=e??(this.#n.textContent||``)),this.#e.toggleAttribute(`thawed`,this.thawed),this.#p()}#p(){if(!this.#o)return;let e=this.getAttribute(`icon`);if(e){let t=n(e,{size:Tr,class:`ic`,part:`icon`});this.#a?this.#a.replaceWith(t):this.#e.appendChild(t),this.#a=t}else this.#a&&=(this.#a.remove(),null)}});var Er=`square-pen`,Dr=`loader-circle`,Or=16,kr=`New chat`,Ar=350,jr=[[`new-chat-save`,`square-pen`,`New chat — save & extract memories`],[`new-chat-skip`,`fast-forward`,`New chat, fast — memories extracted later`],[`new-chat-erase`,`trash-2`,`Discard this chat — no freezer, no memories`],[`new-cone`,`plus`,`New cone — keep this chat, start another cone`],[`drop-cone`,`circle-minus`,`Drop this cone — freeze its chat, no memories`]],Mr=M(`
|
|
2686
2686
|
:host { display: block; }
|
|
2687
2687
|
:host([hidden]) { display: none; }
|
|
2688
2688
|
*{ box-sizing: border-box; }
|
|
@@ -2828,18 +2828,18 @@ slicc-freezer-card[thawed] {
|
|
|
2828
2828
|
.fznew, .nlbl { transition: none; }
|
|
2829
2829
|
.fznew-spinner svg { animation: none; }
|
|
2830
2830
|
}
|
|
2831
|
-
`);A(`slicc-freezer-new`,class extends HTMLElement{static observedAttributes=[`expanded`,`label`,`busy`,`progress`,`no-skip`,`cones`];#e;#t=null;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
2831
|
+
`);A(`slicc-freezer-new`,class extends HTMLElement{static observedAttributes=[`expanded`,`label`,`busy`,`progress`,`no-skip`,`cones`];#e;#t=null;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Mr]}connectedCallback(){this.#a()}disconnectedCallback(){this.#n?.destroy(),this.#n=null,this.#l()}attributeChangedCallback(e){e===`progress`&&this.#i()||this.isConnected&&this.#a()}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}get label(){return this.getAttribute(`label`)??kr}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get noSkip(){return this.hasAttribute(`no-skip`)}set noSkip(e){this.toggleAttribute(`no-skip`,e)}get cones(){let e=this.getAttribute(`cones`);if(e==null)return null;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:null}set cones(e){e==null?this.removeAttribute(`cones`):this.setAttribute(`cones`,String(Math.max(0,Math.floor(e))))}get busy(){return this.hasAttribute(`busy`)}set busy(e){this.toggleAttribute(`busy`,e)}get progress(){let e=this.getAttribute(`progress`);if(e==null)return null;let t=Number.parseFloat(e);return Number.isFinite(t)?Math.min(1,Math.max(0,t)):null}set progress(e){e==null?this.removeAttribute(`progress`):this.setAttribute(`progress`,String(Math.min(1,Math.max(0,e))))}#i(){let e=this.#e.querySelector(`.fznew-ring`);return!e||!this.busy||!this.hasAttribute(`progress`)?!1:(e.style.setProperty(`--fznew-progress`,String(this.progress??0)),!0)}#a(){let e=this.label,t=this.busy,r=t&&this.hasAttribute(`progress`),i=j(`span`,{class:`nico`,part:`badge`},t?j(`span`,{class:`fznew-spinner`,part:`spinner`},r?j(`span`,{class:`fznew-ring`,part:`ring`,style:`--fznew-progress:${this.progress??0}`}):null,n(Dr,{size:Or,part:`icon`})):j(`slot`,{name:`icon`},n(Er,{size:Or,part:`icon`}))),a=j(`span`,{class:`nlbl`,part:`label`},j(`slot`,null,e)),o=j(`button`,{class:`fznew`,part:`button`,type:`button`,"aria-label":e,title:e,"aria-busy":t?`true`:void 0},i,a);this.#t=o,this.#c(o),this.#e.replaceChildren(o,this.#o(t,r))}#o(e,t){let r=j(`div`,{class:`fznew-row`,part:`row`,role:`group`,"aria-label":this.label});for(let[i,a,o]of this.#s()){let s=i===`new-chat-save`,c=s&&e?j(`span`,{class:`fznew-spinner`},t?j(`span`,{class:`fznew-ring`,style:`--fznew-progress:${this.progress??0}`}):null,n(Dr,{size:Or})):n(a,{size:Or}),l=j(`button`,{class:`fznew-act fznew-act--${i}`,part:`action-${i}`,type:`button`,title:o,"aria-label":o,"aria-busy":s&&e?`true`:void 0},c);l.disabled=e,l.addEventListener(`click`,()=>{this.busy||this.#u(i)}),r.appendChild(l)}return r}#s(){let e=this.cones;return jr.filter(([t])=>t===`new-chat-skip`?!this.noSkip:t===`new-cone`?e!==null:t!==`drop-cone`||e!==null&&e>1)}#c(e){this.#n?.destroy(),this.#l(),this.#n=tr(e,{onLongPress:()=>{if(this.#r!==null){this.#l(),this.#u(`new-chat-skip`);return}this.#u(`new-chat-erase`)},onShortClick:()=>{if(this.noSkip){this.#u(`new-chat-save`);return}if(this.#r!==null){this.#l(),this.#u(`new-chat-skip`);return}this.#r=setTimeout(()=>{this.#r=null,this.#u(`new-chat-save`)},Ar)}})}#l(){this.#r!==null&&(clearTimeout(this.#r),this.#r=null)}#u(e){e===`new-chat-save`&&(this.busy=!0),this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))}});var Nr=1e3/15;function Pr(e,t,n){return n?!0:e-t>=62.66666666666667}function Fr(e,t,n){if(n||!Number.isFinite(t))return e;let r=t+Nr;return e-r>66.66666666666667?e:r}var Ir=`attribute vec2 a_pos; void main(){ gl_Position = vec4(a_pos,0.0,1.0); }`,Lr=`precision highp float;
|
|
2832
2832
|
uniform vec2 u_res; uniform float u_time; uniform float u_energy;
|
|
2833
2833
|
uniform vec2 u_center; uniform vec3 u_evt; uniform float u_freeze; uniform float u_dark;
|
|
2834
2834
|
uniform float u_falloff; uniform float u_life; uniform vec3 u_tint; uniform float u_scroll;
|
|
2835
2835
|
uniform float u_brightness; uniform float u_contrast; uniform float u_noise; uniform float u_blur;
|
|
2836
|
-
vec3 themeBg(){ return mix(vec3(0.97,0.95,0.89), vec3(0.09,0.08,0.06), u_dark); }`,
|
|
2836
|
+
vec3 themeBg(){ return mix(vec3(0.97,0.95,0.89), vec3(0.09,0.08,0.06), u_dark); }`,Rr=`
|
|
2837
2837
|
float hash21(vec2 p){ p=fract(p*vec2(123.34,456.21)); p+=dot(p,p+45.32); return fract(p.x*p.y); }
|
|
2838
2838
|
float vnoise(vec2 p){ vec2 i=floor(p),f=fract(p);
|
|
2839
2839
|
float a=hash21(i),b=hash21(i+vec2(1.,0.)),c=hash21(i+vec2(0.,1.)),d=hash21(i+vec2(1.,1.));
|
|
2840
2840
|
vec2 u=f*f*(3.-2.*f); return mix(mix(a,b,u.x),mix(c,d,u.x),u.y); }
|
|
2841
2841
|
float fbm(vec2 p){ float v=0.,a=0.5; for(int i=0;i<5;i++){ v+=a*vnoise(p); p=p*2.02+vec2(7.1,3.7); a*=0.5;} return v; }
|
|
2842
|
-
vec2 warp(vec2 p, float t){ float a=fbm(p+vec2(0.0,1.7)+t*0.10); float b=fbm(p+vec2(5.2,1.3)-t*0.08); return p+0.85*vec2(a,b); }`,
|
|
2842
|
+
vec2 warp(vec2 p, float t){ float a=fbm(p+vec2(0.0,1.7)+t*0.10); float b=fbm(p+vec2(5.2,1.3)-t*0.08); return p+0.85*vec2(a,b); }`,zr=`${Lr}${Rr}
|
|
2843
2843
|
vec3 pal(float t){ vec3 strawberry=vec3(1.0,0.45,0.62); vec3 vanilla=vec3(1.0,0.95,0.82);
|
|
2844
2844
|
vec3 pistachio=vec3(0.60,0.86,0.52);
|
|
2845
2845
|
vec3 col=mix(strawberry,vanilla,smoothstep(0.0,0.5,t)); col=mix(col,pistachio,smoothstep(0.5,1.0,t)); return col; }
|
|
@@ -2858,7 +2858,7 @@ void main(){
|
|
|
2858
2858
|
ice*=0.95+0.08*sin(u_time*0.4); float mask=smoothstep(0.62,0.0,r);
|
|
2859
2859
|
vec3 col=mix(bg,ice,clamp(mask,0.0,1.0)*0.80); col+=ice*mask*hl*0.12;
|
|
2860
2860
|
gl_FragColor=vec4(col,1.0);
|
|
2861
|
-
}`,
|
|
2861
|
+
}`,Br=`${Lr}${Rr}
|
|
2862
2862
|
/* Inside-of-a-freezer ground: icy WHITE in light mode (never the warm theme
|
|
2863
2863
|
canvas — blue-on-beige read as sand, not frost), cold blue-black in dark. */
|
|
2864
2864
|
vec3 freezerBg(){ return mix(vec3(0.965,0.98,1.0), vec3(0.05,0.08,0.13), u_dark); }
|
|
@@ -2885,7 +2885,7 @@ void main(){
|
|
|
2885
2885
|
deviation budget the cone glass uses. */
|
|
2886
2886
|
col=mix(freezerBg(),col,0.22);
|
|
2887
2887
|
gl_FragColor=vec4(col,1.0);
|
|
2888
|
-
}`,
|
|
2888
|
+
}`,Vr=`${Lr}${Rr}
|
|
2889
2889
|
uniform float u_speed;
|
|
2890
2890
|
vec2 sugarHash(vec2 p){ p=vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3))); return fract(sin(p)*43758.5453123); }
|
|
2891
2891
|
vec3 sugarVoronoi(vec2 p,float t){
|
|
@@ -2964,20 +2964,20 @@ void main(){
|
|
|
2964
2964
|
col+=u_noise*grain; col=(col-0.5)*u_contrast+0.5; col*=u_brightness; col=clamp(col,0.0,1.0);
|
|
2965
2965
|
col=clamp(col,max(bg-vec3(0.20),vec3(0.0)),min(bg+vec3(0.20),vec3(1.0)));
|
|
2966
2966
|
gl_FragColor=vec4(col,1.0);
|
|
2967
|
-
}`,
|
|
2967
|
+
}`,Hr={caramel:{mode:`cone`,tint:`#d08a3c`,brightness:1.1,contrast:1.1,noise:.025,blur:.14,coverage:.28,speed:.0625},"caramel-soft":{mode:`cone`,tint:`#d08a3c`,brightness:1.2,contrast:.75,noise:.025,blur:.14,coverage:.28,speed:1},frosted:{mode:`cone`,tint:`#ead9bd`,brightness:1,contrast:.55,noise:.005,blur:.9,coverage:.08,speed:1},brittle:{mode:`cone`,tint:`#ffd089`,brightness:.96,contrast:1.2,noise:.055,blur:.02,coverage:.68,speed:1},"waffle-glass":{mode:`cone`,tint:`#d3a15f`,brightness:1,contrast:.9,noise:.02,blur:.08,coverage:.9,speed:1}},Ur={cone:Vr,scoop:zr,freezer:Br},Wr=new Set([`cone`,`scoop`,`freezer`]),Gr={cone:`radial-gradient(120% 120% at 35% 45%, color-mix(in srgb,#d08a3c 20%,var(--bg)) 0%, var(--bg) 70%)`,scoop:`radial-gradient(120% 120% at 40% 50%, color-mix(in srgb,#ff9bc0 40%,var(--bg)) 0%, var(--bg) 62%)`,freezer:`radial-gradient(120% 120% at 0% 100%, color-mix(in srgb,#7fb0e6 55%,var(--bg)) 0%, var(--bg) 70%)`},Kr=M(`
|
|
2968
2968
|
:host { position: relative; display: block; pointer-events: none; }
|
|
2969
2969
|
.canvas, .fallback { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
|
|
2970
2970
|
.fallback { display: none; }
|
|
2971
2971
|
:host([no-webgl]) .canvas { display: none; }
|
|
2972
|
-
:host([no-webgl]) .fallback { display: block; }`),
|
|
2972
|
+
:host([no-webgl]) .fallback { display: block; }`),qr=1,Jr=.5,Yr=2,Xr=.35,Zr=[`u_res`,`u_scroll`,`u_time`,`u_energy`,`u_center`,`u_evt`,`u_freeze`,`u_dark`,`u_falloff`,`u_life`,`u_tint`,`u_brightness`,`u_contrast`,`u_noise`,`u_blur`,`u_speed`];function Qr(e,t,n,r){return Number.isFinite(e)?Math.max(t,Math.min(n,e)):r}function $r(e,t){if(!e||typeof getComputedStyle!=`function`)return t;let n=document.createElement(`span`);n.style.color=e,n.style.display=`none`,document.body.appendChild(n);let r=getComputedStyle(n).color;n.remove();let i=r.match(/[\d.]+/g)?.map(Number);return!i||i.length<3?t:[i[0]/255,i[1]/255,i[2]/255]}var ei=class extends HTMLElement{static observedAttributes=[`mode`,`tint`,`coverage`,`intensity`,`scroll`,`brightness`,`contrast`,`noise`,`blur`,`speed`,`dpr`];#e;#t=null;#n=null;#r=null;#i={};#a=null;#o={};#s=-1;#c=0;#l=0;#u=0;#d=-1/0;#f=0;#p=!1;#m=null;#h=!1;#g=[.816,.541,.235];#_=[.957,.247,.369];#v=0;#y=null;#b=null;#x=null;#S=null;#C=null;#w=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Kr];let e=j(`canvas`,{class:`canvas`,part:`canvas`}),t=j(`div`,{class:`fallback`,part:`fallback`,"aria-hidden":`true`});this.#e.replaceChildren(e,t),this.#t=e}connectedCallback(){if(this.#h=typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches,this.#T(),!this.#N()){this.setAttribute(`no-webgl`,``);return}if(this.removeAttribute(`no-webgl`),typeof ResizeObserver<`u`){let e=!0;this.#m=new ResizeObserver(()=>{let t=e;e=!1,this.#V({burst:!t})}),this.#m.observe(this)}this.#E(),this.#D(),this.#l=performance.now()/1e3,this.#d=-1/0,this.#p=!1,this.#V()}disconnectedCallback(){this.#U(),this.#m?.disconnect(),this.#m=null,this.#y?.disconnect(),this.#y=null,this.#b&&this.#x&&this.#b.removeEventListener(`change`,this.#x),this.#b=null,this.#x=null,this.#W()}attributeChangedCallback(e){if(this.isConnected){if((e===`tint`||e===`mode`)&&this.#E(),e===`mode`&&this.#n&&this.mode!==this.#S){if(this.#A()){this.#z(),this.#d=performance.now(),this.#T(),this.#V();return}console.error(`[slicc-shader] mode switch failed to link program`)}this.#T(),this.#V({burst:!0})}}get mode(){let e=this.getAttribute(`mode`);return e&&Wr.has(e)?e:`cone`}set mode(e){this.setAttribute(`mode`,e)}get coverage(){let e=this.mode===`cone`?Hr.caramel.coverage:.66;return Qr(Number.parseFloat(this.getAttribute(`coverage`)??``),0,1,e)}set coverage(e){this.setAttribute(`coverage`,String(e))}get intensity(){return Qr(Number.parseFloat(this.getAttribute(`intensity`)??``),0,4,1)}set intensity(e){this.setAttribute(`intensity`,String(e))}get scrollOffset(){let e=Number.parseFloat(this.getAttribute(`scroll`)??``);return Number.isFinite(e)?e:0}set scrollOffset(e){this.setAttribute(`scroll`,String(e))}get brightness(){return Qr(Number.parseFloat(this.getAttribute(`brightness`)??``),.5,1.5,Hr.caramel.brightness)}set brightness(e){this.setAttribute(`brightness`,String(e))}get contrast(){return Qr(Number.parseFloat(this.getAttribute(`contrast`)??``),.5,2,Hr.caramel.contrast)}set contrast(e){this.setAttribute(`contrast`,String(e))}get noise(){return Qr(Number.parseFloat(this.getAttribute(`noise`)??``),0,.3,Hr.caramel.noise)}set noise(e){this.setAttribute(`noise`,String(e))}get blurAmount(){return Qr(Number.parseFloat(this.getAttribute(`blur`)??``),0,1,Hr.caramel.blur)}set blurAmount(e){this.setAttribute(`blur`,String(e))}get speed(){return Qr(Number.parseFloat(this.getAttribute(`speed`)??``),0,2,Hr.caramel.speed)}set speed(e){this.setAttribute(`speed`,String(e))}get dpr(){return Qr(Number.parseFloat(this.getAttribute(`dpr`)??``),Jr,Yr,qr)}set dpr(e){this.setAttribute(`dpr`,String(e))}get noWebgl(){return this.hasAttribute(`no-webgl`)}pulse(e=1){Number.isFinite(e)&&(this.#u=Math.min(1.4,Math.max(0,this.#u+e)),this.#V({burst:!0}))}#T(){let e=this.#e.querySelector(`.fallback`);e&&(e.style.background=Gr[this.mode])}#E(){let e=this.getAttribute(`tint`)??(this.mode===`cone`?Hr.caramel.tint:``);this.#g=$r(e,[.545,.361,.965]),this.#_=$r(e,[.957,.247,.369]),this.#v=this.#R()}#D(){let e=()=>{this.#E(),this.#V({burst:!0})};if(typeof MutationObserver<`u`){this.#y=new MutationObserver(e);for(let e of[document.documentElement,document.body])e&&this.#y.observe(e,{attributes:!0,attributeFilter:[`class`,`data-theme`]})}typeof matchMedia==`function`&&(this.#b=matchMedia(`(prefers-color-scheme: dark)`),this.#x=e,this.#b.addEventListener(`change`,this.#x))}#O(e,t,n){let r=e.createShader(t);return r?(e.shaderSource(r,n),e.compileShader(r),e.getShaderParameter(r,e.COMPILE_STATUS)?r:(e.deleteShader(r),null)):null}#k(e){let t=this.#n;if(!t)return null;let n=this.#O(t,t.VERTEX_SHADER,Ir),r=this.#O(t,t.FRAGMENT_SHADER,Ur[e]);if(!n||!r)return n&&t.deleteShader(n),r&&t.deleteShader(r),null;let i=t.createProgram();if(!i)return t.deleteShader(n),t.deleteShader(r),null;if(t.attachShader(i,n),t.attachShader(i,r),t.linkProgram(i),!t.getProgramParameter(i,t.LINK_STATUS))return t.deleteProgram(i),t.deleteShader(n),t.deleteShader(r),null;let a=t.getAttribLocation(i,`a_pos`),o={};for(let e of Zr)o[e]=t.getUniformLocation(i,e);return{program:i,vs:n,fs:r,aPos:a,loc:o}}#A(){let e=this.#n;if(!e)return!1;let t=this.mode,n=this.#i[t];if(!n){let e=this.#k(t);if(!e)return!1;this.#i[t]=e,n=e}return this.#r=n.program,this.#s=n.aPos,this.#o=n.loc,e.useProgram(n.program),this.#S=t,!0}#j(e){let t={premultipliedAlpha:!0,alpha:!0,antialias:!0};try{return e.getContext(`webgl`,t)??e.getContext(`experimental-webgl`,t)}catch{return null}}#M(e){this.#I(e);let t=j(`canvas`,{class:`canvas`,part:`canvas`});return e.parentNode?e.replaceWith(t):this.#e.prepend(t),this.#t=t,t}#N(){let e=this.#t;if(!e)return!1;let t=this.#j(e);return t?.isContextLost()&&(e=this.#M(e),t=this.#j(e)),!t||t.isContextLost()?!1:(this.#n=t,this.#F(e),this.#P()?!0:(this.#W(),!1))}#P(){let e=this.#n;if(!e||!this.#A())return!1;let t=e.createBuffer();return t?(this.#a=t,e.bindBuffer(e.ARRAY_BUFFER,t),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,3,-1,-1,3]),e.STATIC_DRAW),!0):!1}#F(e){this.#I(e),this.#C=e=>{e.preventDefault(),this.#p=!0,this.#U(),this.#i={},this.#r=null,this.#S=null,this.#o={},this.#a=null},this.#w=()=>{if(!(!this.isConnected||!this.#n)){if(this.#i={},!this.#P()){this.#p=!1,console.error(`[slicc-shader] GL restore failed; falling back to CSS gradient`),this.setAttribute(`no-webgl`,``),this.#W();return}this.#p=!1,this.#l=performance.now()/1e3,this.#d=-1/0,this.#V()}},e.addEventListener(`webglcontextlost`,this.#C,!1),e.addEventListener(`webglcontextrestored`,this.#w,!1)}#I(e){this.#C&&e.removeEventListener(`webglcontextlost`,this.#C),this.#w&&e.removeEventListener(`webglcontextrestored`,this.#w),this.#C=null,this.#w=null}#L(){let e=this.#t;if(!e)return;let t=Math.min(this.dpr,typeof window<`u`&&window.devicePixelRatio||1),n=Math.max(1,e.clientWidth*t|0),r=Math.max(1,e.clientHeight*t|0);(e.width!==n||e.height!==r)&&(e.width=n,e.height=r)}#R(){if(typeof getComputedStyle!=`function`)return 0;let e=getComputedStyle(this).getPropertyValue(`--ink`).trim();if(!e)return 0;let[t,n,r]=$r(e,[0,0,0]);return+(.2126*t+.7152*n+.0722*r>.5)}#z(){let e=this.#n,t=this.#t,n=this.#r;if(!e||!t||!n||!this.#a)return;this.#L();let r=performance.now()/1e3-this.#l,i=.5+.5*Math.sin(r*.12),a=.5+.5*Math.sin(r*.097+1),o=.2*(1-i)+.46*i,s=.74*(1-a)+.3*a,c=this.#v,l=this.#g,u=this.#_;e.viewport(0,0,t.width,t.height),e.useProgram(n),e.bindBuffer(e.ARRAY_BUFFER,this.#a),e.enableVertexAttribArray(this.#s),e.vertexAttribPointer(this.#s,2,e.FLOAT,!1,0,0);let d=this.#o;e.uniform2f(d.u_res??null,t.width,t.height),e.uniform1f(d.u_time??null,r),e.uniform1f(d.u_energy??null,this.#u),e.uniform2f(d.u_center??null,o,s),e.uniform3f(d.u_evt??null,u[0],u[1],u[2]),e.uniform1f(d.u_freeze??null,Qr(this.coverage*this.intensity,0,1,.66)*2.2),e.uniform1f(d.u_dark??null,c),e.uniform1f(d.u_scroll??null,this.scrollOffset*Xr/Math.max(1,t.clientHeight||t.height)),e.uniform1f(d.u_falloff??null,.3),e.uniform1f(d.u_life??null,.35),e.uniform3f(d.u_tint??null,l[0],l[1],l[2]),e.uniform1f(d.u_brightness??null,this.brightness),e.uniform1f(d.u_contrast??null,this.contrast),e.uniform1f(d.u_noise??null,this.noise),e.uniform1f(d.u_blur??null,this.blurAmount),e.uniform1f(d.u_speed??null,this.speed),e.drawArrays(e.TRIANGLES,0,3),this.#u*=.95,this.#u<.001&&(this.#u=0)}#B(){return!(this.#h||this.mode===`cone`&&this.speed===0)}#V(e={}){e.burst&&(this.#f=performance.now()+800),!(this.#c||!this.#n||this.#p)&&(this.#c=requestAnimationFrame(this.#H))}#H=e=>{this.#c=0;let t=e<this.#f||this.#u>0;Pr(e,this.#d,t)&&(this.#d=Fr(e,this.#d,t),this.#z()),!(this.#h||!this.#B()&&this.#u===0)&&(this.#c=requestAnimationFrame(this.#H))};#U(){this.#c&&cancelAnimationFrame(this.#c),this.#c=0}#W(){let e=this.#n,t=this.#t;if(t&&this.#I(t),e){this.#a&&e.deleteBuffer(this.#a);for(let t of Object.values(this.#i))t&&(e.deleteProgram(t.program),e.deleteShader(t.vs),e.deleteShader(t.fs));e.getExtension(`WEBGL_lose_context`)?.loseContext()}this.#n=null,this.#r=null,this.#i={},this.#o={},this.#a=null,this.#S=null}};A(`slicc-shader`,ei),A(`slicc-frost-shader`,class extends ei{connectedCallback(){this.getAttribute(`mode`)!==`freezer`&&this.setAttribute(`mode`,`freezer`),super.connectedCallback()}});var ti=`# Memory
|
|
2973
2973
|
|
|
2974
|
-
`,
|
|
2974
|
+
`,ni=[`**Evidence first:** inspect the smallest relevant surface before editing and record the observed state.`,`**Narrow plans:** keep one measurable outcome, one implementation pass, and one verification pass.`,`**Runtime state:** prefer browser-owned storage and keep the relay stateless whenever practical.`,`**Failure boundaries:** external work needs a timeout, a useful error category, and an explicit retry decision.`,"**Keyboard parity:** interactive rows remain focusable and respond to both `Enter` and `Space`.",`**Memory rendering:** preserve Markdown meaning while sanitizing untrusted tags at the DOM boundary.`,`**Cross-runtime parity:** shared events need matching page, worker, extension, and follower handling.`,`**Verification records:** report the exact command, outcome, and scope instead of writing only “tests pass”.`,`**Synthetic data:** use neutral paths, reserved domains, and conspicuously invented identifiers in fixtures.`,`**Collaboration:** coordinate public-barrel edits before overlapping with another active implementation.`],ri=["Keep the durable rule beside `packages/example.ts` so later work can reproduce the decision without a transcript.",`Preserve selection, expansion, and scroll state when a refresh replaces visible children.`,`Run the focused regression first; broaden to package and repository gates only after the hypothesis holds.`,'Treat A & B, “quoted labels”, arrows →, and `<preview mode="safe">` as text rather than executable markup.',`Prefer a reversible patch over a destructive command when the target was inferred rather than supplied.`,`Stop exploring when another read no longer changes the hypothesis; switch to a test or focused question.`,`Document the invalidation trigger when cached data can become stale, and retain a correctness bypass.`,`Release every listener, timer, observer, channel, and object URL during the matching teardown path.`,`Keep logs to operation name, duration, status, and a synthetic correlation label; omit payload contents.`],ii=ni.flatMap(e=>ri.map(t=>`- ${e} ${t}`)),ai=[`- Keep diffs small.`,`- Prefer native APIs.`,`- Ship docs with code.`,`- No surprise deploys.`,"- **Continuation stress:** preserve one logical memory across source lines,\n carrying `inline-code`, emphasis, and an arrow → without creating another row.",'- **Escaping stress:** render `<preview mode="safe">`, A & B, “quotes”, and `score > threshold` as inert content.',`- **Reserved link:** [the synthetic reference](https://example.invalid/memory) exists only to exercise link rendering.`,`- **Medium tail:** before rebuilding a filtered collection, capture the query, focused control, selected row, group expansion, and scroll anchor; restore only state that still refers to surviving items.`,`- **Long tail:** ${`A long-lived panel decision was reviewed in sequence: a compact sample initially hid scale problems; a larger dataset exposed discarded provenance and summaries cut mid-phrase; Markdown stress then revealed literal markers; keyboard review found pointer-only activation; narrow layouts showed metadata competing with the primary text; refresh testing exposed lost search, focus, expansion, and scroll state; cross-runtime review found a missing follower path; failure testing identified an unbounded request; cleanup testing found a retained observer; and final verification required the focused test, package suite, coverage gate, and build. `.repeat(2).trim()}`,`- **Folded long tail:** a remote action keeps one event contract and preserves error categories across serialization,
|
|
2975
2975
|
terminates pending requests on disconnect, and verifies timeout plus malformed-response behavior,
|
|
2976
|
-
while this third source line remains part of the same bullet and contains “quotes”, A & B, and <angle brackets>.`],
|
|
2977
|
-
`)}\n`}
|
|
2978
|
-
`),`${
|
|
2976
|
+
while this third source line remains part of the same bullet and contains “quotes”, A & B, and <angle brackets>.`],oi=[...ii,...ai],si=[[`2099-01-03`,`compaction`],[`2099-01-10`,`new-session`],[`2099-01-18`,`compaction`],[`2099-02-02`,`pending-enrichment`],[`2099-02-14`,`new-session`],[`2099-03-01`,`compaction`],[`2099-03-21`,`pending-enrichment`],[`2099-04-05`,`compaction`],[`2099-04-19`,`new-session`],[`2099-05-07`,`compaction`]];function ci(e,t,n){return`## Auto-extracted (${e}, ${t})\n\n${n.join(`
|
|
2977
|
+
`)}\n`}ti+si.map(([e,t],n)=>ci(e,t,oi.slice(n*10,n*10+10))).join(`
|
|
2978
|
+
`),`${ti}${oi.join(`
|
|
2979
2979
|
`)}`,[`# Project Northstar`,``,`Role: Kestrel (primary engineering agent)`,`Workspace: /workspaces/northstar`,`Snapshot: 2032-04-18T14:15:51.712Z`,``,`## Operating agreements`,"- **Keep Northstar changes reviewable:** issue #501 requires one concern per branch in `packages/northstar-shell/src/` with fixtures under `/workspaces/northstar/testdata/`; run `keel verify --scope shell` before asking Mina Kestrel for `review_ready` status. The branch note in `packages/northstar-shell/reviews/` explains the user-visible outcome, the measured baseline, and the exact rollback point so another engineer can judge the change without reconstructing the session.","- **Prefer evidence before edits:** issue #502 starts with traces from `packages/telemetry/src/` and a reproduction in `/workspaces/northstar/repros/`; record the failing `trace_id` and the smallest useful `fixture_seed` before changing code. The supporting report in `packages/telemetry/reports/` separates observed behavior from a proposed cause and includes the command, expected result, actual result, and environment assumptions.","- **Use the native release path:** issue #503 sends text-only patches through `packages/release-tools/src/` and stores large binary fixtures in `/workspaces/northstar/artifacts/`; invoke `keel publish --dry-run` and confirm `release_manifest_v3` before upload. The release record in `packages/release-tools/records/` names every artifact, its content digest, the verification run that produced it, and the person who approved promotion.","- **Never merge on assumption:** issue #504 leaves the candidate in `packages/change-gate/src/` until `/workspaces/northstar/reviews/` contains an explicit approval; use `keel review status` and preserve the requested `merge_strategy`. The decision log in `packages/change-gate/decisions/` states whether history must remain linear and whether a reviewer requested a merge commit for audit context.",``,`## Repository and release workflow`,"- **Branch from the verified base:** issue #505 creates work in `packages/release-tools/branches/` and writes the base proof to `/workspaces/northstar/checkpoints/`; `keel branch create` must report the expected `base_oid`. The branch receipt in `packages/release-tools/receipts/` also captures the remote name and fetch time, which makes stale-base failures obvious during review.","- **Rebase only when linear history is required:** issue #506 keeps merge-preserving work in `packages/change-gate/policies/` and conflict notes in `/workspaces/northstar/reviews/`; choose `merge_commit` or `linear_rebase` from the recorded policy, never from habit. Guidance under packages/change-gate/guides/rebase/ requires a fresh verification run after conflict resolution because a clean textual rebase does not prove unchanged behavior.","- **Treat remote deletion as a gated operation:** issue #507 resolves the exact ref through `packages/release-tools/refs/` and snapshots it in `/workspaces/northstar/checkpoints/`; call `keel ref delete --confirm` only after `ref_guard` matches. The recovery note under packages/release-tools/guides/restore/ retains the deleted object identifier and a tested restore command until the review window closes.",``,`## Aurora renderer bootstrap — desktop preview (Session April 02)`,"- **Create the preview shell:** issue #508 keeps the host in `packages/aurora-preview/src/` and its deterministic scene data in `/workspaces/northstar/fixtures/aurora/`; start `keel preview aurora` with `scene_seed_2048`. A walkthrough under packages/aurora-preview/guides/startup/ lists the expected loading, ready, degraded, and failed states so reviewers know whether the shell or renderer owns a defect.","- **Load the renderer through its public package:** issue #509 imports `@northstar/aurora` from `/workspaces/northstar/apps/desktop/` and pins `aurora_protocol_v6`; the preview must not reach the private `renderer_singleton`. Contract notes under packages/aurora-preview/guides/contracts/ describe the mount lifecycle and require the host to release observers, workers, and object URLs during teardown.","- **Keep browser and desktop entry points equivalent:** issue #510 compares `packages/aurora-preview/browser/` with `/workspaces/northstar/apps/desktop/`; both expose `mountAuroraPreview` and accept `preview_transport`. Parity evidence under packages/aurora-preview/reviews/parity/ records the same scene, viewport, theme, keyboard path, and frame checksum for each host.","- **Pass viewer identity without personal data:** issue #511 reads `packages/aurora-preview/config/` and `/workspaces/northstar/fixtures/viewers/`; use `viewer_alpha` plus `tenant_sandbox`, never an account copied from production. The fixture catalog under packages/aurora-preview/fixtures/viewers/ explains each synthetic role and deliberately omits names, credentials, message history, and customer content.","- **Document the development-only compositor:** the guide in `packages/aurora-preview/docs/` points to `/workspaces/northstar/examples/compositor/`; `keel preview --inspect` exposes `frame_budget_ms` for local diagnosis. The inspector reports dropped frames, long tasks, active workers, and selected fallback mode without changing the scheduling decisions being measured.","- **Bundle Aurora without runtime network fetches:** build `packages/aurora-preview/bundle/` into `/workspaces/northstar/artifacts/aurora/` with `rook bundle --target desktop`; the output registers `aurora_bundle_hash` and embeds shader tables, icon atlases, locale data, fallback fonts, protocol schemas, worker bootstrap code, source labels, feature defaults, accessibility metadata, safe demo accounts, and the exact scene seed used by review. The host imports one local module, validates the manifest before evaluation, rejects unknown capabilities, records a structured startup trace, and keeps every optional adapter behind a capability check. When the packager rewrites an external import, inspect the emitted dependency map rather than adding a global shim. The accepted bundle must boot with the network disabled, survive a renderer restart, restore the selected scene, preserve focus order, report missing GPU features as a visible diagnostic, and produce the same frame checksum in Chromium and the desktop shell. Store the checksum beside the manifest, not in application code, so a fixture update is reviewable without touching runtime behavior.","- **Aurora offline recovery drill for the desktop preview** uses `packages/aurora-preview/fallback/` and `/workspaces/northstar/apps/desktop/assets/` with `aurora_fallback_entry` after `gpu_probe_result` records unsupported adapter evidence then the host verifies the local manifest restores the selected scene preserves keyboard focus retains the review viewport loads bundled fonts rejects network requests emits a visible diagnostic stores the frame checksum beside the artifact compares browser and desktop output keeps the original trace identifier and leaves the normal renderer untouched for the next controlled restart",``,`## Signal audio service — capture and transcription pipeline`,"- **Keep voice fixtures synthetic:** write generated samples to `packages/signal-audio/fixtures/` and metadata to `/workspaces/northstar/testdata/audio/`; select `signal_voice_cedar` with `sample_rate_24000`. The catalog under packages/signal-audio/guides/fixtures/ states how each sample was generated and which timing, silence, overlap, and clipping cases it is meant to exercise.","- **Resolve credentials through the fixture broker:** configure `packages/signal-audio/auth/` from `/workspaces/northstar/config/local/`; `keel secret lease signal` returns `signal_lease_ref` without exposing token material. The runbook under packages/signal-audio/guides/auth/ distinguishes a missing lease, an expired lease, provider denial, and an unavailable broker so recovery remains specific.","- **Use the streaming endpoint for long utterances:** send chunks from `packages/signal-audio/stream/` through `/workspaces/northstar/repros/audio/`; the client tracks `utterance_seq` and rejects a stale `transcript_epoch`. Evidence under packages/signal-audio/reviews/streaming/ includes chunk timing and final ordering, making dropped, duplicated, and late frames visible without retaining spoken content.","- **Preserve binary audio until decoding succeeds:** `packages/signal-audio/codecs/` writes to `/workspaces/northstar/artifacts/audio/`; `signal_decode_pcm` returns `decoded_frame_count` before text normalization. Notes under packages/signal-audio/guides/codecs/ require the original byte length, channel count, sample rate, and decoder warning before any waveform is discarded.",``,`## Harbor control-plane CLI (Session April 05, #401)`,"- **Define Harbor as a thin API client:** keep commands in `packages/harbor-cli/src/` and contract fixtures in `/workspaces/northstar/testdata/harbor/`; `harbor project list` emits `harbor_result_v2`. This boundary keeps command behavior easy to inspect, lets the service remain the source of truth, and gives every failure one clear place for diagnosis.","- **Store only a broker reference:** `packages/harbor-cli/auth/` reads `/workspaces/northstar/config/local/`; `harbor auth login` persists `credential_handle`, never a bearer value. A later command can ask the broker for a short lease while the terminal, history, trace, and saved configuration remain free of secret material.","- **Normalize boolean flags at the boundary:** `packages/harbor-cli/args/` tests `/workspaces/northstar/repros/harbor/`; `--include-paused=false` becomes `include_paused` rather than a truthy string. The same rule covers an omitted flag, an explicit true value, and a false value so script behavior does not depend on parser accident.","- **Do not edit remote files with shell redirection:** fetch through `packages/harbor-cli/files/` into `/workspaces/northstar/checkpoints/`; `harbor file replace` validates `remote_etag` before committing. The client first writes a complete local draft, shows a compact difference, and sends the whole document only after the expected revision still matches.","- **Read structured responses before printing:** `packages/harbor-cli/output/` stores schemas under `/workspaces/northstar/testdata/schemas/`; `harbor --format json` preserves `error_code` and nested causes. Human output may become shorter, but machine output must retain every field needed for retry, support, audit, and a later automated decision.","- **Refresh expired leases once:** `packages/harbor-cli/retry/` records attempts in `/workspaces/northstar/traces/`; `harbor_lease_expired` may trigger one `credential_refresh`, not a loop. A second denial is returned with the first request identity and lease age so the operator sees a stable failure rather than repeated login work.","- **Map provider failures to actionable hints:** `packages/harbor-cli/errors/` uses `/workspaces/northstar/docs/runbooks/`; `deployment_policy_denied` points to `harbor deployment inspect`. Each hint names the blocked resource, the required capability, and a safe read-only command that can confirm policy state before any new request.",``,`## Atlas runtime and plugin packaging (Session April 07, #418)`,"- **Build Atlas from a readable entry module:** `packages/atlas-runtime/src/` produces `/workspaces/northstar/artifacts/atlas/`; `rook build atlas` keeps `atlas_entrypoint` stable. The entry names each adapter and capability in one visible table, which makes bundle review possible without following generated glue across many small files.","- **Install plugins into an isolated sandbox:** `packages/atlas-runtime/plugins/` expands under `/workspaces/northstar/sandboxes/atlas/`; `atlas plugin inspect` verifies `plugin_manifest_v4`. Extraction rejects parent traversal, absolute names, duplicate entries, and unsupported links before any plugin code can observe the host or write outside its assigned directory.","- **Share filesystem adapters across hosts:** `packages/atlas-runtime/adapters/` is tested against `/workspaces/northstar/testdata/files/`; `atlas_read_bytes` and `atlas_write_atomic` retain binary data. Browser and desktop implementations must agree on path normalization, missing file behavior, atomic replacement, permission denial, and the byte count returned after a write.","- **Externalize host-owned modules:** `packages/atlas-runtime/build/` writes `/workspaces/northstar/artifacts/maps/`; `rook bundle --external host` marks `host_module_table` in the manifest. The loader resolves only names declared by that table and reports an absent host module before plugin startup rather than after partial state has changed.","- **Preserve integer field types during schema conversion:** `packages/atlas-runtime/schema/` compares `/workspaces/northstar/testdata/events/`; `packet_sequence` stays numeric in `atlas_event_v3`. The conversion test also covers zero, the largest safe value, a missing optional field, and an invalid string so type loss cannot hide in ordinary data.","- **Treat unknown extensions as data:** `packages/atlas-runtime/loader/` copies `/workspaces/northstar/fixtures/plugins/`; `atlas_load_module` uses `declared_media_type` instead of filename guessing. This permits a host to choose the correct evaluator while an untrusted plugin cannot change execution mode by selecting a familiar suffix.","- **Verify large artifacts through content hashes:** `packages/atlas-runtime/cache/` indexes `/workspaces/northstar/artifacts/atlas/`; `atlas artifact verify` checks `sha256_digest` before activation. Size and digest are checked after download and again before load, with one clear error that names which step observed an unexpected value.","- **Detect build drift against one canonical artifact:** `packages/atlas-runtime/ci/` reads `/workspaces/northstar/checkpoints/builds/`; `keel drift atlas` compares `canonical_bundle_id` rather than tool banners. A green result means the committed artifact matches the verified build output, not merely that two tools printed a similar version name.",``,`## Relay deployment automation (Session April 09, #433)`,"- **Acquire deployment credentials per operation:** `packages/relay-deploy/auth/` resolves `/workspaces/northstar/config/relay/`; `relay credential lease` returns `relay_lease_id`. The lease is bound to one provider and action, expires quickly, and can be revoked without changing local configuration or any unrelated deployment session.","- **Use immutable release descriptors:** `packages/relay-deploy/manifests/` publishes `/workspaces/northstar/artifacts/releases/`; `relay deploy plan` pins `release_descriptor_sha`. Review therefore covers the exact image, configuration, migration, and rollback input that promotion will consume rather than a mutable branch or floating tag.","- **Model provider capabilities explicitly:** `packages/relay-deploy/providers/` tests `/workspaces/northstar/testdata/providers/`; `provider_capability_set` prevents unsupported preview creation. A plan can explain which feature is absent and offer a compatible path before it asks a remote service to begin work.","- **Write remote documents atomically:** `packages/relay-deploy/files/` stages `/workspaces/northstar/checkpoints/remote/`; `relay file put` requires `expected_revision`. This prevents a short replacement from leaving stale tail content and prevents a concurrent operator from losing a newer remote change.","- **Keep retry policy narrow:** `packages/relay-deploy/retry/` reads `/workspaces/northstar/docs/runbooks/`; `relay_retryable_error` excludes policy denials and invalid manifests. Delay includes a firm attempt limit and a stable request identity so a temporary transport fault cannot become duplicate provider work.","- **Promote the artifact already tested:** `packages/relay-deploy/promote/` selects `/workspaces/northstar/artifacts/releases/`; `relay promote` verifies `tested_artifact_sha`. The command refuses a rebuild during promotion because even an equivalent source revision can yield a different dependency graph or bundle digest.",``,`## Orbit browser collaboration (Session April 11, #447)`,"- **Represent each shared tab as an Orbit room:** `packages/orbit-collab/rooms/` persists `/workspaces/northstar/testdata/orbit/`; `orbit room create` returns `room_epoch` and `participant_slot`. Room identity stays stable across transport replacement, while a new epoch makes every participant reject late state from a connection that no longer owns the session.","- **Send cursor updates as replaceable state:** `packages/orbit-collab/presence/` replays `/workspaces/northstar/fixtures/presence/`; `orbit_presence_v5` coalesces superseded coordinates. Presence may be lost without harming the document because the next update replaces it, which keeps interaction smooth under delay without building an unbounded queue.","- **Keep durable messages separate from presence:** `packages/orbit-collab/messages/` writes `/workspaces/northstar/checkpoints/orbit/`; `orbit message append` assigns `message_sequence`. A message is acknowledged only after durable storage, and replay begins after the highest sequence already seen so reconnect cannot create a duplicate conversation entry.","- **Recover from a stale browser execution context:** `packages/orbit-collab/browser/` logs `/workspaces/northstar/traces/orbit/`; `orbit context renew` increments `context_generation`. The old context is detached before a new observer is added, preventing both generations from sending navigation and focus events for the same visible tab.","- **Capture collaboration evidence through the public surface:** `packages/orbit-collab/qa/` stores `/workspaces/northstar/artifacts/screens/`; `keel orbit snapshot` records `active_room_id`. Review uses the same controls available to a person, then records visible member state, selected room, pending draft, and transport health beside the image.","- **Preserve pending input during reconnect:** `packages/orbit-collab/drafts/` tests `/workspaces/northstar/repros/reconnect/`; `draft_revision` survives one `transport_rebind`. The draft remains local until send succeeds, and a successful acknowledgement clears only the revision that was actually delivered rather than newer text still being edited.",``,`## Incident review — reconnect storm (Session April 12)`,"- **Root cause was competing transport owners:** `packages/orbit-collab/transport/` and `/workspaces/northstar/repros/reconnect/` both advanced `room_epoch`; the fix elects one `transport_owner`. The incident began when a browser wake event and a network return event each created a connection before either could observe the other.","- **The retry loop hid the first useful error:** `packages/orbit-collab/retry/` now records `/workspaces/northstar/traces/incidents/`; `first_failure_code` is retained in `reconnect_report`. Later timeout noise remains available in the trace, but the summary leads with the event that first moved the room away from healthy state.","- **Recovery must preserve the draft and selected room:** `packages/orbit-collab/state/` replays `/workspaces/northstar/fixtures/recovery/`; `orbit_recover_state` restores `active_room_id`. The acceptance check covers unsent text, keyboard focus, scroll position, participant order, and exactly one successful delivery after transport recovery.",``,`## Mobile companion sync (Session April 14, #462)`,"- **Pair the companion with an ephemeral code:** `packages/mobile-sync/pairing/` verifies `/workspaces/northstar/testdata/pairing/`; `mobile_pair_code` expires with `pairing_epoch`. Approval shows the synthetic device name and requested capability before either side accepts, and cancellation invalidates the code immediately rather than waiting for normal expiry.","- `packages/mobile-sync/outbox/` mirrors `/workspaces/northstar/fixtures/offline/`; `mobile_outbox_flush` preserves ordering after a network transition. Each item carries a local sequence and stable identity, so a retry can continue after the last acknowledgement without losing or repeating an action.","- `packages/mobile-sync/media/` writes `/workspaces/northstar/artifacts/mobile/`; `mobile_media_chunk` carries a checksum before upload. The receiver verifies every chunk before assembly and reports the first damaged range, which permits a narrow retry instead of sending the complete recording again.","- `packages/mobile-sync/notifications/` reads `/workspaces/northstar/testdata/push/`; `notification_dedupe_key` prevents duplicate alerts after resume. Foreground delivery updates visible state without another banner, while background delivery presents one alert that opens the exact room named by the event.","- `packages/mobile-sync/state/` compares `/workspaces/northstar/checkpoints/mobile/`; `mobile_state_merge` rejects an older `device_epoch`. Merge keeps local draft content, accepts newer durable state, and records a conflict when both sides changed the same preference after their common revision.","- `packages/mobile-sync/diagnostics/` exports `/workspaces/northstar/traces/mobile/`; `mobile_diag_bundle` removes payload text but keeps timing. The bundle includes version, platform, connection change, queue depth, retry count, and state generation so support can reason about order without reading user content.","- `packages/mobile-sync/accessibility/` tests `/workspaces/northstar/fixtures/a11y/`; `focus_restore_target` survives a view rebuild. The check follows pairing, room choice, draft entry, send, background, and resume with a keyboard so focus order is verified through a complete task.","- `packages/mobile-sync/release/` stages `/workspaces/northstar/artifacts/mobile/`; `mobile_release_channel` defaults to the review track. Promotion requires the same signed archive that passed device smoke review, with no rebuild or configuration change between approval and publication.","- `packages/mobile-sync/qa/` records `/workspaces/northstar/reviews/mobile/`; `mobile_smoke_matrix` covers offline launch, resume, and re-pairing. Each case states the initial network and account state, the exact action, the visible result, and the durable state expected after another launch.",``,`## Release readiness (Session April 16)`,"- `packages/release-checks/lint/` scans `/workspaces/northstar/checkpoints/release/`; `keel verify lint` writes `lint_run_id` for the candidate. Review links that identity rather than a copied summary so any warning, formatter change, or excluded file remains visible in its original context.","- `packages/release-checks/types/` scans `/workspaces/northstar/checkpoints/release/`; `keel verify types` records `type_graph_hash`. A later source or dependency change invalidates that graph and requires another check before the candidate can share the earlier result.","- `packages/release-checks/tests/` reads `/workspaces/northstar/testdata/`; `keel verify tests` stores `test_matrix_id`. The matrix names every package, host, browser, and fixture group that ran, making an omitted surface as visible as a failed assertion.","- `packages/release-checks/coverage/` reads `/workspaces/northstar/artifacts/coverage/`; `keel verify coverage` compares `coverage_floor_set`.","- `packages/release-checks/build/` emits `/workspaces/northstar/artifacts/builds/`; `keel verify build` stamps `bundle_manifest_sha`.","- `packages/release-checks/smoke/` stores `/workspaces/northstar/reviews/smoke/`; `keel verify smoke` requires `reviewer_ack`.",``,`## Durable project reference`,``,`### People and product context`,"- Mina Kestrel leads Northstar product engineering; the synthetic team directory lives in `packages/project-context/people/` and uses `mina_kestrel` plus `product_lead`.","- Oren Vale owns the Aurora renderer; notes in `packages/project-context/people/` use `oren_vale` and `rendering_owner`.","- Jules Rowan owns Harbor and Relay; entries in `packages/project-context/people/` use `jules_rowan` and `control_plane_owner`.","- Nia Ember owns Signal audio; records in `packages/project-context/people/` use `nia_ember` and `audio_owner`.","- Kestrel is the primary engineering agent; `/workspaces/northstar/agents/` maps `agent_kestrel` to `northstar_generalist`.","- Northstar is a fictional collaborative desktop environment; `/workspaces/northstar/docs/` defines `northstar_product` and `desktop_collaboration`.","- Aurora renders local workspaces and review scenes; `/workspaces/northstar/docs/` defines `aurora_renderer` and `scene_protocol_v6`.","- Atlas hosts sandboxed extensions; `/workspaces/northstar/docs/` defines `atlas_runtime` and `plugin_manifest_v4`.","- Harbor manages control-plane resources; `/workspaces/northstar/docs/` defines `harbor_cli` and `harbor_result_v2`.","- Relay promotes verified artifacts; `/workspaces/northstar/docs/` defines `relay_deploy` and `release_descriptor_sha`.","- Orbit synchronizes shared browser state; `/workspaces/northstar/docs/` defines `orbit_collab` and `room_epoch`.","- Signal captures and transcribes synthetic audio; `/workspaces/northstar/docs/` defines `signal_audio` and `utterance_seq`.","- Keel is the repository and verification CLI; `/workspaces/northstar/docs/` defines `keel_cli` and `verification_run`.","- Rook is the deterministic package builder; `/workspaces/northstar/docs/` defines `rook_builder` and `bundle_manifest`.","- The demo tenant is always synthetic; `/workspaces/northstar/fixtures/` uses `tenant_sandbox` and `viewer_alpha`.","- Review accounts use the reserved invalid domain; `/workspaces/northstar/fixtures/` stores `mina@example.invalid` and `oren@example.invalid`.","- Dates and identifiers describe an invented future project; `/workspaces/northstar/docs/` labels `fixture_provenance` and `synthetic_only`.","- Product decisions favor understandable failure states; `/workspaces/northstar/docs/` records `visible_diagnostics` and `recoverable_actions`.",``,`### Engineering preferences`,"- Keep each review branch narrow; `/workspaces/northstar/reviews/` records `change_scope` and `review_owner`.","- Prefer native text patches for source changes; `/workspaces/northstar/checkpoints/` records `patch_digest` and `base_oid`.","- Wait on CI through the supported command; `/workspaces/northstar/checkpoints/` stores `verification_run` and `final_status`.","- Never commit credential material; `/workspaces/northstar/config/` contains `credential_handle` and `lease_expiry` only.","- Require explicit confirmation before production promotion; `/workspaces/northstar/reviews/` stores `promotion_approval` and `rollback_plan`.","- Reproduce failures before changing a workaround; `/workspaces/northstar/repros/` stores `fixture_seed` and `first_failure_code`.","- Diagnose invisible failures with traffic and state metrics; `/workspaces/northstar/traces/` tracks `request_count` and `state_generation`.","- Use exact units instead of ambiguous shorthand; `/workspaces/northstar/docs/` prefers `approximately` and `milliseconds`.","- Keep secrets inside the broker boundary; `/workspaces/northstar/config/` exposes `credential_handle` and `provider_scope`.","- Report regressions with measured before and after values; `/workspaces/northstar/reviews/` records `baseline_metric` and `candidate_metric`.",``,`### Repository and verification map`,"- The monorepo root is `/workspaces/northstar/`; `packages/northstar-shell` contains the desktop host and `keel verify shell` is its focused gate.","- Aurora lives in `/workspaces/northstar/packages/`; `@northstar/aurora` is the public package and `aurora_protocol_v6` is the renderer contract.","- Atlas lives in `/workspaces/northstar/packages/`; `@northstar/atlas-runtime` owns plugin loading and `plugin_manifest_v4` is its schema.","- Harbor and Relay live in `/workspaces/northstar/packages/`; `@northstar/harbor-cli` owns commands and `release_descriptor_sha` identifies promotion input.","- Orbit and Signal live in `/workspaces/northstar/packages/`; `@northstar/orbit-collab` owns shared state and `utterance_seq` orders audio text.","- All synthetic fixtures live in `/workspaces/northstar/testdata/`; `keel verify fixtures` checks privacy and `fixture_provenance` marks their source.",``,`### Infrastructure and operations`,"- The local control plane uses `/workspaces/northstar/config/`; `harbor_local_profile` selects the sandbox and `credential_handle` references broker state.","- Preview artifacts use `/workspaces/northstar/artifacts/`; `aurora_bundle_hash` identifies the renderer and `canonical_bundle_id` drives drift checks.","- Deployment manifests use `/workspaces/northstar/artifacts/`; `release_descriptor_sha` pins content and `tested_artifact_sha` gates promotion.","- Collaboration traces use `/workspaces/northstar/traces/`; `room_epoch` identifies a session and `context_generation` identifies browser renewal.","- Mobile diagnostics use `/workspaces/northstar/traces/`; `mobile_diag_bundle` strips content and `device_epoch` orders state.","- Incident runbooks use `/workspaces/northstar/docs/`; `first_failure_code` names the initiating fault and `rollback_plan` names recovery.","- Review evidence uses `/workspaces/northstar/reviews/`; `baseline_metric` and `candidate_metric` keep UI judgments quantitative.","- Production promotion remains disabled in this fixture; `/workspaces/northstar/config/` sets `production_enabled` false and `tenant_sandbox` as the only tenant."].join(`
|
|
2980
|
-
`)+``;var
|
|
2980
|
+
`)+``;var li=new Set([`user`,`feedback`,`project`]),ui={user:{hue:`--rose`,label:`user`},feedback:{hue:`--cyan`,label:`feedback`},project:{hue:`--violet`,label:`project`}};function di(e){return e===`feedback`||e===`project`?e:`user`}var fi=M(`
|
|
2981
2981
|
:host {
|
|
2982
2982
|
display: inline-flex;
|
|
2983
2983
|
vertical-align: middle;
|
|
@@ -2999,13 +2999,13 @@ void main(){
|
|
|
2999
2999
|
background: color-mix(in srgb, var(--mtag-hue, var(--rose)) var(--mtag-fill), var(--canvas));
|
|
3000
3000
|
border: 1px solid color-mix(in srgb, var(--mtag-hue, var(--rose)) var(--mtag-border), var(--line));
|
|
3001
3001
|
}
|
|
3002
|
-
`),
|
|
3002
|
+
`),pi=`slicc-memtag-dark`,mi=`
|
|
3003
3003
|
.dark slicc-memtag,
|
|
3004
3004
|
[data-theme="dark"] slicc-memtag {
|
|
3005
3005
|
--mtag-fill: 22%;
|
|
3006
3006
|
--mtag-border: 38%;
|
|
3007
3007
|
}
|
|
3008
|
-
`;function
|
|
3008
|
+
`;function hi(e){if(e.getElementById(pi))return;let t=e.createElement(`style`);t.id=pi,t.textContent=mi,(e.head??e.documentElement).appendChild(t)}A(`slicc-memtag`,class extends HTMLElement{static observedAttributes=[`type`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[fi]}connectedCallback(){hi(this.ownerDocument),this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get type(){return di(this.getAttribute(`type`))}set type(e){this.setAttribute(`type`,li.has(e)?e:`user`)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let{hue:e,label:t}=ui[this.type],n=this.label??j(`slot`,null,t),r=j(`span`,{class:`mtag`,part:`tag`,style:`--mtag-hue:var(${e})`},n);this.#e.replaceChildren(r)}});var gi=`
|
|
3009
3009
|
slicc-memrow {
|
|
3010
3010
|
display: block;
|
|
3011
3011
|
border: 1px solid var(--line);
|
|
@@ -3112,7 +3112,7 @@ slicc-memrow.fresh {
|
|
|
3112
3112
|
background: color-mix(in srgb, var(--violet) 22%, var(--canvas));
|
|
3113
3113
|
border-color: color-mix(in srgb, var(--violet) 38%, var(--line));
|
|
3114
3114
|
}
|
|
3115
|
-
`,
|
|
3115
|
+
`,_i=`slicc-memrow-style`,vi=96,yi=12;function bi(e,t){if(e.length<=vi)return{heading:e,summary:t};let n=e.slice(0,97).lastIndexOf(` `),r=n>=yi?n:vi,i=e.slice(r).trim();return{heading:e.slice(0,r).trim(),summary:[i,t].filter(Boolean).join(` `)}}function xi(e){if(e.getElementById(_i))return;let t=e.createElement(`style`);t.id=_i,t.textContent=gi,(e.head??e.documentElement).appendChild(t)}function Si(e){return e===`feedback`||e===`project`?e:`user`}A(`slicc-memrow`,class extends HTMLElement{static get observedAttributes(){return[`heading`,`summary`,`tag`,`fresh`,`expanded`]}#e=!1;#t=null;#n=null;#r=null;#i=null;#a=null;#o=null;#s=0;#c=!1;#l=!1;#u=null;#d=null;#f=null;connectedCallback(){xi(this.ownerDocument),this.#e||this.#p(),this.#m(),this.#y(),this.#h()}disconnectedCallback(){this.#b(),this.#o?.disconnect(),this.#o=null,this.#s&&cancelAnimationFrame(this.#s),this.#s=0}attributeChangedCallback(){this.#e&&this.#m()}get heading(){return this.getAttribute(`heading`)??``}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get summary(){return this.getAttribute(`summary`)??``}set summary(e){e==null?this.removeAttribute(`summary`):this.setAttribute(`summary`,e)}get tag(){return Si(this.getAttribute(`tag`))}set tag(e){this.setAttribute(`tag`,e)}get fresh(){return this.hasAttribute(`fresh`)}set fresh(e){this.toggleAttribute(`fresh`,e)}get expanded(){return this.hasAttribute(`expanded`)}set expanded(e){this.toggleAttribute(`expanded`,e)}setHeadingContent(e){this.#c=!0,this.#n?this.#n.replaceChildren(e):this.#u=e}setBodyContent(e){this.#l=!0,this.#i?this.#i.replaceChildren(e):this.#d=e,this.#g()}#p(){this.#e=!0;let e=this.ownerDocument.createElement(`button`);e.className=`mt`,e.type=`button`;let t=this.ownerDocument.createElement(`b`),n=this.ownerDocument.createElement(`slicc-memtag`);e.append(t,n);let r=this.ownerDocument.createElement(`div`);for(r.className=`ms`;this.firstChild;)r.appendChild(this.firstChild);this.#u&&t.replaceChildren(this.#u),this.#d&&r.replaceChildren(this.#d),this.#u=null,this.#d=null,this.append(e,r),this.#t=e,this.#n=t,this.#r=n,this.#i=r}#m(){let e=this.#n,t=this.#r,n=this.#i;if(!e||!t||!n)return;let r=bi(this.heading,this.summary);this.#c||(e.textContent=r.heading);let i=this.tag;if(t.className=``,t.hidden=!this.hasAttribute(`tag`),t.setAttribute(`type`,i),t.textContent=``,!this.#l){let e=n.firstChild,t=r.summary;e&&e.nodeType===Node.TEXT_NODE?e.textContent=t:t&&n.insertBefore(this.ownerDocument.createTextNode(t),e)}this.classList.toggle(`fresh`,this.fresh),this.#v(),this.#g()}#h(){let e=this.#i;!e||this.#o||(this.#o=new ResizeObserver(()=>this.#g()),this.#o.observe(e),this.#g())}#g(){!this.isConnected||this.expanded||(this.#s&&cancelAnimationFrame(this.#s),this.#s=requestAnimationFrame(()=>{this.#s=0;let e=this.#i;!e||this.expanded||(e.scrollHeight>e.clientHeight+1?this.#_():this.#a?.remove(),this.#v())}))}#_(){if(!this.#a){let e=this.ownerDocument.createElement(`button`);e.className=`mexpand`,e.type=`button`,e.addEventListener(`click`,e=>{e.stopPropagation(),this.expanded=!this.expanded}),this.#a=e}this.#a.isConnected||this.append(this.#a)}#v(){let e=this.#a;if(!e?.isConnected)return;let t=this.expanded;e.textContent=t?`Show less`:`Show more`,e.setAttribute(`aria-expanded`,String(t))}#y(){this.#f||(this.#f=e=>this.#x(e),this.addEventListener(`click`,this.#f))}#b(){this.#f&&=(this.removeEventListener(`click`,this.#f),null)}#x(e){this.dispatchEvent(new CustomEvent(`select`,{bubbles:!0,composed:!0,detail:{heading:this.heading,summary:this.summary,tag:this.tag,sourceEvent:e}}))}});var Ci=`
|
|
3116
3116
|
slicc-memory-panel{display:flex;flex-direction:column;min-height:0;overflow:hidden;background:var(--canvas);color:var(--ink);font-family:var(--ui)}
|
|
3117
3117
|
slicc-memory-panel .mp-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:12px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--canvas) 94%,var(--violet))}
|
|
3118
3118
|
slicc-memory-panel .mp-search{display:flex;align-items:center;min-width:0;border:1px solid var(--line);border-radius:10px;background:var(--canvas);padding:0 10px}
|
|
@@ -3145,7 +3145,7 @@ slicc-memory-panel .mp-rows{padding:0;border-top:0}
|
|
|
3145
3145
|
slicc-memory-panel slicc-memrow{border:0;border-radius:0;border-top:1px solid var(--line);margin:0;padding:7px 12px}
|
|
3146
3146
|
slicc-memory-panel slicc-memrow .mt b{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
3147
3147
|
slicc-memory-panel slicc-memrow .ms{-webkit-line-clamp:1;margin-top:2px;font-size:11px}
|
|
3148
|
-
`,
|
|
3148
|
+
`,wi=`slicc-memory-panel-style`;function Ti(e){if(e.getElementById(wi))return;let t=e.createElement(`style`);t.id=wi,t.textContent=Ci,(e.head??e.documentElement).append(t)}function Ei(e){return e.getAttribute(`section`)?.trim()||`General`}function Di(e){let t=new Map;for(let n of e){let e=Ei(n),r=t.get(e)??[];r.push(n),t.set(e,r)}return t}var Oi=2,ki=[`user`,`feedback`,`project`];function Ai(e){for(let t of ki)if(e.filter(e=>e.getAttribute(`tag`)===t).length*2>e.length)return t;return null}function ji(e,t){let n=Ai(t);n&&e.setAttribute(`data-suppress-${n}`,``)}function Mi(e){let t=/^Auto-extracted \((?:(\d{4})-(\d{2})-(\d{2}),\s*)?([^)]+)\)$/.exec(e);if(!t){let t=/\(([^)]*\bsessions?\b[^)]*)\)/i.exec(e);return t?{name:`${e.slice(0,t.index)} ${e.slice(t.index+t[0].length)}`.replace(/\s+[—–-]\s*$/,``).replace(/\s+/g,` `).trim()||`Session memory`,source:t[1]}:{name:e,source:``}}let[,n,r,i,a]=t;if(!n||!r||!i)return{name:`Auto-extracted`,source:a};let o=new Date(Date.UTC(Number(n),Number(r)-1,Number(i)));return{name:new Intl.DateTimeFormat(`en-US`,{month:`short`,day:`numeric`,year:`numeric`,timeZone:`UTC`}).format(o),source:a.replaceAll(`-`,` `)}}A(`slicc-memory-panel`,class extends HTMLElement{#e=[];#t=null;#n=null;#r=null;#i=null;#a=``;#o=`all`;#s=new Set;#c=!1;connectedCallback(){Ti(this.ownerDocument),this.#c||this.#u(),this.#h()}setRows(e){let t=new Set(Di(this.#e).keys());this.#e=e.filter(e=>e.matches(`slicc-memrow`)),this.#l();let n=[...Di(this.#e).keys()],r=new Set;for(let e of n)(!t.has(e)||this.#s.has(e))&&r.add(e);this.#s=r,this.#c&&this.#h()}#l(){let e=this.#i;if(e){for(let t of e.options){if(t.value===`all`)continue;let e=!this.#e.some(e=>e.getAttribute(`tag`)===t.value);t.hidden=e,t.disabled=e}e.value=this.#o}}#u(){this.#c=!0;let e=j(`input`,{type:`search`,placeholder:`Search memories…`,"aria-label":`Search memories`}),t=j(`select`,{class:`mp-filter`,"aria-label":`Filter memories by tag`},j(`option`,{value:`all`},`All tags`),j(`option`,{value:`user`},`User`),j(`option`,{value:`feedback`},`Feedback`),j(`option`,{value:`project`},`Project`)),n=j(`div`,{class:`mp-count`,role:`status`,"aria-live":`polite`}),r=j(`div`,{class:`mp-toolbar`},j(`label`,{class:`mp-search`},e),t,n),i=j(`div`,{class:`mp-body`});e.addEventListener(`input`,()=>{this.#a=e.value.trim().toLowerCase(),this.#h()}),t.addEventListener(`change`,()=>{this.#o=t.value,this.#h()}),this.replaceChildren(r,i),this.#t=i,this.#n=n,this.#r=e,this.#i=t,this.#l()}#d(){return this.#e.filter(e=>this.#o!==`all`&&e.getAttribute(`tag`)!==this.#o?!1:!this.#a||[e.getAttribute(`heading`),e.getAttribute(`summary`),e.getAttribute(`section`),e.getAttribute(`tag`),e.textContent].filter(Boolean).join(` `).toLowerCase().includes(this.#a))}#f(e){return j(`div`,{class:`mp-empty`},j(`strong`,null,e?`No matching memories`:`No memories yet`),j(`span`,null,e?`Try a different search or tag.`:`Memories extracted from conversations will appear here.`))}#p(e,t){let n=Mi(e),r=j(`details`,{class:`mp-group`},j(`summary`,{class:`mp-section`},j(`span`,{class:`mp-section-name`},n.name),...n.source?[j(`span`,{class:`mp-section-source`},n.source)]:[],j(`span`,{class:`mp-section-count`},`${t.length}`)),j(`div`,{class:`mp-rows`},...t));return r.open=this.#a?!0:this.#s.has(e),r.addEventListener(`toggle`,()=>{r.open?this.#s.add(e):this.#s.delete(e)}),ji(r,t),r}#m(e){let t=j(`div`,{class:`mp-flat`},...e);return ji(t,e),t}#h(){let e=this.#t;if(!e)return;let t=this.#d();if(this.#r&&(this.#r.placeholder=`Search ${this.#e.length} memories…`),this.#n&&(this.#n.textContent=`${t.length} of ${this.#e.length} memories`),this.#e.length===0){e.replaceChildren(this.#f(!1));return}if(t.length===0){e.replaceChildren(this.#f(!0));return}let n=Di(t);if(n.size<Oi){e.replaceChildren(this.#m(t));return}e.replaceChildren(...[...n].map(([e,t])=>this.#p(e,t)))}});var Ni=`
|
|
3149
3149
|
slicc-palette-grid {
|
|
3150
3150
|
display: block;
|
|
3151
3151
|
flex: 1;
|
|
@@ -3164,7 +3164,7 @@ slicc-palette-grid .palgrid {
|
|
|
3164
3164
|
grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
|
|
3165
3165
|
gap: 10px;
|
|
3166
3166
|
}
|
|
3167
|
-
`,
|
|
3167
|
+
`,Pi=`slicc-palette-grid-style`;function Fi(e){if(e.getElementById(Pi))return;let t=e.createElement(`style`);t.id=Pi,t.textContent=Ni,(e.head??e.documentElement).appendChild(t)}var Ii=[{label:`canvas #faf6f1`,color:`#faf6f1`},{label:`cone #ef7000`,color:`#ef7000`},{label:`scoop #8b5cf6`,color:`#8b5cf6`},{label:`scoop #06b6d4`,color:`#06b6d4`},{label:`scoop #f43f5e`,color:`#f43f5e`},{label:`ink #0a0a0a`,color:`#0a0a0a`}],Li=`brand palette · tokens`;A(`slicc-palette-grid`,class extends HTMLElement{static get observedAttributes(){return[`heading`]}#e=!1;#t=null;#n=null;#r=[];#i=null;#a=null;connectedCallback(){Fi(this.ownerDocument),this.#e||this.#o(),this.#s(),this.#l()}disconnectedCallback(){this.#u()}attributeChangedCallback(){this.#e&&this.#s()}get heading(){return this.getAttribute(`heading`)??Li}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get tokens(){return(this.#i??Ii).map(e=>({...e}))}set tokens(e){this.#i=Array.isArray(e)?e.map(e=>({label:String(e.label??``),color:String(e.color??``)})):null,this.#e&&this.#c()}#o(){for(this.#e=!0,this.#r=[];this.firstChild;)this.#r.push(this.firstChild),this.removeChild(this.firstChild);let e=this.ownerDocument.createElement(`h4`),t=this.ownerDocument.createElement(`div`);t.className=`palgrid`,this.append(e,t),this.#t=e,this.#n=t,this.#c()}#s(){this.#t&&(this.#t.textContent=this.heading)}#c(){let e=this.#n;if(e){e.replaceChildren();for(let t of this.#r)e.appendChild(t);for(let t of this.tokens){let n=this.ownerDocument.createElement(`slicc-palette-cell`);n.setAttribute(`color`,t.color),n.setAttribute(`label`,t.label),e.appendChild(n)}}}#l(){this.#a||(this.#a=e=>{let t=e.detail??{};this.dispatchEvent(new CustomEvent(`select`,{bubbles:!0,composed:!0,detail:{label:t.label??``,color:t.color??``,sourceEvent:e}}))},this.addEventListener(`palette-select`,this.#a))}#u(){this.#a&&=(this.removeEventListener(`palette-select`,this.#a),null)}});var Ri=M(`
|
|
3168
3168
|
:host { display: inline-block; position: relative; font-family: var(--ui); }
|
|
3169
3169
|
.trigger {
|
|
3170
3170
|
display: inline-flex; align-items: center; justify-content: center;
|
|
@@ -3205,7 +3205,7 @@ slicc-palette-grid .palgrid {
|
|
|
3205
3205
|
.item .ic { flex: 0 0 auto; display: flex; color: var(--txt-2, #505050); }
|
|
3206
3206
|
.item.danger .ic { color: var(--rose, #f43f5e); }
|
|
3207
3207
|
@media (prefers-reduced-motion: reduce) { .pop { transition: none; } }
|
|
3208
|
-
`);A(`slicc-avatar-menu`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t;#n;#r=[];#i=null;#a=e=>{this.open&&!e.composedPath().includes(this)&&this.hide()};#o=e=>{e.key===`Escape`&&this.open&&(this.hide(),this.#t.focus())};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
3208
|
+
`);A(`slicc-avatar-menu`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t;#n;#r=[];#i=null;#a=e=>{this.open&&!e.composedPath().includes(this)&&this.hide()};#o=e=>{e.key===`Escape`&&this.open&&(this.hide(),this.#t.focus())};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ri],this.#t=j(`button`,{class:`trigger`,part:`trigger`,type:`button`,"aria-haspopup":`menu`,"aria-expanded":`false`},j(`slot`)),this.#n=j(`div`,{class:`pop`,part:`popover`,role:`menu`}),this.#e.replaceChildren(this.#t,this.#n),this.#t.addEventListener(`click`,()=>this.toggle())}connectedCallback(){this.#c()}disconnectedCallback(){document.removeEventListener(`mousedown`,this.#a),document.removeEventListener(`keydown`,this.#o)}attributeChangedCallback(e){if(e===`open`){let e=this.open;this.#t.setAttribute(`aria-expanded`,e?`true`:`false`),e?(document.addEventListener(`mousedown`,this.#a),document.addEventListener(`keydown`,this.#o)):(document.removeEventListener(`mousedown`,this.#a),document.removeEventListener(`keydown`,this.#o))}}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get user(){return this.#i}set user(e){this.#i=e,this.#c()}get items(){return this.#r.map(e=>({...e}))}set items(e){this.#r=Array.isArray(e)?e.map(e=>({...e})):[],this.#c()}show(){this.open||(this.open=!0,this.#s())}hide(){this.open&&(this.open=!1,this.#s())}toggle(){this.open?this.hide():this.show()}#s(){this.dispatchEvent(new CustomEvent(`slicc-avatar-menu-toggle`,{detail:{open:this.open},bubbles:!0,composed:!0}))}#c(){let e=[];if(this.#i){let t=j(`div`,{class:`user`},j(`div`,{class:`name`},this.#i.name));this.#i.provider&&t.append(j(`div`,{class:`prov`},this.#i.provider)),e.push(t)}for(let t of this.#r)if(t.kind===`separator`)e.push(j(`div`,{class:`sep`,role:`separator`}));else if(t.kind===`caption`)e.push(j(`div`,{class:`cap`},t.label??``));else{let r=j(`button`,{class:`item${t.danger?` danger`:``}`,part:`item`,type:`button`,role:`menuitem`,"data-id":t.id??``,disabled:t.disabled?!0:void 0});t.icon&&r.append(j(`span`,{class:`ic`},n(t.icon,{size:16}))),r.append(j(`span`,{class:`lb`},t.label??``)),t.disabled||r.addEventListener(`click`,()=>this.#l(t.id??``)),e.push(r)}this.#n.replaceChildren(...e)}#l(e){this.dispatchEvent(new CustomEvent(`slicc-avatar-action`,{detail:{id:e},bubbles:!0,composed:!0})),this.hide()}});var zi=`
|
|
3209
3209
|
.slicc-nav {
|
|
3210
3210
|
display: flex;
|
|
3211
3211
|
align-items: center;
|
|
@@ -3235,7 +3235,7 @@ slicc-palette-grid .palgrid {
|
|
|
3235
3235
|
width, not the viewport, so embedded and Storybook frames behave like the
|
|
3236
3236
|
real sidebar. */
|
|
3237
3237
|
.slicc-nav[data-narrow] { gap: 8px; padding: 0 10px; }
|
|
3238
|
-
`,
|
|
3238
|
+
`,Bi=`slicc-nav-style`;function Vi(e){if(e.getElementById(Bi))return;let t=e.createElement(`style`);t.id=Bi,t.textContent=zi,(e.head??e.documentElement).appendChild(t)}A(`slicc-nav`,class extends HTMLElement{static observedAttributes=[`accent`];#e=!1;#t=null;connectedCallback(){Vi(this.ownerDocument),this.classList.add(`slicc-nav`),this.setAttribute(`part`,`bar`),this.#n(),this.#r(this.getAttribute(`accent`)),typeof ResizeObserver<`u`&&(this.#t=new ResizeObserver(()=>this.#i()),this.#t.observe(this)),this.#i()}disconnectedCallback(){this.#t?.disconnect(),this.#t=null}attributeChangedCallback(e,t,n){e===`accent`&&t!==n&&this.isConnected&&(this.#r(n),this.dispatchEvent(new CustomEvent(`slicc-nav-accent-change`,{detail:{accent:n},bubbles:!0,composed:!0})))}get accent(){return this.getAttribute(`accent`)}set accent(e){e==null?this.removeAttribute(`accent`):this.setAttribute(`accent`,e)}get spacer(){return this.#n(),this.querySelector(`:scope > .slicc-nav__spacer, :scope > .spacer`)}#n(){if(this.#e||(this.#e=!0,this.querySelector(`:scope > .slicc-nav__spacer, :scope > .spacer`)))return;let e=this.ownerDocument.createElement(`div`);e.className=`slicc-nav__spacer`,e.setAttribute(`part`,`spacer`),e.setAttribute(`aria-hidden`,`true`);let t=this.querySelector(`:scope > slicc-floatbar, :scope > slicc-theme-toggle, :scope > slicc-avatar`);t?this.insertBefore(e,t):this.appendChild(e)}#r(e){e==null||e.trim()===``?this.style.removeProperty(`--ctx`):this.style.setProperty(`--ctx`,e)}#i(){this.toggleAttribute(`data-narrow`,this.getBoundingClientRect().width<=560)}});var Hi=M(`
|
|
3239
3239
|
:host {
|
|
3240
3240
|
position: fixed;
|
|
3241
3241
|
z-index: 110;
|
|
@@ -3273,7 +3273,7 @@ slicc-palette-grid .palgrid {
|
|
|
3273
3273
|
.item.destructive {
|
|
3274
3274
|
color: var(--red, #e53e3e);
|
|
3275
3275
|
}
|
|
3276
|
-
`),
|
|
3276
|
+
`),Ui=null,Wi=null,Gi=null,Ki=class e extends HTMLElement{#e;#t=void 0;#n=null;#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Hi]}connectedCallback(){this.#e.addEventListener(`click`,this.#i)}disconnectedCallback(){this.#e.removeEventListener(`click`,this.#i)}#i=t=>{let n=t.target.closest(`[data-action]`);if(!n)return;let r=n.dataset.action;(this.#r??this.#n??this).dispatchEvent(new CustomEvent(`overflow-action`,{bubbles:!0,composed:!0,detail:{action:r,context:this.#t}})),e.hide()};static show(t){e.hide();let r=document.createElement(`slicc-overflow-menu`);r.#t=t.context,r.#n=t.anchor,r.#r=t.dispatchTarget??null;let i=t.items.filter(e=>e.visible!==!1),a=j(`div`,{class:`menu`});for(let e of i){let t=e.destructive?`item destructive`:`item`,r=[];e.icon&&r.push(n(e.icon,{size:14})),r.push(e.label);let i=j(`button`,{class:t,"data-action":e.id},...r);a.appendChild(i)}r.#e.appendChild(a),document.body.appendChild(r),Ui=r;let o=t.anchor.getBoundingClientRect(),s=r.getBoundingClientRect(),c=o.bottom+4;c+s.height>window.innerHeight&&(c=o.top-s.height-4);let l=o.right-s.width;l<4&&(l=o.left),r.style.top=`${c}px`,r.style.left=`${l}px`,Wi=t=>{t.key===`Escape`&&e.hide()},Gi=n=>{let i=n.composedPath();!i.includes(r)&&!i.includes(t.anchor)&&e.hide()},document.addEventListener(`keydown`,Wi),document.addEventListener(`pointerdown`,Gi,{capture:!0})}static hide(){Ui&&=(Ui.remove(),null),Wi&&=(document.removeEventListener(`keydown`,Wi),null),Gi&&=(document.removeEventListener(`pointerdown`,Gi,{capture:!0}),null)}};A(`slicc-overflow-menu`,Ki);var qi=M(`
|
|
3277
3277
|
:host { display: none; }
|
|
3278
3278
|
:host([open]) { display: block; }
|
|
3279
3279
|
.overlay {
|
|
@@ -3320,7 +3320,7 @@ slicc-palette-grid .palgrid {
|
|
|
3320
3320
|
@media (prefers-reduced-motion: reduce) {
|
|
3321
3321
|
.overlay, .dialog { transition: none; }
|
|
3322
3322
|
}
|
|
3323
|
-
`);A(`slicc-dialog`,class extends HTMLElement{static observedAttributes=[`open`,`heading`,`description`,`no-close-button`];#e;#t;#n;#r;#i;#a;#o=null;#s=e=>{e.key===`Escape`&&this.open&&(e.stopPropagation(),this.#c(`escape`))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
3323
|
+
`);A(`slicc-dialog`,class extends HTMLElement{static observedAttributes=[`open`,`heading`,`description`,`no-close-button`];#e;#t;#n;#r;#i;#a;#o=null;#s=e=>{e.key===`Escape`&&this.open&&(e.stopPropagation(),this.#c(`escape`))};constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[qi],this.#r=j(`div`,{class:`title`,part:`title`,id:`slicc-dialog-title`}),this.#i=j(`div`,{class:`desc`,part:`description`}),this.#a=j(`button`,{class:`x`,part:`close`,type:`button`,"aria-label":`Close`},n(`x`,{size:18}));let e=j(`div`,{class:`body`},j(`slot`)),t=j(`div`,{class:`footer`},j(`slot`,{name:`footer`}));this.#n=j(`div`,{class:`dialog`,part:`dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`slicc-dialog-title`,tabindex:`-1`},this.#a,this.#r,this.#i,e,t),this.#t=j(`div`,{class:`overlay`,part:`overlay`},this.#n),this.#e.replaceChildren(this.#t),this.#a.addEventListener(`click`,()=>this.#c(`close-button`)),this.#t.addEventListener(`mousedown`,e=>{e.target===this.#t&&!this.persistent&&this.#c(`backdrop`)})}connectedCallback(){this.#u()}disconnectedCallback(){document.removeEventListener(`keydown`,this.#s,!0)}attributeChangedCallback(e){e===`open`?this.#u():this.#l()}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,e)}get heading(){return this.getAttribute(`heading`)}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get description(){return this.getAttribute(`description`)}set description(e){e==null?this.removeAttribute(`description`):this.setAttribute(`description`,e)}get persistent(){return this.hasAttribute(`persistent`)}set persistent(e){this.toggleAttribute(`persistent`,e)}show(){this.open||=!0}hide(){this.open&&this.#c(`api`)}#c(e){this.open=!1,this.dispatchEvent(new CustomEvent(`slicc-dialog-close`,{detail:{reason:e},bubbles:!0,composed:!0}))}#l(){this.#r.textContent=this.heading??``,this.#r.style.display=this.heading?``:`none`,this.#i.textContent=this.description??``,this.#i.style.display=this.description?``:`none`,this.#a.style.display=this.hasAttribute(`no-close-button`)?`none`:``}#u(){this.#l(),this.open?(this.#o=this.getRootNode().activeElement,document.addEventListener(`keydown`,this.#s,!0),requestAnimationFrame(()=>this.#n.focus())):(document.removeEventListener(`keydown`,this.#s,!0),this.#o?.focus?.(),this.#o=null)}});var Ji=`
|
|
3324
3324
|
slicc-camera-dialog slicc-dialog::part(dialog) {
|
|
3325
3325
|
width: min(560px, 92vw);
|
|
3326
3326
|
}
|
|
@@ -3387,7 +3387,7 @@ slicc-camera-dialog .slicc-camera__btn--snap {
|
|
|
3387
3387
|
slicc-camera-dialog .slicc-camera__btn--snap:hover {
|
|
3388
3388
|
background: color-mix(in srgb, var(--ink) 85%, var(--canvas));
|
|
3389
3389
|
}
|
|
3390
|
-
`,
|
|
3390
|
+
`,Yi=`slicc-camera-dialog-style`;function Xi(e){if(e.getElementById(Yi))return;let t=e.createElement(`style`);t.id=Yi,t.textContent=Ji,(e.head??e.documentElement).appendChild(t)}var Zi=`Take a photo`;A(`slicc-camera-dialog`,class extends HTMLElement{static observedAttributes=[`heading`,`preferred-device`];media=null;#e;#t;#n;#r;#i=!1;#a=null;#o=null;connectedCallback(){Xi(this.ownerDocument),this.#h()}disconnectedCallback(){this.#m()}attributeChangedCallback(e){e===`heading`&&this.#i&&this.#e.setAttribute(`heading`,this.heading)}get heading(){return this.getAttribute(`heading`)??Zi}set heading(e){e==null?this.removeAttribute(`heading`):this.setAttribute(`heading`,e)}get preferredDevice(){return this.getAttribute(`preferred-device`)}set preferredDevice(e){e==null?this.removeAttribute(`preferred-device`):this.setAttribute(`preferred-device`,e)}#s(){return this.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}async open(){this.#h();let e=this.#s();if(!e)return null;try{this.#a=await this.#c(e,this.preferredDevice)}catch{return null}return this.#l(this.#a),await this.#u(e),this.#e.setAttribute(`heading`,this.heading),this.#e.show?.(),new Promise(e=>{this.#o=e})}async#c(e,t){if(t)try{return await e.getUserMedia({video:{deviceId:{exact:t}}})}catch{}return e.getUserMedia({video:!0})}#l(e){this.#t.srcObject=e,this.#t.play?.()?.catch(()=>void 0);let t=e.getVideoTracks()[0]?.getSettings?.().facingMode;this.#t.toggleAttribute(`data-mirrored`,t!==`environment`)}async#u(e){let t=[];try{t=(await e.enumerateDevices()).filter(e=>e.kind===`videoinput`)}catch{t=[]}this.#n.replaceChildren(...t.map((e,t)=>j(`option`,{value:e.deviceId},e.label||`Camera ${t+1}`)));let n=this.#a?.getVideoTracks()[0]?.getSettings?.().deviceId;n&&(this.#n.value=n),this.#n.toggleAttribute(`hidden`,t.length<2)}async#d(e){let t=this.#s();if(t){this.#r.textContent=``;try{let n=await t.getUserMedia({video:{deviceId:{exact:e}}});this.#m(),this.#a=n,this.#l(n),this.dispatchEvent(new CustomEvent(`slicc-camera-device-change`,{detail:{deviceId:e},bubbles:!0,composed:!0}))}catch{this.#r.textContent=`Could not switch camera — keeping the current one.`}}}#f(){let e=this.ownerDocument.createElement(`canvas`);if(e.width=this.#t.videoWidth,e.height=this.#t.videoHeight,e.width===0||e.height===0){this.#r.textContent=`No frame yet — give the camera a moment.`;return}e.getContext(`2d`)?.drawImage(this.#t,0,0);let t=e.toDataURL(`image/png`);this.dispatchEvent(new CustomEvent(`slicc-camera-capture`,{detail:{dataUrl:t},bubbles:!0,composed:!0})),this.#p(t)}#p(e){this.#m();let t=this.#o;this.#o=null,this.#e.hide?.(),t?.(e)}#m(){for(let e of this.#a?.getTracks()??[])e.stop();this.#a=null,this.#t&&(this.#t.srcObject=null)}#h(){if(this.#i)return;this.#i=!0,this.#t=j(`video`,{class:`slicc-camera__video`,part:`video`,autoplay:!0,muted:!0,playsinline:!0}),this.#n=j(`select`,{class:`slicc-camera__select`,part:`picker`,"aria-label":`Camera`,hidden:!0}),this.#n.addEventListener(`change`,()=>{this.#d(this.#n.value)}),this.#r=j(`div`,{class:`slicc-camera__status`});let e=j(`button`,{type:`button`,class:`slicc-camera__btn`,part:`cancel`,slot:`footer`},`Cancel`);e.addEventListener(`click`,()=>this.#p(null));let t=j(`button`,{type:`button`,class:`slicc-camera__btn slicc-camera__btn--snap`,part:`snap`,slot:`footer`},n(`camera`,{size:14}),` Snap`);t.addEventListener(`click`,()=>this.#f());let r=j(`div`,{class:`slicc-camera__body`},this.#t,this.#n,this.#r);this.#e=this.ownerDocument.createElement(`slicc-dialog`),this.#e.setAttribute(`heading`,this.heading),this.#e.append(r,e,t),this.#e.addEventListener(`slicc-dialog-close`,()=>{this.#o&&this.#p(null)}),this.append(this.#e)}});var Qi={debug(e,t){t===void 0?console.debug(`[slicc-permissions] ${e}`):console.debug(`[slicc-permissions] ${e}`,t)},error(e,t){t===void 0?console.error(`[slicc-permissions] ${e}`):console.error(`[slicc-permissions] ${e}`,t)}},$i=new Set([`microphone`,`camera`]);function ea(e){return typeof navigator>`u`||!navigator.permissions?.query?Promise.resolve(`prompt`):navigator.permissions.query({name:e}).then(e=>e.state)}var ta=`
|
|
3391
3391
|
slicc-permissions {
|
|
3392
3392
|
/* Invisible host by default — only the drop overlay paints, and only
|
|
3393
3393
|
while a folder drag is in flight. Hosts can give the element a fixed
|
|
@@ -3558,7 +3558,7 @@ slicc-permissions .slicc-permissions__prompt-btn:disabled {
|
|
|
3558
3558
|
transform: translateX(-50%) translateY(0);
|
|
3559
3559
|
}
|
|
3560
3560
|
}
|
|
3561
|
-
`,
|
|
3561
|
+
`,na=`slicc-permissions-style`;function ra(e){if(e.getElementById(na))return;let t=e.createElement(`style`);t.id=na,t.textContent=ta,(e.head??e.documentElement).appendChild(t)}function ia(e){let t=e.dataTransfer?.types;if(!t)return!1;for(let e=0;e<t.length;e++)if(t[e]===`Files`)return!0;return!1}var aa=class extends HTMLElement{providers={};permissionQuery=null;#e;#t=!1;#n=0;#r=null;connectedCallback(){ra(this.ownerDocument),this.#C();let e=this.ownerDocument;e.addEventListener(`dragenter`,this.#v),e.addEventListener(`dragover`,this.#y),e.addEventListener(`dragleave`,this.#b),e.addEventListener(`drop`,this.#x)}disconnectedCallback(){let e=this.ownerDocument;e.removeEventListener(`dragenter`,this.#v),e.removeEventListener(`dragover`,this.#y),e.removeEventListener(`dragleave`,this.#b),e.removeEventListener(`drop`,this.#x),this.#n=0,this.removeAttribute(`data-dropping`),this.#r&&this.#r.cancel()}async request(e,t){switch(e){case`camera`:return this.#o(t);case`microphone`:return this.#s(t);case`screenshare`:return this.#l(t);case`usb`:return this.#u(t);case`hid`:return this.#d(t);case`serial`:return this.#f(t);case`filesystem`:return this.#p();case`popup`:return this.#m(t);default:return null}}async prompt(e){if(!e.kinds.length)return{status:`granted`,grants:[]};if(e.skipIfGranted){let t=await this.#i(e);if(t)return t}return this.#r&&this.#r.cancel(),new Promise(t=>{this.#w(e,t)})}async#i(e){if(!e.kinds.every(e=>$i.has(e)))return Qi.debug(`prompt: showing dialog (a gesture-bound kind was requested)`,{kinds:e.kinds}),null;let t=this.permissionQuery??ea,n;try{n=await Promise.all(e.kinds.map(e=>t(e)))}catch(e){return Qi.error(`prompt: permission query threw; showing dialog`,e),null}if(Qi.debug(`prompt: queried permission state`,{kinds:e.kinds,states:n}),!n.every(e=>e===`granted`))return Qi.debug(`prompt: not all kinds granted; showing dialog`),null;let r=[];for(let t of e.kinds){let n=await this.request(t,e.requestOptions?.[t]);if(!n)return Qi.error(`prompt: acquisition failed after granted state`,{kind:t}),{status:`error`,grants:r,reason:`error`};r.push(n)}return Qi.debug(`prompt: short-circuited dialog (already granted)`,{kinds:e.kinds}),{status:`granted`,grants:r}}#a(){return this.providers.media??(typeof navigator<`u`?navigator.mediaDevices:null)??null}async#o(e){let t=this.#a();if(!t)return this.#g(`camera`,`unavailable`,`mediaDevices unavailable`);try{let n=await t.getUserMedia(e?.constraints??{video:!0});return this.#h({kind:`camera`,stream:n})}catch(e){return this.#_(`camera`,e)}}async#s(e){let t=this.#a();if(!t)return this.#g(`microphone`,`unavailable`,`mediaDevices unavailable`);try{let n=await t.getUserMedia(e?.constraints??{audio:!0});return this.#h({kind:`microphone`,stream:n})}catch(e){return this.#_(`microphone`,e)}}#c(){if(this.providers.screenshare)return this.providers.screenshare;let e=typeof navigator<`u`?navigator.mediaDevices:void 0;return e&&typeof e.getDisplayMedia==`function`?{getDisplayMedia:t=>e.getDisplayMedia(t)}:null}async#l(e){let t=this.#c();if(!t)return this.#g(`screenshare`,`unavailable`,`getDisplayMedia unavailable`);try{let n=await t.getDisplayMedia(e?.constraints??{video:!0});return this.#h({kind:`screenshare`,stream:n})}catch(e){return this.#_(`screenshare`,e)}}async#u(e){let t=this.providers.usb??globalThis.navigator?.usb??null;if(!t?.requestDevice)return this.#g(`usb`,`unavailable`,`WebUSB unavailable`);try{let n=await t.requestDevice({filters:e?.filters??[]});return n?this.#h({kind:`usb`,device:n}):this.#g(`usb`,`cancelled`)}catch(e){return this.#_(`usb`,e)}}async#d(e){let t=this.providers.hid??globalThis.navigator?.hid??null;if(!t?.requestDevice)return this.#g(`hid`,`unavailable`,`WebHID unavailable`);try{let n=await t.requestDevice({filters:e?.filters??[]}),r=Array.isArray(n)?n:n?[n]:[];return r.length===0?this.#g(`hid`,`cancelled`):this.#h({kind:`hid`,device:r[0],devices:r})}catch(e){return this.#_(`hid`,e)}}async#f(e){let t=this.providers.serial??globalThis.navigator?.serial??null;if(!t?.requestPort)return this.#g(`serial`,`unavailable`,`Web Serial unavailable`);try{let n=await t.requestPort(e?.filters?.length?{filters:e.filters}:{});return n?this.#h({kind:`serial`,port:n}):this.#g(`serial`,`cancelled`)}catch(e){return this.#_(`serial`,e)}}async#p(){let e=this.providers.filesystem??(typeof window<`u`&&`showDirectoryPicker`in window&&window||null);if(!e?.showDirectoryPicker)return this.#g(`filesystem`,`unavailable`,`showDirectoryPicker unavailable`);try{let t=await e.showDirectoryPicker({mode:`readwrite`});return this.#h({kind:`filesystem`,handle:t,source:`picker`,permission:`granted`})}catch(e){return this.#_(`filesystem`,e)}}#m(e){let t=e?.url;if(!t)return this.#g(`popup`,`error`,`popup request missing url`);let n=e?.features??`width=500,height=700,popup=yes`,r=this.providers.popup??(typeof window<`u`?{open:(e,t)=>window.open(e,`_blank`,t)}:null);if(!r)return this.#g(`popup`,`unavailable`,`window.open unavailable`);let i;try{i=r.open(t,n)}catch(e){return this.#_(`popup`,e)}return i?this.#h({kind:`popup`,window:i}):this.#g(`popup`,`error`,`window.open returned null (popup blocked?)`)}#h(e){return this.dispatchEvent(new CustomEvent(`slicc-permission-grant`,{detail:e,bubbles:!0,composed:!0})),e}#g(e,t,n){return this.dispatchEvent(new CustomEvent(`slicc-permission-deny`,{detail:{kind:e,reason:t,message:n},bubbles:!0,composed:!0})),null}#_(e,t){return t instanceof Error&&(t.name===`AbortError`||t.name===`NotFoundError`)?this.#g(e,`cancelled`):this.#g(e,`error`,t instanceof Error?t.message:String(t))}#v=e=>{ia(e)&&(e.preventDefault(),this.#n++,this.setAttribute(`data-dropping`,``))};#y=e=>{ia(e)&&e.preventDefault()};#b=e=>{ia(e)&&(this.#n=Math.max(0,this.#n-1),this.#n===0&&this.removeAttribute(`data-dropping`))};#x=e=>{if(!ia(e))return;e.preventDefault(),this.#n=0,this.removeAttribute(`data-dropping`);let t=e.dataTransfer?.items;if(!t?.length)return;let n=[];for(let e=0;e<t.length;e++){let r=t[e];r.kind===`file`&&typeof r.getAsFileSystemHandle==`function`&&n.push(r.getAsFileSystemHandle())}n.length!==0&&this.#S(n)};async#S(e){let t;try{t=await Promise.all(e)}catch(e){this.#g(`filesystem`,`error`,e instanceof Error?e.message:String(e));return}let n=t.find(e=>e?.kind===`directory`);if(!n){this.#g(`filesystem`,`cancelled`,`no directory in drop`);return}let r=n,i;if(r.requestPermission)try{i=await r.requestPermission({mode:`readwrite`})}catch(e){this.#g(`filesystem`,`error`,e instanceof Error?e.message:String(e));return}else i=`granted`;if(i!==`granted`){this.#g(`filesystem`,`cancelled`,`permission ${i}`);return}this.#h({kind:`filesystem`,handle:n,source:`drop`,permission:i})}#C(){if(this.#t)return;this.#t=!0;let e=j(`div`,{class:`slicc-permissions__drop-inner`},n(`folder-up`,{size:32}),j(`div`,null,`Drop a folder to mount it (read-write)`));this.#e=j(`div`,{class:`slicc-permissions__drop`,part:`drop`,"aria-hidden":`true`},e),this.append(this.#e)}#w(e,t){let r=e.heading??ca(e.kinds),i=e.grantLabel??`Allow`,a=e.cancelLabel??`Cancel`,o=`slicc-permissions__heading-${Math.random().toString(36).slice(2,8)}`,s=`slicc-permissions__desc-${Math.random().toString(36).slice(2,8)}`,c=j(`button`,{type:`button`,class:`slicc-permissions__prompt-btn`,"data-variant":`ghost`,part:`prompt-cancel`},a),l=j(`button`,{type:`button`,class:`slicc-permissions__prompt-btn`,"data-variant":`primary`,part:`prompt-grant`},i),u=j(`div`,{class:`slicc-permissions__prompt-icons`,"aria-hidden":`true`},...e.kinds.map(e=>j(`span`,{class:`slicc-permissions__prompt-icon`},n(oa(e),{size:22})))),d=j(`div`,{class:`slicc-permissions__prompt`,part:`prompt`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":o,"aria-describedby":s,tabindex:`-1`,popover:`manual`},u,j(`h2`,{class:`slicc-permissions__prompt-heading`,id:o},r),j(`p`,{class:`slicc-permissions__prompt-desc`,id:s},e.description),j(`div`,{class:`slicc-permissions__prompt-actions`},c,l));this.append(d);let f=d;if(typeof f.showPopover==`function`)try{f.showPopover()}catch{}let p=!1,m=this.ownerDocument.activeElement??null,h=()=>{if(d.removeEventListener(`keydown`,_),d.remove(),m&&typeof m.focus==`function`)try{m.focus()}catch{}this.#r=null},g=(n,r)=>{if(!p){p=!0;for(let t of e.kinds)this.#g(t,n,r);h(),t({status:`cancelled`,grants:[],reason:n,message:r})}},_=e=>{if(e.key===`Escape`){e.preventDefault(),g(`cancelled`);return}if(e.key===`Tab`){let t=[c,l],n=this.ownerDocument.activeElement,r=t.indexOf(n);if(r===-1){t[0].focus(),e.preventDefault();return}(e.shiftKey?t[(r-1+t.length)%t.length]:t[(r+1)%t.length]).focus(),e.preventDefault()}};c.addEventListener(`click`,()=>g(`cancelled`)),l.addEventListener(`click`,async()=>{if(p)return;p=!0,l.disabled=!0,c.disabled=!0;let n=[],r=null;for(let t of e.kinds){let i=await this.request(t,e.requestOptions?.[t]);if(i)n.push(i);else{r={kind:t,reason:`cancelled`};break}}let i=r?e.kinds.indexOf(r.kind):-1;if(r&&i>=0)for(let t=i+1;t<e.kinds.length;t++)this.#g(e.kinds[t],`cancelled`);h(),t(r?{status:`cancelled`,grants:n,reason:`cancelled`}:{status:`granted`,grants:n})}),d.addEventListener(`keydown`,_),this.#r={cancel:()=>g(`cancelled`)},requestAnimationFrame(()=>{d.setAttribute(`data-open`,``),l.focus()})}};function oa(e){switch(e){case`camera`:return`camera`;case`microphone`:return`mic`;case`screenshare`:return`monitor-up`;case`usb`:return`usb`;case`hid`:return`keyboard`;case`serial`:return`cable`;case`filesystem`:return`folder`;case`popup`:return`external-link`}}function sa(e){switch(e){case`camera`:return`camera`;case`microphone`:return`microphone`;case`screenshare`:return`screen`;case`usb`:return`USB device`;case`hid`:return`HID device`;case`serial`:return`serial port`;case`filesystem`:return`folder`;case`popup`:return`sign-in window`}}function ca(e){if(e.length===1)return`Allow access to your ${sa(e[0])}?`;let t=e.map(sa),n=t.pop();return`Allow access to your ${t.join(`, `)} and ${n}?`}A(`slicc-permissions`,aa);var la=new Set([`top`,`bottom`,`left`,`right`]),ua=M(`
|
|
3562
3562
|
:host { position: relative; display: inline-flex; }
|
|
3563
3563
|
:host([hidden]) { display: none; }
|
|
3564
3564
|
.tip {
|
|
@@ -3583,7 +3583,7 @@ slicc-permissions .slicc-permissions__prompt-btn:disabled {
|
|
|
3583
3583
|
:host(:hover) .tip[data-p="right"], :host(:focus-within) .tip[data-p="right"], :host([open]) .tip[data-p="right"] { transform: translate(0, -50%); }
|
|
3584
3584
|
.tip:empty { display: none; }
|
|
3585
3585
|
@media (prefers-reduced-motion: reduce) { .tip { transition: none; } }
|
|
3586
|
-
`);A(`slicc-tooltip`,class extends HTMLElement{static observedAttributes=[`label`,`placement`];#e;#t;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
3586
|
+
`);A(`slicc-tooltip`,class extends HTMLElement{static observedAttributes=[`label`,`placement`];#e;#t;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ua],this.#t=j(`span`,{class:`tip`,part:`tip`,role:`tooltip`,"aria-hidden":`true`}),this.#e.replaceChildren(j(`slot`),this.#t)}connectedCallback(){this.#n()}attributeChangedCallback(){this.#n()}get label(){return this.getAttribute(`label`)??``}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get placement(){let e=this.getAttribute(`placement`);return e&&la.has(e)?e:`top`}set placement(e){this.setAttribute(`placement`,e)}#n(){this.#t.textContent=this.label,this.#t.setAttribute(`data-p`,this.placement)}});function da(e,t){let n=e.base;for(let r of e.variants??[])f(r.when,t)&&(r.zones!==void 0||r.center!==void 0)&&(n=r);return n}var fa=.02,pa=48,ma={top:`Top`,left:`Left`,center:`Center`,right:`Right`,bottom:`Bottom`},ha=class{#e;#t;#n;#r=null;constructor(e){this.#e=e,this.#t=ga(`slicc-layout__ghost`),this.#n=ga(`slicc-layout__targets`)}overlays(){return[this.#n,this.#t]}cancel(){window.removeEventListener(`pointermove`,this.#l),window.removeEventListener(`pointerup`,this.#d),this.#r=null,this.#t.classList.remove(`slicc-layout__ghost--active`),this.#n.replaceChildren(),this.#n.classList.remove(`slicc-layout__targets--active`)}decorateSlot(e,t){if(this.#e.isLocked(t))return;let r=document.createElement(`button`);r.type=`button`,r.className=`slicc-layout__move`,r.title=`Move ${t}`,r.setAttribute(`aria-label`,`Move ${t}`),r.dataset.panelId=t,r.appendChild(n(`grip-vertical`,{size:13})),r.addEventListener(`pointerdown`,e=>this.#a(e,t)),e.appendChild(r)}buildZonePanelDivider(e,t,n,r){if(r)return null;let i=t===`row`,a=ga(`slicc-layout__divider slicc-layout__divider--${i?`h`:`v`}`);return a.dataset.zone=e,a.addEventListener(`pointerdown`,t=>{this.#f(t,e,i,n)}),a}buildZoneDivider(e,t,n,r,i){if(i)return null;let a=ga(`slicc-layout__divider slicc-layout__divider--zone slicc-layout__divider--${n?`h`:`v`}`);return a.dataset.zoneBefore=e,a.dataset.zoneAfter=t,a.addEventListener(`pointerdown`,i=>{this.#i(i,e,t,n,r)}),a}#i(e,t,n,r,i){e.preventDefault();let a=t===`center`?n:t,o=a===t?1:-1,s=i.querySelector(`:scope > [data-zone="${a}"]`);if(!(s instanceof HTMLElement))return;this.#e.setPointerCapture(e.pointerId);let c=s.getBoundingClientRect(),l=r?c.width:c.height,u=r?e.clientX:e.clientY,d=i.getBoundingClientRect(),f=r?d.width:d.height,p=0;for(let e of Array.from(i.children)){if(!(e instanceof HTMLElement)||e===s)continue;let t=e.getBoundingClientRect(),n=r?t.width:t.height,i=e.dataset.zone===`center`||e.classList.contains(`slicc-layout__work-row`);p+=i?pa:n}let m=Math.max(pa,f-p),h=l,g=e=>{let t=r?e.clientX:e.clientY;h=Math.max(pa,Math.min(m,l+(t-u)*o)),this.#e.applyZoneResize(a,`${Math.round(h)}px`),this.#e.rerender()},_=()=>{window.removeEventListener(`pointermove`,g),window.removeEventListener(`pointerup`,_),window.removeEventListener(`pointercancel`,_),this.#e.hasPointerCapture(e.pointerId)&&this.#e.releasePointerCapture(e.pointerId),this.#e.applyZoneResize(a,`${Math.round(h)}px`),this.#e.commitResize()};window.addEventListener(`pointermove`,g),window.addEventListener(`pointerup`,_),window.addEventListener(`pointercancel`,_)}#a(e,t){this.#e.isLocked(t)||(e.preventDefault(),this.#r={panelId:t,zone:null},this.#t.textContent=t,this.#t.classList.add(`slicc-layout__ghost--active`),this.#c(e),this.#o(),window.addEventListener(`pointermove`,this.#l),window.addEventListener(`pointerup`,this.#d))}#o(){let e=this.#e.querySelector(`.slicc-layout__work`);if(!(e instanceof HTMLElement))return;let t=e.getBoundingClientRect();for(let e of h)this.#n.appendChild(ba(e,t));this.#n.classList.add(`slicc-layout__targets--active`)}#s(e){for(let t of Array.from(this.#n.children))t.classList.toggle(`slicc-layout__target--hot`,t===e)}#c(e){this.#t.style.left=`${e.clientX}px`,this.#t.style.top=`${e.clientY}px`}#l=e=>{let t=this.#r;if(!t)return;this.#c(e),t.zone=null;let n=document.elementFromPoint(e.clientX,e.clientY),r=n?.closest(`.slicc-layout__target`);if(r instanceof HTMLElement){let e=r.dataset.zone;if(e){t.zone=e,this.#s(r);return}}let i=n?.closest(`.slicc-layout__zone`),a=i instanceof HTMLElement?i.dataset.zone:null;t.zone=a,this.#s(a?this.#u(a):null)};#u(e){return this.#n.querySelector(`.slicc-layout__target[data-zone="${e}"]`)}#d=()=>{let e=this.#r;this.cancel(),e?.zone&&this.#e.applyMove(e.panelId,e.zone)};#f(e,t,n,r){e.preventDefault();let i=e.currentTarget,a=Array.from(r.querySelectorAll(`:scope > .slicc-layout__slot`)),o=Array.from(r.children).slice(0,Array.from(r.children).indexOf(i)).filter(e=>e.classList.contains(`slicc-layout__slot`)).length;if(o<1||o>=a.length)return;this.#e.setPointerCapture(e.pointerId);let s=a.map(e=>{let t=e.getBoundingClientRect();return Math.max(1,n?t.width:t.height)}),c=s.reduce((e,t)=>e+t,0),l=s.map(e=>e/c*s.length),u=r.getBoundingClientRect(),d=n?u.width:u.height,f=n?e.clientX:e.clientY,p=l.reduce((e,t)=>e+t,0),m=l[o-1]+l[o],h=m*fa,g=l[o-1],_=l,v=e=>{let r=n?e.clientX:e.clientY,i=d>0?(r-f)/d*p:0,a=Math.max(h,Math.min(m-h,g+i));_=[...l],_[o-1]=a,_[o]=m-a,this.#e.applyResize(t,_),this.#e.rerender()},y=()=>{window.removeEventListener(`pointermove`,v),window.removeEventListener(`pointerup`,y),window.removeEventListener(`pointercancel`,y),this.#e.hasPointerCapture(e.pointerId)&&this.#e.releasePointerCapture(e.pointerId),this.#e.applyResize(t,_),this.#e.commitResize()};window.addEventListener(`pointermove`,v),window.addEventListener(`pointerup`,y),window.addEventListener(`pointercancel`,y)}};function ga(e){let t=document.createElement(`div`);return t.className=e,t}var _a={top:`arrow-up`,bottom:`arrow-down`,left:`arrow-left`,right:`arrow-right`,center:`square`},va=56,ya=16;function ba(e,t){let r=ga(`slicc-layout__target slicc-layout__target--${e}`);r.dataset.zone=e,r.title=`Move to ${ma[e]}`,r.appendChild(n(_a[e],{size:20}));let i=ga(`slicc-layout__target-label`);i.textContent=ma[e],r.appendChild(i);let a=t.left+t.width/2-va/2,o=t.top+t.height/2-va/2,[s,c]={center:[a,o],top:[a,t.top+ya],bottom:[a,t.bottom-va-ya],left:[t.left+ya,o],right:[t.right-va-ya,o]}[e];return r.style.left=`${s}px`,r.style.top=`${c}px`,r}var xa=`
|
|
3587
3587
|
/* The corner grip: hidden until the slot is hovered, mirroring the dock-tree's
|
|
3588
3588
|
(and slicc-file-tree's) hover-reveal action pattern — a persistent title bar on
|
|
3589
3589
|
every panel was the thing the redesign set out to remove. */
|
|
@@ -3689,7 +3689,7 @@ slicc-layout .slicc-layout__target--hot {
|
|
|
3689
3689
|
color: #fff;
|
|
3690
3690
|
transform: scale(1.12);
|
|
3691
3691
|
}
|
|
3692
|
-
`,
|
|
3692
|
+
`,Sa=`
|
|
3693
3693
|
[data-slicc-panel] {
|
|
3694
3694
|
display: flex;
|
|
3695
3695
|
flex-direction: column;
|
|
@@ -3728,7 +3728,7 @@ slicc-layout .slicc-layout__target--hot {
|
|
|
3728
3728
|
[data-slicc-panel][presentation="floating"][anchor="center"] {
|
|
3729
3729
|
top: 50%; left: 50%; transform: translate(-50%, -50%);
|
|
3730
3730
|
}
|
|
3731
|
-
`,
|
|
3731
|
+
`,Ca=`slicc-panel-style`;function wa(e){if(e.getElementById(Ca))return;let t=e.createElement(`style`);t.id=Ca,t.textContent=Sa,(e.head??e.documentElement).appendChild(t)}var Ta=`data-slicc-panel`;A(`slicc-panel`,class extends HTMLElement{static observedAttributes=[`panel-id`,`hidden`,`locked`,`presentation`,`anchor`];static panelMeta;#e=null;connectedCallback(){wa(this.ownerDocument),this.setAttribute(Ta,``),this.setAttribute(`part`,`panel`),this.hasAttribute(`presentation`)||this.setAttribute(`presentation`,this.presentation),!this.hasAttribute(`anchor`)&&this.anchor&&this.setAttribute(`anchor`,this.anchor),this.#t(),this.visible&&this.onPanelShow?.()}disconnectedCallback(){this.#e?.disconnect(),this.#e=null}attributeChangedCallback(e,t,n){if(!this.isConnected||t===n||e!==`hidden`)return;let r=this.visible;r?this.onPanelShow?.():this.onPanelHide?.(),this.dispatchEvent(new CustomEvent(`slicc-panel-visibility`,{bubbles:!0,composed:!0,detail:{panelId:this.panelId,visible:r}}))}get panelId(){return this.getAttribute(`panel-id`)??S(this.constructor)?.id??null}set panelId(e){e==null?this.removeAttribute(`panel-id`):this.setAttribute(`panel-id`,e)}get visible(){return!this.hasAttribute(`hidden`)}set visible(e){this.toggleAttribute(`hidden`,!e)}get locked(){return this.hasAttribute(`locked`)}set locked(e){this.toggleAttribute(`locked`,e)}get presentation(){let e=this.getAttribute(`presentation`);return e===`floating`||e===`docked`?e:S(this.constructor)?.presentation??`docked`}set presentation(e){this.setAttribute(`presentation`,e)}get anchor(){let e=this.getAttribute(`anchor`);return x(e)?e:S(this.constructor)?.anchor??null}set anchor(e){e==null?this.removeAttribute(`anchor`):this.setAttribute(`anchor`,e)}get meta(){return S(this.constructor)}#t(){!this.onPanelResize||typeof ResizeObserver>`u`||(this.#e=new ResizeObserver(e=>{let t=e[0]?.contentRect;t&&this.onPanelResize?.(t)}),this.#e.observe(this))}});var Ea=`
|
|
3732
3732
|
slicc-layout {
|
|
3733
3733
|
display: flex;
|
|
3734
3734
|
flex-direction: column;
|
|
@@ -3827,7 +3827,7 @@ slicc-layout .slicc-layout__zone {
|
|
|
3827
3827
|
sit side by side or stacked — see zoneAxis(). */
|
|
3828
3828
|
slicc-layout .slicc-layout__zone[data-axis='row'] { flex-direction: row; }
|
|
3829
3829
|
slicc-layout .slicc-layout__zone[data-axis='col'] { flex-direction: column; }
|
|
3830
|
-
${
|
|
3830
|
+
${xa}`,Da=`slicc-layout-style`;function Oa(e){if(e.getElementById(Da))return;let t=e.createElement(`style`);t.id=Da,t.textContent=Ea,(e.head??e.documentElement).appendChild(t)}function ka(e,t){let n=document.createElement(e);return n.className=t,n}var Aa=class extends HTMLElement{static observedAttributes=[`platform`];#e=m();#t=null;#n=!1;#r=ka(`div`,`slicc-layout__root`);#i=ka(`div`,`slicc-layout__parking`);#a=new Set;#o=null;#s=null;#c=0;#l=new MutationObserver(()=>this.#f());#u=new ha(this);connectedCallback(){Oa(this.ownerDocument),this.#n=!0,this.#r.parentElement!==this&&this.append(this.#r),this.#i.parentElement!==this&&this.append(this.#i);for(let e of this.#u.overlays())e.parentElement!==this&&this.append(e);this.#v(),this.#f(),this.#l.observe(this,{childList:!0})}disconnectedCallback(){this.#n=!1,this.#l.disconnect(),this.#u.cancel(),this.#s?.disconnect(),this.#s=null,this.#c&&cancelAnimationFrame(this.#c),this.#c=0}attributeChangedCallback(e,t,n){e!==`platform`||t===n||!this.#n||this.#f(`environment`)}setLayout(e){this.#e=e?v(e):m(),this.#n&&this.#f(`set`)}getLayout(){return v(this.#e)}getResolved(){return this.#t?v(this.#t):null}getPlacedPanelIds(){return this.#t?g(this.#t).filter(e=>this.#a.has(e)):[]}isLocked(e){let t=this.#o??this.#t;return t?l(t,e):!1}environment(){let e=this.getBoundingClientRect(),t=this.getAttribute(`platform`);return{width:e.width,height:e.height,platform:t===`web`||t===`extension`||t===`electron`?t:void 0}}#d(){let e=new Map;for(let t of Array.from(this.querySelectorAll(`[${Ta}]`))){if(!(t instanceof HTMLElement)||t.parentElement?.closest(`[data-slicc-panel]`))continue;let n=t.getAttribute(`panel-id`);n&&e.set(n,t)}return e}#f(e=`set`,t){let n=y(this.#e,this.environment());this.#o=n;let r=this.#d(),i=new Set,a=e=>this.#p(n,e,r,i),o=ka(`div`,`slicc-layout__row`),s=a(`left`),c=a(`right`);s&&o.appendChild(s);let l=this.#m(n,r,i);l.style.flex=`1 1 0`,o.appendChild(l),c&&o.appendChild(c);let u=[],d=a(`top`);d&&u.push(d),u.push(o);let f=a(`bottom`);f&&u.push(f);let p=this.#g(n,r,i);p&&u.push(p);for(let[e,t]of r)i.has(e)||t.parentElement!==this.#i&&this.#i.appendChild(t);this.#r.replaceChildren(...u),this.#l.takeRecords(),this.#t=n,this.#a=i,this.#o=null,!t?.silent&&this.dispatchEvent(new CustomEvent(`slicc-layout-change`,{bubbles:!0,composed:!0,detail:{layout:v(n),reason:e}}))}#p(e,t,n,r){let i=e.docks.filter(e=>e.edge===t);if(i.length===0)return null;let a=[];for(let o of i){let i=ka(`div`,`slicc-layout__dock slicc-layout__dock--${t}`);i.dataset.edge=t;let s=!1;for(let t of o.panels){let a=n.get(t);!a||e.panels[t]?.visible===!1||(this.#_(a,e,t),i.appendChild(a),r.add(t),s=!0)}s&&(i.style.flex=o.size==null?`0 0 auto`:d(o.size),a.push(i))}if(a.length===0)return null;if(a.length===1)return a[0];let o=ka(`div`,`slicc-layout__dockstack slicc-layout__dockstack--${t}`);return o.dataset.edge=t,o.append(...a),o.style.flex=`0 0 auto`,o}#m(e,t,n){let r=e.zones??(e.center?p(e.center):{}),i=ka(`div`,`slicc-layout__work`),a=i=>{let a=e.locked||(r.locked??[]).includes(i),o=(r[i]??[]).map(r=>this.#h(r,i,e,t,n)).filter(e=>e!==null);if(o.length===0)return null;let s=ka(`div`,`slicc-layout__zone slicc-layout__zone--${i}`);s.dataset.zone=i;let c=_(r,i);s.dataset.axis=c,o.forEach((e,t)=>{if(t>0){let e=this.#u.buildZonePanelDivider(i,c,s,a);e&&s.appendChild(e)}s.appendChild(e)});let l=r.sizes?.[i];return s.style.flex=i===`center`?`1 1 0`:d(l??void 0),s},o=(t,n,i)=>{let o=n.map(e=>({zone:e,element:a(e)})).filter(e=>!!e.element);o.forEach((n,a)=>{if(a>0){let s=o[a-1].zone,c=e.locked||(r.locked??[]).includes(s)||(r.locked??[]).includes(n.zone),l=this.#u.buildZoneDivider(s,n.zone,i,t,c);l&&t.appendChild(l)}t.appendChild(n.element)})},s=ka(`div`,`slicc-layout__work-row`);o(s,[`left`,`center`,`right`],!0);let c=a(`top`),l=a(`bottom`),u=[];return c&&u.push({zone:`top`,element:c}),u.push({zone:`center`,element:s}),l&&u.push({zone:`bottom`,element:l}),u.forEach((t,n)=>{if(n>0){let a=u[n-1].zone,o=e.locked||(r.locked??[]).includes(a)||(r.locked??[]).includes(t.zone),s=this.#u.buildZoneDivider(a,t.zone,!1,i,o);s&&i.appendChild(s)}i.appendChild(t.element)}),i}#h(e,t,n,r,i){let a=r.get(e);if(!a||n.panels[e]?.visible===!1)return null;let o=ka(`div`,`slicc-layout__slot`);return o.dataset.panelId=e,o.dataset.zone=t,o.style.flex=d(n.panels[e]?.size??void 0),this.#_(a,n,e),o.appendChild(a),this.#u.decorateSlot(o,e),i.add(e),o}applyMove(e,t){if(this.isLocked(e))return;let n=da(this.#e,this.environment()),r=n.zones??p(n.center??null),i=u(r,e,t);i===r&&n.zones||(n.zones=i,n.center=null,this.#f(`rearrange`))}applyResize(e,t){let n=da(this.#e,this.environment()).zones,r=n?.[e];if(!n||!r||r.length!==t.length)return;let i={...this.#e.panels??{}};r.forEach((e,n)=>{i[e]={...i[e],size:t[n]}}),this.#e.panels=i}applyZoneResize(e,t){let n=da(this.#e,this.environment());n.zones&&(n.zones.sizes={...n.zones.sizes,[e]:t})}rerender(){this.#f(`resize`,{silent:!0})}commitResize(){this.#f(`resize`)}#g(e,t,n){if(e.floating.length===0)return null;let r=ka(`div`,`slicc-layout__floating`),i=!1;for(let a of e.floating){let o=t.get(a.panel);!o||e.panels[a.panel]?.visible===!1||(this.#_(o,e,a.panel),o.setAttribute(`presentation`,`floating`),a.anchor&&o.setAttribute(`anchor`,a.anchor),a.width!=null&&(o.style.width=ja(a.width)),a.height!=null&&(o.style.height=ja(a.height)),r.appendChild(o),n.add(a.panel),i=!0)}return i?r:null}#_(e,t,n){e.toggleAttribute(`locked`,l(t,n)),e.removeAttribute(`hidden`),e.setAttribute(`presentation`,`docked`),e.removeAttribute(`anchor`),e.style.removeProperty(`width`),e.style.removeProperty(`height`)}#v(){typeof ResizeObserver>`u`||(this.#s=new ResizeObserver(()=>{this.#e.variants?.length&&(this.#c||=requestAnimationFrame(()=>{this.#c=0;let e=y(this.#e,this.environment()),t=this.#t?.appliedVariants.join(`,`)??``;e.appliedVariants.join(`,`)!==t&&this.#f(`viewport`)}))}),this.#s.observe(this))}};function ja(e){return typeof e==`number`?`${e}px`:e}A(`slicc-layout`,Aa);var Ma={offline:`#94a3b8`,connecting:`#f59e0b`,live:`#22c55e`,stalled:`#eab308`,reconnecting:`#f97316`,error:`#ef4444`},Na={offline:`color-mix(in srgb, #94a3b8 18%, transparent)`,connecting:`color-mix(in srgb, #f59e0b 28%, transparent)`,live:`color-mix(in srgb, #22c55e 22%, transparent)`,stalled:`color-mix(in srgb, #eab308 26%, transparent)`,reconnecting:`color-mix(in srgb, #f97316 28%, transparent)`,error:`color-mix(in srgb, #ef4444 24%, transparent)`},Pa={offline:`offline`,connecting:`connecting`,live:`live`,stalled:`leader busy`,reconnecting:`reconnecting`,error:`connection error`},Fa={npx:`terminal`,sliccstart:`monitor`,extension:`blocks`,standalone:`monitor`,cherry:`frame`,electron:`laptop`,hosted:`cloud`},Ia={npx:`npx`,sliccstart:`sliccstart`,extension:`extension`,standalone:`standalone`,cherry:`cherry`,electron:`electron`,hosted:`hosted`},La={leader:`crown`,follower:`radio`},Ra={none:`local`,leader:`leading tray`,follower:`following tray`};function za(e){return Fa[e]}function Ba(e){return Ia[e]}function Va(e){return Ma[e]}function Ha(e){return Na[e]}function Ua(e){return Pa[e]}function Wa(e){return e===`none`?null:La[e]}function Ga(e){return Ra[e]}function Ka(e){return e===`connecting`||e===`reconnecting`}function qa(){return{connection:`offline`,floatKind:`standalone`,trayRole:`none`}}function Ja(e){return[Ba(e.floatKind),Ga(e.trayRole),Ua(e.connection)].join(` · `)}var Ya=M(`
|
|
3831
3831
|
:host {
|
|
3832
3832
|
display: inline-grid;
|
|
3833
3833
|
place-items: center;
|
|
@@ -3874,7 +3874,7 @@ ${ba}`,Ea=`slicc-layout-style`;function Da(e){if(e.getElementById(Ea))return;let
|
|
|
3874
3874
|
object-fit: cover;
|
|
3875
3875
|
display: block;
|
|
3876
3876
|
}
|
|
3877
|
-
`),
|
|
3877
|
+
`),Xa=class extends HTMLElement{static observedAttributes=[`initials`,`name`,`src`,`email`,`size`,`label`];#e;#t=0;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ya],this.addEventListener(`click`,this.#i),this.addEventListener(`keydown`,this.#a)}connectedCallback(){this.hasAttribute(`role`)||this.setAttribute(`role`,`button`),this.hasAttribute(`tabindex`)||this.setAttribute(`tabindex`,`0`),this.#o()}disconnectedCallback(){this.#t++}attributeChangedCallback(e,t,n){e===`size`&&this.#r(n),this.isConnected&&this.#o()}get initials(){return this.getAttribute(`initials`)}set initials(e){e==null?this.removeAttribute(`initials`):this.setAttribute(`initials`,e)}get name(){return this.getAttribute(`name`)}set name(e){e==null?this.removeAttribute(`name`):this.setAttribute(`name`,e)}get src(){return this.getAttribute(`src`)}set src(e){e==null?this.removeAttribute(`src`):this.setAttribute(`src`,e)}get email(){return this.getAttribute(`email`)}set email(e){e==null?this.removeAttribute(`email`):this.setAttribute(`email`,e)}get size(){return this.getAttribute(`size`)}set size(e){e==null?this.removeAttribute(`size`):this.setAttribute(`size`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get resolvedInitials(){let e=this.initials;return e!=null&&e.trim()!==``?e.trim().slice(0,2).toUpperCase():Qa(this.name)||`?`}async gravatarUrl(e=this.email){let t=e?.trim().toLowerCase();return t?`https://www.gravatar.com/avatar/${await Za(t)}?s=${this.#n()}&d=404`:null}#n(){let e=this.getBoundingClientRect().width;return Math.max(1,Math.round((e>0?e:30)*2))}#r(e){e==null||e.trim()===``?this.style.removeProperty(`--avatar-size`):this.style.setProperty(`--avatar-size`,e)}#i=()=>{this.dispatchEvent(new CustomEvent(`slicc-avatar-click`,{bubbles:!0,composed:!0}))};#a=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.click())};#o(){let e=++this.#t,t=this.src,n=this.email,r=this.resolvedInitials,i=this.label??this.name??(r===`?`?`Account`:r);this.setAttribute(`aria-label`,i);let a=[j(`span`,{class:`ini`,part:`initials`},r)];if(t){let n=j(`img`,{class:`img`,part:`image`,src:t,alt:i});n.addEventListener(`load`,()=>{e===this.#t&&this.#e.querySelector(`.me`)?.classList.add(`has-img`)}),n.addEventListener(`error`,()=>{e===this.#t&&(n.remove(),this.#e.querySelector(`.me`)?.classList.remove(`has-img`))}),a.push(n)}let o=j(`div`,{class:`me`,part:`avatar`},j(`slot`,null,...a));this.#e.replaceChildren(o),!t&&n&&this.#s(n,e)}#s(e,t){this.gravatarUrl(e).then(e=>{if(!e||t!==this.#t)return;let n=new Image;n.onload=()=>{if(t!==this.#t||!this.isConnected)return;let n=this.#e.querySelector(`.me`);n&&(n.style.backgroundImage=`url("${e}")`,n.classList.add(`has-img`))},n.src=e}).catch(()=>{})}};async function Za(e){let t=new TextEncoder().encode(e),n=await crypto.subtle.digest(`SHA-256`,t);return Array.from(new Uint8Array(n)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function Qa(e){if(!e)return``;let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?``:t.length===1?t[0].slice(0,2).toUpperCase():(t[0][0]+t[t.length-1][0]).toUpperCase()}A(`slicc-avatar`,Xa);var $a=5,eo=1;function to(e){return e.replace(`claude-`,``)}function no(e){return e==null||e===0?``:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}function ro(e){if(e.length<=$a)return{individuals:e,buckets:[]};let t=[...e].sort((e,t)=>t.cost-e.cost),n=t.slice(0,$a),r=[],i={count:0,cost:0};for(let e of t.slice($a))i.count+=1,i.cost+=e.cost,i.cost>=eo&&(r.push(i),i={count:0,cost:0});if(i.count>0){let e=r.at(-1);e?(e.count+=i.count,e.cost+=i.cost):r.push(i)}return{individuals:n,buckets:r}}var io=M(`
|
|
3878
3878
|
:host {
|
|
3879
3879
|
position: absolute;
|
|
3880
3880
|
top: calc(100% + 8px);
|
|
@@ -3998,7 +3998,7 @@ ${ba}`,Ea=`slicc-layout-style`;function Da(e){if(e.getElementById(Ea))return;let
|
|
|
3998
3998
|
font-variant-numeric: tabular-nums;
|
|
3999
3999
|
color: var(--ink);
|
|
4000
4000
|
}
|
|
4001
|
-
`);A(`slicc-cost-overlay`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n=[];#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
4001
|
+
`);A(`slicc-cost-overlay`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n=[];#r=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[io]}connectedCallback(){this.#i()}attributeChangedCallback(){this.isConnected&&this.#i()}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get models(){return this.#t}set models(e){this.#t=e,this.isConnected&&this.#i()}get scoops(){return this.#n}set scoops(e){this.#n=e,this.isConnected&&this.#i()}get total(){return this.#r}set total(e){this.#r=e!=null&&Number.isFinite(e)?e:null,this.isConnected&&this.#i()}#i(){let e=[];if(this.#t.length>0){let t=this.#t.map(e=>{let t=no(e.tokens);return j(`div`,{class:`model-row`},j(`span`,{class:`model-name`},to(e.model)),t?j(`span`,{class:`model-tokens`},t):!1,j(`span`,{class:`model-cost`},`$${e.cost.toFixed(2)}`))});e.push(j(`div`,{class:`section section--models`},j(`div`,{class:`section-title`},`BY MODEL`),...t))}if(this.#n.length>0){let t=ro(this.#n),n=t.individuals.map(e=>j(`div`,{class:`scoop-row`},j(`span`,{class:`scoop-name`},e.name),j(`span`,{class:`scoop-cost`},`$${e.cost.toFixed(2)}`))),r=t.buckets.map(e=>j(`div`,{class:`bucket-row`,part:`bucket`},`${e.count} ${e.count===1?`agent`:`agents`} · $${e.cost.toFixed(2)}`));e.push(j(`div`,{class:`section section--scoops`},j(`div`,{class:`section-title`},`BY AGENT`),...n,...r))}let t=this.#r??this.#t.reduce((e,t)=>e+t.cost,0);e.push(j(`div`,{class:`total-row`},j(`span`,{class:`total-label`},`Total`),j(`span`,{class:`total-cost`},`$${t.toFixed(2)}`)));let n=j(`div`,{class:`card`},...e);this.#e.replaceChildren(n)}});var ao=M(`
|
|
4002
4002
|
:host {
|
|
4003
4003
|
display: flex;
|
|
4004
4004
|
align-items: center;
|
|
@@ -4027,7 +4027,7 @@ ${ba}`,Ea=`slicc-layout-style`;function Da(e){if(e.getElementById(Ea))return;let
|
|
|
4027
4027
|
min-width: 0;
|
|
4028
4028
|
background: var(--line, #e5e5e5);
|
|
4029
4029
|
}
|
|
4030
|
-
`);A(`slicc-day-separator`,class extends HTMLElement{static observedAttributes=[`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
4030
|
+
`);A(`slicc-day-separator`,class extends HTMLElement{static observedAttributes=[`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ao]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.label??j(`slot`);this.#e.replaceChildren(j(`span`,{class:`label`,part:`label`},e))}});var oo=M(`
|
|
4031
4031
|
:host {
|
|
4032
4032
|
position: absolute;
|
|
4033
4033
|
top: calc(100% + 8px);
|
|
@@ -4145,7 +4145,7 @@ ${ba}`,Ea=`slicc-layout-style`;function Da(e){if(e.getElementById(Ea))return;let
|
|
|
4145
4145
|
color: var(--txt-2);
|
|
4146
4146
|
font-size: 11px;
|
|
4147
4147
|
}
|
|
4148
|
-
`);A(`slicc-follower-hud`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
4148
|
+
`);A(`slicc-follower-hud`,class extends HTMLElement{static observedAttributes=[`open`];#e;#t=[];#n=null;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[oo]}connectedCallback(){this.#r()}attributeChangedCallback(){this.isConnected&&this.#r()}get open(){return this.hasAttribute(`open`)}set open(e){this.toggleAttribute(`open`,!!e)}get rows(){return this.#t}set rows(e){this.#t=e,this.isConnected&&this.#r()}get hint(){return this.#n}set hint(e){this.#n=e&&e.trim()!==``?e:null,this.isConnected&&this.#r()}#r(){let e=this.#t.length,t=[];if(e===0)t.push(j(`div`,{class:`empty`},`No followers connected.`));else{let r=this.#t.map(e=>j(`div`,{class:`row`,part:`row`},n(e.icon,{size:14}),j(`div`,{class:`row-main`},j(`span`,{class:`row-title`},e.title),e.detail?j(`span`,{class:`row-detail`},e.detail):!1,e.chips&&e.chips.length>0?j(`div`,{class:`chips`},...e.chips.map(e=>j(`span`,{class:`chip`},e))):!1),j(`div`,{class:`row-state`},j(`span`,{class:`sdot`,"data-state":e.state}),e.stateText)));t.push(j(`div`,{class:`section`},j(`div`,{class:`section-title`},`${e} ${e===1?`follower`:`followers`}`),...r))}this.#n&&t.push(j(`div`,{class:`hint`},this.#n)),this.#e.replaceChildren(j(`div`,{class:`card`,part:`card`},...t))}});var so=`CLI float`;function co(e){if(e==null)return null;let t=e.trim();if(t===``)return null;let n=Number.parseFloat(t.replace(/^\$/,``));return Number.isFinite(n)?n:null}function lo(e){let t=co(e);return t==null?null:`$${t.toFixed(2)}`}function uo(e){return`${lo(e)??`$0.00`}/h`}var fo=720,po=M(`
|
|
4149
4149
|
:host {
|
|
4150
4150
|
position: relative;
|
|
4151
4151
|
display: inline-flex;
|
|
@@ -4345,7 +4345,7 @@ ${ba}`,Ea=`slicc-layout-style`;function Da(e){if(e.getElementById(Ea))return;let
|
|
|
4345
4345
|
.tip { transition: none; }
|
|
4346
4346
|
.beacon[data-pulse] .beacon__ring { animation: none; }
|
|
4347
4347
|
}
|
|
4348
|
-
`);A(`slicc-floatbar`,class extends HTMLElement{static observedAttributes=[`label`,`linked`,`connection`,`float-kind`,`tray-role`,`rate`,`spent`];#e;#t=null;#n=null;#r=[];#i=[];#a;#o=[];#s=null;#c;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
4348
|
+
`);A(`slicc-floatbar`,class extends HTMLElement{static observedAttributes=[`label`,`linked`,`connection`,`float-kind`,`tray-role`,`rate`,`spent`];#e;#t=null;#n=null;#r=[];#i=[];#a;#o=[];#s=null;#c;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[po]}connectedCallback(){this.#f();let e=this.closest(`slicc-nav`);e&&typeof ResizeObserver<`u`&&(this.#t=new ResizeObserver(()=>this.#d()),this.#t.observe(e))}disconnectedCallback(){this.#t?.disconnect(),this.#t=null,clearTimeout(this.#a),clearTimeout(this.#c)}attributeChangedCallback(e,t,n){t!==n&&this.isConnected&&this.#f()}get label(){return this.getAttribute(`label`)??so}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get linked(){return this.hasAttribute(`linked`)}set linked(e){this.toggleAttribute(`linked`,!!e)}get connection(){let e=this.getAttribute(`connection`);return e===`connecting`||e===`live`||e===`stalled`||e===`reconnecting`||e===`error`?e:`offline`}set connection(e){e==null?this.removeAttribute(`connection`):this.setAttribute(`connection`,e)}get floatKind(){let e=this.getAttribute(`float-kind`);return e===`npx`||e===`sliccstart`||e===`extension`||e===`standalone`||e===`cherry`||e===`electron`||e===`hosted`?e:qa().floatKind}set floatKind(e){e==null?this.removeAttribute(`float-kind`):this.setAttribute(`float-kind`,e)}get trayRole(){let e=this.getAttribute(`tray-role`);return e===`leader`||e===`follower`?e:`none`}set trayRole(e){e==null||e===`none`?this.removeAttribute(`tray-role`):this.setAttribute(`tray-role`,e)}get status(){return{connection:this.connection,floatKind:this.floatKind,trayRole:this.trayRole}}set status(e){this.connection=e.connection,this.floatKind=e.floatKind,this.trayRole=e.trayRole}get spent(){return this.getAttribute(`spent`)}set spent(e){e==null?this.removeAttribute(`spent`):this.setAttribute(`spent`,String(e))}get rate(){return this.getAttribute(`rate`)}set rate(e){e==null?this.removeAttribute(`rate`):this.setAttribute(`rate`,String(e))}get costModels(){return this.#r}set costModels(e){this.#r=e,this.#n&&(this.#n.models=e)}get followers(){return this.#o}set followers(e){this.#o=e,e.length>0?this.setAttribute(`follower-count`,String(e.length)):this.removeAttribute(`follower-count`),this.isConnected?this.#f():this.#s&&(this.#s.rows=e)}get costScoops(){return this.#i}set costScoops(e){this.#i=e,this.#n&&(this.#n.scoops=e)}#l(){let e=[this.label,Ja(this.status)],t=this.#o.length;return t>0&&e.push(`${t} ${t===1?`follower`:`followers`}`),e.push(uo(this.rate)),e.push(`recency-weighted session avg`),e.join(` · `)}#u(e){let{connection:t,floatKind:r,trayRole:i}=e,a=j(`span`,{class:`beacon__ring`,part:`beacon-ring`,style:`--beacon-fill:${Va(t)};--beacon-glow:${Ha(t)}`}),o=j(`span`,{class:`beacon__icon`,part:`beacon-icon`},n(za(r),{size:9,strokeWidth:2.25})),s={class:`beacon`,part:`beacon dot`,"data-connection":t,"data-float-kind":r,"aria-label":Ja({connection:t,floatKind:r,trayRole:i})};i!==`none`&&(s[`data-tray-role`]=i),Ka(t)&&(s[`data-pulse`]=``);let c=[a,o],l=Wa(i);return l&&c.push(j(`span`,{class:`beacon__role`,part:`beacon-role`,"aria-hidden":`true`},n(l,{size:5,strokeWidth:2.5}))),j(`span`,s,...c)}#d(){let e=this.closest(`slicc-nav`),t=e?getComputedStyle(e):null;(e?e.clientWidth-Number.parseFloat(t?.paddingLeft??`0`)-Number.parseFloat(t?.paddingRight??`0`):1/0)<=fo?this.setAttribute(`title`,this.#l()):this.removeAttribute(`title`)}#f(){let e=[];e.push(this.#u(this.status));let[t,...r]=this.label.split(` · `),i=[j(`span`,{class:`runtime`},t)];r.length>0&&i.push(j(`span`,{class:`detail`},` · ${r.join(` · `)}`)),e.push(j(`span`,{class:`label`,part:`label`},j(`slot`,null,...i))),this.#o.length>0&&(e.push(j(`span`,{class:`sep sep--followers`,part:`sep`})),e.push(this.#p(this.#o.length))),e.push(j(`span`,{class:`sep sep--spent`,part:`sep`}));let a=j(`span`,{class:`spent`,part:`spent rate`},n(`circle-dollar-sign`,{size:12}),j(`span`,{class:`amount`},uo(this.rate)));a.addEventListener(`mouseenter`,()=>this.#_()),a.addEventListener(`mouseleave`,()=>this.#v()),e.push(a),e.push(j(`span`,{class:`tip`,part:`tip`,"aria-hidden":`true`},this.#l()));let o=this.#s?.hasAttribute(`open`)&&this.#o.length>0?this.#s:null;this.#n=null,this.#s=o,this.#e.replaceChildren(...e),o&&(o.rows=this.#o,this.#e.appendChild(o)),this.#d()}#p(e){let t=j(`button`,{class:`followers`,part:`followers`,type:`button`,"aria-haspopup":`dialog`,"aria-label":`${`${e} ${e===1?`follower`:`followers`}`} connected — open session sharing`},n(`users`,{size:12}),j(`span`,{class:`follower-count`},String(e)));return t.addEventListener(`mouseenter`,()=>this.#m()),t.addEventListener(`mouseleave`,()=>this.#h()),t.addEventListener(`focus`,()=>this.#m()),t.addEventListener(`blur`,()=>this.#h()),t.addEventListener(`keydown`,e=>{e.key===`Escape`&&this.#g()}),t.addEventListener(`click`,()=>{this.#g(),this.dispatchEvent(new CustomEvent(`slicc-followers-click`,{bubbles:!0,composed:!0}))}),t}#m(){if(clearTimeout(this.#c),!this.#s){let e=document.createElement(`slicc-follower-hud`);e.rows=this.#o,e.hint=`Click for sharing options.`,e.addEventListener(`mouseenter`,()=>this.#m()),e.addEventListener(`mouseleave`,()=>this.#h()),this.#e.appendChild(e),this.#s=e}this.#s.toggleAttribute(`open`,!0)}#h(){this.#c=setTimeout(()=>this.#g(),150)}#g(){clearTimeout(this.#c),this.#s?.removeAttribute(`open`)}#_(){if(clearTimeout(this.#a),!this.#n){let e=document.createElement(`slicc-cost-overlay`);e.models=this.#r,e.scoops=this.#i,e.total=co(this.spent),e.addEventListener(`mouseenter`,()=>this.#_()),e.addEventListener(`mouseleave`,()=>this.#v()),this.#e.appendChild(e),this.#n=e}this.#n.toggleAttribute(`open`,!0)}#v(){this.#a=setTimeout(()=>{this.#n&&this.#n.removeAttribute(`open`)},150)}});var mo=M(`
|
|
4349
4349
|
:host { display: inline-grid; }
|
|
4350
4350
|
:host([hidden]) { display: none; }
|
|
4351
4351
|
.iconbtn {
|
|
@@ -4374,7 +4374,7 @@ ${ba}`,Ea=`slicc-layout-style`;function Da(e){if(e.getElementById(Ea))return;let
|
|
|
4374
4374
|
.iconbtn:disabled:hover { background: var(--canvas); color: var(--txt-2); }
|
|
4375
4375
|
.icon { display: grid; place-items: center; pointer-events: none; }
|
|
4376
4376
|
.icon svg { display: block; }
|
|
4377
|
-
`),
|
|
4377
|
+
`),ho=`plus`,go=16;A(`slicc-icon-button`,class extends HTMLElement{static observedAttributes=[`icon`,`disabled`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[mo]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get icon(){return this.getAttribute(`icon`)??ho}set icon(e){e==null?this.removeAttribute(`icon`):this.setAttribute(`icon`,e)}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){e?this.setAttribute(`disabled`,``):this.removeAttribute(`disabled`)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.label,t=j(`slot`,null,j(`span`,{class:`icon`},n(this.icon,{size:go,part:`icon`}))),r=j(`button`,{type:`button`,class:`iconbtn`,part:`button`,"aria-label":e??void 0,title:e??void 0,disabled:this.disabled},t);this.#e.replaceChildren(r)}});var _o=`
|
|
4378
4378
|
slicc-pane {
|
|
4379
4379
|
display: flex;
|
|
4380
4380
|
flex-direction: column;
|
|
@@ -4413,7 +4413,7 @@ slicc-pane .slicc-pane__body {
|
|
|
4413
4413
|
min-height: 0;
|
|
4414
4414
|
overflow: auto;
|
|
4415
4415
|
}
|
|
4416
|
-
`,
|
|
4416
|
+
`,vo=`slicc-pane-style`;function yo(e){if(e.getElementById(vo))return;let t=e.createElement(`style`);t.id=vo,t.textContent=_o,(e.head??e.documentElement).appendChild(t)}A(`slicc-pane`,class extends HTMLElement{static observedAttributes=[`elevated`];#e;#t;#n=!1;connectedCallback(){yo(this.ownerDocument),this.#r()}attributeChangedCallback(e,t,n){e===`elevated`&&t!==n&&this.isConnected&&this.dispatchEvent(new CustomEvent(`slicc-pane-change`,{bubbles:!0,composed:!0,detail:{elevated:n!==null}}))}get elevated(){return this.hasAttribute(`elevated`)}set elevated(e){e?this.setAttribute(`elevated`,``):this.removeAttribute(`elevated`)}#r(){if(this.#n)return;this.#n=!0;let e=Array.from(this.childNodes).filter(e=>!(e instanceof HTMLElement&&e.classList.contains(`slicc-pane__surface`))),t=this.ownerDocument.createElement(`div`);t.className=`slicc-pane__surface`,t.setAttribute(`part`,`surface`),this.#e=this.ownerDocument.createElement(`div`),this.#e.className=`slicc-pane__header`,this.#e.setAttribute(`part`,`header`),this.#t=this.ownerDocument.createElement(`div`),this.#t.className=`slicc-pane__body`,this.#t.setAttribute(`part`,`body`),t.append(this.#e,this.#t);for(let t of e)t instanceof HTMLElement&&t.getAttribute(`slot`)===`header`?this.#e.appendChild(t):this.#t.appendChild(t);this.appendChild(t)}});var bo=`
|
|
4417
4417
|
slicc-press-button {
|
|
4418
4418
|
display: inline-flex;
|
|
4419
4419
|
}
|
|
@@ -4505,7 +4505,7 @@ slicc-press-button {
|
|
|
4505
4505
|
animation: none;
|
|
4506
4506
|
}
|
|
4507
4507
|
}
|
|
4508
|
-
`,
|
|
4508
|
+
`,xo=`slicc-press-button-style`;function So(e){if(e.getElementById(xo))return;let t=e.createElement(`style`);t.id=xo,t.textContent=bo,(e.head??e.documentElement).appendChild(t)}var Co=`slicc-press-btn`,wo=`is-squish`,To=`is-wobble`;A(`slicc-press-button`,class extends HTMLElement{static get observedAttributes(){return[`label`,`tooltip`,`tooltip-pos`,`disabled`]}innerBtn=null;pressLayer=null;handle=null;initialized=!1;pendingShortTimer=null;pendingShortEvent=null;animEndListener=null;connectedCallback(){So(this.ownerDocument),this.initialized?this.handle===null&&this.attachGesture():this.initialize(),this.syncAttributes()}disconnectedCallback(){this.handle?.destroy(),this.handle=null,this.clearPendingShort(),this.clearRipple(),this.clearAnimation()}attributeChangedCallback(){this.initialized&&this.syncAttributes()}get disabled(){return this.hasAttribute(`disabled`)}set disabled(e){this.toggleAttribute(`disabled`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get tooltip(){return this.getAttribute(`tooltip`)}set tooltip(e){e==null?this.removeAttribute(`tooltip`):this.setAttribute(`tooltip`,e)}setIcon(e){this.initialized||this.initialize();let t=this.innerBtn,n=this.pressLayer;for(let e of Array.from(t.childNodes))e!==n&&e.remove();let r=new DOMParser().parseFromString(e,`text/html`).body;for(;r.firstChild;)t.appendChild(r.firstChild)}focus(e){this.initialized||this.initialize(),this.innerBtn?.focus(e)}initialize(){this.initialized=!0;let e=j(`span`,{class:`${Co}__press-layer`,part:`press-layer`}),t=j(`button`,{type:`button`,class:`${Co}__btn`,part:`button`},e);for(;this.firstChild;)t.appendChild(this.firstChild);this.appendChild(t),this.innerBtn=t,this.pressLayer=e,this.attachGesture()}syncAttributes(){let e=this.innerBtn;if(!e)return;let t=this.getAttribute(`label`);t==null?e.removeAttribute(`aria-label`):e.setAttribute(`aria-label`,t);let n=this.getAttribute(`tooltip`);n==null?delete e.dataset.tooltip:e.dataset.tooltip=n;let r=this.getAttribute(`tooltip-pos`);r==null?delete e.dataset.tooltipPos:e.dataset.tooltipPos=r,this.hasAttribute(`disabled`)?e.setAttribute(`disabled`,``):e.removeAttribute(`disabled`)}longPressMs(){let e=this.getAttribute(`long-press-ms`);if(e==null)return er;let t=Number(e);return Number.isFinite(t)&&t>0?t:er}doubleClickMs(){let e=this.getAttribute(`double-click-ms`);if(e==null)return 350;let t=Number(e);return Number.isFinite(t)&&t>0?t:350}doubleClickDisabled(){return this.hasAttribute(`disable-double-click`)}emit(e,t){e===`short-click`?this.playAnimation(wo):e===`double-click`&&this.playAnimation(To);let n=t?{sourceEvent:t}:{};this.dispatchEvent(new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n}))}playAnimation(e){let t=this.innerBtn;if(!t)return;this.clearAnimation(),t.offsetWidth,t.classList.add(e);let n=e=>{e.target===t&&this.clearAnimation()};this.animEndListener=n,t.addEventListener(`animationend`,n)}clearAnimation(){let e=this.innerBtn;e&&(this.animEndListener&&=(e.removeEventListener(`animationend`,this.animEndListener),null),e.classList.remove(wo,To))}clearPendingShort(){this.pendingShortTimer!==null&&(clearTimeout(this.pendingShortTimer),this.pendingShortTimer=null),this.pendingShortEvent=null}attachGesture(){this.handle=tr(this,{longPressMs:this.longPressMs(),onPressStart:e=>this.paintRipple(e),onPressEnd:()=>this.clearRipple(),onLongPress:()=>{if(this.pendingShortTimer!==null){this.clearPendingShort(),this.emit(`double-click`);return}this.emit(`long-press`)},onShortClick:e=>{if(this.doubleClickDisabled()){this.emit(`short-click`,e);return}if(this.pendingShortTimer!==null){this.clearPendingShort(),this.emit(`double-click`,e);return}this.pendingShortEvent=e,this.pendingShortTimer=setTimeout(()=>{this.pendingShortTimer=null;let e=this.pendingShortEvent;this.pendingShortEvent=null,this.emit(`short-click`,e??void 0)},this.doubleClickMs())}})}paintRipple(e){this.clearRipple();let t=this.pressLayer;if(!t)return;let n=t.getBoundingClientRect(),r=e.clientX-n.left,i=e.clientY-n.top,a=Math.max(r,n.width-r),o=Math.max(i,n.height-i),s=Math.ceil(Math.hypot(a,o))+2,c=this.ownerDocument.createElement(`span`);c.className=`${Co}__press`,c.style.left=`${r}px`,c.style.top=`${i}px`,c.style.width=`0px`,c.style.height=`0px`,c.style.transitionDuration=`${this.longPressMs()}ms`,t.appendChild(c),requestAnimationFrame(()=>{c.isConnected&&(c.style.width=`${s*2}px`,c.style.height=`${s*2}px`)})}clearRipple(){let e=this.pressLayer;if(e)for(;e.firstChild;)e.firstChild.remove()}});var Eo=M(`
|
|
4509
4509
|
:host { display: inline-flex; }
|
|
4510
4510
|
:host([hidden]) { display: none; }
|
|
4511
4511
|
|
|
@@ -4535,7 +4535,7 @@ slicc-press-button {
|
|
|
4535
4535
|
outline: 2px solid var(--violet);
|
|
4536
4536
|
outline-offset: 2px;
|
|
4537
4537
|
}
|
|
4538
|
-
`);A(`slicc-swatch`,class extends HTMLElement{static observedAttributes=[`color`,`hue`,`selected`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
4538
|
+
`);A(`slicc-swatch`,class extends HTMLElement{static observedAttributes=[`color`,`hue`,`selected`,`label`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Eo]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get color(){return this.getAttribute(`color`)}set color(e){e==null?this.removeAttribute(`color`):this.setAttribute(`color`,e)}get hue(){return this.hasAttribute(`hue`)}set hue(e){this.toggleAttribute(`hue`,!!e)}get selected(){return this.hasAttribute(`selected`)}set selected(e){this.toggleAttribute(`selected`,!!e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}#t(){let e=this.color,t=[`sw`];this.hue&&t.push(`hue`),this.selected&&t.push(`on`);let n=j(`button`,{type:`button`,part:`button`,class:t.join(` `),"aria-pressed":this.selected?`true`:`false`,"aria-label":this.label??e??`color swatch`},j(`slot`));e&&n.style.setProperty(`--swatch-color`,e),n.addEventListener(`click`,this.#n),this.#e.replaceChildren(n)}#n=()=>{this.selected=!0,this.dispatchEvent(new CustomEvent(`select`,{detail:{color:this.color},bubbles:!0,composed:!0}))}});var Do=new Set([`rose`,`cyan`,`violet`,`amber`,`waffle`,`green`]),Oo=M(`
|
|
4539
4539
|
:host {
|
|
4540
4540
|
display: inline-flex;
|
|
4541
4541
|
vertical-align: middle;
|
|
@@ -4595,7 +4595,7 @@ slicc-press-button {
|
|
|
4595
4595
|
:host-context(.dark)[hue="amber"] .tag, :host-context([data-theme="dark"])[hue="amber"] .tag { background: color-mix(in srgb, var(--amber) 22%, var(--canvas)); border-color: color-mix(in srgb, var(--amber) 38%, var(--line)); }
|
|
4596
4596
|
:host-context(.dark)[hue="waffle"] .tag, :host-context([data-theme="dark"])[hue="waffle"] .tag { background: color-mix(in srgb, var(--waffle) 22%, var(--canvas)); border-color: color-mix(in srgb, var(--waffle) 38%, var(--line)); }
|
|
4597
4597
|
:host-context(.dark)[hue="green"] .tag, :host-context([data-theme="dark"])[hue="green"] .tag { background: color-mix(in srgb, var(--green) 22%, var(--canvas)); border-color: color-mix(in srgb, var(--green) 38%, var(--line)); }
|
|
4598
|
-
`);A(`slicc-tag`,class extends HTMLElement{static observedAttributes=[`hue`,`label`,`dot`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[
|
|
4598
|
+
`);A(`slicc-tag`,class extends HTMLElement{static observedAttributes=[`hue`,`label`,`dot`];#e;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Oo]}connectedCallback(){this.#t()}attributeChangedCallback(){this.isConnected&&this.#t()}get hue(){let e=this.getAttribute(`hue`);return e&&Do.has(e)?e:null}set hue(e){e==null?this.removeAttribute(`hue`):this.setAttribute(`hue`,e)}get label(){return this.getAttribute(`label`)}set label(e){e==null?this.removeAttribute(`label`):this.setAttribute(`label`,e)}get dot(){return this.hasAttribute(`dot`)}set dot(e){e?this.setAttribute(`dot`,``):this.removeAttribute(`dot`)}#t(){let e=this.label??j(`slot`),t=j(`span`,{class:`tag`,part:`tag`},this.dot?j(`span`,{class:`dot`,part:`dot`}):null,j(`span`,{class:`label`,part:`label`},e));this.#e.replaceChildren(t)}});var ko=M(`
|
|
4599
4599
|
:host {
|
|
4600
4600
|
position: fixed;
|
|
4601
4601
|
inset: 0;
|
|
@@ -4783,7 +4783,7 @@ iframe {
|
|
|
4783
4783
|
font-size: 13px;
|
|
4784
4784
|
}
|
|
4785
4785
|
.fallback code { font-family: var(--mono, monospace); font-size: 12px; }
|
|
4786
|
-
`),
|
|
4786
|
+
`),Ao={rendered:`Preview`,file:`Source`,diff:`Diff`};function jo(e){let t=[];return e.rendered&&t.push(`rendered`),Fo(e)&&t.push(`file`),e.baseContent!==void 0&&t.push(`diff`),t}function Mo(e){return e.rendered?`rendered`:e.baseContent===void 0?`file`:`diff`}var No=null,Po=null;function Fo(e){if(e.text===!0)return!0;let t=e.mimeType.split(`;`,1)[0]?.trim()??e.mimeType;return t.startsWith(`text/`)?!0:t===`application/json`||t===`application/xml`||t===`application/javascript`||t===`image/svg+xml`||t.endsWith(`+json`)||t.endsWith(`+xml`)}function Io(e){return typeof e==`string`?e:new TextDecoder().decode(e)}function Lo(e,t){let n=typeof e==`string`?new TextEncoder().encode(e):e;return new Blob([n],{type:t})}var Ro=!1;function zo(e){if(!Ro){Ro=!0;for(let t of[`jsh`,`bsh`])try{e.setCustomExtension(t,`zsh`)}catch{}}}function Bo(e,t){let n=`<style>:root{color-scheme:${t};}html{background:Canvas;color:CanvasText;}</style>`,r=/^\s*<!doctype[^>]*>/i.exec(e);return r?e.slice(0,r[0].length)+n+e.slice(r[0].length):n+e}function Vo(){let e=document.documentElement,t=e.dataset.theme??e.getAttribute(`data-theme`)??``;return t.includes(`dark`)?`dark`:t.includes(`light`)?`light`:globalThis.matchMedia?.(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}var Ho=class e extends HTMLElement{#e;#t=[];#n=0;#r=null;#i=null;#a=`file`;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[ko]}disconnectedCallback(){for(let e of this.#t)URL.revokeObjectURL(e);this.#t.length=0,No===this&&(No=null)}static open(t){e.close();let r=document.createElement(`slicc-quick-look`);r.#r=t,r.#n+=1,r.#a=Mo(t);let i=t.path.split(`/`).pop()||t.path,a=t.path.slice(0,t.path.length-i.length),o=j(`div`,{class:`backdrop`}),s=j(`button`,{class:`x`});s.setAttribute(`aria-label`,`Close preview`),s.appendChild(n(`x`,{size:14}));let c=j(`div`,{class:`header`},j(`div`,{class:`name`},j(`span`,{class:`dir`},a),i));c.appendChild(j(`span`,{class:`chip`},Uo(t))),t.gitStatus&&c.appendChild(j(`span`,{class:`chip chip--git`},t.gitStatus));let l=jo(t);l.length>1&&c.appendChild(r.#o(l)),c.appendChild(s);let u=j(`div`,{class:`content`});r.#i=u,r.#s();let d=j(`div`,{class:`panel`},c,u);d.tabIndex=-1,r.#e.append(o,d),document.body.appendChild(r),No=r,d.focus(),o.addEventListener(`click`,()=>r.#l(`backdrop`)),s.addEventListener(`click`,()=>r.#l(`close-button`)),Po&&document.removeEventListener(`keydown`,Po),Po=e=>{e.key===`Escape`&&r.#l(`escape`)},document.addEventListener(`keydown`,Po)}static close(){if(No){for(let e of No.#t)URL.revokeObjectURL(e);No.remove(),No=null}Po&&=(document.removeEventListener(`keydown`,Po),null)}#o(e){let t=e.map(e=>j(`button`,{type:`button`},Ao[e])),n=()=>{for(let[n,r]of e.entries())t[n]?.setAttribute(`aria-pressed`,String(this.#a===r))};n();for(let[r,i]of e.entries())t[r]?.addEventListener(`click`,()=>{this.#a!==i&&(this.#a=i,n(),this.#s())});return j(`div`,{class:`toggle`},...t)}#s(){let e=this.#r,t=this.#i;!e||!t||(t.replaceChildren(this.#d(e)),t.classList.toggle(`content--rich`,this.#a===`rendered`&&e.rendered?.mount===`sandbox`),this.#a!==`rendered`&&Fo(e)&&this.#u(this.#n))}#c(e){let t=e.rendered;if(!t)return j(`pre`,null,Io(e.content));if(t.mount===`sandbox`){let n=document.createElement(`iframe`);return n.setAttribute(`sandbox`,``),n.srcdoc=Bo(t.html,Vo()),n.title=`${e.path.split(`/`).pop()||e.path} preview`,n.className=`rendered-frame`,n}let n=j(`div`,{class:`rendered`}),r=this.ownerDocument.createRange();return r.selectNodeContents(n),n.appendChild(r.createContextualFragment(t.html)),n}#l(t){this.dispatchEvent(new CustomEvent(`quick-look-close`,{bubbles:!0,composed:!0,detail:{reason:t}})),e.close()}async#u(e){let n=this.#r,r=this.#i;if(!n||!r)return;let i;try{i=await t(()=>import(`./dist-B4LJzMVB.js`).then(e=>e.t),__vite__mapDeps([0,1,2]))}catch{return}if(zo(i),e!==this.#n||!this.isConnected)return;let a=n.path.split(`/`).pop()||n.path,o=Io(n.content),s={themeType:Vo(),theme:{dark:`github-dark`,light:`github-light`},stickyHeader:!1,disableFileHeader:!0},c=j(`div`);try{if(this.#a===`diff`&&n.baseContent!==void 0){let e=new i.FileDiff({...s,diffStyle:`unified`});e.render({oldFile:{name:a,contents:n.baseContent},newFile:{name:a,contents:o},containerWrapper:c}),n.line!==void 0&&e.setSelectedLines({start:n.line,end:n.line,side:`additions`})}else{let e=new i.File(s);e.render({file:{name:a,contents:o},containerWrapper:c}),n.line!==void 0&&e.setSelectedLines({start:n.line,end:n.line})}}catch{return}e!==this.#n||!this.isConnected||(r.classList.add(`content--rich`),r.replaceChildren(c))}#d(e){let t=e.mimeType;if(this.#a===`rendered`)return this.#c(e);if(Fo(e))return j(`pre`,null,Io(e.content));if(t.startsWith(`image/`)){let n=document.createElement(`img`);return n.src=this.#f(e.content,t),n.alt=e.path.split(`/`).pop()||``,n}if(t.startsWith(`audio/`)){let n=document.createElement(`audio`);return n.controls=!0,n.src=this.#f(e.content,t),n}if(t.startsWith(`video/`)){let n=document.createElement(`video`);return n.controls=!0,n.src=this.#f(e.content,t),n}if(t===`application/pdf`){let n=document.createElement(`iframe`);return n.src=this.#f(e.content,t),n.title=e.path.split(`/`).pop()||`PDF preview`,n}return j(`div`,{class:`fallback`},j(`div`,null,`Preview not available for this file type (${Wo(typeof e.content==`string`?e.content.length:e.content.byteLength)})`),j(`div`,{style:`margin-top:6px;`},j(`code`,null,t)))}#f(e,t){let n=URL.createObjectURL(Lo(e,t));return this.#t.push(n),n}};function Uo(e){let t=e.mimeType.split(`;`,1)[0]?.trim()??e.mimeType;return t===`application/octet-stream`?`binary`:t.slice(t.indexOf(`/`)+1).replace(/^x-/,``).replace(/\+.*$/,``)}function Wo(e){return e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:`${(e/1048576).toFixed(1)} MB`}A(`slicc-quick-look`,Ho);var Go=`
|
|
4787
4787
|
.slicc-chatpane {
|
|
4788
4788
|
flex: 1 1 0;
|
|
4789
4789
|
width: 100%;
|
|
@@ -4824,7 +4824,7 @@ iframe {
|
|
|
4824
4824
|
-webkit-mask-image: none;
|
|
4825
4825
|
mask-image: none;
|
|
4826
4826
|
}
|
|
4827
|
-
`,
|
|
4827
|
+
`,Ko=`slicc-chatpane-style`;function qo(e){if(e.getElementById(Ko))return;let t=e.createElement(`style`);t.id=Ko,t.textContent=Go,(e.head??e.documentElement).appendChild(t)}var Jo=[`slicc-chat-thread`,`slicc-composer`];A(`slicc-chatpane`,class extends HTMLElement{static observedAttributes=[`narrow`];#e=null;#t=!1;connectedCallback(){qo(this.ownerDocument),this.classList.add(`slicc-chatpane`),this.setAttribute(`part`,`pane`),this.#t=!0,this.#n(),this.#r()}disconnectedCallback(){this.#e?.disconnect(),this.#e=null}attributeChangedCallback(e,t,n){e===`narrow`&&t!==n&&this.isConnected&&(this.#n(),this.dispatchEvent(new CustomEvent(`slicc-chatpane-narrow-change`,{detail:{narrow:this.narrow},bubbles:!0,composed:!0})))}get narrow(){return this.hasAttribute(`narrow`)}set narrow(e){e?this.setAttribute(`narrow`,``):this.removeAttribute(`narrow`)}get nav(){return this.querySelector(`:scope > slicc-nav`)}get thread(){return this.querySelector(`:scope > slicc-chat-thread`)}get composer(){return this.querySelector(`:scope > slicc-composer`)}#n(){if(!this.#t)return;let e=this.narrow;for(let t of Jo)for(let n of this.querySelectorAll(`:scope > ${t}`))e?n.setAttribute(`open`,``):n.removeAttribute(`open`)}#r(){this.#e||(this.#e=new MutationObserver(()=>this.#n()),this.#e.observe(this,{childList:!0}))}});var Yo=`
|
|
4828
4828
|
.slicc-shell { display: flex; flex: 1; min-height: 0; }
|
|
4829
4829
|
.slicc-shell > slicc-dock-tree,
|
|
4830
4830
|
.slicc-shell > .dock-tree {
|
|
@@ -4840,7 +4840,7 @@ iframe {
|
|
|
4840
4840
|
and blur the rail's own opaque strip. */
|
|
4841
4841
|
.slicc-shell > slicc-dock,
|
|
4842
4842
|
.slicc-shell > .dock { flex: 0 0 48px; position: relative; z-index: 3; }
|
|
4843
|
-
`,
|
|
4843
|
+
`,Xo=`slicc-shell-style`;function Zo(e){if(e.getElementById(Xo))return;let t=e.createElement(`style`);t.id=Xo,t.textContent=Yo,(e.head??e.documentElement).appendChild(t)}var Qo=`chat`;A(`slicc-shell`,class extends HTMLElement{#e=e=>{let t=e.detail?.placed;if(!Array.isArray(t))return;let n=t.some(e=>e!==Qo);this.querySelector(`slicc-chatpane`)?.toggleAttribute(`narrow`,n)};connectedCallback(){Zo(this.ownerDocument),this.classList.add(`slicc-shell`),this.setAttribute(`part`,`shell`),this.addEventListener(`dock-tree-render`,this.#e)}disconnectedCallback(){this.removeEventListener(`dock-tree-render`,this.#e)}get dockTree(){return this.querySelector(`:scope > slicc-dock-tree, :scope > .dock-tree`)}get dock(){return this.querySelector(`:scope > slicc-dock, :scope > .dock`)}});var $o=[`idle`,`thinking`,`working`,`awaiting`],es=.22,ts=.08,ns=3400,rs=4600,is=.38,as=2600,os=.22,ss=1e3,cs=.1,ls=.55,us=.16,ds={left:{raise:-9,tilt:-10},right:{raise:2,tilt:6}},fs=[{x:45,y:-15},{x:150,y:-10},{x:95,y:-25},{x:160,y:-30},{x:40,y:-28}],ps=1300,ms=[{x:70,y:60},{x:130,y:40},{x:100,y:72},{x:55,y:30},{x:148,y:62}],hs=4100,gs=2.2,_s={x:100,y:66};function vs(e,t,n){return e+(t-e)*n}function ys(e,t,n,r){return e+(t-e)*Math.min(1,n*r)}function bs(e){return e===null?null:$o.includes(e)?e:`idle`}function xs(e){let t=Number.parseFloat(e??``);return Number.isFinite(t)&&t>=0?t:90}function Ss(e){return+(e===`working`)}function Cs(e){return vs(38,10,e)}function ws(e,t){return vs(e,e*es,t)}function Ts(e){return e<=50?1:e>=85?2.2:1+(e-50)/35*1.2}function Es(e){return e<=0?1:1+us*Math.min(1,e/350)}function Ds(e){return Math.max(2,Math.min(16,38-e-4))}function Os(e){return e>.001?12+e*2*38:9}function ks(e){return e>.001?88-e*2*38:91}function As(e,t){let n=e-50;return vs(Math.sqrt(Math.max(0,1444-n*n)),36,t)}function js(e,t){return e<=t?cs:vs(cs,ls,Math.min(1,(e-t)/12))}function Ms(e){return e.left.raise<0}function Ns(e,t=Math.random){let n=t()<.65?!Ms(e):Ms(e),r={raise:-(7+t()*5),tilt:7+t()*5},i={raise:1+t()*2,tilt:4+t()*3};return n?{left:{raise:r.raise,tilt:-r.tilt},right:i}:{left:{raise:i.raise,tilt:-i.tilt},right:r}}function Ps(e,t,n){return t<2?0:(e+1+Math.floor(n()*(t-1)))%t}var Fs=`http://www.w3.org/2000/svg`,Is={cx:55,cy:50,r:38},Ls={cx:145,cy:50,r:38},Rs=1,zs=12,Bs=.72,Vs=[.08,.36,.68,.94],Hs=1372365086,Us=2654435769,Ws=2246822507,Gs=Date.UTC(2001,0,1),Ks=500,qs={cone:{vb:`70 330 440 570`,eyes:{top:-18.5,left:17,width:70,height:44},zoom:3,glyph:96},scoop:{vb:`0 0 580 470`,eyes:{top:30,left:15,width:70,height:45},zoom:2.65,glyph:96}},Js={cone:`#D2691E`,scoop:`#FFB6C1`},Ys=M(`
|
|
4844
4844
|
:host{display:block;width:26px;height:26px;pointer-events:none;}
|
|
4845
4845
|
/* The tile itself no longer clips: .crop owns the roundrect so the brows can
|
|
4846
4846
|
break out of it (see .brow-layer). Everything else still paints inside. */
|
|
@@ -4855,14 +4855,14 @@ iframe {
|
|
|
4855
4855
|
.eyes{position:absolute;pointer-events:none;}
|
|
4856
4856
|
.eyes-svg,.brows-svg{display:block;overflow:visible;}
|
|
4857
4857
|
.eye-blink,.eye-frozen{transform-box:view-box;}
|
|
4858
|
-
@keyframes slicc-agent-avatar-blink{0%,92%,100%{transform:scaleY(1);}96%{transform:scaleY(${
|
|
4858
|
+
@keyframes slicc-agent-avatar-blink{0%,92%,100%{transform:scaleY(1);}96%{transform:scaleY(${ts});}}
|
|
4859
4859
|
:host([blink]) .eye-blink{animation:slicc-agent-avatar-blink 3.4s ease-in-out infinite;}
|
|
4860
4860
|
:host([blink]) .eye-r{animation-duration:4.6s;}
|
|
4861
4861
|
/* The engine drives blinks itself so it can commit shape changes at the apex. */
|
|
4862
4862
|
.avatar[data-expressive] .eye-blink{animation:none;}
|
|
4863
4863
|
.brow{transition:opacity 350ms ease,transform 350ms ease;}
|
|
4864
4864
|
@media (prefers-reduced-motion:reduce){:host([blink]) .eye-blink{animation:none;}.brow{transition:none;}}
|
|
4865
|
-
`);function z(e,t,...n){let r=document.createElementNS(Ps,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function Ys(e,t,n){e&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Xs(e,t,n){Ys(e,t,n.toFixed(2))}function Zs(e,t){let n=e.replace(`#`,``),r=n.length===3?[...n].map(e=>`${e}${e}`).join(``):n,i=Number.parseInt(r,16);if(!Number.isFinite(i))return e;let a=t<0?0:255,o=e=>Math.round(e+(a-e)*Math.abs(t)).toString(16).padStart(2,`0`);return`#${o(i>>16&255)}${o(i>>8&255)}${o(i&255)}`}function Qs(e,t,n){let r=[[`path`,{d:`M108.22,414.88l189.84,460.03c1.36,3.3,6.09,3.16,7.25-.22l159.34-463.34c.87-2.53-1.03-5.16-3.7-5.13l-349.18,3.32c-2.74.03-4.59,2.82-3.55,5.35Z`,fill:e,stroke:t,"stroke-linejoin":`round`,"stroke-width":20}],[`path`,{d:`M261.93,482.48h0c15.03-15.03,4.46-40.72-16.79-40.83h0c-21.37-.11-32.14,25.72-17.03,40.83h0c9.34,9.34,24.48,9.34,33.82,0Z`,fill:n}],[`path`,{d:`M384.85,527.49l-51.82,51.82c-2.24,2.24-2.24,5.86,0,8.1l55.71,55.71c2.24,2.24,5.86,2.24,8.1,0h0c.62-.62,1.08-1.36,1.37-2.19l26.52-77.11c.71-2.07.18-4.36-1.37-5.91l-30.41-30.41c-2.24-2.24-5.86-2.24-8.1,0Z`,fill:n}],[`path`,{d:`M371.7,684.58l-25.94,25.94c-2.24,2.24-2.24,5.86,0,8.1l12.67,12.67c2.99,2.99,8.09,1.82,9.46-2.19l13.28-38.61c1.97-5.74-5.17-10.2-9.46-5.91Z`,fill:n}],[`path`,{d:`M159.42,564.14l2.73,6.83c1.52,3.82,6.46,4.83,9.37,1.93l2.05-2.05c2.24-2.24,2.24-5.86,0-8.1l-4.78-4.78c-4.4-4.4-11.67.39-9.37,6.17Z`,fill:n}],[`path`,{d:`M243.92,633.11l-48.65-48.65c-5.24-5.24-13.74-5.24-18.99,0h0c-3.8,3.8-4.97,9.49-2.98,14.47l27.77,69.54c3.58,8.95,15.14,11.33,21.96,4.51l20.89-20.89c5.24-5.24,5.24-13.74,0-18.99Z`,fill:n}],[`path`,{d:`M211.32,533.1h0c14.11-14.11,14.11-36.98,0-51.08l-34.94-34.94c-.72-.72-.72-1.89,0-2.62h0c1.16-1.16.34-3.15-1.3-3.16l-11.23-.06c-25.62-.13-43.23,25.72-33.73,49.51l5.37,13.45c1.82,4.55,4.54,8.68,8,12.15l16.74,16.74c14.11,14.11,36.98,14.11,51.08,0Z`,fill:n}],[`path`,{d:`M263.74,792.53h0c-5.69,5.69-7.45,14.23-4.46,21.71l22.5,56.36c6.92,17.34,31.68,16.74,37.75-.92l8.66-25.2c2.5-7.28.64-15.35-4.8-20.79l-31.17-31.17c-7.87-7.87-20.62-7.87-28.48,0Z`,fill:n}],[`path`,{d:`M392.94,503.07l40.81-40.81c2.24-2.24,5.86-2.24,8.1,0l.06.06c2.24,2.24,2.24,5.86,0,8.1l-40.81,40.81c-2.24,2.24-2.24,5.86,0,8.1l22.48,22.48c2.99,2.99,8.09,1.82,9.46-2.19l30.71-89.32c1.27-3.71-1.47-7.57-5.39-7.59l-120.63-.6c-5.11-.03-7.69,6.16-4.08,9.77l51.18,51.18c2.24,2.24,5.86,2.24,8.1,0Z`,fill:n}]],i=[[274.59,463.59,84.73,95.66,42.36,`translate(-268.79 373.91) rotate(-45)`],[291.06,603.84,72.24,90.24,36.12,`translate(-363.06 421.43) rotate(-45)`],[217.18,527.25,72.24,95.66,36.12,`translate(-332.45 347.55) rotate(-45)`],[236.26,661.25,67.04,90.24,33.52,`translate(-420.46 397.65) rotate(-45)`]],a=r.map(([e,t])=>z(e,t));return a.push(...i.map(([e,t,r,i,a,o])=>z(`rect`,{x:e,y:t,width:r,height:i,rx:a,ry:a,transform:o,fill:n})),z(`ellipse`,{cx:288.37,cy:404.38,rx:182.34,ry:67.01,fill:e,stroke:t,"stroke-miterlimit":10,"stroke-width":20})),a}function $s(e,t){return[z(`path`,{d:`M566.75,340.67c0-29.85-12.97-56.87-33.96-76.47,4.8-9.98,7.44-20.71,7.44-31.9,0-38.29-30.62-71.33-74.92-86.77.33-3.07.51-6.17.51-9.3,0-69.72-84.29-126.24-188.26-126.24s-188.26,56.52-188.26,126.24c0,4,.29,7.95.83,11.86-34.94,15.4-58.48,44.25-58.48,77.34,0,18.21,7.15,34.25,19.39,49.26-25.1,19.88-41.05,49.47-41.05,82.54,0,59.85,52.15,108.37,116.49,108.37,10.83,0,21.3-1.4,31.26-3.98,31.42,41.91,83.55,69.34,142.55,69.34,64.73,0,121.2-33,151.11-81.94,63.8-.57,115.34-48.85,115.34-108.34Z`,fill:e,stroke:t,"stroke-width":20})]}function ec(e,t,n,r){return z(`rect`,{x:e-t,y:50-t,width:t*2,height:t*2,rx:n,...r})}function tc(e,t,n,r){return z(`g`,{class:`pupil pupil-${t}`},ec(e,n,Cs(n,r),{fill:`#000`}),z(`circle`,{cx:e-n*.3,cy:50-n*.35,r:n*.4,fill:`#fff`}))}function nc(e,t){return z(`line`,{class:`lid-line lid-${t}`,x1:e-38,y1:50,x2:e+38,y2:50,stroke:`#000`,"stroke-width":4,"stroke-linecap":`round`,display:`none`})}function rc(e,t){let n=z(`line`,{class:`brow brow-${t}`,x1:e-22,y1:2,x2:e+22,y2:2,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`,opacity:0});return n.style.transformBox=`fill-box`,n.style.transformOrigin=`center`,n}function ic(e){return j(`span`,{class:`eyes`,style:`top:${e.eyes.top}%;left:${e.eyes.left}%;width:${e.eyes.width}%;height:${e.eyes.height}%`})}function ac(e,t,n){let r=z(`g`,{class:`${n} eye-${t}`});return r.style.transformOrigin=`${e}px 50px`,r}function oc(e,t,n){let r=`slicc-agent-avatar-noise-${t}`;return z(`g`,{class:`eye-static eye-body-${t}`},z(`defs`,{},z(`clipPath`,{id:r},ec(e,38,n,{class:`noise-clip`}))),ec(e,38,n,{class:`socket`,fill:`#fff`}),z(`g`,{class:`noise noise-${t}`,"clip-path":`url(#${r})`,"data-cell-size":Ls}),ec(e,38,n,{class:`eye-outline`,fill:`none`,stroke:`#000`,"stroke-width":4}))}function sc(e){return e^=e<<13,e^=e>>>17,e^=e<<5,e>>>0}function cc(e){return(Vs^Math.imul(e,Us))>>>0}function lc(e,t){return(cc(e)^Math.imul(t,Hs))>>>0}function uc(){return Math.floor((Date.now()-Ws)/1e3*Rs)>>>0}function dc(e){return[z(`circle`,{cx:e,cy:50,r:38,fill:`#fff`,stroke:`#000`,"stroke-width":4}),z(`line`,{x1:e-15,y1:35,x2:e+15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`}),z(`line`,{x1:e+15,y1:35,x2:e-15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`})]}function fc(e,t,n,r,i){let a=n-t,o=r-50,s=Math.hypot(a,o),c=Math.min(s,i),l=s>0?a/s*c:0,u=s>0?o/s*c:0;e.setAttribute(`transform`,`translate(${l.toFixed(2)},${u.toFixed(2)})`)}var pc={now:()=>performance.now(),requestFrame:e=>window.requestAnimationFrame(e),cancelFrame:e=>window.cancelAnimationFrame(e),delay:(e,t)=>window.setTimeout(e,t),cancelDelay:e=>window.clearTimeout(e),repeat:(e,t)=>window.setInterval(e,t),cancelRepeat:e=>window.clearInterval(e)};A(`slicc-agent-avatar`,class extends HTMLElement{static observedAttributes=[`type`,`color`,`eyes`,`fill`,`connection`,`activity`,`gaze-target`,`drowse-delay`];#e;#t=e=>this.#ke(e);#n=()=>{this.#V(),this.#q(),this.#U()===`static`&&this.#we()};#r=null;#i=null;#a=null;#o=null;#s=[];#c=null;#l=16;#u=!1;#d=null;#f=!1;#p=!1;#m=0;#h=0;#g=!1;#_=0;#v=0;#y=us;#b={x:100,y:50};#x=0;#S=0;#C=18;#w=null;#T=0;#E=0;#D=0;#O=null;#k=0;#A=[];#j=null;#M=[];#N=gs;#P=null;#F=pc;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Js]}connectedCallback(){this.#r=window.matchMedia(`(prefers-reduced-motion: reduce)`),this.#r.addEventListener(`change`,this.#n),this.#L(),this.#V(),this.#q()}disconnectedCallback(){this.#H(),this.#De(),this.#Q(),this.#r?.removeEventListener(`change`,this.#n),this.#r=null,this.#p=!1}attributeChangedCallback(e){if(this.isConnected){if(e===`activity`||e===`gaze-target`||e===`drowse-delay`){this.#K();return}this.#L(),this.#V(),this.#q()}}get activity(){return ys(this.getAttribute(`activity`))}set activity(e){e===null?this.removeAttribute(`activity`):this.setAttribute(`activity`,e)}get gazeTarget(){return this.getAttribute(`gaze-target`)}set gazeTarget(e){e===null?this.removeAttribute(`gaze-target`):this.setAttribute(`gaze-target`,e)}get drowseDelay(){return bs(this.getAttribute(`drowse-delay`))}set drowseDelay(e){this.setAttribute(`drowse-delay`,String(e))}get clock(){return this.#F}set clock(e){if(e===this.#F)return;this.#Q(),this.#F=e;let t=e.now();this.#k=t,this.#w!==null&&(this.#w=t),this.#T=0,this.#E=0,this.#D=0,this.#P=null,this.isConnected&&this.#q()}get expression(){return Object.freeze({activity:this.#d,shape:this.#m,lidTop:this.#_,lidBottom:this.#v,pupilRadius:this.#C,gaze:{...this.#b},brows:this.#y,browsVisible:this.#_e()})}wake(){let e=this.#F.now();this.#w=e,this.#W()||(this.#D=e+350,this.#ce()),this.#Y()}scrutinize(){this.#E=this.#F.now()+os,this.#Y()}glower(){this.#T=this.#F.now()+is,this.#Y()}resetExpression(){this.#se();let e=this.#F.now();this.#T=0,this.#E=0,this.#D=0,this.#_=0,this.#v=0,this.#y=us,this.#N=gs,this.#P=null,this.#S=0,this.#w=this.#d===`awaiting`?e:null,this.#g=!1,this.#h=xs(this.#d),this.#m=this.#h,this.#k=e,this.#I()&&this.isConnected&&(this.#ve(),this.#q())}#I(){return this.hasAttribute(`activity`)||this.#f}#L(){this.#De(),this.#s=[];let e=this.getAttribute(`type`)===`cone`?`cone`:`scoop`,t=Ks[e],n=this.getAttribute(`color`)??qs[e],r=this.#I();this.#d=ys(this.getAttribute(`activity`)),this.#d===`awaiting`&&this.#w===null&&(this.#w=this.#F.now()),this.#p||=(this.#m=this.#h=xs(this.#d),!0);let i=z(`svg`,{class:`glyph`,viewBox:t.vb,preserveAspectRatio:`xMidYMid meet`,style:`--g:${t.glyph}%`},...e===`cone`?Qs(n,Zs(n,-.38),Zs(n,.3)):$s(n,Zs(n,-.32)));this.#o=z(`svg`,{class:`eyes-svg`,viewBox:`0 0 200 100`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},...this.#R(r));let a=ic(t);a.append(this.#o);let o=`--tx:${((.5-t.zoom*((t.eyes.left+t.eyes.width/2)/100))*100).toFixed(2)}%;--ty:${((.5-t.zoom*((t.eyes.top+t.eyes.height/2)/100))*100).toFixed(2)}%;--zoom:${t.zoom}`,s=j(`span`,{class:`icon-inner`,style:o},i,a),c=this.#z(r),l=null;if(c){let e=ic(t);e.append(c),l=j(`span`,{class:`icon-inner brow-layer`,style:o},e)}this.#e.replaceChildren(j(`span`,{class:`avatar`,"aria-hidden":`true`,"data-expressive":r||null},j(`span`,{class:`crop`},s),l)),this.#i=this.#e.querySelector(`.pupil-l`),this.#a=this.#e.querySelector(`.pupil-r`),this.#U()===`static`&&this.#we(),r&&this.#ve()}#R(e){let t=this.#U();if(t===`none`)return[];if(t===`dead`)return[...dc(Fs.cx),...dc(Is.cx)];this.#C=this.#B(),this.#l=Es(this.#C);let n=Ss(this.#m);return[Fs.cx,Is.cx].map((r,i)=>{let a=i===0?`l`:`r`,o=t===`static`,s=ac(r,a,o?`eye-frozen`:`eye-blink`),c=o?oc(r,a,n):z(`g`,{class:`eye-body eye-body-${a}`},ec(r,38,n,{class:`socket`,fill:`#fff`,stroke:`#000`,"stroke-width":4}),tc(r,a,this.#C,this.#m));if(s.append(c),!e)return s;let l=`slicc-agent-avatar-lid-${a}`;return s.append(z(`defs`,{},z(`clipPath`,{id:l},z(`rect`,{class:`lid-clip`,x:r-38-3,y:9,width:82,height:82}))),nc(r,`top`),nc(r,`bottom`)),c.setAttribute(`clip-path`,`url(#${l})`),s})}#z(e){let t=this.#U();return!e||t===`none`||t===`dead`?null:z(`svg`,{class:`brows-svg`,viewBox:`0 0 200 100`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},...[Fs.cx,Is.cx].map((e,t)=>{let n=t===0?`l`:`r`,r=z(`g`,{class:`brow-group brow-group-${n}`});return r.style.transformBox=`view-box`,r.style.transformOrigin=`${e}px 50px`,r.append(rc(e,n)),r}))}#B(){return 18*ws(Math.max(0,Math.min(100,Number.parseFloat(this.getAttribute(`fill`)??`0`)||0)))}#V(){let e=this.#U()===`open`&&!this.#r?.matches&&(this.#d===null||this.#d===`working`);e&&!this.#u?(this.ownerDocument.addEventListener(`pointermove`,this.#t),this.#u=!0):e||(this.#H(),(this.#d===null||this.#d===`working`)&&this.#Oe())}#H(){this.#u&&=(this.ownerDocument.removeEventListener(`pointermove`,this.#t),!1)}#U(){let e=this.getAttribute(`connection`);if(e!==null&&e!==`connected`)return`static`;let t=this.getAttribute(`eyes`);return t===`dead`||t===`none`||t===`static`?t:`open`}#W(){return this.#r?.matches===!0||this.#U()!==`open`||!this.isConnected||!this.#p}#G(){return this.#U()!==`open`}#K(){let e=ys(this.getAttribute(`activity`)),t=this.#e.querySelector(`.avatar[data-expressive]`)!==null;e===`awaiting`&&this.#d!==`awaiting`?this.#w=this.#F.now():e!==`awaiting`&&(this.#w=null),this.#P=null,this.#d=e,this.#I()!==t&&this.#L(),this.#V(),this.#q()}#q(){if(!this.#I()||!this.isConnected){this.#Q();return}if(this.#G()||this.#r?.matches){this.#Z(),this.#J(),this.#te();return}this.#ue(),this.#X()}#J(){for(let e of this.#M)this.#F.cancelRepeat(e);this.#M=[]}#Y(){this.#I()||(this.#f=!0,this.isConnected&&this.#L()),this.#q()}#X(){this.#O===null&&(this.#k=this.#F.now(),this.#O=this.#F.requestFrame(this.#$))}#Z(){this.#O!==null&&(this.#F.cancelFrame(this.#O),this.#O=null)}#Q(){this.#Z();for(let e of this.#A)this.#F.cancelDelay(e);this.#A=[],this.#j!==null&&this.#F.cancelDelay(this.#j),this.#j=null;for(let e of this.#M)this.#F.cancelRepeat(e);this.#M=[]}#$=e=>{this.#O=this.#F.requestFrame(this.#$);let t=Math.min(.05,Math.max(0,(e-this.#k)/1e3));this.#k=e,this.#ee(e,t),this.#ve()};#ee(e,t){let n=xs(this.#d);n!==this.#h&&!this.#g&&this.#ae(n),this.#m=vs(this.#m,this.#h,6,t),this.#_=vs(this.#_,this.#re(e,!1),5,t),this.#v=vs(this.#v,this.#ie(e),5,t),this.#pe(e,t)}#te(){let e=this.#F.now();this.#G()||(this.#h=this.#m=xs(this.#d),this.#_=this.#re(e,!0),this.#v=this.#ie(e),this.#me()),this.#ve(),this.#ne(e)}#ne(e){if(this.#j!==null&&this.#F.cancelDelay(this.#j),this.#j=null,this.#G())return;let t=this.#d===`awaiting`&&this.#w!==null?this.#w+this.drowseDelay*1e3:1/0,n=Math.min(this.#T>e?this.#T:1/0,this.#E>e?this.#E:1/0,t>e?t:1/0);Number.isFinite(n)&&(this.#j=this.#F.delay(()=>this.#te(),Math.max(0,n-e)+1))}#re(e,t){let n=this.#T>e?rs:0;if(this.#d!==`awaiting`)return n;let r=this.#w===null?0:(e-this.#w)/1e3,i=this.drowseDelay;return Math.max(n,As(t&&r>i?i+12:r,i))}#ie(e){return this.#E>e?as:0}#ae(e){if(this.#W()){this.#h=this.#m=e;return}this.#g=!0,this.#ce(()=>{this.#h=this.#m=e,this.#g=!1})}#oe(){return[...this.#e.querySelectorAll(`.eye-blink`)]}#se(){for(let e of this.#A)this.#F.cancelDelay(e);this.#A=[];for(let e of this.#oe())e.style.transition=`none`,e.style.transform=`scaleY(1)`}#ce(e){let t=this.#oe();if(t.length===0){e?.();return}t.forEach((t,n)=>{this.#le(t,n===0?e:void 0)})}#le(e,t){e.style.transition=`transform 110ms ease-in`,e.style.transform=`scaleY(${es})`,this.#A.push(this.#F.delay(()=>{t?.(),this.#d===`thinking`&&!this.#G()&&(this.#y=Ms(this.#y)),e.style.transition=`transform 130ms ease-out`,e.style.transform=`scaleY(1)`},120))}#ue(){this.#M.length>0||this.#W()||this.#G()||[ts,ns].forEach((e,t)=>{this.#M.push(this.#F.repeat(()=>{let e=this.#oe()[t];e&&this.hasAttribute(`blink`)&&!this.#G()&&this.#le(e)},e))})}#de(e){return this.#d===`thinking`?{target:this.#fe(e,ds,fs),rate:9}:this.#d===`idle`?{target:this.#fe(e,ps,ms),rate:hs}:this.#d===`awaiting`?{target:this.#ge(e),rate:6}:null}#fe(e,t,n){return e-this.#S>n&&(this.#S=e,this.#x=Ns(this.#x,t.length,Math.random)),t[this.#x]??gs}#pe(e,t){let n=this.#de(e);n&&(this.#b={x:vs(this.#b.x,n.target.x,n.rate,t),y:vs(this.#b.y,n.target.y,n.rate,t)},this.#he())}#me(){this.#d===`awaiting`?(this.#b=this.#ge(this.#F.now()),this.#he()):(this.#d===`thinking`||this.#d===`idle`)&&this.#Oe()}#he(){this.#i&&fc(this.#i,Fs.cx,this.#b.x,this.#b.y,this.#l),this.#a&&fc(this.#a,Is.cx,this.#b.x,this.#b.y,this.#l)}#ge(e){if(this.#P!==null&&e-this.#P<Gs)return this.#N;this.#P=e;let t=this.getAttribute(`gaze-target`),n=t?this.ownerDocument.querySelector(t):null,r=this.#o?.getBoundingClientRect();if(!n||!r?.width||!r.height)return this.#N=gs,this.#N;let i=n.getBoundingClientRect();return this.#N={x:(i.left+i.width/2-r.left)*(200/r.width),y:(i.top+i.height/2-r.top)*(100/r.height)},this.#N}#_e(){return this.#d===`thinking`}#ve(){let e=this.#F.now(),t=this.#m,n=Ss(t),r=this.#B()*Ts(this.#D-e);this.#C=r,this.#l=Es(r);for(let[e,i]of[`l`,`r`].entries()){let a=e===0?Fs.cx:Is.cx;this.#ye(i,n),this.#be(i,a,r,t),this.#xe(i,a,t),this.#Ce(i)}}#ye(e,t){for(let n of this.#e.querySelectorAll(`.eye-body-${e} .socket, .eye-body-${e} .eye-outline, .eye-body-${e} .noise-clip`))Xs(n,`rx`,t)}#be(e,t,n,r){let i=this.#e.querySelector(`.pupil-${e} rect`);if(!i)return;Xs(i,`x`,t-n),Xs(i,`y`,50-n),Xs(i,`width`,n*2),Xs(i,`height`,n*2),Xs(i,`rx`,Cs(n,r));let a=this.#e.querySelector(`.pupil-${e} circle`);Xs(a,`cx`,t-n*.3),Xs(a,`cy`,50-n*.35),Xs(a,`r`,n*.4)}#xe(e,t,n){let r=this.#e.querySelector(`.eye-${e} .lid-clip`);if(!r)return;let i=Ds(this.#_),a=Os(this.#v);Xs(r,`y`,i),Xs(r,`height`,Math.max(0,a-i)),this.#Se(`.eye-${e} .lid-top`,t,i,n,this.#_),this.#Se(`.eye-${e} .lid-bottom`,t,a,n,this.#v)}#Se(e,t,n,r,i){let a=this.#e.querySelector(e);if(!a)return;let o=ks(n,r);Xs(a,`x1`,t-o),Xs(a,`x2`,t+o),Xs(a,`y1`,n),Xs(a,`y2`,n),Ys(a,`display`,i>.02?`inline`:`none`)}#Ce(e){let t=this.#e.querySelector(`.brow-${e}`);if(!t)return;let n=this.#_e(),r=e===`l`?this.#y.left:this.#y.right;Ys(t,`opacity`,n?`1`:`0`),t.style.transform=n?`translateY(${r.raise.toFixed(2)}px) rotate(${r.tilt.toFixed(2)}deg)`:`translateY(6px)`}#we(){if(this.#De(),this.#s.length===0&&this.#Te(),this.#r?.matches){this.#Ee(null);return}this.#Ee(uc()),this.#c=window.setInterval(()=>{this.#Ee(uc())},1e3/Rs)}#Te(){let e=this.#o?.getBoundingClientRect(),t=e?Math.min(e.width/200,e.height/100):0,n=Ls/(t>0?t:.25);this.#s=[...this.#e.querySelectorAll(`.noise`)].map((e,t)=>{let r=t===0?Fs.cx:Is.cx,i=[],a=r-Fs.r,o=r+Fs.r,s=50-Fs.r,c=50+Fs.r;for(let e=s;e<c;e+=n)for(let t=a;t<o;t+=n){let r=z(`rect`,{x:t,y:e,width:Math.min(n,o-t),height:Math.min(n,c-e),opacity:zs});i.push(r)}return e.replaceChildren(...i),i})}#Ee(e){this.#s.forEach((t,n)=>{let r=e===null?cc(n):lc(n,e),i=r===0?Vs:r;(t[0]?.parentElement)?.setAttribute(`data-seed`,String(i));for(let e of t){i=sc(i);let t=`${Bs[i%Bs.length]*100}%`;e.setAttribute(`fill`,`rgb(${t} ${t} ${t})`)}})}#De(){this.#c!==null&&(window.clearInterval(this.#c),this.#c=null)}#Oe(){this.#i?.setAttribute(`transform`,`translate(0,0)`),this.#a?.setAttribute(`transform`,`translate(0,0)`)}#ke(e){if(!this.#o||!this.#i||!this.#a)return;let t=this.#o.getBoundingClientRect();!t.width||!t.height||(this.#b={x:(e.clientX-t.left)*(200/t.width),y:(e.clientY-t.top)*(100/t.height)},this.#he())}});var mc=M(`
|
|
4865
|
+
`);function R(e,t,...n){let r=document.createElementNS(Fs,e);for(let[e,n]of Object.entries(t))r.setAttribute(e,String(n));return r.append(...n),r}function Xs(e,t,n){e&&e.getAttribute(t)!==n&&e.setAttribute(t,n)}function z(e,t,n){Xs(e,t,n.toFixed(2))}function Zs(e,t){let n=e.replace(`#`,``),r=n.length===3?[...n].map(e=>`${e}${e}`).join(``):n,i=Number.parseInt(r,16);if(!Number.isFinite(i))return e;let a=t<0?0:255,o=e=>Math.round(e+(a-e)*Math.abs(t)).toString(16).padStart(2,`0`);return`#${o(i>>16&255)}${o(i>>8&255)}${o(i&255)}`}function Qs(e,t,n){let r=[[`path`,{d:`M108.22,414.88l189.84,460.03c1.36,3.3,6.09,3.16,7.25-.22l159.34-463.34c.87-2.53-1.03-5.16-3.7-5.13l-349.18,3.32c-2.74.03-4.59,2.82-3.55,5.35Z`,fill:e,stroke:t,"stroke-linejoin":`round`,"stroke-width":20}],[`path`,{d:`M261.93,482.48h0c15.03-15.03,4.46-40.72-16.79-40.83h0c-21.37-.11-32.14,25.72-17.03,40.83h0c9.34,9.34,24.48,9.34,33.82,0Z`,fill:n}],[`path`,{d:`M384.85,527.49l-51.82,51.82c-2.24,2.24-2.24,5.86,0,8.1l55.71,55.71c2.24,2.24,5.86,2.24,8.1,0h0c.62-.62,1.08-1.36,1.37-2.19l26.52-77.11c.71-2.07.18-4.36-1.37-5.91l-30.41-30.41c-2.24-2.24-5.86-2.24-8.1,0Z`,fill:n}],[`path`,{d:`M371.7,684.58l-25.94,25.94c-2.24,2.24-2.24,5.86,0,8.1l12.67,12.67c2.99,2.99,8.09,1.82,9.46-2.19l13.28-38.61c1.97-5.74-5.17-10.2-9.46-5.91Z`,fill:n}],[`path`,{d:`M159.42,564.14l2.73,6.83c1.52,3.82,6.46,4.83,9.37,1.93l2.05-2.05c2.24-2.24,2.24-5.86,0-8.1l-4.78-4.78c-4.4-4.4-11.67.39-9.37,6.17Z`,fill:n}],[`path`,{d:`M243.92,633.11l-48.65-48.65c-5.24-5.24-13.74-5.24-18.99,0h0c-3.8,3.8-4.97,9.49-2.98,14.47l27.77,69.54c3.58,8.95,15.14,11.33,21.96,4.51l20.89-20.89c5.24-5.24,5.24-13.74,0-18.99Z`,fill:n}],[`path`,{d:`M211.32,533.1h0c14.11-14.11,14.11-36.98,0-51.08l-34.94-34.94c-.72-.72-.72-1.89,0-2.62h0c1.16-1.16.34-3.15-1.3-3.16l-11.23-.06c-25.62-.13-43.23,25.72-33.73,49.51l5.37,13.45c1.82,4.55,4.54,8.68,8,12.15l16.74,16.74c14.11,14.11,36.98,14.11,51.08,0Z`,fill:n}],[`path`,{d:`M263.74,792.53h0c-5.69,5.69-7.45,14.23-4.46,21.71l22.5,56.36c6.92,17.34,31.68,16.74,37.75-.92l8.66-25.2c2.5-7.28.64-15.35-4.8-20.79l-31.17-31.17c-7.87-7.87-20.62-7.87-28.48,0Z`,fill:n}],[`path`,{d:`M392.94,503.07l40.81-40.81c2.24-2.24,5.86-2.24,8.1,0l.06.06c2.24,2.24,2.24,5.86,0,8.1l-40.81,40.81c-2.24,2.24-2.24,5.86,0,8.1l22.48,22.48c2.99,2.99,8.09,1.82,9.46-2.19l30.71-89.32c1.27-3.71-1.47-7.57-5.39-7.59l-120.63-.6c-5.11-.03-7.69,6.16-4.08,9.77l51.18,51.18c2.24,2.24,5.86,2.24,8.1,0Z`,fill:n}]],i=[[274.59,463.59,84.73,95.66,42.36,`translate(-268.79 373.91) rotate(-45)`],[291.06,603.84,72.24,90.24,36.12,`translate(-363.06 421.43) rotate(-45)`],[217.18,527.25,72.24,95.66,36.12,`translate(-332.45 347.55) rotate(-45)`],[236.26,661.25,67.04,90.24,33.52,`translate(-420.46 397.65) rotate(-45)`]],a=r.map(([e,t])=>R(e,t));return a.push(...i.map(([e,t,r,i,a,o])=>R(`rect`,{x:e,y:t,width:r,height:i,rx:a,ry:a,transform:o,fill:n})),R(`ellipse`,{cx:288.37,cy:404.38,rx:182.34,ry:67.01,fill:e,stroke:t,"stroke-miterlimit":10,"stroke-width":20})),a}function $s(e,t){return[R(`path`,{d:`M566.75,340.67c0-29.85-12.97-56.87-33.96-76.47,4.8-9.98,7.44-20.71,7.44-31.9,0-38.29-30.62-71.33-74.92-86.77.33-3.07.51-6.17.51-9.3,0-69.72-84.29-126.24-188.26-126.24s-188.26,56.52-188.26,126.24c0,4,.29,7.95.83,11.86-34.94,15.4-58.48,44.25-58.48,77.34,0,18.21,7.15,34.25,19.39,49.26-25.1,19.88-41.05,49.47-41.05,82.54,0,59.85,52.15,108.37,116.49,108.37,10.83,0,21.3-1.4,31.26-3.98,31.42,41.91,83.55,69.34,142.55,69.34,64.73,0,121.2-33,151.11-81.94,63.8-.57,115.34-48.85,115.34-108.34Z`,fill:e,stroke:t,"stroke-width":20})]}function ec(e,t,n,r){return R(`rect`,{x:e-t,y:50-t,width:t*2,height:t*2,rx:n,...r})}function tc(e,t,n,r){return R(`g`,{class:`pupil pupil-${t}`},ec(e,n,ws(n,r),{fill:`#000`}),R(`circle`,{cx:e-n*.3,cy:50-n*.35,r:n*.4,fill:`#fff`}))}function nc(e,t){return R(`line`,{class:`lid-line lid-${t}`,x1:e-38,y1:50,x2:e+38,y2:50,stroke:`#000`,"stroke-width":4,"stroke-linecap":`round`,display:`none`})}function rc(e,t){let n=R(`line`,{class:`brow brow-${t}`,x1:e-22,y1:2,x2:e+22,y2:2,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`,opacity:0});return n.style.transformBox=`fill-box`,n.style.transformOrigin=`center`,n}function ic(e){return j(`span`,{class:`eyes`,style:`top:${e.eyes.top}%;left:${e.eyes.left}%;width:${e.eyes.width}%;height:${e.eyes.height}%`})}function ac(e,t,n){let r=R(`g`,{class:`${n} eye-${t}`});return r.style.transformOrigin=`${e}px 50px`,r}function oc(e,t,n){let r=`slicc-agent-avatar-noise-${t}`;return R(`g`,{class:`eye-static eye-body-${t}`},R(`defs`,{},R(`clipPath`,{id:r},ec(e,38,n,{class:`noise-clip`}))),ec(e,38,n,{class:`socket`,fill:`#fff`}),R(`g`,{class:`noise noise-${t}`,"clip-path":`url(#${r})`,"data-cell-size":Rs}),ec(e,38,n,{class:`eye-outline`,fill:`none`,stroke:`#000`,"stroke-width":4}))}function sc(e){return e^=e<<13,e^=e>>>17,e^=e<<5,e>>>0}function cc(e){return(Hs^Math.imul(e,Ws))>>>0}function lc(e,t){return(cc(e)^Math.imul(t,Us))>>>0}function uc(){return Math.floor((Date.now()-Gs)/1e3*zs)>>>0}function dc(e){return[R(`circle`,{cx:e,cy:50,r:38,fill:`#fff`,stroke:`#000`,"stroke-width":4}),R(`line`,{x1:e-15,y1:35,x2:e+15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`}),R(`line`,{x1:e+15,y1:35,x2:e-15,y2:65,stroke:`#000`,"stroke-width":8,"stroke-linecap":`round`})]}function fc(e,t,n,r,i){let a=n-t,o=r-50,s=Math.hypot(a,o),c=Math.min(s,i),l=s>0?a/s*c:0,u=s>0?o/s*c:0;e.setAttribute(`transform`,`translate(${l.toFixed(2)},${u.toFixed(2)})`)}var pc={now:()=>performance.now(),requestFrame:e=>window.requestAnimationFrame(e),cancelFrame:e=>window.cancelAnimationFrame(e),delay:(e,t)=>window.setTimeout(e,t),cancelDelay:e=>window.clearTimeout(e),repeat:(e,t)=>window.setInterval(e,t),cancelRepeat:e=>window.clearInterval(e)};A(`slicc-agent-avatar`,class extends HTMLElement{static observedAttributes=[`type`,`color`,`eyes`,`fill`,`connection`,`activity`,`gaze-target`,`drowse-delay`];#e;#t=e=>this.#ke(e);#n=()=>{this.#V(),this.#q(),this.#U()===`static`&&this.#we()};#r=null;#i=null;#a=null;#o=null;#s=[];#c=null;#l=16;#u=!1;#d=null;#f=!1;#p=!1;#m=0;#h=0;#g=!1;#_=0;#v=0;#y=ds;#b={x:100,y:50};#x=0;#S=0;#C=18;#w=null;#T=0;#E=0;#D=0;#O=null;#k=0;#A=[];#j=null;#M=[];#N=_s;#P=null;#F=pc;constructor(){super(),this.#e=this.attachShadow({mode:`open`}),this.#e.adoptedStyleSheets=[Ys]}connectedCallback(){this.#r=window.matchMedia(`(prefers-reduced-motion: reduce)`),this.#r.addEventListener(`change`,this.#n),this.#L(),this.#V(),this.#q()}disconnectedCallback(){this.#H(),this.#De(),this.#Q(),this.#r?.removeEventListener(`change`,this.#n),this.#r=null,this.#p=!1}attributeChangedCallback(e){if(this.isConnected){if(e===`activity`||e===`gaze-target`||e===`drowse-delay`){this.#K();return}this.#L(),this.#V(),this.#q()}}get activity(){return bs(this.getAttribute(`activity`))}set activity(e){e===null?this.removeAttribute(`activity`):this.setAttribute(`activity`,e)}get gazeTarget(){return this.getAttribute(`gaze-target`)}set gazeTarget(e){e===null?this.removeAttribute(`gaze-target`):this.setAttribute(`gaze-target`,e)}get drowseDelay(){return xs(this.getAttribute(`drowse-delay`))}set drowseDelay(e){this.setAttribute(`drowse-delay`,String(e))}get clock(){return this.#F}set clock(e){if(e===this.#F)return;this.#Q(),this.#F=e;let t=e.now();this.#k=t,this.#w!==null&&(this.#w=t),this.#T=0,this.#E=0,this.#D=0,this.#P=null,this.isConnected&&this.#q()}get expression(){return Object.freeze({activity:this.#d,shape:this.#m,lidTop:this.#_,lidBottom:this.#v,pupilRadius:this.#C,gaze:{...this.#b},brows:this.#y,browsVisible:this.#_e()})}wake(){let e=this.#F.now();this.#w=e,this.#W()||(this.#D=e+350,this.#ce()),this.#Y()}scrutinize(){this.#E=this.#F.now()+ss,this.#Y()}glower(){this.#T=this.#F.now()+as,this.#Y()}resetExpression(){this.#se();let e=this.#F.now();this.#T=0,this.#E=0,this.#D=0,this.#_=0,this.#v=0,this.#y=ds,this.#N=_s,this.#P=null,this.#S=0,this.#w=this.#d===`awaiting`?e:null,this.#g=!1,this.#h=Ss(this.#d),this.#m=this.#h,this.#k=e,this.#I()&&this.isConnected&&(this.#ve(),this.#q())}#I(){return this.hasAttribute(`activity`)||this.#f}#L(){this.#De(),this.#s=[];let e=this.getAttribute(`type`)===`cone`?`cone`:`scoop`,t=qs[e],n=this.getAttribute(`color`)??Js[e],r=this.#I();this.#d=bs(this.getAttribute(`activity`)),this.#d===`awaiting`&&this.#w===null&&(this.#w=this.#F.now()),this.#p||=(this.#m=this.#h=Ss(this.#d),!0);let i=R(`svg`,{class:`glyph`,viewBox:t.vb,preserveAspectRatio:`xMidYMid meet`,style:`--g:${t.glyph}%`},...e===`cone`?Qs(n,Zs(n,-.38),Zs(n,.3)):$s(n,Zs(n,-.32)));this.#o=R(`svg`,{class:`eyes-svg`,viewBox:`0 0 200 100`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},...this.#R(r));let a=ic(t);a.append(this.#o);let o=`--tx:${((.5-t.zoom*((t.eyes.left+t.eyes.width/2)/100))*100).toFixed(2)}%;--ty:${((.5-t.zoom*((t.eyes.top+t.eyes.height/2)/100))*100).toFixed(2)}%;--zoom:${t.zoom}`,s=j(`span`,{class:`icon-inner`,style:o},i,a),c=this.#z(r),l=null;if(c){let e=ic(t);e.append(c),l=j(`span`,{class:`icon-inner brow-layer`,style:o},e)}this.#e.replaceChildren(j(`span`,{class:`avatar`,"aria-hidden":`true`,"data-expressive":r||null},j(`span`,{class:`crop`},s),l)),this.#i=this.#e.querySelector(`.pupil-l`),this.#a=this.#e.querySelector(`.pupil-r`),this.#U()===`static`&&this.#we(),r&&this.#ve()}#R(e){let t=this.#U();if(t===`none`)return[];if(t===`dead`)return[...dc(Is.cx),...dc(Ls.cx)];this.#C=this.#B(),this.#l=Ds(this.#C);let n=Cs(this.#m);return[Is.cx,Ls.cx].map((r,i)=>{let a=i===0?`l`:`r`,o=t===`static`,s=ac(r,a,o?`eye-frozen`:`eye-blink`),c=o?oc(r,a,n):R(`g`,{class:`eye-body eye-body-${a}`},ec(r,38,n,{class:`socket`,fill:`#fff`,stroke:`#000`,"stroke-width":4}),tc(r,a,this.#C,this.#m));if(s.append(c),!e)return s;let l=`slicc-agent-avatar-lid-${a}`;return s.append(R(`defs`,{},R(`clipPath`,{id:l},R(`rect`,{class:`lid-clip`,x:r-38-3,y:9,width:82,height:82}))),nc(r,`top`),nc(r,`bottom`)),c.setAttribute(`clip-path`,`url(#${l})`),s})}#z(e){let t=this.#U();return!e||t===`none`||t===`dead`?null:R(`svg`,{class:`brows-svg`,viewBox:`0 0 200 100`,width:`100%`,height:`100%`,preserveAspectRatio:`xMidYMid meet`},...[Is.cx,Ls.cx].map((e,t)=>{let n=t===0?`l`:`r`,r=R(`g`,{class:`brow-group brow-group-${n}`});return r.style.transformBox=`view-box`,r.style.transformOrigin=`${e}px 50px`,r.append(rc(e,n)),r}))}#B(){return 18*Ts(Math.max(0,Math.min(100,Number.parseFloat(this.getAttribute(`fill`)??`0`)||0)))}#V(){let e=this.#U()===`open`&&!this.#r?.matches&&(this.#d===null||this.#d===`working`);e&&!this.#u?(this.ownerDocument.addEventListener(`pointermove`,this.#t),this.#u=!0):e||(this.#H(),(this.#d===null||this.#d===`working`)&&this.#Oe())}#H(){this.#u&&=(this.ownerDocument.removeEventListener(`pointermove`,this.#t),!1)}#U(){let e=this.getAttribute(`connection`);if(e!==null&&e!==`connected`)return`static`;let t=this.getAttribute(`eyes`);return t===`dead`||t===`none`||t===`static`?t:`open`}#W(){return this.#r?.matches===!0||this.#U()!==`open`||!this.isConnected||!this.#p}#G(){return this.#U()!==`open`}#K(){let e=bs(this.getAttribute(`activity`)),t=this.#e.querySelector(`.avatar[data-expressive]`)!==null;e===`awaiting`&&this.#d!==`awaiting`?this.#w=this.#F.now():e!==`awaiting`&&(this.#w=null),this.#P=null,this.#d=e,this.#I()!==t&&this.#L(),this.#V(),this.#q()}#q(){if(!this.#I()||!this.isConnected){this.#Q();return}if(this.#G()||this.#r?.matches){this.#Z(),this.#J(),this.#te();return}this.#ue(),this.#X()}#J(){for(let e of this.#M)this.#F.cancelRepeat(e);this.#M=[]}#Y(){this.#I()||(this.#f=!0,this.isConnected&&this.#L()),this.#q()}#X(){this.#O===null&&(this.#k=this.#F.now(),this.#O=this.#F.requestFrame(this.#$))}#Z(){this.#O!==null&&(this.#F.cancelFrame(this.#O),this.#O=null)}#Q(){this.#Z();for(let e of this.#A)this.#F.cancelDelay(e);this.#A=[],this.#j!==null&&this.#F.cancelDelay(this.#j),this.#j=null;for(let e of this.#M)this.#F.cancelRepeat(e);this.#M=[]}#$=e=>{this.#O=this.#F.requestFrame(this.#$);let t=Math.min(.05,Math.max(0,(e-this.#k)/1e3));this.#k=e,this.#ee(e,t),this.#ve()};#ee(e,t){let n=Ss(this.#d);n!==this.#h&&!this.#g&&this.#ae(n),this.#m=ys(this.#m,this.#h,6,t),this.#_=ys(this.#_,this.#re(e,!1),5,t),this.#v=ys(this.#v,this.#ie(e),5,t),this.#pe(e,t)}#te(){let e=this.#F.now();this.#G()||(this.#h=this.#m=Ss(this.#d),this.#_=this.#re(e,!0),this.#v=this.#ie(e),this.#me()),this.#ve(),this.#ne(e)}#ne(e){if(this.#j!==null&&this.#F.cancelDelay(this.#j),this.#j=null,this.#G())return;let t=this.#d===`awaiting`&&this.#w!==null?this.#w+this.drowseDelay*1e3:1/0,n=Math.min(this.#T>e?this.#T:1/0,this.#E>e?this.#E:1/0,t>e?t:1/0);Number.isFinite(n)&&(this.#j=this.#F.delay(()=>this.#te(),Math.max(0,n-e)+1))}#re(e,t){let n=this.#T>e?is:0;if(this.#d!==`awaiting`)return n;let r=this.#w===null?0:(e-this.#w)/1e3,i=this.drowseDelay;return Math.max(n,js(t&&r>i?i+12:r,i))}#ie(e){return this.#E>e?os:0}#ae(e){if(this.#W()){this.#h=this.#m=e;return}this.#g=!0,this.#ce(()=>{this.#h=this.#m=e,this.#g=!1})}#oe(){return[...this.#e.querySelectorAll(`.eye-blink`)]}#se(){for(let e of this.#A)this.#F.cancelDelay(e);this.#A=[];for(let e of this.#oe())e.style.transition=`none`,e.style.transform=`scaleY(1)`}#ce(e){let t=this.#oe();if(t.length===0){e?.();return}t.forEach((t,n)=>{this.#le(t,n===0?e:void 0)})}#le(e,t){e.style.transition=`transform 110ms ease-in`,e.style.transform=`scaleY(${ts})`,this.#A.push(this.#F.delay(()=>{t?.(),this.#d===`thinking`&&!this.#G()&&(this.#y=Ns(this.#y)),e.style.transition=`transform 130ms ease-out`,e.style.transform=`scaleY(1)`},120))}#ue(){this.#M.length>0||this.#W()||this.#G()||[ns,rs].forEach((e,t)=>{this.#M.push(this.#F.repeat(()=>{let e=this.#oe()[t];e&&this.hasAttribute(`blink`)&&!this.#G()&&this.#le(e)},e))})}#de(e){return this.#d===`thinking`?{target:this.#fe(e,fs,ps),rate:9}:this.#d===`idle`?{target:this.#fe(e,ms,hs),rate:gs}:this.#d===`awaiting`?{target:this.#ge(e),rate:6}:null}#fe(e,t,n){return e-this.#S>n&&(this.#S=e,this.#x=Ps(this.#x,t.length,Math.random)),t[this.#x]??_s}#pe(e,t){let n=this.#de(e);n&&(this.#b={x:ys(this.#b.x,n.target.x,n.rate,t),y:ys(this.#b.y,n.target.y,n.rate,t)},this.#he())}#me(){this.#d===`awaiting`?(this.#b=this.#ge(this.#F.now()),this.#he()):(this.#d===`thinking`||this.#d===`idle`)&&this.#Oe()}#he(){this.#i&&fc(this.#i,Is.cx,this.#b.x,this.#b.y,this.#l),this.#a&&fc(this.#a,Ls.cx,this.#b.x,this.#b.y,this.#l)}#ge(e){if(this.#P!==null&&e-this.#P<Ks)return this.#N;this.#P=e;let t=this.getAttribute(`gaze-target`),n=t?this.ownerDocument.querySelector(t):null,r=this.#o?.getBoundingClientRect();if(!n||!r?.width||!r.height)return this.#N=_s,this.#N;let i=n.getBoundingClientRect();return this.#N={x:(i.left+i.width/2-r.left)*(200/r.width),y:(i.top+i.height/2-r.top)*(100/r.height)},this.#N}#_e(){return this.#d===`thinking`}#ve(){let e=this.#F.now(),t=this.#m,n=Cs(t),r=this.#B()*Es(this.#D-e);this.#C=r,this.#l=Ds(r);for(let[e,i]of[`l`,`r`].entries()){let a=e===0?Is.cx:Ls.cx;this.#ye(i,n),this.#be(i,a,r,t),this.#xe(i,a,t),this.#Ce(i)}}#ye(e,t){for(let n of this.#e.querySelectorAll(`.eye-body-${e} .socket, .eye-body-${e} .eye-outline, .eye-body-${e} .noise-clip`))z(n,`rx`,t)}#be(e,t,n,r){let i=this.#e.querySelector(`.pupil-${e} rect`);if(!i)return;z(i,`x`,t-n),z(i,`y`,50-n),z(i,`width`,n*2),z(i,`height`,n*2),z(i,`rx`,ws(n,r));let a=this.#e.querySelector(`.pupil-${e} circle`);z(a,`cx`,t-n*.3),z(a,`cy`,50-n*.35),z(a,`r`,n*.4)}#xe(e,t,n){let r=this.#e.querySelector(`.eye-${e} .lid-clip`);if(!r)return;let i=Os(this.#_),a=ks(this.#v);z(r,`y`,i),z(r,`height`,Math.max(0,a-i)),this.#Se(`.eye-${e} .lid-top`,t,i,n,this.#_),this.#Se(`.eye-${e} .lid-bottom`,t,a,n,this.#v)}#Se(e,t,n,r,i){let a=this.#e.querySelector(e);if(!a)return;let o=As(n,r);z(a,`x1`,t-o),z(a,`x2`,t+o),z(a,`y1`,n),z(a,`y2`,n),Xs(a,`display`,i>.02?`inline`:`none`)}#Ce(e){let t=this.#e.querySelector(`.brow-${e}`);if(!t)return;let n=this.#_e(),r=e===`l`?this.#y.left:this.#y.right;Xs(t,`opacity`,n?`1`:`0`),t.style.transform=n?`translateY(${r.raise.toFixed(2)}px) rotate(${r.tilt.toFixed(2)}deg)`:`translateY(6px)`}#we(){if(this.#De(),this.#s.length===0&&this.#Te(),this.#r?.matches){this.#Ee(null);return}this.#Ee(uc()),this.#c=window.setInterval(()=>{this.#Ee(uc())},1e3/zs)}#Te(){let e=this.#o?.getBoundingClientRect(),t=e?Math.min(e.width/200,e.height/100):0,n=Rs/(t>0?t:.25);this.#s=[...this.#e.querySelectorAll(`.noise`)].map((e,t)=>{let r=t===0?Is.cx:Ls.cx,i=[],a=r-Is.r,o=r+Is.r,s=50-Is.r,c=50+Is.r;for(let e=s;e<c;e+=n)for(let t=a;t<o;t+=n){let r=R(`rect`,{x:t,y:e,width:Math.min(n,o-t),height:Math.min(n,c-e),opacity:Bs});i.push(r)}return e.replaceChildren(...i),i})}#Ee(e){this.#s.forEach((t,n)=>{let r=e===null?cc(n):lc(n,e),i=r===0?Hs:r;(t[0]?.parentElement)?.setAttribute(`data-seed`,String(i));for(let e of t){i=sc(i);let t=`${Vs[i%Vs.length]*100}%`;e.setAttribute(`fill`,`rgb(${t} ${t} ${t})`)}})}#De(){this.#c!==null&&(window.clearInterval(this.#c),this.#c=null)}#Oe(){this.#i?.setAttribute(`transform`,`translate(0,0)`),this.#a?.setAttribute(`transform`,`translate(0,0)`)}#ke(e){if(!this.#o||!this.#i||!this.#a)return;let t=this.#o.getBoundingClientRect();!t.width||!t.height||(this.#b={x:(e.clientX-t.left)*(200/t.width),y:(e.clientY-t.top)*(100/t.height)},this.#he())}});var mc=M(`
|
|
4866
4866
|
:host{display:inline-block;}
|
|
4867
4867
|
.switcher-more{position:relative;}
|
|
4868
4868
|
.morebtn{display:none;font:inherit;font-size:13px;font-weight:600;color:var(--txt-2);background:transparent;border:1px solid var(--line);border-radius:9999px;height:var(--ctl-h,30px);padding:0 11px;cursor:pointer;line-height:1;align-items:center;}
|
|
@@ -6494,7 +6494,7 @@ slicc-dock-tree .dock-tree__preview--active {
|
|
|
6494
6494
|
}`}function ah(e){return`${rh}
|
|
6495
6495
|
@layer unsafe {
|
|
6496
6496
|
${e}
|
|
6497
|
-
}`}var oh=new WeakMap;function sh(e){let t=oh.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(cd,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),oh.set(e,i),i}function ch(e,t){if(!e.isConnected)return;let n=sh(t);if(n==null)return;let r=t.querySelector(`style[${ld}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(ld,``),t.appendChild(i)),i.textContent=`:host { ${ud}: ${n}px; }`}var lh;function uh(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){lh??(lh=new CSSStyleSheet,lh.replaceSync(ih(nh)));let t=!1;try{e.adoptedStyleSheets=[lh],t=!0}catch{}if(t){e.querySelector(`style[${od}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(od,``),t.textContent=ih(nh),e.prepend(t)}}function dh(e,t){fh(e,t),uh(t),ch(e,t)}function fh(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});dh(this,e)}}if(customElements.define(ad,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(ad)))e instanceof HTMLElement&&dh(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var ph=e=>e.startsWith(`f::`)?e.slice(3):e;function mh(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function hh(e,t){return e===``?t:`${e}/${t}`}function gh({files:e,path:t,isFolder:n,nextBasename:r}){let i=ph(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=mh(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=hh(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function _h(e){return e.endsWith(`/`)}function vh(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function yh(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function bh(e,t){return t.includes(e)?yh(t):[e]}function xh(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function Sh(e,t){return{draggedPaths:e,target:t}}function Ch(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(_h(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function wh(e,t){return t.kind===`root`||t.directoryPath==null?vh(e):t.directoryPath}function Th(e,t){let n=e.map(e=>{let n=wh(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function Eh(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Dh(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!Eh(Xm.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function Oh(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function kh(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function Ah(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function jh(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return Ah(e,t.path)?n?e:null:e;case`move`:return kh(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=jh(r,e,n),r==null)return null;return r}}}function Mh(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function Nh(e){switch(e.operation){case`add`:return{...Mh(e),operation:`add`,path:e.path};case`remove`:return{...Mh(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...Mh(e),from:e.from,operation:`move`,to:e.to}}}function Ph(e){return{...Mh(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>Nh(e)),operation:`batch`}}function Fh(e){switch(e.operation){case`add`:case`remove`:case`move`:return Nh(e);case`batch`:return Ph(e);default:return null}}function Ih(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Lh(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function Rh(e){return Lh(e).at(-1)??null}function zh(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function Bh(e){return e.endsWith(`/`)}var Vh=e=>e.toLowerCase();function Hh(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function Uh(e){return e.endsWith(`/`)?e.slice(0,-1):e}function Wh(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var Gh=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},Kh=Symbol(`FILE_TREE_RENAME_VIEW`),qh=512,Jh=512;function Yh(e){return e===`top`||e===`center`?e:`nearest`}function Xh(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=Lh(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function Zh(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:Xh(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var Qh=class e{static{Object.defineProperty(e.prototype,Kh,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=Dh({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=Rh(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:Yh(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=Jh){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=bh(t,n);return this.#r.canDrag?.(r)!==!1&&(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=Sh(t.draggedPaths,n);(Ch(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}xh(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=Sh(e.draggedPaths,t);if(Ch(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=Th(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=Bh(r),a=Uh(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of Lh(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=Hh(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,Bh(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,Bh(e)?{recursive:!0}:void 0);return}let t=Bh(e),n=gh({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:Uh(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(Wh(n.sourcePath,t),Wh(n.destinationPath,t))}#Y(e){this.#T!=null&&this.#E!==e&&(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=Dh({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!Ih(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=Rh(e),n=zh(e,t),r=null,i=null;for(let e of this.#be()){if(Rh(e)!==t)continue;let a=zh(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=Lh(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!Ih(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new Xm({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of Lh(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(Vh),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(Vh),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of Lh(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:Gh(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of Lh(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of Lh(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=Zh(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,qh)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s!==e||this.#c!==n)&&(this.#s=e,this.#c=n,t&&this.#De())}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=jh(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=jh(this.#c,e,!0),r=[...this.#B].map(t=>jh(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=jh(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return Ih(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&Oh(e)&&(this.#i=null);let t=Oh(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=Fh(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},$h=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function eg(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(e[t]!==`/`&&t!==e.length){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function tg(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function ng(e,t){return t?`${e}/`:e}function rg(e,t=null){let n=$h(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=ag(t);e!=null&&cg({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function ig(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=og(e);t!=null&&(c=sg({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=ag(e);t!=null&&(c=cg({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:dg(i),statusByPath:i}:e}function ag(e){return og(e.path)}function og(e){let t=eg(e);if(t!=null)return{canonicalPath:ng(t.path,t.isDirectory),isDirectory:t.isDirectory}}function sg({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),ug(t,n,e),!0)}function cg({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??lg(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function lg(e,t,n){for(let r of tg(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function ug(e,t,n){for(let r of tg(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function dg(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var J,fg,pg,mg,hg,gg,_g,vg,yg,bg,xg={},Sg=[],Cg=Array.isArray,wg=Sg.slice,Tg=Object.assign;function Eg(e){e&&e.parentNode&&e.remove()}function Dg(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?wg.call(arguments,2):n),Og(e,o,r,i,null)}function Og(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++fg,__i:-1,__u:0};return i==null&&J.vnode!=null&&J.vnode(a),a}function kg(e){return e.children}function Ag(e,t){this.props=e,this.context=t,this.__g=0}function jg(e,t){if(t==null)return e.__?jg(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?jg(e):null}function Mg(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return Mg(e)}}function Ng(e){(8&e.__g||!(e.__g|=8)||!pg.push(e)||hg++)&&mg==J.debounceRendering||((mg=J.debounceRendering)||queueMicrotask)(Pg)}function Pg(){for(var e,t,n,r,i,a,o,s,c=1;pg.length;)pg.length>c&&pg.sort(gg),e=pg.shift(),c=pg.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=Tg({},r)).__v=r.__v+1,J.vnode&&J.vnode(n),Hg(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??jg(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,Wg(a,n,o),n.__e!=i&&Mg(n)));hg=0}function Fg(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||Sg,b=t.length;for(c=Ig(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?xg:y[m.__i]||xg,m.__i=f,_=Hg(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&qg(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=Lg(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function Ig(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?Og(null,o,null,null,null):Cg(o)?Og(kg,{children:o},null,null,null):o.constructor==null&&o.__b>0?Og(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=Rg(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=jg(s)),Jg(s,s));return r}function Lg(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Lg(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=jg(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Rg(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function zg(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function Bg(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||zg(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||zg(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(_g,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=vg,e.addEventListener(t,a?bg:yg,a)):e.removeEventListener(t,a?bg:yg,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function Vg(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=vg++;else if(t.u<n.l)return;return n(J.event?J.event(t):t)}}}function Hg(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,ee,te,w,T,E,ne,re,ie,D=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=J.__b)&&d(t);n:if(typeof D==`function`)try{if(v=t.props,y=`prototype`in D&&D.prototype.render,b=(d=D.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new D(v,x):(t.__c=f=new Ag(v,x),f.constructor=D,f.render=Yg),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&D.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Tg({},f.__s)),Tg(f.__s,D.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&D.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&D.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=J.__r,ee=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),te=0;te<f._sb.length;te++)f.__h.push(f._sb[te]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++ee<25);f.state=f.__s,f.getChildContext!=null&&(r=Tg({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),w=d,d!=null&&d.type===kg&&d.key==null&&(w=Gg(d.props.children)),s=Fg(e,Cg(w)?w:[w],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(T=0,E=!1,t.__u|=c?160:128,t.__c.__z=[],ne=0;ne<a.length;ne++)(re=a[ne])==null||E||(re.nodeType==8&&re.data==`$s`?(T>0&&t.__c.__z.push(re),T++,a[ne]=null):re.nodeType==8&&re.data==`/$s`?(--T>0&&t.__c.__z.push(re),E=T===0,s=a[ne],a[ne]=null):T>0&&(t.__c.__z.push(re),a[ne]=null));if(!E){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(ie=a.length;ie--;)Eg(a[ie]);Ug(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Ug(t);J.__e(e,t,n)}else s=t.__e=Kg(n.__e,t,n,r,i,a,o,c,l,u);return(d=J.diffed)&&d(t),128&t.__u?void 0:s}function Ug(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(Ug)}function Wg(e,t,n){for(var r=0;r<n.length;r++)qg(n[r],n[++r],n[++r]);J.__c&&J.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){J.__e(e,t.__v)}})}function Gg(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:Cg(e)?e.map(Gg):Tg({},e)}function Kg(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(J.__m&&J.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=wg.call(e.childNodes),v=n.props||xg,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;Bg(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||Bg(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),Fg(b==`template`?e.content:e,Cg(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&jg(n,0),s,c,l),a!=null)for(u=a.length;u--;)Eg(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||Bg(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&Bg(e,u,g,v[u],i))}return e}function qg(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){J.__e(e,n)}}function Jg(e,t,n){var r,i;if(J.unmount&&J.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||qg(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){J.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Jg(r[i],t,n||typeof e.type!=`function`);n||Eg(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function Yg(e,t,n){return this.constructor(e,n)}function Xg(e,t){var n,r,i,a;t==document&&(t=document.documentElement),J.__&&J.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=Dg(kg,null,[e]),i=[],a=[],Hg(t,e,r||xg,xg,t.namespaceURI,r?null:t.firstChild?wg.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),Wg(i,e,a)}function Zg(e,t){e.__u|=32,Xg(e,t)}J={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw hg=0,e}},fg=0,Ag.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Tg({},this.state);typeof e==`function`&&(e=e(Tg({},n),this.props)),e&&Tg(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ng(this))},Ag.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),Ng(this))},Ag.prototype.render=kg,pg=[],hg=0,gg=function(e,t){return e.__v.__b-t.__v.__b},_g=/(PointerCapture)$|Capture$/i,vg=0,yg=Vg(!1),bg=Vg(!0);var Qg=0;Array.isArray;function Y(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Qg,__i:-1,__u:0,__source:i,__self:a};return J.vnode&&J.vnode(l),l}var $g=16,e_=16,t_={};function n_({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=t_[e]??{width:$g,height:e_},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return Y(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:Y(`use`,{href:c})})}var r_=e=>e!==void 0&&/\s/.test(e),i_=(e,t)=>{let n=t=>r_(e[t-1])||r_(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},a_=e=>i_(e,Math.ceil(e.length/2)),o_=e=>{if(e.length<2)return[e,``];let t=a_(e);return[e.slice(0,t),e.slice(t)]},s_=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:a_(e);return[e.slice(0,r),e.slice(r)]},c_=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},l_=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},u_=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},d_=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function f_({children:e,marker:t,variant:n=`default`}){"use no memo";return Y(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:Y(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?Y(`span`,{"data-truncate-fade":!0}):t})})}function p_(e){"use no memo";let{mode:t,children:n}=e;return Y(`div`,{children:[Y(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?Y(`span`,{children:n}):n}),Y(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?Y(`span`,{children:n}):n})]})}function m_({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=Y(p_,{mode:t,children:e},`content`),o=Y(f_,{marker:n,mode:t,variant:r},`marker`),s=Y(`div`,{"data-truncate-fill":!0},`fill`);return Y(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:Y(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function h_({children:e,...t}){"use no memo";return Y(m_,{mode:`truncate`,...t,children:e})}function g_({children:e,...t}){"use no memo";return Y(m_,{mode:`fruncate`,...t,children:e})}function __({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=Y(h_,{...s,children:t[0]}),l=Y(g_,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return Y(`div`,{className:a,style:o});if(e.length<i)return Y(n===`end`?g_:h_,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=o_:r===`extension`?t=s_:r===`leaf-path`&&(t=c_);else if(typeof r==`number`)t=l_,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=u_:e===`first`&&(t=d_)}else typeof r==`function`&&(t=r);t??=o_;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=Y(h_,{...s,..._,children:f}),l=Y(g_,{...s,...v,children:p})}return Y(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[Y(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),Y(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var v_={endIndex:-1,startIndex:-1};function y_(e,t,n){return Math.min(Math.max(e,t),n)}function b_(e,t){return e<0||t<e?v_:{endIndex:t,startIndex:e}}function x_(e){return e.startIndex<0||e.endIndex<e.startIndex}function S_(e,t){return x_(e)?0:(e.endIndex-e.startIndex+1)*t}function C_(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function w_(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function T_(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function E_(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function D_(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function O_(e,t,n){if(e.length===0||t<=0)return[];let r=D_(e),i=T_(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=E_(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function k_(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=y_(t.scrollTop,0,o),c=t.stickyRows??O_(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=C_(s,n,t.itemHeight),m=C_(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?v_:b_(m,w_(u+d,n,t.itemHeight)),y=g+1,b=x_(v)?v_:b_(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=S_(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:x_(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var A_={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},j_={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},M_=`Contains git status items`;function N_(e){return e.current?!0:(e.current=!0,!1)}function P_(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function F_(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return P_({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function I_(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function L_(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function R_(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function z_(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function B_(e,t){return e!=null&&e>0?e:t}function V_(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function H_(e,t,n,r,i=0){let a=P_({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function U_(e,t,n,r,i,a,o=0){let s=F_({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function W_(e,t,n,r,i,a){let o=I_({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function G_(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function K_(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function q_({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return Y(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function J_(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function Y_(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var X_,X,Z_,Q_,$_=Object.is,ev=0,tv=[],Z=J,nv=Z.__b,rv=Z.__r,iv=Z.diffed,av=Z.__c,ov=Z.unmount,sv=Z.__;function cv(e,t){Z.__h&&Z.__h(X,e,ev||t),ev=0;var n=X.__H||(X.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function lv(e){return ev=1,uv(bv,e)}function uv(e,t,n){var r=cv(X_++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):bv(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);$_(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=X,!X.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,$_(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};X.__f=!0;var a=X.shouldComponentUpdate,o=X.componentWillUpdate;X.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},X.shouldComponentUpdate=i}return r.__N||r.__}function dv(e,t){var n=cv(X_++,3);!Z.__s&&yv(n.__H,t)&&(n.__=e,n.u=t,X.__H.__h.push(n))}function fv(e,t){var n=cv(X_++,4);!Z.__s&&yv(n.__H,t)&&(n.__=e,n.u=t,X.__h.push(n))}function Q(e){return ev=5,pv(function(){return{current:e}},[])}function pv(e,t){var n=cv(X_++,7);return yv(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function $(e,t){return ev=8,pv(function(){return e},t)}function mv(){for(var e;e=tv.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(_v),e.__H.__h.forEach(vv),e.__H.__h=[]}catch(t){e.__H.__h=[],Z.__e(t,e.__v)}}Z.__b=function(e){X=null,nv&&nv(e)},Z.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),sv&&sv(e,t)},Z.__r=function(e){rv&&rv(e),X_=0;var t=(X=e.__c).__H;t&&(Z_===X?(t.__h=[],X.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(_v),t.__h.forEach(vv),t.__h=[],X_=0)),Z_=X},Z.diffed=function(e){iv&&iv(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(tv.push(t)!==1&&Q_===Z.requestAnimationFrame||((Q_=Z.requestAnimationFrame)||gv)(mv)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Z_=X=null},Z.__c=function(e,t){t.some(function(e){try{e.__h.forEach(_v),e.__h=e.__h.filter(function(e){return!e.__||vv(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],Z.__e(n,e.__v)}}),av&&av(e,t)},Z.unmount=function(e){ov&&ov(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{_v(e)}catch(e){t=e}}),n.__H=void 0,t&&Z.__e(t,n.__v))};var hv=typeof requestAnimationFrame==`function`;function gv(e){var t,n=function(){clearTimeout(r),hv&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);hv&&(t=requestAnimationFrame(n))}function _v(e){var t=X,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),X=t}function vv(e){var t=X;e.__c=e.__(),X=t}function yv(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!$_(t,e[n])})}function bv(e,t){return typeof t==`function`?t(e):t}function xv(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:Y(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return Y(kg,{children:[Y(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:Y(h_,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function Sv(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function Cv(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function wv(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function Tv({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=k_(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:wv(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?wv(u,1,t,o):i&&r<=0&&c.length>0?O_(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var Ev=400,Dv=40,Ov=18;function kv(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?Av(e,t,n):a instanceof HTMLElement?a:null}function Av(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function jv(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function Mv(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function Nv(){return navigator.vendor!==`Apple Computer, Inc.`}function Pv(e,t){let n=e-t.top;if(n<Dv)return-Math.ceil((Dv-Math.max(0,n))/Dv*Ov);let r=t.bottom-e;return r<Dv?Math.ceil((Dv-Math.max(0,r))/Dv*Ov):0}function Fv(e,t){if(e!=null){let t=A_[e];return t==null?null:{text:t,title:j_[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:M_}:null}function Iv(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function Lv(e){return e!=null&&`toggle`in e}function Rv(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function zv(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function Bv(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function Vv(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function Hv(e,t){return t&&Vv(e)||(e.ctrlKey||e.metaKey)&&Rv(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var Uv=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function Wv(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function Gv(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function Kv(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function qv(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function Jv(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function Yv(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function Xv(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function Zv(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function Qv(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=Zv(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function $v(e,t){return{kind:e.kind,name:Cv(e),path:t}}function ey(e){return e==null?void 0:`${e}__tree`}function ty(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function ny(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function ry(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?Y(`span`,{title:e.title,children:e.text}):Y(`span`,{title:e.title,children:e.parts.map((e,t)=>Y(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?ny(e.icon)?t(e.icon):{name:e.icon}:ny(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return Y(`span`,{title:e.title,children:Y(n_,{...n})})}function iy(e){e!=null&&L_(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function ay(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=Sv(e);return Y(kg,{children:[e.depth>0?Y(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>Y(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,Y(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?Y(n_,{...t(`file-tree-icon-chevron`)}):Y(n_,{...t(`file-tree-icon-file`,u)})}),Y(`div`,{"data-item-section":`content`,children:e.isFlattened?xv(e,c,a):c??Y(__,{minimumLength:5,split:`extension`,children:e.name})}),i?Y(`div`,{"data-item-section":`decoration`,children:r==null?null:ry(r,t)}):null,s?Y(`div`,{"data-item-section":`git`,children:ry(o,t)}):null,n?Y(`div`,{"data-item-section":`action`,children:l?Y(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:Y(n_,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function oy(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:ee,contextMenuButtonVisibility:te,contextMenuRightClickEnabled:w,registerRenameInput:T,registerButton:E,resolveIcon:ne,renderDecorationForRow:re,openContextMenuForRow:ie,onRowClick:D,onKeyDown:ae}=e,O=Sv(t),{isParked:oe=!1,mode:se=`flow`,style:ce}=r,le=se===`sticky`,ue=_?.get(O)??null??Iv(t.ancestorPaths,v,y),de=t.kind===`directory`&&(b?.has(O)??!1),fe=re(t,O),pe=Fv(ue,de),me=S&&ee,k=fe!=null||x||me,he=me&&te===`always`,ge=a.getPath()===O,_e=ge?a.getValue():``,ve=le||!ge?null:Y(q_,{ref:T,ariaLabel:`Rename ${Cv(t)}`,isFlattened:t.isFlattened,value:_e,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ye=ay(t,ne,{actionLaneEnabled:me,customDecoration:fe,decorationLaneEnabled:k,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:pe,gitLaneActive:x,renameInput:ve,showDecorativeActionAffordance:he}),be={...J_({ariaLabel:Cv(t),domId:t.isFocused?ty(h,O,oe):void 0,extraStyle:ce,features:{actionLaneEnabled:me,contextMenuButtonVisibility:me?te:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:oe,itemHeight:g,mode:se,row:t,state:{containsGitChange:de,effectiveGitStatus:ue,isContextHovered:s===O,isDragTarget:l?.kind===`directory`&&l.directoryPath===O,isDragging:c?.has(O)===!0,isFocusRinged:t.isFocused&&o===O},targetPath:O}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),w&&(i.focusMountedPathFromInput(O),ie(t,O,{anchorRect:Kv(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:le?void 0:()=>{i.focusMountedPathFromInput(O)},onKeyDown:le?void 0:ae,ref:e=>{E(O,e)}};return!le&&ge?Y(`div`,{...be,children:ye}):Y(`button`,{...be,type:`button`,draggable:u&&!oe,onDragEnd:u&&!oe?p:void 0,onDragStart:u&&!oe?e=>{f(e,t,O)}:void 0,onMouseDown:e=>{if(le){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!oe?e=>{m(e,t,O)}:void 0,onClick:e=>{D(e,t,O,se)},children:ye})}function sy(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(Sv(e))).map((n,r)=>oy(e,n,t.start+r))}function cy({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=th,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=Q(null),v=Q(null),y=Q(!1),b=Q(null),x=Q(null),S=Q(null),C=Q(null),ee=Q(null),te=Q(new Map),w=Q(new Map),T=Q(()=>{}),E=Q(null),ne=Q(0),re=Q(!1),ie=Q(null);ie.current!==t&&(re.current=!1,ie.current=t);let D=Q(!1),ae=Q(null),O=Q(null),oe=Q(!1),se=Q(null),ce=Q(null),le=Q(null),ue=Q(null),de=Q(null),fe=Q(null),pe=Q(null),me=Q(null),k=Q(!1),he=Q(null),ge=Q(null),_e=Q(null),ve=Q(null),ye=pv(()=>new Map,[]),[,be]=lv(0),xe=Q(!1),[Se,Ce]=lv(null),[A,we]=lv(null),[j,M]=lv(null),[Te,Ee]=lv(null),[De,Oe]=lv(0),[N,ke]=lv(null),Ae=Q(N);Ae.current=N;let je=Q(null),Me=Q(null),Ne=Q(null),Pe=Q(null),Fe=Q(null),Ie=Q(!1),Le=()=>{Me.current=null,Ne.current=null,Pe.current=null},Re=(e,t)=>{Me.current=e,Ne.current=null,Pe.current=t==null?null:{path:e,scrollTop:t}},ze=(e,t)=>{Me.current=null,Ne.current={path:e,viewportOffset:t},Pe.current=null},Be=Q(d===`retain`&&t.isSearchOpen()),[Ve,He]=lv(p);dv(()=>{p||He(!1)},[p]);let Ue=Q(!1),We=$(()=>{Ue.current=!0,He(e=>e&&!1)},[]),[Ge,Ke]=lv(()=>Tv({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[qe,Je]=lv(!1);dv(()=>{Je(!0)},[]);let P=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Ye=e?.contextMenu?.triggerMode??(P?`right-click`:`both`),Xe=Ye===`both`||Ye===`button`,Ze=e?.contextMenu?.buttonVisibility??`when-needed`,Qe=Ye===`both`||Ye===`right-click`;fv(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Fe.current=t,we(t),Ee(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Ie.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let $e=$((e,t)=>{Jv(te.current,e,t)},[]),et=$((e,t)=>{Jv(w.current,e,t)},[]),tt=$(e=>{x.current=e},[]),nt=$(e=>Yv(e,w.current,te.current),[]),rt=n!=null||r!=null||i!=null,{resolveIcon:it}=pv(()=>bd(a),[a]),at=t[Kh](),ot=at.getPath(),st=ot!=null,ct=t.isSearchOpen(),lt=t.getSearchValue(),F=t.getFocusedPath(),I=t.getFocusedIndex(),ut=t.getScrollRequest(),dt=t.isDragAndDropEnabled(),ft=t.getDragSession(),pt=pv(()=>ft==null?null:new Set(ft.draggedPaths),[ft]),mt=ft?.target??null,ht=ft?.primaryPath??null,gt=ey(o),{overlayHeight:_t,overlayRows:vt,snapshot:L,visibleRows:yt}=Ge,R=L.physical.viewportHeight,bt=pv(()=>({end:L.window.endIndex,start:L.window.startIndex}),[L.window.endIndex,L.window.startIndex]),xt=vt,St=L.sticky.rows,Ct=L.physical.totalHeight,wt=L.sticky.height,Tt=pv(()=>new Set(St.map(e=>Sv(e.row))),[St]),Et=I>=0&&I>=bt.start&&I<=bt.end,Dt=$((e,t)=>u?.({item:$v(e,t),row:e})??null,[u]),Ot=$(e=>L_(e==null?null:te.current.get(e)??null)?!0:L_(S.current),[]),kt=$(e=>{Ot(t.focusNearestPath(e))},[t,Ot]),At=Q(kt);At.current=kt;let jt=Q(!0),Mt=Q(()=>{}),Nt=$((t=!0)=>{let n=Ae.current;n!=null&&(jt.current=jt.current&&t,ke(null),e?.contextMenu?.onClose?.(),jt.current&&kt(n.path))},[e?.contextMenu,kt]);Mt.current=Nt;let Pt=$(e=>{let t=e==null?null:qv(S.current,e);M(e=>e===t?e:t)},[]),Ft=$((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=nt(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Re(n,e?.scrollTop??null),D.current=!0,Ce(e=>e===n?e:n)}i.focus(),Pt(a),jt.current=!0,ke({anchorRect:r?.anchorRect??null,item:$v(e,n),path:n,source:r?.source??`keyboard`})},[t,nt,Pt]),It=$(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=z_(e,R);se.current=I<0||e==null?null:Math.max(0,Math.min(I*s-e.scrollTop,Math.max(0,t-s))),oe.current=!0}t.startRenaming(e)!==!1&&(Ee(`focus`),be(e=>e+1))}},[t,I,s,l,R]),Lt=$((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=z_(i,R),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:Tv({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return D.current=!0,W_(i,a,s,l,u,d),T.current(),je.current=n?e:null,!0},[t,s,c,R,h]),Rt=()=>y.current===!0||ve.current!=null||k.current===!0,zt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Bt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Vt=()=>{ue.current!=null&&(clearTimeout(ue.current),ue.current=null),le.current=null},Ht=()=>{fe.current?.remove(),fe.current=null},Ut=()=>{Bt(ce.current),ce.current=null,de.current=null},Wt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Gt=()=>{me.current?.(),me.current=null,ve.current!=null&&(clearTimeout(ve.current),ve.current=null),k.current=!1,he.current=null,_e.current=null,ge.current!=null&&(ge.current.setAttribute(`draggable`,`true`),ge.current.style.removeProperty(`touch-action`),ge.current=null),Ht(),Vt(),Ut(),pe.current=null},Kt=(e,n)=>{let r=S.current?.getRootNode(),i=jv(kv(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},qt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Vt();return}let r=t.getItem(e.directoryPath),i=Lv(r)?r:null;if(i==null||i.isExpanded()){Vt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;le.current!==a&&(Vt(),le.current=a,ue.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Jt=()=>{ce.current=null;let e=de.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=Pv(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,T.current()),qt(Kt(e.clientX,e.clientY)),ce.current=zt(Jt)},Yt=(e,t)=>{de.current={clientX:e,clientY:t},ce.current??=zt(Jt)},Xt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Gt(),Ht(),Vt(),Ut(),t.startDrag(r)===!1){e.preventDefault();return}if(pe.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),Nv())){let t=Mv(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Wt(t),fe.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Zt=()=>{Ht(),Vt(),Ut(),pe.current=null,t.cancelDrag()},Qt=(e,n,r)=>{if(ve.current!=null||k.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;_e.current={clientX:i.clientX,clientY:i.clientY},ge.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!k.current;ve.current!=null&&(clearTimeout(ve.current),ve.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),me.current===o&&(me.current=null),t&&(a.setAttribute(`draggable`,`true`),ge.current===a&&(ge.current=null),_e.current=null)},s=e=>{let t=e.touches[0],n=_e.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),me.current=o,ve.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),ge.current===a&&(ge.current=null),_e.current=null;return}k.current=!0,ge.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),pe.current=n;let e=a.getBoundingClientRect(),s=Mv(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Wt(s),fe.current=s,he.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=he.current;n!=null&&fe.current!=null&&(fe.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),qt(Kt(t.clientX,t.clientY)),Yt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&Kt(n.clientX,n.clientY),t.completeDrag(),Gt()},u=()=>{t.cancelDrag(),Gt()};me.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},Ev)},$t=e=>{if(N!=null){if(e.key===`Escape`){Nt(),e.preventDefault(),e.stopPropagation();return}Uv.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(at.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)at.cancel();else if(e.key===`Enter`)at.commit();else return;Ee(`focus`),be(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){It(F??void 0),e.preventDefault(),e.stopPropagation();return}if(ct){if(e.key===`Escape`)oe.current=!1,se.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=z_(n,R);se.current=I<0||n==null?null:Math.max(0,Math.min(I*s-n.scrollTop,Math.max(0,r-s))),oe.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;Ee(`focus`),be(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&zv(e)){t.openSearch(e.key),be(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=P&&Vv(e),r=Hv(e,P),i=r&&S.current!=null?R_(S.current):null,a=r?new Set(Xv(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==F&&a.has(o)){let e=C.current;Re(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=Lv(p)?p:null,h=u!=null&&(Tt.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=Yv(u,w.current,te.current);e==null||n==null?y=!1:Ft(e,u)}else if((e.ctrlKey||e.metaKey)&&Rv(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;Ee(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Tt.has(b)||a.has(b)),ee=g&&b!==u,T=n&&c&&o===u&&b===u;if((h||T)&&b!=null&&(ee&&x||T))Re(b,v?.scrollTop??null),D.current=!0,Ce(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(ze(b,Qv(S.current,v,i,u,s,wt,R)),D.current=!0,Ce(e=>e===b?e:b)):Le()}be(e=>e+1),e.preventDefault(),e.stopPropagation()};fv(()=>{if(!(!f||!ct)){if(Be.current){Be.current=!1;return}L_(ee.current)}},[ct,f]),fv(()=>{let e=x.current;switch(K_({hasRenderedInput:e!=null,previousRenamingPath:O.current,renamingPath:ot})){case`reset`:O.current=null;return;case`reveal-canonical`:ot!=null&&Lt(ot,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(je.current=null,O.current=ot,L_(e),e.select());return}},[bt.end,bt.start,ot,Lt,Tt]),fv(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=R_(e)?.dataset.itemPath??null;Ce(e=>e===t?e:t)},i=()=>{n(),D.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,R_(e)!=null){r();return}D.current=!1,Ce(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),D.current=!1,Ce(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;Ce(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),fv(()=>{let e=S.current;e!=null&&(L.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[L.physical.scrollTop]),fv(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;E.current=z_(n,g);let a=()=>{let e=t.getVisibleCount(),r=B_(E.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Ke(Tv({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!re.current){re.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=B_(E.current,g),i=t.getVisibleRows(e,e)[0]??null;H_(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}T.current=a;let o=t.subscribe(()=>{N_(xe)&&be(e=>e+1),a()}),l=()=>{Ie.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,Oe(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&Ie.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),Ae.current!=null&&y.current&&Mt.current(),Ie.current===!0){y.current=!1;return}we(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{E.current=(e[0]==null?null:V_(e[0]))??z_(n,g),a()}):null;return x?.observe(n),()=>{T.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,E.current=null,x?.disconnect()}},[t,g,s,c,h]),fv(()=>{P||N==null||Nt(!1)},[Nt,P,N]);let en=pv(()=>N==null?null:`${N.path}::${N.source}`,[N]);fv(()=>{if(en==null){m?.clearSlotContent(fd);return}let t=Ae.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??Gv(n.getBoundingClientRect()),close:e=>{Mt.current(e?.restoreFocus??!0)},restoreFocus:()=>{jt.current&&At.current(Ae.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(fd,i),e?.contextMenu?.onOpen?.(t.item,r),iy(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&iy(i)}),()=>{m?.clearSlotContent(fd)}},[en,e?.contextMenu,m]),fv(()=>{N!=null&&t.getItem(N.path)==null&&Nt()},[Nt,N,t]),fv(()=>{if(N==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(Wv(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Nt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Nt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Nt,N]),fv(()=>{let e=C.current,n=S.current;if(e==null||n==null){ae.current=F;return}let r=F==null?null:te.current.get(F)??null,i=R_(n),a=i?.dataset.itemPath??null,o=st&&x.current===i,c=f&&ee.current===i,l=oe.current&&!ct,u=se.current??0,d=je.current,p=Me.current,m=Ne.current,g=Pe.current,_=i!=null,v=D.current||_,y=ae.current!==F,b=p!=null&&p===F&&F!=null,w=!1,E=!1;if(ut!=null&&ut.id!==ne.current){ne.current=ut.id;let n=ut.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,R-s))):wt;w=!0,E=U_(e,n,s,R,Ct,ut.offset,t)}t.clearScrollRequest(ut.id)}let re=!w&&l&&W_(e,I,s,R,Ct,u),ie=!w&&d!=null&&d===F&&W_(e,I,s,R,Ct,wt),O=!w&&m!=null&&m.path===F&&W_(e,I,s,R,Ct,m.viewportOffset),ce=!w&&g!=null&&g.path===F&&e.scrollTop!==g.scrollTop;if(ce&&(e.scrollTop=g.scrollTop),(ce||E||ie||O||re||v&&y&&d!==F&&!b&&H_(e,I,s,R,wt))&&T.current(),w){ae.current=F;return}if(!v){ae.current=F;return}if(o){ae.current=F;return}if(c&&!l){ae.current=F;return}if(r==null){l&&I>=0&&(W_(e,I,s,R,Ct,u),T.current()),ae.current=F;return}(y||l||d===F||p===F||m?.path===F||g?.path===F||a==null||a!==F)&&(L_(r),d===F&&(je.current=null),p===F&&(Me.current=null),m?.path===F&&(Ne.current=null),g?.path===F&&(Pe.current=null),oe.current=!1,se.current=null),ae.current=F},[t,I,F,Et,s,st,ct,bt,R,f,ut,h,wt,Ct,yt]);let tn=I>=0&&I>=L.visible.startIndex&&I<=L.visible.endIndex,nn=F!=null&&xt.some(e=>Sv(e.row)===F),rn=tn||nn,an=Xe&&D.current===!0&&rn?F:null,on=Te===`pointer`?A:null,sn=N?.path??Fe.current??on??an??A,cn=N?.source===`right-click`;fv(()=>{y.current&&N==null||Pt(nt(sn))},[N,nt,bt,R,De,xt,sn,Pt,yt]);let ln=$(e=>{if(y.current||Wv(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&Ee(e=>e===`pointer`?e:`pointer`),we(e=>e===i?e:i)},[]),un=$(()=>{we(null)},[]);fv(()=>{if(!dt)return;let e=()=>{Gt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Gt(),t.cancelDrag()}},[t,dt]);let dn=e=>{if(!dt||t.getDragSession()==null||k.current)return;let n=jv(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),qt(t.getDragSession()?.target??null),Yt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},fn=e=>{if(!dt||t.getDragSession()==null||k.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Vt(),Ut(),t.setDragTarget(null))},pn=e=>{!dt||t.getDragSession()==null||k.current||(e.preventDefault(),Kt(e.clientX,e.clientY),t.completeDrag(),Ht(),Vt(),Ut(),pe.current=null)},mn=L.window.height,hn=L.window.offsetTop,gn=Math.min(0,R-mn),_n=Math.min(0,R-mn-wt),vn=Se===F||oe.current,yn=F!=null&&vn&&!Et&&I>=0?yt[I]??t.getVisibleRows(I,I)[0]??null:null,bn=yn==null?null:G_(I,s,bt,mn),xn=pe.current,Sn=ht!=null&&xn!=null&&xn.path===ht&&xn.index>=bt.start&&xn.index<=bt.end,Cn=ht!=null&&xn!=null&&xn.path===ht&&!Sn&&xn.path!==yn?.path?xn:null,wn=Cn==null?null:G_(Cn.index,s,bt,mn),Tn=Bv((I>=0?yt[I]??t.getVisibleRows(I,I)[0]??null:null)?.ancestorPaths.at(-1)??null),En=ct&&F!=null?ty(o,F,!Et):void 0,Dn=N?.path??(ct?F:Se),On=N?.path??A,kn=nt(sn),An=P&&Xe&&!cn&&!st&&kn!=null&&j!=null&&sn!=null,jn=P&&(An||N!=null),Mn=N?.anchorRect,Nn=Mn==null&&kn!=null&&j!=null&&(N!=null||An)?j:null,Pn=Mn==null?Nn==null?void 0:{top:`${Nn}px`}:{left:`${Mn.left}px`,position:`fixed`,right:`auto`,top:`${Mn.top}px`},Fn=cn?{opacity:`0`}:void 0,In=$((e,n,r,i)=>{let a=Y_({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:ct,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=L.visible.startIndex&&n.index<=L.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(D.current=!0,Ce(e=>e===c?e:c),Ee(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Lt(c,{targetOffset:`sticky-parents`})},[t,ct,L.visible.endIndex,L.visible.startIndex,Lt]),Ln=()=>{if(y.current||!Xe||sn==null||kn==null)return;let e=t.getItem(sn);e!=null&&(Pt(kn),jt.current=!0,ke({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:kn.getAttribute(`aria-label`)??sn,path:e.getPath()},path:e.getPath(),source:`button`}))},Rn={contextHoverPath:On,contextMenuButtonTriggerEnabled:Xe,contextMenuButtonVisibility:Ze,contextMenuEnabled:P,contextMenuRightClickEnabled:Qe,contextMenuTriggerMode:Ye,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:dt,draggedPathSet:pt,dragTarget:mt,gitLaneActive:rt,gitStatusByPath:n,handleRowDragEnd:Zt,handleRowDragStart:Xt,handleRowTouchStart:Qt,ignoredGitDirectories:r,ignoredInheritanceCache:ye,instanceId:o,itemHeight:s,onKeyDown:$t,onRowClick:In,openContextMenuForRow:Ft,registerButton:$e,registerRenameInput:tt,renameView:at,renderDecorationForRow:Dt,resolveIcon:it,shouldSuppressContextMenu:Rt,visualFocusPath:Dn},zn={...Rn,registerButton:et};return Y(`div`,{ref:S,id:gt,"data-file-tree-context-menu-button-visibility":P&&Xe?Ze:void 0,"data-file-tree-context-menu-trigger-mode":P?Ye:void 0,"data-file-tree-has-context-menu-action-lane":P&&Xe?`true`:void 0,"data-file-tree-has-git-lane":rt?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:dt?fn:void 0,onDragOver:dt?dn:void 0,onDrop:dt?pn:void 0,onKeyDown:$t,onPointerLeave:P?un:void 0,onPointerOver:P?ln:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[Y(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:Tn}}),Y(`slot`,{name:dd,"data-type":`header-slot`}),f?Y(`div`,{"data-file-tree-search-container":!0,"data-open":ct?`true`:`false`,children:Y(`input`,{ref:ee,"aria-activedescendant":En,"aria-controls":gt,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ve?`true`:void 0,value:lt,onBlur:()=>{d===`retain`&&!Ue.current||t.closeSearch()},onFocus:We,onPointerDown:We,onInput:e=>{We();let n=e.currentTarget;t.setSearch(n.value)}})}):null,Y(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&qe&&xt.length>0?Y(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:Y(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${_t}px`},children:xt.map((e,t)=>oy(zn,e.row,`sticky:${Sv(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${xt.length-t}`}}))})}):null,Y(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${Ct}px`},children:[Y(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${hn}px`}}),Y(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${mn}px`,top:`${gn}px`,bottom:`${_n}px`},children:[sy(Rn,bt,Tt),yn!=null&&bn!=null?oy(Rn,yn,`parked:${yn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:ht===yn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${bn}px`}}):null,Cn!=null&&wn!=null?oy(Rn,Cn,`parked-drag:${Cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${wn}px`}}):null]})]})]}),P?Y(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":jn?`true`:`false`,style:Pn,children:[Y(`button`,{ref:v,type:`button`,"data-type":pd,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":N==null?`false`:`true`,"data-visible":An?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),N!=null){Nt();return}Ln()},tabIndex:-1,style:Fn,children:Y(n_,{...it(`file-tree-icon-ellipsis`)})}),N==null?null:Y(`slot`,{name:fd})]}):null,N==null?null:Y(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Nt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Nt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var ly={hydrateRoot:(e,t)=>{Zg(Dg(cy,t),e)},renderRoot:(e,t)=>{Xg(Dg(cy,t),e)},unmountRoot:e=>{Xg(null,e)}};function uy(e,t){ly.renderRoot(e,t)}function dy(e,t){ly.hydrateRoot(e,t)}function fy(e){ly.unmountRoot(e)}var py=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}};Array.isArray;var my=0;function hy(e){return e!=null&&e.length>0?e:(my+=1,`pst_ft_${my}`)}function gy({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??th)}function _y(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function vy(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function yy(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var by=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new py;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=hy(a),this.#p=rg(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=eh(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new Qh({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(fy(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=ig(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&uy(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),uy(t.wrapper,this.#w()))}setGitStatus(e){let t=rg(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&uy(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),uy(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),dy(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),uy(r,this.#w())}#C(){return{initialViewportHeight:gy({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(dd,e());return}this.#l.setSlotHtml(dd,this.#e?.header?.html??null)}#k(e){let t=yy(e).find(e=>vy(e)),n=_y(td(hd(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=yy(e),n=t.find(e=>vy(e)),r=t.filter(e=>e!==n),i=hd(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=_y(i);if(a==null){for(let e of r)e.remove();return}if(r.length!==1||r[0].outerHTML!==a.outerHTML){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=hd(this.#m);t.colored&&rd(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${sd}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}(this.#g?.parentNode!==e||this.#_!==this.#h)&&(this.#g??=document.createElement(`style`),this.#g.setAttribute(sd,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=ah(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return dh(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},xy=`
|
|
6497
|
+
}`}var oh=new WeakMap;function sh(e){let t=oh.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(cd,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),oh.set(e,i),i}function ch(e,t){if(!e.isConnected)return;let n=sh(t);if(n==null)return;let r=t.querySelector(`style[${ld}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(ld,``),t.appendChild(i)),i.textContent=`:host { ${ud}: ${n}px; }`}var lh;function uh(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){lh??(lh=new CSSStyleSheet,lh.replaceSync(ih(nh)));let t=!1;try{e.adoptedStyleSheets=[lh],t=!0}catch{}if(t){e.querySelector(`style[${od}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(od,``),t.textContent=ih(nh),e.prepend(t)}}function dh(e,t){fh(e,t),uh(t),ch(e,t)}function fh(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});dh(this,e)}}if(customElements.define(ad,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(ad)))e instanceof HTMLElement&&dh(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var ph=e=>e.startsWith(`f::`)?e.slice(3):e;function mh(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function hh(e,t){return e===``?t:`${e}/${t}`}function gh({files:e,path:t,isFolder:n,nextBasename:r}){let i=ph(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=mh(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=hh(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function _h(e){return e.endsWith(`/`)}function vh(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function yh(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function bh(e,t){return t.includes(e)?yh(t):[e]}function xh(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function Sh(e,t){return{draggedPaths:e,target:t}}function Ch(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(_h(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function wh(e,t){return t.kind===`root`||t.directoryPath==null?vh(e):t.directoryPath}function Th(e,t){let n=e.map(e=>{let n=wh(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function Eh(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Dh(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!Eh(Xm.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function Oh(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function kh(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function Ah(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function jh(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return Ah(e,t.path)?n?e:null:e;case`move`:return kh(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=jh(r,e,n),r==null)return null;return r}}}function Mh(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function Nh(e){switch(e.operation){case`add`:return{...Mh(e),operation:`add`,path:e.path};case`remove`:return{...Mh(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...Mh(e),from:e.from,operation:`move`,to:e.to}}}function Ph(e){return{...Mh(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>Nh(e)),operation:`batch`}}function Fh(e){switch(e.operation){case`add`:case`remove`:case`move`:return Nh(e);case`batch`:return Ph(e);default:return null}}function Ih(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Lh(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function Rh(e){return Lh(e).at(-1)??null}function zh(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function Bh(e){return e.endsWith(`/`)}var Vh=e=>e.toLowerCase();function Hh(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function Uh(e){return e.endsWith(`/`)?e.slice(0,-1):e}function Wh(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var Gh=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},Kh=Symbol(`FILE_TREE_RENAME_VIEW`),qh=512,Jh=512;function Yh(e){return e===`top`||e===`center`?e:`nearest`}function Xh(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=Lh(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function Zh(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:Xh(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var Qh=class e{static{Object.defineProperty(e.prototype,Kh,{configurable:!0,value(){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}},writable:!0})}#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=Dh({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=Rh(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:Yh(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=Jh){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=bh(t,n);return this.#r.canDrag?.(r)!==!1&&(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=Sh(t.draggedPaths,n);(Ch(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}xh(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=Sh(e.draggedPaths,t);if(Ch(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=Th(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=Bh(r),a=Uh(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of Lh(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=Hh(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,Bh(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,Bh(e)?{recursive:!0}:void 0);return}let t=Bh(e),n=gh({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:Uh(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(Wh(n.sourcePath,t),Wh(n.destinationPath,t))}#Y(e){this.#T!=null&&this.#E!==e&&(this.#E=e,this.#De())}resetPaths(e,t={}){let n=!Array.isArray(e),r=n?void 0:e,i=n?e:t,a=this.#H.list().length,o=this.#G,s=Dh({paths:r,preparedInput:i.preparedInput},`resetPaths`,this.#e.sort),c=this.#le(s.paths,s.preparedInput,i.initialExpandedPaths),l=this.#c,u=this.#T,d=this.getSelectedPaths(),f=this.#z;this.#K?.(),this.#H=c,this.#d.clear(),this.#he();let p=d.map(e=>c.getPathInfo(e)?.path??null).filter(e=>e!=null),m=!Ih(this.#B,p);this.#B=new Set(p),m&&(this.#V+=1),this.#z=f==null?null:c.getPathInfo(f)?.path??null,this.#T=u==null?null:c.getPathInfo(u)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(l,l!=null||p.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:s.paths.length,pathCountBefore:a,projectionChanged:!0,usedPreparedInput:i.preparedInput!=null,visibleCountDelta:this.#G-o})}#X(e){this.#Ie();let t=Rh(e),n=zh(e,t),r=null,i=null;for(let e of this.#be()){if(Rh(e)!==t)continue;let a=zh(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=Lh(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!Ih(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new Xm({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of Lh(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(Vh),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(Vh),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of Lh(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:Gh(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of Lh(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of Lh(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=Zh(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,qh)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s!==e||this.#c!==n)&&(this.#s=e,this.#c=n,t&&this.#De())}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=jh(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=jh(this.#c,e,!0),r=[...this.#B].map(t=>jh(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=jh(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return Ih(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&Oh(e)&&(this.#i=null);let t=Oh(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=Fh(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},$h=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function eg(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(e[t]!==`/`&&t!==e.length){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function tg(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=[],r=0;for(;;){let e=t.indexOf(`/`,r);if(e===-1)break;n.push(t.slice(0,e+1)),r=e+1}return n}function ng(e,t){return t?`${e}/`:e}function rg(e,t=null){let n=$h(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set,o=new Map;for(let t of e??[]){let e=ag(t);e!=null&&cg({canonicalPath:e.canonicalPath,changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,isDirectory:e.isDirectory,status:t.status,statusByPath:r})}return r.size===0?null:{changeCountByDirectoryPath:o,directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}function ig(e,t){let n=t?.remove??[],r=t?.set??[];if(n.length===0&&r.length===0)return e;let i=new Map(e?.statusByPath),a=new Set(e?.directoriesWithChanges),o=new Set(e?.ignoredDirectoryPaths),s=new Map(e?.changeCountByDirectoryPath),c=!1;for(let e of n){let t=og(e);t!=null&&(c=sg({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,statusByPath:i})||c)}for(let e of r){let t=ag(e);t!=null&&(c=cg({canonicalPath:t.canonicalPath,changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,isDirectory:t.isDirectory,status:e.status,statusByPath:i})||c)}return c?i.size===0?null:{changeCountByDirectoryPath:s,directoriesWithChanges:a,ignoredDirectoryPaths:o,signature:dg(i),statusByPath:i}:e}function ag(e){return og(e.path)}function og(e){let t=eg(e);if(t!=null)return{canonicalPath:ng(t.path,t.isDirectory),isDirectory:t.isDirectory}}function sg({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,statusByPath:i}){let a=i.get(e);return a!=null&&(i.delete(e),a===`ignored`&&e.endsWith(`/`)&&r.delete(e),ug(t,n,e),!0)}function cg({canonicalPath:e,changeCountByDirectoryPath:t,directoriesWithChanges:n,ignoredDirectoryPaths:r,isDirectory:i,status:a,statusByPath:o}){let s=o.get(e);return s!==a&&(s??lg(t,n,e),o.set(e,a),a===`ignored`&&i?r.add(e):i&&r.delete(e),!0)}function lg(e,t,n){for(let r of tg(n))e.set(r,(e.get(r)??0)+1),t.add(r)}function ug(e,t,n){for(let r of tg(n)){let n=(e.get(r)??0)-1;n>0?e.set(r,n):(e.delete(r),t.delete(r))}}function dg(e){let t=`${e.size}`;for(let[n,r]of e)t+=`\0${n}\0${r}`;return t}var J,fg,pg,mg,hg,gg,_g,vg,yg,bg,xg={},Sg=[],Cg=Array.isArray,wg=Sg.slice,Tg=Object.assign;function Eg(e){e&&e.parentNode&&e.remove()}function Dg(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?wg.call(arguments,2):n),Og(e,o,r,i,null)}function Og(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++fg,__i:-1,__u:0};return i==null&&J.vnode!=null&&J.vnode(a),a}function kg(e){return e.children}function Ag(e,t){this.props=e,this.context=t,this.__g=0}function jg(e,t){if(t==null)return e.__?jg(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?jg(e):null}function Mg(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return Mg(e)}}function Ng(e){(8&e.__g||!(e.__g|=8)||!pg.push(e)||hg++)&&mg==J.debounceRendering||((mg=J.debounceRendering)||queueMicrotask)(Pg)}function Pg(){for(var e,t,n,r,i,a,o,s,c=1;pg.length;)pg.length>c&&pg.sort(gg),e=pg.shift(),c=pg.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=Tg({},r)).__v=r.__v+1,J.vnode&&J.vnode(n),Hg(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??jg(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,Wg(a,n,o),n.__e!=i&&Mg(n)));hg=0}function Fg(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||Sg,b=t.length;for(c=Ig(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?xg:y[m.__i]||xg,m.__i=f,_=Hg(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&qg(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=Lg(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function Ig(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?Og(null,o,null,null,null):Cg(o)?Og(kg,{children:o},null,null,null):o.constructor==null&&o.__b>0?Og(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=Rg(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=jg(s)),Jg(s,s));return r}function Lg(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=Lg(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=jg(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Rg(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function zg(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function Bg(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||zg(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||zg(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(_g,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=vg,e.addEventListener(t,a?bg:yg,a)):e.removeEventListener(t,a?bg:yg,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function Vg(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=vg++;else if(t.u<n.l)return;return n(J.event?J.event(t):t)}}}function Hg(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,ee,te,w,T,E,ne,re,ie,D=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=J.__b)&&d(t);n:if(typeof D==`function`)try{if(v=t.props,y=`prototype`in D&&D.prototype.render,b=(d=D.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new D(v,x):(t.__c=f=new Ag(v,x),f.constructor=D,f.render=Yg),b&&b.sub(f),f.props=v,f.state||(f.state={}),f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&D.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Tg({},f.__s)),Tg(f.__s,D.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&D.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&D.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=J.__r,ee=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),te=0;te<f._sb.length;te++)f.__h.push(f._sb[te]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++ee<25);f.state=f.__s,f.getChildContext!=null&&(r=Tg({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),w=d,d!=null&&d.type===kg&&d.key==null&&(w=Gg(d.props.children)),s=Fg(e,Cg(w)?w:[w],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(T=0,E=!1,t.__u|=c?160:128,t.__c.__z=[],ne=0;ne<a.length;ne++)(re=a[ne])==null||E||(re.nodeType==8&&re.data==`$s`?(T>0&&t.__c.__z.push(re),T++,a[ne]=null):re.nodeType==8&&re.data==`/$s`?(--T>0&&t.__c.__z.push(re),E=T===0,s=a[ne],a[ne]=null):T>0&&(t.__c.__z.push(re),a[ne]=null));if(!E){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(ie=a.length;ie--;)Eg(a[ie]);Ug(t)}else t.__e=n.__e,t.__k=n.__k,e.then||Ug(t);J.__e(e,t,n)}else s=t.__e=Kg(n.__e,t,n,r,i,a,o,c,l,u);return(d=J.diffed)&&d(t),128&t.__u?void 0:s}function Ug(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(Ug)}function Wg(e,t,n){for(var r=0;r<n.length;r++)qg(n[r],n[++r],n[++r]);J.__c&&J.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){J.__e(e,t.__v)}})}function Gg(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:Cg(e)?e.map(Gg):Tg({},e)}function Kg(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(J.__m&&J.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=wg.call(e.childNodes),v=n.props||xg,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;Bg(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||Bg(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),Fg(b==`template`?e.content:e,Cg(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&jg(n,0),s,c,l),a!=null)for(u=a.length;u--;)Eg(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||Bg(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&Bg(e,u,g,v[u],i))}return e}function qg(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){J.__e(e,n)}}function Jg(e,t,n){var r,i;if(J.unmount&&J.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||qg(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){J.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&Jg(r[i],t,n||typeof e.type!=`function`);n||Eg(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function Yg(e,t,n){return this.constructor(e,n)}function Xg(e,t){var n,r,i,a;t==document&&(t=document.documentElement),J.__&&J.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=Dg(kg,null,[e]),i=[],a=[],Hg(t,e,r||xg,xg,t.namespaceURI,r?null:t.firstChild?wg.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),Wg(i,e,a)}function Zg(e,t){e.__u|=32,Xg(e,t)}J={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw hg=0,e}},fg=0,Ag.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Tg({},this.state);typeof e==`function`&&(e=e(Tg({},n),this.props)),e&&Tg(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ng(this))},Ag.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),Ng(this))},Ag.prototype.render=kg,pg=[],hg=0,gg=function(e,t){return e.__v.__b-t.__v.__b},_g=/(PointerCapture)$|Capture$/i,vg=0,yg=Vg(!1),bg=Vg(!0);var Qg=0;Array.isArray;function Y(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Qg,__i:-1,__u:0,__source:i,__self:a};return J.vnode&&J.vnode(l),l}var $g=16,e_=16,t_={};function n_({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=t_[e]??{width:$g,height:e_},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return Y(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:Y(`use`,{href:c})})}var r_=e=>e!==void 0&&/\s/.test(e),i_=(e,t)=>{let n=t=>r_(e[t-1])||r_(e[t]);if(!n(t))return t;for(let r=1;r<e.length;r++){let i=t-r;if(i>0&&!n(i))return i;let a=t+r;if(a<e.length&&!n(a))return a}return t},a_=e=>i_(e,Math.ceil(e.length/2)),o_=e=>{if(e.length<2)return[e,``];let t=a_(e);return[e.slice(0,t),e.slice(t)]},s_=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:a_(e);return[e.slice(0,r),e.slice(r)]},c_=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},l_=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},u_=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},d_=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function f_({children:e,marker:t,variant:n=`default`}){"use no memo";return Y(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:Y(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?Y(`span`,{"data-truncate-fade":!0}):t})})}function p_(e){"use no memo";let{mode:t,children:n}=e;return Y(`div`,{children:[Y(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?Y(`span`,{children:n}):n}),Y(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?Y(`span`,{children:n}):n})]})}function m_({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=Y(p_,{mode:t,children:e},`content`),o=Y(f_,{marker:n,mode:t,variant:r},`marker`),s=Y(`div`,{"data-truncate-fill":!0},`fill`);return Y(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:Y(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function h_({children:e,...t}){"use no memo";return Y(m_,{mode:`truncate`,...t,children:e})}function g_({children:e,...t}){"use no memo";return Y(m_,{mode:`fruncate`,...t,children:e})}function __({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=Y(h_,{...s,children:t[0]}),l=Y(g_,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return Y(`div`,{className:a,style:o});if(e.length<i)return Y(n===`end`?g_:h_,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=o_:r===`extension`?t=s_:r===`leaf-path`&&(t=c_);else if(typeof r==`number`)t=l_,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=u_:e===`first`&&(t=d_)}else typeof r==`function`&&(t=r);t??=o_;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=Y(h_,{...s,..._,children:f}),l=Y(g_,{...s,...v,children:p})}return Y(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[Y(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),Y(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var v_={endIndex:-1,startIndex:-1};function y_(e,t,n){return Math.min(Math.max(e,t),n)}function b_(e,t){return e<0||t<e?v_:{endIndex:t,startIndex:e}}function x_(e){return e.startIndex<0||e.endIndex<e.startIndex}function S_(e,t){return x_(e)?0:(e.endIndex-e.startIndex+1)*t}function C_(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function w_(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function T_(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function E_(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function D_(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function O_(e,t,n){if(e.length===0||t<=0)return[];let r=D_(e),i=T_(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=E_(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function k_(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=y_(t.scrollTop,0,o),c=t.stickyRows??O_(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=C_(s,n,t.itemHeight),m=C_(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?v_:b_(m,w_(u+d,n,t.itemHeight)),y=g+1,b=x_(v)?v_:b_(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=S_(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:x_(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var A_={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},j_={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},M_=`Contains git status items`;function N_(e){return e.current?!0:(e.current=!0,!1)}function P_(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function F_(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return P_({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function I_(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function L_(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function R_(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function z_(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function B_(e,t){return e!=null&&e>0?e:t}function V_(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function H_(e,t,n,r,i=0){let a=P_({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a!=null&&(e.scrollTop=a,!0)}function U_(e,t,n,r,i,a,o=0){let s=F_({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s!=null&&(e.scrollTop=s,!0)}function W_(e,t,n,r,i,a){let o=I_({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o!=null&&(e.scrollTop=o,!0)}function G_(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function K_(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function q_({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return Y(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function J_(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function Y_(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var X_,X,Z_,Q_,$_=Object.is,ev=0,tv=[],Z=J,nv=Z.__b,rv=Z.__r,iv=Z.diffed,av=Z.__c,ov=Z.unmount,sv=Z.__;function cv(e,t){Z.__h&&Z.__h(X,e,ev||t),ev=0;var n=X.__H||(X.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function lv(e){return ev=1,uv(bv,e)}function uv(e,t,n){var r=cv(X_++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):bv(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);$_(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=X,!X.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,$_(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};X.__f=!0;var a=X.shouldComponentUpdate,o=X.componentWillUpdate;X.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},X.shouldComponentUpdate=i}return r.__N||r.__}function dv(e,t){var n=cv(X_++,3);!Z.__s&&yv(n.__H,t)&&(n.__=e,n.u=t,X.__H.__h.push(n))}function fv(e,t){var n=cv(X_++,4);!Z.__s&&yv(n.__H,t)&&(n.__=e,n.u=t,X.__h.push(n))}function Q(e){return ev=5,pv(function(){return{current:e}},[])}function pv(e,t){var n=cv(X_++,7);return yv(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function $(e,t){return ev=8,pv(function(){return e},t)}function mv(){for(var e;e=tv.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(_v),e.__H.__h.forEach(vv),e.__H.__h=[]}catch(t){e.__H.__h=[],Z.__e(t,e.__v)}}Z.__b=function(e){X=null,nv&&nv(e)},Z.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),sv&&sv(e,t)},Z.__r=function(e){rv&&rv(e),X_=0;var t=(X=e.__c).__H;t&&(Z_===X?(t.__h=[],X.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(_v),t.__h.forEach(vv),t.__h=[],X_=0)),Z_=X},Z.diffed=function(e){iv&&iv(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(tv.push(t)!==1&&Q_===Z.requestAnimationFrame||((Q_=Z.requestAnimationFrame)||gv)(mv)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Z_=X=null},Z.__c=function(e,t){t.some(function(e){try{e.__h.forEach(_v),e.__h=e.__h.filter(function(e){return!e.__||vv(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],Z.__e(n,e.__v)}}),av&&av(e,t)},Z.unmount=function(e){ov&&ov(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{_v(e)}catch(e){t=e}}),n.__H=void 0,t&&Z.__e(t,n.__v))};var hv=typeof requestAnimationFrame==`function`;function gv(e){var t,n=function(){clearTimeout(r),hv&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);hv&&(t=requestAnimationFrame(n))}function _v(e){var t=X,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),X=t}function vv(e){var t=X;e.__c=e.__(),X=t}function yv(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!$_(t,e[n])})}function bv(e,t){return typeof t==`function`?t(e):t}function xv(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:Y(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return Y(kg,{children:[Y(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:Y(h_,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function Sv(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function Cv(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function wv(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function Tv({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=k_(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:wv(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?wv(u,1,t,o):i&&r<=0&&c.length>0?O_(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var Ev=400,Dv=40,Ov=18;function kv(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?Av(e,t,n):a instanceof HTMLElement?a:null}function Av(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function jv(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function Mv(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function Nv(){return navigator.vendor!==`Apple Computer, Inc.`}function Pv(e,t){let n=e-t.top;if(n<Dv)return-Math.ceil((Dv-Math.max(0,n))/Dv*Ov);let r=t.bottom-e;return r<Dv?Math.ceil((Dv-Math.max(0,r))/Dv*Ov):0}function Fv(e,t){if(e!=null){let t=A_[e];return t==null?null:{text:t,title:j_[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:M_}:null}function Iv(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function Lv(e){return e!=null&&`toggle`in e}function Rv(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function zv(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function Bv(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function Vv(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function Hv(e,t){return t&&Vv(e)||(e.ctrlKey||e.metaKey)&&Rv(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var Uv=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function Wv(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function Gv(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function Kv(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function qv(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function Jv(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function Yv(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function Xv(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function Zv(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function Qv(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=Zv(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function $v(e,t){return{kind:e.kind,name:Cv(e),path:t}}function ey(e){return e==null?void 0:`${e}__tree`}function ty(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function ny(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function ry(e,t){if(e==null)return null;if(`text`in e)return e.parts==null?Y(`span`,{title:e.title,children:e.text}):Y(`span`,{title:e.title,children:e.parts.map((e,t)=>Y(`span`,{style:{color:e.color},children:e.text},t))});let n=typeof e.icon==`string`?ny(e.icon)?t(e.icon):{name:e.icon}:ny(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return Y(`span`,{title:e.title,children:Y(n_,{...n})})}function iy(e){e!=null&&L_(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function ay(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=Sv(e);return Y(kg,{children:[e.depth>0?Y(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>Y(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,Y(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?Y(n_,{...t(`file-tree-icon-chevron`)}):Y(n_,{...t(`file-tree-icon-file`,u)})}),Y(`div`,{"data-item-section":`content`,children:e.isFlattened?xv(e,c,a):c??Y(__,{minimumLength:5,split:`extension`,children:e.name})}),i?Y(`div`,{"data-item-section":`decoration`,children:r==null?null:ry(r,t)}):null,s?Y(`div`,{"data-item-section":`git`,children:ry(o,t)}):null,n?Y(`div`,{"data-item-section":`action`,children:l?Y(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:Y(n_,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function oy(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:ee,contextMenuButtonVisibility:te,contextMenuRightClickEnabled:w,registerRenameInput:T,registerButton:E,resolveIcon:ne,renderDecorationForRow:re,openContextMenuForRow:ie,onRowClick:D,onKeyDown:ae}=e,O=Sv(t),{isParked:oe=!1,mode:se=`flow`,style:ce}=r,le=se===`sticky`,ue=_?.get(O)??null??Iv(t.ancestorPaths,v,y),de=t.kind===`directory`&&(b?.has(O)??!1),fe=re(t,O),pe=Fv(ue,de),me=S&&ee,k=fe!=null||x||me,he=me&&te===`always`,ge=a.getPath()===O,_e=ge?a.getValue():``,ve=le||!ge?null:Y(q_,{ref:T,ariaLabel:`Rename ${Cv(t)}`,isFlattened:t.isFlattened,value:_e,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ye=ay(t,ne,{actionLaneEnabled:me,customDecoration:fe,decorationLaneEnabled:k,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:pe,gitLaneActive:x,renameInput:ve,showDecorativeActionAffordance:he}),be={...J_({ariaLabel:Cv(t),domId:t.isFocused?ty(h,O,oe):void 0,extraStyle:ce,features:{actionLaneEnabled:me,contextMenuButtonVisibility:me?te:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:oe,itemHeight:g,mode:se,row:t,state:{containsGitChange:de,effectiveGitStatus:ue,isContextHovered:s===O,isDragTarget:l?.kind===`directory`&&l.directoryPath===O,isDragging:c?.has(O)===!0,isFocusRinged:t.isFocused&&o===O},targetPath:O}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),w&&(i.focusMountedPathFromInput(O),ie(t,O,{anchorRect:Kv(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:le?void 0:()=>{i.focusMountedPathFromInput(O)},onKeyDown:le?void 0:ae,ref:e=>{E(O,e)}};return!le&&ge?Y(`div`,{...be,children:ye}):Y(`button`,{...be,type:`button`,draggable:u&&!oe,onDragEnd:u&&!oe?p:void 0,onDragStart:u&&!oe?e=>{f(e,t,O)}:void 0,onMouseDown:e=>{if(le){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!oe?e=>{m(e,t,O)}:void 0,onClick:e=>{D(e,t,O,se)},children:ye})}function sy(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(Sv(e))).map((n,r)=>oy(e,n,t.start+r))}function cy({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=th,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=Q(null),v=Q(null),y=Q(!1),b=Q(null),x=Q(null),S=Q(null),C=Q(null),ee=Q(null),te=Q(new Map),w=Q(new Map),T=Q(()=>{}),E=Q(null),ne=Q(0),re=Q(!1),ie=Q(null);ie.current!==t&&(re.current=!1,ie.current=t);let D=Q(!1),ae=Q(null),O=Q(null),oe=Q(!1),se=Q(null),ce=Q(null),le=Q(null),ue=Q(null),de=Q(null),fe=Q(null),pe=Q(null),me=Q(null),k=Q(!1),he=Q(null),ge=Q(null),_e=Q(null),ve=Q(null),ye=pv(()=>new Map,[]),[,be]=lv(0),xe=Q(!1),[Se,Ce]=lv(null),[A,we]=lv(null),[j,M]=lv(null),[Te,Ee]=lv(null),[De,Oe]=lv(0),[N,ke]=lv(null),Ae=Q(N);Ae.current=N;let je=Q(null),Me=Q(null),Ne=Q(null),Pe=Q(null),Fe=Q(null),Ie=Q(!1),Le=()=>{Me.current=null,Ne.current=null,Pe.current=null},Re=(e,t)=>{Me.current=e,Ne.current=null,Pe.current=t==null?null:{path:e,scrollTop:t}},ze=(e,t)=>{Me.current=null,Ne.current={path:e,viewportOffset:t},Pe.current=null},Be=Q(d===`retain`&&t.isSearchOpen()),[Ve,He]=lv(p);dv(()=>{p||He(!1)},[p]);let Ue=Q(!1),We=$(()=>{Ue.current=!0,He(e=>e&&!1)},[]),[Ge,Ke]=lv(()=>Tv({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[qe,Je]=lv(!1);dv(()=>{Je(!0)},[]);let Ye=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Xe=e?.contextMenu?.triggerMode??(Ye?`right-click`:`both`),Ze=Xe===`both`||Xe===`button`,Qe=e?.contextMenu?.buttonVisibility??`when-needed`,$e=Xe===`both`||Xe===`right-click`;fv(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;Fe.current=t,we(t),Ee(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(Ie.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let et=$((e,t)=>{Jv(te.current,e,t)},[]),tt=$((e,t)=>{Jv(w.current,e,t)},[]),nt=$(e=>{x.current=e},[]),rt=$(e=>Yv(e,w.current,te.current),[]),it=n!=null||r!=null||i!=null,{resolveIcon:at}=pv(()=>bd(a),[a]),ot=t[Kh](),st=ot.getPath(),ct=st!=null,lt=t.isSearchOpen(),ut=t.getSearchValue(),P=t.getFocusedPath(),F=t.getFocusedIndex(),dt=t.getScrollRequest(),ft=t.isDragAndDropEnabled(),pt=t.getDragSession(),mt=pv(()=>pt==null?null:new Set(pt.draggedPaths),[pt]),ht=pt?.target??null,gt=pt?.primaryPath??null,_t=ey(o),{overlayHeight:vt,overlayRows:yt,snapshot:I,visibleRows:bt}=Ge,L=I.physical.viewportHeight,xt=pv(()=>({end:I.window.endIndex,start:I.window.startIndex}),[I.window.endIndex,I.window.startIndex]),St=yt,Ct=I.sticky.rows,wt=I.physical.totalHeight,Tt=I.sticky.height,Et=pv(()=>new Set(Ct.map(e=>Sv(e.row))),[Ct]),Dt=F>=0&&F>=xt.start&&F<=xt.end,Ot=$((e,t)=>u?.({item:$v(e,t),row:e})??null,[u]),kt=$(e=>L_(e==null?null:te.current.get(e)??null)?!0:L_(S.current),[]),At=$(e=>{kt(t.focusNearestPath(e))},[t,kt]),jt=Q(At);jt.current=At;let Mt=Q(!0),Nt=Q(()=>{}),Pt=$((t=!0)=>{let n=Ae.current;n!=null&&(Mt.current=Mt.current&&t,ke(null),e?.contextMenu?.onClose?.(),Mt.current&&At(n.path))},[e?.contextMenu,At]);Nt.current=Pt;let Ft=$(e=>{let t=e==null?null:qv(S.current,e);M(e=>e===t?e:t)},[]),It=$((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=rt(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Re(n,e?.scrollTop??null),D.current=!0,Ce(e=>e===n?e:n)}i.focus(),Ft(a),Mt.current=!0,ke({anchorRect:r?.anchorRect??null,item:$v(e,n),path:n,source:r?.source??`keyboard`})},[t,rt,Ft]),Lt=$(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=z_(e,L);se.current=F<0||e==null?null:Math.max(0,Math.min(F*s-e.scrollTop,Math.max(0,t-s))),oe.current=!0}t.startRenaming(e)!==!1&&(Ee(`focus`),be(e=>e+1))}},[t,F,s,l,L]),Rt=$((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=z_(i,L),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:Tv({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return D.current=!0,W_(i,a,s,l,u,d),T.current(),je.current=n?e:null,!0},[t,s,c,L,h]),zt=()=>y.current===!0||ve.current!=null||k.current===!0,Bt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Vt=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Ht=()=>{ue.current!=null&&(clearTimeout(ue.current),ue.current=null),le.current=null},Ut=()=>{fe.current?.remove(),fe.current=null},Wt=()=>{Vt(ce.current),ce.current=null,de.current=null},Gt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Kt=()=>{me.current?.(),me.current=null,ve.current!=null&&(clearTimeout(ve.current),ve.current=null),k.current=!1,he.current=null,_e.current=null,ge.current!=null&&(ge.current.setAttribute(`draggable`,`true`),ge.current.style.removeProperty(`touch-action`),ge.current=null),Ut(),Ht(),Wt(),pe.current=null},qt=(e,n)=>{let r=S.current?.getRootNode(),i=jv(kv(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Jt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Ht();return}let r=t.getItem(e.directoryPath),i=Lv(r)?r:null;if(i==null||i.isExpanded()){Ht();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;le.current!==a&&(Ht(),le.current=a,ue.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind===`directory`&&n.directoryPath===e.directoryPath&&n.flattenedSegmentPath===e.flattenedSegmentPath&&i.expand()},n))},Yt=()=>{ce.current=null;let e=de.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=Pv(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,T.current()),Jt(qt(e.clientX,e.clientY)),ce.current=Bt(Yt)},Xt=(e,t)=>{de.current={clientX:e,clientY:t},ce.current??=Bt(Yt)},Zt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Kt(),Ut(),Ht(),Wt(),t.startDrag(r)===!1){e.preventDefault();return}if(pe.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),Nv())){let t=Mv(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Gt(t),fe.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Qt=()=>{Ut(),Ht(),Wt(),pe.current=null,t.cancelDrag()},$t=(e,n,r)=>{if(ve.current!=null||k.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;_e.current={clientX:i.clientX,clientY:i.clientY},ge.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!k.current;ve.current!=null&&(clearTimeout(ve.current),ve.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),me.current===o&&(me.current=null),t&&(a.setAttribute(`draggable`,`true`),ge.current===a&&(ge.current=null),_e.current=null)},s=e=>{let t=e.touches[0],n=_e.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=100||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),me.current=o,ve.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),ge.current===a&&(ge.current=null),_e.current=null;return}k.current=!0,ge.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),pe.current=n;let e=a.getBoundingClientRect(),s=Mv(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Gt(s),fe.current=s,he.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=he.current;n!=null&&fe.current!=null&&(fe.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Jt(qt(t.clientX,t.clientY)),Xt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&qt(n.clientX,n.clientY),t.completeDrag(),Kt()},u=()=>{t.cancelDrag(),Kt()};me.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},Ev)},en=e=>{if(N!=null){if(e.key===`Escape`){Pt(),e.preventDefault(),e.stopPropagation();return}Uv.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(ot.isActive()){if(e.isComposing||e.keyCode===229)return;if(e.key===`Escape`)ot.cancel();else if(e.key===`Enter`)ot.commit();else return;Ee(`focus`),be(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Lt(P??void 0),e.preventDefault(),e.stopPropagation();return}if(lt){if(e.key===`Escape`)oe.current=!1,se.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=z_(n,L);se.current=F<0||n==null?null:Math.max(0,Math.min(F*s-n.scrollTop,Math.max(0,r-s))),oe.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;Ee(`focus`),be(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&zv(e)){t.openSearch(e.key),be(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Ye&&Vv(e),r=Hv(e,Ye),i=r&&S.current!=null?R_(S.current):null,a=r?new Set(Xv(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==P&&a.has(o)){let e=C.current;Re(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=Lv(p)?p:null,h=u!=null&&(Et.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=Yv(u,w.current,te.current);e==null||n==null?y=!1:It(e,u)}else if((e.ctrlKey||e.metaKey)&&Rv(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;Ee(`focus`);let b=t.getFocusedPath(),x=b!=null&&(Et.has(b)||a.has(b)),ee=g&&b!==u,T=n&&c&&o===u&&b===u;if((h||T)&&b!=null&&(ee&&x||T))Re(b,v?.scrollTop??null),D.current=!0,Ce(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(ze(b,Qv(S.current,v,i,u,s,Tt,L)),D.current=!0,Ce(e=>e===b?e:b)):Le()}be(e=>e+1),e.preventDefault(),e.stopPropagation()};fv(()=>{if(!(!f||!lt)){if(Be.current){Be.current=!1;return}L_(ee.current)}},[lt,f]),fv(()=>{let e=x.current;switch(K_({hasRenderedInput:e!=null,previousRenamingPath:O.current,renamingPath:st})){case`reset`:O.current=null;return;case`reveal-canonical`:st!=null&&Rt(st,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(je.current=null,O.current=st,L_(e),e.select());return}},[xt.end,xt.start,st,Rt,Et]),fv(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=R_(e)?.dataset.itemPath??null;Ce(e=>e===t?e:t)},i=()=>{n(),D.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,R_(e)!=null){r();return}D.current=!1,Ce(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),D.current=!1,Ce(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;Ce(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),fv(()=>{let e=S.current;e!=null&&(I.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[I.physical.scrollTop]),fv(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;E.current=z_(n,g);let a=()=>{let e=t.getVisibleCount(),r=B_(E.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Ke(Tv({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!re.current){re.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=B_(E.current,g),i=t.getVisibleRows(e,e)[0]??null;H_(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}T.current=a;let o=t.subscribe(()=>{N_(xe)&&be(e=>e+1),a()}),l=()=>{Ie.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,Oe(e=>e+1),e=null},50))},u=null,d=()=>{i!=null&&delete i.dataset.overlayReveal,u!=null&&(clearTimeout(u),u=null)},f=()=>{i!=null&&Ie.current!==!0&&(n.scrollTop>0||(i.dataset.overlayReveal=`true`,u!=null&&clearTimeout(u),u=setTimeout(()=>{d()},200)))},p=()=>{if(a(),n.scrollTop>0&&d(),Ae.current!=null&&y.current&&Nt.current(),Ie.current===!0){y.current=!1;return}we(e=>e==null?e:null),l()},m=()=>{l(),f()},_=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),v=e=>{_.has(e.key)&&m()};n.addEventListener(`scroll`,p,{passive:!0}),n.addEventListener(`wheel`,m,{passive:!0}),n.addEventListener(`touchmove`,m,{passive:!0}),n.addEventListener(`keydown`,v);let x=typeof ResizeObserver<`u`?new ResizeObserver(e=>{E.current=(e[0]==null?null:V_(e[0]))??z_(n,g),a()}):null;return x?.observe(n),()=>{T.current=()=>{},o(),n.removeEventListener(`scroll`,p),n.removeEventListener(`wheel`,m),n.removeEventListener(`touchmove`,m),n.removeEventListener(`keydown`,v),e!=null&&clearTimeout(e),u!=null&&clearTimeout(u),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,E.current=null,x?.disconnect()}},[t,g,s,c,h]),fv(()=>{Ye||N==null||Pt(!1)},[Pt,Ye,N]);let tn=pv(()=>N==null?null:`${N.path}::${N.source}`,[N]);fv(()=>{if(tn==null){m?.clearSlotContent(fd);return}let t=Ae.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??Gv(n.getBoundingClientRect()),close:e=>{Nt.current(e?.restoreFocus??!0)},restoreFocus:()=>{Mt.current&&jt.current(Ae.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(fd,i),e?.contextMenu?.onOpen?.(t.item,r),iy(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&iy(i)}),()=>{m?.clearSlotContent(fd)}},[tn,e?.contextMenu,m]),fv(()=>{N!=null&&t.getItem(N.path)==null&&Pt()},[Pt,N,t]),fv(()=>{if(N==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(Wv(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Pt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Pt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Pt,N]),fv(()=>{let e=C.current,n=S.current;if(e==null||n==null){ae.current=P;return}let r=P==null?null:te.current.get(P)??null,i=R_(n),a=i?.dataset.itemPath??null,o=ct&&x.current===i,c=f&&ee.current===i,l=oe.current&&!lt,u=se.current??0,d=je.current,p=Me.current,m=Ne.current,g=Pe.current,_=i!=null,v=D.current||_,y=ae.current!==P,b=p!=null&&p===P&&P!=null,w=!1,E=!1;if(dt!=null&&dt.id!==ne.current){ne.current=dt.id;let n=dt.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,L-s))):Tt;w=!0,E=U_(e,n,s,L,wt,dt.offset,t)}t.clearScrollRequest(dt.id)}let re=!w&&l&&W_(e,F,s,L,wt,u),ie=!w&&d!=null&&d===P&&W_(e,F,s,L,wt,Tt),O=!w&&m!=null&&m.path===P&&W_(e,F,s,L,wt,m.viewportOffset),ce=!w&&g!=null&&g.path===P&&e.scrollTop!==g.scrollTop;if(ce&&(e.scrollTop=g.scrollTop),(ce||E||ie||O||re||v&&y&&d!==P&&!b&&H_(e,F,s,L,Tt))&&T.current(),w){ae.current=P;return}if(!v){ae.current=P;return}if(o){ae.current=P;return}if(c&&!l){ae.current=P;return}if(r==null){l&&F>=0&&(W_(e,F,s,L,wt,u),T.current()),ae.current=P;return}(y||l||d===P||p===P||m?.path===P||g?.path===P||a==null||a!==P)&&(L_(r),d===P&&(je.current=null),p===P&&(Me.current=null),m?.path===P&&(Ne.current=null),g?.path===P&&(Pe.current=null),oe.current=!1,se.current=null),ae.current=P},[t,F,P,Dt,s,ct,lt,xt,L,f,dt,h,Tt,wt,bt]);let nn=F>=0&&F>=I.visible.startIndex&&F<=I.visible.endIndex,rn=P!=null&&St.some(e=>Sv(e.row)===P),an=nn||rn,on=Ze&&D.current===!0&&an?P:null,sn=Te===`pointer`?A:null,cn=N?.path??Fe.current??sn??on??A,ln=N?.source===`right-click`;fv(()=>{y.current&&N==null||Ft(rt(cn))},[N,rt,xt,L,De,St,cn,Ft,bt]);let un=$(e=>{if(y.current||Wv(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&Ee(e=>e===`pointer`?e:`pointer`),we(e=>e===i?e:i)},[]),dn=$(()=>{we(null)},[]);fv(()=>{if(!ft)return;let e=()=>{Kt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Kt(),t.cancelDrag()}},[t,ft]);let fn=e=>{if(!ft||t.getDragSession()==null||k.current)return;let n=jv(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Jt(t.getDragSession()?.target??null),Xt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},pn=e=>{if(!ft||t.getDragSession()==null||k.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Ht(),Wt(),t.setDragTarget(null))},mn=e=>{!ft||t.getDragSession()==null||k.current||(e.preventDefault(),qt(e.clientX,e.clientY),t.completeDrag(),Ut(),Ht(),Wt(),pe.current=null)},hn=I.window.height,gn=I.window.offsetTop,_n=Math.min(0,L-hn),vn=Math.min(0,L-hn-Tt),yn=Se===P||oe.current,bn=P!=null&&yn&&!Dt&&F>=0?bt[F]??t.getVisibleRows(F,F)[0]??null:null,xn=bn==null?null:G_(F,s,xt,hn),Sn=pe.current,Cn=gt!=null&&Sn!=null&&Sn.path===gt&&Sn.index>=xt.start&&Sn.index<=xt.end,wn=gt!=null&&Sn!=null&&Sn.path===gt&&!Cn&&Sn.path!==bn?.path?Sn:null,Tn=wn==null?null:G_(wn.index,s,xt,hn),En=Bv((F>=0?bt[F]??t.getVisibleRows(F,F)[0]??null:null)?.ancestorPaths.at(-1)??null),Dn=lt&&P!=null?ty(o,P,!Dt):void 0,On=N?.path??(lt?P:Se),kn=N?.path??A,An=rt(cn),jn=Ye&&Ze&&!ln&&!ct&&An!=null&&j!=null&&cn!=null,Mn=Ye&&(jn||N!=null),Nn=N?.anchorRect,Pn=Nn==null&&An!=null&&j!=null&&(N!=null||jn)?j:null,Fn=Nn==null?Pn==null?void 0:{top:`${Pn}px`}:{left:`${Nn.left}px`,position:`fixed`,right:`auto`,top:`${Nn.top}px`},In=ln?{opacity:`0`}:void 0,Ln=$((e,n,r,i)=>{let a=Y_({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:lt,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c)}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=I.visible.startIndex&&n.index<=I.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(D.current=!0,Ce(e=>e===c?e:c),Ee(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Rt(c,{targetOffset:`sticky-parents`})},[t,lt,I.visible.endIndex,I.visible.startIndex,Rt]),Rn=()=>{if(y.current||!Ze||cn==null||An==null)return;let e=t.getItem(cn);e!=null&&(Ft(An),Mt.current=!0,ke({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:An.getAttribute(`aria-label`)??cn,path:e.getPath()},path:e.getPath(),source:`button`}))},zn={contextHoverPath:kn,contextMenuButtonTriggerEnabled:Ze,contextMenuButtonVisibility:Qe,contextMenuEnabled:Ye,contextMenuRightClickEnabled:$e,contextMenuTriggerMode:Xe,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:ft,draggedPathSet:mt,dragTarget:ht,gitLaneActive:it,gitStatusByPath:n,handleRowDragEnd:Qt,handleRowDragStart:Zt,handleRowTouchStart:$t,ignoredGitDirectories:r,ignoredInheritanceCache:ye,instanceId:o,itemHeight:s,onKeyDown:en,onRowClick:Ln,openContextMenuForRow:It,registerButton:et,registerRenameInput:nt,renameView:ot,renderDecorationForRow:Ot,resolveIcon:at,shouldSuppressContextMenu:zt,visualFocusPath:On},Bn={...zn,registerButton:tt};return Y(`div`,{ref:S,id:_t,"data-file-tree-context-menu-button-visibility":Ye&&Ze?Qe:void 0,"data-file-tree-context-menu-trigger-mode":Ye?Xe:void 0,"data-file-tree-has-context-menu-action-lane":Ye&&Ze?`true`:void 0,"data-file-tree-has-git-lane":it?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:ft?pn:void 0,onDragOver:ft?fn:void 0,onDrop:ft?mn:void 0,onKeyDown:en,onPointerLeave:Ye?dn:void 0,onPointerOver:Ye?un:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[Y(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:En}}),Y(`slot`,{name:dd,"data-type":`header-slot`}),f?Y(`div`,{"data-file-tree-search-container":!0,"data-open":lt?`true`:`false`,children:Y(`input`,{ref:ee,"aria-activedescendant":Dn,"aria-controls":_t,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ve?`true`:void 0,value:ut,onBlur:()=>{d===`retain`&&!Ue.current||t.closeSearch()},onFocus:We,onPointerDown:We,onInput:e=>{We();let n=e.currentTarget;t.setSearch(n.value)}})}):null,Y(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&qe&&St.length>0?Y(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:Y(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${vt}px`},children:St.map((e,t)=>oy(Bn,e.row,`sticky:${Sv(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${St.length-t}`}}))})}):null,Y(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${wt}px`},children:[Y(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${gn}px`}}),Y(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${hn}px`,top:`${_n}px`,bottom:`${vn}px`},children:[sy(zn,xt,Et),bn!=null&&xn!=null?oy(zn,bn,`parked:${bn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:gt===bn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${xn}px`}}):null,wn!=null&&Tn!=null?oy(zn,wn,`parked-drag:${wn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${Tn}px`}}):null]})]})]}),Ye?Y(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":Mn?`true`:`false`,style:Fn,children:[Y(`button`,{ref:v,type:`button`,"data-type":pd,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":N==null?`false`:`true`,"data-visible":jn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),N!=null){Pt();return}Rn()},tabIndex:-1,style:In,children:Y(n_,{...at(`file-tree-icon-ellipsis`)})}),N==null?null:Y(`slot`,{name:fd})]}):null,N==null?null:Y(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Pt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Pt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var ly={hydrateRoot:(e,t)=>{Zg(Dg(cy,t),e)},renderRoot:(e,t)=>{Xg(Dg(cy,t),e)},unmountRoot:e=>{Xg(null,e)}};function uy(e,t){ly.renderRoot(e,t)}function dy(e,t){ly.hydrateRoot(e,t)}function fy(e){ly.unmountRoot(e)}var py=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}};Array.isArray;var my=0;function hy(e){return e!=null&&e.length>0?e:(my+=1,`pst_ft_${my}`)}function gy({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??th)}function _y(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function vy(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function yy(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var by=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new py;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=hy(a),this.#p=rg(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=eh(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new Qh({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(fy(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getFocusedIndex(){return this.#t.getFocusedIndex()}getVisibleCount(){return this.#t.getVisibleCount()}getVisibleRows(e,t){return this.#t.getVisibleRows(e,t)}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}focusFirstItem(){this.#t.focusFirstItem()}focusLastItem(){this.#t.focusLastItem()}focusNextItem(){this.#t.focusNextItem()}focusPreviousItem(){this.#t.focusPreviousItem()}focusParentItem(){this.#t.focusParentItem()}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}applyGitStatusPatch(e){let t=ig(this.#p,e);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&uy(n.wrapper,this.#w())}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){Array.isArray(e)?this.#t.resetPaths(e,t):this.#t.resetPaths(e)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),uy(t.wrapper,this.#w()))}setGitStatus(e){let t=rg(e,this.#p);if(t===this.#p)return;this.#p=t;let n=this.#T();n!=null&&uy(n.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),uy(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),dy(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),uy(r,this.#w())}#C(){return{initialViewportHeight:gy({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(dd,e());return}this.#l.setSlotHtml(dd,this.#e?.header?.html??null)}#k(e){let t=yy(e).find(e=>vy(e)),n=_y(td(hd(this.#m).set));n!=null&&(t==null||t.outerHTML!==n.outerHTML)&&(t==null?e.prepend(n):t.replaceWith(n))}#A(e){let t=yy(e),n=t.find(e=>vy(e)),r=t.filter(e=>e!==n),i=hd(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=_y(i);if(a==null){for(let e of r)e.remove();return}if(r.length!==1||r[0].outerHTML!==a.outerHTML){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=hd(this.#m);t.colored&&rd(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${sd}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}(this.#g?.parentNode!==e||this.#_!==this.#h)&&(this.#g??=document.createElement(`style`),this.#g.setAttribute(sd,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=ah(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return dh(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},xy=`
|
|
6498
6498
|
:host {
|
|
6499
6499
|
--file-tree-font-family: var(--ui, system-ui, sans-serif);
|
|
6500
6500
|
--file-tree-font-size: 12.5px;
|
|
@@ -7006,8 +7006,12 @@ slicc-monitor {
|
|
|
7006
7006
|
margin: 6px 0 2px;
|
|
7007
7007
|
}
|
|
7008
7008
|
.monitor-tile__plot svg {
|
|
7009
|
-
|
|
7010
|
-
|
|
7009
|
+
display: block;
|
|
7010
|
+
/*
|
|
7011
|
+
* The end marker sits ON the right edge (see projectSeries), so its ring
|
|
7012
|
+
* would be sliced by the SVG box. The tile's 14px padding absorbs it.
|
|
7013
|
+
*/
|
|
7014
|
+
overflow: visible;
|
|
7011
7015
|
}
|
|
7012
7016
|
.monitor-tile__foot {
|
|
7013
7017
|
font-size: 10.5px;
|
|
@@ -7428,4 +7432,4 @@ slicc-monitor {
|
|
|
7428
7432
|
.monitor-row,
|
|
7429
7433
|
.monitor-btn { transition-duration: 0.01ms; }
|
|
7430
7434
|
}
|
|
7431
|
-
`,Wy=`slicc-monitor-style`;function Gy(e){if(e.getElementById(Wy))return;let t=e.createElement(`style`);t.id=Wy,t.textContent=Uy,(e.head??e.documentElement).appendChild(t)}var Ky={error:3,warn:2,active:1,idle:0},qy={active:`circle-check`,warn:`triangle-alert`,error:`octagon-x`,idle:`circle`},Jy={active:`Healthy`,warn:`Attention`,error:`Failing`,idle:`Idle`};function Yy(e){return e.status?e.status:e.error?`error`:e.active?`active`:`idle`}function Xy(e){if(e.status)return e.status;let t=`idle`;for(let n of e.rows){let e=Yy(n);Ky[e]>Ky[t]&&(t=e)}return t}function Zy(e){return j(`span`,{class:`monitor-glyph monitor-glyph--${e}`},n(qy[e],{size:14}))}var Qy={rose:`var(--rose)`,cyan:`var(--cyan)`,violet:`var(--violet)`,amber:`var(--amber)`,waffle:`var(--waffle)`,green:`var(--green)`};function $y(e){return e?Qy[e]:`var(--ctx)`}var eb=`http://www.w3.org/2000/svg`;function tb(e,t){let n=document.createElementNS(eb,e);for(let[e,r]of Object.entries(t))n.setAttribute(e,String(r));return n}function nb(e,t,n){let r=Math.min(...e),i=Math.max(...e)-r||1;return e.map((a,o)=>({x:3+o/(e.length-1)*(t-6),y:n-3-(a-r)/i*(n-6)}))}function rb(e,t,n,r){let i=nb(e,n,r),a=i.map(e=>`${e.x.toFixed(1)},${e.y.toFixed(1)}`).join(` `),o=i[i.length-1],s=tb(`svg`,{width:n,height:r,viewBox:`0 0 ${n} ${r}`,"aria-hidden":`true`});return s.append(tb(`polygon`,{points:`${a} ${n-3},${r} 3,${r}`,fill:t,"fill-opacity":`0.1`}),tb(`polyline`,{points:a,fill:`none`,stroke:t,"stroke-width":`2`,"stroke-linejoin":`round`,"stroke-linecap":`round`}),tb(`circle`,{cx:o.x,cy:o.y,r:`4`,fill:t,stroke:`var(--canvas)`,"stroke-width":`2`})),s}function ib(e){let t=$y(e.accent);if(e.series&&e.series.length>1){let n=e.hero?{w:300,h:56}:{w:132,h:34};return j(`div`,{class:`monitor-tile__plot`},rb(e.series,t,n.w,n.h))}if(typeof e.ratio==`number`){let n=Math.max(0,Math.min(1,e.ratio))*100;return j(`div`,{class:`monitor-tile__plot`},j(`span`,{class:`monitor-meter`,style:`--monitor-hue:${t}`},j(`span`,{class:`monitor-meter__fill`,style:`width:${n.toFixed(1)}%`})))}return null}function ab(e){let t=j(`section`,{class:`monitor-tile${e.hero?` monitor-tile--hero`:``}`,"data-vital":e.id});return we(t,[j(`span`,{class:`monitor-tile__label`},e.label),j(`div`,{class:`monitor-tile__figure`},j(`span`,{class:`monitor-tile__value`},e.value),e.unit?j(`span`,{class:`monitor-tile__unit`},e.unit):null),e.delta?j(`span`,{class:`monitor-tile__delta`},e.delta):null,ib(e),e.foot?j(`span`,{class:`monitor-tile__foot`},e.foot):null]),t}function ob(e){return j(`div`,{class:`monitor-vitals`},...e.map(ab))}function sb(e){return j(`li`,{class:`monitor-alert`,"data-severity":e.severity,"data-alert":e.id},j(`span`,{class:`monitor-alert__icon monitor-glyph--${e.severity}`},n(e.icon??qy[e.severity===`error`?`error`:`warn`],{size:16})),j(`span`,{class:`monitor-alert__copy`},j(`span`,{class:`monitor-alert__title`},e.title),e.detail?j(`span`,{class:`monitor-alert__detail`},e.detail):null),e.age?j(`span`,{class:`monitor-alert__age`},e.age):null)}function cb(){return j(`div`,{class:`monitor-clear`,role:`status`},Zy(`active`),j(`span`,{class:`monitor-clear__title`},`All clear`),j(`span`,{class:`monitor-clear__text`},`Nothing is stalled, expired, or failing.`))}function lb(e){let t=e.some(e=>e.severity===`error`)?`error`:e.length>0?`warn`:`ok`;return j(`section`,{class:`monitor-block`,"data-block":`attention`},j(`div`,{class:`monitor-block__head`},j(`h3`,{class:`monitor-block__title`},`Needs attention`),j(`span`,{class:`monitor-pill monitor-pill--${t}`},String(e.length))),e.length===0?cb():j(`ul`,{class:`monitor-alerts`},...e.map(sb)))}function ub(e){let t=Yy(e),n=j(`span`,{class:`monitor-child__headline`},j(`span`,{class:`monitor-child__name`},e.name));for(let t of e.badges??[])n.appendChild(j(`span`,{class:`monitor-badge`},t));let r=j(`span`,{class:`monitor-child__copy`},n);return e.sublabel&&r.appendChild(j(`span`,{class:`monitor-child__sublabel`},e.sublabel)),j(`li`,{class:`monitor-child`,"data-status":t,style:`padding-left:${28+(e.depth??0)*18}px`},Zy(t),r,j(`span`,{class:`monitor-child__meta`},e.meta))}function db(e){return j(`div`,{class:`monitor-empty`,role:`status`},j(`span`,{class:`monitor-empty__title`},`No ${e.label.toLocaleLowerCase()} yet`),j(`span`,{class:`monitor-empty__text`},e.emptyText??`${e.label} will appear here when available.`))}function fb(e,t,r,i,a){let o=Xy(e),s=o===`warn`||o===`error`,c=r.has(e.id)?!0:!t.has(e.id)&&s&&e.rows.length>0,l=j(`ul`,{class:`monitor-children`,id:a});e.rows.length===0?l.replaceChildren(db(e)):l.append(...e.rows.map(ub)),c||l.setAttribute(`hidden`,``);let u=j(`button`,{class:`monitor-row`,type:`button`},j(`span`,{class:`monitor-row__chev`,"aria-hidden":`true`},n(c?`chevron-down`:`chevron-right`,{size:15})),j(`span`,{class:`monitor-row__icon`},n(e.icon??`box`,{size:16})),j(`span`,{class:`monitor-row__name`},e.label),j(`span`,{class:`monitor-row__summary`},e.meta??`${e.count}`),j(`span`,{class:`monitor-row__state monitor-glyph--${o}`},Zy(o),Jy[o]));return u.setAttribute(`aria-expanded`,String(c)),u.setAttribute(`aria-controls`,a),u.addEventListener(`click`,()=>i(e.id,c)),j(`div`,{class:`monitor-group`,"data-section":e.id,"data-status":o,"data-accent":e.accent??`neutral`},u,l)}var pb=[`pid`,`ppid`,`state`,`started`,`elapsed`,`scoop`,`command`],mb=new Set([`R`,`S`]);function hb(e,t){if(t===`state`)return j(`td`,{class:`monitor-td monitor-td--state`},j(`span`,{class:`monitor-statcell`},j(`span`,{class:`monitor-stat-tag monitor-stat-tag--${e.state}`},e.state),j(`span`,{class:`monitor-stat-word`},e.status)));let n=e[t];return j(`td`,{class:`monitor-td monitor-td--${t}`},n==null?`—`:String(n))}function gb(e){return j(`tr`,{class:`monitor-tr`,"data-pid":String(e.pid),"data-live":String(mb.has(e.state))},...pb.map(t=>hb(e,t)))}function _b(e,t,n){return[...e].sort((e,r)=>{let i=e[t],a=r[t],o=typeof i==`number`&&typeof a==`number`?i-a:String(i??``).localeCompare(String(a??``));return n?-o:o})}function vb(e,t){return j(`tr`,null,...pb.map(r=>{let i=e.sort===r,a=j(`th`,{class:`monitor-th monitor-td--${r}`,scope:`col`},j(`span`,{class:`monitor-th__label`},r.toUpperCase()),i?n(e.descending?`chevron-down`:`chevron-up`,{size:12}):null);return a.setAttribute(`aria-sort`,i?e.descending?`descending`:`ascending`:`none`),a.addEventListener(`click`,()=>{e.descending=e.sort===r&&!e.descending,e.sort=r,t()}),a}))}function yb(e,t){return!t||e.command.toLowerCase().includes(t)||(e.scoop??``).toLowerCase().includes(t)||String(e.pid).includes(t)}function bb(e){let t={sort:`pid`,descending:!1,query:``},n=j(`input`,{class:`monitor-input`,type:`search`,"aria-label":`Filter processes`,placeholder:`Filter command, scoop, or pid…`}),r=j(`thead`),i=j(`tbody`),a=j(`span`,{class:`monitor-block__hint`}),o=()=>{let n=_b(e.rows,t.sort,t.descending).filter(e=>yb(e,t.query));if(r.replaceChildren(vb(t,o)),n.length===0){let e=j(`td`,{class:`monitor-td monitor-empty-cell`,colspan:pb.length});e.textContent=t.query?`No live process matches “${t.query}”.`:`No processes running.`,i.replaceChildren(j(`tr`,{class:`monitor-tr`},e))}else i.replaceChildren(...n.map(gb));let s=e.terminated>0?` · ${e.terminated.toLocaleString()} exited this session`:``;a.replaceChildren(document.createTextNode(`${e.rows.length} live${s}`))};return n.addEventListener(`input`,()=>{t.query=n.value.trim().toLowerCase(),o()}),o(),j(`section`,{class:`monitor-block`,"data-block":`processes`},j(`div`,{class:`monitor-block__head`},j(`h3`,{class:`monitor-block__title`},`Processes`),a),j(`div`,{class:`monitor-toolbar`},n),j(`div`,{class:`monitor-tablewrap`},j(`table`,{class:`monitor-table`},r,i)))}function xb(e){return{...e,rows:e.rows.map(e=>({...e,badges:e.badges?.slice()}))}}var Sb=0;A(`slicc-monitor`,class extends HTMLElement{#e={};#t=new Set;#n=new Set;#r=!1;#i=++Sb;connectedCallback(){Gy(this.ownerDocument),this.#r||=(this.#t=Vy(),!0),this.#c()}get model(){return{...this.#e,vitals:this.#e.vitals?.map(e=>({...e,series:e.series?.slice()})),alerts:this.#e.alerts?.map(e=>({...e})),sections:this.#e.sections?.map(xb),processes:this.#e.processes?{...this.#e.processes,rows:this.#e.processes.rows.map(e=>({...e}))}:this.#e.processes}}set model(e){this.#e=e??{},this.isConnected&&this.#c()}get sections(){return(this.#e.sections??[]).map(xb)}set sections(e){this.#e={...this.#e,sections:Array.isArray(e)?e.map(xb):[]},this.isConnected&&this.#c()}#a(){let e=j(`button`,{class:`monitor-btn`,type:`button`,"aria-label":`Re-sync monitor data`},n(`refresh-cw`,{size:14}),j(`span`,null,`Re-sync`));return e.addEventListener(`click`,()=>{this.dispatchEvent(new CustomEvent(`slicc-monitor-refresh`,{bubbles:!0,composed:!0}))}),j(`header`,{class:`monitor-head`},j(`span`,{class:`monitor-head__mark`},n(`activity`,{size:18})),j(`div`,{class:`monitor-head__copy`},j(`h2`,{class:`monitor-head__title`},`Live monitor`),j(`p`,{class:`monitor-head__sub`},this.#e.updated??`Streaming`)),e)}#o(e){let t=j(`div`,{class:`monitor-groups`});for(let n of e){let e=n.id.replace(/[^a-z0-9_-]/gi,`-`);t.appendChild(fb(n,this.#t,this.#n,(e,t)=>this.#s(e,t),`monitor-${this.#i}-${e}`))}return j(`section`,{class:`monitor-block`,"data-block":`topology`},j(`div`,{class:`monitor-block__head`},j(`h3`,{class:`monitor-block__title`},`Topology`),j(`span`,{class:`monitor-block__hint`},`healthy groups stay collapsed`)),t)}#s(e,t){t?(this.#n.delete(e),this.#t.add(e)):(this.#t.delete(e),this.#n.add(e)),Hy(this.#t),this.#c()}#c(){let{vitals:e=[],alerts:t,sections:n=[],processes:r}=this.#e,i=j(`div`,{class:`monitor`});we(i,[this.#a(),e.length>0?ob(e):null,t?lb(t):null,n.length>0?this.#o(n):null,r?bb(r):null]),this.replaceChildren(i)}});var Cb=e({CHAT_SURFACE_ID:()=>gl,DEFAULT_LAUNCHER_CORNER:()=>ee,DEFAULT_LAUNCHER_FOLLOWER_STATUS:()=>T,HOLD_TO_ENABLE_MS:()=>nn,LAUNCHER_FOLLOWER_STATUS_ATTR:()=>E,LAYOUT_SCHEMA_VERSION:()=>1,MACHINE_WRITTEN_MEMORY_PATH:()=>MACHINE_WRITTEN_MEMORY_PATH,PANEL_MARKER_ATTR:()=>wa,REDACTED_REAL_WORLD_MEMORY_PATH:()=>REDACTED_REAL_WORLD_MEMORY_PATH,SYNTHETIC_MEMORY_PATH:()=>SYNTHETIC_MEMORY_PATH,SliccImagePreview:()=>Yt,TOKENS_CSS:()=>rl,ensureGlobalTokens:()=>al,followSystemTheme:()=>sl,setTheme:()=>ol});export{za as a,Vo as i,al as n,ua as o,sl as r,Gi as s,Cb as t};
|
|
7435
|
+
`,Wy=`slicc-monitor-style`;function Gy(e){if(e.getElementById(Wy))return;let t=e.createElement(`style`);t.id=Wy,t.textContent=Uy,(e.head??e.documentElement).appendChild(t)}var Ky={error:3,warn:2,active:1,idle:0},qy={active:`circle-check`,warn:`triangle-alert`,error:`octagon-x`,idle:`circle`},Jy={active:`Healthy`,warn:`Attention`,error:`Failing`,idle:`Idle`};function Yy(e){return e.status?e.status:e.error?`error`:e.active?`active`:`idle`}function Xy(e){if(e.status)return e.status;let t=`idle`;for(let n of e.rows){let e=Yy(n);Ky[e]>Ky[t]&&(t=e)}return t}function Zy(e){return j(`span`,{class:`monitor-glyph monitor-glyph--${e}`},n(qy[e],{size:14}))}var Qy={rose:`var(--rose)`,cyan:`var(--cyan)`,violet:`var(--violet)`,amber:`var(--amber)`,waffle:`var(--waffle)`,green:`var(--green)`};function $y(e){return e?Qy[e]:`var(--ctx)`}var eb=`http://www.w3.org/2000/svg`;function tb(e,t){let n=document.createElementNS(eb,e);for(let[e,r]of Object.entries(t))n.setAttribute(e,String(r));return n}var nb=2,rb=nb/2,ib=4,ab=5;function ob(e,t,n){let r=e.points,i=r.map(e=>e.value),a=Math.min(...i),o=Math.max(...i)-a||1,s=t-rb,c=Math.max(0,t-2),l=r[r.length-1].at,u=e.windowMs>0?e.windowMs:1,d=l-r[0].at>0;return r.map((e,t)=>({x:d?Math.max(rb,s-Math.min(1,(l-e.at)/u)*c):rb+t/(r.length-1)*c,y:n-ab-(e.value-a)/o*(n-10)}))}function sb(e,t,n,r){let i=ob(e,n,r),a=i.map(e=>`${e.x.toFixed(1)},${e.y.toFixed(1)}`).join(` `),o=i[i.length-1],s=i[0],c=tb(`svg`,{width:n,height:r,viewBox:`0 0 ${n} ${r}`,"aria-hidden":`true`});return c.append(tb(`polygon`,{points:`${a} ${o.x.toFixed(1)},${r} ${s.x.toFixed(1)},${r}`,fill:t,"fill-opacity":`0.1`}),tb(`polyline`,{points:a,fill:`none`,stroke:t,"stroke-width":String(nb),"stroke-linejoin":`round`,"stroke-linecap":`round`}),tb(`circle`,{cx:o.x.toFixed(1),cy:o.y.toFixed(1),r:String(ib),fill:t,stroke:`var(--canvas)`,"stroke-width":String(nb)})),c}var cb={hero:{w:300,h:56},tile:{w:132,h:34}};function lb(e,t,n,r){let i=j(`div`,{class:`monitor-tile__plot`}),a=0,o=r=>{let o=Math.round(r);o<=0||o===a||(a=o,i.replaceChildren(sb(e,t,o,n.h)))};if(o(n.w),typeof ResizeObserver==`function`){let e=new ResizeObserver(e=>{for(let t of e)o(t.contentRect.width)});e.observe(i),r.push(e)}return i}function ub(e,t){let n=$y(e.accent);if(e.series&&e.series.points.length>1)return lb(e.series,n,e.hero?cb.hero:cb.tile,t);if(typeof e.ratio==`number`){let t=Math.max(0,Math.min(1,e.ratio))*100;return j(`div`,{class:`monitor-tile__plot`},j(`span`,{class:`monitor-meter`,style:`--monitor-hue:${n}`},j(`span`,{class:`monitor-meter__fill`,style:`width:${t.toFixed(1)}%`})))}return null}function db(e,t){let n=j(`section`,{class:`monitor-tile${e.hero?` monitor-tile--hero`:``}`,"data-vital":e.id});return we(n,[j(`span`,{class:`monitor-tile__label`},e.label),j(`div`,{class:`monitor-tile__figure`},j(`span`,{class:`monitor-tile__value`},e.value),e.unit?j(`span`,{class:`monitor-tile__unit`},e.unit):null),e.delta?j(`span`,{class:`monitor-tile__delta`},e.delta):null,ub(e,t),e.foot?j(`span`,{class:`monitor-tile__foot`},e.foot):null]),n}function fb(e,t){return j(`div`,{class:`monitor-vitals`},...e.map(e=>db(e,t)))}function pb(e){return j(`li`,{class:`monitor-alert`,"data-severity":e.severity,"data-alert":e.id},j(`span`,{class:`monitor-alert__icon monitor-glyph--${e.severity}`},n(e.icon??qy[e.severity===`error`?`error`:`warn`],{size:16})),j(`span`,{class:`monitor-alert__copy`},j(`span`,{class:`monitor-alert__title`},e.title),e.detail?j(`span`,{class:`monitor-alert__detail`},e.detail):null),e.age?j(`span`,{class:`monitor-alert__age`},e.age):null)}function mb(){return j(`div`,{class:`monitor-clear`,role:`status`},Zy(`active`),j(`span`,{class:`monitor-clear__title`},`All clear`),j(`span`,{class:`monitor-clear__text`},`Nothing is stalled, expired, or failing.`))}function hb(e){let t=e.some(e=>e.severity===`error`)?`error`:e.length>0?`warn`:`ok`;return j(`section`,{class:`monitor-block`,"data-block":`attention`},j(`div`,{class:`monitor-block__head`},j(`h3`,{class:`monitor-block__title`},`Needs attention`),j(`span`,{class:`monitor-pill monitor-pill--${t}`},String(e.length))),e.length===0?mb():j(`ul`,{class:`monitor-alerts`},...e.map(pb)))}function gb(e){let t=Yy(e),n=j(`span`,{class:`monitor-child__headline`},j(`span`,{class:`monitor-child__name`},e.name));for(let t of e.badges??[])n.appendChild(j(`span`,{class:`monitor-badge`},t));let r=j(`span`,{class:`monitor-child__copy`},n);return e.sublabel&&r.appendChild(j(`span`,{class:`monitor-child__sublabel`},e.sublabel)),j(`li`,{class:`monitor-child`,"data-status":t,style:`padding-left:${28+(e.depth??0)*18}px`},Zy(t),r,j(`span`,{class:`monitor-child__meta`},e.meta))}function _b(e){return j(`div`,{class:`monitor-empty`,role:`status`},j(`span`,{class:`monitor-empty__title`},`No ${e.label.toLocaleLowerCase()} yet`),j(`span`,{class:`monitor-empty__text`},e.emptyText??`${e.label} will appear here when available.`))}function vb(e,t,r,i,a){let o=Xy(e),s=o===`warn`||o===`error`,c=r.has(e.id)?!0:!t.has(e.id)&&s&&e.rows.length>0,l=j(`ul`,{class:`monitor-children`,id:a});e.rows.length===0?l.replaceChildren(_b(e)):l.append(...e.rows.map(gb)),c||l.setAttribute(`hidden`,``);let u=j(`button`,{class:`monitor-row`,type:`button`},j(`span`,{class:`monitor-row__chev`,"aria-hidden":`true`},n(c?`chevron-down`:`chevron-right`,{size:15})),j(`span`,{class:`monitor-row__icon`},n(e.icon??`box`,{size:16})),j(`span`,{class:`monitor-row__name`},e.label),j(`span`,{class:`monitor-row__summary`},e.meta??`${e.count}`),j(`span`,{class:`monitor-row__state monitor-glyph--${o}`},Zy(o),Jy[o]));return u.setAttribute(`aria-expanded`,String(c)),u.setAttribute(`aria-controls`,a),u.addEventListener(`click`,()=>i(e.id,c)),j(`div`,{class:`monitor-group`,"data-section":e.id,"data-status":o,"data-accent":e.accent??`neutral`},u,l)}var yb=[`pid`,`ppid`,`state`,`started`,`elapsed`,`scoop`,`command`],bb=new Set([`R`,`S`]);function xb(e,t){if(t===`state`)return j(`td`,{class:`monitor-td monitor-td--state`},j(`span`,{class:`monitor-statcell`},j(`span`,{class:`monitor-stat-tag monitor-stat-tag--${e.state}`},e.state),j(`span`,{class:`monitor-stat-word`},e.status)));let n=e[t];return j(`td`,{class:`monitor-td monitor-td--${t}`},n==null?`—`:String(n))}function Sb(e){return j(`tr`,{class:`monitor-tr`,"data-pid":String(e.pid),"data-live":String(bb.has(e.state))},...yb.map(t=>xb(e,t)))}function Cb(e,t,n){return[...e].sort((e,r)=>{let i=e[t],a=r[t],o=typeof i==`number`&&typeof a==`number`?i-a:String(i??``).localeCompare(String(a??``));return n?-o:o})}function wb(e,t){return j(`tr`,null,...yb.map(r=>{let i=e.sort===r,a=j(`th`,{class:`monitor-th monitor-td--${r}`,scope:`col`},j(`span`,{class:`monitor-th__label`},r.toUpperCase()),i?n(e.descending?`chevron-down`:`chevron-up`,{size:12}):null);return a.setAttribute(`aria-sort`,i?e.descending?`descending`:`ascending`:`none`),a.addEventListener(`click`,()=>{e.descending=e.sort===r&&!e.descending,e.sort=r,t()}),a}))}function Tb(e,t){return!t||e.command.toLowerCase().includes(t)||(e.scoop??``).toLowerCase().includes(t)||String(e.pid).includes(t)}function Eb(e){let t={sort:`pid`,descending:!1,query:``},n=j(`input`,{class:`monitor-input`,type:`search`,"aria-label":`Filter processes`,placeholder:`Filter command, scoop, or pid…`}),r=j(`thead`),i=j(`tbody`),a=j(`span`,{class:`monitor-block__hint`}),o=()=>{let n=Cb(e.rows,t.sort,t.descending).filter(e=>Tb(e,t.query));if(r.replaceChildren(wb(t,o)),n.length===0){let e=j(`td`,{class:`monitor-td monitor-empty-cell`,colspan:yb.length});e.textContent=t.query?`No live process matches “${t.query}”.`:`No processes running.`,i.replaceChildren(j(`tr`,{class:`monitor-tr`},e))}else i.replaceChildren(...n.map(Sb));let s=e.terminated>0?` · ${e.terminated.toLocaleString()} exited this session`:``;a.replaceChildren(document.createTextNode(`${e.rows.length} live${s}`))};return n.addEventListener(`input`,()=>{t.query=n.value.trim().toLowerCase(),o()}),o(),j(`section`,{class:`monitor-block`,"data-block":`processes`},j(`div`,{class:`monitor-block__head`},j(`h3`,{class:`monitor-block__title`},`Processes`),a),j(`div`,{class:`monitor-toolbar`},n),j(`div`,{class:`monitor-tablewrap`},j(`table`,{class:`monitor-table`},r,i)))}function Db(e){return{...e,rows:e.rows.map(e=>({...e,badges:e.badges?.slice()}))}}var Ob=0;A(`slicc-monitor`,class extends HTMLElement{#e={};#t=new Set;#n=new Set;#r=!1;#i=++Ob;#a=[];connectedCallback(){Gy(this.ownerDocument),this.#r||=(this.#t=Vy(),!0),this.#u()}disconnectedCallback(){this.#o()}#o(){for(let e of this.#a)e.disconnect();this.#a=[]}get model(){return{...this.#e,vitals:this.#e.vitals?.map(e=>({...e,series:e.series?{...e.series,points:e.series.points.map(e=>({...e}))}:e.series})),alerts:this.#e.alerts?.map(e=>({...e})),sections:this.#e.sections?.map(Db),processes:this.#e.processes?{...this.#e.processes,rows:this.#e.processes.rows.map(e=>({...e}))}:this.#e.processes}}set model(e){this.#e=e??{},this.isConnected&&this.#u()}get sections(){return(this.#e.sections??[]).map(Db)}set sections(e){this.#e={...this.#e,sections:Array.isArray(e)?e.map(Db):[]},this.isConnected&&this.#u()}#s(){let e=j(`button`,{class:`monitor-btn`,type:`button`,"aria-label":`Re-sync monitor data`},n(`refresh-cw`,{size:14}),j(`span`,null,`Re-sync`));return e.addEventListener(`click`,()=>{this.dispatchEvent(new CustomEvent(`slicc-monitor-refresh`,{bubbles:!0,composed:!0}))}),j(`header`,{class:`monitor-head`},j(`span`,{class:`monitor-head__mark`},n(`activity`,{size:18})),j(`div`,{class:`monitor-head__copy`},j(`h2`,{class:`monitor-head__title`},`Live monitor`),j(`p`,{class:`monitor-head__sub`},this.#e.updated??`Streaming`)),e)}#c(e){let t=j(`div`,{class:`monitor-groups`});for(let n of e){let e=n.id.replace(/[^a-z0-9_-]/gi,`-`);t.appendChild(vb(n,this.#t,this.#n,(e,t)=>this.#l(e,t),`monitor-${this.#i}-${e}`))}return j(`section`,{class:`monitor-block`,"data-block":`topology`},j(`div`,{class:`monitor-block__head`},j(`h3`,{class:`monitor-block__title`},`Topology`),j(`span`,{class:`monitor-block__hint`},`healthy groups stay collapsed`)),t)}#l(e,t){t?(this.#n.delete(e),this.#t.add(e)):(this.#t.delete(e),this.#n.add(e)),Hy(this.#t),this.#u()}#u(){let{vitals:e=[],alerts:t,sections:n=[],processes:r}=this.#e;this.#o();let i=j(`div`,{class:`monitor`});we(i,[this.#s(),e.length>0?fb(e,this.#a):null,t?hb(t):null,n.length>0?this.#c(n):null,r?Eb(r):null]),this.replaceChildren(i)}});var kb=e({CHAT_SURFACE_ID:()=>gl,DEFAULT_LAUNCHER_CORNER:()=>ee,DEFAULT_LAUNCHER_FOLLOWER_STATUS:()=>T,HOLD_TO_ENABLE_MS:()=>rn,LAUNCHER_FOLLOWER_STATUS_ATTR:()=>E,LAYOUT_SCHEMA_VERSION:()=>1,MACHINE_WRITTEN_MEMORY_PATH:()=>MACHINE_WRITTEN_MEMORY_PATH,PANEL_MARKER_ATTR:()=>Ta,REDACTED_REAL_WORLD_MEMORY_PATH:()=>REDACTED_REAL_WORLD_MEMORY_PATH,SYNTHETIC_MEMORY_PATH:()=>SYNTHETIC_MEMORY_PATH,SliccImagePreview:()=>Xt,TOKENS_CSS:()=>rl,ensureGlobalTokens:()=>al,followSystemTheme:()=>sl,setTheme:()=>ol});export{Ba as a,Ho as i,al as n,da as o,sl as r,Ki as s,kb as t};
|