turtlecode 0.3.3 → 0.3.5
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/assets/assets/{_basePickBy-CDfmhcx9.js → _basePickBy-CmMBZyDf.js} +1 -1
- package/assets/assets/{_baseUniq-lZFgHXiE.js → _baseUniq-lALnZV2o.js} +1 -1
- package/assets/assets/{arc-CiWtZddM.js → arc-BcR6HE20.js} +1 -1
- package/assets/assets/{architectureDiagram-2XIMDMQ5-Bmno1HM3.js → architectureDiagram-2XIMDMQ5-BrL5a0qj.js} +1 -1
- package/assets/assets/{auth-callback-ZxYbdxkK.js → auth-callback-_vvdzu1l.js} +1 -1
- package/assets/assets/{blockDiagram-WCTKOSBZ-DCVQzyEi.js → blockDiagram-WCTKOSBZ-CqjhEIG9.js} +1 -1
- package/assets/assets/{c4Diagram-IC4MRINW-uMGZlC4G.js → c4Diagram-IC4MRINW-DVBZtDVs.js} +1 -1
- package/assets/assets/channel-CQQB8u0V.js +1 -0
- package/assets/assets/{chunk-4BX2VUAB-CHvACcDF.js → chunk-4BX2VUAB-BS58LR0l.js} +1 -1
- package/assets/assets/{chunk-55IACEB6-CySRX9XJ.js → chunk-55IACEB6-B90tZn59.js} +1 -1
- package/assets/assets/{chunk-FMBD7UC4-Cevh108R.js → chunk-FMBD7UC4-cIL--xUZ.js} +1 -1
- package/assets/assets/{chunk-JSJVCQXG-ao6O7SVj.js → chunk-JSJVCQXG-qqpsp7ar.js} +1 -1
- package/assets/assets/{chunk-KX2RTZJC-Cw6c-gYk.js → chunk-KX2RTZJC-CHjAkMQj.js} +1 -1
- package/assets/assets/{chunk-NQ4KR5QH-CbT-L2Dq.js → chunk-NQ4KR5QH-4ovSBYw1.js} +1 -1
- package/assets/assets/{chunk-QZHKN3VN-r54d9Sl2.js → chunk-QZHKN3VN-dwQ8FPdc.js} +1 -1
- package/assets/assets/{chunk-VVM5DH6Z-DC7a68f8.js → chunk-VVM5DH6Z-Dno15NPb.js} +1 -1
- package/assets/assets/{chunk-WL4C6EOR-CfBu2d3r.js → chunk-WL4C6EOR-ChbxZ1g-.js} +1 -1
- package/assets/assets/classDiagram-VBA2DB6C-BcxnuOq0.js +1 -0
- package/assets/assets/classDiagram-v2-RAHNMMFH-BcxnuOq0.js +1 -0
- package/assets/assets/clone-DjhGh0aP.js +1 -0
- package/assets/assets/{connection-popover-Mm718MbR.js → connection-popover-B-9E-RAf.js} +1 -1
- package/assets/assets/{context-popover-DIsMB9at.js → context-popover-BlpFdt33.js} +1 -1
- package/assets/assets/{cose-bilkent-S5V4N54A-BATNfXGW.js → cose-bilkent-S5V4N54A-BqnDa6eL.js} +1 -1
- package/assets/assets/{cssMode-CPTYeS11.js → cssMode-BwF1fxAj.js} +1 -1
- package/assets/assets/{dagre-KLK3FWXG-BFmHdvHh.js → dagre-KLK3FWXG-BFVywJ5e.js} +1 -1
- package/assets/assets/{diagram-E7M64L7V-CiLx0HjV.js → diagram-E7M64L7V-B3c03BVx.js} +1 -1
- package/assets/assets/{diagram-IFDJBPK2-BUaIBpmy.js → diagram-IFDJBPK2-DSktkOKI.js} +1 -1
- package/assets/assets/{diagram-P4PSJMXO-BgD_PzW6.js → diagram-P4PSJMXO-CpajuJrZ.js} +1 -1
- package/assets/assets/{dialog-clone-project-C7k2pNz7.js → dialog-clone-project-D78pS1R8.js} +1 -1
- package/assets/assets/{dialog-connect-provider-B8rrSrpR.js → dialog-connect-provider-DtYBi8pJ.js} +2 -2
- package/assets/assets/{dialog-create-project-DjSz5fKF.js → dialog-create-project-DZIA0DQF.js} +1 -1
- package/assets/assets/{dialog-edit-project-aGSXOj6x.js → dialog-edit-project-B91zPs73.js} +1 -1
- package/assets/assets/{dialog-fork-CJPj-aUt.js → dialog-fork-DFnsJbEn.js} +1 -1
- package/assets/assets/{dialog-manage-models-Dhl_0u0F.js → dialog-manage-models-CfjvaHIZ.js} +1 -1
- package/assets/assets/{dialog-select-directory-D84XEi3u.js → dialog-select-directory-CuuUL7us.js} +3 -3
- package/assets/assets/{dialog-select-file-DLuEm8R1.js → dialog-select-file-BCVBORpO.js} +1 -1
- package/assets/assets/{dialog-select-mcp-CvmzHC8a.js → dialog-select-mcp-BzrRaKIi.js} +1 -1
- package/assets/assets/{dialog-select-model-unpaid-CBPy-OtK.js → dialog-select-model-unpaid-gAhcQ-2T.js} +2 -2
- package/assets/assets/{dialog-select-provider-BAPqXfpR.js → dialog-select-provider-Da3OoYdK.js} +1 -1
- package/assets/assets/{dialog-select-server-CPIZBmuF.js → dialog-select-server-UCc0uaGh.js} +1 -1
- package/assets/assets/{dialog-settings-Bk-jMPkO.js → dialog-settings-Wsa2poSm.js} +1 -1
- package/assets/assets/{erDiagram-INFDFZHY-D26xOve6.js → erDiagram-INFDFZHY-CFhMXY1q.js} +1 -1
- package/assets/assets/{file-icon-BZV7RBUG.js → file-icon-DCdf-9qH.js} +1 -1
- package/assets/assets/{flowDiagram-PKNHOUZH-CQRwEuPJ.js → flowDiagram-PKNHOUZH-BxC5oYgt.js} +1 -1
- package/assets/assets/{freemarker2-DVBIrMW3.js → freemarker2-XjHMwN2V.js} +1 -1
- package/assets/assets/{ganttDiagram-A5KZAMGK-BrEbL6fO.js → ganttDiagram-A5KZAMGK-BDD2cxRj.js} +1 -1
- package/assets/assets/{ghostty-web-D0EfxmGr.js → ghostty-web-CXzJhbVj.js} +1 -1
- package/assets/assets/{gitGraphDiagram-K3NZZRJ6-Cv3l4By7.js → gitGraphDiagram-K3NZZRJ6-Bos7kC10.js} +1 -1
- package/assets/assets/{graph-D7I4UhA2.js → graph-Dw06UHjD.js} +1 -1
- package/assets/assets/{handlebars-CIC4uHM4.js → handlebars-BxkRxjf3.js} +1 -1
- package/assets/assets/{home-BKqFRRgM.js → home-KBuxIbfS.js} +1 -1
- package/assets/assets/{html-dRRW9JsT.js → html-b79FxAPz.js} +1 -1
- package/assets/assets/{htmlMode-p1o6q0gC.js → htmlMode-C323VrfA.js} +1 -1
- package/assets/assets/{index-CCzVn-5f.js → index-DeRCyL0u.js} +19 -19
- package/assets/assets/{infoDiagram-LFFYTUFH-C8JbBg1H.js → infoDiagram-LFFYTUFH-BAQ6JJbu.js} +1 -1
- package/assets/assets/{ishikawaDiagram-PHBUUO56-Bw25suVv.js → ishikawaDiagram-PHBUUO56-CEv-Z1_L.js} +1 -1
- package/assets/assets/{javascript-DVffDs86.js → javascript-DwxIqgyj.js} +1 -1
- package/assets/assets/{jobs-popover-CfipWaYV.js → jobs-popover-CN3yxape.js} +1 -1
- package/assets/assets/{journeyDiagram-4ABVD52K-B5srLokV.js → journeyDiagram-4ABVD52K-Olyq6oR4.js} +1 -1
- package/assets/assets/{jsonMode-BKwofy7X.js → jsonMode-COHV_P-c.js} +1 -1
- package/assets/assets/{kanban-definition-K7BYSVSG-C-_5DqMT.js → kanban-definition-K7BYSVSG-B7CZDe3s.js} +1 -1
- package/assets/assets/{layout-DBFrwqbp.js → layout-Bjmc6K2S.js} +1 -1
- package/assets/assets/{liquid-CjIB2WvF.js → liquid-C5gK55a9.js} +1 -1
- package/assets/assets/{list-BE7VaqXn.js → list-r-C0jWe3.js} +1 -1
- package/assets/assets/{mdx-BNgyWV6s.js → mdx-CN9d-Ra0.js} +1 -1
- package/assets/assets/{mermaid.core-B2qSjKru.js → mermaid.core-BEWtGc16.js} +5 -5
- package/assets/assets/{mindmap-definition-YRQLILUH-BHsDE4eq.js → mindmap-definition-YRQLILUH-BSid2GOJ.js} +1 -1
- package/assets/assets/{pieDiagram-SKSYHLDU-DN_upNFc.js → pieDiagram-SKSYHLDU-Cw1wWwYe.js} +1 -1
- package/assets/assets/{python-DMQiCX6e.js → python-DWmCL4CU.js} +1 -1
- package/assets/assets/{quadrantDiagram-337W2JSQ-BOOS8E7v.js → quadrantDiagram-337W2JSQ-CruEt9rt.js} +1 -1
- package/assets/assets/{razor-C6SMnv0Y.js → razor-Cq1Fzcsf.js} +1 -1
- package/assets/assets/{requirementDiagram-Z7DCOOCP-Bqii1TD-.js → requirementDiagram-Z7DCOOCP-Cq1yMBf5.js} +1 -1
- package/assets/assets/{sankeyDiagram-WA2Y5GQK-DcIaTuO9.js → sankeyDiagram-WA2Y5GQK-CsCGay9Z.js} +1 -1
- package/assets/assets/{select-CmZ_rG74.js → select-DTzRSV7E.js} +1 -1
- package/assets/assets/{sequenceDiagram-2WXFIKYE-D_ACSm25.js → sequenceDiagram-2WXFIKYE-iiBON86Z.js} +1 -1
- package/assets/assets/{server-row-BHr0D3Wt.js → server-row-Dz8CVHx2.js} +1 -1
- package/assets/assets/{session-CHqBQBtu.js → session-gJuaiFTU.js} +6 -6
- package/assets/assets/{stateDiagram-RAJIS63D-BQleqQwx.js → stateDiagram-RAJIS63D-DL4OboGM.js} +1 -1
- package/assets/assets/stateDiagram-v2-FVOUBMTO-gmKCfZZ6.js +1 -0
- package/assets/assets/{status-popover-body-2WZ-AJhv.js → status-popover-body-2pI5dup4.js} +2 -2
- package/assets/assets/{switch-B-D65K3W.js → switch-BuF8peZ_.js} +1 -1
- package/assets/assets/{tabs-dF_kGzHr.js → tabs-D8lg7D65.js} +1 -1
- package/assets/assets/{tag-CLcvrXEO.js → tag--guRRUJB.js} +1 -1
- package/assets/assets/{timeline-definition-YZTLITO2-xEDn7PRz.js → timeline-definition-YZTLITO2-7UMofpgr.js} +1 -1
- package/assets/assets/{treemap-KZPCXAKY-DuULHDuR.js → treemap-KZPCXAKY-qwngdrol.js} +1 -1
- package/assets/assets/{trellis-B7oy118W.js → trellis-DJj85d6A.js} +137 -137
- package/assets/assets/{trellis-badge-demo-sGSBW7BL.js → trellis-badge-demo-CVRLg01T.js} +1 -1
- package/assets/assets/{trellis-op-icon-DbCkg5XE.js → trellis-op-icon-D3kRKjFt.js} +1 -1
- package/assets/assets/{tsMode-DR55FSwY.js → tsMode-DCJbmhKp.js} +1 -1
- package/assets/assets/{typescript-VQri_wR-.js → typescript-DVTOoWhY.js} +1 -1
- package/assets/assets/{vennDiagram-LZ73GAT5-foRAPP65.js → vennDiagram-LZ73GAT5-CjckF22N.js} +1 -1
- package/assets/assets/{xml-LgHR5Pyz.js → xml-jcC0kswV.js} +1 -1
- package/assets/assets/{xychartDiagram-JWTSCODW-CK7nK_rZ.js → xychartDiagram-JWTSCODW-CZ0WJKWR.js} +1 -1
- package/assets/assets/{yaml-DE0P_eVM.js → yaml-BwS4oFV9.js} +1 -1
- package/assets/index.html +1 -1
- package/package.json +13 -13
- package/assets/assets/channel-efrqY8Kx.js +0 -1
- package/assets/assets/classDiagram-VBA2DB6C-CTugHRTX.js +0 -1
- package/assets/assets/classDiagram-v2-RAHNMMFH-CTugHRTX.js +0 -1
- package/assets/assets/clone-CCcC5C65.js +0 -1
- package/assets/assets/stateDiagram-v2-FVOUBMTO-B6EU69jt.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-DVc8C-J4.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-BZjJHVRy.js","assets/fortran-free-form-D22FLkUw.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-C8NyazO9.js","assets/r-DiinP2Uv.js","assets/latex-BdAV_C_H.js","assets/tex-CxkMU7Pf.js","assets/liquid-DYVedYrR.js","assets/marko-CPi9NSCl.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-CE9lU5zL.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-3Dk4HxPD.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DnHKYNfI.js","assets/vue-html-CChd_i61.js","assets/vue-vine-8moa0y9V.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/mermaid.core-
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();const Xe={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return cX(this.context.count)},getNextContextId(){return cX(this.context.count++)}};function cX(e){const t=String(e),n=t.length-1;return Xe.context.id+(n?String.fromCharCode(96+n):"")+t}function Wo(e){Xe.context=e}const Fne=!1,$ge=(e,t)=>e===t,za=Symbol("solid-proxy"),Vne=typeof Proxy=="function",TR=Symbol("solid-track"),ER={equals:$ge};let Hp=null,Bne=Zne;const aa=1,n2=2,Une={owned:null,cleanups:null,context:null,owner:null},tH={};var ht=null;let Pe=null,Tge=null,Zt=null,jr=null,vr=null,rq=0;function wr(e,t){const n=Zt,r=ht,i=e.length===0,a=t===void 0?r:t,o=i?Une:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>lt(()=>Ws(o)));ht=o,Zt=null;try{return Oi(s,!0)}finally{Zt=n,ht=r}}function Ce(e,t){t=t?Object.assign({},ER,t):ER;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(Pe&&Pe.running&&Pe.sources.has(n)?i=i(n.tValue):i=i(n.value)),Gne(n,i));return[Wne.bind(n),r]}function r2(e,t,n){const r=V2(e,t,!0,aa);sf(r)}function Qe(e,t,n){const r=V2(e,t,!1,aa);sf(r)}function he(e,t,n){Bne=qge;const r=V2(e,t,!1,aa),i=n0&&Lt(n0);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),vr?vr.push(r):sf(r)}function Z(e,t,n){n=n?Object.assign({},ER,n):ER;const r=V2(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,sf(r),Wne.bind(r)}function Ege(e){return e&&typeof e=="object"&&"then"in e}function Yr(e,t,n){let r,i,a;typeof t=="function"?(r=e,i=t,a=n||{}):(r=!0,i=e,a=t||{});let o=null,s=tH,l=null,c=!1,u=!1,h="initialValue"in a,m=typeof r=="function"&&Z(r);const g=new Set,[y,v]=(a.storage||Ce)(a.initialValue),[k,b]=Ce(void 0),[x,w]=Ce(void 0,{equals:!1}),[M,_]=Ce(h?"ready":"unresolved");Xe.context&&(l=Xe.getNextContextId(),a.ssrLoadFrom==="initial"?s=a.initialValue:Xe.load&&Xe.has(l)&&(s=Xe.load(l)));function C(D,P,O,E){return o===D&&(o=null,E!==void 0&&(h=!0),(D===s||P===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(E,{value:P})),s=tH,Pe&&D&&c?(Pe.promises.delete(D),c=!1,Oi(()=>{Pe.running=!0,L(P,O)},!1)):L(P,O)),P}function L(D,P){Oi(()=>{P===void 0&&v(()=>D),_(P!==void 0?"errored":h?"ready":"unresolved"),b(P);for(const O of g.keys())O.decrement();g.clear()},!1)}function S(){const D=n0&&Lt(n0),P=y(),O=k();if(O!==void 0&&!o)throw O;return Zt&&!Zt.user&&D&&r2(()=>{x(),o&&(D.resolved&&Pe&&c?Pe.promises.add(o):g.has(D)||(D.increment(),g.add(D)))}),P}function I(D=!0){if(D!==!1&&u)return;u=!1;const P=m?m():r;if(c=Pe&&Pe.running,P==null||P===!1){C(o,lt(y));return}Pe&&o&&Pe.promises.delete(o);let O;const E=s!==tH?s:lt(()=>{try{return i(P,{value:y(),refetching:D})}catch(T){O=T}});if(O!==void 0){C(o,void 0,ny(O),P);return}else if(!Ege(E))return C(o,E,void 0,P),E;return o=E,"v"in E?(E.s===1?C(o,E.v,void 0,P):C(o,void 0,ny(E.v),P),E):(u=!0,queueMicrotask(()=>u=!1),Oi(()=>{_(h?"refreshing":"pending"),w()},!1),E.then(T=>C(E,T,void 0,P),T=>C(E,void 0,ny(T),P)))}Object.defineProperties(S,{state:{get:()=>M()},error:{get:()=>k()},loading:{get(){const D=M();return D==="pending"||D==="refreshing"}},latest:{get(){if(!h)return S();const D=k();if(D&&!o)throw D;return y()}}});let A=ht;return m?r2(()=>(A=ht,I(!1))):I(!1),[S,{refetch:D=>Go(A,()=>I(D)),mutate:v}]}function ct(e){return Oi(e,!1)}function lt(e){if(Zt===null)return e();const t=Zt;Zt=null;try{return e()}finally{Zt=t}}function vn(e,t,n){const r=Array.isArray(e);let i,a=n&&n.defer;return o=>{let s;if(r){s=Array(e.length);for(let c=0;c<e.length;c++)s[c]=e[c]()}else s=e();if(a)return a=!1,o;const l=lt(()=>t(s,i,o));return i=s,l}}function dn(e){he(()=>lt(e))}function me(e){return ht===null||(ht.cleanups===null?ht.cleanups=[e]:ht.cleanups.push(e)),e}function Pge(e,t){Hp||(Hp=Symbol("error")),ht=V2(void 0,void 0,!0),ht.context={...ht.context,[Hp]:[t]},Pe&&Pe.running&&Pe.sources.add(ht);try{return e()}catch(n){B2(n)}finally{ht=ht.owner}}function sV(){return Zt}function qa(){return ht}function Go(e,t){const n=ht,r=Zt;ht=e,Zt=null;try{return Oi(t,!0)}catch(i){B2(i)}finally{ht=n,Zt=r}}function Dge(e){if(Pe&&Pe.running)return e(),Pe.done;const t=Zt,n=ht;return Promise.resolve().then(()=>{Zt=t,ht=n;let r;return n0&&(r=Pe||(Pe={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(i=>r.resolve=i)),r.running=!0),Oi(e,!1),Zt=ht=null,r?r.done:void 0})}const[kJt,dX]=Ce(!1);function Oge(e){vr.push.apply(vr,e),e.length=0}function Tt(e,t){const n=Symbol("context");return{id:n,Provider:jge(n),defaultValue:e}}function Lt(e){let t;return ht&&ht.context&&(t=ht.context[e.id])!==void 0?t:e.defaultValue}function iq(e){const t=Z(e),n=Z(()=>lV(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let n0;function Rge(){return n0||(n0=Tt())}function Wne(){const e=Pe&&Pe.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===aa)sf(this);else{const t=jr;jr=null,Oi(()=>DR(this),!1),jr=t}if(Zt){const t=this.observers?this.observers.length:0;Zt.sources?(Zt.sources.push(this),Zt.sourceSlots.push(t)):(Zt.sources=[this],Zt.sourceSlots=[t]),this.observers?(this.observers.push(Zt),this.observerSlots.push(Zt.sources.length-1)):(this.observers=[Zt],this.observerSlots=[Zt.sources.length-1])}return e&&Pe.sources.has(this)?this.tValue:this.value}function Gne(e,t,n){let r=Pe&&Pe.running&&Pe.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(Pe){const i=Pe.running;(i||!n&&Pe.sources.has(e))&&(Pe.sources.add(e),e.tValue=t),i||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&Oi(()=>{for(let i=0;i<e.observers.length;i+=1){const a=e.observers[i],o=Pe&&Pe.running;o&&Pe.disposed.has(a)||((o?!a.tState:!a.state)&&(a.pure?jr.push(a):vr.push(a),a.observers&&Kne(a)),o?a.tState=aa:a.state=aa)}if(jr.length>1e6)throw jr=[],new Error},!1)}return t}function sf(e){if(!e.fn)return;Ws(e);const t=rq;uX(e,Pe&&Pe.running&&Pe.sources.has(e)?e.tValue:e.value,t),Pe&&!Pe.running&&Pe.sources.has(e)&&queueMicrotask(()=>{Oi(()=>{Pe&&(Pe.running=!0),Zt=ht=e,uX(e,e.tValue,t),Zt=ht=null},!1)})}function uX(e,t,n){let r;const i=ht,a=Zt;Zt=ht=e;try{r=e.fn(t)}catch(o){return e.pure&&(Pe&&Pe.running?(e.tState=aa,e.tOwned&&e.tOwned.forEach(Ws),e.tOwned=void 0):(e.state=aa,e.owned&&e.owned.forEach(Ws),e.owned=null)),e.updatedAt=n+1,B2(o)}finally{Zt=a,ht=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Gne(e,r,!0):Pe&&Pe.running&&e.pure?(Pe.sources.has(e)||(e.value=r),Pe.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function V2(e,t,n,r=aa,i){const a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ht,context:ht?ht.context:null,pure:n};return Pe&&Pe.running&&(a.state=0,a.tState=r),ht===null||ht!==Une&&(Pe&&Pe.running&&ht.pure?ht.tOwned?ht.tOwned.push(a):ht.tOwned=[a]:ht.owned?ht.owned.push(a):ht.owned=[a]),a}function PR(e){const t=Pe&&Pe.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===n2)return DR(e);if(e.suspense&<(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<rq);){if(t&&Pe.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let i=e,a=n[r+1];for(;(i=i.owner)&&i!==a;)if(Pe.disposed.has(i))return}if((t?e.tState:e.state)===aa)sf(e);else if((t?e.tState:e.state)===n2){const i=jr;jr=null,Oi(()=>DR(e,n[0]),!1),jr=i}}}function Oi(e,t){if(jr)return e();let n=!1;t||(jr=[]),vr?n=!0:vr=[],rq++;try{const r=e();return zge(n),r}catch(r){n||(vr=null),jr=null,B2(r)}}function zge(e){if(jr&&(Zne(jr),jr=null),e)return;let t;if(Pe){if(!Pe.promises.size&&!Pe.queue.size){const r=Pe.sources,i=Pe.disposed;vr.push.apply(vr,Pe.effects),t=Pe.resolve;for(const a of vr)"tState"in a&&(a.state=a.tState),delete a.tState;Pe=null,Oi(()=>{for(const a of i)Ws(a);for(const a of r){if(a.value=a.tValue,a.owned)for(let o=0,s=a.owned.length;o<s;o++)Ws(a.owned[o]);a.tOwned&&(a.owned=a.tOwned),delete a.tValue,delete a.tOwned,a.tState=0}dX(!1)},!1)}else if(Pe.running){Pe.running=!1,Pe.effects.push.apply(Pe.effects,vr),vr=null,dX(!0);return}}const n=vr;vr=null,n.length&&Oi(()=>Bne(n),!1),t&&t()}function Zne(e){for(let t=0;t<e.length;t++)PR(e[t])}function qge(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:PR(r)}if(Xe.context){if(Xe.count){Xe.effects||(Xe.effects=[]),Xe.effects.push(...e.slice(0,n));return}Wo()}for(Xe.effects&&(Xe.done||!Xe.count)&&(e=[...Xe.effects,...e],n+=Xe.effects.length,delete Xe.effects),t=0;t<n;t++)PR(e[t])}function DR(e,t){const n=Pe&&Pe.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){const i=e.sources[r];if(i.sources){const a=n?i.tState:i.state;a===aa?i!==t&&(!i.updatedAt||i.updatedAt<rq)&&PR(i):a===n2&&DR(i,t)}}}function Kne(e){const t=Pe&&Pe.running;for(let n=0;n<e.observers.length;n+=1){const r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=n2:r.state=n2,r.pure?jr.push(r):vr.push(r),r.observers&&Kne(r))}}function Ws(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const a=i.pop(),o=n.observerSlots.pop();r<i.length&&(a.sourceSlots[o]=r,i[r]=a,n.observerSlots[r]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Ws(e.tOwned[t]);delete e.tOwned}if(Pe&&Pe.running&&e.pure)Xne(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Ws(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}Pe&&Pe.running?e.tState=0:e.state=0}function Xne(e,t){if(t||(e.tState=0,Pe.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)Xne(e.owned[n])}function ny(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function hX(e,t,n){try{for(const r of t)r(e)}catch(r){B2(r,n&&n.owner||null)}}function B2(e,t=ht){const n=Hp&&t&&t.context&&t.context[Hp],r=ny(e);if(!n)throw r;vr?vr.push({fn(){hX(r,n,t)},state:aa}):hX(r,n,t)}function lV(e){if(typeof e=="function"&&!e.length)return lV(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=lV(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function jge(e,t){return function(r){let i;return Qe(()=>i=lt(()=>(ht.context={...ht.context,[e]:r.value},iq(()=>r.children))),void 0),i}}const cV=Symbol("fallback");function OR(e){for(let t=0;t<e.length;t++)e[t]()}function Hge(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return me(()=>OR(a)),()=>{let l=e()||[],c=l.length,u,h;return l[TR],lt(()=>{let g,y,v,k,b,x,w,M,_;if(c===0)o!==0&&(OR(a),a=[],r=[],i=[],o=0,s&&(s=[])),n.fallback&&(r=[cV],i[0]=wr(C=>(a[0]=C,n.fallback())),o=1);else if(o===0){for(i=new Array(c),h=0;h<c;h++)r[h]=l[h],i[h]=wr(m);o=c}else{for(v=new Array(c),k=new Array(c),s&&(b=new Array(c)),x=0,w=Math.min(o,c);x<w&&r[x]===l[x];x++);for(w=o-1,M=c-1;w>=x&&M>=x&&r[w]===l[M];w--,M--)v[M]=i[w],k[M]=a[w],s&&(b[M]=s[w]);for(g=new Map,y=new Array(M+1),h=M;h>=x;h--)_=l[h],u=g.get(_),y[h]=u===void 0?-1:u,g.set(_,h);for(u=x;u<=w;u++)_=r[u],h=g.get(_),h!==void 0&&h!==-1?(v[h]=i[u],k[h]=a[u],s&&(b[h]=s[u]),h=y[h],g.set(_,h)):a[u]();for(h=x;h<c;h++)h in v?(i[h]=v[h],a[h]=k[h],s&&(s[h]=b[h],s[h](h))):i[h]=wr(m);i=i.slice(0,o=c),r=l.slice(0)}return i});function m(g){if(a[h]=g,s){const[y,v]=Ce(h);return s[h]=v,t(l[h],y)}return t(l[h])}}}function Fge(e,t,n={}){let r=[],i=[],a=[],o=[],s=0,l;return me(()=>OR(a)),()=>{const c=e()||[],u=c.length;return c[TR],lt(()=>{if(u===0)return s!==0&&(OR(a),a=[],r=[],i=[],s=0,o=[]),n.fallback&&(r=[cV],i[0]=wr(m=>(a[0]=m,n.fallback())),s=1),i;for(r[0]===cV&&(a[0](),a=[],r=[],i=[],s=0),l=0;l<u;l++)l<r.length&&r[l]!==c[l]?o[l](()=>c[l]):l>=r.length&&(i[l]=wr(h));for(;l<r.length;l++)a[l]();return s=o.length=a.length=u,r=c.slice(0),i=i.slice(0,s)});function h(m){a[l]=m;const[g,y]=Ce(c[l]);return o[l]=y,t(g,l)}}}function d(e,t){return lt(()=>e(t||{}))}function Fm(){return!0}const dV={get(e,t,n){return t===za?n:e.get(t)},has(e,t){return t===za?!0:e.has(t)},set:Fm,deleteProperty:Fm,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Fm,deleteProperty:Fm}},ownKeys(e){return e.keys()}};function nH(e){return(e=typeof e=="function"?e():e)?e:{}}function Vge(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function f(...e){let t=!1;for(let o=0;o<e.length;o++){const s=e[o];t=t||!!s&&za in s,e[o]=typeof s=="function"?(t=!0,Z(s)):s}if(Vne&&t)return new Proxy({get(o){for(let s=e.length-1;s>=0;s--){const l=nH(e[s])[o];if(l!==void 0)return l}},has(o){for(let s=e.length-1;s>=0;s--)if(o in nH(e[s]))return!0;return!1},keys(){const o=[];for(let s=0;s<e.length;s++)o.push(...Object.keys(nH(e[s])));return[...new Set(o)]}},dV);const n={},r=Object.create(null);for(let o=e.length-1;o>=0;o--){const s=e[o];if(!s)continue;const l=Object.getOwnPropertyNames(s);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const h=Object.getOwnPropertyDescriptor(s,u);if(!r[u])r[u]=h.get?{enumerable:!0,configurable:!0,get:Vge.bind(n[u]=[h.get.bind(s)])}:h.value!==void 0?h:void 0;else{const m=n[u];m&&(h.get?m.push(h.get.bind(s)):h.value!==void 0&&m.push(()=>h.value))}}}const i={},a=Object.keys(r);for(let o=a.length-1;o>=0;o--){const s=a[o],l=r[s];l&&l.get?Object.defineProperty(i,s,l):i[s]=l?l.value:void 0}return i}function Se(e,...t){const n=t.length;if(Vne&&za in e){const i=n>1?t.flat():t[0],a=t.map(o=>new Proxy({get(s){return o.includes(s)?e[s]:void 0},has(s){return o.includes(s)&&s in e},keys(){return o.filter(s=>s in e)}},dV));return a.push(new Proxy({get(o){return i.includes(o)?void 0:e[o]},has(o){return i.includes(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.includes(o))}},dV)),a}const r=[];for(let i=0;i<=n;i++)r[i]={};for(const i of Object.getOwnPropertyNames(e)){let a=n;for(let l=0;l<t.length;l++)if(t[l].includes(i)){a=l;break}const o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}function U2(e){let t,n;const r=i=>{const a=Xe.context;if(a){const[s,l]=Ce();Xe.count||(Xe.count=0),Xe.count++,(n||(n=e())).then(c=>{!Xe.done&&Wo(a),Xe.count--,l(()=>c.default),Wo()}),t=s}else if(!t){const[s]=Yr(()=>(n||(n=e())).then(l=>l.default));t=s}let o;return Z(()=>(o=t())?lt(()=>{if(!a||Xe.done)return o(i);const s=Xe.context;Wo(a);const l=o(i);return Wo(s),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}let Bge=0;function xr(){return Xe.context?Xe.getNextContextId():`cl-${Bge++}`}const Yne=e=>`Stale read from <${e}>.`;function Qt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Z(Hge(()=>e.each,e.children,t||void 0))}function bJt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Z(Fge(()=>e.each,e.children,t||void 0))}function ke(e){const t=e.keyed,n=Z(()=>e.when,void 0,void 0),r=t?n:Z(n,void 0,{equals:(i,a)=>!i==!a});return Z(()=>{const i=r();if(i){const a=e.children;return typeof a=="function"&&a.length>0?lt(()=>a(t?i:()=>{if(!lt(r))throw Yne("Show");return n()})):a}return e.fallback},void 0,void 0)}function r0(e){const t=iq(()=>e.children),n=Z(()=>{const r=t(),i=Array.isArray(r)?r:[r];let a=()=>{};for(let o=0;o<i.length;o++){const s=o,l=i[o],c=a,u=Z(()=>c()?void 0:l.when,void 0,void 0),h=l.keyed?u:Z(u,void 0,{equals:(m,g)=>!m==!g});a=()=>c()||(h()?[s,u,l]:void 0)}return a});return Z(()=>{const r=n()();if(!r)return e.fallback;const[i,a,o]=r,s=o.children;return typeof s=="function"&&s.length>0?lt(()=>s(o.keyed?a():()=>{if(lt(n)()?.[0]!==i)throw Yne("Match");return a()})):s},void 0,void 0)}function Zn(e){return e}let gh;function Uge(){gh&&[...gh].forEach(e=>e())}function Wge(e){let t;Xe.context&&Xe.load&&(t=Xe.load(Xe.getContextId()));const[n,r]=Ce(t,void 0);return gh||(gh=new Set),gh.add(r),me(()=>gh.delete(r)),Z(()=>{let i;if(i=n()){const a=e.fallback;return typeof a=="function"&&a.length?lt(()=>a(i,()=>r())):a}return Pge(()=>e.children,r)},void 0,void 0)}const Gge=Tt();function Zge(e){let t=0,n,r,i,a,o;const[s,l]=Ce(!1),c=Rge(),u={increment:()=>{++t===1&&l(!0)},decrement:()=>{--t===0&&l(!1)},inFallback:s,effects:[],resolved:!1},h=qa();if(Xe.context&&Xe.load){const y=Xe.getContextId();let v=Xe.load(y);if(v&&(typeof v!="object"||v.s!==1?i=v:Xe.gather(y)),i&&i!=="$$f"){const[k,b]=Ce(void 0,{equals:!1});a=k,i.then(()=>{if(Xe.done)return b();Xe.gather(y),Wo(r),b(),Wo()},x=>{o=x,b()})}}const m=Lt(Gge);m&&(n=m.register(u.inFallback));let g;return me(()=>g&&g()),d(c.Provider,{value:u,get children(){return Z(()=>{if(o)throw o;if(r=Xe.context,a)return a(),a=void 0;r&&i==="$$f"&&Wo();const y=Z(()=>e.children);return Z(v=>{const k=u.inFallback(),{showContent:b=!0,showFallback:x=!0}=n?n():{};if((!k||i&&i!=="$$f")&&b)return u.resolved=!0,g&&g(),g=r=i=void 0,Oge(u.effects),y();if(x)return g?v:wr(w=>(g=w,r&&(Wo({id:r.id+"F",count:0}),r=void 0),e.fallback),h)})})}})}const Kge=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],Xge=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...Kge]),Yge=new Set(["innerHTML","textContent","innerText","children"]),Jge=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Qge=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function eye(e,t){const n=Qge[e];return typeof n=="object"?n[t]?n.$:void 0:n}const tye=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),nye=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),rye={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},bt=e=>Z(()=>e());function iye(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,l=t[i-1].nextSibling,c=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){const u=a<r?s?n[s-1].nextSibling:n[a-s]:l;for(;s<a;)e.insertBefore(n[s++],u)}else if(a===s)for(;o<i;)(!c||!c.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],u),t[i]=n[a]}else{if(!c){c=new Map;let h=s;for(;h<a;)c.set(n[h],h++)}const u=c.get(t[o]);if(u!=null)if(s<u&&u<a){let h=o,m=1,g;for(;++h<i&&h<a&&!((g=c.get(t[h]))==null||g!==u+m);)m++;if(m>u-s){const y=t[o];for(;s<u;)e.insertBefore(n[s++],y)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const fX="_$DX_DELEGATE";function aye(e,t,n,r={}){let i;return wr(a=>{i=a,t===document?e():K(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function ie(e,t,n,r){let i;const a=()=>{const s=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:r?s.firstChild:s.content.firstChild},o=t?()=>lt(()=>document.importNode(i||(i=a()),!0)):()=>(i||(i=a())).cloneNode(!0);return o.cloneNode=o,o}function li(e,t=window.document){const n=t[fX]||(t[fX]=new Set);for(let r=0,i=e.length;r<i;r++){const a=e[r];n.has(a)||(n.add(a),t.addEventListener(a,uye))}}function gt(e,t,n){b0(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function oye(e,t,n,r){b0(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function sye(e,t,n){b0(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function W2(e,t){b0(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Y1(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=a=>i.call(e,n[1],a))}else e.addEventListener(t,n,typeof n!="function"&&n)}function hr(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let a,o;for(a=0,o=i.length;a<o;a++){const s=i[a];!s||s==="undefined"||t[s]||(pX(e,s,!1),delete n[s])}for(a=0,o=r.length;a<o;a++){const s=r[a],l=!!t[s];!s||s==="undefined"||n[s]===l||!l||(pX(e,s,!0),n[s]=l)}return n}function aq(e,t,n){if(!t)return n?gt(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,a;for(a in n)t[a]==null&&r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function kr(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t)}function ki(e,t={},n,r){const i={};return r||Qe(()=>i.children=i2(e,t.children,i.children)),Qe(()=>typeof t.ref=="function"&&Hr(t.ref,e)),Qe(()=>lye(e,t,n,!0,i,!0)),i}function Hr(e,t,n){return lt(()=>e(t,n))}function K(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return i2(e,t,r,n);Qe(i=>i2(e,t(),i,n),r)}function lye(e,t,n,r,i={},a=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=mX(e,o,null,i[o],n,a,t)}for(const o in t){if(o==="children")continue;const s=t[o];i[o]=mX(e,o,s,i[o],n,a,t)}}function cye(e){let t,n;return!b0()||!(t=Xe.registry.get(n=hye()))?e():(Xe.completed&&Xe.completed.add(t),Xe.registry.delete(n),t)}function b0(e){return!!Xe.context&&!Xe.done&&(!e||e.isConnected)}function dye(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function pX(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,a=r.length;i<a;i++)e.classList.toggle(r[i],n)}function mX(e,t,n,r,i,a,o){let s,l,c,u,h;if(t==="style")return aq(e,n,r);if(t==="classList")return hr(e,n,r);if(n===r)return r;if(t==="ref")a||n(e);else if(t.slice(0,3)==="on:"){const m=t.slice(3);r&&e.removeEventListener(m,r,typeof r!="function"&&r),n&&e.addEventListener(m,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const m=t.slice(10);r&&e.removeEventListener(m,r,!0),n&&e.addEventListener(m,n,!0)}else if(t.slice(0,2)==="on"){const m=t.slice(2).toLowerCase(),g=tye.has(m);if(!g&&r){const y=Array.isArray(r)?r[0]:r;e.removeEventListener(m,y)}(g||n)&&(Y1(e,m,n,g),g&&li([m]))}else if(t.slice(0,5)==="attr:")gt(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")sye(e,t.slice(5),n);else if((h=t.slice(0,5)==="prop:")||(c=Yge.has(t))||!i&&((u=eye(t,e.tagName))||(l=Xge.has(t)))||(s=e.nodeName.includes("-")||"is"in o)){if(h)t=t.slice(5),l=!0;else if(b0(e))return n;t==="class"||t==="className"?W2(e,n):s&&!l&&!c?e[dye(t)]=n:e[u||t]=n}else{const m=i&&t.indexOf(":")>-1&&rye[t.split(":")[0]];m?oye(e,m,t,n):gt(e,Jge[t]||t,n)}return n}function uye(e){if(Xe.registry&&Xe.events&&Xe.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),o=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Xe.registry&&!Xe.done&&(Xe.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();a(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!o());c++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function i2(e,t,n,r,i){const a=b0(e);if(a){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const u=n[c];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():l.push(u)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(a||o==="number"&&(t=t.toString(),t===n))return n;if(s){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=j0(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(a)return n;n=j0(e,n,r)}else{if(o==="function")return Qe(()=>{let l=t();for(;typeof l=="function";)l=l();n=i2(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(uV(l,t,n,i))return Qe(()=>n=i2(e,l,n,r,!0)),()=>n;if(a){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return n;const h=[u];for(;(u=u.nextSibling)!==r;)h.push(u);return n=h}if(l.length===0){if(n=j0(e,n,r),s)return n}else c?n.length===0?gX(e,l,r):iye(e,n,l):(n&&j0(e),gX(e,l));n=l}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=j0(e,n,r,t);j0(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function uV(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let s=t[a],l=n&&n[e.length],c;if(!(s==null||s===!0||s===!1))if((c=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))i=uV(e,s,l)||i;else if(c==="function")if(r){for(;typeof s=="function";)s=s();i=uV(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||i}else e.push(s),i=!0;else{const u=String(s);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return i}function gX(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function j0(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let a=!1;for(let o=t.length-1;o>=0;o--){const s=t[o];if(i!==s){const l=s.parentNode===e;!a&&!o?l?e.replaceChild(i,s):e.insertBefore(i,n):l&&s.remove()}else a=!0}}else e.insertBefore(i,n);return[i]}function hye(){return Xe.getNextContextId()}const fye=!1,pye="http://www.w3.org/2000/svg";function Jne(e,t=!1,n=void 0){return t?document.createElementNS(pye,e):document.createElement(e,{is:n})}function w0(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=qa();let a,o=!!Xe.context;return he(()=>{o&&(qa().user=o=!1),a||(a=Go(i,()=>Z(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[l,c]=Ce(!1),u=()=>c(!0);wr(h=>K(s,()=>l()?h():a(),null)),me(u)}else{const l=Jne(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),K(c,a),s.appendChild(l),e.ref&&e.ref(l),me(()=>s.removeChild(l))}},void 0,{render:!o}),n}function mye(e,t){const n=Z(e);return Z(()=>{const r=n();switch(typeof r){case"function":return lt(()=>r(t));case"string":const i=nye.has(r),a=Xe.context?cye():Jne(r,i,lt(()=>t.is));return ki(a,t,i),a}})}function oq(e){const[,t]=Se(e,["component"]);return mye(()=>e.component,t)}const gye="modulepreload",yye=function(e){return"/"+e},yX={},z=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),s=o?.nonce||o?.getAttribute("nonce");i=l(n.map(c=>{if(c=yye(c),c in yX)return;yX[c]=!0;const u=c.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const m=document.createElement("link");if(m.rel=u?"stylesheet":gye,u||(m.as="script"),m.crossOrigin="",m.href=c,s&&m.setAttribute("nonce",s),document.head.appendChild(m),u)return new Promise((g,y)=>{m.addEventListener("load",g),m.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return i.then(o=>{for(const s of o||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})};function Nn(e){const t=Tt();return{provider:n=>{const r=e.init(n);if(!(e.gate??!0))return d(t.Provider,{value:r,get children(){return n.children}});const a=Z(()=>{const o=r.ready;return o===void 0||(typeof o=="function"?o():o)});return d(ke,{get when(){return a()},get children(){return d(t.Provider,{value:r,get children(){return n.children}})}})},use(){const n=Lt(t);if(!n)throw new Error(`${e.name} context must be used within a context provider`);return n}}}const{use:vye,provider:Qne}=Nn({name:"Data",init:e=>({get store(){return e.data},get directory(){return e.directory},get mediaUrl(){return e.mediaUrl},navigateToSession:e.onNavigateToSession,sessionHref:e.onSessionHref})}),ere=Nn({name:"FileComponent",init:e=>e.component}),kye=ere.provider,wJt=ere.use,bye=e=>e!=null,xJt=e=>e.filter(bye);function wye(e){return(...t)=>{for(const n of e)n&&n(...t)}}const be=e=>typeof e=="function"&&!e.length?e():e,vX=e=>Array.isArray(e)?e:e?[e]:[];function xye(e,...t){return typeof e=="function"?e(...t):e}const RU=me;function _ye(e,t,n){if(Xe.context){const[r,i]=Ce(e,n);return dn(()=>i(()=>t())),[r,i]}return Ce(t(),n)}function _Jt(e,t,n,r){const i=e.length,a=t.length;let o=0;if(!a){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<a;o++)r(t[o]);return}for(;o<a&&t[o]===e[o];o++);let s,l;t=t.slice(o),e=e.slice(o);for(s of t)e.includes(s)||r(s);for(l of e)t.includes(l)||n(l)}function tre(e,t,n,r){return e.addEventListener(t,n,r),RU(e.removeEventListener.bind(e,t,n,r))}function Mye(e,t,n,r){const i=()=>{vX(be(e)).forEach(a=>{a&&vX(be(t)).forEach(o=>tre(a,o,n,r))})};typeof e=="function"?he(i):Qe(i)}function Sye(e,t=qa()){let n=0,r,i;return()=>(n++,me(()=>{n--,queueMicrotask(()=>{!n&&i&&(i(),i=r=void 0)})}),i||wr(a=>r=e(i=a),t),r)}function Cye(e){const t=qa(),n=Sye(e,t);return()=>Xe.context?wr(e,t):n()}function zU(e,t=!1){const n=window.matchMedia(e),[r,i]=_ye(t,()=>n.matches);return tre(n,"change",()=>i(n.matches)),r}function Lye(e){return zU("(prefers-color-scheme: dark)",e)}Lye.bind(void 0,!1);const Iye=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function kX(e){const t={};let n;for(;n=Iye.exec(e);)t[n[1]]=n[2];return t}function Wa(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=kX(e)}else typeof t=="string"&&(t=kX(t));return{...e,...t}}function hn(...e){return wye(e)}function Nye(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function hV(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Aye(e){return typeof e=="number"}function lh(e){return Object.prototype.toString.call(e)==="[object String]"}function nre(e){return typeof e=="function"}function Io(e){return t=>`${e()}-${t}`}function $ye(){const e=new Map,t=(i,a,o,s)=>{const l=s?.once?(...c)=>{e.delete(o),o(...c)}:o;e.set(o,{type:a,eventTarget:i,fn:l,options:s}),i.addEventListener(a,o,s)},n=(i,a,o,s)=>{const l=e.get(o)?.fn||o;i.removeEventListener(a,l,s),e.delete(o)},r=()=>{e.forEach((i,a)=>{n(i.eventTarget,i.type,a,i.options)})};return me(()=>{r()}),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Yn(e,t){return e?e===t||e.contains(t):!1}function Mp(e,t=!1){const{activeElement:n}=ri(e);if(!n?.nodeName)return null;if(rre(n)&&n.contentDocument)return Mp(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=ri(n).getElementById(r);if(i)return i}}return n}function qU(e){return ri(e).defaultView||window}function ri(e){return e?e.ownerDocument||e:document}function rre(e){return e.tagName==="IFRAME"}var ire=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(ire||{});function are(e){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function jU(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function sq(){return jU(/^Mac/i)}function Tye(){return jU(/^iPhone/i)}function Eye(){return jU(/^iPad/i)||sq()&&navigator.maxTouchPoints>1}function Pye(){return Tye()||Eye()}function Dye(){return sq()||Pye()}function MJt(){return are(/AppleWebKit/i)&&!Oye()}function Oye(){return are(/Chrome/i)}function dt(e,t){return t&&(nre(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function Kn(e){return t=>{for(const n of e)dt(t,n)}}function Rye(e){return sq()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function ur(e){if(e)if(zye())e.focus({preventScroll:!0});else{const t=qye(e);e.focus(),jye(t)}}var Vm=null;function zye(){if(Vm==null){Vm=!1;try{document.createElement("div").focus({get preventScroll(){return Vm=!0,!0}})}catch{}}return Vm}function qye(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function jye(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var ore=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Hye=[...ore,'[tabindex]:not([tabindex="-1"]):not([disabled])'],HU=`${ore.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,Fye=Hye.join(':not([hidden]):not([tabindex="-1"]),');function sre(e,t){const r=Array.from(e.querySelectorAll(HU)).filter(bX);return t&&bX(e)&&r.unshift(e),r.forEach((i,a)=>{if(rre(i)&&i.contentDocument){const o=i.contentDocument.body,s=sre(o,!1);r.splice(a,1,...s)}}),r}function bX(e){return lre(e)&&!Vye(e)}function lre(e){return e.matches(HU)&&FU(e)}function Vye(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function FU(e,t){return e.nodeName!=="#comment"&&Bye(e)&&Uye(e,t)&&(!e.parentElement||FU(e.parentElement,e))}function Bye(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:a,visibility:o}=i(e);r=a!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function Uye(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Wye(e,t,n){const r=t?.tabbable?Fye:HU,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(a){return t?.from?.contains(a)?NodeFilter.FILTER_REJECT:a.matches(r)&&FU(a)&&(!t?.accept||t.accept(a))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(i.currentNode=t.from),i}function wX(e){let t=e;for(;t&&!Gye(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Gye(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Zye(){}function cre(e){return[e.clientX,e.clientY]}function VU(e,t){const[n,r]=e;let i=!1;const a=t.length;for(let o=a,s=0,l=o-1;s<o;l=s++){const[c,u]=t[s],[h,m]=t[l],[,g]=t[l===0?o-1:l-1]||[0,0],y=(u-m)*(n-c)-(c-h)*(r-u);if(m<u){if(r>=m&&r<u){if(y===0)return!0;y>0&&(r===m?r>g&&(i=!i):i=!i)}}else if(u<m){if(r>u&&r<=m){if(y===0)return!0;y<0&&(r===m?r<g&&(i=!i):i=!i)}}else if(r===u&&(n>=h&&n<=c||n>=c&&n<=h))return!0}return i}function ft(e,t){return f(e,t)}var Yf=new Map,xX=new Set;function _X(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Yf.get(n.target);r||(r=new Set,Yf.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Yf.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Yf.delete(n.target)),Yf.size===0)){for(const i of xX)i();xX.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?_X():document.addEventListener("DOMContentLoaded",_X));function fV(e,t){const n=MX(e,t,"left"),r=MX(e,t,"top"),i=t.offsetWidth,a=t.offsetHeight;let o=e.scrollLeft,s=e.scrollTop;const l=o+e.offsetWidth,c=s+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=s?s=r:r+a>c&&(s+=r+a-c),e.scrollLeft=o,e.scrollTop=s}function MX(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function Kye(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let i=wX(e);for(;e&&i&&e!==n&&i!==n;)fV(i,e),e=i,i=wX(e)}else{const{left:i,top:a}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:o,top:s}=e.getBoundingClientRect();(Math.abs(i-o)>1||Math.abs(a-s)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var Xye={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"},a2="data-kb-top-layer",dre,pV=!1,rs=[];function o2(e){return rs.findIndex(t=>t.node===e)}function Yye(e){return rs[o2(e)]}function Jye(e){return rs[rs.length-1].node===e}function ure(){return rs.filter(e=>e.isPointerBlocking)}function Qye(){return[...ure()].slice(-1)[0]}function BU(){return ure().length>0}function hre(e){const t=o2(Qye()?.node);return o2(e)<t}function eve(e){rs.push(e)}function tve(e){const t=o2(e);t<0||rs.splice(t,1)}function nve(){for(const{node:e}of rs)e.style.pointerEvents=hre(e)?"none":"auto"}function rve(e){if(BU()&&!pV){const t=ri(e);dre=document.body.style.pointerEvents,t.body.style.pointerEvents="none",pV=!0}}function ive(e){if(BU())return;const t=ri(e);t.body.style.pointerEvents=dre,t.body.style.length===0&&t.body.removeAttribute("style"),pV=!1}var Si={layers:rs,isTopMostLayer:Jye,hasPointerBlockingLayer:BU,isBelowPointerBlockingLayer:hre,addLayer:eve,removeLayer:tve,indexOf:o2,find:Yye,assignPointerEventToLayers:nve,disableBodyPointerEvents:rve,restoreBodyPointerEvents:ive},rH="focusScope.autoFocusOnMount",iH="focusScope.autoFocusOnUnmount",SX={bubbles:!1,cancelable:!0},CX={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=hV(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=hV(this.stack,e),this.active()?.resume()}};function fre(e,t){const[n,r]=Ce(!1),i={pause(){r(!0)},resume(){r(!1)}};let a=null;const o=y=>e.onMountAutoFocus?.(y),s=y=>e.onUnmountAutoFocus?.(y),l=()=>ri(t()),c=()=>{const y=l().createElement("span");return y.setAttribute("data-focus-trap",""),y.tabIndex=0,Object.assign(y.style,Xye),y},u=()=>{const y=t();return y?sre(y,!0).filter(v=>!v.hasAttribute("data-focus-trap")):[]},h=()=>{const y=u();return y.length>0?y[0]:null},m=()=>{const y=u();return y.length>0?y[y.length-1]:null},g=()=>{const y=t();if(!y)return!1;const v=Mp(y);return!v||Yn(y,v)?!1:lre(v)};he(()=>{const y=t();if(!y)return;CX.add(i);const v=Mp(y);if(!Yn(y,v)){const b=new CustomEvent(rH,SX);y.addEventListener(rH,o),y.dispatchEvent(b),b.defaultPrevented||setTimeout(()=>{ur(h()),Mp(y)===v&&ur(y)},0)}me(()=>{y.removeEventListener(rH,o),setTimeout(()=>{const b=new CustomEvent(iH,SX);g()&&b.preventDefault(),y.addEventListener(iH,s),y.dispatchEvent(b),b.defaultPrevented||ur(v??l().body),y.removeEventListener(iH,s),CX.remove(i)},0)})}),he(()=>{const y=t();if(!y||!be(e.trapFocus)||n())return;const v=b=>{const x=b.target;x?.closest(`[${a2}]`)||(Yn(y,x)?a=x:ur(a))},k=b=>{const w=b.relatedTarget??Mp(y);w?.closest(`[${a2}]`)||Yn(y,w)||ur(a)};l().addEventListener("focusin",v),l().addEventListener("focusout",k),me(()=>{l().removeEventListener("focusin",v),l().removeEventListener("focusout",k)})}),he(()=>{const y=t();if(!y||!be(e.trapFocus)||n())return;const v=c();y.insertAdjacentElement("afterbegin",v);const k=c();y.insertAdjacentElement("beforeend",k);function b(w){const M=h(),_=m();w.relatedTarget===M?ur(_):ur(M)}v.addEventListener("focusin",b),k.addEventListener("focusin",b);const x=new MutationObserver(w=>{for(const M of w)M.previousSibling===k&&(k.remove(),y.insertAdjacentElement("beforeend",k)),M.nextSibling===v&&(v.remove(),y.insertAdjacentElement("afterbegin",v))});x.observe(y,{childList:!0,subtree:!1}),me(()=>{v.removeEventListener("focusin",b),k.removeEventListener("focusin",b),v.remove(),k.remove(),x.disconnect()})})}var ave="data-live-announcer";function pre(e){he(()=>{be(e.isDisabled)||me(ove(be(e.targets),be(e.root)))})}var Jf=new WeakMap,Ui=[];function ove(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const m of l.querySelectorAll(`[${ave}], [${a2}]`))n.add(m);const c=m=>{if(n.has(m)||m.parentElement&&r.has(m.parentElement)&&m.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const g of n)if(m.contains(g))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),h=c(l);if(h===NodeFilter.FILTER_ACCEPT&&a(l),h!==NodeFilter.FILTER_REJECT){let m=u.nextNode();for(;m!=null;)a(m),m=u.nextNode()}},a=l=>{const c=Jf.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),Jf.set(l,c+1))};Ui.length&&Ui[Ui.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&i(u)}});o.observe(t,{childList:!0,subtree:!0});const s={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return Ui.push(s),()=>{o.disconnect();for(const l of r){const c=Jf.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),Jf.delete(l)):Jf.set(l,c-1)}s===Ui[Ui.length-1]?(Ui.pop(),Ui.length&&Ui[Ui.length-1].observe()):Ui.splice(Ui.indexOf(s),1)}}var LX="interactOutside.pointerDownOutside",IX="interactOutside.focusOutside";function sve(e,t){let n,r=Zye;const i=()=>ri(t()),a=h=>e.onPointerDownOutside?.(h),o=h=>e.onFocusOutside?.(h),s=h=>e.onInteractOutside?.(h),l=h=>{const m=h.target;return!(m instanceof Element)||m.closest(`[${a2}]`)||!Yn(i(),m)||Yn(t(),m)?!1:!e.shouldExcludeElement?.(m)},c=h=>{function m(){const g=t(),y=h.target;if(!g||!y||!l(h))return;const v=Kn([a,s]);y.addEventListener(LX,v,{once:!0});const k=new CustomEvent(LX,{bubbles:!1,cancelable:!0,detail:{originalEvent:h,isContextMenu:h.button===2||Rye(h)&&h.button===0}});y.dispatchEvent(k)}h.pointerType==="touch"?(i().removeEventListener("click",m),r=m,i().addEventListener("click",m,{once:!0})):m()},u=h=>{const m=t(),g=h.target;if(!m||!g||!l(h))return;const y=Kn([o,s]);g.addEventListener(IX,y,{once:!0});const v=new CustomEvent(IX,{bubbles:!1,cancelable:!0,detail:{originalEvent:h,isContextMenu:!1}});g.dispatchEvent(v)};he(()=>{be(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",c,!0)},0),i().addEventListener("focusin",u,!0),me(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",c,!0),i().removeEventListener("focusin",u,!0)}))})}function lve(e){const t=n=>{n.key===ire.Escape&&e.onEscapeKeyDown?.(n)};he(()=>{if(be(e.isDisabled))return;const n=e.ownerDocument?.()??ri();n.addEventListener("keydown",t),me(()=>{n.removeEventListener("keydown",t)})})}function zt(e){const[t,n]=Se(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return d(oq,f(n,{get component(){return t.as}}))}var mre=Tt();function cve(){return Lt(mre)}function lq(e){let t;const n=cve(),[r,i]=Se(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),a=new Set([]),o=h=>{a.add(h);const m=n?.registerNestedLayer(h);return()=>{a.delete(h),m?.()}};sve({shouldExcludeElement:h=>t?r.excludedElements?.some(m=>Yn(m(),h))||[...a].some(m=>Yn(m,h)):!1,onPointerDownOutside:h=>{!t||Si.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Si.isTopMostLayer(t)||(r.onPointerDownOutside?.(h),r.onInteractOutside?.(h),h.defaultPrevented||r.onDismiss?.())},onFocusOutside:h=>{r.onFocusOutside?.(h),r.onInteractOutside?.(h),h.defaultPrevented||r.onDismiss?.()}},()=>t),lve({ownerDocument:()=>ri(t),onEscapeKeyDown:h=>{!t||!Si.isTopMostLayer(t)||(r.onEscapeKeyDown?.(h),!h.defaultPrevented&&r.onDismiss&&(h.preventDefault(),r.onDismiss()))}}),dn(()=>{if(!t)return;Si.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const h=n?.registerNestedLayer(t);Si.assignPointerEventToLayers(),Si.disableBodyPointerEvents(t),me(()=>{t&&(Si.removeLayer(t),h?.(),Si.assignPointerEventToLayers(),Si.restoreBodyPointerEvents(t))})}),he(vn([()=>t,()=>r.disableOutsidePointerEvents],([h,m])=>{if(!h)return;const g=Si.find(h);g&&g.isPointerBlocking!==m&&(g.isPointerBlocking=m,Si.assignPointerEventToLayers()),m&&Si.disableBodyPointerEvents(h),me(()=>{Si.restoreBodyPointerEvents(h)})},{defer:!0}));const u={registerNestedLayer:o};return d(mre.Provider,{value:u,get children(){return d(zt,f({as:"div",ref(h){var m=hn(g=>t=g,r.ref);typeof m=="function"&&m(h)}},i))}})}function G2(e){const[t,n]=Ce(e.defaultValue?.()),r=Z(()=>e.value?.()!==void 0),i=Z(()=>r()?e.value?.():t());return[i,o=>{lt(()=>{const s=xye(o,i());return Object.is(s,i())||(r()||n(s),e.onChange?.(s)),s})}]}function gre(e){const[t,n]=G2(e);return[()=>t()??!1,n]}function dve(e){const[t,n]=G2(e);return[()=>t()??[],n]}function x0(e={}){const[t,n]=gre({value:()=>be(e.open),defaultValue:()=>!!be(e.defaultOpen),onChange:o=>e.onOpenChange?.(o)}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}function Z2(e,t){const[n,r]=Ce(NX(t?.()));return he(()=>{r(e()?.tagName.toLowerCase()||NX(t?.()))}),n}function NX(e){return lh(e)?e:void 0}var uve=Object.defineProperty,Ga=(e,t)=>{for(var n in t)uve(e,n,{get:t[n],enumerable:!0})},hve={};Ga(hve,{Button:()=>UU,Root:()=>_0});var fve=["button","color","file","image","reset","submit"];function pve(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?fve.indexOf(e.type)!==-1:!1}function _0(e){let t;const n=ft({type:"button"},e),[r,i]=Se(n,["ref","type","disabled"]),a=Z2(()=>t,()=>"button"),o=Z(()=>{const c=a();return c==null?!1:pve({tagName:c,type:r.type})}),s=Z(()=>a()==="input"),l=Z(()=>a()==="a"&&t?.getAttribute("href")!=null);return d(zt,f({as:"button",ref(c){var u=hn(h=>t=h,r.ref);typeof u=="function"&&u(c)},get type(){return bt(()=>!!(o()||s()))()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return bt(()=>!!(o()||s()))()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!s()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var UU=_0;function zr(e){return t=>(e(t),()=>e(void 0))}var Er=e=>typeof e=="function"?e():e,mV=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},Bm=new Map,mve=e=>{he(()=>{const t=Er(e.style)??{},n=Er(e.properties)??[],r={};for(const a in t)r[a]=e.element.style[a];const i=Bm.get(e.key);i?i.activeCount++:Bm.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(a=>a.key)}),Object.assign(e.element.style,e.style);for(const a of n)e.element.style.setProperty(a.key,a.value);me(()=>{const a=Bm.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}Bm.delete(e.key);for(const[o,s]of Object.entries(a.originalStyles))e.element.style[o]=s;for(const o of a.properties)e.element.style.removeProperty(o);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},AX=mve,gve=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},yve=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},vve=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,a=0,o=0,s=!1;do{const[l,c,u]=gve(i,t),h=u-l-r*c;(c!==0||h!==0)&&yve(i,t)&&(a+=h,o+=c),i===(n??document.documentElement)?s=!0:i=i._$host??i.parentElement}while(i&&!s);return[a,o]},[$X,TX]=Ce([]),kve=e=>$X().indexOf(e)===$X().length-1,bve=e=>{const t=f({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=xr();let r=[0,0],i=null,a=null;he(()=>{Er(t.enabled)&&(TX(c=>[...c,n]),me(()=>{TX(c=>c.filter(u=>u!==n))}))}),he(()=>{if(!Er(t.enabled)||!Er(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(Er(t.preventScrollbarShift)){const h={overflow:"hidden"},m=[];u>0&&(Er(t.preventScrollbarShiftMode)==="padding"?h.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:h.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,m.push({key:"--scrollbar-width",value:`${u}px`}));const g=window.scrollY,y=window.scrollX;AX({key:"prevent-scroll",element:c,style:h,properties:m,cleanup:()=>{Er(t.restoreScrollPosition)&&u>0&&window.scrollTo(y,g)}})}else AX({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),he(()=>{!kve(n)||!Er(t.enabled)||(document.addEventListener("wheel",s,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),me(()=>{document.removeEventListener("wheel",s),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=c=>{r=EX(c),i=null,a=null},s=c=>{const u=c.target,h=Er(t.element),m=wve(c),g=Math.abs(m[0])>Math.abs(m[1])?"x":"y",y=g==="x"?m[0]:m[1],v=PX(u,g,y,h);let k;h&&mV(h,u)?k=!v:k=!0,k&&c.cancelable&&c.preventDefault()},l=c=>{const u=Er(t.element),h=c.target;let m;if(c.touches.length===2)m=!Er(t.allowPinchZoom);else{if(i==null||a===null){const g=EX(c).map((v,k)=>r[k]-v),y=Math.abs(g[0])>Math.abs(g[1])?"x":"y";i=y,a=y==="x"?g[0]:g[1]}if(h.type==="range")m=!1;else{const g=PX(h,i,a,u);u&&mV(u,h)?m=!g:m=!0}}m&&c.cancelable&&c.preventDefault()}},wve=e=>[e.deltaX,e.deltaY],EX=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],PX=(e,t,n,r)=>{const i=r!==null&&mV(r,e),[a,o]=vve(e,t,i?r:void 0);return!(n>0&&Math.abs(a)<=1||n<0&&Math.abs(o)<1)},xve=bve,yre=xve,_ve=e=>{const t=Z(()=>{const o=Er(e.element);if(o)return getComputedStyle(o)}),n=()=>t()?.animationName??"none",[r,i]=Ce(Er(e.show)?"present":"hidden");let a="none";return he(o=>{const s=Er(e.show);return lt(()=>{if(o===s)return s;const l=a,c=n();s?i("present"):c==="none"||t()?.display==="none"?i("hidden"):i(o===!0&&l!==c?"hiding":"hidden")}),s}),he(()=>{const o=Er(e.element);if(!o)return;const s=c=>{c.target===o&&(a=n())},l=c=>{const h=n().includes(c.animationName);c.target===o&&h&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",s),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),me(()=>{o.removeEventListener("animationstart",s),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:i}},Mve=_ve,i0=Mve,Sve={};Ga(Sve,{CloseButton:()=>kre,Content:()=>bre,Description:()=>wre,Dialog:()=>Ds,Overlay:()=>xre,Portal:()=>_re,Root:()=>Mre,Title:()=>Sre,Trigger:()=>Cre,useDialogContext:()=>al});var vre=Tt();function al(){const e=Lt(vre);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function kre(e){const t=al(),[n,r]=Se(e,["aria-label","onClick"]);return d(_0,f({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:a=>{dt(a,n.onClick),t.close()}},r))}function bre(e){let t;const n=al(),r=ft({id:n.generateId("content")},e),[i,a]=Se(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let o=!1,s=!1;const l=m=>{i.onPointerDownOutside?.(m),n.modal()&&m.detail.isContextMenu&&m.preventDefault()},c=m=>{i.onFocusOutside?.(m),n.modal()&&m.preventDefault()},u=m=>{i.onInteractOutside?.(m),!n.modal()&&(m.defaultPrevented||(o=!0,m.detail.originalEvent.type==="pointerdown"&&(s=!0)),Yn(n.triggerRef(),m.target)&&m.preventDefault(),m.detail.originalEvent.type==="focusin"&&s&&m.preventDefault())},h=m=>{i.onCloseAutoFocus?.(m),n.modal()?(m.preventDefault(),ur(n.triggerRef())):(m.defaultPrevented||(o||ur(n.triggerRef()),m.preventDefault()),o=!1,s=!1)};return pre({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),yre({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),fre({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:i.onOpenAutoFocus,onUnmountAutoFocus:h},()=>t),he(()=>me(n.registerContentId(a.id))),d(ke,{get when(){return n.contentPresent()},get children(){return d(lq,f({ref(m){var g=hn(y=>{n.setContentRef(y),t=y},i.ref);typeof g=="function"&&g(m)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return bt(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?"":void 0},get"data-closed"(){return n.isOpen()?void 0:""},onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,get onDismiss(){return n.close}},a))}})}function wre(e){const t=al(),n=ft({id:t.generateId("description")},e),[r,i]=Se(n,["id"]);return he(()=>me(t.registerDescriptionId(r.id))),d(zt,f({as:"p",get id(){return r.id}},i))}function xre(e){const t=al(),[n,r]=Se(e,["ref","style","onPointerDown"]),i=a=>{dt(a,n.onPointerDown),a.target===a.currentTarget&&a.preventDefault()};return d(ke,{get when(){return t.overlayPresent()},get children(){return d(zt,f({as:"div",ref(a){var o=hn(t.setOverlayRef,n.ref);typeof o=="function"&&o(a)},get style(){return Wa({"pointer-events":"auto"},n.style)},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onPointerDown:i},r))}})}function _re(e){const t=al();return d(ke,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return d(w0,e)}})}var DX={dismiss:"Dismiss"};function Mre(e){const t=`dialog-${xr()}`,n=ft({id:t,modal:!0,translations:DX},e),[r,i]=Ce(),[a,o]=Ce(),[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(),[g,y]=Ce(),v=x0({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:M=>n.onOpenChange?.(M)}),k=()=>n.forceMount||v.isOpen(),{present:b}=i0({show:k,element:()=>c()??null}),{present:x}=i0({show:k,element:()=>h()??null}),w={translations:()=>n.translations??DX,isOpen:v.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??w.modal(),contentId:r,titleId:a,descriptionId:s,triggerRef:g,overlayRef:c,setOverlayRef:u,contentRef:h,setContentRef:m,overlayPresent:b,contentPresent:x,close:v.close,toggle:v.toggle,setTriggerRef:y,generateId:Io(()=>n.id),registerContentId:zr(i),registerTitleId:zr(o),registerDescriptionId:zr(l)};return d(vre.Provider,{value:w,get children(){return n.children}})}function Sre(e){const t=al(),n=ft({id:t.generateId("title")},e),[r,i]=Se(n,["id"]);return he(()=>me(t.registerTitleId(r.id))),d(zt,f({as:"h2",get id(){return r.id}},i))}function Cre(e){const t=al(),[n,r]=Se(e,["ref","onClick"]);return d(_0,f({ref(a){var o=hn(t.setTriggerRef,n.ref);typeof o=="function"&&o(a)},"aria-haspopup":"dialog",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return bt(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onClick:a=>{dt(a,n.onClick),t.toggle()}},r))}var Ds=Object.assign(Mre,{CloseButton:kre,Content:bre,Description:wre,Overlay:xre,Portal:_re,Title:Sre,Trigger:Cre}),Cve=ie("<div data-component=dialog-stack>");const Lre=Tt();function Lve(){const[e,t]=Ce(),n={current:void 0},r={value:!1};me(()=>{n.current!==void 0&&(clearTimeout(n.current),n.current=void 0)});const i=()=>{const o=e();if(!o||r.value)return;r.value=!0,o.onClose?.(),o.setClosing(!0);const s=o.id;n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),n.current=setTimeout(()=>{n.current=void 0,o.dispose(),e()?.id===s&&t(void 0),r.value=!1},100)};return he(()=>{if(!e())return;const o=s=>{s.key==="Escape"&&(i(),s.preventDefault(),s.stopPropagation())};window.addEventListener("keydown",o,!0),me(()=>window.removeEventListener("keydown",o,!0))}),{get active(){return e()},close:i,show:(o,s,l)=>{const c=e();c&&(c.dispose(),t(void 0)),n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),r.value=!1;const u=Math.random().toString(36).slice(2);let h,m;const g=Go(s,()=>wr(y=>{h=y;const[v,k]=Ce(!1);return m=k,d(Ds,{modal:!0,get open(){return!v()},onOpenChange:b=>{b||i()},get children(){return d(Ds.Portal,{get children(){return[d(Ds.Overlay,{"data-component":"dialog-overlay",onClick:i}),bt(()=>o())]}})}})}));!h||!m||t({id:u,node:g,dispose:h,owner:s,onClose:l,setClosing:m})}}}function Ive(e){const t=Lve();return d(Lre.Provider,{value:t,get children(){return[bt(()=>e.children),(()=>{var n=Cve();return K(n,()=>t.active?.node),n})()]}})}function lf(){const e=Lt(Lre),t=qa();if(!t)throw new Error("useDialog must be used within a DialogProvider");if(!e)throw new Error("useDialog must be used within a DialogProvider");return{get active(){return e.active},show(n,r){const i=e.active?.owner??t;e.show(n,i,r)},close(){e.close()}}}const Ire={"ui.sessionReview.title":"Session changes","ui.sessionReview.title.lastTurn":"Last turn changes","ui.sessionReview.diffStyle.unified":"Unified","ui.sessionReview.diffStyle.split":"Split","ui.sessionReview.expandAll":"Expand all","ui.sessionReview.collapseAll":"Collapse all","ui.sessionReview.change.added":"Added","ui.sessionReview.change.removed":"Removed","ui.sessionReview.change.modified":"Modified","ui.sessionReview.image.loading":"Loading...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff too large to render","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} changed lines. Current: {{current}} changed lines.","ui.sessionReview.largeDiff.renderAnyway":"Render anyway","ui.sessionReview.openFile":"Open file","ui.sessionReview.selection.line":"line {{line}}","ui.sessionReview.selection.lines":"lines {{start}}-{{end}}","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Removed {{kind}} file.","ui.fileMedia.state.loading":"Loading {{kind}}...","ui.fileMedia.state.error":"Unable to load {{kind}}.","ui.fileMedia.state.unavailable":"{{kind}} preview unavailable.","ui.fileMedia.binary.title":"Binary file","ui.fileMedia.binary.description.path":"{{path}} is binary.","ui.fileMedia.binary.description.default":"Binary content","ui.lineComment.label.prefix":"Comment on ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commenting on ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Add comment","ui.lineComment.submit":"Comment","ui.sessionTurn.steps.show":"Show steps","ui.sessionTurn.steps.hide":"Hide steps","ui.sessionTurn.summary.response":"Response","ui.sessionTurn.diff.showMore":"Show more changes ({{count}})","ui.sessionTurn.retry.retrying":"retrying","ui.sessionTurn.retry.inSeconds":"in {{seconds}}s","ui.sessionTurn.retry.attempt":"attempt #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - attempt #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini is way too hot right now","ui.sessionTurn.error.freeUsageExceeded":"Free usage exceeded","ui.sessionTurn.error.addCredits":"Add credits","ui.sessionTurn.status.delegating":"Delegating work","ui.sessionTurn.status.planning":"Planning next steps","ui.sessionTurn.status.gatheringContext":"Exploring","ui.sessionTurn.status.gatheredContext":"Explored","ui.sessionTurn.status.searchingCodebase":"Searching the codebase","ui.sessionTurn.status.searchingWeb":"Searching the web","ui.sessionTurn.status.makingEdits":"Making edits","ui.sessionTurn.status.runningCommands":"Running commands","ui.sessionTurn.status.thinking":"Thinking","ui.sessionTurn.status.thinkingWithTopic":"Thinking - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Gathering thoughts","ui.sessionTurn.status.consideringNextSteps":"Considering next steps","ui.messagePart.diagnostic.error":"Error","ui.messagePart.title.edit":"Edit","ui.messagePart.title.write":"Write","ui.messagePart.option.typeOwnAnswer":"Type your own answer","ui.messagePart.review.title":"Review your answers","ui.messagePart.questions.dismissed":"Questions dismissed","ui.messagePart.compaction":"Session compacted","ui.messagePart.context.read.one":"{{count}} read","ui.messagePart.context.read.other":"{{count}} reads","ui.messagePart.context.search.one":"{{count}} search","ui.messagePart.context.search.other":"{{count}} searches","ui.messagePart.context.list.one":"{{count}} list","ui.messagePart.context.list.other":"{{count}} lists","ui.list.loading":"Loading","ui.list.empty":"No results","ui.list.clearFilter":"Clear filter","ui.list.emptyWithFilter.prefix":"No results for","ui.list.emptyWithFilter.suffix":"","ui.fileSearch.placeholder":"Find","ui.fileSearch.previousMatch":"Previous match","ui.fileSearch.nextMatch":"Next match","ui.fileSearch.close":"Close search","ui.messageNav.newMessage":"New message","ui.textField.copyToClipboard":"Copy to clipboard","ui.textField.copyLink":"Copy link","ui.textField.copied":"Copied","ui.imagePreview.alt":"Image preview","ui.scrollView.ariaLabel":"scrollable content","ui.tool.read":"Read","ui.tool.loaded":"Loaded","ui.tool.list":"List","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.task":"Task","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Web Search","ui.tool.codesearch":"Code Search","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"To-dos","ui.tool.todos.read":"Read to-dos","ui.tool.questions":"Questions","ui.tool.agent":"{{type}} Agent","ui.tool.agent.default":"Agent","ui.tool.skill":"Skill","ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":"Failed","ui.toolErrorCard.copyError":"Copy error","ui.common.file.one":"file","ui.common.file.other":"files","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Add","ui.common.back":"Back","ui.common.cancel":"Cancel","ui.common.confirm":"Confirm","ui.common.dismiss":"Dismiss","ui.common.close":"Close","ui.common.next":"Next","ui.common.submit":"Submit","ui.permission.deny":"Deny","ui.permission.allowAlways":"Allow always","ui.permission.allowOnce":"Allow once","ui.message.expand":"Expand message","ui.message.collapse":"Collapse message","ui.message.copy":"Copy","ui.message.copyMessage":"Copy message","ui.message.forkMessage":"Fork to new session","ui.message.revertMessage":"Revert message","ui.message.copyResponse":"Copy response","ui.message.copied":"Copied","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s","ui.message.interrupted":"Interrupted","ui.message.queued":"Queued","ui.message.attachment.alt":"attachment","ui.patch.action.deleted":"Deleted","ui.patch.action.created":"Created","ui.patch.action.moved":"Moved","ui.patch.action.patched":"Patched","ui.question.subtitle.answered":"{{count}} answered","ui.question.answer.none":"(no answer)","ui.question.review.notAnswered":"(not answered)","ui.question.multiHint":"Select all answers that apply","ui.question.singleHint":"Select one answer","ui.question.custom.placeholder":"Type your answer..."};function Nve(e,t){return t?e.replace(/{{\s*([^}]+?)\s*}}/g,(n,r)=>{const i=String(r),a=t[i];return a===void 0?"":String(a)}):e}const Ave={locale:()=>"en",t:(e,t)=>{const n=Ire[e]??String(e);return Nve(n,t)}},Nre=Tt(Ave);function $ve(e){return d(Nre.Provider,{get value(){return e.value},get children(){return e.children}})}function M0(){return Lt(Nre)}function WU(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var S0=WU();function Are(e){S0=e}var Fp={exec:()=>null};function Ut(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Jr.caret,"$1"),n=n.replace(i,o),r},getRegex:()=>new RegExp(n,t)};return r}var Tve=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Jr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Eve=/^(?:[ \t]*(?:\n|$))+/,Pve=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Dve=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K2=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ove=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,GU=/(?:[*+-]|\d{1,9}[.)])/,$re=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Tre=Ut($re).replace(/bull/g,GU).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Rve=Ut($re).replace(/bull/g,GU).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ZU=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,zve=/^[^\n]+/,KU=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qve=Ut(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",KU).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),jve=Ut(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,GU).getRegex(),cq="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",XU=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Hve=Ut("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",XU).replace("tag",cq).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ere=Ut(ZU).replace("hr",K2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cq).getRegex(),Fve=Ut(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ere).getRegex(),YU={blockquote:Fve,code:Pve,def:qve,fences:Dve,heading:Ove,hr:K2,html:Hve,lheading:Tre,list:jve,newline:Eve,paragraph:Ere,table:Fp,text:zve},OX=Ut("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cq).getRegex(),Vve={...YU,lheading:Rve,table:OX,paragraph:Ut(ZU).replace("hr",K2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",OX).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cq).getRegex()},Bve={...YU,html:Ut(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",XU).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Fp,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ut(ZU).replace("hr",K2).replace("heading",` *#{1,6} *[^
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-CU67Zn6k.js","assets/html-GMplVEZG.js","assets/javascript-wDzz0qaB.js","assets/css-DPfMkruS.js","assets/angular-ts-BwZT4LLn.js","assets/scss-OYdSNvt2.js","assets/apl-dKokRX4l.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-CbQHKStN.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-DVc8C-J4.js","assets/html-derivative-BFtXZ54Q.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nwyudZeR.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-tKQVLTB8.js","assets/shellscript-Yzrsuije.js","assets/edge-BkV0erSs.js","assets/elixir-CDX3lj18.js","assets/elm-DbKCFpqz.js","assets/erb-BOJIQeun.js","assets/ruby-BvKwtOVI.js","assets/haml-B8DHNrY2.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BbnMAYS6.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-BZjJHVRy.js","assets/fortran-free-form-D22FLkUw.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-B7Tvp0Sc.js","assets/gdshader-DkwncUOv.js","assets/gdscript-DTMYz4Jt.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-Rg0-pVw9.js","assets/glimmer-ts-U6CK756n.js","assets/hack-CaT9iCJl.js","assets/handlebars-BL8al0AC.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-4LBKfQ-Z.js","assets/jison-wvAkD_A8.js","assets/julia-C8NyazO9.js","assets/r-DiinP2Uv.js","assets/latex-BdAV_C_H.js","assets/tex-CxkMU7Pf.js","assets/liquid-DYVedYrR.js","assets/marko-CPi9NSCl.js","assets/less-B1dDrJ26.js","assets/mdc-DUICxH0z.js","assets/nginx-DknmC5AR.js","assets/nim-CVrawwO9.js","assets/perl-C0TMdlhV.js","assets/php-CDn_0X-4.js","assets/pug-CGlum2m_.js","assets/qml-3beO22l8.js","assets/razor-CE9lU5zL.js","assets/csharp-K5feNrxe.js","assets/rst-B0xPkSld.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-Brmx7dQM.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/svelte-3Dk4HxPD.js","assets/templ-W15q3VgB.js","assets/go-Dn2_MT6a.js","assets/ts-tags-zn1MmPIZ.js","assets/twig-CO9l9SDP.js","assets/vue-DnHKYNfI.js","assets/vue-html-CChd_i61.js","assets/vue-vine-8moa0y9V.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js","assets/mermaid.core-BEWtGc16.js","assets/transform-BwXaE9hv.js","assets/dialog-settings-Wsa2poSm.js","assets/tabs-D8lg7D65.js","assets/select-DTzRSV7E.js","assets/chunk-VVM5DH6Z-Dno15NPb.js","assets/switch-BuF8peZ_.js","assets/dialog-connect-provider-DtYBi8pJ.js","assets/list-r-C0jWe3.js","assets/tag--guRRUJB.js","assets/dialog-select-provider-Da3OoYdK.js","assets/dialog-select-server-UCc0uaGh.js","assets/server-row-Dz8CVHx2.js","assets/dialog-select-directory-CuuUL7us.js","assets/file-icon-DCdf-9qH.js","assets/home-KBuxIbfS.js","assets/dialog-create-project-DZIA0DQF.js","assets/session-gJuaiFTU.js","assets/trellis-DJj85d6A.js","assets/trellis-op-icon-D3kRKjFt.js","assets/trellis-CZsWDIog.css","assets/trellis-badge-demo-CVRLg01T.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();const Xe={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return cX(this.context.count)},getNextContextId(){return cX(this.context.count++)}};function cX(e){const t=String(e),n=t.length-1;return Xe.context.id+(n?String.fromCharCode(96+n):"")+t}function Wo(e){Xe.context=e}const Fne=!1,$ge=(e,t)=>e===t,za=Symbol("solid-proxy"),Vne=typeof Proxy=="function",TR=Symbol("solid-track"),ER={equals:$ge};let Hp=null,Bne=Zne;const aa=1,n2=2,Une={owned:null,cleanups:null,context:null,owner:null},tH={};var ht=null;let Pe=null,Tge=null,Zt=null,jr=null,vr=null,rq=0;function wr(e,t){const n=Zt,r=ht,i=e.length===0,a=t===void 0?r:t,o=i?Une:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>lt(()=>Ws(o)));ht=o,Zt=null;try{return Oi(s,!0)}finally{Zt=n,ht=r}}function Ce(e,t){t=t?Object.assign({},ER,t):ER;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=i=>(typeof i=="function"&&(Pe&&Pe.running&&Pe.sources.has(n)?i=i(n.tValue):i=i(n.value)),Gne(n,i));return[Wne.bind(n),r]}function r2(e,t,n){const r=V2(e,t,!0,aa);sf(r)}function Qe(e,t,n){const r=V2(e,t,!1,aa);sf(r)}function he(e,t,n){Bne=qge;const r=V2(e,t,!1,aa),i=n0&&Lt(n0);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),vr?vr.push(r):sf(r)}function Z(e,t,n){n=n?Object.assign({},ER,n):ER;const r=V2(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,sf(r),Wne.bind(r)}function Ege(e){return e&&typeof e=="object"&&"then"in e}function Yr(e,t,n){let r,i,a;typeof t=="function"?(r=e,i=t,a=n||{}):(r=!0,i=e,a=t||{});let o=null,s=tH,l=null,c=!1,u=!1,h="initialValue"in a,m=typeof r=="function"&&Z(r);const g=new Set,[y,v]=(a.storage||Ce)(a.initialValue),[k,b]=Ce(void 0),[x,w]=Ce(void 0,{equals:!1}),[M,_]=Ce(h?"ready":"unresolved");Xe.context&&(l=Xe.getNextContextId(),a.ssrLoadFrom==="initial"?s=a.initialValue:Xe.load&&Xe.has(l)&&(s=Xe.load(l)));function C(D,P,O,E){return o===D&&(o=null,E!==void 0&&(h=!0),(D===s||P===s)&&a.onHydrated&&queueMicrotask(()=>a.onHydrated(E,{value:P})),s=tH,Pe&&D&&c?(Pe.promises.delete(D),c=!1,Oi(()=>{Pe.running=!0,L(P,O)},!1)):L(P,O)),P}function L(D,P){Oi(()=>{P===void 0&&v(()=>D),_(P!==void 0?"errored":h?"ready":"unresolved"),b(P);for(const O of g.keys())O.decrement();g.clear()},!1)}function S(){const D=n0&&Lt(n0),P=y(),O=k();if(O!==void 0&&!o)throw O;return Zt&&!Zt.user&&D&&r2(()=>{x(),o&&(D.resolved&&Pe&&c?Pe.promises.add(o):g.has(D)||(D.increment(),g.add(D)))}),P}function I(D=!0){if(D!==!1&&u)return;u=!1;const P=m?m():r;if(c=Pe&&Pe.running,P==null||P===!1){C(o,lt(y));return}Pe&&o&&Pe.promises.delete(o);let O;const E=s!==tH?s:lt(()=>{try{return i(P,{value:y(),refetching:D})}catch(T){O=T}});if(O!==void 0){C(o,void 0,ny(O),P);return}else if(!Ege(E))return C(o,E,void 0,P),E;return o=E,"v"in E?(E.s===1?C(o,E.v,void 0,P):C(o,void 0,ny(E.v),P),E):(u=!0,queueMicrotask(()=>u=!1),Oi(()=>{_(h?"refreshing":"pending"),w()},!1),E.then(T=>C(E,T,void 0,P),T=>C(E,void 0,ny(T),P)))}Object.defineProperties(S,{state:{get:()=>M()},error:{get:()=>k()},loading:{get(){const D=M();return D==="pending"||D==="refreshing"}},latest:{get(){if(!h)return S();const D=k();if(D&&!o)throw D;return y()}}});let A=ht;return m?r2(()=>(A=ht,I(!1))):I(!1),[S,{refetch:D=>Go(A,()=>I(D)),mutate:v}]}function ct(e){return Oi(e,!1)}function lt(e){if(Zt===null)return e();const t=Zt;Zt=null;try{return e()}finally{Zt=t}}function vn(e,t,n){const r=Array.isArray(e);let i,a=n&&n.defer;return o=>{let s;if(r){s=Array(e.length);for(let c=0;c<e.length;c++)s[c]=e[c]()}else s=e();if(a)return a=!1,o;const l=lt(()=>t(s,i,o));return i=s,l}}function dn(e){he(()=>lt(e))}function me(e){return ht===null||(ht.cleanups===null?ht.cleanups=[e]:ht.cleanups.push(e)),e}function Pge(e,t){Hp||(Hp=Symbol("error")),ht=V2(void 0,void 0,!0),ht.context={...ht.context,[Hp]:[t]},Pe&&Pe.running&&Pe.sources.add(ht);try{return e()}catch(n){B2(n)}finally{ht=ht.owner}}function sV(){return Zt}function qa(){return ht}function Go(e,t){const n=ht,r=Zt;ht=e,Zt=null;try{return Oi(t,!0)}catch(i){B2(i)}finally{ht=n,Zt=r}}function Dge(e){if(Pe&&Pe.running)return e(),Pe.done;const t=Zt,n=ht;return Promise.resolve().then(()=>{Zt=t,ht=n;let r;return n0&&(r=Pe||(Pe={sources:new Set,effects:[],promises:new Set,disposed:new Set,queue:new Set,running:!0}),r.done||(r.done=new Promise(i=>r.resolve=i)),r.running=!0),Oi(e,!1),Zt=ht=null,r?r.done:void 0})}const[wJt,dX]=Ce(!1);function Oge(e){vr.push.apply(vr,e),e.length=0}function Tt(e,t){const n=Symbol("context");return{id:n,Provider:jge(n),defaultValue:e}}function Lt(e){let t;return ht&&ht.context&&(t=ht.context[e.id])!==void 0?t:e.defaultValue}function iq(e){const t=Z(e),n=Z(()=>lV(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let n0;function Rge(){return n0||(n0=Tt())}function Wne(){const e=Pe&&Pe.running;if(this.sources&&(e?this.tState:this.state))if((e?this.tState:this.state)===aa)sf(this);else{const t=jr;jr=null,Oi(()=>DR(this),!1),jr=t}if(Zt){const t=this.observers?this.observers.length:0;Zt.sources?(Zt.sources.push(this),Zt.sourceSlots.push(t)):(Zt.sources=[this],Zt.sourceSlots=[t]),this.observers?(this.observers.push(Zt),this.observerSlots.push(Zt.sources.length-1)):(this.observers=[Zt],this.observerSlots=[Zt.sources.length-1])}return e&&Pe.sources.has(this)?this.tValue:this.value}function Gne(e,t,n){let r=Pe&&Pe.running&&Pe.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(Pe){const i=Pe.running;(i||!n&&Pe.sources.has(e))&&(Pe.sources.add(e),e.tValue=t),i||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&Oi(()=>{for(let i=0;i<e.observers.length;i+=1){const a=e.observers[i],o=Pe&&Pe.running;o&&Pe.disposed.has(a)||((o?!a.tState:!a.state)&&(a.pure?jr.push(a):vr.push(a),a.observers&&Kne(a)),o?a.tState=aa:a.state=aa)}if(jr.length>1e6)throw jr=[],new Error},!1)}return t}function sf(e){if(!e.fn)return;Ws(e);const t=rq;uX(e,Pe&&Pe.running&&Pe.sources.has(e)?e.tValue:e.value,t),Pe&&!Pe.running&&Pe.sources.has(e)&&queueMicrotask(()=>{Oi(()=>{Pe&&(Pe.running=!0),Zt=ht=e,uX(e,e.tValue,t),Zt=ht=null},!1)})}function uX(e,t,n){let r;const i=ht,a=Zt;Zt=ht=e;try{r=e.fn(t)}catch(o){return e.pure&&(Pe&&Pe.running?(e.tState=aa,e.tOwned&&e.tOwned.forEach(Ws),e.tOwned=void 0):(e.state=aa,e.owned&&e.owned.forEach(Ws),e.owned=null)),e.updatedAt=n+1,B2(o)}finally{Zt=a,ht=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Gne(e,r,!0):Pe&&Pe.running&&e.pure?(Pe.sources.has(e)||(e.value=r),Pe.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function V2(e,t,n,r=aa,i){const a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:ht,context:ht?ht.context:null,pure:n};return Pe&&Pe.running&&(a.state=0,a.tState=r),ht===null||ht!==Une&&(Pe&&Pe.running&&ht.pure?ht.tOwned?ht.tOwned.push(a):ht.tOwned=[a]:ht.owned?ht.owned.push(a):ht.owned=[a]),a}function PR(e){const t=Pe&&Pe.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===n2)return DR(e);if(e.suspense&<(e.suspense.inFallback))return e.suspense.effects.push(e);const n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<rq);){if(t&&Pe.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let i=e,a=n[r+1];for(;(i=i.owner)&&i!==a;)if(Pe.disposed.has(i))return}if((t?e.tState:e.state)===aa)sf(e);else if((t?e.tState:e.state)===n2){const i=jr;jr=null,Oi(()=>DR(e,n[0]),!1),jr=i}}}function Oi(e,t){if(jr)return e();let n=!1;t||(jr=[]),vr?n=!0:vr=[],rq++;try{const r=e();return zge(n),r}catch(r){n||(vr=null),jr=null,B2(r)}}function zge(e){if(jr&&(Zne(jr),jr=null),e)return;let t;if(Pe){if(!Pe.promises.size&&!Pe.queue.size){const r=Pe.sources,i=Pe.disposed;vr.push.apply(vr,Pe.effects),t=Pe.resolve;for(const a of vr)"tState"in a&&(a.state=a.tState),delete a.tState;Pe=null,Oi(()=>{for(const a of i)Ws(a);for(const a of r){if(a.value=a.tValue,a.owned)for(let o=0,s=a.owned.length;o<s;o++)Ws(a.owned[o]);a.tOwned&&(a.owned=a.tOwned),delete a.tValue,delete a.tOwned,a.tState=0}dX(!1)},!1)}else if(Pe.running){Pe.running=!1,Pe.effects.push.apply(Pe.effects,vr),vr=null,dX(!0);return}}const n=vr;vr=null,n.length&&Oi(()=>Bne(n),!1),t&&t()}function Zne(e){for(let t=0;t<e.length;t++)PR(e[t])}function qge(e){let t,n=0;for(t=0;t<e.length;t++){const r=e[t];r.user?e[n++]=r:PR(r)}if(Xe.context){if(Xe.count){Xe.effects||(Xe.effects=[]),Xe.effects.push(...e.slice(0,n));return}Wo()}for(Xe.effects&&(Xe.done||!Xe.count)&&(e=[...Xe.effects,...e],n+=Xe.effects.length,delete Xe.effects),t=0;t<n;t++)PR(e[t])}function DR(e,t){const n=Pe&&Pe.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){const i=e.sources[r];if(i.sources){const a=n?i.tState:i.state;a===aa?i!==t&&(!i.updatedAt||i.updatedAt<rq)&&PR(i):a===n2&&DR(i,t)}}}function Kne(e){const t=Pe&&Pe.running;for(let n=0;n<e.observers.length;n+=1){const r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=n2:r.state=n2,r.pure?jr.push(r):vr.push(r),r.observers&&Kne(r))}}function Ws(e){let t;if(e.sources)for(;e.sources.length;){const n=e.sources.pop(),r=e.sourceSlots.pop(),i=n.observers;if(i&&i.length){const a=i.pop(),o=n.observerSlots.pop();r<i.length&&(a.sourceSlots[o]=r,i[r]=a,n.observerSlots[r]=o)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)Ws(e.tOwned[t]);delete e.tOwned}if(Pe&&Pe.running&&e.pure)Xne(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)Ws(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}Pe&&Pe.running?e.tState=0:e.state=0}function Xne(e,t){if(t||(e.tState=0,Pe.disposed.add(e)),e.owned)for(let n=0;n<e.owned.length;n++)Xne(e.owned[n])}function ny(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function hX(e,t,n){try{for(const r of t)r(e)}catch(r){B2(r,n&&n.owner||null)}}function B2(e,t=ht){const n=Hp&&t&&t.context&&t.context[Hp],r=ny(e);if(!n)throw r;vr?vr.push({fn(){hX(r,n,t)},state:aa}):hX(r,n,t)}function lV(e){if(typeof e=="function"&&!e.length)return lV(e());if(Array.isArray(e)){const t=[];for(let n=0;n<e.length;n++){const r=lV(e[n]);Array.isArray(r)?t.push.apply(t,r):t.push(r)}return t}return e}function jge(e,t){return function(r){let i;return Qe(()=>i=lt(()=>(ht.context={...ht.context,[e]:r.value},iq(()=>r.children))),void 0),i}}const cV=Symbol("fallback");function OR(e){for(let t=0;t<e.length;t++)e[t]()}function Hge(e,t,n={}){let r=[],i=[],a=[],o=0,s=t.length>1?[]:null;return me(()=>OR(a)),()=>{let l=e()||[],c=l.length,u,h;return l[TR],lt(()=>{let g,y,v,k,b,x,w,M,_;if(c===0)o!==0&&(OR(a),a=[],r=[],i=[],o=0,s&&(s=[])),n.fallback&&(r=[cV],i[0]=wr(C=>(a[0]=C,n.fallback())),o=1);else if(o===0){for(i=new Array(c),h=0;h<c;h++)r[h]=l[h],i[h]=wr(m);o=c}else{for(v=new Array(c),k=new Array(c),s&&(b=new Array(c)),x=0,w=Math.min(o,c);x<w&&r[x]===l[x];x++);for(w=o-1,M=c-1;w>=x&&M>=x&&r[w]===l[M];w--,M--)v[M]=i[w],k[M]=a[w],s&&(b[M]=s[w]);for(g=new Map,y=new Array(M+1),h=M;h>=x;h--)_=l[h],u=g.get(_),y[h]=u===void 0?-1:u,g.set(_,h);for(u=x;u<=w;u++)_=r[u],h=g.get(_),h!==void 0&&h!==-1?(v[h]=i[u],k[h]=a[u],s&&(b[h]=s[u]),h=y[h],g.set(_,h)):a[u]();for(h=x;h<c;h++)h in v?(i[h]=v[h],a[h]=k[h],s&&(s[h]=b[h],s[h](h))):i[h]=wr(m);i=i.slice(0,o=c),r=l.slice(0)}return i});function m(g){if(a[h]=g,s){const[y,v]=Ce(h);return s[h]=v,t(l[h],y)}return t(l[h])}}}function Fge(e,t,n={}){let r=[],i=[],a=[],o=[],s=0,l;return me(()=>OR(a)),()=>{const c=e()||[],u=c.length;return c[TR],lt(()=>{if(u===0)return s!==0&&(OR(a),a=[],r=[],i=[],s=0,o=[]),n.fallback&&(r=[cV],i[0]=wr(m=>(a[0]=m,n.fallback())),s=1),i;for(r[0]===cV&&(a[0](),a=[],r=[],i=[],s=0),l=0;l<u;l++)l<r.length&&r[l]!==c[l]?o[l](()=>c[l]):l>=r.length&&(i[l]=wr(h));for(;l<r.length;l++)a[l]();return s=o.length=a.length=u,r=c.slice(0),i=i.slice(0,s)});function h(m){a[l]=m;const[g,y]=Ce(c[l]);return o[l]=y,t(g,l)}}}function d(e,t){return lt(()=>e(t||{}))}function Fm(){return!0}const dV={get(e,t,n){return t===za?n:e.get(t)},has(e,t){return t===za?!0:e.has(t)},set:Fm,deleteProperty:Fm,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:Fm,deleteProperty:Fm}},ownKeys(e){return e.keys()}};function nH(e){return(e=typeof e=="function"?e():e)?e:{}}function Vge(){for(let e=0,t=this.length;e<t;++e){const n=this[e]();if(n!==void 0)return n}}function f(...e){let t=!1;for(let o=0;o<e.length;o++){const s=e[o];t=t||!!s&&za in s,e[o]=typeof s=="function"?(t=!0,Z(s)):s}if(Vne&&t)return new Proxy({get(o){for(let s=e.length-1;s>=0;s--){const l=nH(e[s])[o];if(l!==void 0)return l}},has(o){for(let s=e.length-1;s>=0;s--)if(o in nH(e[s]))return!0;return!1},keys(){const o=[];for(let s=0;s<e.length;s++)o.push(...Object.keys(nH(e[s])));return[...new Set(o)]}},dV);const n={},r=Object.create(null);for(let o=e.length-1;o>=0;o--){const s=e[o];if(!s)continue;const l=Object.getOwnPropertyNames(s);for(let c=l.length-1;c>=0;c--){const u=l[c];if(u==="__proto__"||u==="constructor")continue;const h=Object.getOwnPropertyDescriptor(s,u);if(!r[u])r[u]=h.get?{enumerable:!0,configurable:!0,get:Vge.bind(n[u]=[h.get.bind(s)])}:h.value!==void 0?h:void 0;else{const m=n[u];m&&(h.get?m.push(h.get.bind(s)):h.value!==void 0&&m.push(()=>h.value))}}}const i={},a=Object.keys(r);for(let o=a.length-1;o>=0;o--){const s=a[o],l=r[s];l&&l.get?Object.defineProperty(i,s,l):i[s]=l?l.value:void 0}return i}function Se(e,...t){const n=t.length;if(Vne&&za in e){const i=n>1?t.flat():t[0],a=t.map(o=>new Proxy({get(s){return o.includes(s)?e[s]:void 0},has(s){return o.includes(s)&&s in e},keys(){return o.filter(s=>s in e)}},dV));return a.push(new Proxy({get(o){return i.includes(o)?void 0:e[o]},has(o){return i.includes(o)?!1:o in e},keys(){return Object.keys(e).filter(o=>!i.includes(o))}},dV)),a}const r=[];for(let i=0;i<=n;i++)r[i]={};for(const i of Object.getOwnPropertyNames(e)){let a=n;for(let l=0;l<t.length;l++)if(t[l].includes(i)){a=l;break}const o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}function U2(e){let t,n;const r=i=>{const a=Xe.context;if(a){const[s,l]=Ce();Xe.count||(Xe.count=0),Xe.count++,(n||(n=e())).then(c=>{!Xe.done&&Wo(a),Xe.count--,l(()=>c.default),Wo()}),t=s}else if(!t){const[s]=Yr(()=>(n||(n=e())).then(l=>l.default));t=s}let o;return Z(()=>(o=t())?lt(()=>{if(!a||Xe.done)return o(i);const s=Xe.context;Wo(a);const l=o(i);return Wo(s),l}):"")};return r.preload=()=>n||((n=e()).then(i=>t=()=>i.default),n),r}let Bge=0;function xr(){return Xe.context?Xe.getNextContextId():`cl-${Bge++}`}const Yne=e=>`Stale read from <${e}>.`;function Qt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Z(Hge(()=>e.each,e.children,t||void 0))}function xJt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return Z(Fge(()=>e.each,e.children,t||void 0))}function ke(e){const t=e.keyed,n=Z(()=>e.when,void 0,void 0),r=t?n:Z(n,void 0,{equals:(i,a)=>!i==!a});return Z(()=>{const i=r();if(i){const a=e.children;return typeof a=="function"&&a.length>0?lt(()=>a(t?i:()=>{if(!lt(r))throw Yne("Show");return n()})):a}return e.fallback},void 0,void 0)}function r0(e){const t=iq(()=>e.children),n=Z(()=>{const r=t(),i=Array.isArray(r)?r:[r];let a=()=>{};for(let o=0;o<i.length;o++){const s=o,l=i[o],c=a,u=Z(()=>c()?void 0:l.when,void 0,void 0),h=l.keyed?u:Z(u,void 0,{equals:(m,g)=>!m==!g});a=()=>c()||(h()?[s,u,l]:void 0)}return a});return Z(()=>{const r=n()();if(!r)return e.fallback;const[i,a,o]=r,s=o.children;return typeof s=="function"&&s.length>0?lt(()=>s(o.keyed?a():()=>{if(lt(n)()?.[0]!==i)throw Yne("Match");return a()})):s},void 0,void 0)}function Zn(e){return e}let gh;function Uge(){gh&&[...gh].forEach(e=>e())}function Wge(e){let t;Xe.context&&Xe.load&&(t=Xe.load(Xe.getContextId()));const[n,r]=Ce(t,void 0);return gh||(gh=new Set),gh.add(r),me(()=>gh.delete(r)),Z(()=>{let i;if(i=n()){const a=e.fallback;return typeof a=="function"&&a.length?lt(()=>a(i,()=>r())):a}return Pge(()=>e.children,r)},void 0,void 0)}const Gge=Tt();function Zge(e){let t=0,n,r,i,a,o;const[s,l]=Ce(!1),c=Rge(),u={increment:()=>{++t===1&&l(!0)},decrement:()=>{--t===0&&l(!1)},inFallback:s,effects:[],resolved:!1},h=qa();if(Xe.context&&Xe.load){const y=Xe.getContextId();let v=Xe.load(y);if(v&&(typeof v!="object"||v.s!==1?i=v:Xe.gather(y)),i&&i!=="$$f"){const[k,b]=Ce(void 0,{equals:!1});a=k,i.then(()=>{if(Xe.done)return b();Xe.gather(y),Wo(r),b(),Wo()},x=>{o=x,b()})}}const m=Lt(Gge);m&&(n=m.register(u.inFallback));let g;return me(()=>g&&g()),d(c.Provider,{value:u,get children(){return Z(()=>{if(o)throw o;if(r=Xe.context,a)return a(),a=void 0;r&&i==="$$f"&&Wo();const y=Z(()=>e.children);return Z(v=>{const k=u.inFallback(),{showContent:b=!0,showFallback:x=!0}=n?n():{};if((!k||i&&i!=="$$f")&&b)return u.resolved=!0,g&&g(),g=r=i=void 0,Oge(u.effects),y();if(x)return g?v:wr(w=>(g=w,r&&(Wo({id:r.id+"F",count:0}),r=void 0),e.fallback),h)})})}})}const Kge=["allowfullscreen","async","alpha","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","adauctionheaders","browsingtopics","credentialless","defaultchecked","defaultmuted","defaultselected","defer","disablepictureinpicture","disableremoteplayback","preservespitch","shadowrootclonable","shadowrootcustomelementregistry","shadowrootdelegatesfocus","shadowrootserializable","sharedstoragewritable"],Xge=new Set(["className","value","readOnly","noValidate","formNoValidate","isMap","noModule","playsInline","adAuctionHeaders","allowFullscreen","browsingTopics","defaultChecked","defaultMuted","defaultSelected","disablePictureInPicture","disableRemotePlayback","preservesPitch","shadowRootClonable","shadowRootCustomElementRegistry","shadowRootDelegatesFocus","shadowRootSerializable","sharedStorageWritable",...Kge]),Yge=new Set(["innerHTML","textContent","innerText","children"]),Jge=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),Qge=Object.assign(Object.create(null),{class:"className",novalidate:{$:"noValidate",FORM:1},formnovalidate:{$:"formNoValidate",BUTTON:1,INPUT:1},ismap:{$:"isMap",IMG:1},nomodule:{$:"noModule",SCRIPT:1},playsinline:{$:"playsInline",VIDEO:1},readonly:{$:"readOnly",INPUT:1,TEXTAREA:1},adauctionheaders:{$:"adAuctionHeaders",IFRAME:1},allowfullscreen:{$:"allowFullscreen",IFRAME:1},browsingtopics:{$:"browsingTopics",IMG:1},defaultchecked:{$:"defaultChecked",INPUT:1},defaultmuted:{$:"defaultMuted",AUDIO:1,VIDEO:1},defaultselected:{$:"defaultSelected",OPTION:1},disablepictureinpicture:{$:"disablePictureInPicture",VIDEO:1},disableremoteplayback:{$:"disableRemotePlayback",AUDIO:1,VIDEO:1},preservespitch:{$:"preservesPitch",AUDIO:1,VIDEO:1},shadowrootclonable:{$:"shadowRootClonable",TEMPLATE:1},shadowrootdelegatesfocus:{$:"shadowRootDelegatesFocus",TEMPLATE:1},shadowrootserializable:{$:"shadowRootSerializable",TEMPLATE:1},sharedstoragewritable:{$:"sharedStorageWritable",IFRAME:1,IMG:1}});function eye(e,t){const n=Qge[e];return typeof n=="object"?n[t]?n.$:void 0:n}const tye=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),nye=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),rye={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"},bt=e=>Z(()=>e());function iye(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,l=t[i-1].nextSibling,c=null;for(;o<i||s<a;){if(t[o]===n[s]){o++,s++;continue}for(;t[i-1]===n[a-1];)i--,a--;if(i===o){const u=a<r?s?n[s-1].nextSibling:n[a-s]:l;for(;s<a;)e.insertBefore(n[s++],u)}else if(a===s)for(;o<i;)(!c||!c.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){const u=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],u),t[i]=n[a]}else{if(!c){c=new Map;let h=s;for(;h<a;)c.set(n[h],h++)}const u=c.get(t[o]);if(u!=null)if(s<u&&u<a){let h=o,m=1,g;for(;++h<i&&h<a&&!((g=c.get(t[h]))==null||g!==u+m);)m++;if(m>u-s){const y=t[o];for(;s<u;)e.insertBefore(n[s++],y)}else e.replaceChild(n[s++],t[o++])}else o++;else t[o++].remove()}}}const fX="_$DX_DELEGATE";function aye(e,t,n,r={}){let i;return wr(a=>{i=a,t===document?e():K(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=""}}function ie(e,t,n,r){let i;const a=()=>{const s=r?document.createElementNS("http://www.w3.org/1998/Math/MathML","template"):document.createElement("template");return s.innerHTML=e,n?s.content.firstChild.firstChild:r?s.firstChild:s.content.firstChild},o=t?()=>lt(()=>document.importNode(i||(i=a()),!0)):()=>(i||(i=a())).cloneNode(!0);return o.cloneNode=o,o}function li(e,t=window.document){const n=t[fX]||(t[fX]=new Set);for(let r=0,i=e.length;r<i;r++){const a=e[r];n.has(a)||(n.add(a),t.addEventListener(a,uye))}}function gt(e,t,n){b0(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function oye(e,t,n,r){b0(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function sye(e,t,n){b0(e)||(n?e.setAttribute(t,""):e.removeAttribute(t))}function W2(e,t){b0(e)||(t==null?e.removeAttribute("class"):e.className=t)}function Y1(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=a=>i.call(e,n[1],a))}else e.addEventListener(t,n,typeof n!="function"&&n)}function hr(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let a,o;for(a=0,o=i.length;a<o;a++){const s=i[a];!s||s==="undefined"||t[s]||(pX(e,s,!1),delete n[s])}for(a=0,o=r.length;a<o;a++){const s=r[a],l=!!t[s];!s||s==="undefined"||n[s]===l||!l||(pX(e,s,!0),n[s]=l)}return n}function aq(e,t,n){if(!t)return n?gt(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,a;for(a in n)t[a]==null&&r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function kr(e,t,n){n!=null?e.style.setProperty(t,n):e.style.removeProperty(t)}function ki(e,t={},n,r){const i={};return r||Qe(()=>i.children=i2(e,t.children,i.children)),Qe(()=>typeof t.ref=="function"&&Hr(t.ref,e)),Qe(()=>lye(e,t,n,!0,i,!0)),i}function Hr(e,t,n){return lt(()=>e(t,n))}function K(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return i2(e,t,r,n);Qe(i=>i2(e,t(),i,n),r)}function lye(e,t,n,r,i={},a=!1){t||(t={});for(const o in i)if(!(o in t)){if(o==="children")continue;i[o]=mX(e,o,null,i[o],n,a,t)}for(const o in t){if(o==="children")continue;const s=t[o];i[o]=mX(e,o,s,i[o],n,a,t)}}function cye(e){let t,n;return!b0()||!(t=Xe.registry.get(n=hye()))?e():(Xe.completed&&Xe.completed.add(t),Xe.registry.delete(n),t)}function b0(e){return!!Xe.context&&!Xe.done&&(!e||e.isConnected)}function dye(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function pX(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,a=r.length;i<a;i++)e.classList.toggle(r[i],n)}function mX(e,t,n,r,i,a,o){let s,l,c,u,h;if(t==="style")return aq(e,n,r);if(t==="classList")return hr(e,n,r);if(n===r)return r;if(t==="ref")a||n(e);else if(t.slice(0,3)==="on:"){const m=t.slice(3);r&&e.removeEventListener(m,r,typeof r!="function"&&r),n&&e.addEventListener(m,n,typeof n!="function"&&n)}else if(t.slice(0,10)==="oncapture:"){const m=t.slice(10);r&&e.removeEventListener(m,r,!0),n&&e.addEventListener(m,n,!0)}else if(t.slice(0,2)==="on"){const m=t.slice(2).toLowerCase(),g=tye.has(m);if(!g&&r){const y=Array.isArray(r)?r[0]:r;e.removeEventListener(m,y)}(g||n)&&(Y1(e,m,n,g),g&&li([m]))}else if(t.slice(0,5)==="attr:")gt(e,t.slice(5),n);else if(t.slice(0,5)==="bool:")sye(e,t.slice(5),n);else if((h=t.slice(0,5)==="prop:")||(c=Yge.has(t))||!i&&((u=eye(t,e.tagName))||(l=Xge.has(t)))||(s=e.nodeName.includes("-")||"is"in o)){if(h)t=t.slice(5),l=!0;else if(b0(e))return n;t==="class"||t==="className"?W2(e,n):s&&!l&&!c?e[dye(t)]=n:e[u||t]=n}else{const m=i&&t.indexOf(":")>-1&&rye[t.split(":")[0]];m?oye(e,m,t,n):gt(e,Jge[t]||t,n)}return n}function uye(e){if(Xe.registry&&Xe.events&&Xe.events.find(([l,c])=>c===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,i=e.currentTarget,a=l=>Object.defineProperty(e,"target",{configurable:!0,value:l}),o=()=>{const l=t[n];if(l&&!t.disabled){const c=t[`${n}Data`];if(c!==void 0?l.call(t,c,e):l.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&a(t.host),!0},s=()=>{for(;o()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),Xe.registry&&!Xe.done&&(Xe.done=_$HY.done=!0),e.composedPath){const l=e.composedPath();a(l[0]);for(let c=0;c<l.length-2&&(t=l[c],!!o());c++){if(t._$host){t=t._$host,s();break}if(t.parentNode===i)break}}else s();a(r)}function i2(e,t,n,r,i){const a=b0(e);if(a){!n&&(n=[...e.childNodes]);let l=[];for(let c=0;c<n.length;c++){const u=n[c];u.nodeType===8&&u.data.slice(0,2)==="!$"?u.remove():l.push(u)}n=l}for(;typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(a||o==="number"&&(t=t.toString(),t===n))return n;if(s){let l=n[0];l&&l.nodeType===3?l.data!==t&&(l.data=t):l=document.createTextNode(t),n=j0(e,n,r,l)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(a)return n;n=j0(e,n,r)}else{if(o==="function")return Qe(()=>{let l=t();for(;typeof l=="function";)l=l();n=i2(e,l,n,r)}),()=>n;if(Array.isArray(t)){const l=[],c=n&&Array.isArray(n);if(uV(l,t,n,i))return Qe(()=>n=i2(e,l,n,r,!0)),()=>n;if(a){if(!l.length)return n;if(r===void 0)return n=[...e.childNodes];let u=l[0];if(u.parentNode!==e)return n;const h=[u];for(;(u=u.nextSibling)!==r;)h.push(u);return n=h}if(l.length===0){if(n=j0(e,n,r),s)return n}else c?n.length===0?gX(e,l,r):iye(e,n,l):(n&&j0(e),gX(e,l));n=l}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=j0(e,n,r,t);j0(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function uV(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let s=t[a],l=n&&n[e.length],c;if(!(s==null||s===!0||s===!1))if((c=typeof s)=="object"&&s.nodeType)e.push(s);else if(Array.isArray(s))i=uV(e,s,l)||i;else if(c==="function")if(r){for(;typeof s=="function";)s=s();i=uV(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||i}else e.push(s),i=!0;else{const u=String(s);l&&l.nodeType===3&&l.data===u?e.push(l):e.push(document.createTextNode(u))}}return i}function gX(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function j0(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let a=!1;for(let o=t.length-1;o>=0;o--){const s=t[o];if(i!==s){const l=s.parentNode===e;!a&&!o?l?e.replaceChild(i,s):e.insertBefore(i,n):l&&s.remove()}else a=!0}}else e.insertBefore(i,n);return[i]}function hye(){return Xe.getNextContextId()}const fye=!1,pye="http://www.w3.org/2000/svg";function Jne(e,t=!1,n=void 0){return t?document.createElementNS(pye,e):document.createElement(e,{is:n})}function w0(e){const{useShadow:t}=e,n=document.createTextNode(""),r=()=>e.mount||document.body,i=qa();let a,o=!!Xe.context;return he(()=>{o&&(qa().user=o=!1),a||(a=Go(i,()=>Z(()=>e.children)));const s=r();if(s instanceof HTMLHeadElement){const[l,c]=Ce(!1),u=()=>c(!0);wr(h=>K(s,()=>l()?h():a(),null)),me(u)}else{const l=Jne(e.isSVG?"g":"div",e.isSVG),c=t&&l.attachShadow?l.attachShadow({mode:"open"}):l;Object.defineProperty(l,"_$host",{get(){return n.parentNode},configurable:!0}),K(c,a),s.appendChild(l),e.ref&&e.ref(l),me(()=>s.removeChild(l))}},void 0,{render:!o}),n}function mye(e,t){const n=Z(e);return Z(()=>{const r=n();switch(typeof r){case"function":return lt(()=>r(t));case"string":const i=nye.has(r),a=Xe.context?cye():Jne(r,i,lt(()=>t.is));return ki(a,t,i),a}})}function oq(e){const[,t]=Se(e,["component"]);return mye(()=>e.component,t)}const gye="modulepreload",yye=function(e){return"/"+e},yX={},z=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let l=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),s=o?.nonce||o?.getAttribute("nonce");i=l(n.map(c=>{if(c=yye(c),c in yX)return;yX[c]=!0;const u=c.endsWith(".css"),h=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const m=document.createElement("link");if(m.rel=u?"stylesheet":gye,u||(m.as="script"),m.crossOrigin="",m.href=c,s&&m.setAttribute("nonce",s),document.head.appendChild(m),u)return new Promise((g,y)=>{m.addEventListener("load",g),m.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(o){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=o,window.dispatchEvent(s),!s.defaultPrevented)throw o}return i.then(o=>{for(const s of o||[])s.status==="rejected"&&a(s.reason);return t().catch(a)})};function Nn(e){const t=Tt();return{provider:n=>{const r=e.init(n);if(!(e.gate??!0))return d(t.Provider,{value:r,get children(){return n.children}});const a=Z(()=>{const o=r.ready;return o===void 0||(typeof o=="function"?o():o)});return d(ke,{get when(){return a()},get children(){return d(t.Provider,{value:r,get children(){return n.children}})}})},use(){const n=Lt(t);if(!n)throw new Error(`${e.name} context must be used within a context provider`);return n}}}const{use:vye,provider:Qne}=Nn({name:"Data",init:e=>({get store(){return e.data},get directory(){return e.directory},get mediaUrl(){return e.mediaUrl},navigateToSession:e.onNavigateToSession,sessionHref:e.onSessionHref})}),ere=Nn({name:"FileComponent",init:e=>e.component}),kye=ere.provider,_Jt=ere.use,bye=e=>e!=null,MJt=e=>e.filter(bye);function wye(e){return(...t)=>{for(const n of e)n&&n(...t)}}const be=e=>typeof e=="function"&&!e.length?e():e,vX=e=>Array.isArray(e)?e:e?[e]:[];function xye(e,...t){return typeof e=="function"?e(...t):e}const RU=me;function _ye(e,t,n){if(Xe.context){const[r,i]=Ce(e,n);return dn(()=>i(()=>t())),[r,i]}return Ce(t(),n)}function SJt(e,t,n,r){const i=e.length,a=t.length;let o=0;if(!a){for(;o<i;o++)n(e[o]);return}if(!i){for(;o<a;o++)r(t[o]);return}for(;o<a&&t[o]===e[o];o++);let s,l;t=t.slice(o),e=e.slice(o);for(s of t)e.includes(s)||r(s);for(l of e)t.includes(l)||n(l)}function tre(e,t,n,r){return e.addEventListener(t,n,r),RU(e.removeEventListener.bind(e,t,n,r))}function Mye(e,t,n,r){const i=()=>{vX(be(e)).forEach(a=>{a&&vX(be(t)).forEach(o=>tre(a,o,n,r))})};typeof e=="function"?he(i):Qe(i)}function Sye(e,t=qa()){let n=0,r,i;return()=>(n++,me(()=>{n--,queueMicrotask(()=>{!n&&i&&(i(),i=r=void 0)})}),i||wr(a=>r=e(i=a),t),r)}function Cye(e){const t=qa(),n=Sye(e,t);return()=>Xe.context?wr(e,t):n()}function zU(e,t=!1){const n=window.matchMedia(e),[r,i]=_ye(t,()=>n.matches);return tre(n,"change",()=>i(n.matches)),r}function Lye(e){return zU("(prefers-color-scheme: dark)",e)}Lye.bind(void 0,!1);const Iye=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function kX(e){const t={};let n;for(;n=Iye.exec(e);)t[n[1]]=n[2];return t}function Wa(e,t){if(typeof e=="string"){if(typeof t=="string")return`${e};${t}`;e=kX(e)}else typeof t=="string"&&(t=kX(t));return{...e,...t}}function hn(...e){return wye(e)}function Nye(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}function hV(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Aye(e){return typeof e=="number"}function lh(e){return Object.prototype.toString.call(e)==="[object String]"}function nre(e){return typeof e=="function"}function Io(e){return t=>`${e()}-${t}`}function $ye(){const e=new Map,t=(i,a,o,s)=>{const l=s?.once?(...c)=>{e.delete(o),o(...c)}:o;e.set(o,{type:a,eventTarget:i,fn:l,options:s}),i.addEventListener(a,o,s)},n=(i,a,o,s)=>{const l=e.get(o)?.fn||o;i.removeEventListener(a,l,s),e.delete(o)},r=()=>{e.forEach((i,a)=>{n(i.eventTarget,i.type,a,i.options)})};return me(()=>{r()}),{addGlobalListener:t,removeGlobalListener:n,removeAllGlobalListeners:r}}function Yn(e,t){return e?e===t||e.contains(t):!1}function Mp(e,t=!1){const{activeElement:n}=ri(e);if(!n?.nodeName)return null;if(rre(n)&&n.contentDocument)return Mp(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const i=ri(n).getElementById(r);if(i)return i}}return n}function qU(e){return ri(e).defaultView||window}function ri(e){return e?e.ownerDocument||e:document}function rre(e){return e.tagName==="IFRAME"}var ire=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(ire||{});function are(e){return typeof window>"u"||window.navigator==null?!1:window.navigator.userAgentData?.brands.some(t=>e.test(t.brand))||e.test(window.navigator.userAgent)}function jU(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.userAgentData?.platform||window.navigator.platform):!1}function sq(){return jU(/^Mac/i)}function Tye(){return jU(/^iPhone/i)}function Eye(){return jU(/^iPad/i)||sq()&&navigator.maxTouchPoints>1}function Pye(){return Tye()||Eye()}function Dye(){return sq()||Pye()}function CJt(){return are(/AppleWebKit/i)&&!Oye()}function Oye(){return are(/Chrome/i)}function dt(e,t){return t&&(nre(t)?t(e):t[0](t[1],e)),e?.defaultPrevented}function Kn(e){return t=>{for(const n of e)dt(t,n)}}function Rye(e){return sq()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function ur(e){if(e)if(zye())e.focus({preventScroll:!0});else{const t=qye(e);e.focus(),jye(t)}}var Vm=null;function zye(){if(Vm==null){Vm=!1;try{document.createElement("div").focus({get preventScroll(){return Vm=!0,!0}})}catch{}}return Vm}function qye(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function jye(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}var ore=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],Hye=[...ore,'[tabindex]:not([tabindex="-1"]):not([disabled])'],HU=`${ore.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`,Fye=Hye.join(':not([hidden]):not([tabindex="-1"]),');function sre(e,t){const r=Array.from(e.querySelectorAll(HU)).filter(bX);return t&&bX(e)&&r.unshift(e),r.forEach((i,a)=>{if(rre(i)&&i.contentDocument){const o=i.contentDocument.body,s=sre(o,!1);r.splice(a,1,...s)}}),r}function bX(e){return lre(e)&&!Vye(e)}function lre(e){return e.matches(HU)&&FU(e)}function Vye(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function FU(e,t){return e.nodeName!=="#comment"&&Bye(e)&&Uye(e,t)&&(!e.parentElement||FU(e.parentElement,e))}function Bye(e){if(!(e instanceof HTMLElement)&&!(e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r=t!=="none"&&n!=="hidden"&&n!=="collapse";if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:i}=e.ownerDocument.defaultView,{display:a,visibility:o}=i(e);r=a!=="none"&&o!=="hidden"&&o!=="collapse"}return r}function Uye(e,t){return!e.hasAttribute("hidden")&&(e.nodeName==="DETAILS"&&t&&t.nodeName!=="SUMMARY"?e.hasAttribute("open"):!0)}function Wye(e,t,n){const r=t?.tabbable?Fye:HU,i=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(a){return t?.from?.contains(a)?NodeFilter.FILTER_REJECT:a.matches(r)&&FU(a)&&(!t?.accept||t.accept(a))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return t?.from&&(i.currentNode=t.from),i}function wX(e){let t=e;for(;t&&!Gye(t);)t=t.parentElement;return t||document.scrollingElement||document.documentElement}function Gye(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Zye(){}function cre(e){return[e.clientX,e.clientY]}function VU(e,t){const[n,r]=e;let i=!1;const a=t.length;for(let o=a,s=0,l=o-1;s<o;l=s++){const[c,u]=t[s],[h,m]=t[l],[,g]=t[l===0?o-1:l-1]||[0,0],y=(u-m)*(n-c)-(c-h)*(r-u);if(m<u){if(r>=m&&r<u){if(y===0)return!0;y>0&&(r===m?r>g&&(i=!i):i=!i)}}else if(u<m){if(r>u&&r<=m){if(y===0)return!0;y<0&&(r===m?r<g&&(i=!i):i=!i)}}else if(r===u&&(n>=h&&n<=c||n>=c&&n<=h))return!0}return i}function ft(e,t){return f(e,t)}var Yf=new Map,xX=new Set;function _X(){if(typeof window>"u")return;const e=n=>{if(!n.target)return;let r=Yf.get(n.target);r||(r=new Set,Yf.set(n.target,r),n.target.addEventListener("transitioncancel",t)),r.add(n.propertyName)},t=n=>{if(!n.target)return;const r=Yf.get(n.target);if(r&&(r.delete(n.propertyName),r.size===0&&(n.target.removeEventListener("transitioncancel",t),Yf.delete(n.target)),Yf.size===0)){for(const i of xX)i();xX.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",t)}typeof document<"u"&&(document.readyState!=="loading"?_X():document.addEventListener("DOMContentLoaded",_X));function fV(e,t){const n=MX(e,t,"left"),r=MX(e,t,"top"),i=t.offsetWidth,a=t.offsetHeight;let o=e.scrollLeft,s=e.scrollTop;const l=o+e.offsetWidth,c=s+e.offsetHeight;n<=o?o=n:n+i>l&&(o+=n+i-l),r<=s?s=r:r+a>c&&(s+=r+a-c),e.scrollLeft=o,e.scrollTop=s}function MX(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){i-=e[r];break}t=t.offsetParent}return i}function Kye(e,t){if(document.contains(e)){const n=document.scrollingElement||document.documentElement;if(window.getComputedStyle(n).overflow==="hidden"){let i=wX(e);for(;e&&i&&e!==n&&i!==n;)fV(i,e),e=i,i=wX(e)}else{const{left:i,top:a}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:o,top:s}=e.getBoundingClientRect();(Math.abs(i-o)>1||Math.abs(a-s)>1)&&e.scrollIntoView?.({block:"nearest"})}}}var Xye={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"},a2="data-kb-top-layer",dre,pV=!1,rs=[];function o2(e){return rs.findIndex(t=>t.node===e)}function Yye(e){return rs[o2(e)]}function Jye(e){return rs[rs.length-1].node===e}function ure(){return rs.filter(e=>e.isPointerBlocking)}function Qye(){return[...ure()].slice(-1)[0]}function BU(){return ure().length>0}function hre(e){const t=o2(Qye()?.node);return o2(e)<t}function eve(e){rs.push(e)}function tve(e){const t=o2(e);t<0||rs.splice(t,1)}function nve(){for(const{node:e}of rs)e.style.pointerEvents=hre(e)?"none":"auto"}function rve(e){if(BU()&&!pV){const t=ri(e);dre=document.body.style.pointerEvents,t.body.style.pointerEvents="none",pV=!0}}function ive(e){if(BU())return;const t=ri(e);t.body.style.pointerEvents=dre,t.body.style.length===0&&t.body.removeAttribute("style"),pV=!1}var Si={layers:rs,isTopMostLayer:Jye,hasPointerBlockingLayer:BU,isBelowPointerBlockingLayer:hre,addLayer:eve,removeLayer:tve,indexOf:o2,find:Yye,assignPointerEventToLayers:nve,disableBodyPointerEvents:rve,restoreBodyPointerEvents:ive},rH="focusScope.autoFocusOnMount",iH="focusScope.autoFocusOnUnmount",SX={bubbles:!1,cancelable:!0},CX={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=hV(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=hV(this.stack,e),this.active()?.resume()}};function fre(e,t){const[n,r]=Ce(!1),i={pause(){r(!0)},resume(){r(!1)}};let a=null;const o=y=>e.onMountAutoFocus?.(y),s=y=>e.onUnmountAutoFocus?.(y),l=()=>ri(t()),c=()=>{const y=l().createElement("span");return y.setAttribute("data-focus-trap",""),y.tabIndex=0,Object.assign(y.style,Xye),y},u=()=>{const y=t();return y?sre(y,!0).filter(v=>!v.hasAttribute("data-focus-trap")):[]},h=()=>{const y=u();return y.length>0?y[0]:null},m=()=>{const y=u();return y.length>0?y[y.length-1]:null},g=()=>{const y=t();if(!y)return!1;const v=Mp(y);return!v||Yn(y,v)?!1:lre(v)};he(()=>{const y=t();if(!y)return;CX.add(i);const v=Mp(y);if(!Yn(y,v)){const b=new CustomEvent(rH,SX);y.addEventListener(rH,o),y.dispatchEvent(b),b.defaultPrevented||setTimeout(()=>{ur(h()),Mp(y)===v&&ur(y)},0)}me(()=>{y.removeEventListener(rH,o),setTimeout(()=>{const b=new CustomEvent(iH,SX);g()&&b.preventDefault(),y.addEventListener(iH,s),y.dispatchEvent(b),b.defaultPrevented||ur(v??l().body),y.removeEventListener(iH,s),CX.remove(i)},0)})}),he(()=>{const y=t();if(!y||!be(e.trapFocus)||n())return;const v=b=>{const x=b.target;x?.closest(`[${a2}]`)||(Yn(y,x)?a=x:ur(a))},k=b=>{const w=b.relatedTarget??Mp(y);w?.closest(`[${a2}]`)||Yn(y,w)||ur(a)};l().addEventListener("focusin",v),l().addEventListener("focusout",k),me(()=>{l().removeEventListener("focusin",v),l().removeEventListener("focusout",k)})}),he(()=>{const y=t();if(!y||!be(e.trapFocus)||n())return;const v=c();y.insertAdjacentElement("afterbegin",v);const k=c();y.insertAdjacentElement("beforeend",k);function b(w){const M=h(),_=m();w.relatedTarget===M?ur(_):ur(M)}v.addEventListener("focusin",b),k.addEventListener("focusin",b);const x=new MutationObserver(w=>{for(const M of w)M.previousSibling===k&&(k.remove(),y.insertAdjacentElement("beforeend",k)),M.nextSibling===v&&(v.remove(),y.insertAdjacentElement("afterbegin",v))});x.observe(y,{childList:!0,subtree:!1}),me(()=>{v.removeEventListener("focusin",b),k.removeEventListener("focusin",b),v.remove(),k.remove(),x.disconnect()})})}var ave="data-live-announcer";function pre(e){he(()=>{be(e.isDisabled)||me(ove(be(e.targets),be(e.root)))})}var Jf=new WeakMap,Ui=[];function ove(e,t=document.body){const n=new Set(e),r=new Set,i=l=>{for(const m of l.querySelectorAll(`[${ave}], [${a2}]`))n.add(m);const c=m=>{if(n.has(m)||m.parentElement&&r.has(m.parentElement)&&m.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(const g of n)if(m.contains(g))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},u=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:c}),h=c(l);if(h===NodeFilter.FILTER_ACCEPT&&a(l),h!==NodeFilter.FILTER_REJECT){let m=u.nextNode();for(;m!=null;)a(m),m=u.nextNode()}},a=l=>{const c=Jf.get(l)??0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),Jf.set(l,c+1))};Ui.length&&Ui[Ui.length-1].disconnect(),i(t);const o=new MutationObserver(l=>{for(const c of l)if(!(c.type!=="childList"||c.addedNodes.length===0)&&![...n,...r].some(u=>u.contains(c.target))){for(const u of c.removedNodes)u instanceof Element&&(n.delete(u),r.delete(u));for(const u of c.addedNodes)(u instanceof HTMLElement||u instanceof SVGElement)&&(u.dataset.liveAnnouncer==="true"||u.dataset.reactAriaTopLayer==="true")?n.add(u):u instanceof Element&&i(u)}});o.observe(t,{childList:!0,subtree:!0});const s={observe(){o.observe(t,{childList:!0,subtree:!0})},disconnect(){o.disconnect()}};return Ui.push(s),()=>{o.disconnect();for(const l of r){const c=Jf.get(l);if(c==null)return;c===1?(l.removeAttribute("aria-hidden"),Jf.delete(l)):Jf.set(l,c-1)}s===Ui[Ui.length-1]?(Ui.pop(),Ui.length&&Ui[Ui.length-1].observe()):Ui.splice(Ui.indexOf(s),1)}}var LX="interactOutside.pointerDownOutside",IX="interactOutside.focusOutside";function sve(e,t){let n,r=Zye;const i=()=>ri(t()),a=h=>e.onPointerDownOutside?.(h),o=h=>e.onFocusOutside?.(h),s=h=>e.onInteractOutside?.(h),l=h=>{const m=h.target;return!(m instanceof Element)||m.closest(`[${a2}]`)||!Yn(i(),m)||Yn(t(),m)?!1:!e.shouldExcludeElement?.(m)},c=h=>{function m(){const g=t(),y=h.target;if(!g||!y||!l(h))return;const v=Kn([a,s]);y.addEventListener(LX,v,{once:!0});const k=new CustomEvent(LX,{bubbles:!1,cancelable:!0,detail:{originalEvent:h,isContextMenu:h.button===2||Rye(h)&&h.button===0}});y.dispatchEvent(k)}h.pointerType==="touch"?(i().removeEventListener("click",m),r=m,i().addEventListener("click",m,{once:!0})):m()},u=h=>{const m=t(),g=h.target;if(!m||!g||!l(h))return;const y=Kn([o,s]);g.addEventListener(IX,y,{once:!0});const v=new CustomEvent(IX,{bubbles:!1,cancelable:!0,detail:{originalEvent:h,isContextMenu:!1}});g.dispatchEvent(v)};he(()=>{be(e.isDisabled)||(n=window.setTimeout(()=>{i().addEventListener("pointerdown",c,!0)},0),i().addEventListener("focusin",u,!0),me(()=>{window.clearTimeout(n),i().removeEventListener("click",r),i().removeEventListener("pointerdown",c,!0),i().removeEventListener("focusin",u,!0)}))})}function lve(e){const t=n=>{n.key===ire.Escape&&e.onEscapeKeyDown?.(n)};he(()=>{if(be(e.isDisabled))return;const n=e.ownerDocument?.()??ri();n.addEventListener("keydown",t),me(()=>{n.removeEventListener("keydown",t)})})}function zt(e){const[t,n]=Se(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return d(oq,f(n,{get component(){return t.as}}))}var mre=Tt();function cve(){return Lt(mre)}function lq(e){let t;const n=cve(),[r,i]=Se(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),a=new Set([]),o=h=>{a.add(h);const m=n?.registerNestedLayer(h);return()=>{a.delete(h),m?.()}};sve({shouldExcludeElement:h=>t?r.excludedElements?.some(m=>Yn(m(),h))||[...a].some(m=>Yn(m,h)):!1,onPointerDownOutside:h=>{!t||Si.isBelowPointerBlockingLayer(t)||!r.bypassTopMostLayerCheck&&!Si.isTopMostLayer(t)||(r.onPointerDownOutside?.(h),r.onInteractOutside?.(h),h.defaultPrevented||r.onDismiss?.())},onFocusOutside:h=>{r.onFocusOutside?.(h),r.onInteractOutside?.(h),h.defaultPrevented||r.onDismiss?.()}},()=>t),lve({ownerDocument:()=>ri(t),onEscapeKeyDown:h=>{!t||!Si.isTopMostLayer(t)||(r.onEscapeKeyDown?.(h),!h.defaultPrevented&&r.onDismiss&&(h.preventDefault(),r.onDismiss()))}}),dn(()=>{if(!t)return;Si.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const h=n?.registerNestedLayer(t);Si.assignPointerEventToLayers(),Si.disableBodyPointerEvents(t),me(()=>{t&&(Si.removeLayer(t),h?.(),Si.assignPointerEventToLayers(),Si.restoreBodyPointerEvents(t))})}),he(vn([()=>t,()=>r.disableOutsidePointerEvents],([h,m])=>{if(!h)return;const g=Si.find(h);g&&g.isPointerBlocking!==m&&(g.isPointerBlocking=m,Si.assignPointerEventToLayers()),m&&Si.disableBodyPointerEvents(h),me(()=>{Si.restoreBodyPointerEvents(h)})},{defer:!0}));const u={registerNestedLayer:o};return d(mre.Provider,{value:u,get children(){return d(zt,f({as:"div",ref(h){var m=hn(g=>t=g,r.ref);typeof m=="function"&&m(h)}},i))}})}function G2(e){const[t,n]=Ce(e.defaultValue?.()),r=Z(()=>e.value?.()!==void 0),i=Z(()=>r()?e.value?.():t());return[i,o=>{lt(()=>{const s=xye(o,i());return Object.is(s,i())||(r()||n(s),e.onChange?.(s)),s})}]}function gre(e){const[t,n]=G2(e);return[()=>t()??!1,n]}function dve(e){const[t,n]=G2(e);return[()=>t()??[],n]}function x0(e={}){const[t,n]=gre({value:()=>be(e.open),defaultValue:()=>!!be(e.defaultOpen),onChange:o=>e.onOpenChange?.(o)}),r=()=>{n(!0)},i=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:i,toggle:()=>{t()?i():r()}}}function Z2(e,t){const[n,r]=Ce(NX(t?.()));return he(()=>{r(e()?.tagName.toLowerCase()||NX(t?.()))}),n}function NX(e){return lh(e)?e:void 0}var uve=Object.defineProperty,Ga=(e,t)=>{for(var n in t)uve(e,n,{get:t[n],enumerable:!0})},hve={};Ga(hve,{Button:()=>UU,Root:()=>_0});var fve=["button","color","file","image","reset","submit"];function pve(e){const t=e.tagName.toLowerCase();return t==="button"?!0:t==="input"&&e.type?fve.indexOf(e.type)!==-1:!1}function _0(e){let t;const n=ft({type:"button"},e),[r,i]=Se(n,["ref","type","disabled"]),a=Z2(()=>t,()=>"button"),o=Z(()=>{const c=a();return c==null?!1:pve({tagName:c,type:r.type})}),s=Z(()=>a()==="input"),l=Z(()=>a()==="a"&&t?.getAttribute("href")!=null);return d(zt,f({as:"button",ref(c){var u=hn(h=>t=h,r.ref);typeof u=="function"&&u(c)},get type(){return bt(()=>!!(o()||s()))()?r.type:void 0},get role(){return!o()&&!l()?"button":void 0},get tabIndex(){return!o()&&!l()&&!r.disabled?0:void 0},get disabled(){return bt(()=>!!(o()||s()))()?r.disabled:void 0},get"aria-disabled"(){return!o()&&!s()&&r.disabled?!0:void 0},get"data-disabled"(){return r.disabled?"":void 0}},i))}var UU=_0;function zr(e){return t=>(e(t),()=>e(void 0))}var Er=e=>typeof e=="function"?e():e,mV=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},Bm=new Map,mve=e=>{he(()=>{const t=Er(e.style)??{},n=Er(e.properties)??[],r={};for(const a in t)r[a]=e.element.style[a];const i=Bm.get(e.key);i?i.activeCount++:Bm.set(e.key,{activeCount:1,originalStyles:r,properties:n.map(a=>a.key)}),Object.assign(e.element.style,e.style);for(const a of n)e.element.style.setProperty(a.key,a.value);me(()=>{const a=Bm.get(e.key);if(a){if(a.activeCount!==1){a.activeCount--;return}Bm.delete(e.key);for(const[o,s]of Object.entries(a.originalStyles))e.element.style[o]=s;for(const o of a.properties)e.element.style.removeProperty(o);e.element.style.length===0&&e.element.removeAttribute("style"),e.cleanup?.()}})})},AX=mve,gve=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},yve=(e,t)=>{const n=getComputedStyle(e),r=t==="x"?n.overflowX:n.overflowY;return r==="auto"||r==="scroll"||e.tagName==="HTML"&&r==="visible"},vve=(e,t,n)=>{const r=t==="x"&&window.getComputedStyle(e).direction==="rtl"?-1:1;let i=e,a=0,o=0,s=!1;do{const[l,c,u]=gve(i,t),h=u-l-r*c;(c!==0||h!==0)&&yve(i,t)&&(a+=h,o+=c),i===(n??document.documentElement)?s=!0:i=i._$host??i.parentElement}while(i&&!s);return[a,o]},[$X,TX]=Ce([]),kve=e=>$X().indexOf(e)===$X().length-1,bve=e=>{const t=f({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=xr();let r=[0,0],i=null,a=null;he(()=>{Er(t.enabled)&&(TX(c=>[...c,n]),me(()=>{TX(c=>c.filter(u=>u!==n))}))}),he(()=>{if(!Er(t.enabled)||!Er(t.hideScrollbar))return;const{body:c}=document,u=window.innerWidth-c.offsetWidth;if(Er(t.preventScrollbarShift)){const h={overflow:"hidden"},m=[];u>0&&(Er(t.preventScrollbarShiftMode)==="padding"?h.paddingRight=`calc(${window.getComputedStyle(c).paddingRight} + ${u}px)`:h.marginRight=`calc(${window.getComputedStyle(c).marginRight} + ${u}px)`,m.push({key:"--scrollbar-width",value:`${u}px`}));const g=window.scrollY,y=window.scrollX;AX({key:"prevent-scroll",element:c,style:h,properties:m,cleanup:()=>{Er(t.restoreScrollPosition)&&u>0&&window.scrollTo(y,g)}})}else AX({key:"prevent-scroll",element:c,style:{overflow:"hidden"}})}),he(()=>{!kve(n)||!Er(t.enabled)||(document.addEventListener("wheel",s,{passive:!1}),document.addEventListener("touchstart",o,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),me(()=>{document.removeEventListener("wheel",s),document.removeEventListener("touchstart",o),document.removeEventListener("touchmove",l)}))});const o=c=>{r=EX(c),i=null,a=null},s=c=>{const u=c.target,h=Er(t.element),m=wve(c),g=Math.abs(m[0])>Math.abs(m[1])?"x":"y",y=g==="x"?m[0]:m[1],v=PX(u,g,y,h);let k;h&&mV(h,u)?k=!v:k=!0,k&&c.cancelable&&c.preventDefault()},l=c=>{const u=Er(t.element),h=c.target;let m;if(c.touches.length===2)m=!Er(t.allowPinchZoom);else{if(i==null||a===null){const g=EX(c).map((v,k)=>r[k]-v),y=Math.abs(g[0])>Math.abs(g[1])?"x":"y";i=y,a=y==="x"?g[0]:g[1]}if(h.type==="range")m=!1;else{const g=PX(h,i,a,u);u&&mV(u,h)?m=!g:m=!0}}m&&c.cancelable&&c.preventDefault()}},wve=e=>[e.deltaX,e.deltaY],EX=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],PX=(e,t,n,r)=>{const i=r!==null&&mV(r,e),[a,o]=vve(e,t,i?r:void 0);return!(n>0&&Math.abs(a)<=1||n<0&&Math.abs(o)<1)},xve=bve,yre=xve,_ve=e=>{const t=Z(()=>{const o=Er(e.element);if(o)return getComputedStyle(o)}),n=()=>t()?.animationName??"none",[r,i]=Ce(Er(e.show)?"present":"hidden");let a="none";return he(o=>{const s=Er(e.show);return lt(()=>{if(o===s)return s;const l=a,c=n();s?i("present"):c==="none"||t()?.display==="none"?i("hidden"):i(o===!0&&l!==c?"hiding":"hidden")}),s}),he(()=>{const o=Er(e.element);if(!o)return;const s=c=>{c.target===o&&(a=n())},l=c=>{const h=n().includes(c.animationName);c.target===o&&h&&r()==="hiding"&&i("hidden")};o.addEventListener("animationstart",s),o.addEventListener("animationcancel",l),o.addEventListener("animationend",l),me(()=>{o.removeEventListener("animationstart",s),o.removeEventListener("animationcancel",l),o.removeEventListener("animationend",l)})}),{present:()=>r()==="present"||r()==="hiding",state:r,setState:i}},Mve=_ve,i0=Mve,Sve={};Ga(Sve,{CloseButton:()=>kre,Content:()=>bre,Description:()=>wre,Dialog:()=>Ds,Overlay:()=>xre,Portal:()=>_re,Root:()=>Mre,Title:()=>Sre,Trigger:()=>Cre,useDialogContext:()=>al});var vre=Tt();function al(){const e=Lt(vre);if(e===void 0)throw new Error("[kobalte]: `useDialogContext` must be used within a `Dialog` component");return e}function kre(e){const t=al(),[n,r]=Se(e,["aria-label","onClick"]);return d(_0,f({get"aria-label"(){return n["aria-label"]||t.translations().dismiss},onClick:a=>{dt(a,n.onClick),t.close()}},r))}function bre(e){let t;const n=al(),r=ft({id:n.generateId("content")},e),[i,a]=Se(r,["ref","onOpenAutoFocus","onCloseAutoFocus","onPointerDownOutside","onFocusOutside","onInteractOutside"]);let o=!1,s=!1;const l=m=>{i.onPointerDownOutside?.(m),n.modal()&&m.detail.isContextMenu&&m.preventDefault()},c=m=>{i.onFocusOutside?.(m),n.modal()&&m.preventDefault()},u=m=>{i.onInteractOutside?.(m),!n.modal()&&(m.defaultPrevented||(o=!0,m.detail.originalEvent.type==="pointerdown"&&(s=!0)),Yn(n.triggerRef(),m.target)&&m.preventDefault(),m.detail.originalEvent.type==="focusin"&&s&&m.preventDefault())},h=m=>{i.onCloseAutoFocus?.(m),n.modal()?(m.preventDefault(),ur(n.triggerRef())):(m.defaultPrevented||(o||ur(n.triggerRef()),m.preventDefault()),o=!1,s=!1)};return pre({isDisabled:()=>!(n.isOpen()&&n.modal()),targets:()=>t?[t]:[]}),yre({element:()=>t??null,enabled:()=>n.contentPresent()&&n.preventScroll()}),fre({trapFocus:()=>n.isOpen()&&n.modal(),onMountAutoFocus:i.onOpenAutoFocus,onUnmountAutoFocus:h},()=>t),he(()=>me(n.registerContentId(a.id))),d(ke,{get when(){return n.contentPresent()},get children(){return d(lq,f({ref(m){var g=hn(y=>{n.setContentRef(y),t=y},i.ref);typeof g=="function"&&g(m)},role:"dialog",tabIndex:-1,get disableOutsidePointerEvents(){return bt(()=>!!n.modal())()&&n.isOpen()},get excludedElements(){return[n.triggerRef]},get"aria-labelledby"(){return n.titleId()},get"aria-describedby"(){return n.descriptionId()},get"data-expanded"(){return n.isOpen()?"":void 0},get"data-closed"(){return n.isOpen()?void 0:""},onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,get onDismiss(){return n.close}},a))}})}function wre(e){const t=al(),n=ft({id:t.generateId("description")},e),[r,i]=Se(n,["id"]);return he(()=>me(t.registerDescriptionId(r.id))),d(zt,f({as:"p",get id(){return r.id}},i))}function xre(e){const t=al(),[n,r]=Se(e,["ref","style","onPointerDown"]),i=a=>{dt(a,n.onPointerDown),a.target===a.currentTarget&&a.preventDefault()};return d(ke,{get when(){return t.overlayPresent()},get children(){return d(zt,f({as:"div",ref(a){var o=hn(t.setOverlayRef,n.ref);typeof o=="function"&&o(a)},get style(){return Wa({"pointer-events":"auto"},n.style)},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onPointerDown:i},r))}})}function _re(e){const t=al();return d(ke,{get when(){return t.contentPresent()||t.overlayPresent()},get children(){return d(w0,e)}})}var DX={dismiss:"Dismiss"};function Mre(e){const t=`dialog-${xr()}`,n=ft({id:t,modal:!0,translations:DX},e),[r,i]=Ce(),[a,o]=Ce(),[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(),[g,y]=Ce(),v=x0({open:()=>n.open,defaultOpen:()=>n.defaultOpen,onOpenChange:M=>n.onOpenChange?.(M)}),k=()=>n.forceMount||v.isOpen(),{present:b}=i0({show:k,element:()=>c()??null}),{present:x}=i0({show:k,element:()=>h()??null}),w={translations:()=>n.translations??DX,isOpen:v.isOpen,modal:()=>n.modal??!0,preventScroll:()=>n.preventScroll??w.modal(),contentId:r,titleId:a,descriptionId:s,triggerRef:g,overlayRef:c,setOverlayRef:u,contentRef:h,setContentRef:m,overlayPresent:b,contentPresent:x,close:v.close,toggle:v.toggle,setTriggerRef:y,generateId:Io(()=>n.id),registerContentId:zr(i),registerTitleId:zr(o),registerDescriptionId:zr(l)};return d(vre.Provider,{value:w,get children(){return n.children}})}function Sre(e){const t=al(),n=ft({id:t.generateId("title")},e),[r,i]=Se(n,["id"]);return he(()=>me(t.registerTitleId(r.id))),d(zt,f({as:"h2",get id(){return r.id}},i))}function Cre(e){const t=al(),[n,r]=Se(e,["ref","onClick"]);return d(_0,f({ref(a){var o=hn(t.setTriggerRef,n.ref);typeof o=="function"&&o(a)},"aria-haspopup":"dialog",get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return bt(()=>!!t.isOpen())()?t.contentId():void 0},get"data-expanded"(){return t.isOpen()?"":void 0},get"data-closed"(){return t.isOpen()?void 0:""},onClick:a=>{dt(a,n.onClick),t.toggle()}},r))}var Ds=Object.assign(Mre,{CloseButton:kre,Content:bre,Description:wre,Overlay:xre,Portal:_re,Title:Sre,Trigger:Cre}),Cve=ie("<div data-component=dialog-stack>");const Lre=Tt();function Lve(){const[e,t]=Ce(),n={current:void 0},r={value:!1};me(()=>{n.current!==void 0&&(clearTimeout(n.current),n.current=void 0)});const i=()=>{const o=e();if(!o||r.value)return;r.value=!0,o.onClose?.(),o.setClosing(!0);const s=o.id;n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),n.current=setTimeout(()=>{n.current=void 0,o.dispose(),e()?.id===s&&t(void 0),r.value=!1},100)};return he(()=>{if(!e())return;const o=s=>{s.key==="Escape"&&(i(),s.preventDefault(),s.stopPropagation())};window.addEventListener("keydown",o,!0),me(()=>window.removeEventListener("keydown",o,!0))}),{get active(){return e()},close:i,show:(o,s,l)=>{const c=e();c&&(c.dispose(),t(void 0)),n.current!==void 0&&(clearTimeout(n.current),n.current=void 0),r.value=!1;const u=Math.random().toString(36).slice(2);let h,m;const g=Go(s,()=>wr(y=>{h=y;const[v,k]=Ce(!1);return m=k,d(Ds,{modal:!0,get open(){return!v()},onOpenChange:b=>{b||i()},get children(){return d(Ds.Portal,{get children(){return[d(Ds.Overlay,{"data-component":"dialog-overlay",onClick:i}),bt(()=>o())]}})}})}));!h||!m||t({id:u,node:g,dispose:h,owner:s,onClose:l,setClosing:m})}}}function Ive(e){const t=Lve();return d(Lre.Provider,{value:t,get children(){return[bt(()=>e.children),(()=>{var n=Cve();return K(n,()=>t.active?.node),n})()]}})}function lf(){const e=Lt(Lre),t=qa();if(!t)throw new Error("useDialog must be used within a DialogProvider");if(!e)throw new Error("useDialog must be used within a DialogProvider");return{get active(){return e.active},show(n,r){const i=e.active?.owner??t;e.show(n,i,r)},close(){e.close()}}}const Ire={"ui.sessionReview.title":"Session changes","ui.sessionReview.title.lastTurn":"Last turn changes","ui.sessionReview.diffStyle.unified":"Unified","ui.sessionReview.diffStyle.split":"Split","ui.sessionReview.expandAll":"Expand all","ui.sessionReview.collapseAll":"Collapse all","ui.sessionReview.change.added":"Added","ui.sessionReview.change.removed":"Removed","ui.sessionReview.change.modified":"Modified","ui.sessionReview.image.loading":"Loading...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff too large to render","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} changed lines. Current: {{current}} changed lines.","ui.sessionReview.largeDiff.renderAnyway":"Render anyway","ui.sessionReview.openFile":"Open file","ui.sessionReview.selection.line":"line {{line}}","ui.sessionReview.selection.lines":"lines {{start}}-{{end}}","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Removed {{kind}} file.","ui.fileMedia.state.loading":"Loading {{kind}}...","ui.fileMedia.state.error":"Unable to load {{kind}}.","ui.fileMedia.state.unavailable":"{{kind}} preview unavailable.","ui.fileMedia.binary.title":"Binary file","ui.fileMedia.binary.description.path":"{{path}} is binary.","ui.fileMedia.binary.description.default":"Binary content","ui.lineComment.label.prefix":"Comment on ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commenting on ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Add comment","ui.lineComment.submit":"Comment","ui.sessionTurn.steps.show":"Show steps","ui.sessionTurn.steps.hide":"Hide steps","ui.sessionTurn.summary.response":"Response","ui.sessionTurn.diff.showMore":"Show more changes ({{count}})","ui.sessionTurn.retry.retrying":"retrying","ui.sessionTurn.retry.inSeconds":"in {{seconds}}s","ui.sessionTurn.retry.attempt":"attempt #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - attempt #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini is way too hot right now","ui.sessionTurn.error.freeUsageExceeded":"Free usage exceeded","ui.sessionTurn.error.addCredits":"Add credits","ui.sessionTurn.status.delegating":"Delegating work","ui.sessionTurn.status.planning":"Planning next steps","ui.sessionTurn.status.gatheringContext":"Exploring","ui.sessionTurn.status.gatheredContext":"Explored","ui.sessionTurn.status.searchingCodebase":"Searching the codebase","ui.sessionTurn.status.searchingWeb":"Searching the web","ui.sessionTurn.status.makingEdits":"Making edits","ui.sessionTurn.status.runningCommands":"Running commands","ui.sessionTurn.status.thinking":"Thinking","ui.sessionTurn.status.thinkingWithTopic":"Thinking - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Gathering thoughts","ui.sessionTurn.status.consideringNextSteps":"Considering next steps","ui.messagePart.diagnostic.error":"Error","ui.messagePart.title.edit":"Edit","ui.messagePart.title.write":"Write","ui.messagePart.option.typeOwnAnswer":"Type your own answer","ui.messagePart.review.title":"Review your answers","ui.messagePart.questions.dismissed":"Questions dismissed","ui.messagePart.compaction":"Session compacted","ui.messagePart.context.read.one":"{{count}} read","ui.messagePart.context.read.other":"{{count}} reads","ui.messagePart.context.search.one":"{{count}} search","ui.messagePart.context.search.other":"{{count}} searches","ui.messagePart.context.list.one":"{{count}} list","ui.messagePart.context.list.other":"{{count}} lists","ui.list.loading":"Loading","ui.list.empty":"No results","ui.list.clearFilter":"Clear filter","ui.list.emptyWithFilter.prefix":"No results for","ui.list.emptyWithFilter.suffix":"","ui.fileSearch.placeholder":"Find","ui.fileSearch.previousMatch":"Previous match","ui.fileSearch.nextMatch":"Next match","ui.fileSearch.close":"Close search","ui.messageNav.newMessage":"New message","ui.textField.copyToClipboard":"Copy to clipboard","ui.textField.copyLink":"Copy link","ui.textField.copied":"Copied","ui.imagePreview.alt":"Image preview","ui.scrollView.ariaLabel":"scrollable content","ui.tool.read":"Read","ui.tool.loaded":"Loaded","ui.tool.list":"List","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.task":"Task","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Web Search","ui.tool.codesearch":"Code Search","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"To-dos","ui.tool.todos.read":"Read to-dos","ui.tool.questions":"Questions","ui.tool.agent":"{{type}} Agent","ui.tool.agent.default":"Agent","ui.tool.skill":"Skill","ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":"Failed","ui.toolErrorCard.copyError":"Copy error","ui.common.file.one":"file","ui.common.file.other":"files","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Add","ui.common.back":"Back","ui.common.cancel":"Cancel","ui.common.confirm":"Confirm","ui.common.dismiss":"Dismiss","ui.common.close":"Close","ui.common.next":"Next","ui.common.submit":"Submit","ui.permission.deny":"Deny","ui.permission.allowAlways":"Allow always","ui.permission.allowOnce":"Allow once","ui.message.expand":"Expand message","ui.message.collapse":"Collapse message","ui.message.copy":"Copy","ui.message.copyMessage":"Copy message","ui.message.forkMessage":"Fork to new session","ui.message.revertMessage":"Revert message","ui.message.copyResponse":"Copy response","ui.message.copied":"Copied","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s","ui.message.interrupted":"Interrupted","ui.message.queued":"Queued","ui.message.attachment.alt":"attachment","ui.patch.action.deleted":"Deleted","ui.patch.action.created":"Created","ui.patch.action.moved":"Moved","ui.patch.action.patched":"Patched","ui.question.subtitle.answered":"{{count}} answered","ui.question.answer.none":"(no answer)","ui.question.review.notAnswered":"(not answered)","ui.question.multiHint":"Select all answers that apply","ui.question.singleHint":"Select one answer","ui.question.custom.placeholder":"Type your answer..."};function Nve(e,t){return t?e.replace(/{{\s*([^}]+?)\s*}}/g,(n,r)=>{const i=String(r),a=t[i];return a===void 0?"":String(a)}):e}const Ave={locale:()=>"en",t:(e,t)=>{const n=Ire[e]??String(e);return Nve(n,t)}},Nre=Tt(Ave);function $ve(e){return d(Nre.Provider,{get value(){return e.value},get children(){return e.children}})}function M0(){return Lt(Nre)}function WU(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var S0=WU();function Are(e){S0=e}var Fp={exec:()=>null};function Ut(e,t=""){let n=typeof e=="string"?e:e.source,r={replace:(i,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Jr.caret,"$1"),n=n.replace(i,o),r},getRegex:()=>new RegExp(n,t)};return r}var Tve=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Jr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Eve=/^(?:[ \t]*(?:\n|$))+/,Pve=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Dve=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,K2=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ove=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,GU=/(?:[*+-]|\d{1,9}[.)])/,$re=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Tre=Ut($re).replace(/bull/g,GU).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Rve=Ut($re).replace(/bull/g,GU).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),ZU=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,zve=/^[^\n]+/,KU=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,qve=Ut(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",KU).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),jve=Ut(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,GU).getRegex(),cq="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",XU=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Hve=Ut("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",XU).replace("tag",cq).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ere=Ut(ZU).replace("hr",K2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cq).getRegex(),Fve=Ut(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ere).getRegex(),YU={blockquote:Fve,code:Pve,def:qve,fences:Dve,heading:Ove,hr:K2,html:Hve,lheading:Tre,list:jve,newline:Eve,paragraph:Ere,table:Fp,text:zve},OX=Ut("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",K2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cq).getRegex(),Vve={...YU,lheading:Rve,table:OX,paragraph:Ut(ZU).replace("hr",K2).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",OX).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cq).getRegex()},Bve={...YU,html:Ut(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",XU).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Fp,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ut(ZU).replace("hr",K2).replace("heading",` *#{1,6} *[^
|
|
3
3
|
]`).replace("lheading",Tre).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Uve=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Wve=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Pre=/^( {2,}|\\)\n(?!\s*$)/,Gve=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,dq=/[\p{P}\p{S}]/u,JU=/[\s\p{P}\p{S}]/u,Dre=/[^\s\p{P}\p{S}]/u,Zve=Ut(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,JU).getRegex(),Ore=/(?!~)[\p{P}\p{S}]/u,Kve=/(?!~)[\s\p{P}\p{S}]/u,Xve=/(?:[^\s\p{P}\p{S}]|~)/u,Yve=Ut(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Tve?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Rre=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Jve=Ut(Rre,"u").replace(/punct/g,dq).getRegex(),Qve=Ut(Rre,"u").replace(/punct/g,Ore).getRegex(),zre="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",e4e=Ut(zre,"gu").replace(/notPunctSpace/g,Dre).replace(/punctSpace/g,JU).replace(/punct/g,dq).getRegex(),t4e=Ut(zre,"gu").replace(/notPunctSpace/g,Xve).replace(/punctSpace/g,Kve).replace(/punct/g,Ore).getRegex(),n4e=Ut("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Dre).replace(/punctSpace/g,JU).replace(/punct/g,dq).getRegex(),r4e=Ut(/\\(punct)/,"gu").replace(/punct/g,dq).getRegex(),i4e=Ut(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),a4e=Ut(XU).replace("(?:-->|$)","-->").getRegex(),o4e=Ut("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",a4e).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),RR=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,s4e=Ut(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",RR).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),qre=Ut(/^!?\[(label)\]\[(ref)\]/).replace("label",RR).replace("ref",KU).getRegex(),jre=Ut(/^!?\[(ref)\](?:\[\])?/).replace("ref",KU).getRegex(),l4e=Ut("reflink|nolink(?!\\()","g").replace("reflink",qre).replace("nolink",jre).getRegex(),RX=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,QU={_backpedal:Fp,anyPunctuation:r4e,autolink:i4e,blockSkip:Yve,br:Pre,code:Wve,del:Fp,emStrongLDelim:Jve,emStrongRDelimAst:e4e,emStrongRDelimUnd:n4e,escape:Uve,link:s4e,nolink:jre,punctuation:Zve,reflink:qre,reflinkSearch:l4e,tag:o4e,text:Gve,url:Fp},c4e={...QU,link:Ut(/^!?\[(label)\]\((.*?)\)/).replace("label",RR).getRegex(),reflink:Ut(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",RR).getRegex()},gV={...QU,emStrongRDelimAst:t4e,emStrongLDelim:Qve,url:Ut(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",RX).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Ut(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",RX).getRegex()},d4e={...gV,br:Ut(Pre).replace("{2,}","*").getRegex(),text:Ut(gV.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Um={normal:YU,gfm:Vve,pedantic:Bve},Qf={normal:QU,gfm:gV,breaks:d4e,pedantic:c4e},u4e={"&":"&","<":"<",">":">",'"':""","'":"'"},zX=e=>u4e[e];function Fo(e,t){if(t){if(Jr.escapeTest.test(e))return e.replace(Jr.escapeReplace,zX)}else if(Jr.escapeTestNoEncode.test(e))return e.replace(Jr.escapeReplaceNoEncode,zX);return e}function qX(e){try{e=encodeURI(e).replace(Jr.percentDecode,"%")}catch{return null}return e}function jX(e,t){let n=e.replace(Jr.findPipe,(a,o,s)=>{let l=!1,c=o;for(;--c>=0&&s[c]==="\\";)l=!l;return l?"|":" |"}),r=n.split(Jr.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Jr.slashPipe,"|");return r}function ep(e,t,n){let r=e.length;if(r===0)return"";let i=0;for(;i<r&&e.charAt(r-i-1)===t;)i++;return e.slice(0,r-i)}function h4e(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function HX(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,l}function f4e(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
4
4
|
`).map(a=>{let o=a.match(n.other.beginningSpace);if(o===null)return a;let[s]=o;return s.length>=i.length?a.slice(i.length):a}).join(`
|
|
5
5
|
`)}var zR=class{options;rules;lexer;constructor(t){this.options=t||S0}space(t){let n=this.rules.block.newline.exec(t);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(t){let n=this.rules.block.code.exec(t);if(n){let r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:ep(r,`
|
|
@@ -317,7 +317,7 @@ l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
|
317
317
|
|[ \r ]+
|
|
318
318
|
?)[ \r ]*`,LV="[̀-ͯ]",r5e=new RegExp(LV+"+$"),i5e="("+$ie+"+)|"+(n5e+"|")+"([!-\\[\\]-‧-豈-]"+(LV+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(LV+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+t5e)+("|"+e5e+")");let yY=class{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(i5e,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new Ri("EOF",new gi(this,n,n));var r=this.tokenRegex.exec(t);if(r===null||r.index!==n)throw new Ie("Unexpected character: '"+t[n]+"'",new Ri(t[n],new gi(this,n,n+1)));var i=r[6]||r[3]||(r[2]?"\\ ":" ");if(this.catcodes[i]===14){var a=t.indexOf(`
|
|
319
319
|
`,this.tokenRegex.lastIndex);return a===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=a+1,this.lex()}return new Ri(i,new gi(this,n,this.tokenRegex.lastIndex))}};class a5e{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Ie("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,r){if(r===void 0&&(r=!1),r){for(var i=0;i<this.undefStack.length;i++)delete this.undefStack[i][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var a=this.undefStack[this.undefStack.length-1];a&&!a.hasOwnProperty(t)&&(a[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var o5e=bie;U("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});U("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});U("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});U("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});U("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});U("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");U("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var vY={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};U("\\char",function(e){var t=e.popToken(),n,r="";if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")r=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Ie("\\char` missing argument");r=t.text.charCodeAt(0)}else n=10;if(n){if(r=vY[t.text],r==null||r>=n)throw new Ie("Invalid base-"+n+" digit "+t.text);for(var i;(i=vY[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return"\\@char{"+r+"}"});var yW=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new Ie("\\newcommand's first argument must be a macro name");var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new Ie("\\newcommand{"+a+"} attempting to redefine "+(a+"; use \\renewcommand"));if(!o&&!n)throw new Ie("\\renewcommand{"+a+"} when command "+a+" does not yet exist; use \\newcommand");var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text==="["){for(var l="",c=e.expandNextToken();c.text!=="]"&&c.text!=="EOF";)l+=c.text,c=e.expandNextToken();if(!l.match(/^\s*[0-9]+\s*$/))throw new Ie("Invalid number of arguments: "+l);s=parseInt(l),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),""};U("\\newcommand",e=>yW(e,!1,!0,!1));U("\\renewcommand",e=>yW(e,!0,!1,!1));U("\\providecommand",e=>yW(e,!0,!0,!0));U("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});U("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});U("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Os[n],un.math[n],un.text[n]),""});U("\\bgroup","{");U("\\egroup","}");U("~","\\nobreakspace");U("\\lq","`");U("\\rq","'");U("\\aa","\\r a");U("\\AA","\\r A");U("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");U("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");U("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");U("ℬ","\\mathscr{B}");U("ℰ","\\mathscr{E}");U("ℱ","\\mathscr{F}");U("ℋ","\\mathscr{H}");U("ℐ","\\mathscr{I}");U("ℒ","\\mathscr{L}");U("ℳ","\\mathscr{M}");U("ℛ","\\mathscr{R}");U("ℭ","\\mathfrak{C}");U("ℌ","\\mathfrak{H}");U("ℨ","\\mathfrak{Z}");U("\\Bbbk","\\Bbb{k}");U("·","\\cdotp");U("\\llap","\\mathllap{\\textrm{#1}}");U("\\rlap","\\mathrlap{\\textrm{#1}}");U("\\clap","\\mathclap{\\textrm{#1}}");U("\\mathstrut","\\vphantom{(}");U("\\underbar","\\underline{\\text{#1}}");U("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');U("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");U("\\ne","\\neq");U("≠","\\neq");U("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");U("∉","\\notin");U("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");U("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");U("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");U("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");U("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");U("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");U("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");U("⟂","\\perp");U("‼","\\mathclose{!\\mkern-0.8mu!}");U("∌","\\notni");U("⌜","\\ulcorner");U("⌝","\\urcorner");U("⌞","\\llcorner");U("⌟","\\lrcorner");U("©","\\copyright");U("®","\\textregistered");U("️","\\textregistered");U("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');U("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');U("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');U("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');U("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");U("⋮","\\vdots");U("\\varGamma","\\mathit{\\Gamma}");U("\\varDelta","\\mathit{\\Delta}");U("\\varTheta","\\mathit{\\Theta}");U("\\varLambda","\\mathit{\\Lambda}");U("\\varXi","\\mathit{\\Xi}");U("\\varPi","\\mathit{\\Pi}");U("\\varSigma","\\mathit{\\Sigma}");U("\\varUpsilon","\\mathit{\\Upsilon}");U("\\varPhi","\\mathit{\\Phi}");U("\\varPsi","\\mathit{\\Psi}");U("\\varOmega","\\mathit{\\Omega}");U("\\substack","\\begin{subarray}{c}#1\\end{subarray}");U("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");U("\\boxed","\\fbox{$\\displaystyle{#1}$}");U("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");U("\\implies","\\DOTSB\\;\\Longrightarrow\\;");U("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");U("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");U("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var kY={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};U("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in kY?t=kY[n]:(n.slice(0,4)==="\\not"||n in un.math&&["bin","rel"].includes(un.math[n].group))&&(t="\\dotsb"),t});var vW={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};U("\\dotso",function(e){var t=e.future().text;return t in vW?"\\ldots\\,":"\\ldots"});U("\\dotsc",function(e){var t=e.future().text;return t in vW&&t!==","?"\\ldots\\,":"\\ldots"});U("\\cdots",function(e){var t=e.future().text;return t in vW?"\\@cdots\\,":"\\@cdots"});U("\\dotsb","\\cdots");U("\\dotsm","\\cdots");U("\\dotsi","\\!\\cdots");U("\\dotsx","\\ldots\\,");U("\\DOTSI","\\relax");U("\\DOTSB","\\relax");U("\\DOTSX","\\relax");U("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");U("\\,","\\tmspace+{3mu}{.1667em}");U("\\thinspace","\\,");U("\\>","\\mskip{4mu}");U("\\:","\\tmspace+{4mu}{.2222em}");U("\\medspace","\\:");U("\\;","\\tmspace+{5mu}{.2777em}");U("\\thickspace","\\;");U("\\!","\\tmspace-{3mu}{.1667em}");U("\\negthinspace","\\!");U("\\negmedspace","\\tmspace-{4mu}{.2222em}");U("\\negthickspace","\\tmspace-{5mu}{.277em}");U("\\enspace","\\kern.5em ");U("\\enskip","\\hskip.5em\\relax");U("\\quad","\\hskip1em\\relax");U("\\qquad","\\hskip2em\\relax");U("\\tag","\\@ifstar\\tag@literal\\tag@paren");U("\\tag@paren","\\tag@literal{({#1})}");U("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Ie("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});U("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");U("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");U("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");U("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");U("\\newline","\\\\\\relax");U("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var Tie=Te(po["Main-Regular"][84][1]-.7*po["Main-Regular"][65][1]);U("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+Tie+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");U("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+Tie+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");U("\\hspace","\\@ifstar\\@hspacer\\@hspace");U("\\@hspace","\\hskip #1\\relax");U("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");U("\\ordinarycolon",":");U("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");U("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');U("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');U("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');U("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');U("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');U("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');U("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');U("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');U("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');U("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');U("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');U("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');U("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');U("∷","\\dblcolon");U("∹","\\eqcolon");U("≔","\\coloneqq");U("≕","\\eqqcolon");U("⩴","\\Coloneqq");U("\\ratio","\\vcentcolon");U("\\coloncolon","\\dblcolon");U("\\colonequals","\\coloneqq");U("\\coloncolonequals","\\Coloneqq");U("\\equalscolon","\\eqqcolon");U("\\equalscoloncolon","\\Eqqcolon");U("\\colonminus","\\coloneq");U("\\coloncolonminus","\\Coloneq");U("\\minuscolon","\\eqcolon");U("\\minuscoloncolon","\\Eqcolon");U("\\coloncolonapprox","\\Colonapprox");U("\\coloncolonsim","\\Colonsim");U("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");U("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");U("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");U("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");U("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");U("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");U("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");U("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");U("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");U("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");U("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");U("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");U("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");U("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");U("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");U("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");U("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");U("\\nleqq","\\html@mathml{\\@nleqq}{≰}");U("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");U("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");U("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");U("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");U("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");U("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");U("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");U("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");U("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");U("\\imath","\\html@mathml{\\@imath}{ı}");U("\\jmath","\\html@mathml{\\@jmath}{ȷ}");U("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");U("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");U("⟦","\\llbracket");U("⟧","\\rrbracket");U("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");U("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");U("⦃","\\lBrace");U("⦄","\\rBrace");U("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");U("⦵","\\minuso");U("\\darr","\\downarrow");U("\\dArr","\\Downarrow");U("\\Darr","\\Downarrow");U("\\lang","\\langle");U("\\rang","\\rangle");U("\\uarr","\\uparrow");U("\\uArr","\\Uparrow");U("\\Uarr","\\Uparrow");U("\\N","\\mathbb{N}");U("\\R","\\mathbb{R}");U("\\Z","\\mathbb{Z}");U("\\alef","\\aleph");U("\\alefsym","\\aleph");U("\\Alpha","\\mathrm{A}");U("\\Beta","\\mathrm{B}");U("\\bull","\\bullet");U("\\Chi","\\mathrm{X}");U("\\clubs","\\clubsuit");U("\\cnums","\\mathbb{C}");U("\\Complex","\\mathbb{C}");U("\\Dagger","\\ddagger");U("\\diamonds","\\diamondsuit");U("\\empty","\\emptyset");U("\\Epsilon","\\mathrm{E}");U("\\Eta","\\mathrm{H}");U("\\exist","\\exists");U("\\harr","\\leftrightarrow");U("\\hArr","\\Leftrightarrow");U("\\Harr","\\Leftrightarrow");U("\\hearts","\\heartsuit");U("\\image","\\Im");U("\\infin","\\infty");U("\\Iota","\\mathrm{I}");U("\\isin","\\in");U("\\Kappa","\\mathrm{K}");U("\\larr","\\leftarrow");U("\\lArr","\\Leftarrow");U("\\Larr","\\Leftarrow");U("\\lrarr","\\leftrightarrow");U("\\lrArr","\\Leftrightarrow");U("\\Lrarr","\\Leftrightarrow");U("\\Mu","\\mathrm{M}");U("\\natnums","\\mathbb{N}");U("\\Nu","\\mathrm{N}");U("\\Omicron","\\mathrm{O}");U("\\plusmn","\\pm");U("\\rarr","\\rightarrow");U("\\rArr","\\Rightarrow");U("\\Rarr","\\Rightarrow");U("\\real","\\Re");U("\\reals","\\mathbb{R}");U("\\Reals","\\mathbb{R}");U("\\Rho","\\mathrm{P}");U("\\sdot","\\cdot");U("\\sect","\\S");U("\\spades","\\spadesuit");U("\\sub","\\subset");U("\\sube","\\subseteq");U("\\supe","\\supseteq");U("\\Tau","\\mathrm{T}");U("\\thetasym","\\vartheta");U("\\weierp","\\wp");U("\\Zeta","\\mathrm{Z}");U("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");U("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");U("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");U("\\bra","\\mathinner{\\langle{#1}|}");U("\\ket","\\mathinner{|{#1}\\rangle}");U("\\braket","\\mathinner{\\langle{#1}\\rangle}");U("\\Bra","\\left\\langle#1\\right|");U("\\Ket","\\left|#1\\right\\rangle");var Eie=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=h=>m=>{e&&(m.macros.set("|",o),i.length&&m.macros.set("\\|",s));var g=h;if(!h&&i.length){var y=m.future();y.text==="|"&&(m.popToken(),g=!0)}return{tokens:g?i:r,numArgs:0}};t.macros.set("|",l(!1)),i.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...a,...c,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};U("\\bra@ket",Eie(!1));U("\\bra@set",Eie(!0));U("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");U("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");U("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");U("\\angln","{\\angl n}");U("\\blue","\\textcolor{##6495ed}{#1}");U("\\orange","\\textcolor{##ffa500}{#1}");U("\\pink","\\textcolor{##ff00af}{#1}");U("\\red","\\textcolor{##df0030}{#1}");U("\\green","\\textcolor{##28ae7b}{#1}");U("\\gray","\\textcolor{gray}{#1}");U("\\purple","\\textcolor{##9d38bd}{#1}");U("\\blueA","\\textcolor{##ccfaff}{#1}");U("\\blueB","\\textcolor{##80f6ff}{#1}");U("\\blueC","\\textcolor{##63d9ea}{#1}");U("\\blueD","\\textcolor{##11accd}{#1}");U("\\blueE","\\textcolor{##0c7f99}{#1}");U("\\tealA","\\textcolor{##94fff5}{#1}");U("\\tealB","\\textcolor{##26edd5}{#1}");U("\\tealC","\\textcolor{##01d1c1}{#1}");U("\\tealD","\\textcolor{##01a995}{#1}");U("\\tealE","\\textcolor{##208170}{#1}");U("\\greenA","\\textcolor{##b6ffb0}{#1}");U("\\greenB","\\textcolor{##8af281}{#1}");U("\\greenC","\\textcolor{##74cf70}{#1}");U("\\greenD","\\textcolor{##1fab54}{#1}");U("\\greenE","\\textcolor{##0d923f}{#1}");U("\\goldA","\\textcolor{##ffd0a9}{#1}");U("\\goldB","\\textcolor{##ffbb71}{#1}");U("\\goldC","\\textcolor{##ff9c39}{#1}");U("\\goldD","\\textcolor{##e07d10}{#1}");U("\\goldE","\\textcolor{##a75a05}{#1}");U("\\redA","\\textcolor{##fca9a9}{#1}");U("\\redB","\\textcolor{##ff8482}{#1}");U("\\redC","\\textcolor{##f9685d}{#1}");U("\\redD","\\textcolor{##e84d39}{#1}");U("\\redE","\\textcolor{##bc2612}{#1}");U("\\maroonA","\\textcolor{##ffbde0}{#1}");U("\\maroonB","\\textcolor{##ff92c6}{#1}");U("\\maroonC","\\textcolor{##ed5fa6}{#1}");U("\\maroonD","\\textcolor{##ca337c}{#1}");U("\\maroonE","\\textcolor{##9e034e}{#1}");U("\\purpleA","\\textcolor{##ddd7ff}{#1}");U("\\purpleB","\\textcolor{##c6b9fc}{#1}");U("\\purpleC","\\textcolor{##aa87ff}{#1}");U("\\purpleD","\\textcolor{##7854ab}{#1}");U("\\purpleE","\\textcolor{##543b78}{#1}");U("\\mintA","\\textcolor{##f5f9e8}{#1}");U("\\mintB","\\textcolor{##edf2df}{#1}");U("\\mintC","\\textcolor{##e0e5cc}{#1}");U("\\grayA","\\textcolor{##f6f7f7}{#1}");U("\\grayB","\\textcolor{##f0f1f2}{#1}");U("\\grayC","\\textcolor{##e3e5e6}{#1}");U("\\grayD","\\textcolor{##d6d8da}{#1}");U("\\grayE","\\textcolor{##babec2}{#1}");U("\\grayF","\\textcolor{##888d93}{#1}");U("\\grayG","\\textcolor{##626569}{#1}");U("\\grayH","\\textcolor{##3b3e40}{#1}");U("\\grayI","\\textcolor{##21242c}{#1}");U("\\kaBlue","\\textcolor{##314453}{#1}");U("\\kaGreen","\\textcolor{##71B307}{#1}");var Pie={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class s5e{constructor(t,n,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new a5e(o5e,n.macros),this.mode=r,this.stack=[]}feed(t){this.lexer=new yY(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,r,i;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:i,end:r}=this.consumeArg(["]"])}else({tokens:i,start:n,end:r}=this.consumeArg());return this.pushToken(new Ri("EOF",r.loc)),this.pushTokens(i),new Ri("",gi.range(n,r))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],r=t&&t.length>0;r||this.consumeSpaces();var i=this.future(),a,o=0,s=0;do{if(a=this.popToken(),n.push(a),a.text==="{")++o;else if(a.text==="}"){if(--o,o===-1)throw new Ie("Extra }",a)}else if(a.text==="EOF")throw new Ie("Unexpected end of input in a macro argument, expected '"+(t&&r?t[s]:"}")+"'",a);if(t&&r)if((o===0||o===1&&t[s]==="{")&&a.text===t[s]){if(++s,s===t.length){n.splice(-s,s);break}}else s=0}while(o!==0||r);return i.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:i,end:a}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Ie("The length of delimiters doesn't match the number of args!");for(var r=n[0],i=0;i<r.length;i++){var a=this.popToken();if(r[i]!==a.text)throw new Ie("Use of the macro doesn't match its definition",a)}}for(var o=[],s=0;s<t;s++)o.push(this.consumeArg(n&&n[s+1]).tokens);return o}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new Ie("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),r=n.text,i=n.noexpand?null:this._getExpansion(r);if(i==null||t&&i.unexpandable){if(t&&i==null&&r[0]==="\\"&&!this.isDefined(r))throw new Ie("Undefined control sequence: "+r);return this.pushToken(n),!1}this.countExpansion(1);var a=i.tokens,o=this.consumeArgs(i.numArgs,i.delimiters);if(i.numArgs){a=a.slice();for(var s=a.length-1;s>=0;--s){var l=a[s];if(l.text==="#"){if(s===0)throw new Ie("Incomplete placeholder at end of macro body",l);if(l=a[--s],l.text==="#")a.splice(s+1,1);else if(/^[1-9]$/.test(l.text))a.splice(s,2,...o[+l.text-1]);else throw new Ie("Not a valid argument number",l)}}}return this.pushTokens(a),a.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}throw new Error}expandMacro(t){return this.macros.has(t)?this.expandTokens([new Ri(t)]):void 0}expandTokens(t){var n=[],r=this.stack.length;for(this.pushTokens(t);this.stack.length>r;)if(this.expandOnce(!0)===!1){var i=this.stack.pop();i.treatAsRelax&&(i.noexpand=!1,i.treatAsRelax=!1),n.push(i)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(r=>r.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var r=this.lexer.catcodes[t];if(r!=null&&r!==13)return}var i=typeof n=="function"?n(this):n;if(typeof i=="string"){var a=0;if(i.indexOf("#")!==-1)for(var o=i.replace(/##/g,"");o.indexOf("#"+(a+1))!==-1;)++a;for(var s=new yY(i,this.settings),l=[],c=s.lex();c.text!=="EOF";)l.push(c),c=s.lex();l.reverse();var u={tokens:l,numArgs:a};return u}return i}isDefined(t){return this.macros.has(t)||Os.hasOwnProperty(t)||un.math.hasOwnProperty(t)||un.text.hasOwnProperty(t)||Pie.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Os.hasOwnProperty(t)&&!Os[t].primitive}}var bY=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,eg=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),kH={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},wY={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};let Die=class Oie{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new s5e(t,n,this.mode),this.settings=n,this.leftrightDepth=0}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Ie("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new Ri("}")),this.gullet.pushTokens(t);var r=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,r}parseExpression(t,n){for(var r=[];;){this.mode==="math"&&this.consumeSpaces();var i=this.fetch();if(Oie.endOfExpression.indexOf(i.text)!==-1||n&&i.text===n||t&&Os[i.text]&&Os[i.text].infix)break;var a=this.parseAtom(n);if(a){if(a.type==="internal")continue}else break;r.push(a)}return this.mode==="text"&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(t){for(var n=-1,r,i=0;i<t.length;i++)if(t[i].type==="infix"){if(n!==-1)throw new Ie("only one infix operator per group",t[i].token);n=i,r=t[i].replaceWith}if(n!==-1&&r){var a,o,s=t.slice(0,n),l=t.slice(n+1);s.length===1&&s[0].type==="ordgroup"?a=s[0]:a={type:"ordgroup",mode:this.mode,body:s},l.length===1&&l[0].type==="ordgroup"?o=l[0]:o={type:"ordgroup",mode:this.mode,body:l};var c;return r==="\\\\abovefrac"?c=this.callFunction(r,[a,t[n],o],[]):c=this.callFunction(r,[a,o],[]),[c]}else return t}handleSupSubscript(t){var n=this.fetch(),r=n.text;this.consume(),this.consumeSpaces();var i;do{var a;i=this.parseGroup(t)}while(((a=i)==null?void 0:a.type)==="internal");if(!i)throw new Ie("Expected group after '"+r+"'",n);return i}formatUnsupportedCmd(t){for(var n=[],r=0;r<t.length;r++)n.push({type:"textord",mode:"text",text:t[r]});var i={type:"text",mode:this.mode,body:n},a={type:"color",mode:this.mode,color:this.settings.errorColor,body:[i]};return a}parseAtom(t){var n=this.parseGroup("atom",t);if(n?.type==="internal"||this.mode==="text")return n;for(var r,i;;){this.consumeSpaces();var a=this.fetch();if(a.text==="\\limits"||a.text==="\\nolimits"){if(n&&n.type==="op"){var o=a.text==="\\limits";n.limits=o,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=a.text==="\\limits");else throw new Ie("Limit controls must follow a math operator",a);this.consume()}else if(a.text==="^"){if(r)throw new Ie("Double superscript",a);r=this.handleSupSubscript("superscript")}else if(a.text==="_"){if(i)throw new Ie("Double subscript",a);i=this.handleSupSubscript("subscript")}else if(a.text==="'"){if(r)throw new Ie("Double superscript",a);var s={type:"textord",mode:this.mode,text:"\\prime"},l=[s];for(this.consume();this.fetch().text==="'";)l.push(s),this.consume();this.fetch().text==="^"&&l.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:l}}else if(eg[a.text]){var c=bY.test(a.text),u=[];for(u.push(new Ri(eg[a.text])),this.consume();;){var h=this.fetch().text;if(!eg[h]||bY.test(h)!==c)break;u.unshift(new Ri(eg[h])),this.consume()}var m=this.subparse(u);c?i={type:"ordgroup",mode:"math",body:m}:r={type:"ordgroup",mode:"math",body:m}}else break}return r||i?{type:"supsub",mode:this.mode,base:n,sup:r,sub:i}:n}parseFunction(t,n){var r=this.fetch(),i=r.text,a=Os[i];if(!a)return null;if(this.consume(),n&&n!=="atom"&&!a.allowedInArgument)throw new Ie("Got function '"+i+"' with no arguments"+(n?" as "+n:""),r);if(this.mode==="text"&&!a.allowedInText)throw new Ie("Can't use function '"+i+"' in text mode",r);if(this.mode==="math"&&a.allowedInMath===!1)throw new Ie("Can't use function '"+i+"' in math mode",r);var{args:o,optArgs:s}=this.parseArguments(i,a);return this.callFunction(i,o,s,r,t)}callFunction(t,n,r,i,a){var o={funcName:t,parser:this,token:i,breakOnTokenText:a},s=Os[t];if(s&&s.handler)return s.handler(o,n,r);throw new Ie("No function handler for "+t)}parseArguments(t,n){var r=n.numArgs+n.numOptionalArgs;if(r===0)return{args:[],optArgs:[]};for(var i=[],a=[],o=0;o<r;o++){var s=n.argTypes&&n.argTypes[o],l=o<n.numOptionalArgs;(n.primitive&&s==null||n.type==="sqrt"&&o===1&&a[0]==null)&&(s="primitive");var c=this.parseGroupOfType("argument to '"+t+"'",s,l);if(l)a.push(c);else if(c!=null)i.push(c);else throw new Ie("Null argument, please report this as a bug")}return{args:i,optArgs:a}}parseGroupOfType(t,n,r){switch(n){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,n);case"hbox":{var i=this.parseArgumentGroup(r,"text");return i!=null?{type:"styling",mode:i.mode,body:[i],style:"text"}:null}case"raw":{var a=this.parseStringGroup("raw",r);return a!=null?{type:"raw",mode:"text",string:a.text}:null}case"primitive":{if(r)throw new Ie("A primitive argument cannot be optional");var o=this.parseGroup(t);if(o==null)throw new Ie("Expected group as "+t,this.fetch());return o}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new Ie("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,n){var r=this.gullet.scanArgument(n);if(r==null)return null;for(var i="",a;(a=this.fetch()).text!=="EOF";)i+=a.text,this.consume();return this.consume(),r.text=i,r}parseRegexGroup(t,n){for(var r=this.fetch(),i=r,a="",o;(o=this.fetch()).text!=="EOF"&&t.test(a+o.text);)i=o,a+=i.text,this.consume();if(a==="")throw new Ie("Invalid "+n+": '"+r.text+"'",r);return r.range(i,a)}parseColorGroup(t){var n=this.parseStringGroup("color",t);if(n==null)return null;var r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!r)throw new Ie("Invalid color: '"+n.text+"'",n);var i=r[0];return/^[0-9a-f]{6}$/i.test(i)&&(i="#"+i),{type:"color-token",mode:this.mode,color:i}}parseSizeGroup(t){var n,r=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",r=!0);var i=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!i)throw new Ie("Invalid size: '"+n.text+"'",n);var a={number:+(i[1]+i[2]),unit:i[3]};if(!Bre(a))throw new Ie("Invalid unit: '"+a.unit+"'",n);return{type:"size",mode:this.mode,value:a,isBlank:r}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var r=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(t,n){var r=this.gullet.scanArgument(t);if(r==null)return null;var i=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var a=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var o={type:"ordgroup",mode:this.mode,loc:r.loc,body:a};return n&&this.switchMode(i),o}parseGroup(t,n){var r=this.fetch(),i=r.text,a;if(i==="{"||i==="\\begingroup"){this.consume();var o=i==="{"?"}":"\\endgroup";this.gullet.beginGroup();var s=this.parseExpression(!1,o),l=this.fetch();this.expect(o),this.gullet.endGroup(),a={type:"ordgroup",mode:this.mode,loc:gi.range(r,l),body:s,semisimple:i==="\\begingroup"||void 0}}else if(a=this.parseFunction(n,t)||this.parseSymbol(),a==null&&i[0]==="\\"&&!Pie.hasOwnProperty(i)){if(this.settings.throwOnError)throw new Ie("Undefined control sequence: "+i,r);a=this.formatUnsupportedCmd(i),this.consume()}return a}formLigatures(t){for(var n=t.length-1,r=0;r<n;++r){var i=t[r],a=i.text;a==="-"&&t[r+1].text==="-"&&(r+1<n&&t[r+2].text==="-"?(t.splice(r,3,{type:"textord",mode:"text",loc:gi.range(i,t[r+2]),text:"---"}),n-=2):(t.splice(r,2,{type:"textord",mode:"text",loc:gi.range(i,t[r+1]),text:"--"}),n-=1)),(a==="'"||a==="`")&&t[r+1].text===a&&(t.splice(r,2,{type:"textord",mode:"text",loc:gi.range(i,t[r+1]),text:a+a}),n-=1)}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var r=n.slice(5),i=r.charAt(0)==="*";if(i&&(r=r.slice(1)),r.length<2||r.charAt(0)!==r.slice(-1))throw new Ie(`\\verb assertion failed --
|
|
320
|
-
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:i}}wY.hasOwnProperty(n[0])&&!un[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=wY[n[0]]+n.slice(1));var a=r5e.exec(n);a&&(n=n.substring(0,a.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var o;if(un[this.mode][n]){this.settings.strict&&this.mode==="math"&&xV.indexOf(n)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var s=un[this.mode][n].group,l=gi.range(t),c;if(K4e.hasOwnProperty(s)){var u=s;c={type:"atom",mode:this.mode,family:u,loc:l,text:n}}else c={type:s,mode:this.mode,loc:l,text:n};o=c}else if(n.charCodeAt(0)>=128)this.settings.strict&&(Fre(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),o={type:"textord",mode:"text",loc:gi.range(t),text:n};else return null;if(this.consume(),a)for(var h=0;h<a[0].length;h++){var m=a[0][h];if(!kH[m])throw new Ie("Unknown accent ' "+m+"'",t);var g=kH[m][this.mode]||kH[m].text;if(!g)throw new Ie("Accent "+m+" unsupported in "+this.mode+" mode",t);o={type:"accent",mode:this.mode,loc:gi.range(t),label:g,isStretchy:!1,isShifty:!0,base:o}}return o}};Die.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var kW=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new Die(t,n);delete r.gullet.macros.current["\\df@tag"];var i=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Ie("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:r.subparse([new Ri("\\df@tag")])}]}return i},bW=function(t,n,r){n.textContent="";var i=yq(t,r).toNode();n.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),bW=function(){throw new Ie("KaTeX doesn't work in quirks mode.")});var Rie=function(t,n){var r=yq(t,n).toMarkup();return r},zie=function(t,n){var r=new tW(n);return kW(t,r)},qie=function(t,n,r){if(r.throwOnError||!(t instanceof Ie))throw t;var i=se.makeSpan(["katex-error"],[new oa(n)]);return i.setAttribute("title",t.toString()),i.setAttribute("style","color:"+r.errorColor),i},yq=function(t,n){var r=new tW(n);try{var i=kW(t,r);return vke(i,t,r)}catch(a){return qie(a,t,r)}},jie=function(t,n){var r=new tW(n);try{var i=kW(t,r);return kke(i,t,r)}catch(a){return qie(a,t,r)}},Hie="0.16.27",Fie={Span:Y2,Anchor:iW,SymbolNode:oa,SvgNode:is,PathNode:Zs,LineNode:wV},UR={version:Hie,render:bW,renderToString:Rie,ParseError:Ie,SETTINGS_SCHEMA:Vp,__parse:zie,__renderToDomTree:yq,__renderToHTMLTree:jie,__setFontMetrics:Vre,__defineSymbol:N,__defineFunction:qe,__defineMacro:U,__domTree:Fie};const
|
|
320
|
+
please report what input caused this bug`);return r=r.slice(1,-1),{type:"verb",mode:"text",body:r,star:i}}wY.hasOwnProperty(n[0])&&!un[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=wY[n[0]]+n.slice(1));var a=r5e.exec(n);a&&(n=n.substring(0,a.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var o;if(un[this.mode][n]){this.settings.strict&&this.mode==="math"&&xV.indexOf(n)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var s=un[this.mode][n].group,l=gi.range(t),c;if(K4e.hasOwnProperty(s)){var u=s;c={type:"atom",mode:this.mode,family:u,loc:l,text:n}}else c={type:s,mode:this.mode,loc:l,text:n};o=c}else if(n.charCodeAt(0)>=128)this.settings.strict&&(Fre(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),o={type:"textord",mode:"text",loc:gi.range(t),text:n};else return null;if(this.consume(),a)for(var h=0;h<a[0].length;h++){var m=a[0][h];if(!kH[m])throw new Ie("Unknown accent ' "+m+"'",t);var g=kH[m][this.mode]||kH[m].text;if(!g)throw new Ie("Accent "+m+" unsupported in "+this.mode+" mode",t);o={type:"accent",mode:this.mode,loc:gi.range(t),label:g,isStretchy:!1,isShifty:!0,base:o}}return o}};Die.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var kW=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var r=new Die(t,n);delete r.gullet.macros.current["\\df@tag"];var i=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Ie("\\tag works only in display equations");i=[{type:"tag",mode:"text",body:i,tag:r.subparse([new Ri("\\df@tag")])}]}return i},bW=function(t,n,r){n.textContent="";var i=yq(t,r).toNode();n.appendChild(i)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),bW=function(){throw new Ie("KaTeX doesn't work in quirks mode.")});var Rie=function(t,n){var r=yq(t,n).toMarkup();return r},zie=function(t,n){var r=new tW(n);return kW(t,r)},qie=function(t,n,r){if(r.throwOnError||!(t instanceof Ie))throw t;var i=se.makeSpan(["katex-error"],[new oa(n)]);return i.setAttribute("title",t.toString()),i.setAttribute("style","color:"+r.errorColor),i},yq=function(t,n){var r=new tW(n);try{var i=kW(t,r);return vke(i,t,r)}catch(a){return qie(a,t,r)}},jie=function(t,n){var r=new tW(n);try{var i=kW(t,r);return kke(i,t,r)}catch(a){return qie(a,t,r)}},Hie="0.16.27",Fie={Span:Y2,Anchor:iW,SymbolNode:oa,SvgNode:is,PathNode:Zs,LineNode:wV},UR={version:Hie,render:bW,renderToString:Rie,ParseError:Ie,SETTINGS_SCHEMA:Vp,__parse:zie,__renderToDomTree:yq,__renderToHTMLTree:jie,__setFontMetrics:Vre,__defineSymbol:N,__defineFunction:qe,__defineMacro:U,__domTree:Fie};const DJt=Object.freeze(Object.defineProperty({__proto__:null,ParseError:Ie,SETTINGS_SCHEMA:Vp,__defineFunction:qe,__defineMacro:U,__defineSymbol:N,__domTree:Fie,__parse:zie,__renderToDomTree:yq,__renderToHTMLTree:jie,__setFontMetrics:Vre,default:UR,get render(){return bW},renderToString:Rie,version:Hie},Symbol.toStringTag,{value:"Module"})),l5e=/^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\1(?=[\s?!\.,:?!。,:]|$)/,c5e=/^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n\$]))\1/,d5e=/^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;function u5e(e={}){return{extensions:[h5e(e,xY(e,!1)),f5e(e,xY(e,!0))]}}function xY(e,t){return n=>UR.renderToString(n.text,{...e,displayMode:n.displayMode})+(t?`
|
|
321
321
|
`:"")}function h5e(e,t){const n=e&&e.nonStandard,r=n?c5e:l5e;return{name:"inlineKatex",level:"inline",start(i){let a,o=i;for(;o;){if(a=o.indexOf("$"),a===-1)return;if((n?a>-1:a===0||o.charAt(a-1)===" ")&&o.substring(a).match(r))return a;o=o.substring(a+1).replace(/^\$+/,"")}},tokenizer(i,a){const o=i.match(r);if(o)return{type:"inlineKatex",raw:o[0],text:o[2].trim(),displayMode:o[1].length===2}},renderer:t}}function f5e(e,t){return{name:"blockKatex",level:"block",tokenizer(n,r){const i=n.match(d5e);if(i)return{type:"blockKatex",raw:i[0],text:i[2].trim(),displayMode:i[1].length===2}},renderer:t}}function p5e(e={}){const{highlight:t,container:n}=e;return{async:!0,async walkTokens(r){var i;if(r.type!=="code"||typeof t!="function")return;const[a="text",...o]=((i=r.lang)==null?void 0:i.split(" "))??[],{text:s}=r,l=await t(s,a,o),c=n?n.replace("%l",String(a).toUpperCase()).replace("%s",l).replace("%t",s):l;Object.assign(r,{type:"html",block:!0,text:`${c}
|
|
322
322
|
`})}}}let Xn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function m5e(e){return wW(e)}function wW(e){return Array.isArray(e)?g5e(e):e instanceof RegExp?e:typeof e=="object"?y5e(e):e}function g5e(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=wW(e[n]);return t}function y5e(e){let t={};for(let n in e)t[n]=wW(e[n]);return t}function Vie(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function Bie(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Bie(e.substring(0,e.length-1)):e.substr(~t+1)}var bH=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,tg=class{static hasCaptures(e){return e===null?!1:(bH.lastIndex=0,bH.test(e))}static replaceCaptures(e,t,n){return e.replace(bH,(r,i,a,o)=>{let s=n[parseInt(i||a,10)];if(s){let l=t.substring(s.start,s.end);for(;l[0]===".";)l=l.substring(1);switch(o){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function Uie(e,t){return e<t?-1:e>t?1:0}function Wie(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let i=0;i<n;i++){let a=Uie(e[i],t[i]);if(a!==0)return a}return 0}return n-r}function _Y(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Gie(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Zie=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},WR=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(b5e(e),t)}static createFromParsedTheme(e,t){return x5e(e,t)}_cachedMatchRoot=new Zie(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(i=>v5e(e.parent,i.parentScopes));return r?new Kie(r.fontStyle,r.foreground,r.background):null}},wH=class iy{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new iy(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new iy(n,t[r]);return n}push(t){return new iy(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function v5e(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],i=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],i=!0}for(;e&&!k5e(e.scopeName,r);){if(i)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function k5e(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Kie=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function b5e(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let i=0,a=t.length;i<a;i++){let o=t[i];if(!o.settings)continue;let s;if(typeof o.scope=="string"){let h=o.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),s=h.split(",")}else Array.isArray(o.scope)?s=o.scope:s=[""];let l=-1;if(typeof o.settings.fontStyle=="string"){l=0;let h=o.settings.fontStyle.split(" ");for(let m=0,g=h.length;m<g;m++)switch(h[m]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let c=null;typeof o.settings.foreground=="string"&&_Y(o.settings.foreground)&&(c=o.settings.foreground);let u=null;typeof o.settings.background=="string"&&_Y(o.settings.background)&&(u=o.settings.background);for(let h=0,m=s.length;h<m;h++){let y=s[h].trim().split(" "),v=y[y.length-1],k=null;y.length>1&&(k=y.slice(0,y.length-1),k.reverse()),n[r++]=new w5e(v,k,i,l,c,u)}}return n}var w5e=class{constructor(e,t,n,r,i,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=a}},Or=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Or||{});function x5e(e,t){e.sort((l,c)=>{let u=Uie(l.scope,c.scope);return u!==0||(u=Wie(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",i="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(i=l.background)}let a=new _5e(t),o=new Kie(n,a.getId(r),a.getId(i)),s=new S5e(new IV(0,null,-1,0,0),[]);for(let l=0,c=e.length;l<c;l++){let u=e[l];s.insert(0,u.scope,u.parentScopes,u.fontStyle,a.getId(u.foreground),a.getId(u.background))}return new WR(a,o,s)}var _5e=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},M5e=Object.freeze([]),IV=class Xie{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,i,a){this.scopeDepth=t,this.parentScopes=n||M5e,this.fontStyle=r,this.foreground=i,this.background=a}clone(){return new Xie(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,i=t.length;r<i;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,i){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},S5e=class NV{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,i=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=t.parentScopes.length||i>=n.parentScopes.length);){const a=n.parentScopes[i].length-t.parentScopes[r].length;if(a!==0)return a;r++,i++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),i,a;if(r===-1?(i=t,a=""):(i=t.substring(0,r),a=t.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(a)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(NV._cmpBySpecificity),n}insert(t,n,r,i,a,o){if(n===""){this._doInsertHere(t,r,i,a,o);return}let s=n.indexOf("."),l,c;s===-1?(l=n,c=""):(l=n.substring(0,s),c=n.substring(s+1));let u;this._children.hasOwnProperty(l)?u=this._children[l]:(u=new NV(this._mainRule.clone(),IV.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(t+1,c,r,i,a,o)}_doInsertHere(t,n,r,i,a){if(n===null){this._mainRule.acceptOverwrite(t,r,i,a);return}for(let o=0,s=this._rulesWithParentScopes.length;o<s;o++){let l=this._rulesWithParentScopes[o];if(Wie(l.parentScopes,n)===0){l.acceptOverwrite(t,r,i,a);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),a===0&&(a=this._mainRule.background),this._rulesWithParentScopes.push(new IV(t,n,r,i,a))}},Fh=class Gi{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=Gi.getLanguageId(t),r=Gi.getTokenType(t),i=Gi.getFontStyle(t),a=Gi.getForeground(t),o=Gi.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:a,background:o})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,i,a,o,s){let l=Gi.getLanguageId(t),c=Gi.getTokenType(t),u=Gi.containsBalancedBrackets(t)?1:0,h=Gi.getFontStyle(t),m=Gi.getForeground(t),g=Gi.getBackground(t);return n!==0&&(l=n),r!==8&&(c=r),i!==null&&(u=i?1:0),a!==-1&&(h=a),o!==0&&(m=o),s!==0&&(g=s),(l<<0|c<<8|u<<10|h<<11|m<<15|g<<24)>>>0}};function GR(e,t){const n=[],r=C5e(e);let i=r.next();for(;i!==null;){let l=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let c=o();if(n.push({matcher:c,priority:l}),i!==",")break;i=r.next()}return n;function a(){if(i==="-"){i=r.next();const l=a();return c=>!!l&&!l(c)}if(i==="("){i=r.next();const l=s();return i===")"&&(i=r.next()),l}if(MY(i)){const l=[];do l.push(i),i=r.next();while(MY(i));return c=>t(l,c)}return null}function o(){const l=[];let c=a();for(;c;)l.push(c),c=a();return u=>l.every(h=>h(u))}function s(){const l=[];let c=o();for(;c&&(l.push(c),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");c=o()}return u=>l.some(h=>h(u))}}function MY(e){return!!e&&!!e.match(/[\w\.:]+/)}function C5e(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function Yie(e){typeof e.dispose=="function"&&e.dispose()}var c2=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},L5e=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},I5e=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},N5e=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new c2(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new I5e;for(const n of e)A5e(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof c2){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function A5e(e,t,n,r){const i=n.lookup(e.scopeName);if(!i){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const a=n.lookup(t);e instanceof c2?ay({baseGrammar:a,selfGrammar:i},r):AV(e.ruleName,{baseGrammar:a,selfGrammar:i,repository:i.repository},r);const o=n.injections(e.scopeName);if(o)for(const s of o)r.add(new c2(s))}function AV(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];ZR([r],t,n)}}function ay(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ZR(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ZR(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ZR(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Vie({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&ZR(r.patterns,{...t,repository:i},n);const a=r.include;if(!a)continue;const o=Jie(a);switch(o.kind){case 0:ay({...t,selfGrammar:t.baseGrammar},n);break;case 1:ay(t,n);break;case 2:AV(o.ruleName,{...t,repository:i},n);break;case 3:case 4:const s=o.scopeName===t.selfGrammar.scopeName?t.selfGrammar:o.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(s){const l={baseGrammar:t.baseGrammar,selfGrammar:s,repository:i};o.kind===4?AV(o.ruleName,l,n):ay(l,n)}else o.kind===4?n.add(new L5e(o.scopeName,o.ruleName)):n.add(new c2(o.scopeName));break}}}var $5e=class{kind=0},T5e=class{kind=1},E5e=class{constructor(e){this.ruleName=e}kind=2},P5e=class{constructor(e){this.scopeName=e}kind=3},D5e=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Jie(e){if(e==="$base")return new $5e;if(e==="$self")return new T5e;const t=e.indexOf("#");if(t===-1)return new P5e(e);if(t===0)return new E5e(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new D5e(n,r)}}var O5e=/\\(\d+)/,SY=/\\(\d+)/g,R5e=-1,Qie=-2;var Q2=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=tg.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=tg.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Bie(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:tg.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:tg.replaceCaptures(this._contentName,e,t)}},z5e=class extends Q2{retokenizeCapturedWithRuleId;constructor(e,t,n,r,i){super(e,t,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},q5e=class extends Q2{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,null),this._match=new d2(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new u2,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},CY=class extends Q2{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i){super(e,t,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new u2,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},$V=class extends Q2{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,i,a,o,s,l,c){super(e,t,n,r),this._begin=new d2(i,this.id),this.beginCaptures=a,this._end=new d2(o||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new u2;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},KR=class extends Q2{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,i,a,o,s,l){super(e,t,n,r),this._begin=new d2(i,this.id),this.beginCaptures=a,this.whileCaptures=s,this._while=new d2(o,Qie),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new u2;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new u2,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns}},eae=class Tr{static createCaptureRule(t,n,r,i,a){return t.registerRule(o=>new z5e(n,o,r,i,a))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(i=>{if(t.id=i,t.match)return new q5e(t.$vscodeTextmateLocation,t.id,t.name,t.match,Tr._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Vie({},r,t.repository));let a=t.patterns;return typeof a>"u"&&t.include&&(a=[{include:t.include}]),new CY(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Tr._compilePatterns(a,n,r))}return t.while?new KR(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Tr._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,Tr._compileCaptures(t.whileCaptures||t.captures,n,r),Tr._compilePatterns(t.patterns,n,r)):new $V(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Tr._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,Tr._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,Tr._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let i=[];if(t){let a=0;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const s=parseInt(o,10);s>a&&(a=s)}for(let o=0;o<=a;o++)i[o]=null;for(const o in t){if(o==="$vscodeTextmateLocation")continue;const s=parseInt(o,10);let l=0;t[o].patterns&&(l=Tr.getCompiledRuleId(t[o],n,r)),i[s]=Tr.createCaptureRule(n,t[o].$vscodeTextmateLocation,t[o].name,t[o].contentName,l)}}return i}static _compilePatterns(t,n,r){let i=[];if(t)for(let a=0,o=t.length;a<o;a++){const s=t[a];let l=-1;if(s.include){const c=Jie(s.include);switch(c.kind){case 0:case 1:l=Tr.getCompiledRuleId(r[s.include],n,r);break;case 2:let u=r[c.ruleName];u&&(l=Tr.getCompiledRuleId(u,n,r));break;case 3:case 4:const h=c.scopeName,m=c.kind===4?c.ruleName:null,g=n.getExternalGrammar(h,r);if(g)if(m){let y=g.repository[m];y&&(l=Tr.getCompiledRuleId(y,n,g.repository))}else l=Tr.getCompiledRuleId(g.repository.$self,n,g.repository);break}}else l=Tr.getCompiledRuleId(s,n,r);if(l!==-1){const c=n.getRule(l);let u=!1;if((c instanceof CY||c instanceof $V||c instanceof KR)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;i.push(l)}}return{patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}}},d2=class tae{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const r=t.length;let i=0,a=[],o=!1;for(let s=0;s<r;s++)if(t.charAt(s)==="\\"&&s+1<r){const c=t.charAt(s+1);c==="z"?(a.push(t.substring(i,s)),a.push("$(?!\\n)(?<!\\n)"),i=s+2):(c==="A"||c==="G")&&(o=!0),s++}this.hasAnchor=o,i===0?this.source=t:(a.push(t.substring(i,r)),this.source=a.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=O5e.test(this.source):this.hasBackReferences=!1}clone(){return new tae(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>t.substring(i.start,i.end));return SY.lastIndex=0,this.source.replace(SY,(i,a)=>Gie(r[parseInt(a,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],i=[],a,o,s,l;for(a=0,o=this.source.length;a<o;a++)s=this.source.charAt(a),t[a]=s,n[a]=s,r[a]=s,i[a]=s,s==="\\"&&a+1<o&&(l=this.source.charAt(a+1),l==="A"?(t[a+1]="",n[a+1]="",r[a+1]="A",i[a+1]="A"):l==="G"?(t[a+1]="",n[a+1]="G",r[a+1]="",i[a+1]="G"):(t[a+1]=l,n[a+1]=l,r[a+1]=l,i[a+1]=l),a++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},u2=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new LY(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(i=>i.resolveAnchors(t,n));return new LY(e,r,this._items.map(i=>i.ruleId))}},LY=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
323
323
|
`)}findNextMatchSync(e,t,n){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},xH=class{constructor(e,t){this.languageId=e,this.tokenType=t}},j5e=class TV{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new xH(t,8),this._embeddedLanguagesMatcher=new H5e(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?TV._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new xH(0,0);_getBasicScopeAttributes=new Zie(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new xH(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(TV.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},H5e=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>Gie(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},IY=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function nae(e,t,n,r,i,a,o,s){const l=t.content.length;let c=!1,u=-1;if(o){const g=F5e(e,t,n,r,i,a);i=g.stack,r=g.linePos,n=g.isFirstLine,u=g.anchorPosition}const h=Date.now();for(;!c;){if(s!==0&&Date.now()-h>s)return new IY(i,!0);m()}return new IY(i,!1);function m(){const g=V5e(e,t,n,r,i,u);if(!g){a.produce(i,l),c=!0;return}const y=g.captureIndices,v=g.matchedRuleId,k=y&&y.length>0?y[0].end>r:!1;if(v===R5e){const b=i.getRule(e);a.produce(i,y[0].start),i=i.withContentNameScopesList(i.nameScopesList),Lp(e,t,n,i,a,b.endCaptures,y),a.produce(i,y[0].end);const x=i;if(i=i.parent,u=x.getAnchorPos(),!k&&x.getEnterPos()===r){i=x,a.produce(i,l),c=!0;return}}else{const b=e.getRule(v);a.produce(i,y[0].start);const x=i,w=b.getName(t.content,y),M=i.contentNameScopesList.pushAttributed(w,e);if(i=i.push(v,r,u,y[0].end===l,null,M,M),b instanceof $V){const _=b;Lp(e,t,n,i,a,_.beginCaptures,y),a.produce(i,y[0].end),u=y[0].end;const C=_.getContentName(t.content,y),L=M.pushAttributed(C,e);if(i=i.withContentNameScopesList(L),_.endHasBackReferences&&(i=i.withEndRule(_.getEndWithResolvedBackReferences(t.content,y))),!k&&x.hasSameRuleAs(i)){i=i.pop(),a.produce(i,l),c=!0;return}}else if(b instanceof KR){const _=b;Lp(e,t,n,i,a,_.beginCaptures,y),a.produce(i,y[0].end),u=y[0].end;const C=_.getContentName(t.content,y),L=M.pushAttributed(C,e);if(i=i.withContentNameScopesList(L),_.whileHasBackReferences&&(i=i.withEndRule(_.getWhileWithResolvedBackReferences(t.content,y))),!k&&x.hasSameRuleAs(i)){i=i.pop(),a.produce(i,l),c=!0;return}}else if(Lp(e,t,n,i,a,b.captures,y),a.produce(i,y[0].end),i=i.pop(),!k){i=i.safePop(),a.produce(i,l),c=!0;return}}y[0].end>r&&(r=y[0].end,n=!1)}}function F5e(e,t,n,r,i,a){let o=i.beginRuleCapturedEOL?0:-1;const s=[];for(let l=i;l;l=l.pop()){const c=l.getRule(e);c instanceof KR&&s.push({rule:c,stack:l})}for(let l=s.pop();l;l=s.pop()){const{ruleScanner:c,findOptions:u}=W5e(l.rule,e,l.stack.endRule,n,r===o),h=c.findNextMatchSync(t,r,u);if(h){if(h.ruleId!==Qie){i=l.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(a.produce(l.stack,h.captureIndices[0].start),Lp(e,t,n,l.stack,a,l.rule.whileCaptures,h.captureIndices),a.produce(l.stack,h.captureIndices[0].end),o=h.captureIndices[0].end,h.captureIndices[0].end>r&&(r=h.captureIndices[0].end,n=!1))}else{i=l.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:o,isFirstLine:n}}function V5e(e,t,n,r,i,a){const o=B5e(e,t,n,r,i,a),s=e.getInjections();if(s.length===0)return o;const l=U5e(s,e,t,n,r,i,a);if(!l)return o;if(!o)return l;const c=o.captureIndices[0].start,u=l.captureIndices[0].start;return u<c||l.priorityMatch&&u===c?l:o}function B5e(e,t,n,r,i,a){const o=i.getRule(e),{ruleScanner:s,findOptions:l}=rae(o,e,i.endRule,n,r===a),c=s.findNextMatchSync(t,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function U5e(e,t,n,r,i,a,o){let s=Number.MAX_VALUE,l=null,c,u=0;const h=a.contentNameScopesList.getScopeNames();for(let m=0,g=e.length;m<g;m++){const y=e[m];if(!y.matcher(h))continue;const v=t.getRule(y.ruleId),{ruleScanner:k,findOptions:b}=rae(v,t,null,r,i===o),x=k.findNextMatchSync(n,i,b);if(!x)continue;const w=x.captureIndices[0].start;if(!(w>=s)&&(s=w,l=x.captureIndices,c=x.ruleId,u=y.priority,s===i))break}return l?{priorityMatch:u===-1,captureIndices:l,matchedRuleId:c}:null}function rae(e,t,n,r,i){return{ruleScanner:e.compileAG(t,n,r,i),findOptions:0}}function W5e(e,t,n,r,i){return{ruleScanner:e.compileWhileAG(t,n,r,i),findOptions:0}}function Lp(e,t,n,r,i,a,o){if(a.length===0)return;const s=t.content,l=Math.min(a.length,o.length),c=[],u=o[0].end;for(let h=0;h<l;h++){const m=a[h];if(m===null)continue;const g=o[h];if(g.length===0)continue;if(g.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=g.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,g.start):i.produce(r,g.start),m.retokenizeCapturedWithRuleId){const v=m.getName(s,o),k=r.contentNameScopesList.pushAttributed(v,e),b=m.getContentName(s,o),x=k.pushAttributed(b,e),w=r.push(m.retokenizeCapturedWithRuleId,g.start,-1,!1,null,k,x),M=e.createOnigString(s.substring(0,g.end));nae(e,M,n&&g.start===0,g.start,w,i,!1,0),Yie(M);continue}const y=m.getName(s,o);if(y!==null){const k=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(y,e);c.push(new G5e(k,g.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var G5e=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Z5e(e,t,n,r,i,a,o,s){return new X5e(e,t,n,r,i,a,o,s)}function NY(e,t,n,r,i){const a=GR(t,XR),o=eae.getCompiledRuleId(n,r,i.repository);for(const s of a)e.push({debugSelector:t,matcher:s.matcher,ruleId:o,grammar:i,priority:s.priority})}function XR(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let i=n;i<t.length;i++)if(K5e(t[i],r))return n=i+1,!0;return!1})}function K5e(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var X5e=class{constructor(e,t,n,r,i,a,o,s){if(this._rootScopeName=e,this.balancedBracketSelectors=a,this._onigLib=s,this._basicScopeAttributesProvider=new j5e(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=o,this._grammar=AY(t,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const l of Object.keys(i)){const c=GR(l,XR);for(const u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:i[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const i=r.injections;if(i)for(let o in i)NY(t,o,i[o],this,r);const a=this._grammarRepository.injections(n);a&&a.forEach(o=>{const s=this.getExternalGrammar(o);if(s){const l=s.injectionSelector;l&&NY(t,l,s,this,s)}})}return t.sort((i,a)=>i.priority-a.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=AY(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=eae.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!t||t===EV.NULL){i=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=Fh.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),m=this.getRule(this._rootId).getName(null,null);let g;m?g=Up.createRootAndLookUpScopeName(m,h,this):g=Up.createRoot("unknown",h),t=new EV(null,this._rootId,-1,-1,!1,null,g,g)}else i=!1,t.reset();e=e+`
|
|
@@ -2271,7 +2271,7 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
2271
2271
|
opacity: 0.5;
|
|
2272
2272
|
pointer-events: none;
|
|
2273
2273
|
}
|
|
2274
|
-
`;let XH=!1;function
|
|
2274
|
+
`;let XH=!1;function BJt(){if(XH||typeof document>"u")return;const e="opencode-line-comment-styles";if(document.getElementById(e)){XH=!0;return}const t=document.createElement("style");t.id=e,t.textContent=Nse,document.head.appendChild(t),XH=!0}const exe=`
|
|
2275
2275
|
[data-diff],
|
|
2276
2276
|
[data-file] {
|
|
2277
2277
|
--diffs-bg: light-dark(var(--diffs-light-bg), var(--diffs-dark-bg));
|
|
@@ -2414,9 +2414,9 @@ ${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.pus
|
|
|
2414
2414
|
|
|
2415
2415
|
${Nse}
|
|
2416
2416
|
|
|
2417
|
-
`;function Ase(e){return{theme:"OpenCode",themeType:"system",disableLineNumbers:!1,overflow:"wrap",diffStyle:e??"unified",diffIndicators:"bars",lineHoverHighlight:"both",disableBackground:!1,expansionLineCount:20,hunkSeparators:"line-info-basic",lineDiffType:e==="split"?"word-alt":"none",maxLineDiffLength:1e3,maxLineLengthForHighlighting:1e3,disableFileHeader:!0,unsafeCSS:exe}}const txe={"--diffs-font-family":"var(--font-family-mono)","--diffs-font-size":"var(--font-size-small)","--diffs-line-height":"24px","--diffs-tab-size":2,"--diffs-font-features":"var(--font-family-mono--font-feature-settings)","--diffs-header-font-family":"var(--font-family-sans)","--diffs-gap-block":0,"--diffs-min-number-column-width":"4ch"};function $se(e){const t=e.closest("[data-line], [data-alt-line]");if(t instanceof HTMLElement){const r=t.dataset.lineType;if(r==="change-deletion")return"deletions";if(r==="change-addition"||r==="change-additions")return"additions"}const n=e.closest("[data-code]");return n instanceof HTMLElement&&n.hasAttribute("data-deletions")?"deletions":"additions"}function cB(e,t){const n=t.dataset.lineIndex;if(!n)return;const r=n.split(",").map(i=>parseInt(i,10)).filter(i=>!Number.isNaN(i));if(r.length!==0)return e&&r.length===2?r[1]:r[0]}function mz(e,t,n,r){const i=Array.from(e.querySelectorAll(`[data-line="${n}"], [data-alt-line="${n}"]`)).filter(o=>o instanceof HTMLElement);if(i.length===0)return;const a=r??"additions";for(const o of i)if($se(o)===a||parseInt(o.dataset.altLine??"",10)===n)return cB(t,o)}function jJ(e,t){if(!t)return t;if(!e)return;const n=e.querySelector("[data-diff]");if(!(n instanceof HTMLElement))return;const r=n.dataset.diffType==="split",i=mz(e,r,t.start,t.side),a=mz(e,r,t.end,t.endSide??t.side);if(i===void 0||a===void 0)return e.querySelector("[data-line], [data-alt-line]")==null?void 0:null;if(i<=a)return t;const o=t.endSide??t.side,s={start:t.end,end:t.start};return o&&(s.side=o),t.endSide&&t.side&&(s.endSide=t.side),s}function Tse(e){const t=e.dataset.lineAnnotation?.split(",")[1];if(!t)return;const n=parseInt(t,10);if(!Number.isNaN(n))return n}function Ese(e){const t=Array.from(e.querySelectorAll("[data-comment-selected]"));for(const n of t)n instanceof HTMLElement&&n.removeAttribute("data-comment-selected")}function nxe(e,t){Ese(e);const n=e.querySelector("[data-diff]");if(!(n instanceof HTMLElement))return;const r=n.dataset.diffType==="split",i=Array.from(n.querySelectorAll("[data-line-index]")).filter(o=>o instanceof HTMLElement);if(i.length===0)return;const a=Array.from(n.querySelectorAll("[data-line-annotation]")).filter(o=>o instanceof HTMLElement);for(const o of t){const s=mz(e,r,o.start,o.side);if(s===void 0)continue;const l=o.end===o.start&&(o.endSide==null||o.endSide===o.side)?s:mz(e,r,o.end,o.endSide??o.side);if(l===void 0)continue;const c=Math.min(s,l),u=Math.max(s,l);for(const h of i){const m=cB(r,h);m===void 0||m<c||m>u||h.setAttribute("data-comment-selected","")}for(const h of a){const m=Tse(h);m===void 0||m<c||m>u||h.setAttribute("data-comment-selected","")}}}function rxe(e,t){Ese(e);const n=Array.from(e.querySelectorAll("[data-line-annotation]")).filter(r=>r instanceof HTMLElement);for(const r of t){const i=Math.max(1,Math.min(r.start,r.end)),a=Math.max(r.start,r.end);for(let o=i;o<=a;o++){const s=Array.from(e.querySelectorAll(`[data-line="${o}"], [data-column-number="${o}"]`));for(const l of s)l instanceof HTMLElement&&l.setAttribute("data-comment-selected","")}for(const o of n){const s=Tse(o);s===void 0||s<i||s>a||o.setAttribute("data-comment-selected","")}}}const gz=Symbol("store-raw"),$h=Symbol("store-node"),Bo=Symbol("store-has"),Pse=Symbol("store-self");function Dse(e){let t=e[za];if(!t&&(Object.defineProperty(e,za,{value:t=new Proxy(e,oxe)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;i<a;i++){const o=n[i];r[o].get&&Object.defineProperty(e,o,{enumerable:r[o].enumerable,get:r[o].get.bind(t)})}}return t}function Co(e){let t;return e!=null&&typeof e=="object"&&(e[za]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function u0(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[gz])return n;if(!Co(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let o=0,s=e.length;o<s;o++)i=e[o],(r=u0(i,t))!==i&&(e[o]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const o=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,c=o.length;l<c;l++)a=o[l],!s[a].get&&(i=e[a],(r=u0(i,t))!==i&&(e[a]=r))}return e}function yz(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function k2(e,t,n){if(e[t])return e[t];const[r,i]=Ce(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function ixe(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===za||t===$h||(delete n.value,delete n.writable,n.get=()=>e[za][t]),n}function Ose(e){sV()&&k2(yz(e,$h),Pse)()}function axe(e){return Ose(e),Reflect.ownKeys(e)}const oxe={get(e,t,n){if(t===gz)return e;if(t===za)return n;if(t===TR)return Ose(e),n;const r=yz(e,$h),i=r[t];let a=i?i():e[t];if(t===$h||t===Bo||t==="__proto__")return a;if(!i){const o=Object.getOwnPropertyDescriptor(e,t);sV()&&(typeof a!="function"||e.hasOwnProperty(t))&&!(o&&o.get)&&(a=k2(r,t,a)())}return Co(a)?Dse(a):a},has(e,t){return t===gz||t===za||t===TR||t===$h||t===Bo||t==="__proto__"?!0:(sV()&&k2(yz(e,Bo),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:axe,getOwnPropertyDescriptor:ixe};function mi(e,t,n,r=!1){if(!r&&e[t]===n)return;const i=e[t],a=e.length;n===void 0?(delete e[t],e[Bo]&&e[Bo][t]&&i!==void 0&&e[Bo][t].$()):(e[t]=n,e[Bo]&&e[Bo][t]&&i===void 0&&e[Bo][t].$());let o=yz(e,$h),s;if((s=k2(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let l=e.length;l<a;l++)(s=o[l])&&s.$();(s=k2(o,"length",a))&&s.$(e.length)}(s=o[Pse])&&s.$()}function Rse(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const i=n[r];mi(e,i,t[i])}}function sxe(e,t){if(typeof t=="function"&&(t=t(e)),t=u0(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const i=t[n];e[n]!==i&&mi(e,n,i)}mi(e,"length",r)}else Rse(e,t)}function Np(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();const o=typeof r,s=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)Np(e,[r[l]].concat(t),n);return}else if(s&&o==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Np(e,[l].concat(t),n);return}else if(s&&o==="object"){const{from:l=0,to:c=e.length-1,by:u=1}=r;for(let h=l;h<=c;h+=u)Np(e,[h].concat(t),n);return}else if(t.length>1){Np(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a=="function"&&(a=a(i,n),a===i)||r===void 0&&a==null||(a=u0(a),r===void 0||Co(i)&&Co(a)&&!Array.isArray(a)?Rse(i,a):mi(e,r,a))}function nt(...[e,t]){const n=u0(e||{}),r=Array.isArray(n),i=Dse(n);function a(...o){ct(()=>{r&&o.length===1?sxe(n,o[0]):Np(n,o)})}return[i,a]}const dB=Symbol("store-root");function uh(e,t,n,r,i){const a=t[n];if(e===a)return;const o=Array.isArray(e);if(n!==dB&&(!Co(e)||!Co(a)||o!==Array.isArray(a)||i&&e[i]!==a[i])){mi(t,n,e);return}if(o){if(e.length&&a.length&&(!r||i&&e[0]&&e[0][i]!=null)){let c,u,h,m,g,y,v,k;for(h=0,m=Math.min(a.length,e.length);h<m&&(a[h]===e[h]||i&&a[h]&&e[h]&&a[h][i]&&a[h][i]===e[h][i]);h++)uh(e[h],a,h,r,i);const b=new Array(e.length),x=new Map;for(m=a.length-1,g=e.length-1;m>=h&&g>=h&&(a[m]===e[g]||i&&a[m]&&e[g]&&a[m][i]&&a[m][i]===e[g][i]);m--,g--)b[g]=a[m];if(h>g||h>m){for(u=h;u<=g;u++)mi(a,u,e[u]);for(;u<e.length;u++)mi(a,u,b[u]),uh(e[u],a,u,r,i);a.length>e.length&&mi(a,"length",e.length);return}for(v=new Array(g+1),u=g;u>=h;u--)y=e[u],k=i&&y?y[i]:y,c=x.get(k),v[u]=c===void 0?-1:c,x.set(k,u);for(c=h;c<=m;c++)y=a[c],k=i&&y?y[i]:y,u=x.get(k),u!==void 0&&u!==-1&&(b[u]=a[c],u=v[u],x.set(k,u));for(u=h;u<e.length;u++)u in b?(mi(a,u,b[u]),uh(e[u],a,u,r,i)):mi(a,u,e[u])}else for(let c=0,u=e.length;c<u;c++)uh(e[c],a,c,r,i);a.length>e.length&&mi(a,"length",e.length);return}const s=Object.keys(e);for(let c=0,u=s.length;c<u;c++)uh(e[s[c]],a,s[c],r,i);const l=Object.keys(a);for(let c=0,u=l.length;c<u;c++)e[l[c]]===void 0&&mi(a,l[c],void 0)}function Ct(e,t={}){const{merge:n,key:r="id"}=t,i=u0(e);return a=>{if(!Co(a)||!Co(i))return i;const o=uh(i,{[dB]:a},dB,n,r);return o===void 0?a:o}}const vz=new WeakMap,zse={get(e,t){if(t===gz)return e;const n=e[t];let r;return Co(n)?vz.get(n)||(vz.set(n,r=new Proxy(n,zse)),r):n},set(e,t,n){return mi(e,t,u0(n)),!0},deleteProperty(e,t){return mi(e,t,void 0,!0),!0}};function Je(e){return t=>{if(Co(t)){let n;(n=vz.get(t))||vz.set(t,n=new Proxy(t,zse)),e(n)}return t}}const kz=new Set;let Ns,Zi,HJ=!1;function lxe(e){return e instanceof HTMLElement?e.closest("[data-prevent-autofocus]")||e.isContentEditable?!0:/^(INPUT|TEXTAREA|SELECT|BUTTON)$/.test(e.tagName):!1}function FJ(e){if(e instanceof Node)for(const t of kz){const n=t.element();if(n&&n.isConnected&&n.contains(e))return t}}function cxe(){HJ||typeof window>"u"||(HJ=!0,window.addEventListener("keydown",e=>{if(e.defaultPrevented||lxe(e.target)||!(e.metaKey||e.ctrlKey))return;const n=e.key.toLowerCase();if(n==="g"){const a=Zi;if(!a||!a.isOpen())return;e.preventDefault(),e.stopPropagation(),a.next(e.shiftKey?-1:1);return}if(n!=="f")return;const r=Zi;if(r&&r.isOpen()){e.preventDefault(),e.stopPropagation(),r.open();return}const i=FJ(document.activeElement)??FJ(e.target)??Ns??Array.from(kz)[0];i&&(e.preventDefault(),e.stopPropagation(),i.open())},{capture:!0}))}function Z0(){const e=globalThis.CSS?.highlights;e&&(e.delete("opencode-find"),e.delete("opencode-find-current"))}function VJ(){const e=globalThis;return typeof e.Highlight=="function"&&e.CSS?.highlights!=null}function BJ(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t);if(n.overflowY==="auto"||n.overflowY==="scroll")return t;t=t.parentElement}}function dxe(e){let t,n,r=[],i="overlay",a=[];const[o,s]=nt({open:!1,query:"",index:0,count:0,pos:{top:8,right:8}}),l=()=>o.open,c=()=>o.query,u=()=>o.index,h=()=>o.count,m=()=>o.pos,g=()=>{for(const P of r)P.removeEventListener("scroll",k);r=[]},y=()=>{const P=e.overlay();P&&(n!==void 0&&(cancelAnimationFrame(n),n=void 0),P.innerHTML="")},v=()=>{if(i!=="overlay"){y();return}const P=e.wrapper(),O=e.overlay();if(!P||!O||(y(),a.length===0))return;const E=P.getBoundingClientRect(),T=u(),R=document.createDocumentFragment();for(let H=0;H<a.length;H++){const Y=a[H],j=H===T;for(const X of Array.from(Y.getClientRects())){if(!X.width||!X.height)continue;const W=document.createElement("div");W.style.position="absolute",W.style.left=`${Math.round(X.left-E.left)}px`,W.style.top=`${Math.round(X.top-E.top)}px`,W.style.width=`${Math.round(X.width)}px`,W.style.height=`${Math.round(X.height)}px`,W.style.borderRadius="2px",W.style.backgroundColor=j?"var(--surface-warning-strong)":"var(--surface-warning-base)",W.style.opacity=j?"0.55":"0.35",j&&(W.style.boxShadow="inset 0 0 0 1px var(--border-warning-base)"),R.appendChild(W)}}O.appendChild(R)};function k(){i==="overlay"&&l()&&n===void 0&&(n=requestAnimationFrame(()=>{n=void 0,v()}))}const b=()=>{if(i!=="overlay")return;const P=e.getRoot(),O=P?Array.from(P.querySelectorAll("[data-code]")).filter(E=>E instanceof HTMLElement):[];if(!(O.length===r.length&&O.every((E,T)=>E===r[T]))){g(),r=O;for(const E of r)E.addEventListener("scroll",k,{passive:!0})}},x=()=>{Z0(),y(),g(),a=[],s("count",0),s("index",0)},w=()=>{if(typeof window>"u")return;const P=e.wrapper();if(!P)return;const O=BJ(P)??P,E=O.getBoundingClientRect(),T=parseFloat(getComputedStyle(O).getPropertyValue("--session-title-height")),R=Number.isNaN(T)?0:T;s("pos",{top:Math.round(E.top)+R-4,right:Math.round(window.innerWidth-E.right)+8})},M=(P,O)=>{const E=O.toLowerCase(),T=[],R=Array.from(P.querySelectorAll("[data-content] [data-line], [data-column-content]")).filter(H=>H instanceof HTMLElement);for(const H of R){const Y=H.textContent;if(!Y)continue;const j=Y.toLowerCase();let X=j.indexOf(E);if(X===-1)continue;const W=[],G=[],J=document.createTreeWalker(H,NodeFilter.SHOW_TEXT);let oe=J.nextNode(),de=0;for(;oe;)oe instanceof Text&&(de+=oe.data.length,W.push(oe),G.push(de)),oe=J.nextNode();if(W.length===0)continue;const ye=ve=>{let le=0,pe=G.length-1;for(;le<pe;){const Re=le+pe>>1;G[Re]>=ve?pe=Re:le=Re+1}const Ee=le===0?0:G[le-1];return{node:W[le],offset:ve-Ee}};for(;X!==-1;){const ve=ye(X),le=ye(X+O.length),pe=document.createRange();pe.setStart(ve.node,ve.offset),pe.setEnd(le.node,le.offset),T.push(pe),X=j.indexOf(E,X+O.length)}}return T},_=P=>{const O=P.startContainer;(O instanceof Element?O:O.parentElement)?.scrollIntoView({block:"center",inline:"center"})},C=(P,O)=>{const E=globalThis.CSS?.highlights,T=globalThis.Highlight;if(!E||typeof T!="function")return!1;E.delete("opencode-find"),E.delete("opencode-find-current");const R=P[O];R&&E.set("opencode-find-current",new T(R));const H=P.filter((Y,j)=>j!==O);return H.length>0&&E.set("opencode-find",new T(...H)),!0},L=P=>{if(!l())return;const O=c().trim();if(!O){x();return}const E=e.getRoot();if(!E)return;i=VJ()?"highlights":"overlay";const T=M(E,O),R=T.length,H=P?.reset?0:u(),Y=R?Math.min(H,R-1):0;a=T,s("count",R),s("index",Y);const j=T[Y];if(i==="highlights"){y(),g(),C(T,Y)||(i="overlay",Z0(),b(),k()),P?.scroll&&j&&_(j);return}Z0(),b(),P?.scroll&&j&&_(j),k()},S=()=>{s("open",!1),s("query",""),x(),Zi===D&&(Zi=void 0)},I=()=>{Zi&&Zi!==D&&Zi.close(),Zi=D,Ns=D,l()||s("open",!0),requestAnimationFrame(()=>{L({scroll:!0}),t?.focus(),t?.select()})},A=P=>{if(!l())return;const O=h();if(O<=0)return;const E=(u()+P+O)%O;s("index",E);const T=a[E];if(T){if(i==="highlights"){if(!C(a,E)){i="overlay",L({reset:!0,scroll:!0});return}_(T);return}Z0(),b(),_(T),k()}},D={element:e.wrapper,isOpen:()=>l(),next:A,open:I,close:S};return dn(()=>{i=VJ()?"highlights":"overlay",cxe(),kz.add(D),Ns||(Ns=D),me(()=>{kz.delete(D),Zi===D&&(Zi=void 0,Z0()),Ns===D&&(Ns=void 0)})}),he(()=>{if(!l())return;const P=()=>w();requestAnimationFrame(P),window.addEventListener("resize",P,{passive:!0});const O=e.wrapper();if(!O)return;const E=BJ(O)??O,T=typeof ResizeObserver>"u"?void 0:new ResizeObserver(()=>P());T?.observe(E),me(()=>{window.removeEventListener("resize",P),T?.disconnect()})}),me(()=>{g(),y(),Zi===D&&(Zi=void 0,Z0())}),{open:l,query:c,count:h,index:u,pos:m,setInput:P=>{t=P},setQuery:P=>{s("query",P),s("index",0),L({reset:!0,scroll:!0})},focus:I,close:S,next:A,refresh:P=>L(P),onPointerDown:()=>{Ns=D,e.wrapper()?.focus({preventScroll:!0})},onFocus:()=>{Ns=D},onInputKeyDown:P=>{if(P.key==="Escape"){P.preventDefault(),S();return}P.key==="Enter"&&(P.preventDefault(),A(P.shiftKey?-1:1))}}}function uxe(){return{token:0}}function Kp(e){e.observer?.disconnect(),e.observer=void 0}function qse(e){if(!e)return;const t=e.querySelector("diffs-container");if(t instanceof HTMLElement)return t}function hxe(e){return qse(e)?.shadowRoot??void 0}function uB(e){if(!e||typeof document>"u")return;const t=document.documentElement.dataset.colorScheme;if(t==="dark"||t==="light"){e.dataset.colorScheme=t;return}e.removeAttribute("data-color-scheme")}function fxe(e){if(typeof document>"u")return()=>{};if(uB(e()),typeof MutationObserver>"u")return()=>{};const t=document.documentElement,n=new MutationObserver(()=>uB(e()));return n.observe(t,{attributes:!0,attributeFilter:["data-color-scheme"]}),()=>n.disconnect()}function pxe(e){Kp(e.state),e.state.token+=1;const t=e.state.token,n=Math.max(0,e.settleFrames??0),r=()=>{const o=s=>{if(t===e.state.token){if(s<=0){e.onReady();return}requestAnimationFrame(()=>o(s-1))}};requestAnimationFrame(()=>o(n))},i=o=>{if(e.isReady(o)){r();return}typeof MutationObserver>"u"||(Kp(e.state),e.state.observer=new MutationObserver(()=>{t===e.state.token&&e.isReady(o)&&(Kp(e.state),r())}),e.state.observer.observe(o,{childList:!0,subtree:!0}))},a=e.getRoot();if(!a){if(typeof MutationObserver>"u")return;e.state.observer=new MutationObserver(()=>{if(t!==e.state.token)return;const o=e.getRoot();o&&i(o)}),e.state.observer.observe(e.container,{childList:!0,subtree:!0});return}i(a)}function VJt(e,t){const n=Math.min(e.start,e.end),r=Math.max(e.start,e.end);return n===r?t("ui.sessionReview.selection.line",{line:n}):t("ui.sessionReview.selection.lines",{start:n,end:r})}function BJt(e,t){const n=Math.max(1,Math.min(t.start,t.end)),r=Math.max(t.start,t.end),i=e.split(`
|
|
2417
|
+
`;function Ase(e){return{theme:"OpenCode",themeType:"system",disableLineNumbers:!1,overflow:"wrap",diffStyle:e??"unified",diffIndicators:"bars",lineHoverHighlight:"both",disableBackground:!1,expansionLineCount:20,hunkSeparators:"line-info-basic",lineDiffType:e==="split"?"word-alt":"none",maxLineDiffLength:1e3,maxLineLengthForHighlighting:1e3,disableFileHeader:!0,unsafeCSS:exe}}const txe={"--diffs-font-family":"var(--font-family-mono)","--diffs-font-size":"var(--font-size-small)","--diffs-line-height":"24px","--diffs-tab-size":2,"--diffs-font-features":"var(--font-family-mono--font-feature-settings)","--diffs-header-font-family":"var(--font-family-sans)","--diffs-gap-block":0,"--diffs-min-number-column-width":"4ch"};function $se(e){const t=e.closest("[data-line], [data-alt-line]");if(t instanceof HTMLElement){const r=t.dataset.lineType;if(r==="change-deletion")return"deletions";if(r==="change-addition"||r==="change-additions")return"additions"}const n=e.closest("[data-code]");return n instanceof HTMLElement&&n.hasAttribute("data-deletions")?"deletions":"additions"}function cB(e,t){const n=t.dataset.lineIndex;if(!n)return;const r=n.split(",").map(i=>parseInt(i,10)).filter(i=>!Number.isNaN(i));if(r.length!==0)return e&&r.length===2?r[1]:r[0]}function mz(e,t,n,r){const i=Array.from(e.querySelectorAll(`[data-line="${n}"], [data-alt-line="${n}"]`)).filter(o=>o instanceof HTMLElement);if(i.length===0)return;const a=r??"additions";for(const o of i)if($se(o)===a||parseInt(o.dataset.altLine??"",10)===n)return cB(t,o)}function jJ(e,t){if(!t)return t;if(!e)return;const n=e.querySelector("[data-diff]");if(!(n instanceof HTMLElement))return;const r=n.dataset.diffType==="split",i=mz(e,r,t.start,t.side),a=mz(e,r,t.end,t.endSide??t.side);if(i===void 0||a===void 0)return e.querySelector("[data-line], [data-alt-line]")==null?void 0:null;if(i<=a)return t;const o=t.endSide??t.side,s={start:t.end,end:t.start};return o&&(s.side=o),t.endSide&&t.side&&(s.endSide=t.side),s}function Tse(e){const t=e.dataset.lineAnnotation?.split(",")[1];if(!t)return;const n=parseInt(t,10);if(!Number.isNaN(n))return n}function Ese(e){const t=Array.from(e.querySelectorAll("[data-comment-selected]"));for(const n of t)n instanceof HTMLElement&&n.removeAttribute("data-comment-selected")}function nxe(e,t){Ese(e);const n=e.querySelector("[data-diff]");if(!(n instanceof HTMLElement))return;const r=n.dataset.diffType==="split",i=Array.from(n.querySelectorAll("[data-line-index]")).filter(o=>o instanceof HTMLElement);if(i.length===0)return;const a=Array.from(n.querySelectorAll("[data-line-annotation]")).filter(o=>o instanceof HTMLElement);for(const o of t){const s=mz(e,r,o.start,o.side);if(s===void 0)continue;const l=o.end===o.start&&(o.endSide==null||o.endSide===o.side)?s:mz(e,r,o.end,o.endSide??o.side);if(l===void 0)continue;const c=Math.min(s,l),u=Math.max(s,l);for(const h of i){const m=cB(r,h);m===void 0||m<c||m>u||h.setAttribute("data-comment-selected","")}for(const h of a){const m=Tse(h);m===void 0||m<c||m>u||h.setAttribute("data-comment-selected","")}}}function rxe(e,t){Ese(e);const n=Array.from(e.querySelectorAll("[data-line-annotation]")).filter(r=>r instanceof HTMLElement);for(const r of t){const i=Math.max(1,Math.min(r.start,r.end)),a=Math.max(r.start,r.end);for(let o=i;o<=a;o++){const s=Array.from(e.querySelectorAll(`[data-line="${o}"], [data-column-number="${o}"]`));for(const l of s)l instanceof HTMLElement&&l.setAttribute("data-comment-selected","")}for(const o of n){const s=Tse(o);s===void 0||s<i||s>a||o.setAttribute("data-comment-selected","")}}}const gz=Symbol("store-raw"),$h=Symbol("store-node"),Bo=Symbol("store-has"),Pse=Symbol("store-self");function Dse(e){let t=e[za];if(!t&&(Object.defineProperty(e,za,{value:t=new Proxy(e,oxe)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let i=0,a=n.length;i<a;i++){const o=n[i];r[o].get&&Object.defineProperty(e,o,{enumerable:r[o].enumerable,get:r[o].get.bind(t)})}}return t}function Co(e){let t;return e!=null&&typeof e=="object"&&(e[za]||!(t=Object.getPrototypeOf(e))||t===Object.prototype||Array.isArray(e))}function u0(e,t=new Set){let n,r,i,a;if(n=e!=null&&e[gz])return n;if(!Co(e)||t.has(e))return e;if(Array.isArray(e)){Object.isFrozen(e)?e=e.slice(0):t.add(e);for(let o=0,s=e.length;o<s;o++)i=e[o],(r=u0(i,t))!==i&&(e[o]=r)}else{Object.isFrozen(e)?e=Object.assign({},e):t.add(e);const o=Object.keys(e),s=Object.getOwnPropertyDescriptors(e);for(let l=0,c=o.length;l<c;l++)a=o[l],!s[a].get&&(i=e[a],(r=u0(i,t))!==i&&(e[a]=r))}return e}function yz(e,t){let n=e[t];return n||Object.defineProperty(e,t,{value:n=Object.create(null)}),n}function k2(e,t,n){if(e[t])return e[t];const[r,i]=Ce(n,{equals:!1,internal:!0});return r.$=i,e[t]=r}function ixe(e,t){const n=Reflect.getOwnPropertyDescriptor(e,t);return!n||n.get||!n.configurable||t===za||t===$h||(delete n.value,delete n.writable,n.get=()=>e[za][t]),n}function Ose(e){sV()&&k2(yz(e,$h),Pse)()}function axe(e){return Ose(e),Reflect.ownKeys(e)}const oxe={get(e,t,n){if(t===gz)return e;if(t===za)return n;if(t===TR)return Ose(e),n;const r=yz(e,$h),i=r[t];let a=i?i():e[t];if(t===$h||t===Bo||t==="__proto__")return a;if(!i){const o=Object.getOwnPropertyDescriptor(e,t);sV()&&(typeof a!="function"||e.hasOwnProperty(t))&&!(o&&o.get)&&(a=k2(r,t,a)())}return Co(a)?Dse(a):a},has(e,t){return t===gz||t===za||t===TR||t===$h||t===Bo||t==="__proto__"?!0:(sV()&&k2(yz(e,Bo),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:axe,getOwnPropertyDescriptor:ixe};function mi(e,t,n,r=!1){if(!r&&e[t]===n)return;const i=e[t],a=e.length;n===void 0?(delete e[t],e[Bo]&&e[Bo][t]&&i!==void 0&&e[Bo][t].$()):(e[t]=n,e[Bo]&&e[Bo][t]&&i===void 0&&e[Bo][t].$());let o=yz(e,$h),s;if((s=k2(o,t,i))&&s.$(()=>n),Array.isArray(e)&&e.length!==a){for(let l=e.length;l<a;l++)(s=o[l])&&s.$();(s=k2(o,"length",a))&&s.$(e.length)}(s=o[Pse])&&s.$()}function Rse(e,t){const n=Object.keys(t);for(let r=0;r<n.length;r+=1){const i=n[r];mi(e,i,t[i])}}function sxe(e,t){if(typeof t=="function"&&(t=t(e)),t=u0(t),Array.isArray(t)){if(e===t)return;let n=0,r=t.length;for(;n<r;n++){const i=t[n];e[n]!==i&&mi(e,n,i)}mi(e,"length",r)}else Rse(e,t)}function Np(e,t,n=[]){let r,i=e;if(t.length>1){r=t.shift();const o=typeof r,s=Array.isArray(e);if(Array.isArray(r)){for(let l=0;l<r.length;l++)Np(e,[r[l]].concat(t),n);return}else if(s&&o==="function"){for(let l=0;l<e.length;l++)r(e[l],l)&&Np(e,[l].concat(t),n);return}else if(s&&o==="object"){const{from:l=0,to:c=e.length-1,by:u=1}=r;for(let h=l;h<=c;h+=u)Np(e,[h].concat(t),n);return}else if(t.length>1){Np(e[r],t,[r].concat(n));return}i=e[r],n=[r].concat(n)}let a=t[0];typeof a=="function"&&(a=a(i,n),a===i)||r===void 0&&a==null||(a=u0(a),r===void 0||Co(i)&&Co(a)&&!Array.isArray(a)?Rse(i,a):mi(e,r,a))}function nt(...[e,t]){const n=u0(e||{}),r=Array.isArray(n),i=Dse(n);function a(...o){ct(()=>{r&&o.length===1?sxe(n,o[0]):Np(n,o)})}return[i,a]}const dB=Symbol("store-root");function uh(e,t,n,r,i){const a=t[n];if(e===a)return;const o=Array.isArray(e);if(n!==dB&&(!Co(e)||!Co(a)||o!==Array.isArray(a)||i&&e[i]!==a[i])){mi(t,n,e);return}if(o){if(e.length&&a.length&&(!r||i&&e[0]&&e[0][i]!=null)){let c,u,h,m,g,y,v,k;for(h=0,m=Math.min(a.length,e.length);h<m&&(a[h]===e[h]||i&&a[h]&&e[h]&&a[h][i]&&a[h][i]===e[h][i]);h++)uh(e[h],a,h,r,i);const b=new Array(e.length),x=new Map;for(m=a.length-1,g=e.length-1;m>=h&&g>=h&&(a[m]===e[g]||i&&a[m]&&e[g]&&a[m][i]&&a[m][i]===e[g][i]);m--,g--)b[g]=a[m];if(h>g||h>m){for(u=h;u<=g;u++)mi(a,u,e[u]);for(;u<e.length;u++)mi(a,u,b[u]),uh(e[u],a,u,r,i);a.length>e.length&&mi(a,"length",e.length);return}for(v=new Array(g+1),u=g;u>=h;u--)y=e[u],k=i&&y?y[i]:y,c=x.get(k),v[u]=c===void 0?-1:c,x.set(k,u);for(c=h;c<=m;c++)y=a[c],k=i&&y?y[i]:y,u=x.get(k),u!==void 0&&u!==-1&&(b[u]=a[c],u=v[u],x.set(k,u));for(u=h;u<e.length;u++)u in b?(mi(a,u,b[u]),uh(e[u],a,u,r,i)):mi(a,u,e[u])}else for(let c=0,u=e.length;c<u;c++)uh(e[c],a,c,r,i);a.length>e.length&&mi(a,"length",e.length);return}const s=Object.keys(e);for(let c=0,u=s.length;c<u;c++)uh(e[s[c]],a,s[c],r,i);const l=Object.keys(a);for(let c=0,u=l.length;c<u;c++)e[l[c]]===void 0&&mi(a,l[c],void 0)}function Ct(e,t={}){const{merge:n,key:r="id"}=t,i=u0(e);return a=>{if(!Co(a)||!Co(i))return i;const o=uh(i,{[dB]:a},dB,n,r);return o===void 0?a:o}}const vz=new WeakMap,zse={get(e,t){if(t===gz)return e;const n=e[t];let r;return Co(n)?vz.get(n)||(vz.set(n,r=new Proxy(n,zse)),r):n},set(e,t,n){return mi(e,t,u0(n)),!0},deleteProperty(e,t){return mi(e,t,void 0,!0),!0}};function Je(e){return t=>{if(Co(t)){let n;(n=vz.get(t))||vz.set(t,n=new Proxy(t,zse)),e(n)}return t}}const kz=new Set;let Ns,Zi,HJ=!1;function lxe(e){return e instanceof HTMLElement?e.closest("[data-prevent-autofocus]")||e.isContentEditable?!0:/^(INPUT|TEXTAREA|SELECT|BUTTON)$/.test(e.tagName):!1}function FJ(e){if(e instanceof Node)for(const t of kz){const n=t.element();if(n&&n.isConnected&&n.contains(e))return t}}function cxe(){HJ||typeof window>"u"||(HJ=!0,window.addEventListener("keydown",e=>{if(e.defaultPrevented||lxe(e.target)||!(e.metaKey||e.ctrlKey))return;const n=e.key.toLowerCase();if(n==="g"){const a=Zi;if(!a||!a.isOpen())return;e.preventDefault(),e.stopPropagation(),a.next(e.shiftKey?-1:1);return}if(n!=="f")return;const r=Zi;if(r&&r.isOpen()){e.preventDefault(),e.stopPropagation(),r.open();return}const i=FJ(document.activeElement)??FJ(e.target)??Ns??Array.from(kz)[0];i&&(e.preventDefault(),e.stopPropagation(),i.open())},{capture:!0}))}function Z0(){const e=globalThis.CSS?.highlights;e&&(e.delete("opencode-find"),e.delete("opencode-find-current"))}function VJ(){const e=globalThis;return typeof e.Highlight=="function"&&e.CSS?.highlights!=null}function BJ(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t);if(n.overflowY==="auto"||n.overflowY==="scroll")return t;t=t.parentElement}}function dxe(e){let t,n,r=[],i="overlay",a=[];const[o,s]=nt({open:!1,query:"",index:0,count:0,pos:{top:8,right:8}}),l=()=>o.open,c=()=>o.query,u=()=>o.index,h=()=>o.count,m=()=>o.pos,g=()=>{for(const P of r)P.removeEventListener("scroll",k);r=[]},y=()=>{const P=e.overlay();P&&(n!==void 0&&(cancelAnimationFrame(n),n=void 0),P.innerHTML="")},v=()=>{if(i!=="overlay"){y();return}const P=e.wrapper(),O=e.overlay();if(!P||!O||(y(),a.length===0))return;const E=P.getBoundingClientRect(),T=u(),R=document.createDocumentFragment();for(let H=0;H<a.length;H++){const Y=a[H],j=H===T;for(const X of Array.from(Y.getClientRects())){if(!X.width||!X.height)continue;const W=document.createElement("div");W.style.position="absolute",W.style.left=`${Math.round(X.left-E.left)}px`,W.style.top=`${Math.round(X.top-E.top)}px`,W.style.width=`${Math.round(X.width)}px`,W.style.height=`${Math.round(X.height)}px`,W.style.borderRadius="2px",W.style.backgroundColor=j?"var(--surface-warning-strong)":"var(--surface-warning-base)",W.style.opacity=j?"0.55":"0.35",j&&(W.style.boxShadow="inset 0 0 0 1px var(--border-warning-base)"),R.appendChild(W)}}O.appendChild(R)};function k(){i==="overlay"&&l()&&n===void 0&&(n=requestAnimationFrame(()=>{n=void 0,v()}))}const b=()=>{if(i!=="overlay")return;const P=e.getRoot(),O=P?Array.from(P.querySelectorAll("[data-code]")).filter(E=>E instanceof HTMLElement):[];if(!(O.length===r.length&&O.every((E,T)=>E===r[T]))){g(),r=O;for(const E of r)E.addEventListener("scroll",k,{passive:!0})}},x=()=>{Z0(),y(),g(),a=[],s("count",0),s("index",0)},w=()=>{if(typeof window>"u")return;const P=e.wrapper();if(!P)return;const O=BJ(P)??P,E=O.getBoundingClientRect(),T=parseFloat(getComputedStyle(O).getPropertyValue("--session-title-height")),R=Number.isNaN(T)?0:T;s("pos",{top:Math.round(E.top)+R-4,right:Math.round(window.innerWidth-E.right)+8})},M=(P,O)=>{const E=O.toLowerCase(),T=[],R=Array.from(P.querySelectorAll("[data-content] [data-line], [data-column-content]")).filter(H=>H instanceof HTMLElement);for(const H of R){const Y=H.textContent;if(!Y)continue;const j=Y.toLowerCase();let X=j.indexOf(E);if(X===-1)continue;const W=[],G=[],J=document.createTreeWalker(H,NodeFilter.SHOW_TEXT);let oe=J.nextNode(),de=0;for(;oe;)oe instanceof Text&&(de+=oe.data.length,W.push(oe),G.push(de)),oe=J.nextNode();if(W.length===0)continue;const ye=ve=>{let le=0,pe=G.length-1;for(;le<pe;){const Re=le+pe>>1;G[Re]>=ve?pe=Re:le=Re+1}const Ee=le===0?0:G[le-1];return{node:W[le],offset:ve-Ee}};for(;X!==-1;){const ve=ye(X),le=ye(X+O.length),pe=document.createRange();pe.setStart(ve.node,ve.offset),pe.setEnd(le.node,le.offset),T.push(pe),X=j.indexOf(E,X+O.length)}}return T},_=P=>{const O=P.startContainer;(O instanceof Element?O:O.parentElement)?.scrollIntoView({block:"center",inline:"center"})},C=(P,O)=>{const E=globalThis.CSS?.highlights,T=globalThis.Highlight;if(!E||typeof T!="function")return!1;E.delete("opencode-find"),E.delete("opencode-find-current");const R=P[O];R&&E.set("opencode-find-current",new T(R));const H=P.filter((Y,j)=>j!==O);return H.length>0&&E.set("opencode-find",new T(...H)),!0},L=P=>{if(!l())return;const O=c().trim();if(!O){x();return}const E=e.getRoot();if(!E)return;i=VJ()?"highlights":"overlay";const T=M(E,O),R=T.length,H=P?.reset?0:u(),Y=R?Math.min(H,R-1):0;a=T,s("count",R),s("index",Y);const j=T[Y];if(i==="highlights"){y(),g(),C(T,Y)||(i="overlay",Z0(),b(),k()),P?.scroll&&j&&_(j);return}Z0(),b(),P?.scroll&&j&&_(j),k()},S=()=>{s("open",!1),s("query",""),x(),Zi===D&&(Zi=void 0)},I=()=>{Zi&&Zi!==D&&Zi.close(),Zi=D,Ns=D,l()||s("open",!0),requestAnimationFrame(()=>{L({scroll:!0}),t?.focus(),t?.select()})},A=P=>{if(!l())return;const O=h();if(O<=0)return;const E=(u()+P+O)%O;s("index",E);const T=a[E];if(T){if(i==="highlights"){if(!C(a,E)){i="overlay",L({reset:!0,scroll:!0});return}_(T);return}Z0(),b(),_(T),k()}},D={element:e.wrapper,isOpen:()=>l(),next:A,open:I,close:S};return dn(()=>{i=VJ()?"highlights":"overlay",cxe(),kz.add(D),Ns||(Ns=D),me(()=>{kz.delete(D),Zi===D&&(Zi=void 0,Z0()),Ns===D&&(Ns=void 0)})}),he(()=>{if(!l())return;const P=()=>w();requestAnimationFrame(P),window.addEventListener("resize",P,{passive:!0});const O=e.wrapper();if(!O)return;const E=BJ(O)??O,T=typeof ResizeObserver>"u"?void 0:new ResizeObserver(()=>P());T?.observe(E),me(()=>{window.removeEventListener("resize",P),T?.disconnect()})}),me(()=>{g(),y(),Zi===D&&(Zi=void 0,Z0())}),{open:l,query:c,count:h,index:u,pos:m,setInput:P=>{t=P},setQuery:P=>{s("query",P),s("index",0),L({reset:!0,scroll:!0})},focus:I,close:S,next:A,refresh:P=>L(P),onPointerDown:()=>{Ns=D,e.wrapper()?.focus({preventScroll:!0})},onFocus:()=>{Ns=D},onInputKeyDown:P=>{if(P.key==="Escape"){P.preventDefault(),S();return}P.key==="Enter"&&(P.preventDefault(),A(P.shiftKey?-1:1))}}}function uxe(){return{token:0}}function Kp(e){e.observer?.disconnect(),e.observer=void 0}function qse(e){if(!e)return;const t=e.querySelector("diffs-container");if(t instanceof HTMLElement)return t}function hxe(e){return qse(e)?.shadowRoot??void 0}function uB(e){if(!e||typeof document>"u")return;const t=document.documentElement.dataset.colorScheme;if(t==="dark"||t==="light"){e.dataset.colorScheme=t;return}e.removeAttribute("data-color-scheme")}function fxe(e){if(typeof document>"u")return()=>{};if(uB(e()),typeof MutationObserver>"u")return()=>{};const t=document.documentElement,n=new MutationObserver(()=>uB(e()));return n.observe(t,{attributes:!0,attributeFilter:["data-color-scheme"]}),()=>n.disconnect()}function pxe(e){Kp(e.state),e.state.token+=1;const t=e.state.token,n=Math.max(0,e.settleFrames??0),r=()=>{const o=s=>{if(t===e.state.token){if(s<=0){e.onReady();return}requestAnimationFrame(()=>o(s-1))}};requestAnimationFrame(()=>o(n))},i=o=>{if(e.isReady(o)){r();return}typeof MutationObserver>"u"||(Kp(e.state),e.state.observer=new MutationObserver(()=>{t===e.state.token&&e.isReady(o)&&(Kp(e.state),r())}),e.state.observer.observe(o,{childList:!0,subtree:!0}))},a=e.getRoot();if(!a){if(typeof MutationObserver>"u")return;e.state.observer=new MutationObserver(()=>{if(t!==e.state.token)return;const o=e.getRoot();o&&i(o)}),e.state.observer.observe(e.container,{childList:!0,subtree:!0});return}i(a)}function UJt(e,t){const n=Math.min(e.start,e.end),r=Math.max(e.start,e.end);return n===r?t("ui.sessionReview.selection.line",{line:n}):t("ui.sessionReview.selection.lines",{start:n,end:r})}function WJt(e,t){const n=Math.max(1,Math.min(t.start,t.end)),r=Math.max(t.start,t.end),i=e.split(`
|
|
2418
2418
|
`).slice(n-1,r);if(i.length!==0)return i.slice(0,2).join(`
|
|
2419
|
-
`)}function UJt(e){const t={start:e.start,end:e.end};return e.side&&(t.side=e.side),e.endSide&&(t.endSide=e.endSide),t}function WJt(e,t,n){if(!e)return!1;const r=Math.min(e.start,e.end),i=Math.max(e.start,e.end);if(t<r||t>i)return!1;if(!n)return!0;const a=e.side,o=e.endSide??a;return!a&&!o?!0:!a||!o?(a??o)===n:a===o||t===r?a===n:t===i?o===n:!0}function mxe(e){return e?e.start===e.end&&(e.endSide==null||e.endSide===e.side):!1}function gxe(e){if(e instanceof Range)return e;const t=new Range;return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),t}function jse(e,t){!e||!t||requestAnimationFrame(()=>{const n=e.getSelection?.()??window.getSelection();if(n)try{n.removeAllRanges(),n.addRange(t)}catch{}})}function yxe(){let e="none",t,n=!1,r=!1;const i=()=>{e="none",t=void 0,n=!1};return{begin(a,o){if(!a){e="text";return}e="numbers",t=o,n=!1},track(a,o){return e!=="numbers"?!1:(a&1)===0?(i(),!0):(o!==void 0&&t!==void 0&&o!==t&&(n=!0),!0)},finish(){const a=e;return r=a==="numbers"&&n,i(),a},consume(a){const o=r&&!mxe(a);return r=!1,o},reset(){r=!1,i()}}}function Vq(e){if(e)return e instanceof HTMLElement?e:e.parentElement??void 0}function vxe(e){const t=Vq(e);if(!t)return;const n=t.closest("[data-line]");if(!(n instanceof HTMLElement))return;const r=parseInt(n.dataset.line??"",10);if(!Number.isNaN(r))return r}function UJ(e){const t=Vq(e);if(!t)return;const n=t.closest("[data-line], [data-alt-line]");if(!(n instanceof HTMLElement))return;const r=parseInt(n.dataset.line??"",10);if(!Number.isNaN(r))return r;const i=parseInt(n.dataset.altLine??"",10);if(!Number.isNaN(i))return i}function kxe(e){const t=Vq(e);if(!t)return;const n=t.closest("[data-code]");if(n instanceof HTMLElement)return n.hasAttribute("data-deletions")?"deletions":"additions"}function Hse(e){const t=e.root.getSelection?.()??window.getSelection();if(!t||t.isCollapsed)return;const n=t.getComposedRanges?.({shadowRoots:[e.root]})?.[0]??(t.rangeCount>0?t.getRangeAt(0):void 0),r=n?.startContainer??t.anchorNode,i=n?.endContainer??t.focusNode;if(!r||!i||!e.root.contains(r)||!e.root.contains(i))return;const a=e.lineForNode(r),o=e.lineForNode(i);if(a===void 0||o===void 0)return;const s=e.sideForNode?.(r),l=e.sideForNode?.(i),c=s??l,u={start:a,end:o};return c&&(u.side=c),l&&c&&l!==c&&(u.endSide=l),{range:u,text:e.preserveTextSelection&&n?gxe(n).cloneRange():void 0}}const yg=new WeakMap,bxe={lineHeight:24,hunkSeparatorHeight:24,fileGap:0};function wxe(e){return e==="auto"||e==="scroll"||e==="overlay"}function WJ(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t);if(wxe(n.overflowY))return t;t=t.parentElement}}function xxe(e){if(typeof document>"u")return;const t=e.closest("[data-component='session-review']");if(t instanceof HTMLElement){const r=WJ(e)??t,i=t.querySelector("[data-slot='session-review-container']");return{key:t,root:r,content:i instanceof HTMLElement?i:void 0}}const n=WJ(e);if(n){const r=n.querySelector("[role='log']");return{key:n,root:n,content:r instanceof HTMLElement?r:void 0}}return{key:document,root:document,content:void 0}}function _xe(e){const t=xxe(e);if(!t)return;let n=yg.get(t.key);if(!n){const i=new Eoe;i.setup(t.root,t.content),n={virtualizer:i,refs:0},yg.set(t.key,n)}n.refs+=1;let r=!1;return{virtualizer:n.virtualizer,release(){if(r)return;r=!0;const i=yg.get(t.key);i&&(i.refs-=1,!(i.refs>0)&&(i.virtualizer.cleanUp(),yg.delete(t.key)))}}}function Fse(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function GJt(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Ap={exports:{}},Mxe=Ap.exports,GJ;function Sxe(){return GJ||(GJ=1,(function(e,t){(function(n,r){r(t)})(Mxe,function(n){const r=Symbol("newer"),i=Symbol("older");class a{constructor(h,m){typeof h!="number"&&(m=h,h=0),this.size=0,this.limit=h,this.oldest=this.newest=void 0,this._keymap=new Map,m&&(this.assign(m),h<1&&(this.limit=this.size))}_markEntryAsUsed(h){h!==this.newest&&(h[r]&&(h===this.oldest&&(this.oldest=h[r]),h[r][i]=h[i]),h[i]&&(h[i][r]=h[r]),h[r]=void 0,h[i]=this.newest,this.newest&&(this.newest[r]=h),this.newest=h)}assign(h){let m,g=this.limit||Number.MAX_VALUE;this._keymap.clear();let y=h[Symbol.iterator]();for(let v=y.next();!v.done;v=y.next()){let k=new o(v.value[0],v.value[1]);if(this._keymap.set(k.key,k),m?(m[r]=k,k[i]=m):this.oldest=k,m=k,g--==0)throw new Error("overflow")}this.newest=m,this.size=this._keymap.size}get(h){var m=this._keymap.get(h);return m?(this._markEntryAsUsed(m),m.value):void 0}set(h,m){var g=this._keymap.get(h);return g?(g.value=m,this._markEntryAsUsed(g),this):(this._keymap.set(h,g=new o(h,m)),this.newest?(this.newest[r]=g,g[i]=this.newest):this.oldest=g,this.newest=g,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var h=this.oldest;if(h)return this.oldest[r]?(this.oldest=this.oldest[r],this.oldest[i]=void 0):(this.oldest=void 0,this.newest=void 0),h[r]=h[i]=void 0,this._keymap.delete(h.key),--this.size,[h.key,h.value]}find(h){let m=this._keymap.get(h);return m?m.value:void 0}has(h){return this._keymap.has(h)}delete(h){var m=this._keymap.get(h);return m?(this._keymap.delete(m.key),m[r]&&m[i]?(m[i][r]=m[r],m[r][i]=m[i]):m[r]?(m[r][i]=void 0,this.oldest=m[r]):m[i]?(m[i][r]=void 0,this.newest=m[i]):this.oldest=this.newest=void 0,this.size--,m.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new l(this.oldest)}values(){return new c(this.oldest)}entries(){return this}[Symbol.iterator](){return new s(this.oldest)}forEach(h,m){typeof m!="object"&&(m=this);let g=this.oldest;for(;g;)h.call(m,g.value,g.key,this),g=g[r]}toJSON(){for(var h=new Array(this.size),m=0,g=this.oldest;g;)h[m++]={key:g.key,value:g.value},g=g[r];return h}toString(){for(var h="",m=this.oldest;m;)h+=String(m.key)+":"+m.value,m=m[r],m&&(h+=" < ");return h}}n.LRUMap=a;function o(u,h){this.key=u,this.value=h,this[r]=void 0,this[i]=void 0}function s(u){this.entry=u}s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:[u.key,u.value]}):{done:!0,value:void 0}};function l(u){this.entry=u}l.prototype[Symbol.iterator]=function(){return this},l.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:u.key}):{done:!0,value:void 0}};function c(u){this.entry=u}c.prototype[Symbol.iterator]=function(){return this},c.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:u.value}):{done:!0,value:void 0}}})})(Ap,Ap.exports)),Ap.exports}var Cxe=Sxe();const ZJ=Fse(Cxe),YH=Symbol("IGNORE_RESPONSE");var Lxe=class{highlighter;preferredHighlighter;renderOptions;initialized=!1;workers=[];taskQueue=new Map;pendingTasks=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;instanceRequestMap=new Map;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;constructor(e,{langs:t,theme:n=qr,lineDiffType:r="word-alt",tokenizeMaxLineLength:i=1e3,preferredHighlighter:a="shiki-js"}){this.options=e,this.preferredHighlighter=a,this.renderOptions={theme:n,lineDiffType:r,tokenizeMaxLineLength:i},this.fileCache=new ZJ.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new ZJ.LRUMap(e.totalASTLRUCacheSize??100),this.initialize(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=qr,lineDiffType:t="word-alt",tokenizeMaxLineLength:n=1e3}){const r={theme:e,lineDiffType:t,tokenizeMaxLineLength:n};this.isInitialized()||await this.initialize();const i=HW(r.theme,this.renderOptions.theme);if(i&&r.lineDiffType===this.renderOptions.lineDiffType&&r.tokenizeMaxLineLength===this.renderOptions.tokenizeMaxLineLength)return;const a=m2(e);let o=[];if(i||(XV(a)?o=IJ(a):o=await NJ(a)),this.highlighter!=null)KV(o,this.highlighter),await this.setRenderOptionsOnWorkers(r,o);else{const[s]=await Promise.all([Vh({themes:a,langs:["text"],preferredHighlighter:this.preferredHighlighter}),this.setRenderOptionsOnWorkers(r,o)]);this.highlighter=s}this.renderOptions=r,this.diffCache.clear(),this.fileCache.clear();for(const s of this.themeSubscribers)s.rerender()}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t}=this.renderOptions;return{theme:t,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const n=[];for(const r of this.workers){if(!r.initialized)throw console.log({managedWorker:r}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((i,a)=>{const o=this.generateRequestId(),s={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:e,resolvedThemes:t},resolve:i,reject:a,requestStart:Date.now()};this.pendingTasks.set(o,s),r.worker.postMessage(s.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const e=this.getStats();for(const t of this.statSubscribers)t(e)};cleanUpPendingTasks(e){this.taskQueue.delete(e);const t=this.instanceRequestMap.get(e);t!=null&&(this.pendingTasks.delete(t),this.instanceRequestMap.delete(e)),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1)this.initialized=new Promise((t,n)=>{(async()=>{try{const r=m2(this.renderOptions.theme);let i=[];XV(r)?i=IJ(r):i=await NJ(r);let a=[];CJ(e)?a=SJ(e):a=await LJ(e);const[o]=await Promise.all([Vh({themes:r,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(i,a)]);if(this.initialized===!1)throw this.terminateWorkers(),new Error("WorkerPoolManager: workers failed to initialize");this.highlighter=o,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),t()}catch(r){this.initialized=!1,this.workersFailed=!0,this.queueBroadcastStateChanges(),n(r)}})()}),this.queueBroadcastStateChanges();else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const n=[];this.workers.length>0&&this.terminateWorkers();for(let r=0;r<(this.options.poolSize??8);r++){const i=this.options.workerFactory(),a={worker:i,request_id:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:o})=>o)])};i.addEventListener("message",o=>{this.handleWorkerMessage(a,o.data)}),i.addEventListener("error",o=>console.error("Worker error:",o,a)),this.workers.push(a),n.push(new Promise((o,s)=>{const l=this.generateRequestId(),c={type:"initialize",id:l,request:{type:"initialize",id:l,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t},resolve(){a.initialized=!0,o()},reject:s,requestStart:Date.now()};this.pendingTasks.set(l,c),this.executeTask(a,c)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.taskQueue.size===0)){for(const[e,t]of this.taskQueue){if(this.instanceRequestMap.has(e))continue;const n=KJ(t),r=this.getAvailableWorker(n);if(r==null)break;this.assignWorkerToTask(t,r),this.resolveLanguagesAndExecuteTask(r,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){if((t.lang??na(t.name))!=="text"){for(const n of[this.taskQueue,this.pendingTasks.values()])for(const r of n)if("instance"in r&&r.instance===e&&r.request.type==="file"&&cz(t,r.request.file))return;this.submitTask(e,{type:"file",file:t})}}getPlainFileAST(e,t,n,r){if(this.highlighter==null){this.initialize();return}return goe(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){if((t.lang??na(t.name))!=="text"){for(const n of[this.taskQueue,this.pendingTasks.values()])for(const r of n)if("instance"in r&&r.instance===e&&r.request.type==="diff"&&r.request.diff===t)return;this.submitTask(e,{type:"diff",diff:t})}}getPlainDiffAST(e,t,n,r,i){return this.highlighter!=null?Noe(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:r,collapsedContextThreshold:i}):void 0}terminate(){this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.instanceRequestMap.clear(),this.taskQueue.clear(),this.pendingTasks.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.request_id!=null).length,queuedTasks:this.taskQueue.size,pendingTasks:this.pendingTasks.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.initialize();const n=this.generateRequestId(),r=Date.now(),i=(()=>{switch(t.type){case"file":return{type:"file",id:n,request:{...t,id:n},instance:e,requestStart:r};case"diff":return{type:"diff",id:n,request:{...t,id:n},instance:e,requestStart:r}}})();this.taskQueue.set(e,i),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{const r=n.filter(i=>!e.langs.has(i));r.length>0&&(CJ(r)?t.request.resolvedLanguages=SJ(r):t.request.resolvedLanguages=await LJ(r)),this.executeTask(e,t)}catch{this.cleanWorkerAndTask(e,t)}}handleWorkerMessage(e,t){const n=this.pendingTasks.get(t.id);try{if(n==null)throw YH;if(t.type==="error"){const r=new Error(t.error);throw t.stack&&(r.stack=t.stack),"reject"in n?n.reject(r):n.instance.onHighlightError(r),r}else{if("instance"in n&&this.instanceRequestMap.get(n.instance)!==t.id)throw YH;switch(t.requestType){case"initialize":if(n.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"set-render-options":if(n.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"file":{if(n.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:i}=t,{instance:a,request:o}=n;o.file.cacheKey!=null&&this.fileCache.set(o.file.cacheKey,{result:r,options:i}),a.onHighlightSuccess(o.file,r,i);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:i}=t,{instance:a,request:o}=n;o.diff.cacheKey!=null&&this.diffCache.set(o.diff.cacheKey,{result:r,options:i}),a.onHighlightSuccess(o.diff,r,i);break}}}}catch(r){r!==YH&&console.error(r,n,t)}this.cleanWorkerAndTask(e,n),this.queueBroadcastStateChanges(),this.taskQueue.size>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.request_id=e.id,"instance"in e&&(this.taskQueue.delete(e.instance),this.instanceRequestMap.set(e.instance,e.id)),this.pendingTasks.set(e.id,e)}cleanWorkerAndTask(e,t){e.request_id=void 0,t!=null&&("instance"in t&&this.instanceRequestMap.delete(t.instance),this.pendingTasks.delete(t.id))}executeTask(e,t){this.assignWorkerToTask(t,e);for(const n of KJ(t))e.langs.add(n);try{e.worker.postMessage(t.request)}catch(n){this.cleanWorkerAndTask(e,t),console.error("Failed to post message to worker:",n),"instance"in t?t.instance.onHighlightError(n):"reject"in t&&t.reject(n)}this.queueBroadcastStateChanges()}getAvailableWorker(e){let t;for(const n of this.workers){if(n.request_id!=null||!n.initialized)continue;if(t=n,e.length===0)break;let r=!0;for(const i of e)if(!n.langs.has(i)){r=!1;break}if(r)break}return t}generateRequestId(){return`req_${++this.nextRequestId}`}};function KJ(e){const t=new Set;if(e.type==="initialize"||e.type==="set-render-options")return[];switch(e.type){case"file":t.add(e.request.file.lang??na(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??na(e.request.diff.name)),t.add(e.request.diff.lang??na(e.request.diff.prevName??"-"));break}return t.delete("text"),Array.from(t)}const Ixe="/assets/worker-BDowWIry.js";function Nxe(){return new Worker(Ixe,{type:"module"})}function XJ(e){const t=new Lxe({workerFactory:Nxe,poolSize:2},{theme:"OpenCode",lineDiffType:e,preferredHighlighter:"shiki-wasm"});return t.initialize(),t}let JH,QH;function hB(e){if(!(typeof window>"u"))return e==="split"?(QH||(QH=XJ("word-alt")),QH):(JH||(JH=XJ("none")),JH)}const Axe=new Set(["png","jpg","jpeg","gif","webp","avif","bmp","ico","tif","tiff","heic"]),$xe=new Set(["mp3","wav","ogg","m4a","aac","flac","opus"]),Txe=new Set(["ttf","otf","woff","woff2"]);function Bq(e){if(!(!e||typeof e!="object"))return e}function iG(e){if(!e)return;const t=e.split(";",1)[0]?.trim().toLowerCase();if(t)return t==="audio/x-aac"?"audio/aac":t==="audio/x-m4a"?"audio/mp4":t}function Exe(e){if(!e)return"";const t=e.lastIndexOf(".");return t===-1?"":e.slice(t+1).toLowerCase()}function Pxe(e){const t=Exe(e);if(t==="svg")return"svg";if(t==="pdf")return"pdf";if(Axe.has(t))return"image";if($xe.has(t))return"audio";if(Txe.has(t))return"font"}function YJ(e){return Bq(e)?.type==="binary"}function Dxe(e,t){if(t==="svg")return e.startsWith("data:image/svg+xml")?e:void 0;if(t==="image")return e.startsWith("data:image/")?e:void 0;if(t==="pdf")return e.startsWith("data:application/pdf")?e:void 0;if(t==="font")return e.startsWith("data:font/")?e:void 0;if(e.startsWith("data:audio/x-aac;"))return e.replace("data:audio/x-aac;","data:audio/aac;");if(e.startsWith("data:audio/x-m4a;"))return e.replace("data:audio/x-m4a;","data:audio/mp4;");if(e.startsWith("data:audio/"))return e}function eF(e,t){if(!e)return;if(typeof e=="string")return Dxe(e,t);const n=Bq(e);if(!n||typeof n.content!="string")return;const r=iG(typeof n.mimeType=="string"?n.mimeType:void 0);if(r){if(t==="svg")return r!=="image/svg+xml"?void 0:n.encoding==="base64"?`data:image/svg+xml;base64,${n.content}`:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n.content)}`;if(!(t==="image"&&!r.startsWith("image/"))&&!(t==="audio"&&!r.startsWith("audio/"))&&!(t==="pdf"&&r!=="application/pdf")&&!(t==="font"&&!r.startsWith("font/"))&&n.encoding==="base64")return`data:${r};base64,${n.content}`}}function Oxe(e){if(typeof atob=="function")try{const t=atob(e),n=Uint8Array.from(t,r=>r.charCodeAt(0));return typeof TextDecoder=="function"?new TextDecoder().decode(n):t}catch{}}function Rxe(e){const t=Bq(e);if(!(!t||typeof t.content!="string"||iG(typeof t.mimeType=="string"?t.mimeType:void 0)!=="image/svg+xml"))return t.encoding==="base64"?Oxe(t.content):t.content}function tF(e){if(typeof e=="string")return e.length>0;const t=Bq(e);return t?typeof t.content=="string"&&t.content.length>0:!1}var zxe=ie('<div class="flex min-h-56 flex-col items-center justify-center gap-2 px-6 py-10 text-center"><div class="text-14-semibold text-text-strong"></div><div class="text-14-regular text-text-weak">'),K0=ie('<div class="flex min-h-40 items-center justify-center px-6 py-4 text-center text-text-weak">'),qxe=ie('<div class="flex justify-center bg-background-stronger px-6 py-4"><img class="max-h-[60vh] max-w-full rounded border border-border-weak-base bg-background-base object-contain">'),jxe=ie('<div class="flex justify-center bg-background-stronger px-6 py-4"><audio class="w-full max-w-xl"controls preload=metadata><source>'),Hxe=ie('<div class="flex h-full min-h-[70vh] flex-col bg-background-stronger"><iframe class="h-full min-h-[70vh] w-full border-0">'),Fxe=ie('<div class="flex flex-col items-center gap-6 bg-background-stronger px-6 py-8"><div class="text-14-regular text-text-weak"></div><div class="text-center text-5xl leading-tight text-text-strong">ABCDEFGHIJKLM<br>NOPQRSTUVWXYZ<br>abcdefghijklm<br>nopqrstuvwxyz<br>0123456789</div><div class="max-w-lg text-center text-lg leading-relaxed text-text-dimmed">The quick brown fox jumps over the lazy dog.'),Vxe=ie('<div class="flex flex-col gap-4 px-6 py-4">'),Bxe=ie('<div class="flex justify-center"><img class="max-h-[60vh] max-w-full rounded border border-border-weak-base bg-background-base object-contain">');function Uxe(e,t){return e.current!==void 0?e.current:e.after??e.before}function JJ(e){const t=M0(),n=()=>e.media,r=Z(()=>{const M=n();if(!(!M||M.mode==="off"))return Pxe(M.path)}),i=Z(()=>{const M=n();return!M||M.mode==="off"||r()?!1:YJ(M.current)}),a=()=>e.media?.onLoad?.(),o=Z(()=>{const M=n(),_=r();return!M||!_||_==="svg"||M.current!==void 0?!1:!tF(M.after)&&tF(M.before)}),s=new Set(["image","audio","pdf","font"]),l=M=>s.has(M),c=Z(()=>{const M=n(),_=r();if(!(!M||!l(_)))return eF(Uxe(M,_==="pdf"||_==="font"?"image":_),_)}),u=Z(()=>{const M=n(),_=r();if(!(!M||!l(_))&&!(M.current!==void 0&&!YJ(M.current))&&!o()&&!c()&&!(!M.path||!M.readFile))return{key:`${_}:${M.path}`,kind:_,path:M.path,readFile:M.readFile,onError:M.onError}}),[h]=Yr(u,async M=>M.readFile(M.path).then(_=>{const C=eF(_,M.kind);return C?{key:M.key,src:C,mime:M.kind==="audio"?iG(_?.mimeType):void 0}:(M.onError?.({kind:M.kind}),{key:M.key,error:!0})},()=>(M.onError?.({kind:M.kind}),{key:M.key,error:!0}))),m=Z(()=>{const M=u(),_=h();if(!(!M||!_||_.key!==M.key))return _}),g=Z(()=>{const M=m();return c()??(M&&"src"in M?M.src:void 0)}),y=Z(()=>c()?"ready":u()?h.loading?"loading":m()?.error?"error":g()?"ready":"idle":"idle"),v=Z(()=>{const M=m();return M&&"mime"in M?M.mime:void 0}),k=Z(()=>{const M=n();if(!(!M||r()!=="svg"))return Rxe(M.current)}),b=Z(()=>{const M=n();if(!(!M||r()!=="svg"))return eF(M.current,"svg")}),x=Z(()=>{const M=n();if(!(!M||r()!=="svg")&&k()===void 0&&tF(M.current))return[M.path,M.current]});he(vn(x,M=>{M&&n()?.onError?.({kind:"svg"})},{defer:!0}));const w=M=>t.t(M==="image"?"ui.fileMedia.kind.image":"ui.fileMedia.kind.audio");return d(r0,{get children(){return[d(Zn,{get when(){return r()==="image"||r()==="audio"},get children(){return d(ke,{get when(){return g()},get fallback(){const M=n(),_=r();if(!M||_!=="image"&&_!=="audio")return e.fallback();const C=w(_);return o()?(()=>{var L=K0();return K(L,()=>t.t("ui.fileMedia.state.removed",{kind:C})),L})():y()==="loading"?(()=>{var L=K0();return K(L,()=>t.t("ui.fileMedia.state.loading",{kind:C})),L})():y()==="error"?(()=>{var L=K0();return K(L,()=>t.t("ui.fileMedia.state.error",{kind:C})),L})():(()=>{var L=K0();return K(L,()=>t.t("ui.fileMedia.state.unavailable",{kind:C})),L})()},children:M=>{const _=r();return _!=="image"&&_!=="audio"?e.fallback():_==="image"?(()=>{var C=qxe(),L=C.firstChild;return L.addEventListener("load",a),Qe(S=>{var I=M(),A=n()?.path;return I!==S.e&>(L,"src",S.e=I),A!==S.t&>(L,"alt",S.t=A),S},{e:void 0,t:void 0}),C})():(()=>{var C=jxe(),L=C.firstChild,S=L.firstChild;return L.addEventListener("loadedmetadata",a),Qe(I=>{var A=M(),D=v();return A!==I.e&>(S,"src",I.e=A),D!==I.t&>(S,"type",I.t=D),I},{e:void 0,t:void 0}),C})()}})}}),d(Zn,{get when(){return r()==="pdf"},get children(){return(()=>{const M=Z(_=>{const C=g();if(_&&URL.revokeObjectURL(_),!C)return;const L=C.match(/^data:([^;]+);base64,(.*)$/);if(!L)return;const S=Uint8Array.from(atob(L[2]),I=>I.charCodeAt(0));return URL.createObjectURL(new Blob([S],{type:L[1]}))});return me(()=>{const _=M();_&&URL.revokeObjectURL(_)}),d(ke,{get when(){return M()},get fallback(){return(()=>{var _=K0();return K(_,()=>y()==="loading"?"Loading PDF…":"PDF preview unavailable"),_})()},children:_=>(()=>{var C=Hxe(),L=C.firstChild;return L.addEventListener("load",a),Qe(S=>{var I=_(),A=n()?.path??"PDF";return I!==S.e&>(L,"src",S.e=I),A!==S.t&>(L,"title",S.t=A),S},{e:void 0,t:void 0}),C})()})})()}}),d(Zn,{get when(){return r()==="font"},get children(){return(()=>{const M=g();if(!M)return(()=>{var L=K0();return K(L,()=>y()==="loading"?"Loading font…":"Font preview unavailable"),L})();const _=`preview-${Date.now()}`,C=document.createElement("style");return C.textContent=`@font-face { font-family: '${_}'; src: url('${M}'); }`,document.head.appendChild(C),me(()=>C.remove()),(()=>{var L=Fxe(),S=L.firstChild,I=S.nextSibling,A=I.nextSibling;return K(S,()=>n()?.path?.split("/").pop()),kr(I,"font-family",`'${_}'`),kr(A,"font-family",`'${_}'`),L})()})()}}),d(Zn,{get when(){return r()==="svg"},get children(){return k()===void 0&&b()==null?e.fallback():(()=>{var M=Vxe();return K(M,d(ke,{get when(){return k()!==void 0},get children(){return e.fallback()}}),null),K(M,d(ke,{get when(){return b()},children:_=>(()=>{var C=Bxe(),L=C.firstChild;return L.addEventListener("load",a),Qe(S=>{var I=_(),A=n()?.path;return I!==S.e&>(L,"src",S.e=I),A!==S.t&>(L,"alt",S.t=A),S},{e:void 0,t:void 0}),C})()}),null),M})()}}),d(Zn,{get when(){return i()},get children(){var M=zxe(),_=M.firstChild,C=_.nextSibling;return K(_,()=>n()?.path?.split("/").pop()??t.t("ui.fileMedia.binary.title")),K(C,()=>{const L=n()?.path;return L?t.t("ui.fileMedia.binary.description.path",{path:L}):t.t("ui.fileMedia.binary.description.default")}),M}}),d(Zn,{when:!0,get children(){return e.fallback()}})]}})}/**
|
|
2419
|
+
`)}function GJt(e){const t={start:e.start,end:e.end};return e.side&&(t.side=e.side),e.endSide&&(t.endSide=e.endSide),t}function ZJt(e,t,n){if(!e)return!1;const r=Math.min(e.start,e.end),i=Math.max(e.start,e.end);if(t<r||t>i)return!1;if(!n)return!0;const a=e.side,o=e.endSide??a;return!a&&!o?!0:!a||!o?(a??o)===n:a===o||t===r?a===n:t===i?o===n:!0}function mxe(e){return e?e.start===e.end&&(e.endSide==null||e.endSide===e.side):!1}function gxe(e){if(e instanceof Range)return e;const t=new Range;return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),t}function jse(e,t){!e||!t||requestAnimationFrame(()=>{const n=e.getSelection?.()??window.getSelection();if(n)try{n.removeAllRanges(),n.addRange(t)}catch{}})}function yxe(){let e="none",t,n=!1,r=!1;const i=()=>{e="none",t=void 0,n=!1};return{begin(a,o){if(!a){e="text";return}e="numbers",t=o,n=!1},track(a,o){return e!=="numbers"?!1:(a&1)===0?(i(),!0):(o!==void 0&&t!==void 0&&o!==t&&(n=!0),!0)},finish(){const a=e;return r=a==="numbers"&&n,i(),a},consume(a){const o=r&&!mxe(a);return r=!1,o},reset(){r=!1,i()}}}function Vq(e){if(e)return e instanceof HTMLElement?e:e.parentElement??void 0}function vxe(e){const t=Vq(e);if(!t)return;const n=t.closest("[data-line]");if(!(n instanceof HTMLElement))return;const r=parseInt(n.dataset.line??"",10);if(!Number.isNaN(r))return r}function UJ(e){const t=Vq(e);if(!t)return;const n=t.closest("[data-line], [data-alt-line]");if(!(n instanceof HTMLElement))return;const r=parseInt(n.dataset.line??"",10);if(!Number.isNaN(r))return r;const i=parseInt(n.dataset.altLine??"",10);if(!Number.isNaN(i))return i}function kxe(e){const t=Vq(e);if(!t)return;const n=t.closest("[data-code]");if(n instanceof HTMLElement)return n.hasAttribute("data-deletions")?"deletions":"additions"}function Hse(e){const t=e.root.getSelection?.()??window.getSelection();if(!t||t.isCollapsed)return;const n=t.getComposedRanges?.({shadowRoots:[e.root]})?.[0]??(t.rangeCount>0?t.getRangeAt(0):void 0),r=n?.startContainer??t.anchorNode,i=n?.endContainer??t.focusNode;if(!r||!i||!e.root.contains(r)||!e.root.contains(i))return;const a=e.lineForNode(r),o=e.lineForNode(i);if(a===void 0||o===void 0)return;const s=e.sideForNode?.(r),l=e.sideForNode?.(i),c=s??l,u={start:a,end:o};return c&&(u.side=c),l&&c&&l!==c&&(u.endSide=l),{range:u,text:e.preserveTextSelection&&n?gxe(n).cloneRange():void 0}}const yg=new WeakMap,bxe={lineHeight:24,hunkSeparatorHeight:24,fileGap:0};function wxe(e){return e==="auto"||e==="scroll"||e==="overlay"}function WJ(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t);if(wxe(n.overflowY))return t;t=t.parentElement}}function xxe(e){if(typeof document>"u")return;const t=e.closest("[data-component='session-review']");if(t instanceof HTMLElement){const r=WJ(e)??t,i=t.querySelector("[data-slot='session-review-container']");return{key:t,root:r,content:i instanceof HTMLElement?i:void 0}}const n=WJ(e);if(n){const r=n.querySelector("[role='log']");return{key:n,root:n,content:r instanceof HTMLElement?r:void 0}}return{key:document,root:document,content:void 0}}function _xe(e){const t=xxe(e);if(!t)return;let n=yg.get(t.key);if(!n){const i=new Eoe;i.setup(t.root,t.content),n={virtualizer:i,refs:0},yg.set(t.key,n)}n.refs+=1;let r=!1;return{virtualizer:n.virtualizer,release(){if(r)return;r=!0;const i=yg.get(t.key);i&&(i.refs-=1,!(i.refs>0)&&(i.virtualizer.cleanUp(),yg.delete(t.key)))}}}function Fse(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function KJt(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Ap={exports:{}},Mxe=Ap.exports,GJ;function Sxe(){return GJ||(GJ=1,(function(e,t){(function(n,r){r(t)})(Mxe,function(n){const r=Symbol("newer"),i=Symbol("older");class a{constructor(h,m){typeof h!="number"&&(m=h,h=0),this.size=0,this.limit=h,this.oldest=this.newest=void 0,this._keymap=new Map,m&&(this.assign(m),h<1&&(this.limit=this.size))}_markEntryAsUsed(h){h!==this.newest&&(h[r]&&(h===this.oldest&&(this.oldest=h[r]),h[r][i]=h[i]),h[i]&&(h[i][r]=h[r]),h[r]=void 0,h[i]=this.newest,this.newest&&(this.newest[r]=h),this.newest=h)}assign(h){let m,g=this.limit||Number.MAX_VALUE;this._keymap.clear();let y=h[Symbol.iterator]();for(let v=y.next();!v.done;v=y.next()){let k=new o(v.value[0],v.value[1]);if(this._keymap.set(k.key,k),m?(m[r]=k,k[i]=m):this.oldest=k,m=k,g--==0)throw new Error("overflow")}this.newest=m,this.size=this._keymap.size}get(h){var m=this._keymap.get(h);return m?(this._markEntryAsUsed(m),m.value):void 0}set(h,m){var g=this._keymap.get(h);return g?(g.value=m,this._markEntryAsUsed(g),this):(this._keymap.set(h,g=new o(h,m)),this.newest?(this.newest[r]=g,g[i]=this.newest):this.oldest=g,this.newest=g,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var h=this.oldest;if(h)return this.oldest[r]?(this.oldest=this.oldest[r],this.oldest[i]=void 0):(this.oldest=void 0,this.newest=void 0),h[r]=h[i]=void 0,this._keymap.delete(h.key),--this.size,[h.key,h.value]}find(h){let m=this._keymap.get(h);return m?m.value:void 0}has(h){return this._keymap.has(h)}delete(h){var m=this._keymap.get(h);return m?(this._keymap.delete(m.key),m[r]&&m[i]?(m[i][r]=m[r],m[r][i]=m[i]):m[r]?(m[r][i]=void 0,this.oldest=m[r]):m[i]?(m[i][r]=void 0,this.newest=m[i]):this.oldest=this.newest=void 0,this.size--,m.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new l(this.oldest)}values(){return new c(this.oldest)}entries(){return this}[Symbol.iterator](){return new s(this.oldest)}forEach(h,m){typeof m!="object"&&(m=this);let g=this.oldest;for(;g;)h.call(m,g.value,g.key,this),g=g[r]}toJSON(){for(var h=new Array(this.size),m=0,g=this.oldest;g;)h[m++]={key:g.key,value:g.value},g=g[r];return h}toString(){for(var h="",m=this.oldest;m;)h+=String(m.key)+":"+m.value,m=m[r],m&&(h+=" < ");return h}}n.LRUMap=a;function o(u,h){this.key=u,this.value=h,this[r]=void 0,this[i]=void 0}function s(u){this.entry=u}s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:[u.key,u.value]}):{done:!0,value:void 0}};function l(u){this.entry=u}l.prototype[Symbol.iterator]=function(){return this},l.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:u.key}):{done:!0,value:void 0}};function c(u){this.entry=u}c.prototype[Symbol.iterator]=function(){return this},c.prototype.next=function(){let u=this.entry;return u?(this.entry=u[r],{done:!1,value:u.value}):{done:!0,value:void 0}}})})(Ap,Ap.exports)),Ap.exports}var Cxe=Sxe();const ZJ=Fse(Cxe),YH=Symbol("IGNORE_RESPONSE");var Lxe=class{highlighter;preferredHighlighter;renderOptions;initialized=!1;workers=[];taskQueue=new Map;pendingTasks=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;instanceRequestMap=new Map;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;constructor(e,{langs:t,theme:n=qr,lineDiffType:r="word-alt",tokenizeMaxLineLength:i=1e3,preferredHighlighter:a="shiki-js"}){this.options=e,this.preferredHighlighter=a,this.renderOptions={theme:n,lineDiffType:r,tokenizeMaxLineLength:i},this.fileCache=new ZJ.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new ZJ.LRUMap(e.totalASTLRUCacheSize??100),this.initialize(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=qr,lineDiffType:t="word-alt",tokenizeMaxLineLength:n=1e3}){const r={theme:e,lineDiffType:t,tokenizeMaxLineLength:n};this.isInitialized()||await this.initialize();const i=HW(r.theme,this.renderOptions.theme);if(i&&r.lineDiffType===this.renderOptions.lineDiffType&&r.tokenizeMaxLineLength===this.renderOptions.tokenizeMaxLineLength)return;const a=m2(e);let o=[];if(i||(XV(a)?o=IJ(a):o=await NJ(a)),this.highlighter!=null)KV(o,this.highlighter),await this.setRenderOptionsOnWorkers(r,o);else{const[s]=await Promise.all([Vh({themes:a,langs:["text"],preferredHighlighter:this.preferredHighlighter}),this.setRenderOptionsOnWorkers(r,o)]);this.highlighter=s}this.renderOptions=r,this.diffCache.clear(),this.fileCache.clear();for(const s of this.themeSubscribers)s.rerender()}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t}=this.renderOptions;return{theme:t,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const n=[];for(const r of this.workers){if(!r.initialized)throw console.log({managedWorker:r}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((i,a)=>{const o=this.generateRequestId(),s={type:"set-render-options",id:o,request:{type:"set-render-options",id:o,renderOptions:e,resolvedThemes:t},resolve:i,reject:a,requestStart:Date.now()};this.pendingTasks.set(o,s),r.worker.postMessage(s.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const e=this.getStats();for(const t of this.statSubscribers)t(e)};cleanUpPendingTasks(e){this.taskQueue.delete(e);const t=this.instanceRequestMap.get(e);t!=null&&(this.pendingTasks.delete(t),this.instanceRequestMap.delete(e)),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1)this.initialized=new Promise((t,n)=>{(async()=>{try{const r=m2(this.renderOptions.theme);let i=[];XV(r)?i=IJ(r):i=await NJ(r);let a=[];CJ(e)?a=SJ(e):a=await LJ(e);const[o]=await Promise.all([Vh({themes:r,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(i,a)]);if(this.initialized===!1)throw this.terminateWorkers(),new Error("WorkerPoolManager: workers failed to initialize");this.highlighter=o,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),t()}catch(r){this.initialized=!1,this.workersFailed=!0,this.queueBroadcastStateChanges(),n(r)}})()}),this.queueBroadcastStateChanges();else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const n=[];this.workers.length>0&&this.terminateWorkers();for(let r=0;r<(this.options.poolSize??8);r++){const i=this.options.workerFactory(),a={worker:i,request_id:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:o})=>o)])};i.addEventListener("message",o=>{this.handleWorkerMessage(a,o.data)}),i.addEventListener("error",o=>console.error("Worker error:",o,a)),this.workers.push(a),n.push(new Promise((o,s)=>{const l=this.generateRequestId(),c={type:"initialize",id:l,request:{type:"initialize",id:l,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t},resolve(){a.initialized=!0,o()},reject:s,requestStart:Date.now()};this.pendingTasks.set(l,c),this.executeTask(a,c)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.taskQueue.size===0)){for(const[e,t]of this.taskQueue){if(this.instanceRequestMap.has(e))continue;const n=KJ(t),r=this.getAvailableWorker(n);if(r==null)break;this.assignWorkerToTask(t,r),this.resolveLanguagesAndExecuteTask(r,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){if((t.lang??na(t.name))!=="text"){for(const n of[this.taskQueue,this.pendingTasks.values()])for(const r of n)if("instance"in r&&r.instance===e&&r.request.type==="file"&&cz(t,r.request.file))return;this.submitTask(e,{type:"file",file:t})}}getPlainFileAST(e,t,n,r){if(this.highlighter==null){this.initialize();return}return goe(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:r})}highlightDiffAST(e,t){if((t.lang??na(t.name))!=="text"){for(const n of[this.taskQueue,this.pendingTasks.values()])for(const r of n)if("instance"in r&&r.instance===e&&r.request.type==="diff"&&r.request.diff===t)return;this.submitTask(e,{type:"diff",diff:t})}}getPlainDiffAST(e,t,n,r,i){return this.highlighter!=null?Noe(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:r,collapsedContextThreshold:i}):void 0}terminate(){this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.instanceRequestMap.clear(),this.taskQueue.clear(),this.pendingTasks.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.request_id!=null).length,queuedTasks:this.taskQueue.size,pendingTasks:this.pendingTasks.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.initialize();const n=this.generateRequestId(),r=Date.now(),i=(()=>{switch(t.type){case"file":return{type:"file",id:n,request:{...t,id:n},instance:e,requestStart:r};case"diff":return{type:"diff",id:n,request:{...t,id:n},instance:e,requestStart:r}}})();this.taskQueue.set(e,i),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{const r=n.filter(i=>!e.langs.has(i));r.length>0&&(CJ(r)?t.request.resolvedLanguages=SJ(r):t.request.resolvedLanguages=await LJ(r)),this.executeTask(e,t)}catch{this.cleanWorkerAndTask(e,t)}}handleWorkerMessage(e,t){const n=this.pendingTasks.get(t.id);try{if(n==null)throw YH;if(t.type==="error"){const r=new Error(t.error);throw t.stack&&(r.stack=t.stack),"reject"in n?n.reject(r):n.instance.onHighlightError(r),r}else{if("instance"in n&&this.instanceRequestMap.get(n.instance)!==t.id)throw YH;switch(t.requestType){case"initialize":if(n.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"set-render-options":if(n.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"file":{if(n.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:i}=t,{instance:a,request:o}=n;o.file.cacheKey!=null&&this.fileCache.set(o.file.cacheKey,{result:r,options:i}),a.onHighlightSuccess(o.file,r,i);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:r,options:i}=t,{instance:a,request:o}=n;o.diff.cacheKey!=null&&this.diffCache.set(o.diff.cacheKey,{result:r,options:i}),a.onHighlightSuccess(o.diff,r,i);break}}}}catch(r){r!==YH&&console.error(r,n,t)}this.cleanWorkerAndTask(e,n),this.queueBroadcastStateChanges(),this.taskQueue.size>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.request_id=e.id,"instance"in e&&(this.taskQueue.delete(e.instance),this.instanceRequestMap.set(e.instance,e.id)),this.pendingTasks.set(e.id,e)}cleanWorkerAndTask(e,t){e.request_id=void 0,t!=null&&("instance"in t&&this.instanceRequestMap.delete(t.instance),this.pendingTasks.delete(t.id))}executeTask(e,t){this.assignWorkerToTask(t,e);for(const n of KJ(t))e.langs.add(n);try{e.worker.postMessage(t.request)}catch(n){this.cleanWorkerAndTask(e,t),console.error("Failed to post message to worker:",n),"instance"in t?t.instance.onHighlightError(n):"reject"in t&&t.reject(n)}this.queueBroadcastStateChanges()}getAvailableWorker(e){let t;for(const n of this.workers){if(n.request_id!=null||!n.initialized)continue;if(t=n,e.length===0)break;let r=!0;for(const i of e)if(!n.langs.has(i)){r=!1;break}if(r)break}return t}generateRequestId(){return`req_${++this.nextRequestId}`}};function KJ(e){const t=new Set;if(e.type==="initialize"||e.type==="set-render-options")return[];switch(e.type){case"file":t.add(e.request.file.lang??na(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??na(e.request.diff.name)),t.add(e.request.diff.lang??na(e.request.diff.prevName??"-"));break}return t.delete("text"),Array.from(t)}const Ixe="/assets/worker-BDowWIry.js";function Nxe(){return new Worker(Ixe,{type:"module"})}function XJ(e){const t=new Lxe({workerFactory:Nxe,poolSize:2},{theme:"OpenCode",lineDiffType:e,preferredHighlighter:"shiki-wasm"});return t.initialize(),t}let JH,QH;function hB(e){if(!(typeof window>"u"))return e==="split"?(QH||(QH=XJ("word-alt")),QH):(JH||(JH=XJ("none")),JH)}const Axe=new Set(["png","jpg","jpeg","gif","webp","avif","bmp","ico","tif","tiff","heic"]),$xe=new Set(["mp3","wav","ogg","m4a","aac","flac","opus"]),Txe=new Set(["ttf","otf","woff","woff2"]);function Bq(e){if(!(!e||typeof e!="object"))return e}function iG(e){if(!e)return;const t=e.split(";",1)[0]?.trim().toLowerCase();if(t)return t==="audio/x-aac"?"audio/aac":t==="audio/x-m4a"?"audio/mp4":t}function Exe(e){if(!e)return"";const t=e.lastIndexOf(".");return t===-1?"":e.slice(t+1).toLowerCase()}function Pxe(e){const t=Exe(e);if(t==="svg")return"svg";if(t==="pdf")return"pdf";if(Axe.has(t))return"image";if($xe.has(t))return"audio";if(Txe.has(t))return"font"}function YJ(e){return Bq(e)?.type==="binary"}function Dxe(e,t){if(t==="svg")return e.startsWith("data:image/svg+xml")?e:void 0;if(t==="image")return e.startsWith("data:image/")?e:void 0;if(t==="pdf")return e.startsWith("data:application/pdf")?e:void 0;if(t==="font")return e.startsWith("data:font/")?e:void 0;if(e.startsWith("data:audio/x-aac;"))return e.replace("data:audio/x-aac;","data:audio/aac;");if(e.startsWith("data:audio/x-m4a;"))return e.replace("data:audio/x-m4a;","data:audio/mp4;");if(e.startsWith("data:audio/"))return e}function eF(e,t){if(!e)return;if(typeof e=="string")return Dxe(e,t);const n=Bq(e);if(!n||typeof n.content!="string")return;const r=iG(typeof n.mimeType=="string"?n.mimeType:void 0);if(r){if(t==="svg")return r!=="image/svg+xml"?void 0:n.encoding==="base64"?`data:image/svg+xml;base64,${n.content}`:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n.content)}`;if(!(t==="image"&&!r.startsWith("image/"))&&!(t==="audio"&&!r.startsWith("audio/"))&&!(t==="pdf"&&r!=="application/pdf")&&!(t==="font"&&!r.startsWith("font/"))&&n.encoding==="base64")return`data:${r};base64,${n.content}`}}function Oxe(e){if(typeof atob=="function")try{const t=atob(e),n=Uint8Array.from(t,r=>r.charCodeAt(0));return typeof TextDecoder=="function"?new TextDecoder().decode(n):t}catch{}}function Rxe(e){const t=Bq(e);if(!(!t||typeof t.content!="string"||iG(typeof t.mimeType=="string"?t.mimeType:void 0)!=="image/svg+xml"))return t.encoding==="base64"?Oxe(t.content):t.content}function tF(e){if(typeof e=="string")return e.length>0;const t=Bq(e);return t?typeof t.content=="string"&&t.content.length>0:!1}var zxe=ie('<div class="flex min-h-56 flex-col items-center justify-center gap-2 px-6 py-10 text-center"><div class="text-14-semibold text-text-strong"></div><div class="text-14-regular text-text-weak">'),K0=ie('<div class="flex min-h-40 items-center justify-center px-6 py-4 text-center text-text-weak">'),qxe=ie('<div class="flex justify-center bg-background-stronger px-6 py-4"><img class="max-h-[60vh] max-w-full rounded border border-border-weak-base bg-background-base object-contain">'),jxe=ie('<div class="flex justify-center bg-background-stronger px-6 py-4"><audio class="w-full max-w-xl"controls preload=metadata><source>'),Hxe=ie('<div class="flex h-full min-h-[70vh] flex-col bg-background-stronger"><iframe class="h-full min-h-[70vh] w-full border-0">'),Fxe=ie('<div class="flex flex-col items-center gap-6 bg-background-stronger px-6 py-8"><div class="text-14-regular text-text-weak"></div><div class="text-center text-5xl leading-tight text-text-strong">ABCDEFGHIJKLM<br>NOPQRSTUVWXYZ<br>abcdefghijklm<br>nopqrstuvwxyz<br>0123456789</div><div class="max-w-lg text-center text-lg leading-relaxed text-text-dimmed">The quick brown fox jumps over the lazy dog.'),Vxe=ie('<div class="flex flex-col gap-4 px-6 py-4">'),Bxe=ie('<div class="flex justify-center"><img class="max-h-[60vh] max-w-full rounded border border-border-weak-base bg-background-base object-contain">');function Uxe(e,t){return e.current!==void 0?e.current:e.after??e.before}function JJ(e){const t=M0(),n=()=>e.media,r=Z(()=>{const M=n();if(!(!M||M.mode==="off"))return Pxe(M.path)}),i=Z(()=>{const M=n();return!M||M.mode==="off"||r()?!1:YJ(M.current)}),a=()=>e.media?.onLoad?.(),o=Z(()=>{const M=n(),_=r();return!M||!_||_==="svg"||M.current!==void 0?!1:!tF(M.after)&&tF(M.before)}),s=new Set(["image","audio","pdf","font"]),l=M=>s.has(M),c=Z(()=>{const M=n(),_=r();if(!(!M||!l(_)))return eF(Uxe(M,_==="pdf"||_==="font"?"image":_),_)}),u=Z(()=>{const M=n(),_=r();if(!(!M||!l(_))&&!(M.current!==void 0&&!YJ(M.current))&&!o()&&!c()&&!(!M.path||!M.readFile))return{key:`${_}:${M.path}`,kind:_,path:M.path,readFile:M.readFile,onError:M.onError}}),[h]=Yr(u,async M=>M.readFile(M.path).then(_=>{const C=eF(_,M.kind);return C?{key:M.key,src:C,mime:M.kind==="audio"?iG(_?.mimeType):void 0}:(M.onError?.({kind:M.kind}),{key:M.key,error:!0})},()=>(M.onError?.({kind:M.kind}),{key:M.key,error:!0}))),m=Z(()=>{const M=u(),_=h();if(!(!M||!_||_.key!==M.key))return _}),g=Z(()=>{const M=m();return c()??(M&&"src"in M?M.src:void 0)}),y=Z(()=>c()?"ready":u()?h.loading?"loading":m()?.error?"error":g()?"ready":"idle":"idle"),v=Z(()=>{const M=m();return M&&"mime"in M?M.mime:void 0}),k=Z(()=>{const M=n();if(!(!M||r()!=="svg"))return Rxe(M.current)}),b=Z(()=>{const M=n();if(!(!M||r()!=="svg"))return eF(M.current,"svg")}),x=Z(()=>{const M=n();if(!(!M||r()!=="svg")&&k()===void 0&&tF(M.current))return[M.path,M.current]});he(vn(x,M=>{M&&n()?.onError?.({kind:"svg"})},{defer:!0}));const w=M=>t.t(M==="image"?"ui.fileMedia.kind.image":"ui.fileMedia.kind.audio");return d(r0,{get children(){return[d(Zn,{get when(){return r()==="image"||r()==="audio"},get children(){return d(ke,{get when(){return g()},get fallback(){const M=n(),_=r();if(!M||_!=="image"&&_!=="audio")return e.fallback();const C=w(_);return o()?(()=>{var L=K0();return K(L,()=>t.t("ui.fileMedia.state.removed",{kind:C})),L})():y()==="loading"?(()=>{var L=K0();return K(L,()=>t.t("ui.fileMedia.state.loading",{kind:C})),L})():y()==="error"?(()=>{var L=K0();return K(L,()=>t.t("ui.fileMedia.state.error",{kind:C})),L})():(()=>{var L=K0();return K(L,()=>t.t("ui.fileMedia.state.unavailable",{kind:C})),L})()},children:M=>{const _=r();return _!=="image"&&_!=="audio"?e.fallback():_==="image"?(()=>{var C=qxe(),L=C.firstChild;return L.addEventListener("load",a),Qe(S=>{var I=M(),A=n()?.path;return I!==S.e&>(L,"src",S.e=I),A!==S.t&>(L,"alt",S.t=A),S},{e:void 0,t:void 0}),C})():(()=>{var C=jxe(),L=C.firstChild,S=L.firstChild;return L.addEventListener("loadedmetadata",a),Qe(I=>{var A=M(),D=v();return A!==I.e&>(S,"src",I.e=A),D!==I.t&>(S,"type",I.t=D),I},{e:void 0,t:void 0}),C})()}})}}),d(Zn,{get when(){return r()==="pdf"},get children(){return(()=>{const M=Z(_=>{const C=g();if(_&&URL.revokeObjectURL(_),!C)return;const L=C.match(/^data:([^;]+);base64,(.*)$/);if(!L)return;const S=Uint8Array.from(atob(L[2]),I=>I.charCodeAt(0));return URL.createObjectURL(new Blob([S],{type:L[1]}))});return me(()=>{const _=M();_&&URL.revokeObjectURL(_)}),d(ke,{get when(){return M()},get fallback(){return(()=>{var _=K0();return K(_,()=>y()==="loading"?"Loading PDF…":"PDF preview unavailable"),_})()},children:_=>(()=>{var C=Hxe(),L=C.firstChild;return L.addEventListener("load",a),Qe(S=>{var I=_(),A=n()?.path??"PDF";return I!==S.e&>(L,"src",S.e=I),A!==S.t&>(L,"title",S.t=A),S},{e:void 0,t:void 0}),C})()})})()}}),d(Zn,{get when(){return r()==="font"},get children(){return(()=>{const M=g();if(!M)return(()=>{var L=K0();return K(L,()=>y()==="loading"?"Loading font…":"Font preview unavailable"),L})();const _=`preview-${Date.now()}`,C=document.createElement("style");return C.textContent=`@font-face { font-family: '${_}'; src: url('${M}'); }`,document.head.appendChild(C),me(()=>C.remove()),(()=>{var L=Fxe(),S=L.firstChild,I=S.nextSibling,A=I.nextSibling;return K(S,()=>n()?.path?.split("/").pop()),kr(I,"font-family",`'${_}'`),kr(A,"font-family",`'${_}'`),L})()})()}}),d(Zn,{get when(){return r()==="svg"},get children(){return k()===void 0&&b()==null?e.fallback():(()=>{var M=Vxe();return K(M,d(ke,{get when(){return k()!==void 0},get children(){return e.fallback()}}),null),K(M,d(ke,{get when(){return b()},children:_=>(()=>{var C=Bxe(),L=C.firstChild;return L.addEventListener("load",a),Qe(S=>{var I=_(),A=n()?.path;return I!==S.e&>(L,"src",S.e=I),A!==S.t&>(L,"alt",S.t=A),S},{e:void 0,t:void 0}),C})()}),null),M})()}}),d(Zn,{get when(){return i()},get children(){var M=zxe(),_=M.firstChild,C=_.nextSibling;return K(_,()=>n()?.path?.split("/").pop()??t.t("ui.fileMedia.binary.title")),K(C,()=>{const L=n()?.path;return L?t.t("ui.fileMedia.binary.description.path",{path:L}):t.t("ui.fileMedia.binary.description.default")}),M}}),d(Zn,{when:!0,get children(){return e.fallback()}})]}})}/**
|
|
2420
2420
|
* @license lucide-solid v1.7.0 - ISC
|
|
2421
2421
|
*
|
|
2422
2422
|
* This source code is licensed under the ISC license.
|
|
@@ -2462,7 +2462,7 @@ ${Nse}
|
|
|
2462
2462
|
color-scheme: ${n};
|
|
2463
2463
|
--text-mix-blend-mode: ${r?"plus-lighter":"multiply"};
|
|
2464
2464
|
${o}
|
|
2465
|
-
}`;document.getElementById("oc-theme-preload")?.remove(),Pxt().textContent=s,document.documentElement.dataset.theme=t,document.documentElement.dataset.colorScheme=n}function iF(e,t){for(const n of["light","dark"]){const r=n==="dark",i=r?e.dark:e.light,a=lle(i,r),o=cle(a);Xp(r?Kr.THEME_CSS_DARK:Kr.THEME_CSS_LIGHT,o)}}const{use:ule,provider:Oxt}=Nn({name:"Theme",init:e=>{const t=J0(xg(Kr.THEME_ID)??e.defaultTheme)??"oc-2",n=xg(Kr.COLOR_SCHEME)??"system",r=n==="system"?_l():n,[i,a]=nt({themes:{"oc-2":Ext},themeId:t,colorScheme:n,mode:r,previewThemeId:null,previewScheme:null}),o=new Map,s=y=>{const v=J0(y);if(!v)return Promise.resolve(void 0);const k=i.themes[v];if(k)return Promise.resolve(k);const b=o.get(v);if(b)return b;const x=dle()[`./themes/${v}.json`];if(!x)return Promise.resolve(void 0);const w=x().then(M=>{const _=M.default;return a("themes",v,_),_}).finally(()=>{o.delete(v)});return o.set(v,w),w},l=(y,v,k)=>{Dxt(y,v,k),e.onThemeApplied?.(y,k)},c=()=>{const y=Object.keys(i.themes).filter(k=>!wg().has(k)).sort(),v=mB();return y.length===0?v:[...v,...y]},u=()=>Promise.all(mB().map(s)).then(()=>i.themes),h=y=>{if(y.key===Kr.THEME_ID&&y.newValue){const v=J0(y.newValue);if(!v||v!=="oc-2"&&!wg().has(v)&&!i.themes[v])return;if(a("themeId",v),v==="oc-2"){lQ();return}s(v).then(k=>{!k||i.themeId!==v||iF(k)})}y.key===Kr.COLOR_SCHEME&&y.newValue&&(a("colorScheme",y.newValue),a("mode",y.newValue==="system"?_l():y.newValue))};typeof window=="object"&&(window.addEventListener("storage",h),me(()=>window.removeEventListener("storage",h))),dn(()=>{const y=window.matchMedia("(prefers-color-scheme: dark)"),v=()=>{i.colorScheme==="system"&&a("mode",_l())};y.addEventListener("change",v),me(()=>y.removeEventListener("change",v));const k=xg(Kr.THEME_ID),b=J0(k??e.defaultTheme)??"oc-2",x=xg(Kr.COLOR_SCHEME)??"system";k&&k!==b&&(Xp(Kr.THEME_ID,b),lQ()),b!==i.themeId&&a("themeId",b),x!==i.colorScheme&&a("colorScheme",x),a("mode",x==="system"?_l():x),s(b).then(w=>{!w||i.themeId!==b||iF(w)})}),he(()=>{const y=i.themes[i.themeId];y&&l(y,i.themeId,i.mode)});const m=y=>{const v=J0(y);if(!v){console.warn(`Theme "${y}" not found`);return}if(v!=="oc-2"&&!wg().has(v)&&!i.themes[v]){console.warn(`Theme "${y}" not found`);return}a("themeId",v),s(v).then(k=>{!k||i.themeId!==v||(iF(k),Xp(Kr.THEME_ID,v))})},g=y=>{a("colorScheme",y),Xp(Kr.COLOR_SCHEME,y),a("mode",y==="system"?_l():y)};return{themeId:()=>i.themeId,colorScheme:()=>i.colorScheme,mode:()=>i.mode,ids:c,name:y=>i.themes[y]?.name??Txt[y]??y,loadThemes:u,themes:()=>i.themes,setTheme:m,setColorScheme:g,registerTheme:y=>a("themes",y.id,y),previewTheme:y=>{const v=J0(y);v&&(v!=="oc-2"&&!wg().has(v)&&!i.themes[v]||(a("previewThemeId",v),s(v).then(k=>{if(!k||i.previewThemeId!==v)return;const b=i.previewScheme?i.previewScheme==="system"?_l():i.previewScheme:i.mode;l(k,v,b)})))},previewColorScheme:y=>{a("previewScheme",y);const v=y==="system"?_l():y,k=i.previewThemeId??i.themeId;s(k).then(b=>{b&&(i.previewThemeId??i.themeId)===k&&i.previewScheme===y&&l(b,k,v)})},commitPreview:()=>{i.previewThemeId&&m(i.previewThemeId),i.previewScheme&&g(i.previewScheme),a("previewThemeId",null),a("previewScheme",null)},cancelPreview:()=>{a("previewThemeId",null),a("previewScheme",null),s(i.themeId).then(y=>{y&&l(y,i.themeId,i.mode)})}}}}),Rxt=Tt(),zxt=["title","meta"],cQ=[],dQ=["name","http-equiv","content","charset","media"].concat(["property"]),uQ=(e,t)=>{const n=Object.fromEntries(Object.entries(e.props).filter(([r])=>t.includes(r)).sort());return(Object.hasOwn(n,"name")||Object.hasOwn(n,"property"))&&(n.name=n.name||n.property,delete n.property),e.tag+JSON.stringify(n)};function qxt(){if(!Xe.context){const n=document.head.querySelectorAll("[data-sm]");Array.prototype.forEach.call(n,r=>r.parentNode.removeChild(r))}const e=new Map;function t(n){if(n.ref)return n.ref;let r=document.querySelector(`[data-sm="${n.id}"]`);return r?(r.tagName.toLowerCase()!==n.tag&&(r.parentNode&&r.parentNode.removeChild(r),r=document.createElement(n.tag)),r.removeAttribute("data-sm")):r=document.createElement(n.tag),r}return{addTag(n){if(zxt.indexOf(n.tag)!==-1){const a=n.tag==="title"?cQ:dQ,o=uQ(n,a);e.has(o)||e.set(o,[]);let s=e.get(o),l=s.length;s=[...s,n],e.set(o,s);let c=t(n);n.ref=c,ki(c,n.props);let u=null;for(var r=l-1;r>=0;r--)if(s[r]!=null){u=s[r];break}return c.parentNode!=document.head&&document.head.appendChild(c),u&&u.ref&&u.ref.parentNode&&document.head.removeChild(u.ref),l}let i=t(n);return n.ref=i,ki(i,n.props),i.parentNode!=document.head&&document.head.appendChild(i),-1},removeTag(n,r){const i=n.tag==="title"?cQ:dQ,a=uQ(n,i);if(n.ref){const o=e.get(a);if(o){if(n.ref.parentNode){n.ref.parentNode.removeChild(n.ref);for(let s=r-1;s>=0;s--)o[s]!=null&&document.head.appendChild(o[s].ref)}o[r]=null,e.set(a,o)}else n.ref.parentNode&&n.ref.parentNode.removeChild(n.ref)}}}}const jxt=e=>{const t=qxt();return d(Rxt.Provider,{value:t,get children(){return e.children}})};function hle(){let e=new Set;function t(i){return e.add(i),()=>e.delete(i)}let n=!1;function r(i,a){if(n)return!(n=!1);const o={to:i,options:a,defaultPrevented:!1,preventDefault:()=>o.defaultPrevented=!0};for(const s of e)s.listener({...o,from:s.location,retry:l=>{l&&(n=!0),s.navigate(i,{...a,resolve:!1})}});return!o.defaultPrevented}return{subscribe:t,confirm:r}}let gB;function oG(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),gB=window.history.state._depth}oG();function Hxt(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function Fxt(e,t){let n=!1;return()=>{const r=gB;oG();const i=r==null?null:gB-r;if(n){n=!1;return}i&&t(i)?(n=!0,window.history.go(-i)):e()}}const Vxt=/^(?:[a-z0-9]+:)?\/\//i,Bxt=/^\/+|(\/)\/+$/g,fle="http://sr";function J1(e,t=!1){const n=e.replace(Bxt,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function kR(e,t,n){if(Vxt.test(t))return;const r=J1(e),i=n&&J1(n);let a="";return!i||t.startsWith("/")?a=r:i.toLowerCase().indexOf(r.toLowerCase())!==0?a=r+i:a=i,(a||"/")+J1(t,!a)}function Uxt(e,t){if(e==null)throw new Error(t);return e}function Wxt(e,t){return J1(e).replace(/\/*(\*.*)?$/g,"")+J1(t)}function ple(e){const t={};return e.searchParams.forEach((n,r)=>{r in t?Array.isArray(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n}),t}function Gxt(e,t,n){const[r,i]=e.split("/*",2),a=r.split("/").filter(Boolean),o=a.length;return s=>{const l=s.split("/").filter(Boolean),c=l.length-o;if(c<0||c>0&&i===void 0&&!t)return null;const u={path:o?"":"/",params:{}},h=m=>n===void 0?void 0:n[m];for(let m=0;m<o;m++){const g=a[m],y=g[0]===":",v=y?l[m]:l[m].toLowerCase(),k=y?g.slice(1):g.toLowerCase();if(y&&aF(v,h(k)))u.params[k]=v;else if(y||!aF(v,k))return null;u.path+=`/${v}`}if(i){const m=c?l.slice(-c).join("/"):"";if(aF(m,h(i)))u.params[i]=m;else return null}return u}}function aF(e,t){const n=r=>r===e;return t===void 0?!0:typeof t=="string"?n(t):typeof t=="function"?t(e):Array.isArray(t)?t.some(n):t instanceof RegExp?t.test(e):!1}function Zxt(e){const[t,n]=e.pattern.split("/*",2),r=t.split("/").filter(Boolean);return r.reduce((i,a)=>i+(a.startsWith(":")?2:3),r.length-(n===void 0?0:1))}function mle(e){const t=new Map,n=qa();return new Proxy({},{get(r,i){return t.has(i)||Go(n,()=>t.set(i,Z(()=>e()[i]))),t.get(i)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())},has(r,i){return i in e()}})}function Kxt(e,t){const n=new URLSearchParams(e);Object.entries(t).forEach(([i,a])=>{a==null||a===""||a instanceof Array&&!a.length?n.delete(i):a instanceof Array?(n.delete(i),a.forEach(o=>{n.append(i,String(o))})):n.set(i,String(a))});const r=n.toString();return r?`?${r}`:""}function gle(e){let t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];let n=e.slice(0,t.index),r=e.slice(t.index+t[0].length);const i=[n,n+=t[1]];for(;t=/^(\/\:[^\/]+)\?/.exec(r);)i.push(n+=t[1]),r=r.slice(t[0].length);return gle(r).reduce((a,o)=>[...a,...i.map(s=>s+o)],[])}const Xxt=100,yle=Tt(),sG=Tt(),am=()=>Uxt(Lt(yle),"<A> and 'use' router primitives can be only used inside a Route."),Yxt=()=>Lt(sG)||am().base,Jxt=e=>{const t=Yxt();return Z(()=>t.resolvePath(e()))},Qxt=e=>{const t=am();return Z(()=>{const n=e();return n!==void 0?t.renderPath(n):n})},ll=()=>am().navigatorFactory(),bf=()=>am().location,di=()=>am().params,e_t=()=>{const e=bf(),t=ll(),n=(r,i)=>{const a=lt(()=>Kxt(e.search,r)+e.hash);t(a,{scroll:!1,resolve:!1,...i})};return[e.query,n]};function t_t(e,t=""){const{component:n,preload:r,load:i,children:a,info:o}=e,s=!a||Array.isArray(a)&&!a.length,l={key:e,component:n,preload:r||i,info:o};return vle(e.path).reduce((c,u)=>{for(const h of gle(u)){const m=Wxt(t,h);let g=s?m:m.split("/*",1)[0];g=g.split("/").map(y=>y.startsWith(":")||y.startsWith("*")?y:encodeURIComponent(y)).join("/"),c.push({...l,originalPath:u,pattern:g,matcher:Gxt(g,!s,e.matchFilters)})}return c},[])}function n_t(e,t=0){return{routes:e,score:Zxt(e[e.length-1])*1e4-t,matcher(n){const r=[];for(let i=e.length-1;i>=0;i--){const a=e[i],o=a.matcher(n);if(!o)return null;r.unshift({...o,route:a})}return r}}}function vle(e){return Array.isArray(e)?e:[e]}function kle(e,t="",n=[],r=[]){const i=vle(e);for(let a=0,o=i.length;a<o;a++){const s=i[a];if(s&&typeof s=="object"){s.hasOwnProperty("path")||(s.path="");const l=t_t(s,t);for(const c of l){n.push(c);const u=Array.isArray(s.children)&&s.children.length===0;if(s.children&&!u)kle(s.children,c.pattern,n,r);else{const h=n_t([...n],r.length);r.push(h)}n.pop()}}}return n.length?r:r.sort((a,o)=>o.score-a.score)}function oF(e,t){for(let n=0,r=e.length;n<r;n++){const i=e[n].matcher(t);if(i)return i}return[]}function r_t(e,t,n){const r=new URL(fle),i=Z(u=>{const h=e();try{return new URL(h,r)}catch{return console.error(`Invalid path ${h}`),u}},r,{equals:(u,h)=>u.href===h.href}),a=Z(()=>i().pathname),o=Z(()=>i().search,!0),s=Z(()=>i().hash),l=()=>"",c=vn(o,()=>ple(i()));return{get pathname(){return a()},get search(){return o()},get hash(){return s()},get state(){return t()},get key(){return l()},query:n?n(c):mle(c)}}let q1;function i_t(){return q1}function a_t(e,t,n,r={}){const{signal:[i,a],utils:o={}}=e,s=o.parsePath||(E=>E),l=o.renderPath||(E=>E),c=o.beforeLeave||hle(),u=kR("",r.base||"");if(u===void 0)throw new Error(`${u} is not a valid base path`);u&&!i().value&&a({value:u,replace:!0,scroll:!1});const[h,m]=Ce(!1);let g;const y=(E,T)=>{T.value===v()&&T.state===b()||(g===void 0&&m(!0),q1=E,g=T,Dge(()=>{g===T&&(k(g.value),x(g.state),Uge(),_[1](R=>R.filter(H=>H.pending)))}).finally(()=>{g===T&&ct(()=>{q1=void 0,E==="navigate"&&P(g),m(!1),g=void 0})}))},[v,k]=Ce(i().value),[b,x]=Ce(i().state),w=r_t(v,b,o.queryWrapper),M=[],_=Ce([]),C=Z(()=>typeof r.transformUrl=="function"?oF(t(),r.transformUrl(w.pathname)):oF(t(),w.pathname)),L=()=>{const E=C(),T={};for(let R=0;R<E.length;R++)Object.assign(T,E[R].params);return T},S=o.paramsWrapper?o.paramsWrapper(L,t):mle(L),I={pattern:u,path:()=>u,outlet:()=>null,resolvePath(E){return kR(u,E)}};return Qe(vn(i,E=>y("native",E),{defer:!0})),{base:I,location:w,params:S,isRouting:h,renderPath:l,parsePath:s,navigatorFactory:D,matches:C,beforeLeave:c,preloadRoute:O,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:_};function A(E,T,R){lt(()=>{if(typeof T=="number"){T&&(o.go?o.go(T):console.warn("Router integration does not support relative routing"));return}const H=!T||T[0]==="?",{replace:Y,resolve:j,scroll:X,state:W}={replace:!1,resolve:!H,scroll:!0,...R},G=j?E.resolvePath(T):kR(H&&w.pathname||"",T);if(G===void 0)throw new Error(`Path '${T}' is not a routable path`);if(M.length>=Xxt)throw new Error("Too many redirects");const J=v();(G!==J||W!==b())&&(fye||c.confirm(G,R)&&(M.push({value:J,replace:Y,scroll:X,state:b()}),y("navigate",{value:G,state:W})))})}function D(E){return E=E||Lt(sG)||I,(T,R)=>A(E,T,R)}function P(E){const T=M[0];T&&(a({...E,replace:T.replace,scroll:T.scroll}),M.length=0)}function O(E,T){const R=oF(t(),E.pathname),H=q1;q1="preload";for(let Y in R){const{route:j,params:X}=R[Y];j.component&&j.component.preload&&j.component.preload();const{preload:W}=j;T&&W&&Go(n(),()=>W({params:X,location:{pathname:E.pathname,search:E.search,hash:E.hash,query:ple(E),state:null,key:""},intent:"preload"}))}q1=H}}function o_t(e,t,n,r){const{base:i,location:a,params:o}=e,{pattern:s,component:l,preload:c}=r().route,u=Z(()=>r().path);l&&l.preload&&l.preload();const h=c?c({params:o,location:a,intent:q1||"initial"}):void 0;return{parent:t,pattern:s,path:u,outlet:()=>l?d(l,{params:o,location:a,data:h,get children(){return n()}}):n(),resolvePath(g){return kR(i.path(),g,u())}}}const s_t=e=>t=>{const{base:n}=t,r=iq(()=>t.children),i=Z(()=>kle(r(),t.base||""));let a;const o=a_t(e,i,()=>a,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(o),d(yle.Provider,{value:o,get children(){return d(l_t,{routerState:o,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[bt(()=>(a=qa())&&null),d(c_t,{routerState:o,get branches(){return i()}})]}})}})};function l_t(e){const t=e.routerState.location,n=e.routerState.params,r=Z(()=>e.preload&<(()=>{e.preload({params:n,location:t,intent:i_t()||"initial"})}));return d(ke,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:i=>d(i,{params:n,location:t,get data(){return r()},get children(){return e.children}})})}function c_t(e){const t=[];let n;const r=Z(vn(e.routerState.matches,(i,a,o)=>{let s=a&&i.length===a.length;const l=[];for(let c=0,u=i.length;c<u;c++){const h=a&&a[c],m=i[c];o&&h&&m.route.key===h.route.key?l[c]=o[c]:(s=!1,t[c]&&t[c](),wr(g=>{t[c]=g,l[c]=o_t(e.routerState,l[c-1]||e.routerState.base,hQ(()=>r()[c+1]),()=>{const y=e.routerState.matches();return y[c]??y[0]})}))}return t.splice(i.length).forEach(c=>c()),o&&s?o:(n=l[0],l)}));return hQ(()=>r()&&n)()}const hQ=e=>()=>d(ke,{get when(){return e()},keyed:!0,children:t=>d(sG.Provider,{value:t,get children(){return t.outlet()}})}),xs=e=>{const t=iq(()=>e.children);return f(e,{get children(){return t()}})};function d_t([e,t],n,r){return[e,r?i=>t(r(i)):t]}function u_t(e){let t=!1;const n=i=>typeof i=="string"?{value:i}:i,r=d_t(Ce(n(e.get()),{equals:(i,a)=>i.value===a.value&&i.state===a.state}),void 0,i=>(!t&&e.set(i),Xe.registry&&!Xe.done&&(Xe.done=!0),i));return e.init&&me(e.init((i=e.get())=>{t=!0,r[1](n(i)),t=!1})),s_t({signal:r,create:e.create,utils:e.utils})}function h_t(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function f_t(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const p_t=new Map;function m_t(e=!0,t=!1,n="/_server",r){return i=>{const a=i.base.path(),o=i.navigatorFactory(i.base);let s,l;function c(v){return v.namespaceURI==="http://www.w3.org/2000/svg"}function u(v){if(v.defaultPrevented||v.button!==0||v.metaKey||v.altKey||v.ctrlKey||v.shiftKey)return;const k=v.composedPath().find(C=>C instanceof Node&&C.nodeName.toUpperCase()==="A");if(!k||t&&!k.hasAttribute("link"))return;const b=c(k),x=b?k.href.baseVal:k.href;if((b?k.target.baseVal:k.target)||!x&&!k.hasAttribute("state"))return;const M=(k.getAttribute("rel")||"").split(/\s+/);if(k.hasAttribute("download")||M&&M.includes("external"))return;const _=b?new URL(x,document.baseURI):new URL(x);if(!(_.origin!==window.location.origin||a&&_.pathname&&!_.pathname.toLowerCase().startsWith(a.toLowerCase())))return[k,_]}function h(v){const k=u(v);if(!k)return;const[b,x]=k,w=i.parsePath(x.pathname+x.search+x.hash),M=b.getAttribute("state");v.preventDefault(),o(w,{resolve:!1,replace:b.hasAttribute("replace"),scroll:!b.hasAttribute("noscroll"),state:M?JSON.parse(M):void 0})}function m(v){const k=u(v);if(!k)return;const[b,x]=k;r&&(x.pathname=r(x.pathname)),i.preloadRoute(x,b.getAttribute("preload")!=="false")}function g(v){clearTimeout(s);const k=u(v);if(!k)return l=null;const[b,x]=k;l!==b&&(r&&(x.pathname=r(x.pathname)),s=setTimeout(()=>{i.preloadRoute(x,b.getAttribute("preload")!=="false"),l=b},20))}function y(v){if(v.defaultPrevented)return;let k=v.submitter&&v.submitter.hasAttribute("formaction")?v.submitter.getAttribute("formaction"):v.target.getAttribute("action");if(!k)return;if(!k.startsWith("https://action/")){const x=new URL(k,fle);if(k=i.parsePath(x.pathname+x.search),!k.startsWith(n))return}if(v.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const b=p_t.get(k);if(b){v.preventDefault();const x=new FormData(v.target,v.submitter);b.call({r:i,f:v.target},v.target.enctype==="multipart/form-data"?x:new URLSearchParams(x))}}li(["click","submit"]),document.addEventListener("click",h),e&&(document.addEventListener("mousemove",g,{passive:!0}),document.addEventListener("focusin",m,{passive:!0}),document.addEventListener("touchstart",m,{passive:!0})),document.addEventListener("submit",y),me(()=>{document.removeEventListener("click",h),e&&(document.removeEventListener("mousemove",g),document.removeEventListener("focusin",m),document.removeEventListener("touchstart",m)),document.removeEventListener("submit",y)})}}function g_t(e){const t=()=>{const r=window.location.pathname.replace(/^\/+/,"/")+window.location.search,i=window.history.state&&window.history.state._depth&&Object.keys(window.history.state).length===1?void 0:window.history.state;return{value:r+window.location.hash,state:i}},n=hle();return u_t({get:t,set({value:r,replace:i,scroll:a,state:o}){i?window.history.replaceState(Hxt(o),"",r):window.history.pushState(o,"",r),f_t(decodeURIComponent(window.location.hash.slice(1)),a),oG()},init:r=>h_t(window,"popstate",Fxt(r,i=>{if(i)return!n.confirm(i);{const a=t();return!n.confirm(a.value,{state:a.state})}})),create:m_t(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}var y_t=ie("<a>");function lG(e){e=f({inactiveClass:"inactive",activeClass:"active"},e);const[,t]=Se(e,["href","state","class","activeClass","inactiveClass","end"]),n=Jxt(()=>e.href),r=Qxt(n),i=bf(),a=Z(()=>{const o=n();if(o===void 0)return[!1,!1];const s=J1(o.split(/[?#]/,1)[0]).toLowerCase(),l=decodeURI(J1(i.pathname).toLowerCase());return[e.end?s===l:l.startsWith(s+"/")||l===s,s===l]});return(()=>{var o=y_t();return ki(o,f(t,{get href(){return r()||e.href},get state(){return JSON.stringify(e.state)},get classList(){return{...e.class&&{[e.class]:!0},[e.inactiveClass]:!a()[0],[e.activeClass]:a()[0],...t.classList}},link:"",get"aria-current"(){return a()[1]?"page":void 0}}),!1,!1),o})()}function v_t(e){const t=ll(),n=bf(),{href:r,state:i}=e,a=typeof r=="function"?r({navigate:t,location:n}):r;return t(a,{replace:!0,state:i}),null}var om=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},k_t=class extends om{#e;#n;#t;constructor(){super(),this.#t=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ble=new k_t,b_t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},w_t=class{#e=b_t;#n=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},yB=new w_t;function x_t(e){setTimeout(e,0)}var __t=typeof window>"u"||"Deno"in globalThis;function Xi(){}function M_t(e,t){return typeof e=="function"?e(t):e}function S_t(e){return typeof e=="number"&&e>=0&&e!==1/0}function C_t(e,t){return Math.max(e+(t||0)-Date.now(),0)}function vB(e,t){return typeof e=="function"?e(t):e}function L_t(e,t){return typeof e=="function"?e(t):e}function fQ(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==cG(o,t.options))return!1}else if(!w2(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function pQ(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(h0(t.options.mutationKey)!==h0(a))return!1}else if(!w2(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function cG(e,t){return(t?.queryKeyHashFn||h0)(e)}function h0(e){return JSON.stringify(e,(t,n)=>kB(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function w2(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>w2(e[n],t[n])):!1}var I_t=Object.prototype.hasOwnProperty;function wle(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=mQ(e)&&mQ(t);if(!r&&!(kB(e)&&kB(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),s=o.length,l=r?new Array(s):{};let c=0;for(let u=0;u<s;u++){const h=r?u:o[u],m=e[h],g=t[h];if(m===g){l[h]=m,(r?u<a:I_t.call(e,h))&&c++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){l[h]=g;continue}const y=wle(m,g,n+1);l[h]=y,y===m&&c++}return a===s&&c===a?e:l}function N_t(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function mQ(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function kB(e){if(!gQ(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!gQ(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function gQ(e){return Object.prototype.toString.call(e)==="[object Object]"}function A_t(e){return new Promise(t=>{yB.setTimeout(t,e)})}function $_t(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?wle(e,t):t}function T_t(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function E_t(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var dG=Symbol();function xle(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===dG?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function P_t(e,t){return typeof e=="function"?e(...t):!!e}function D_t(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var _le=(()=>{let e=()=>__t;return{isServer(){return e()},setIsServer(t){e=t}}})();function O_t(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var R_t=x_t;function z_t(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=R_t;const a=s=>{t?e.push(s):i(()=>{n(s)})},o=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||o()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Dr=z_t(),q_t=class extends om{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},bz=new q_t;function j_t(e){return Math.min(1e3*2**e,3e4)}function Mle(e){return(e??"online")==="online"?bz.isOnline():!0}var bB=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Sle(e){let t=!1,n=0,r;const i=O_t(),a=()=>i.status!=="pending",o=v=>{if(!a()){const k=new bB(v);m(k),e.onCancel?.(k)}},s=()=>{t=!0},l=()=>{t=!1},c=()=>ble.isFocused()&&(e.networkMode==="always"||bz.isOnline())&&e.canRun(),u=()=>Mle(e.networkMode)&&e.canRun(),h=v=>{a()||(r?.(),i.resolve(v))},m=v=>{a()||(r?.(),i.reject(v))},g=()=>new Promise(v=>{r=k=>{(a()||c())&&v(k)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),y=()=>{if(a())return;let v;const k=n===0?e.initialPromise:void 0;try{v=k??e.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(h).catch(b=>{if(a())return;const x=e.retry??(_le.isServer()?0:3),w=e.retryDelay??j_t,M=typeof w=="function"?w(n,b):w,_=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!_){m(b);return}n++,e.onFail?.(n,b),A_t(M).then(()=>c()?void 0:g()).then(()=>{t?m(b):y()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?y():g().then(y),i)}}var Cle=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),S_t(this.gcTime)&&(this.#e=yB.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_le.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&(yB.clearTimeout(this.#e),this.#e=void 0)}},H_t=class extends Cle{#e;#n;#t;#i;#r;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#t=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=vQ(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=vQ(this.options);t.data!==void 0&&(this.setState(yQ(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=$_t(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Xi).catch(Xi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>L_t(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dG||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>vB(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!C_t(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o||this.#l()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#l(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const s=this.observers.find(l=>l.options.queryFn);s&&this.setOptions(s.options)}const n=new AbortController,r=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const s=xle(this.options,t),c=(()=>{const u={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(u),u})();return this.#o=!1,this.options.persister?this.options.persister(s,c,this):s(c)},o=(()=>{const s={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(s),s})();this.options.behavior?.onFetch(o,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=Sle({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:s=>{s instanceof bB&&s.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(s,l)=>{this.#s({type:"failed",failureCount:s,error:l})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const s=await this.#r.start();if(s===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(s),this.#t.config.onSuccess?.(s,this),this.#t.config.onSettled?.(s,this.state.error,this),s}catch(s){if(s instanceof bB){if(s.silent)return this.#r.promise;if(s.revert){if(this.state.data===void 0)throw s;return this.state.data}}throw this.#s({type:"error",error:s}),this.#t.config.onError?.(s,this),this.#t.config.onSettled?.(this.state.data,s,this),s}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...F_t(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...yQ(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Dr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function F_t(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Mle(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function yQ(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vQ(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function kQ(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const h=y=>{D_t(y,()=>t.signal,()=>u=!0)},m=xle(t.options,t.fetchOptions),g=async(y,v,k)=>{if(u)return Promise.reject();if(v==null&&y.pages.length)return Promise.resolve(y);const x=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:v,direction:k?"backward":"forward",meta:t.options.meta};return h(C),C})(),w=await m(x),{maxPages:M}=t.options,_=k?E_t:T_t;return{pages:_(y.pages,w,M),pageParams:_(y.pageParams,v,M)}};if(i&&a.length){const y=i==="backward",v=y?V_t:bQ,k={pages:a,pageParams:o},b=v(r,k);s=await g(k,b,y)}else{const y=e??a.length;do{const v=l===0?o[0]??r.initialPageParam:bQ(r,s);if(l>0&&v==null)break;s=await g(s,v),l++}while(l<y)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function bQ(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function V_t(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var B_t=class extends Cle{#e;#n;#t;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#n=[],this.state=e.state||Lle(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#n=this.#n.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Sle({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#r({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#t.config.onMutate&&await this.#t.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:i})}const a=await this.#i.start();return await this.#t.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#t.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#t.config.onError?.(a,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#t.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:a}),a}finally{this.#t.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Dr.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function Lle(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var U_t=class extends om{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(e,t,n){const r=new B_t({client:e,mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=_g(e);if(typeof t=="string"){const n=this.#n.get(t);n?n.push(e):this.#n.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=_g(e);if(typeof t=="string"){const n=this.#n.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#n.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=_g(e);if(typeof t=="string"){const r=this.#n.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=_g(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Dr.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>pQ(t,n))}findAll(e={}){return this.getAll().filter(t=>pQ(e,t))}notify(e){Dr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Dr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Xi))))}};function _g(e){return e.options.scope?.id}var W_t=class extends om{#e;#n=void 0;#t;#i;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),N_t(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),n?.mutationKey&&this.options.mutationKey&&h0(n.mutationKey)!==h0(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#n}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#a()}mutate(t,n){return this.#i=n,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??Lle();this.#n={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Dr.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#n.variables,r=this.#n.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#n)})})}},G_t=class extends om{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??cG(r,t);let a=this.get(i);return a||(a=new H_t({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Dr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>fQ(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>fQ(e,n)):t}notify(e){Dr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Dr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Dr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Z_t=class{#e;#n;#t;#i;#r;#a;#o;#l;constructor(t={}){this.#e=t.queryCache||new G_t,this.#n=t.mutationCache||new U_t,this.#t=t.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ble.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=bz.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#n.findAll({...t,status:"pending"}).length}getQueryData(t){const n=this.defaultQueryOptions({queryKey:t});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=this.#e.build(this,n),i=r.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(vB(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(i))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(t,n,r){const i=this.defaultQueryOptions({queryKey:t}),o=this.#e.get(i.queryHash)?.state.data,s=M_t(n,o);if(s!==void 0)return this.#e.build(this,i).setData(s,{...r,manual:!0})}setQueriesData(t,n,r){return Dr.batch(()=>this.#e.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(t){const n=this.defaultQueryOptions({queryKey:t});return this.#e.get(n.queryHash)?.state}removeQueries(t){const n=this.#e;Dr.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=this.#e;return Dr.batch(()=>(r.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},n)))}cancelQueries(t,n={}){const r={revert:!0,...n},i=Dr.batch(()=>this.#e.findAll(t).map(a=>a.cancel(r)));return Promise.all(i).then(Xi).catch(Xi)}invalidateQueries(t,n={}){return Dr.batch(()=>(this.#e.findAll(t).forEach(r=>{r.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},n)))}refetchQueries(t,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},i=Dr.batch(()=>this.#e.findAll(t).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,r);return r.throwOnError||(o=o.catch(Xi)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(i).then(Xi)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=this.#e.build(this,n);return r.isStaleByTime(vB(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Xi).catch(Xi)}fetchInfiniteQuery(t){return t.behavior=kQ(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Xi).catch(Xi)}ensureInfiniteQueryData(t){return t.behavior=kQ(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return bz.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(t){this.#t=t}setQueryDefaults(t,n){this.#i.set(h0(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...this.#i.values()],r={};return n.forEach(i=>{w2(t,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(t,n){this.#r.set(h0(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...this.#r.values()],r={};return n.forEach(i=>{w2(t,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={...this.#t.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=cG(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===dG&&(n.enabled=!1),n}defaultMutationOptions(t){return t?._defaulted?t:{...this.#t.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},Ile=Tt(void 0),K_t=e=>{if(e)return e;const t=Lt(Ile);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t()},X_t=e=>(Qe(t=>(t?.(),e.client.mount(),e.client.unmount.bind(e.client))),me(()=>e.client.unmount()),d(Ile.Provider,{value:()=>e.client,get children(){return e.children}})),Y_t=Tt(()=>!1);Y_t.Provider;function XJt(e,t){const n=Z(()=>K_t(t?.())),r=new W_t(n(),e()),i=(l,c)=>{r.mutate(l,c).catch(Xi)},[a,o]=nt({...r.getCurrentResult(),mutate:i,mutateAsync:r.getCurrentResult().mutate});r2(()=>{r.setOptions(e())}),r2(vn(()=>a.status,()=>{if(a.isError&&P_t(r.options.throwOnError,[a.error]))throw a.error}));const s=r.subscribe(l=>{o({...l,mutate:i,mutateAsync:l.mutate})});return me(s),a}var J_t=class extends Z_t{constructor(e={}){super(e)}};const wf=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let r=0,i=t.length;r<i;r++)n=t[r](n);return n}}},fn=function(e,t){if(typeof e=="function")return function(){return e(arguments)?t.apply(this,arguments):n=>t(n,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(n,r){return arguments.length>=2?t(n,r):function(i){return t(i,n)}};case 3:return function(n,r,i){return arguments.length>=3?t(n,r,i):function(a){return t(a,n,r)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);const n=arguments;return function(r){return t(r,...n)}}}},Fs=e=>e,Nle=e=>()=>e,Ale=Nle(void 0),Q_t=Ale,wB=e=>{const t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete("stack");const n=Object.getPrototypeOf(e);let r=n;for(;r!==null&&r!==Object.prototype;){const i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++)t.add(i[a]);r=Object.getPrototypeOf(r)}return t.has("constructor")&&typeof e.constructor=="function"&&n===e.constructor.prototype&&t.delete("constructor"),t},xB=new WeakSet;function eMt(e){return typeof e=="string"}function tMt(e){return typeof e=="number"}function $le(e){return typeof e=="function"}function nMt(e){return typeof e=="object"&&e!==null||$le(e)}const Hi=fn(2,(e,t)=>nMt(e)&&t in e);function rMt(e){return Hi(e,Symbol.iterator)||eMt(e)}const Ka="~effect/interfaces/Hash",Lr=e=>{switch(typeof e){case"number":return uG(e);case"bigint":return yr(e.toString(10));case"boolean":return yr(String(e));case"symbol":return yr(String(e));case"string":return yr(e);case"undefined":return yr("undefined");case"function":case"object":{if(e===null)return yr("null");if(e instanceof Date)return yr(e.toISOString());if(e instanceof RegExp)return yr(e.toString());{if(xB.has(e))return _B(e);if(lF.has(e))return lF.get(e);const t=lMt(e,()=>iMt(e)?e[Ka]():typeof e=="function"?_B(e):Array.isArray(e)?Ele(e):e instanceof Map?oMt(e):e instanceof Set?sMt(e):Tle(e));return lF.set(e,t),t}}default:throw new Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},_B=e=>(sF.has(e)||sF.set(e,uG(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),sF.get(e)),Lo=fn(2,(e,t)=>e*53^t),Uq=e=>e&3221225471|e>>>1&1073741824,iMt=e=>Hi(e,Ka),uG=e=>{if(e!==e)return yr("NaN");if(e===1/0)return yr("Infinity");if(e===-1/0)return yr("-Infinity");let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return Uq(t)},yr=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Uq(t)},aMt=(e,t)=>{let n=12289;for(const r of t)n^=Lo(Lr(r),Lr(e[r]));return Uq(n)},Tle=e=>aMt(e,wB(e)),hG=(e,t)=>n=>{let r=e;for(const i of n)r^=t(i);return Uq(r)},Ele=hG(6151,Lr),oMt=hG(yr("Map"),([e,t])=>Lo(Lr(e),Lr(t))),sMt=hG(yr("Set"),Lr),sF=new WeakMap,lF=new WeakMap,cF=new WeakSet;function lMt(e,t){if(cF.has(e))return yr("[Circular]");cF.add(e);const n=t();return cF.delete(e),n}const Xa="~effect/interfaces/Equal";function ja(){return arguments.length===1?e=>f0(e,arguments[0]):f0(arguments[0],arguments[1])}function f0(e,t){if(e===t)return!0;if(e==null||t==null)return!1;const n=typeof e;return n!==typeof t?!1:n==="number"&&e!==e&&t!==t?!0:n!=="object"&&n!=="function"||xB.has(e)||xB.has(t)?!1:uMt(e,t,dMt)}function cMt(e,t,n){const r=dF.has(e),i=uF.has(t);if(r&&i)return!0;if(r||i)return!1;dF.add(e),uF.add(t);const a=n();return dF.delete(e),uF.delete(t),a}const dF=new WeakSet,uF=new WeakSet;function dMt(e,t){if(Lr(e)!==Lr(t))return!1;if(e instanceof Date)return t instanceof Date?e.toISOString()===t.toISOString():!1;if(e instanceof RegExp)return t instanceof RegExp?e.toString()===t.toString():!1;const n=wQ(e),r=wQ(t);if(n!==r)return!1;const i=n&&r;return typeof e=="function"&&!i?!1:cMt(e,t,()=>i?e[Xa](t):Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:hMt(e,t):e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:mMt(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:yMt(e,t):fMt(e,t))}function uMt(e,t,n){let r=Mg.get(e);if(!r)r=new WeakMap,Mg.set(e,r);else if(r.has(t))return r.get(t);const i=n(e,t);r.set(t,i);let a=Mg.get(t);return a||(a=new WeakMap,Mg.set(t,a)),a.set(e,i),i}const Mg=new WeakMap;function hMt(e,t){for(let n=0;n<e.length;n++)if(!f0(e[n],t[n]))return!1;return!0}function fMt(e,t){const n=wB(e),r=wB(t);if(n.size!==r.size)return!1;for(const i of n)if(!r.has(i)||!f0(e[i],t[i]))return!1;return!0}function pMt(e,t){return function(r,i){for(const[a,o]of r){let s=!1;for(const[l,c]of i)if(e(a,l)&&t(o,c)){s=!0;break}if(!s)return!1}return!0}}const mMt=pMt(f0,f0);function gMt(e){return function(n,r){for(const i of n){let a=!1;for(const o of r)if(e(i,o)){a=!0;break}if(!a)return!1}return!0}}const yMt=gMt(f0),wQ=e=>Hi(e,Xa),vMt=()=>ja,kMt=e=>e.length>0,fG=Symbol.for("~effect/Inspectable/redactable"),bMt=e=>Hi(e,fG);function wMt(e){return bMt(e)?Ple(e):e}function Ple(e){return e[fG](globalThis[bR]?.services??xMt)}const bR="~effect/Fiber/currentFiber",xMt={"~effect/ServiceMap":{},mapUnsafe:new Map,pipe(){return wf(this,arguments)}};function ps(e,t){const n=t?.space??0,r=new WeakSet,i=n?typeof n=="number"?" ".repeat(n):n:"",a=c=>i.repeat(c),o=(c,u)=>{const h=c?.constructor;return h&&h!==Object.prototype.constructor&&h.name?`${h.name}(${u})`:u},s=c=>{try{return Reflect.ownKeys(c)}catch{return["[ownKeys threw]"]}};function l(c,u=0){if(Array.isArray(c)){if(r.has(c))return xQ;if(r.add(c),!i||c.length<=1)return`[${c.map(m=>l(m,u)).join(",")}]`;const h=c.map(m=>l(m,u+1)).join(`,
|
|
2465
|
+
}`;document.getElementById("oc-theme-preload")?.remove(),Pxt().textContent=s,document.documentElement.dataset.theme=t,document.documentElement.dataset.colorScheme=n}function iF(e,t){for(const n of["light","dark"]){const r=n==="dark",i=r?e.dark:e.light,a=lle(i,r),o=cle(a);Xp(r?Kr.THEME_CSS_DARK:Kr.THEME_CSS_LIGHT,o)}}const{use:ule,provider:Oxt}=Nn({name:"Theme",init:e=>{const t=J0(xg(Kr.THEME_ID)??e.defaultTheme)??"oc-2",n=xg(Kr.COLOR_SCHEME)??"system",r=n==="system"?_l():n,[i,a]=nt({themes:{"oc-2":Ext},themeId:t,colorScheme:n,mode:r,previewThemeId:null,previewScheme:null}),o=new Map,s=y=>{const v=J0(y);if(!v)return Promise.resolve(void 0);const k=i.themes[v];if(k)return Promise.resolve(k);const b=o.get(v);if(b)return b;const x=dle()[`./themes/${v}.json`];if(!x)return Promise.resolve(void 0);const w=x().then(M=>{const _=M.default;return a("themes",v,_),_}).finally(()=>{o.delete(v)});return o.set(v,w),w},l=(y,v,k)=>{Dxt(y,v,k),e.onThemeApplied?.(y,k)},c=()=>{const y=Object.keys(i.themes).filter(k=>!wg().has(k)).sort(),v=mB();return y.length===0?v:[...v,...y]},u=()=>Promise.all(mB().map(s)).then(()=>i.themes),h=y=>{if(y.key===Kr.THEME_ID&&y.newValue){const v=J0(y.newValue);if(!v||v!=="oc-2"&&!wg().has(v)&&!i.themes[v])return;if(a("themeId",v),v==="oc-2"){lQ();return}s(v).then(k=>{!k||i.themeId!==v||iF(k)})}y.key===Kr.COLOR_SCHEME&&y.newValue&&(a("colorScheme",y.newValue),a("mode",y.newValue==="system"?_l():y.newValue))};typeof window=="object"&&(window.addEventListener("storage",h),me(()=>window.removeEventListener("storage",h))),dn(()=>{const y=window.matchMedia("(prefers-color-scheme: dark)"),v=()=>{i.colorScheme==="system"&&a("mode",_l())};y.addEventListener("change",v),me(()=>y.removeEventListener("change",v));const k=xg(Kr.THEME_ID),b=J0(k??e.defaultTheme)??"oc-2",x=xg(Kr.COLOR_SCHEME)??"system";k&&k!==b&&(Xp(Kr.THEME_ID,b),lQ()),b!==i.themeId&&a("themeId",b),x!==i.colorScheme&&a("colorScheme",x),a("mode",x==="system"?_l():x),s(b).then(w=>{!w||i.themeId!==b||iF(w)})}),he(()=>{const y=i.themes[i.themeId];y&&l(y,i.themeId,i.mode)});const m=y=>{const v=J0(y);if(!v){console.warn(`Theme "${y}" not found`);return}if(v!=="oc-2"&&!wg().has(v)&&!i.themes[v]){console.warn(`Theme "${y}" not found`);return}a("themeId",v),s(v).then(k=>{!k||i.themeId!==v||(iF(k),Xp(Kr.THEME_ID,v))})},g=y=>{a("colorScheme",y),Xp(Kr.COLOR_SCHEME,y),a("mode",y==="system"?_l():y)};return{themeId:()=>i.themeId,colorScheme:()=>i.colorScheme,mode:()=>i.mode,ids:c,name:y=>i.themes[y]?.name??Txt[y]??y,loadThemes:u,themes:()=>i.themes,setTheme:m,setColorScheme:g,registerTheme:y=>a("themes",y.id,y),previewTheme:y=>{const v=J0(y);v&&(v!=="oc-2"&&!wg().has(v)&&!i.themes[v]||(a("previewThemeId",v),s(v).then(k=>{if(!k||i.previewThemeId!==v)return;const b=i.previewScheme?i.previewScheme==="system"?_l():i.previewScheme:i.mode;l(k,v,b)})))},previewColorScheme:y=>{a("previewScheme",y);const v=y==="system"?_l():y,k=i.previewThemeId??i.themeId;s(k).then(b=>{b&&(i.previewThemeId??i.themeId)===k&&i.previewScheme===y&&l(b,k,v)})},commitPreview:()=>{i.previewThemeId&&m(i.previewThemeId),i.previewScheme&&g(i.previewScheme),a("previewThemeId",null),a("previewScheme",null)},cancelPreview:()=>{a("previewThemeId",null),a("previewScheme",null),s(i.themeId).then(y=>{y&&l(y,i.themeId,i.mode)})}}}}),Rxt=Tt(),zxt=["title","meta"],cQ=[],dQ=["name","http-equiv","content","charset","media"].concat(["property"]),uQ=(e,t)=>{const n=Object.fromEntries(Object.entries(e.props).filter(([r])=>t.includes(r)).sort());return(Object.hasOwn(n,"name")||Object.hasOwn(n,"property"))&&(n.name=n.name||n.property,delete n.property),e.tag+JSON.stringify(n)};function qxt(){if(!Xe.context){const n=document.head.querySelectorAll("[data-sm]");Array.prototype.forEach.call(n,r=>r.parentNode.removeChild(r))}const e=new Map;function t(n){if(n.ref)return n.ref;let r=document.querySelector(`[data-sm="${n.id}"]`);return r?(r.tagName.toLowerCase()!==n.tag&&(r.parentNode&&r.parentNode.removeChild(r),r=document.createElement(n.tag)),r.removeAttribute("data-sm")):r=document.createElement(n.tag),r}return{addTag(n){if(zxt.indexOf(n.tag)!==-1){const a=n.tag==="title"?cQ:dQ,o=uQ(n,a);e.has(o)||e.set(o,[]);let s=e.get(o),l=s.length;s=[...s,n],e.set(o,s);let c=t(n);n.ref=c,ki(c,n.props);let u=null;for(var r=l-1;r>=0;r--)if(s[r]!=null){u=s[r];break}return c.parentNode!=document.head&&document.head.appendChild(c),u&&u.ref&&u.ref.parentNode&&document.head.removeChild(u.ref),l}let i=t(n);return n.ref=i,ki(i,n.props),i.parentNode!=document.head&&document.head.appendChild(i),-1},removeTag(n,r){const i=n.tag==="title"?cQ:dQ,a=uQ(n,i);if(n.ref){const o=e.get(a);if(o){if(n.ref.parentNode){n.ref.parentNode.removeChild(n.ref);for(let s=r-1;s>=0;s--)o[s]!=null&&document.head.appendChild(o[s].ref)}o[r]=null,e.set(a,o)}else n.ref.parentNode&&n.ref.parentNode.removeChild(n.ref)}}}}const jxt=e=>{const t=qxt();return d(Rxt.Provider,{value:t,get children(){return e.children}})};function hle(){let e=new Set;function t(i){return e.add(i),()=>e.delete(i)}let n=!1;function r(i,a){if(n)return!(n=!1);const o={to:i,options:a,defaultPrevented:!1,preventDefault:()=>o.defaultPrevented=!0};for(const s of e)s.listener({...o,from:s.location,retry:l=>{l&&(n=!0),s.navigate(i,{...a,resolve:!1})}});return!o.defaultPrevented}return{subscribe:t,confirm:r}}let gB;function oG(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),gB=window.history.state._depth}oG();function Hxt(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function Fxt(e,t){let n=!1;return()=>{const r=gB;oG();const i=r==null?null:gB-r;if(n){n=!1;return}i&&t(i)?(n=!0,window.history.go(-i)):e()}}const Vxt=/^(?:[a-z0-9]+:)?\/\//i,Bxt=/^\/+|(\/)\/+$/g,fle="http://sr";function J1(e,t=!1){const n=e.replace(Bxt,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function kR(e,t,n){if(Vxt.test(t))return;const r=J1(e),i=n&&J1(n);let a="";return!i||t.startsWith("/")?a=r:i.toLowerCase().indexOf(r.toLowerCase())!==0?a=r+i:a=i,(a||"/")+J1(t,!a)}function Uxt(e,t){if(e==null)throw new Error(t);return e}function Wxt(e,t){return J1(e).replace(/\/*(\*.*)?$/g,"")+J1(t)}function ple(e){const t={};return e.searchParams.forEach((n,r)=>{r in t?Array.isArray(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n}),t}function Gxt(e,t,n){const[r,i]=e.split("/*",2),a=r.split("/").filter(Boolean),o=a.length;return s=>{const l=s.split("/").filter(Boolean),c=l.length-o;if(c<0||c>0&&i===void 0&&!t)return null;const u={path:o?"":"/",params:{}},h=m=>n===void 0?void 0:n[m];for(let m=0;m<o;m++){const g=a[m],y=g[0]===":",v=y?l[m]:l[m].toLowerCase(),k=y?g.slice(1):g.toLowerCase();if(y&&aF(v,h(k)))u.params[k]=v;else if(y||!aF(v,k))return null;u.path+=`/${v}`}if(i){const m=c?l.slice(-c).join("/"):"";if(aF(m,h(i)))u.params[i]=m;else return null}return u}}function aF(e,t){const n=r=>r===e;return t===void 0?!0:typeof t=="string"?n(t):typeof t=="function"?t(e):Array.isArray(t)?t.some(n):t instanceof RegExp?t.test(e):!1}function Zxt(e){const[t,n]=e.pattern.split("/*",2),r=t.split("/").filter(Boolean);return r.reduce((i,a)=>i+(a.startsWith(":")?2:3),r.length-(n===void 0?0:1))}function mle(e){const t=new Map,n=qa();return new Proxy({},{get(r,i){return t.has(i)||Go(n,()=>t.set(i,Z(()=>e()[i]))),t.get(i)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())},has(r,i){return i in e()}})}function Kxt(e,t){const n=new URLSearchParams(e);Object.entries(t).forEach(([i,a])=>{a==null||a===""||a instanceof Array&&!a.length?n.delete(i):a instanceof Array?(n.delete(i),a.forEach(o=>{n.append(i,String(o))})):n.set(i,String(a))});const r=n.toString();return r?`?${r}`:""}function gle(e){let t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];let n=e.slice(0,t.index),r=e.slice(t.index+t[0].length);const i=[n,n+=t[1]];for(;t=/^(\/\:[^\/]+)\?/.exec(r);)i.push(n+=t[1]),r=r.slice(t[0].length);return gle(r).reduce((a,o)=>[...a,...i.map(s=>s+o)],[])}const Xxt=100,yle=Tt(),sG=Tt(),am=()=>Uxt(Lt(yle),"<A> and 'use' router primitives can be only used inside a Route."),Yxt=()=>Lt(sG)||am().base,Jxt=e=>{const t=Yxt();return Z(()=>t.resolvePath(e()))},Qxt=e=>{const t=am();return Z(()=>{const n=e();return n!==void 0?t.renderPath(n):n})},ll=()=>am().navigatorFactory(),bf=()=>am().location,di=()=>am().params,e_t=()=>{const e=bf(),t=ll(),n=(r,i)=>{const a=lt(()=>Kxt(e.search,r)+e.hash);t(a,{scroll:!1,resolve:!1,...i})};return[e.query,n]};function t_t(e,t=""){const{component:n,preload:r,load:i,children:a,info:o}=e,s=!a||Array.isArray(a)&&!a.length,l={key:e,component:n,preload:r||i,info:o};return vle(e.path).reduce((c,u)=>{for(const h of gle(u)){const m=Wxt(t,h);let g=s?m:m.split("/*",1)[0];g=g.split("/").map(y=>y.startsWith(":")||y.startsWith("*")?y:encodeURIComponent(y)).join("/"),c.push({...l,originalPath:u,pattern:g,matcher:Gxt(g,!s,e.matchFilters)})}return c},[])}function n_t(e,t=0){return{routes:e,score:Zxt(e[e.length-1])*1e4-t,matcher(n){const r=[];for(let i=e.length-1;i>=0;i--){const a=e[i],o=a.matcher(n);if(!o)return null;r.unshift({...o,route:a})}return r}}}function vle(e){return Array.isArray(e)?e:[e]}function kle(e,t="",n=[],r=[]){const i=vle(e);for(let a=0,o=i.length;a<o;a++){const s=i[a];if(s&&typeof s=="object"){s.hasOwnProperty("path")||(s.path="");const l=t_t(s,t);for(const c of l){n.push(c);const u=Array.isArray(s.children)&&s.children.length===0;if(s.children&&!u)kle(s.children,c.pattern,n,r);else{const h=n_t([...n],r.length);r.push(h)}n.pop()}}}return n.length?r:r.sort((a,o)=>o.score-a.score)}function oF(e,t){for(let n=0,r=e.length;n<r;n++){const i=e[n].matcher(t);if(i)return i}return[]}function r_t(e,t,n){const r=new URL(fle),i=Z(u=>{const h=e();try{return new URL(h,r)}catch{return console.error(`Invalid path ${h}`),u}},r,{equals:(u,h)=>u.href===h.href}),a=Z(()=>i().pathname),o=Z(()=>i().search,!0),s=Z(()=>i().hash),l=()=>"",c=vn(o,()=>ple(i()));return{get pathname(){return a()},get search(){return o()},get hash(){return s()},get state(){return t()},get key(){return l()},query:n?n(c):mle(c)}}let q1;function i_t(){return q1}function a_t(e,t,n,r={}){const{signal:[i,a],utils:o={}}=e,s=o.parsePath||(E=>E),l=o.renderPath||(E=>E),c=o.beforeLeave||hle(),u=kR("",r.base||"");if(u===void 0)throw new Error(`${u} is not a valid base path`);u&&!i().value&&a({value:u,replace:!0,scroll:!1});const[h,m]=Ce(!1);let g;const y=(E,T)=>{T.value===v()&&T.state===b()||(g===void 0&&m(!0),q1=E,g=T,Dge(()=>{g===T&&(k(g.value),x(g.state),Uge(),_[1](R=>R.filter(H=>H.pending)))}).finally(()=>{g===T&&ct(()=>{q1=void 0,E==="navigate"&&P(g),m(!1),g=void 0})}))},[v,k]=Ce(i().value),[b,x]=Ce(i().state),w=r_t(v,b,o.queryWrapper),M=[],_=Ce([]),C=Z(()=>typeof r.transformUrl=="function"?oF(t(),r.transformUrl(w.pathname)):oF(t(),w.pathname)),L=()=>{const E=C(),T={};for(let R=0;R<E.length;R++)Object.assign(T,E[R].params);return T},S=o.paramsWrapper?o.paramsWrapper(L,t):mle(L),I={pattern:u,path:()=>u,outlet:()=>null,resolvePath(E){return kR(u,E)}};return Qe(vn(i,E=>y("native",E),{defer:!0})),{base:I,location:w,params:S,isRouting:h,renderPath:l,parsePath:s,navigatorFactory:D,matches:C,beforeLeave:c,preloadRoute:O,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:_};function A(E,T,R){lt(()=>{if(typeof T=="number"){T&&(o.go?o.go(T):console.warn("Router integration does not support relative routing"));return}const H=!T||T[0]==="?",{replace:Y,resolve:j,scroll:X,state:W}={replace:!1,resolve:!H,scroll:!0,...R},G=j?E.resolvePath(T):kR(H&&w.pathname||"",T);if(G===void 0)throw new Error(`Path '${T}' is not a routable path`);if(M.length>=Xxt)throw new Error("Too many redirects");const J=v();(G!==J||W!==b())&&(fye||c.confirm(G,R)&&(M.push({value:J,replace:Y,scroll:X,state:b()}),y("navigate",{value:G,state:W})))})}function D(E){return E=E||Lt(sG)||I,(T,R)=>A(E,T,R)}function P(E){const T=M[0];T&&(a({...E,replace:T.replace,scroll:T.scroll}),M.length=0)}function O(E,T){const R=oF(t(),E.pathname),H=q1;q1="preload";for(let Y in R){const{route:j,params:X}=R[Y];j.component&&j.component.preload&&j.component.preload();const{preload:W}=j;T&&W&&Go(n(),()=>W({params:X,location:{pathname:E.pathname,search:E.search,hash:E.hash,query:ple(E),state:null,key:""},intent:"preload"}))}q1=H}}function o_t(e,t,n,r){const{base:i,location:a,params:o}=e,{pattern:s,component:l,preload:c}=r().route,u=Z(()=>r().path);l&&l.preload&&l.preload();const h=c?c({params:o,location:a,intent:q1||"initial"}):void 0;return{parent:t,pattern:s,path:u,outlet:()=>l?d(l,{params:o,location:a,data:h,get children(){return n()}}):n(),resolvePath(g){return kR(i.path(),g,u())}}}const s_t=e=>t=>{const{base:n}=t,r=iq(()=>t.children),i=Z(()=>kle(r(),t.base||""));let a;const o=a_t(e,i,()=>a,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(o),d(yle.Provider,{value:o,get children(){return d(l_t,{routerState:o,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[bt(()=>(a=qa())&&null),d(c_t,{routerState:o,get branches(){return i()}})]}})}})};function l_t(e){const t=e.routerState.location,n=e.routerState.params,r=Z(()=>e.preload&<(()=>{e.preload({params:n,location:t,intent:i_t()||"initial"})}));return d(ke,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:i=>d(i,{params:n,location:t,get data(){return r()},get children(){return e.children}})})}function c_t(e){const t=[];let n;const r=Z(vn(e.routerState.matches,(i,a,o)=>{let s=a&&i.length===a.length;const l=[];for(let c=0,u=i.length;c<u;c++){const h=a&&a[c],m=i[c];o&&h&&m.route.key===h.route.key?l[c]=o[c]:(s=!1,t[c]&&t[c](),wr(g=>{t[c]=g,l[c]=o_t(e.routerState,l[c-1]||e.routerState.base,hQ(()=>r()[c+1]),()=>{const y=e.routerState.matches();return y[c]??y[0]})}))}return t.splice(i.length).forEach(c=>c()),o&&s?o:(n=l[0],l)}));return hQ(()=>r()&&n)()}const hQ=e=>()=>d(ke,{get when(){return e()},keyed:!0,children:t=>d(sG.Provider,{value:t,get children(){return t.outlet()}})}),xs=e=>{const t=iq(()=>e.children);return f(e,{get children(){return t()}})};function d_t([e,t],n,r){return[e,r?i=>t(r(i)):t]}function u_t(e){let t=!1;const n=i=>typeof i=="string"?{value:i}:i,r=d_t(Ce(n(e.get()),{equals:(i,a)=>i.value===a.value&&i.state===a.state}),void 0,i=>(!t&&e.set(i),Xe.registry&&!Xe.done&&(Xe.done=!0),i));return e.init&&me(e.init((i=e.get())=>{t=!0,r[1](n(i)),t=!1})),s_t({signal:r,create:e.create,utils:e.utils})}function h_t(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function f_t(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const p_t=new Map;function m_t(e=!0,t=!1,n="/_server",r){return i=>{const a=i.base.path(),o=i.navigatorFactory(i.base);let s,l;function c(v){return v.namespaceURI==="http://www.w3.org/2000/svg"}function u(v){if(v.defaultPrevented||v.button!==0||v.metaKey||v.altKey||v.ctrlKey||v.shiftKey)return;const k=v.composedPath().find(C=>C instanceof Node&&C.nodeName.toUpperCase()==="A");if(!k||t&&!k.hasAttribute("link"))return;const b=c(k),x=b?k.href.baseVal:k.href;if((b?k.target.baseVal:k.target)||!x&&!k.hasAttribute("state"))return;const M=(k.getAttribute("rel")||"").split(/\s+/);if(k.hasAttribute("download")||M&&M.includes("external"))return;const _=b?new URL(x,document.baseURI):new URL(x);if(!(_.origin!==window.location.origin||a&&_.pathname&&!_.pathname.toLowerCase().startsWith(a.toLowerCase())))return[k,_]}function h(v){const k=u(v);if(!k)return;const[b,x]=k,w=i.parsePath(x.pathname+x.search+x.hash),M=b.getAttribute("state");v.preventDefault(),o(w,{resolve:!1,replace:b.hasAttribute("replace"),scroll:!b.hasAttribute("noscroll"),state:M?JSON.parse(M):void 0})}function m(v){const k=u(v);if(!k)return;const[b,x]=k;r&&(x.pathname=r(x.pathname)),i.preloadRoute(x,b.getAttribute("preload")!=="false")}function g(v){clearTimeout(s);const k=u(v);if(!k)return l=null;const[b,x]=k;l!==b&&(r&&(x.pathname=r(x.pathname)),s=setTimeout(()=>{i.preloadRoute(x,b.getAttribute("preload")!=="false"),l=b},20))}function y(v){if(v.defaultPrevented)return;let k=v.submitter&&v.submitter.hasAttribute("formaction")?v.submitter.getAttribute("formaction"):v.target.getAttribute("action");if(!k)return;if(!k.startsWith("https://action/")){const x=new URL(k,fle);if(k=i.parsePath(x.pathname+x.search),!k.startsWith(n))return}if(v.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const b=p_t.get(k);if(b){v.preventDefault();const x=new FormData(v.target,v.submitter);b.call({r:i,f:v.target},v.target.enctype==="multipart/form-data"?x:new URLSearchParams(x))}}li(["click","submit"]),document.addEventListener("click",h),e&&(document.addEventListener("mousemove",g,{passive:!0}),document.addEventListener("focusin",m,{passive:!0}),document.addEventListener("touchstart",m,{passive:!0})),document.addEventListener("submit",y),me(()=>{document.removeEventListener("click",h),e&&(document.removeEventListener("mousemove",g),document.removeEventListener("focusin",m),document.removeEventListener("touchstart",m)),document.removeEventListener("submit",y)})}}function g_t(e){const t=()=>{const r=window.location.pathname.replace(/^\/+/,"/")+window.location.search,i=window.history.state&&window.history.state._depth&&Object.keys(window.history.state).length===1?void 0:window.history.state;return{value:r+window.location.hash,state:i}},n=hle();return u_t({get:t,set({value:r,replace:i,scroll:a,state:o}){i?window.history.replaceState(Hxt(o),"",r):window.history.pushState(o,"",r),f_t(decodeURIComponent(window.location.hash.slice(1)),a),oG()},init:r=>h_t(window,"popstate",Fxt(r,i=>{if(i)return!n.confirm(i);{const a=t();return!n.confirm(a.value,{state:a.state})}})),create:m_t(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}var y_t=ie("<a>");function lG(e){e=f({inactiveClass:"inactive",activeClass:"active"},e);const[,t]=Se(e,["href","state","class","activeClass","inactiveClass","end"]),n=Jxt(()=>e.href),r=Qxt(n),i=bf(),a=Z(()=>{const o=n();if(o===void 0)return[!1,!1];const s=J1(o.split(/[?#]/,1)[0]).toLowerCase(),l=decodeURI(J1(i.pathname).toLowerCase());return[e.end?s===l:l.startsWith(s+"/")||l===s,s===l]});return(()=>{var o=y_t();return ki(o,f(t,{get href(){return r()||e.href},get state(){return JSON.stringify(e.state)},get classList(){return{...e.class&&{[e.class]:!0},[e.inactiveClass]:!a()[0],[e.activeClass]:a()[0],...t.classList}},link:"",get"aria-current"(){return a()[1]?"page":void 0}}),!1,!1),o})()}function v_t(e){const t=ll(),n=bf(),{href:r,state:i}=e,a=typeof r=="function"?r({navigate:t,location:n}):r;return t(a,{replace:!0,state:i}),null}var om=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},k_t=class extends om{#e;#n;#t;constructor(){super(),this.#t=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ble=new k_t,b_t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},w_t=class{#e=b_t;#n=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},yB=new w_t;function x_t(e){setTimeout(e,0)}var __t=typeof window>"u"||"Deno"in globalThis;function Xi(){}function M_t(e,t){return typeof e=="function"?e(t):e}function S_t(e){return typeof e=="number"&&e>=0&&e!==1/0}function C_t(e,t){return Math.max(e+(t||0)-Date.now(),0)}function vB(e,t){return typeof e=="function"?e(t):e}function L_t(e,t){return typeof e=="function"?e(t):e}function fQ(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==cG(o,t.options))return!1}else if(!w2(t.queryKey,o))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function pQ(e,t){const{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(h0(t.options.mutationKey)!==h0(a))return!1}else if(!w2(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function cG(e,t){return(t?.queryKeyHashFn||h0)(e)}function h0(e){return JSON.stringify(e,(t,n)=>kB(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function w2(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>w2(e[n],t[n])):!1}var I_t=Object.prototype.hasOwnProperty;function wle(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=mQ(e)&&mQ(t);if(!r&&!(kB(e)&&kB(t)))return t;const a=(r?e:Object.keys(e)).length,o=r?t:Object.keys(t),s=o.length,l=r?new Array(s):{};let c=0;for(let u=0;u<s;u++){const h=r?u:o[u],m=e[h],g=t[h];if(m===g){l[h]=m,(r?u<a:I_t.call(e,h))&&c++;continue}if(m===null||g===null||typeof m!="object"||typeof g!="object"){l[h]=g;continue}const y=wle(m,g,n+1);l[h]=y,y===m&&c++}return a===s&&c===a?e:l}function N_t(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function mQ(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function kB(e){if(!gQ(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!gQ(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function gQ(e){return Object.prototype.toString.call(e)==="[object Object]"}function A_t(e){return new Promise(t=>{yB.setTimeout(t,e)})}function $_t(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?wle(e,t):t}function T_t(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function E_t(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var dG=Symbol();function xle(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===dG?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function P_t(e,t){return typeof e=="function"?e(...t):!!e}function D_t(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r||(r=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),e}var _le=(()=>{let e=()=>__t;return{isServer(){return e()},setIsServer(t){e=t}}})();function O_t(){let e,t;const n=new Promise((i,a)=>{e=i,t=a});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}var R_t=x_t;function z_t(){let e=[],t=0,n=s=>{s()},r=s=>{s()},i=R_t;const a=s=>{t?e.push(s):i(()=>{n(s)})},o=()=>{const s=e;e=[],s.length&&i(()=>{r(()=>{s.forEach(l=>{n(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||o()}return l},batchCalls:s=>(...l)=>{a(()=>{s(...l)})},schedule:a,setNotifyFunction:s=>{n=s},setBatchNotifyFunction:s=>{r=s},setScheduler:s=>{i=s}}}var Dr=z_t(),q_t=class extends om{#e=!0;#n;#t;constructor(){super(),this.#t=e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#n||this.setEventListener(this.#t)}onUnsubscribe(){this.hasListeners()||(this.#n?.(),this.#n=void 0)}setEventListener(e){this.#t=e,this.#n?.(),this.#n=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},bz=new q_t;function j_t(e){return Math.min(1e3*2**e,3e4)}function Mle(e){return(e??"online")==="online"?bz.isOnline():!0}var bB=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Sle(e){let t=!1,n=0,r;const i=O_t(),a=()=>i.status!=="pending",o=v=>{if(!a()){const k=new bB(v);m(k),e.onCancel?.(k)}},s=()=>{t=!0},l=()=>{t=!1},c=()=>ble.isFocused()&&(e.networkMode==="always"||bz.isOnline())&&e.canRun(),u=()=>Mle(e.networkMode)&&e.canRun(),h=v=>{a()||(r?.(),i.resolve(v))},m=v=>{a()||(r?.(),i.reject(v))},g=()=>new Promise(v=>{r=k=>{(a()||c())&&v(k)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),y=()=>{if(a())return;let v;const k=n===0?e.initialPromise:void 0;try{v=k??e.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(h).catch(b=>{if(a())return;const x=e.retry??(_le.isServer()?0:3),w=e.retryDelay??j_t,M=typeof w=="function"?w(n,b):w,_=x===!0||typeof x=="number"&&n<x||typeof x=="function"&&x(n,b);if(t||!_){m(b);return}n++,e.onFail?.(n,b),A_t(M).then(()=>c()?void 0:g()).then(()=>{t?m(b):y()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?y():g().then(y),i)}}var Cle=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),S_t(this.gcTime)&&(this.#e=yB.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(_le.isServer()?1/0:300*1e3))}clearGcTimeout(){this.#e&&(yB.clearTimeout(this.#e),this.#e=void 0)}},H_t=class extends Cle{#e;#n;#t;#i;#r;#a;#o;constructor(e){super(),this.#o=!1,this.#a=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#t=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=vQ(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#a,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=vQ(this.options);t.data!==void 0&&(this.setState(yQ(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#t.remove(this)}setData(e,t){const n=$_t(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(Xi).catch(Xi):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#e}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>L_t(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===dG||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>vB(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!C_t(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#o||this.#l()?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#t.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#l(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const s=this.observers.find(l=>l.options.queryFn);s&&this.setOptions(s.options)}const n=new AbortController,r=s=>{Object.defineProperty(s,"signal",{enumerable:!0,get:()=>(this.#o=!0,n.signal)})},i=()=>{const s=xle(this.options,t),c=(()=>{const u={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(u),u})();return this.#o=!1,this.options.persister?this.options.persister(s,c,this):s(c)},o=(()=>{const s={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(s),s})();this.options.behavior?.onFetch(o,this),this.#n=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#s({type:"fetch",meta:o.fetchOptions?.meta}),this.#r=Sle({initialPromise:t?.initialPromise,fn:o.fetchFn,onCancel:s=>{s instanceof bB&&s.revert&&this.setState({...this.#n,fetchStatus:"idle"}),n.abort()},onFail:(s,l)=>{this.#s({type:"failed",failureCount:s,error:l})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{const s=await this.#r.start();if(s===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(s),this.#t.config.onSuccess?.(s,this),this.#t.config.onSettled?.(s,this.state.error,this),s}catch(s){if(s instanceof bB){if(s.silent)return this.#r.promise;if(s.revert){if(this.state.data===void 0)throw s;return this.state.data}}throw this.#s({type:"error",error:s}),this.#t.config.onError?.(s,this),this.#t.config.onSettled?.(this.state.data,s,this),s}finally{this.scheduleGc()}}#s(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...F_t(n.data,this.options),fetchMeta:e.meta??null};case"success":const r={...n,...yQ(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?r:void 0,r;case"error":const i=e.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),Dr.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#t.notify({query:this,type:"updated",action:e})})}};function F_t(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Mle(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function yQ(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function vQ(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function kQ(e){return{onFetch:(t,n)=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let u=!1;const h=y=>{D_t(y,()=>t.signal,()=>u=!0)},m=xle(t.options,t.fetchOptions),g=async(y,v,k)=>{if(u)return Promise.reject();if(v==null&&y.pages.length)return Promise.resolve(y);const x=(()=>{const C={client:t.client,queryKey:t.queryKey,pageParam:v,direction:k?"backward":"forward",meta:t.options.meta};return h(C),C})(),w=await m(x),{maxPages:M}=t.options,_=k?E_t:T_t;return{pages:_(y.pages,w,M),pageParams:_(y.pageParams,v,M)}};if(i&&a.length){const y=i==="backward",v=y?V_t:bQ,k={pages:a,pageParams:o},b=v(r,k);s=await g(k,b,y)}else{const y=e??a.length;do{const v=l===0?o[0]??r.initialPageParam:bQ(r,s);if(l>0&&v==null)break;s=await g(s,v),l++}while(l<y)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=c}}}function bQ(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function V_t(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var B_t=class extends Cle{#e;#n;#t;#i;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#t=e.mutationCache,this.#n=[],this.state=e.state||Lle(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#t.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#n=this.#n.filter(t=>t!==e),this.scheduleGc(),this.#t.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#n.length||(this.state.status==="pending"?this.scheduleGc():this.#t.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=Sle({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(a,o)=>{this.#r({type:"failed",failureCount:a,error:o})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#t.canRun(this)});const r=this.state.status==="pending",i=!this.#i.canStart();try{if(r)t();else{this.#r({type:"pending",variables:e,isPaused:i}),this.#t.config.onMutate&&await this.#t.config.onMutate(e,this,n);const o=await this.options.onMutate?.(e,n);o!==this.state.context&&this.#r({type:"pending",context:o,variables:e,isPaused:i})}const a=await this.#i.start();return await this.#t.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#t.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#r({type:"success",data:a}),a}catch(a){try{await this.#t.config.onError?.(a,e,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onError?.(a,e,this.state.context,n)}catch(o){Promise.reject(o)}try{await this.#t.config.onSettled?.(void 0,a,this.state.variables,this.state.context,this,n)}catch(o){Promise.reject(o)}try{await this.options.onSettled?.(void 0,a,e,this.state.context,n)}catch(o){Promise.reject(o)}throw this.#r({type:"error",error:a}),a}finally{this.#t.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),Dr.batch(()=>{this.#n.forEach(n=>{n.onMutationUpdate(e)}),this.#t.notify({mutation:this,type:"updated",action:e})})}};function Lle(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var U_t=class extends om{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#n=new Map,this.#t=0}#e;#n;#t;build(e,t,n){const r=new B_t({client:e,mutationCache:this,mutationId:++this.#t,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);const t=_g(e);if(typeof t=="string"){const n=this.#n.get(t);n?n.push(e):this.#n.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=_g(e);if(typeof t=="string"){const n=this.#n.get(t);if(n)if(n.length>1){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}else n[0]===e&&this.#n.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=_g(e);if(typeof t=="string"){const r=this.#n.get(t)?.find(i=>i.state.status==="pending");return!r||r===e}else return!0}runNext(e){const t=_g(e);return typeof t=="string"?this.#n.get(t)?.find(r=>r!==e&&r.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Dr.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#n.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>pQ(t,n))}findAll(e={}){return this.getAll().filter(t=>pQ(e,t))}notify(e){Dr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return Dr.batch(()=>Promise.all(e.map(t=>t.continue().catch(Xi))))}};function _g(e){return e.options.scope?.id}var W_t=class extends om{#e;#n=void 0;#t;#i;constructor(t,n){super(),this.#e=t,this.setOptions(n),this.bindMethods(),this.#r()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const n=this.options;this.options=this.#e.defaultMutationOptions(t),N_t(this.options,n)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#t,observer:this}),n?.mutationKey&&this.options.mutationKey&&h0(n.mutationKey)!==h0(this.options.mutationKey)?this.reset():this.#t?.state.status==="pending"&&this.#t.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#t?.removeObserver(this)}onMutationUpdate(t){this.#r(),this.#a(t)}getCurrentResult(){return this.#n}reset(){this.#t?.removeObserver(this),this.#t=void 0,this.#r(),this.#a()}mutate(t,n){return this.#i=n,this.#t?.removeObserver(this),this.#t=this.#e.getMutationCache().build(this.#e,this.options),this.#t.addObserver(this),this.#t.execute(t)}#r(){const t=this.#t?.state??Lle();this.#n={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#a(t){Dr.batch(()=>{if(this.#i&&this.hasListeners()){const n=this.#n.variables,r=this.#n.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(t?.type==="success"){try{this.#i.onSuccess?.(t.data,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(t.data,null,n,r,i)}catch(a){Promise.reject(a)}}else if(t?.type==="error"){try{this.#i.onError?.(t.error,n,r,i)}catch(a){Promise.reject(a)}try{this.#i.onSettled?.(void 0,t.error,n,r,i)}catch(a){Promise.reject(a)}}}this.listeners.forEach(n=>{n(this.#n)})})}},G_t=class extends om{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const r=t.queryKey,i=t.queryHash??cG(r,t);let a=this.get(i);return a||(a=new H_t({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Dr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>fQ(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>fQ(e,n)):t}notify(e){Dr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Dr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Dr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Z_t=class{#e;#n;#t;#i;#r;#a;#o;#l;constructor(t={}){this.#e=t.queryCache||new G_t,this.#n=t.mutationCache||new U_t,this.#t=t.defaultOptions||{},this.#i=new Map,this.#r=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ble.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#l=bz.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#l?.(),this.#l=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#n.findAll({...t,status:"pending"}).length}getQueryData(t){const n=this.defaultQueryOptions({queryKey:t});return this.#e.get(n.queryHash)?.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),r=this.#e.build(this,n),i=r.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&r.isStaleByTime(vB(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(i))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(t,n,r){const i=this.defaultQueryOptions({queryKey:t}),o=this.#e.get(i.queryHash)?.state.data,s=M_t(n,o);if(s!==void 0)return this.#e.build(this,i).setData(s,{...r,manual:!0})}setQueriesData(t,n,r){return Dr.batch(()=>this.#e.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(t){const n=this.defaultQueryOptions({queryKey:t});return this.#e.get(n.queryHash)?.state}removeQueries(t){const n=this.#e;Dr.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=this.#e;return Dr.batch(()=>(r.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},n)))}cancelQueries(t,n={}){const r={revert:!0,...n},i=Dr.batch(()=>this.#e.findAll(t).map(a=>a.cancel(r)));return Promise.all(i).then(Xi).catch(Xi)}invalidateQueries(t,n={}){return Dr.batch(()=>(this.#e.findAll(t).forEach(r=>{r.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},n)))}refetchQueries(t,n={}){const r={...n,cancelRefetch:n.cancelRefetch??!0},i=Dr.batch(()=>this.#e.findAll(t).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,r);return r.throwOnError||(o=o.catch(Xi)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(i).then(Xi)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=this.#e.build(this,n);return r.isStaleByTime(vB(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(Xi).catch(Xi)}fetchInfiniteQuery(t){return t.behavior=kQ(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(Xi).catch(Xi)}ensureInfiniteQueryData(t){return t.behavior=kQ(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return bz.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#n}getDefaultOptions(){return this.#t}setDefaultOptions(t){this.#t=t}setQueryDefaults(t,n){this.#i.set(h0(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...this.#i.values()],r={};return n.forEach(i=>{w2(t,i.queryKey)&&Object.assign(r,i.defaultOptions)}),r}setMutationDefaults(t,n){this.#r.set(h0(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...this.#r.values()],r={};return n.forEach(i=>{w2(t,i.mutationKey)&&Object.assign(r,i.defaultOptions)}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={...this.#t.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=cG(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===dG&&(n.enabled=!1),n}defaultMutationOptions(t){return t?._defaulted?t:{...this.#t.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#n.clear()}},Ile=Tt(void 0),K_t=e=>{if(e)return e;const t=Lt(Ile);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t()},X_t=e=>(Qe(t=>(t?.(),e.client.mount(),e.client.unmount.bind(e.client))),me(()=>e.client.unmount()),d(Ile.Provider,{value:()=>e.client,get children(){return e.children}})),Y_t=Tt(()=>!1);Y_t.Provider;function JJt(e,t){const n=Z(()=>K_t(t?.())),r=new W_t(n(),e()),i=(l,c)=>{r.mutate(l,c).catch(Xi)},[a,o]=nt({...r.getCurrentResult(),mutate:i,mutateAsync:r.getCurrentResult().mutate});r2(()=>{r.setOptions(e())}),r2(vn(()=>a.status,()=>{if(a.isError&&P_t(r.options.throwOnError,[a.error]))throw a.error}));const s=r.subscribe(l=>{o({...l,mutate:i,mutateAsync:l.mutate})});return me(s),a}var J_t=class extends Z_t{constructor(e={}){super(e)}};const wf=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let r=0,i=t.length;r<i;r++)n=t[r](n);return n}}},fn=function(e,t){if(typeof e=="function")return function(){return e(arguments)?t.apply(this,arguments):n=>t(n,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(n,r){return arguments.length>=2?t(n,r):function(i){return t(i,n)}};case 3:return function(n,r,i){return arguments.length>=3?t(n,r,i):function(a){return t(a,n,r)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);const n=arguments;return function(r){return t(r,...n)}}}},Fs=e=>e,Nle=e=>()=>e,Ale=Nle(void 0),Q_t=Ale,wB=e=>{const t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete("stack");const n=Object.getPrototypeOf(e);let r=n;for(;r!==null&&r!==Object.prototype;){const i=Reflect.ownKeys(r);for(let a=0;a<i.length;a++)t.add(i[a]);r=Object.getPrototypeOf(r)}return t.has("constructor")&&typeof e.constructor=="function"&&n===e.constructor.prototype&&t.delete("constructor"),t},xB=new WeakSet;function eMt(e){return typeof e=="string"}function tMt(e){return typeof e=="number"}function $le(e){return typeof e=="function"}function nMt(e){return typeof e=="object"&&e!==null||$le(e)}const Hi=fn(2,(e,t)=>nMt(e)&&t in e);function rMt(e){return Hi(e,Symbol.iterator)||eMt(e)}const Ka="~effect/interfaces/Hash",Lr=e=>{switch(typeof e){case"number":return uG(e);case"bigint":return yr(e.toString(10));case"boolean":return yr(String(e));case"symbol":return yr(String(e));case"string":return yr(e);case"undefined":return yr("undefined");case"function":case"object":{if(e===null)return yr("null");if(e instanceof Date)return yr(e.toISOString());if(e instanceof RegExp)return yr(e.toString());{if(xB.has(e))return _B(e);if(lF.has(e))return lF.get(e);const t=lMt(e,()=>iMt(e)?e[Ka]():typeof e=="function"?_B(e):Array.isArray(e)?Ele(e):e instanceof Map?oMt(e):e instanceof Set?sMt(e):Tle(e));return lF.set(e,t),t}}default:throw new Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},_B=e=>(sF.has(e)||sF.set(e,uG(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),sF.get(e)),Lo=fn(2,(e,t)=>e*53^t),Uq=e=>e&3221225471|e>>>1&1073741824,iMt=e=>Hi(e,Ka),uG=e=>{if(e!==e)return yr("NaN");if(e===1/0)return yr("Infinity");if(e===-1/0)return yr("-Infinity");let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return Uq(t)},yr=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Uq(t)},aMt=(e,t)=>{let n=12289;for(const r of t)n^=Lo(Lr(r),Lr(e[r]));return Uq(n)},Tle=e=>aMt(e,wB(e)),hG=(e,t)=>n=>{let r=e;for(const i of n)r^=t(i);return Uq(r)},Ele=hG(6151,Lr),oMt=hG(yr("Map"),([e,t])=>Lo(Lr(e),Lr(t))),sMt=hG(yr("Set"),Lr),sF=new WeakMap,lF=new WeakMap,cF=new WeakSet;function lMt(e,t){if(cF.has(e))return yr("[Circular]");cF.add(e);const n=t();return cF.delete(e),n}const Xa="~effect/interfaces/Equal";function ja(){return arguments.length===1?e=>f0(e,arguments[0]):f0(arguments[0],arguments[1])}function f0(e,t){if(e===t)return!0;if(e==null||t==null)return!1;const n=typeof e;return n!==typeof t?!1:n==="number"&&e!==e&&t!==t?!0:n!=="object"&&n!=="function"||xB.has(e)||xB.has(t)?!1:uMt(e,t,dMt)}function cMt(e,t,n){const r=dF.has(e),i=uF.has(t);if(r&&i)return!0;if(r||i)return!1;dF.add(e),uF.add(t);const a=n();return dF.delete(e),uF.delete(t),a}const dF=new WeakSet,uF=new WeakSet;function dMt(e,t){if(Lr(e)!==Lr(t))return!1;if(e instanceof Date)return t instanceof Date?e.toISOString()===t.toISOString():!1;if(e instanceof RegExp)return t instanceof RegExp?e.toString()===t.toString():!1;const n=wQ(e),r=wQ(t);if(n!==r)return!1;const i=n&&r;return typeof e=="function"&&!i?!1:cMt(e,t,()=>i?e[Xa](t):Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:hMt(e,t):e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:mMt(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:yMt(e,t):fMt(e,t))}function uMt(e,t,n){let r=Mg.get(e);if(!r)r=new WeakMap,Mg.set(e,r);else if(r.has(t))return r.get(t);const i=n(e,t);r.set(t,i);let a=Mg.get(t);return a||(a=new WeakMap,Mg.set(t,a)),a.set(e,i),i}const Mg=new WeakMap;function hMt(e,t){for(let n=0;n<e.length;n++)if(!f0(e[n],t[n]))return!1;return!0}function fMt(e,t){const n=wB(e),r=wB(t);if(n.size!==r.size)return!1;for(const i of n)if(!r.has(i)||!f0(e[i],t[i]))return!1;return!0}function pMt(e,t){return function(r,i){for(const[a,o]of r){let s=!1;for(const[l,c]of i)if(e(a,l)&&t(o,c)){s=!0;break}if(!s)return!1}return!0}}const mMt=pMt(f0,f0);function gMt(e){return function(n,r){for(const i of n){let a=!1;for(const o of r)if(e(i,o)){a=!0;break}if(!a)return!1}return!0}}const yMt=gMt(f0),wQ=e=>Hi(e,Xa),vMt=()=>ja,kMt=e=>e.length>0,fG=Symbol.for("~effect/Inspectable/redactable"),bMt=e=>Hi(e,fG);function wMt(e){return bMt(e)?Ple(e):e}function Ple(e){return e[fG](globalThis[bR]?.services??xMt)}const bR="~effect/Fiber/currentFiber",xMt={"~effect/ServiceMap":{},mapUnsafe:new Map,pipe(){return wf(this,arguments)}};function ps(e,t){const n=t?.space??0,r=new WeakSet,i=n?typeof n=="number"?" ".repeat(n):n:"",a=c=>i.repeat(c),o=(c,u)=>{const h=c?.constructor;return h&&h!==Object.prototype.constructor&&h.name?`${h.name}(${u})`:u},s=c=>{try{return Reflect.ownKeys(c)}catch{return["[ownKeys threw]"]}};function l(c,u=0){if(Array.isArray(c)){if(r.has(c))return xQ;if(r.add(c),!i||c.length<=1)return`[${c.map(m=>l(m,u)).join(",")}]`;const h=c.map(m=>l(m,u+1)).join(`,
|
|
2466
2466
|
`+a(u+1));return`[
|
|
2467
2467
|
${a(u+1)}${h}
|
|
2468
2468
|
${a(u)}]`}if(c instanceof Date)return _Mt(c);if(!t?.ignoreToString&&Hi(c,"toString")&&typeof c.toString=="function"&&c.toString!==Object.prototype.toString&&c.toString!==Array.prototype.toString){const h=MMt(c);return c instanceof Error&&c.cause?`${h} (cause: ${l(c.cause,u)})`:h}if(typeof c=="string")return JSON.stringify(c);if(typeof c=="number"||c==null||typeof c=="boolean"||typeof c=="symbol")return String(c);if(typeof c=="bigint")return String(c)+"n";if(typeof c=="object"||typeof c=="function"){if(r.has(c))return xQ;if(r.add(c),fG in c)return ps(Ple(c));if(Symbol.iterator in c)return`${c.constructor.name}(${l(Array.from(c),u)})`;const h=s(c);if(!i||h.length<=1){const g=`{${h.map(y=>`${_Q(y)}:${l(c[y],u)}`).join(",")}}`;return o(c,g)}const m=`{
|
|
@@ -2473,9 +2473,9 @@ ${a(u)}}`;return o(c,m)}return String(c)}return l(e,0)}const xQ="[Circular]";fun
|
|
|
2473
2473
|
`);n.splice(1,3),t.stack=n.join(`
|
|
2474
2474
|
`)}return t},ASt=(e,t)=>{if(e.mutable)return t(e.mapUnsafe),e;const n=new Map(e.mapUnsafe);return t(n),Jq(n)},dl=bSt,Qle=dl("effect/Scheduler",{defaultValue:()=>new TSt}),ece="setImmediate"in globalThis?e=>{const t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{const t=setTimeout(e,0);return()=>clearTimeout(t)};class $St{buckets=[];scheduleTask(t,n){const r=this.buckets,i=r.length;let a,o=0;for(;o<i&&!(r[o][0]>n);o++)a=r[o];a&&a[0]===n?a[1].push(t):o===i?r.push([n,[t]]):r.splice(o,0,[n,[t]])}drain(){const t=this.buckets;return this.buckets=[],t}}class TSt{executionMode;setImmediate;constructor(t="async",n=ece){this.executionMode=t,this.setImmediate=n}shouldYield(t){return t.currentOpCount>=t.maxOpsBeforeYield}makeDispatcher(){return new ESt(this.setImmediate)}}class ESt{tasks=new $St;running=void 0;setImmediate;constructor(t=ece){this.setImmediate=t}scheduleTask(t,n){this.tasks.scheduleTask(t,n),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}afterScheduled=()=>{this.running=void 0,this.runTasks()};runTasks(){const t=this.tasks.drain();for(let n=0;n<t.length;n++){const r=t[n][1];for(let i=0;i<r.length;i++)r[i]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}}const PSt=dl("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),DSt=dl("effect/Scheduler/PreventSchedulerYield",{defaultValue:()=>!1}),OSt="effect/Tracer/ParentSpan",RSt="effect/Tracer",zSt="effect/observability/Metric/FiberRuntimeMetricsKey",qSt=dl("effect/References/CurrentConcurrency",{defaultValue:()=>"unbounded"}),jSt=dl("effect/References/CurrentStackFrame",{defaultValue:Ale}),HSt=dl("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),FSt=dl("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"}),VSt="dev";class BSt extends mG{fiberId;constructor(t,n=Xq){super("Interrupt",n,"Interrupted"),this.fiberId=t}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[Xa](t){return Hle(t)&&this.fiberId===t.fiberId&&this.annotations===t.annotations}[Ka](){return Lo(yr(`${this._tag}:${this.fiberId}`))(_B(this.annotations))}}const USt=e=>new xf([new BSt(e)]),WSt=e=>{for(let t=0;t<e.reasons.length;t++){const n=e.reasons[t];if(n._tag==="Fail")return Gle(n.error)}return Zle(e)},GSt=e=>e.reasons.some(Hle),ZSt=fn(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;const n=new xf(XMt(e.reasons,t.reasons));return ja(e,n)?e:n}),KSt=e=>{const t={Fail:[],Die:[],Interrupt:[]};for(let n=0;n<e.reasons.length;n++)t[e.reasons[n]._tag].push(e.reasons[n]);return t},XSt=e=>{const t=KSt(e);return t.Fail.length>0?t.Fail[0].error:t.Die.length>0?t.Die[0].defect:t.Interrupt.length>0?new globalThis.Error("All fibers interrupted without error"):new globalThis.Error("Empty cause")},TQ=`~effect/Fiber/${VSt}`,YSt={_A:Fs,_E:Fs},JSt={id:0};class tce{constructor(t,n=!0){this[TQ]=YSt,this.setServices(t),this.id=++JSt.id,this.currentOpCount=0,this.currentLoopCount=0,this.interruptible=n,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0}[TQ];id;interruptible;currentOpCount;currentLoopCount;_stack;_observers;_exit;_currentExit;_children;_interruptedCause;_yielded;services;currentScheduler;currentTracerContext;currentSpan;currentLogLevel;minimumLogLevel;currentStackFrame;runtimeMetrics;maxOpsBeforeYield;currentPreventYield;_dispatcher=void 0;get currentDispatcher(){return this._dispatcher??=this.currentScheduler.makeDispatcher()}getRef(t){return ISt(this.services,t)}addObserver(t){return this._exit?(t(this._exit),Q_t):(this._observers.push(t),()=>{const n=this._observers.indexOf(t);n>=0&&this._observers.splice(n,1)})}interruptUnsafe(t,n){if(this._exit)return;let r=USt(t);this.currentStackFrame&&(r=MB(r,Yle(gG,this.currentStackFrame))),n&&(r=MB(r,n)),this._interruptedCause=this._interruptedCause?ZSt(this._interruptedCause,r):r,this.interruptible&&this.evaluate(_2(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate(t){if(this.runtimeMetrics?.recordFiberStart(this.services),this._exit)return;if(this._yielded!==void 0){const r=this._yielded;this._yielded=void 0,r()}const n=this.runLoop(t);if(n!==j1){this._exit=n,this.runtimeMetrics?.recordFiberEnd(this.services,this._exit);for(let r=0;r<this._observers.length;r++)this._observers[r](n);this._observers.length=0}}runLoop(t){const n=globalThis[bR];globalThis[bR]=this;let r=!1,i=t;this.currentOpCount=0;const a=++this.currentLoopCount;try{for(;;){if(this.currentOpCount++,!r&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){r=!0;const o=i;i=ds(rce,()=>o)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[Vr](this),a!==this.currentLoopCount)return j1;if(i===j1){const o=this._yielded;return x2 in o?(this._yielded=void 0,o):j1}}}catch(o){return Hi(i,Vr)?this.runLoop(wz(o)):wz(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{globalThis[bR]=n}}getCont(t){for(;;){const n=this._stack.pop();if(!n)return;const r=n[p0]&&n[p0](this);if(r)return r[t]=r,r;if(n[t])return n}}yieldWith(t){return this._yielded=t,j1}children(){return this._children??=new Set}pipe(){return wf(this,arguments)}setServices(t){this.services=t;const n=this.getRef(Qle);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=t.mapUnsafe.get(OSt),this.currentLogLevel=this.getRef(HSt),this.minimumLogLevel=this.getRef(FSt),this.currentStackFrame=t.mapUnsafe.get(jSt.key),this.maxOpsBeforeYield=this.getRef(PSt),this.currentPreventYield=this.getRef(DSt),this.runtimeMetrics=t.mapUnsafe.get(zSt);const r=t.mapUnsafe.get(RSt);this.currentTracerContext=r?r.context:void 0}get currentSpanLocal(){return this.currentSpan?._tag==="Span"?this.currentSpan:void 0}}const nce=e=>{if(!e.currentStackFrame)return;const t=new Map;return t.set(gG.key,e.currentStackFrame),Jq(t)},QSt=e=>ej(t=>{const n=e[Symbol.iterator](),r=[];let i;function a(){let o=n.next();for(;!o.done;){if(o.value._exit){r.push(o.value._exit),o=n.next();continue}i=o.value.addObserver(s=>{r.push(s),a()});return}t(cs(r))}return a(),Q1(()=>i?.())}),LB=e=>Bs(t=>{const n=nce(t);for(const r of e)r.interruptUnsafe(t.id,n);return oCt(QSt(e))}),cs=ls,_2=_f,Q1=To({op:"Sync",[Vr](e){const t=this[Ot](),n=e.getCont(ca);return n?n[ca](t,e):e.yieldWith(ls(t))}}),Qq=To({op:"Suspend",[Vr](e){return this[Ot]()}}),eCt=To({op:"Yield",[Vr](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(M2)},this[Ot]??0),e.yieldWith(()=>{t=!0})}}),rce=eCt(0),tCt=e=>wz(e),ice=cs(void 0),nCt=e=>ace(function(t,n){Zq(()=>e(n)).then(r=>t(cs(r)),r=>t(tCt(r)))},e.length!==0),ace=To({op:"Async",single:!1,[Vr](e){const t=Zq(()=>this[Ot][0].bind(e.currentScheduler));let n=!1,r=!1;const i=this[Ot][1]?new AbortController:void 0,a=t(o=>{n||(n=!0,r?e.evaluate(o):r=o)},i?.signal);return r!==!1?r:(r=!0,e._yielded=()=>{n=!0},i===void 0&&a===void 0||e._stack.push(rCt(()=>(n=!0,i?.abort(),a??M2))),j1)}}),rCt=To({op:"AsyncFinalizer",[p0](e){e.interruptible&&(e.interruptible=!1,e._stack.push(yG))},[Vs](e,t){return GSt(e)?ds(this[Ot](),()=>_2(e)):_2(e)}}),ej=e=>ace(e,e.length>=2),iCt=(...e)=>Qq(()=>aCt(e.length===1?e[0]():e[1].call(e[0].self))),aCt=To({op:"Iterator",single:!1,[ca](e,t){const n=this[Ot][0];for(;;){const r=n.next(e);if(r.done)return cs(r.value);const i=r.value.asEffect();if(sce(i)){if(i._tag==="Failure")return i}else return t._stack.push(this),i;e=i.value}},[Vr](e){return this[ca](this[Ot][1],e)}}),oce=fn(2,(e,t)=>{const n=cs(t);return ds(e,r=>n)}),oCt=e=>ds(e,t=>M2),sCt=(e,t)=>Bs(n=>ej(r=>{let i=!1;const a=new Set,o=l=>{i=!0,r(a.size===0?l:ds(kCt(LB(a)),()=>l))};let s=0;for(const l of e){if(i)break;const c=s++,u=cce(n,l,!0,!0,!1);a.add(u),u.addObserver(h=>{a.delete(u);const m=!i;o(h),m&&t?.onWinner&&t.onWinner({fiber:u,index:c,parentFiber:n})})}return LB(a)})),lCt=fn(e=>NMt(e[1]),(e,t,n)=>sCt([e,t],n)),ds=fn(2,(e,t)=>{const n=Object.create(cCt);return n[Ot]=e,n[ca]=t.length!==1?r=>t(r):t,n}),cCt=Yq({op:"OnSuccess",[Vr](e){return e._stack.push(this),this[Ot]}}),sce=e=>x2 in e,lce=fn(2,(e,t)=>ds(e,n=>cs(Zq(()=>t(n))))),M2=ls(void 0),mF=e=>pCt(e,{onFailure:Zle,onSuccess:Gle}),dCt=fn(2,(e,t)=>{const n=Object.create(uCt);return n[Ot]=e,n[ca]=t.onSuccess.length!==1?r=>t.onSuccess(r):t.onSuccess,n[Vs]=t.onFailure.length!==1?r=>t.onFailure(r):t.onFailure,n}),uCt=Yq({op:"OnSuccessAndFailure",[Vr](e){return e._stack.push(this),this[Ot]}}),hCt=fn(2,(e,t)=>dCt(e,{onFailure:n=>{const r=n.reasons.find(jle);return r?Zq(()=>t.onFailure(r.error)):_2(n)},onSuccess:t.onSuccess})),fCt=fn(2,(e,t)=>hCt(e,{onFailure:n=>Q1(()=>t.onFailure(n)),onSuccess:n=>Q1(()=>t.onSuccess(n))})),pCt=fn(2,(e,t)=>{if(sce(e)){if(e._tag==="Success")return ls(t.onSuccess(e.value));const n=WSt(e.cause);return VMt(n)?e:ls(t.onFailure(n.success))}return fCt(e,t)}),mCt=fn(2,(e,t)=>lCt(e,ds(dce(t.duration),t.orElse))),gCt=To({op:"OnExit",single:!1,[Vr](e){return e._stack.push(this),this[Ot][0]},[p0](e){e.interruptible&&this[Ot][2]!==!0&&(e._stack.push(yG),e.interruptible=!1)},[ca](e,t,n){n??=ls(e);const r=this[Ot][1](n);return r?ds(r,i=>n):n},[Vs](e,t,n){n??=_f(e);const r=this[Ot][1](n);return r?ds(r,i=>n):n}}),yCt=fn(2,gCt),vCt=fn(2,(e,t)=>yCt(e,n=>t)),kCt=e=>Bs(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push(yG)),e)),bCt=To({op:"SetInterruptible",[p0](e){if(e.interruptible=this[Ot],e._interruptedCause&&e.interruptible)return()=>_2(e._interruptedCause)}}),yG=bCt(!0),wCt=(e,t)=>rMt(e)?t?.mode==="result"?sp(e,mF,t):sp(e,Fs,t):t?.discard?t.mode==="result"?sp(Object.values(e),mF,t):sp(Object.values(e),Fs,t):Qq(()=>{const n={};return oce(sp(Object.entries(e),([r,i])=>lce(t?.mode==="result"?mF(i):i,a=>{n[r]=a}),{discard:!0,concurrency:t?.concurrency}),n)}),xCt=To({op:"While",[ca](e,t){return this[Ot].step(e),this[Ot].while()?(t._stack.push(this),this[Ot].body()):M2},[Vr](e){return this[Ot].while()?(e._stack.push(this),this[Ot].body()):M2}}),sp=fn(e=>typeof e[1]=="function",(e,t,n)=>Bs(r=>{const i=n?.concurrency==="inherit"?r.getRef(qSt):n?.concurrency??1,a=i==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,i);if(a===1)return _Ct(e,t,n);const o=Zh(e);let s=o.length;if(s===0)return n?.discard?ice:cs([]);const l=n?.discard?void 0:new Array(s);let c=0;const u=nce(r);return ej(h=>{const m=new Set,g=[];let y=!1,v=0,k=0,b=!1,x=!1;function w(){for(b=!0;v<a&&c<s;){const M=c,_=o[M];c++,v++;try{const C=cce(r,t(_,M),!0,!0,"inherit");m.add(C),C.addObserver(L=>{if(!x){if(m.delete(C),L._tag==="Failure")if(!y)y=!0,s=c,g.push(...L.cause.reasons),m.forEach(S=>S.interruptUnsafe(r.id,u));else for(const S of L.cause.reasons)S._tag!=="Interrupt"&&g.push(S);else l!==void 0&&(l[M]=L.value);k++,v--,k===s?h(g.length>0?_f(TMt(g)):cs(l)):!b&&!y&&v<a&&w()}})}catch(C){y=!0,s=c,g.push(new qle(C)),m.forEach(L=>L.interruptUnsafe(r.id,u))}}b=!1}return w(),Qq(()=>(x=!0,c=s,LB(m)))})})),_Ct=(e,t,n)=>Qq(()=>{const r=n?.discard?void 0:[],i=e[Symbol.iterator]();let a=i.next(),o=0;return oce(xCt({while:()=>!a.done,body:()=>t(a.value,o++),step:s=>{r&&r.push(s),a=i.next()}}),r)}),cce=(e,t,n=!1,r=!1,i=!1)=>{const a=i==="inherit"?e.interruptible:!i,o=new tce(e.services,a);return n?o.evaluate(t):e.currentDispatcher.scheduleTask(()=>o.evaluate(t),0),!r&&!o._exit&&(e.children().add(o),o.addObserver(()=>e._children.delete(o))),o},MCt=e=>(t,n)=>{const r=new tce(n?.scheduler?CSt(e,Qle,n.scheduler):e,n?.uninterruptible!==!0);if(r.evaluate(t),r._exit)return r;if(n?.signal)if(n.signal.aborted)r.interruptUnsafe();else{const i=()=>r.interruptUnsafe();n.signal.addEventListener("abort",i,{once:!0}),r.addObserver(()=>n.signal.removeEventListener("abort",i))}return n?.onFiberStart&&n.onFiberStart(r),r},SCt=e=>{const t=MCt(e);return(n,r)=>{const i=t(n,r);return new Promise(a=>{i.addObserver(o=>a(o))})}},CCt=e=>{const t=SCt(e);return(n,r)=>t(n,r).then(i=>{if(i._tag==="Failure")throw XSt(i.cause);return i.value})},LCt=CCt(MSt()),ICt=dl("effect/Clock",{defaultValue:()=>new ACt}),NCt=2**31-1;class ACt{currentTimeMillisUnsafe(){return Date.now()}currentTimeMillis=Q1(()=>this.currentTimeMillisUnsafe());currentTimeNanosUnsafe(){return $Ct()}currentTimeNanos=Q1(()=>this.currentTimeNanosUnsafe());sleep(t){const n=mSt(t);return n<=0?rce:ej(r=>{if(n>NCt)return;const i=setTimeout(()=>r(ice),n);return Q1(()=>clearTimeout(i))})}}const EQ=(function(){const e=BigInt(1e6);if(typeof performance>"u"||typeof performance.now>"u")return()=>BigInt(Date.now())*e;if(typeof performance.timeOrigin=="number"&&performance.timeOrigin===0)return()=>BigInt(Math.round(performance.now()*1e6));const t=BigInt(Date.now())*e-BigInt(Math.round(performance.now()*1e6));return()=>t+BigInt(Math.round(performance.now()*1e6))})(),$Ct=(function(){const e=typeof process=="object"&&"hrtime"in process&&typeof process.hrtime.bigint=="function"?process.hrtime:void 0;if(!e)return EQ;const t=EQ()-e.bigint();return()=>t+e.bigint()})(),TCt=e=>Bs(t=>e(t.getRef(ICt))),dce=e=>TCt(t=>t.sleep(tSt(e))),ECt=typeof process=="object"&&process!==null&&typeof process.stdout=="object"&&process.stdout!==null;ECt&&process.stdout.isTTY;const PCt=wCt,DCt=nCt,OCt=cs,RCt=Q1,zCt=iCt,qCt=lce,jCt=mCt,HCt=dce,FCt=vCt,VCt=LCt,uce=e=>e!=null&&(e=Object.getPrototypeOf(e),e===Array.prototype||e===Object.prototype);function hce(e,t,n){for(const[r,i]of Object.entries(t)){const a=`${n}.${r}`;e[a]=i,uce(i)&&hce(e,i,a)}}function fce(e){const t={...e};for(const[n,r]of Object.entries(e))uce(r)&&hce(t,r,n);return t}const BCt=(e,t)=>{if(t)for(const[n,r]of Object.entries(t))e=e.replace(new RegExp(`{{\\s*${n}\\s*}}`,"g"),r);return e},UCt=(e=>e);function WCt(e,t=UCt){return(n,...r)=>{n[0]==="."&&(n=n.slice(1));const i=e()?.[n];switch(typeof i){case"function":return i(...r);case"string":return t(i,r[0]);default:return i}}}const{use:ms,provider:GCt}=Nn({name:"Platform",init:e=>e.value});function ZCt(e,t={}){const n=t.storage||globalThis.localStorage,r=t.name||`storage-${xr()}`;if(!n)return[e[0],e[1],null];const i=t.storageOptions,a=t.serialize||JSON.stringify.bind(JSON),o=t.deserialize||JSON.parse.bind(JSON),s=n.getItem(r,i),l=typeof e[0]=="function"?u=>{try{const h=o(u);e[1](()=>h)}catch{}}:u=>{try{const h=o(u);e[1](Ct(h))}catch{}};let c=!0;if(s instanceof Promise?s.then(u=>c&&u&&l(u)):s&&l(s),typeof t.sync?.[0]=="function"){const u=typeof e[0]=="function"?e[0]:()=>e[0];t.sync[0](h=>{h.key!==r||(h.url||globalThis.location.href)!==globalThis.location.href||h.newValue===a(lt(u))||l(h.newValue)})}return[e[0],typeof e[0]=="function"?u=>{const h=e[1](u),m=u!=null?a(h):u;return t.sync?.[1](r,m),m!=null?n.setItem(r,m,i):n.removeItem(r,i),c=!1,h}:(...u)=>{e[1](...u);const h=a(lt(()=>e[0]));t.sync?.[1](r,h),n.setItem(r,h,i),c=!1},s]}const KCt="default.dat",XCt="opencode.global.dat",YCt="opencode.",pce=new Map,JCt=500,mce=8*1024*1024,wo=new Map,_z={bytes:0};function Mf(e){const t=wo.get(e);t&&(_z.bytes-=t.bytes,wo.delete(e))}function QCt(){for(;;){if(wo.size<=JCt&&_z.bytes<=mce)return;const e=wo.keys().next().value;if(!e)return;Mf(e)}}function S2(e,t){const n=t.length*2;if(n>mce){Mf(e);return}const r=wo.get(e);r&&(_z.bytes-=r.bytes),wo.delete(e),wo.set(e,{value:t,bytes:n}),_z.bytes+=n,QCt()}function gce(e){const t=wo.get(e);if(t)return wo.delete(e),wo.set(e,t),t.value}function Eh(e){return pce.get(e)===!0}function Rs(e){pce.set(e,!0)}function IB(e){if(e instanceof DOMException)return e.name==="QuotaExceededError"||e.name==="NS_ERROR_DOM_QUOTA_REACHED"||e.name==="QUOTA_EXCEEDED_ERR"||e.code===22||e.code===1014;if(!e||typeof e!="object")return!1;const t=e.name;if(t==="QuotaExceededError"||t==="NS_ERROR_DOM_QUOTA_REACHED"||t&&/quota/i.test(t))return!0;const n=e.code;if(n===22||n===1014)return!0;const r=e.message;return typeof r!="string"?!1:!!/quota/i.test(r)}function eLt(e,t,n){const r=e.length,i=Array.from({length:r},(o,s)=>s),a=[];for(const o of i){const s=e.key(o);if(!s||!s.startsWith(YCt)||s===t)continue;const l=e.getItem(s);a.push({key:s,size:l?.length??0})}a.sort((o,s)=>s.size-o.size);for(const o of a){e.removeItem(o.key),Mf(o.key);try{return e.setItem(t,n),S2(t,n),!0}catch(s){if(!IB(s))throw s}}return!1}function yce(e,t,n){try{return e.setItem(t,n),S2(t,n),!0}catch(i){if(!IB(i))throw i}try{return e.removeItem(t),Mf(t),e.setItem(t,n),S2(t,n),!0}catch(i){if(!IB(i))throw i}return eLt(e,t,n)}function tLt(e){return JSON.parse(JSON.stringify(e))}function PQ(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vce(e,t){if(t===void 0)return e;if(t===null)return t;if(Array.isArray(e))return Array.isArray(t)?t:e;if(PQ(e)){if(!PQ(t))return e;const n={...e};for(const r of Object.keys(t))r in e?n[r]=vce(e[r],t[r]):n[r]=t[r];return n}return t}function nLt(e){try{return JSON.parse(e)}catch{return}}function Sg(e,t,n){const r=nLt(t);if(r===void 0)return;const i=n?n(r):r,a=vce(e,i);return JSON.stringify(a)}function DQ(e){const t=(e.slice(0,12)||"workspace").replace(/[^a-zA-Z0-9._-]/g,"-"),n=Wh(e)??"0";return`opencode.workspace.${t}.${n}.dat`}function kce(e){const t=`${e}:`,n=`prefix:${e}`,r=i=>t+i;return{getItem:i=>{const a=r(i),o=gce(a);if(Eh(n))return o??null;const s=(()=>{try{return localStorage.getItem(a)}catch{return Rs(n),null}})();return s===null?o??null:(S2(a,s),s)},setItem:(i,a)=>{const o=r(i);if(!Eh(n)){try{if(yce(localStorage,o,a))return}catch{Rs(n);return}Rs(n)}},removeItem:i=>{const a=r(i);if(Mf(a),!Eh(n))try{localStorage.removeItem(a)}catch{Rs(n)}}}}function NB(){const e="direct";return{getItem:t=>{const n=gce(t);if(Eh(e))return n??null;const r=(()=>{try{return localStorage.getItem(t)}catch{return Rs(e),null}})();return r===null?n??null:(S2(t,r),r)},setItem:(t,n)=>{if(!Eh(e)){try{if(yce(localStorage,t,n))return}catch{Rs(e);return}Rs(e)}},removeItem:t=>{if(Mf(t),!Eh(e))try{localStorage.removeItem(t)}catch{Rs(e)}}}}const In={global(e,t){return{storage:XCt,key:e,legacy:t}},workspace(e,t,n){return{storage:DQ(e),key:`workspace:${t}`,legacy:n}},session(e,t,n,r){return{storage:DQ(e),key:`session:${t}:${n}`,legacy:r}},scoped(e,t,n,r){return t?In.session(e,t,n,r):In.workspace(e,n,r)}};function Mz(e,t){if(t?.platform==="desktop"&&!!t.storage)return t.storage?.(e.storage)?.removeItem(e.key);if(!e.storage){NB().removeItem(e.key);return}kce(e.storage).removeItem(e.key)}function Jn(e,t){const n=ms(),r=typeof e=="string"?{key:e}:e,i=tLt(t[0]),a=r.legacy??[],o=n.platform==="desktop"&&!!n.storage,s=o?n.storage?.(r.storage):r.storage?kce(r.storage):NB(),l=o?r.storage?n.storage?.(KCt):n.storage?.():NB(),c=(()=>{if(!o){const x=s,w=l;return{getItem:_=>{const C=x.getItem(_);if(C!==null){const L=Sg(i,C,r.migrate);return L===void 0?(x.removeItem(_),null):(C!==L&&x.setItem(_,L),L)}for(const L of a){const S=w.getItem(L);if(S===null)continue;const I=Sg(i,S,r.migrate);if(I===void 0){w.removeItem(L);continue}return x.setItem(_,I),w.removeItem(L),I}return null},setItem:(_,C)=>{x.setItem(_,C)},removeItem:_=>{x.removeItem(_)}}}const v=s,k=l;return{getItem:async x=>{const w=await v.getItem(x);if(w!==null){const M=Sg(i,w,r.migrate);return M===void 0?(await v.removeItem(x).catch(()=>{}),null):(w!==M&&await v.setItem(x,M),M)}if(!k)return null;for(const M of a){const _=await k.getItem(M);if(_===null)continue;const C=Sg(i,_,r.migrate);if(C===void 0){await k.removeItem(M).catch(()=>{});continue}return await v.setItem(x,C),await k.removeItem(M),C}return null},setItem:async(x,w)=>{await v.setItem(x,w)},removeItem:async x=>{await v.removeItem(x)}}})(),[u,h,m]=ZCt(t,{name:r.key,storage:c}),g=m instanceof Promise,[y]=Yr(()=>m,async v=>(v instanceof Promise&&await v,!0),{initialValue:!g});return[u,h,m,Object.assign(()=>y()===!0,{promise:m instanceof Promise?m:void 0})]}const bce={"command.category.suggested":"Suggested","command.category.view":"View","command.category.project":"Project","command.category.provider":"Provider","command.category.server":"Server","command.category.session":"Session","command.category.editor":"Editor","command.category.theme":"Theme","command.category.language":"Language","command.category.file":"File","command.category.context":"Context","command.category.terminal":"Terminal","command.category.model":"Model","command.category.mcp":"MCP","command.category.agent":"Agent","command.category.permissions":"Permissions","command.category.workspace":"Workspace","command.category.settings":"Settings","command.category.app":"App","command.category.ai":"AI","theme.scheme.system":"System","theme.scheme.light":"Light","theme.scheme.dark":"Dark","command.sidebar.toggle":"Toggle sidebar","command.project.open":"Open project","command.project.previous":"Previous project","command.project.next":"Next project","command.provider.connect":"Connect provider","command.server.switch":"Switch server","command.settings.open":"Open settings","command.settings.shortcuts":"Open keyboard shortcuts","command.session.previous":"Previous session","command.session.next":"Next session","command.session.previous.unseen":"Previous unread session","command.session.next.unseen":"Next unread session","command.session.archive":"Archive session","command.palette":"Command palette","command.theme.cycle":"Cycle theme","command.theme.set":"Use theme: {{theme}}","command.theme.scheme.cycle":"Cycle color scheme","command.theme.scheme.set":"Use color scheme: {{scheme}}","command.language.cycle":"Cycle language","command.language.set":"Use language: {{language}}","command.session.new":"New session","command.file.save":"Save","command.file.saveAll":"Save all","command.file.new":"New file","command.folder.new":"New folder","command.file.open":"Open file","command.file.findInFiles":"Find in files","command.tab.close":"Close tab","command.tab.moveLeft":"Move tab left","command.tab.moveRight":"Move tab right","command.editor.format":"Format document","command.editor.find":"Find","command.editor.replace":"Replace","command.editor.gotoLine":"Go to line","command.editor.foldAll":"Fold all","command.editor.unfoldAll":"Unfold all","command.editor.selectToBracket":"Select to bracket","command.editor.smartSelect.expand":"Expand selection","command.editor.smartSelect.shrink":"Shrink selection","command.editor.quickFix":"Quick fix","command.editor.commentLine":"Toggle line comment","command.editor.deleteLines":"Delete lines","command.editor.copyFilePath":"Copy file path","command.editor.fontZoomIn":"Font zoom in","command.editor.fontZoomOut":"Font zoom out","command.editor.fontZoomReset":"Font zoom reset","command.terminal.fontZoomIn":"Terminal font zoom in","command.terminal.fontZoomOut":"Terminal font zoom out","command.view.toggleMinimap":"Toggle minimap","command.view.toggleMaximizedPanel":"Toggle maximized panel","command.view.toggleActivityBar":"Toggle activity bar","command.view.toggleStatusBar":"Toggle status bar","command.view.moveSidebarLeft":"Move sidebar left","command.view.moveSidebarRight":"Move sidebar right","command.view.alignPanelCenter":"Align panel center","command.view.positionPanelBottom":"Position panel bottom","command.view.positionPanelRight":"Position panel right","command.view.positionPanelLeft":"Position panel left","command.app.quit":"Quit","command.app.reload":"Reload window","command.app.restart":"Restart to update","command.theme.select":"Select theme","command.theme.toggleLightDark":"Toggle light/dark theme","command.context.addSelection":"Add selection to context","command.ai.quickChat":"Quick chat","command.ai.sidePane":"Open AI side pane","command.ai.insertSelection":"Insert selection into chat","command.ai.toggleModel":"Toggle AI model","command.ai.openSettings":"Open AI settings","command.ai.openGlobalRules":"Open global rules","command.ai.toggleModelSelector":"Toggle model selector","command.ai.switchToNextModel":"Switch to next model","command.ai.openMcpMarketplace":"Open MCP marketplace","command.ai.cascadeView":"Open Cascade view","command.context.addSelection.description":"Add selected lines from the current file","command.input.focus":"Focus input","command.terminal.toggle":"Toggle terminal","command.fileTree.toggle":"Toggle file tree","command.review.toggle":"Toggle review","command.terminal.new":"New terminal","command.terminal.new.description":"Create a new terminal tab","command.terminal.split.horizontal":"Split terminal horizontally","command.terminal.split.vertical":"Split terminal vertically","command.terminal.pane.close":"Close terminal pane","command.steps.toggle":"Toggle steps","command.steps.toggle.description":"Show or hide steps for the current message","command.message.previous":"Previous message","command.message.previous.description":"Go to the previous user message","command.message.next":"Next message","command.message.next.description":"Go to the next user message","command.model.choose":"Choose model","command.model.choose.description":"Select a different model","command.mcp.toggle":"Toggle MCPs","command.mcp.toggle.description":"Toggle MCPs","command.agent.cycle":"Cycle agent","command.agent.cycle.description":"Switch to the next agent","command.agent.cycle.reverse":"Cycle agent backwards","command.agent.cycle.reverse.description":"Switch to the previous agent","command.model.variant.cycle":"Cycle thinking effort","command.model.variant.cycle.description":"Switch to the next effort level","command.prompt.mode.shell":"Shell","command.prompt.mode.normal":"Prompt","command.permissions.autoaccept.enable":"Auto-accept permissions","command.permissions.autoaccept.disable":"Stop auto-accepting permissions","command.workspace.toggle":"Toggle workspaces","command.workspace.toggle.description":"Enable or disable multiple workspaces in the sidebar","command.session.undo":"Undo","command.session.undo.description":"Undo the last message","command.session.redo":"Redo","command.session.redo.description":"Redo the last undone message","command.session.compact":"Compact session","command.session.compact.description":"Summarize the session to reduce context size","command.session.fork":"Fork from message","command.session.fork.description":"Create a new session from a previous message","command.session.share":"Share session","command.session.share.description":"Share this session and copy the URL to clipboard","command.session.unshare":"Unshare session","command.session.unshare.description":"Stop sharing this session","palette.search.placeholder":"Search files, commands, and sessions","palette.empty":"No results found","palette.group.commands":"Commands","palette.group.files":"Files","dialog.provider.search.placeholder":"Search providers","dialog.provider.empty":"No providers found","dialog.provider.group.popular":"Popular","dialog.provider.group.other":"Other","dialog.provider.tag.recommended":"Recommended","dialog.provider.opencode.note":"Curated models including Claude, GPT, Gemini and more","dialog.provider.opencode.tagline":"Reliable optimized models","dialog.provider.opencodeGo.tagline":"Low cost subscription for everyone","dialog.provider.anthropic.note":"Direct access to Claude models, including Pro and Max","dialog.provider.copilot.note":"AI models for coding assistance via GitHub Copilot","dialog.provider.openai.note":"GPT models for fast, capable general AI tasks","dialog.provider.google.note":"Gemini models for fast, structured responses","dialog.provider.openrouter.note":"Access all supported models from one provider","dialog.provider.vercel.note":"Unified access to AI models with smart routing","dialog.model.select.title":"Select model","dialog.model.search.placeholder":"Search models","dialog.model.empty":"No model results","dialog.model.manage":"Manage models","dialog.model.manage.description":"Customize which models appear in the model selector.","dialog.model.manage.provider.toggle":"Toggle all {{provider}} models","dialog.model.unpaid.freeModels.title":"Free models provided by OpenCode","dialog.model.unpaid.addMore.title":"Add more models from popular providers","dialog.provider.viewAll":"Show more providers","provider.connect.title":"Connect {{provider}}","provider.connect.title.anthropicProMax":"Login with Claude Pro/Max","provider.connect.selectMethod":"Select login method for {{provider}}.","provider.connect.method.apiKey":"API key","provider.connect.status.inProgress":"Authorization in progress...","provider.connect.status.waiting":"Waiting for authorization...","provider.connect.status.failed":"Authorization failed: {{error}}","provider.connect.apiKey.description":"Enter your {{provider}} API key to connect your account and use {{provider}} models in OpenCode.","provider.connect.apiKey.label":"{{provider}} API key","provider.connect.apiKey.placeholder":"API key","provider.connect.apiKey.required":"API key is required","provider.connect.opencodeZen.line1":"OpenCode Zen gives you access to a curated set of reliable optimized models for coding agents.","provider.connect.opencodeZen.line2":"With a single API key you'll get access to models such as Claude, GPT, Gemini, GLM and more.","provider.connect.opencodeZen.visit.prefix":"Visit ","provider.connect.opencodeZen.visit.link":"opencode.ai/zen","provider.connect.opencodeZen.visit.suffix":" to collect your API key.","provider.connect.oauth.code.visit.prefix":"Visit ","provider.connect.oauth.code.visit.link":"this link","provider.connect.oauth.code.visit.suffix":" to collect your authorization code to connect your account and use {{provider}} models in OpenCode.","provider.connect.oauth.code.label":"{{method}} authorization code","provider.connect.oauth.code.placeholder":"Authorization code","provider.connect.oauth.code.required":"Authorization code is required","provider.connect.oauth.code.invalid":"Invalid authorization code","provider.connect.oauth.auto.visit.prefix":"Visit ","provider.connect.oauth.auto.visit.link":"this link","provider.connect.oauth.auto.visit.suffix":" and enter the code below to connect your account and use {{provider}} models in OpenCode.","provider.connect.oauth.auto.confirmationCode":"Confirmation code","provider.connect.toast.connected.title":"{{provider}} connected","provider.connect.toast.connected.description":"{{provider}} models are now available to use.","provider.custom.title":"Custom provider","provider.custom.description.prefix":"Configure an OpenAI-compatible provider. See the ","provider.custom.description.link":"provider config docs","provider.custom.description.suffix":".","provider.custom.field.providerID.label":"Provider ID","provider.custom.field.providerID.placeholder":"myprovider","provider.custom.field.providerID.description":"Lowercase letters, numbers, hyphens, or underscores","provider.custom.field.name.label":"Display name","provider.custom.field.name.placeholder":"My AI Provider","provider.custom.field.baseURL.label":"Base URL","provider.custom.field.baseURL.placeholder":"https://api.myprovider.com/v1","provider.custom.field.apiKey.label":"API key","provider.custom.field.apiKey.placeholder":"API key","provider.custom.field.apiKey.description":"Optional. Leave empty if you manage auth via headers.","provider.custom.models.label":"Models","provider.custom.models.id.label":"ID","provider.custom.models.id.placeholder":"model-id","provider.custom.models.name.label":"Name","provider.custom.models.name.placeholder":"Display Name","provider.custom.models.remove":"Remove model","provider.custom.models.add":"Add model","provider.custom.headers.label":"Headers (optional)","provider.custom.headers.key.label":"Header","provider.custom.headers.key.placeholder":"Header-Name","provider.custom.headers.value.label":"Value","provider.custom.headers.value.placeholder":"value","provider.custom.headers.remove":"Remove header","provider.custom.headers.add":"Add header","provider.custom.error.providerID.required":"Provider ID is required","provider.custom.error.providerID.format":"Use lowercase letters, numbers, hyphens, or underscores","provider.custom.error.providerID.exists":"That provider ID already exists","provider.custom.error.name.required":"Display name is required","provider.custom.error.baseURL.required":"Base URL is required","provider.custom.error.baseURL.format":"Must start with http:// or https://","provider.custom.error.required":"Required","provider.custom.error.duplicate":"Duplicate","provider.disconnect.toast.disconnected.title":"{{provider}} disconnected","provider.disconnect.toast.disconnected.description":"{{provider}} models are no longer available.","model.tag.free":"Free","model.tag.latest":"Latest","model.provider.anthropic":"Anthropic","model.provider.openai":"OpenAI","model.provider.google":"Google","model.provider.xai":"xAI","model.provider.meta":"Meta","model.input.text":"text","model.input.image":"image","model.input.audio":"audio","model.input.video":"video","model.input.pdf":"pdf","model.tooltip.allows":"Allows: {{inputs}}","model.tooltip.reasoning.allowed":"Allows reasoning","model.tooltip.reasoning.none":"No reasoning","model.tooltip.context":"Context limit {{limit}}","common.search.placeholder":"Search","common.goBack":"Navigate back","common.goForward":"Navigate forward","common.loading":"Loading","common.loading.ellipsis":"...","common.cancel":"Cancel","common.open":"Open","common.connect":"Connect","common.disconnect":"Disconnect","common.continue":"Continue","common.submit":"Submit","common.save":"Save","common.saving":"Saving...","common.default":"Default","common.attachment":"attachment","prompt.placeholder.shell":"Enter shell command...","prompt.placeholder.normal":'Ask anything... "{{example}}"',"prompt.placeholder.simple":"Ask anything...","prompt.placeholder.summarizeComments":"Summarize comments…","prompt.placeholder.summarizeComment":"Summarize comment…","prompt.mode.shell":"Shell","prompt.mode.normal":"Prompt","prompt.mode.shell.exit":"esc to exit","prompt.example.1":"Fix a TODO in the codebase","prompt.example.2":"What is the tech stack of this project?","prompt.example.3":"Fix broken tests","prompt.example.4":"Explain how authentication works","prompt.example.5":"Find and fix security vulnerabilities","prompt.example.6":"Add unit tests for the user service","prompt.example.7":"Refactor this function to be more readable","prompt.example.8":"What does this error mean?","prompt.example.9":"Help me debug this issue","prompt.example.10":"Generate API documentation","prompt.example.11":"Optimize database queries","prompt.example.12":"Add input validation","prompt.example.13":"Create a new component for...","prompt.example.14":"How do I deploy this project?","prompt.example.15":"Review my code for best practices","prompt.example.16":"Add error handling to this function","prompt.example.17":"Explain this regex pattern","prompt.example.18":"Convert this to TypeScript","prompt.example.19":"Add logging throughout the codebase","prompt.example.20":"What dependencies are outdated?","prompt.example.21":"Help me write a migration script","prompt.example.22":"Implement caching for this endpoint","prompt.example.23":"Add pagination to this list","prompt.example.24":"Create a CLI command for...","prompt.example.25":"How do environment variables work here?","prompt.popover.emptyResults":"No matching results","prompt.popover.emptyCommands":"No matching commands","prompt.dropzone.label":"Drop images, PDFs, or text files here","prompt.dropzone.file.label":"Drop to @mention file","prompt.slash.badge.custom":"custom","prompt.slash.badge.skill":"skill","prompt.slash.badge.mcp":"mcp","prompt.context.active":"active","prompt.context.includeActiveFile":"Include active file","prompt.context.removeActiveFile":"Remove active file from context","prompt.context.removeFile":"Remove file from context","prompt.action.attachFile":"Add files","prompt.attachment.remove":"Remove attachment","prompt.action.send":"Send","prompt.action.stop":"Stop","prompt.toast.pasteUnsupported.title":"Unsupported attachment","prompt.toast.pasteUnsupported.description":"Only images, PDFs, or text files can be attached here.","prompt.toast.modelAgentRequired.title":"Select an agent and model","prompt.toast.modelAgentRequired.description":"Choose an agent and model before sending a prompt.","prompt.toast.worktreeCreateFailed.title":"Failed to create worktree","prompt.toast.sessionCreateFailed.title":"Failed to create session","prompt.toast.shellSendFailed.title":"Failed to send shell command","prompt.toast.commandSendFailed.title":"Failed to send command","prompt.toast.promptSendFailed.title":"Failed to send prompt","prompt.toast.promptSendFailed.description":"Unable to retrieve session","dialog.mcp.title":"MCPs","dialog.mcp.description":"{{enabled}} of {{total}} enabled","dialog.mcp.empty":"No MCPs configured","dialog.lsp.empty":"LSPs auto-detected from file types","dialog.plugins.empty":"Plugins configured in opencode.json","mcp.status.connected":"connected","mcp.status.failed":"failed","mcp.status.needs_auth":"needs auth","mcp.status.disabled":"disabled","dialog.fork.empty":"No messages to fork from","dialog.directory.search.placeholder":"Search folders","dialog.directory.empty":"No folders found","dialog.directory.create":"New blank project","dialog.directory.create.placeholder":"Project name","dialog.directory.create.action":"Create project","dialog.directory.create.error":"Failed to create project","dialog.clone.title":"Import from GitHub","dialog.clone.description":"Paste a GitHub repository URL to clone it locally.","dialog.clone.action":"Clone","dialog.clone.error":"Failed to clone repository","command.project.new":"New project","command.project.newBlank":"New blank project","command.project.importGitHub":"Import from GitHub","app.server.unreachable":"Could not reach {{server}}","app.server.retrying":"Retrying automatically...","app.server.otherServers":"Other servers","dialog.server.title":"Servers","dialog.server.description":"Switch which OpenCode server this app connects to.","dialog.server.search.placeholder":"Search servers","dialog.server.empty":"No servers yet","dialog.server.add.title":"Add server","dialog.server.add.url":"Server address","dialog.server.add.placeholder":"http://localhost:4096","dialog.server.add.error":"Could not connect to server","dialog.server.add.checking":"Checking...","dialog.server.add.button":"Add server","dialog.server.add.name":"Server name (optional)","dialog.server.add.namePlaceholder":"Localhost","dialog.server.add.username":"Username (optional)","dialog.server.add.usernamePlaceholder":"username","dialog.server.add.password":"Password (optional)","dialog.server.add.passwordPlaceholder":"password","dialog.server.edit.title":"Edit server","dialog.server.default.title":"Default server","dialog.server.default.description":"Connect to this server on app launch instead of starting a local server. Requires restart.","dialog.server.default.none":"No server selected","dialog.server.default.set":"Set current server as default","dialog.server.default.clear":"Clear","dialog.server.action.remove":"Remove server","dialog.server.menu.edit":"Edit","dialog.server.menu.default":"Set as default","dialog.server.menu.defaultRemove":"Remove default","dialog.server.menu.delete":"Delete","dialog.server.current":"Current Server","dialog.server.status.default":"Default","server.row.noUsername":"no username","dialog.project.edit.title":"Edit project","dialog.project.edit.name":"Name","dialog.project.edit.icon":"Icon","dialog.project.edit.icon.alt":"Project icon","dialog.project.edit.icon.hint":"Click or drag an image","dialog.project.edit.icon.recommended":"Recommended: 128x128px","dialog.project.edit.color":"Color","dialog.project.edit.color.select":"Select {{color}} color","dialog.project.edit.worktree.startup":"Workspace startup script","dialog.project.edit.worktree.startup.description":"Runs after creating a new workspace (worktree).","dialog.project.edit.worktree.startup.placeholder":"e.g. bun install","dialog.releaseNotes.action.getStarted":"Get started","dialog.releaseNotes.action.next":"Next","dialog.releaseNotes.action.hideFuture":"Don't show these in the future","dialog.releaseNotes.media.alt":"Release preview","context.breakdown.title":"Context Breakdown","context.breakdown.note":'Approximate breakdown of input tokens. "Other" includes tool definitions and overhead.',"context.breakdown.system":"System","context.breakdown.user":"User","context.breakdown.assistant":"Assistant","context.breakdown.tool":"Tool Calls","context.breakdown.other":"Other","context.systemPrompt.title":"System Prompt","context.rawMessages.title":"Raw messages","context.stats.session":"Session","context.stats.messages":"Messages","context.stats.provider":"Provider","context.stats.model":"Model","context.stats.limit":"Context Limit","context.stats.totalTokens":"Total Tokens","context.stats.usage":"Usage","context.stats.inputTokens":"Input Tokens","context.stats.outputTokens":"Output Tokens","context.stats.reasoningTokens":"Reasoning Tokens","context.stats.cacheTokens":"Cache Tokens (read/write)","context.stats.userMessages":"User Messages","context.stats.assistantMessages":"Assistant Messages","context.stats.totalCost":"Total Cost","context.stats.sessionCreated":"Session Created","context.stats.lastActivity":"Last Activity","context.usage.tokens":"Tokens","context.usage.usage":"Usage","context.usage.cost":"Cost","context.usage.clickToView":"Click to view context","context.usage.view":"View context usage","language.en":"English","language.zh":"简体中文","language.zht":"繁體中文","language.ko":"한국어","language.de":"Deutsch","language.es":"Español","language.fr":"Français","language.da":"Dansk","language.ja":"日本語","language.pl":"Polski","language.ru":"Русский","language.ar":"العربية","language.no":"Norsk","language.br":"Português (Brasil)","language.bs":"Bosanski","language.th":"ไทย","language.tr":"Türkçe","toast.language.title":"Language","toast.language.description":"Switched to {{language}}","toast.theme.title":"Theme switched","toast.scheme.title":"Color scheme","toast.workspace.enabled.title":"Workspaces enabled","toast.workspace.enabled.description":"Multiple worktrees are now shown in the sidebar","toast.workspace.disabled.title":"Workspaces disabled","toast.workspace.disabled.description":"Only the main worktree is shown in the sidebar","toast.permissions.autoaccept.on.title":"Auto-accepting permissions","toast.permissions.autoaccept.on.description":"Permission requests will be automatically approved","toast.permissions.autoaccept.off.title":"Stopped auto-accepting permissions","toast.permissions.autoaccept.off.description":"Permission requests will require approval","toast.model.none.title":"No model selected","toast.model.none.description":"Connect a provider to summarize this session","toast.file.loadFailed.title":"Failed to load file","toast.file.listFailed.title":"Failed to list files","toast.context.noLineSelection.title":"No line selection","toast.context.noLineSelection.description":"Select a line range in a file tab first.","toast.session.share.copyFailed.title":"Failed to copy URL to clipboard","toast.session.share.success.title":"Session shared","toast.session.share.success.description":"Share URL copied to clipboard!","toast.session.share.failed.title":"Failed to share session","toast.session.share.failed.description":"An error occurred while sharing the session","toast.session.unshare.success.title":"Session unshared","toast.session.unshare.success.description":"Session unshared successfully!","toast.session.unshare.failed.title":"Failed to unshare session","toast.session.unshare.failed.description":"An error occurred while unsharing the session","toast.session.listFailed.title":"Failed to load sessions for {{project}}","toast.project.reloadFailed.title":"Failed to reload {{project}}","toast.update.title":"Update available","toast.update.description":"A new version of OpenCode ({{version}}) is now available to install.","toast.update.action.installRestart":"Install and restart","toast.update.action.notYet":"Not yet","error.page.title":"Something went wrong","error.page.description":"An error occurred while loading the application.","error.page.details.label":"Error Details","error.page.action.restart":"Restart","error.page.action.checking":"Checking...","error.page.action.checkUpdates":"Check for updates","error.page.action.updateTo":"Update to {{version}}","error.page.circular":"[Circular]","error.page.report.prefix":"Please report this error to the TurtleCode team","error.page.report.discord":"on Discord","error.page.version":"Version: {{version}}","error.dev.rootNotFound":"Root element not found. Did you forget to add it to your index.html? Or maybe the id attribute got misspelled?","error.globalSync.connectFailed":"Could not connect to server. Is there a server running at `{{url}}`?","error.globalSDK.noServerAvailable":"No server available","error.globalSDK.serverNotAvailable":"Server not available","error.childStore.persistedCacheCreateFailed":"Failed to create persisted cache","error.childStore.persistedProjectMetadataCreateFailed":"Failed to create persisted project metadata","error.childStore.persistedProjectIconCreateFailed":"Failed to create persisted project icon","error.childStore.storeCreateFailed":"Failed to create store","directory.error.invalidUrl":"Invalid directory in URL.","error.chain.unknown":"Unknown error","error.server.invalidConfiguration":"Invalid configuration","error.chain.causedBy":"Caused by:","error.chain.apiError":"API error","error.chain.status":"Status: {{status}}","error.chain.retryable":"Retryable: {{retryable}}","error.chain.responseBody":`Response body:
|
|
2475
2475
|
{{body}}`,"error.chain.didYouMean":"Did you mean: {{suggestions}}","error.chain.modelNotFound":"Model not found: {{provider}}/{{model}}","error.chain.checkConfig":"Check your config (opencode.json) provider/model names","error.chain.mcpFailed":'MCP server "{{name}}" failed. Note, OpenCode does not support MCP authentication yet.',"error.chain.providerAuthFailed":"Provider authentication failed ({{provider}}): {{message}}","error.chain.providerInitFailed":'Failed to initialize provider "{{provider}}". Check credentials and configuration.',"error.chain.configJsonInvalid":"Config file at {{path}} is not valid JSON(C)","error.chain.configJsonInvalidWithMessage":"Config file at {{path}} is not valid JSON(C): {{message}}","error.chain.configDirectoryTypo":'Directory "{{dir}}" in {{path}} is not valid. Rename the directory to "{{suggestion}}" or remove it. This is a common typo.',"error.chain.configFrontmatterError":`Failed to parse frontmatter in {{path}}:
|
|
2476
|
-
{{message}}`,"error.chain.configInvalid":"Config file at {{path}} is invalid","error.chain.configInvalidWithMessage":"Config file at {{path}} is invalid: {{message}}","notification.permission.title":"Permission required","notification.permission.description":"{{sessionTitle}} in {{projectName}} needs permission","notification.question.title":"Question","notification.question.description":"{{sessionTitle}} in {{projectName}} has a question","notification.action.goToSession":"Go to session","notification.session.responseReady.title":"Response ready","notification.session.error.title":"Session error","notification.session.error.fallbackDescription":"An error occurred","home.recentProjects":"Recent projects","home.empty.title":"No recent projects","home.empty.description":"Get started by opening a local project","session.tab.session":"Session","session.tab.review":"Review","session.tab.track":"Track","session.tab.code":"Code","session.tab.context":"Context","session.panel.reviewAndFiles":"Review and files","session.review.filesChanged":"{{count}} Files Changed","session.review.change.one":"Change","session.review.change.other":"Changes","session.review.loadingChanges":"Loading changes...","session.review.empty":"No changes in this session yet","session.review.noVcs":"No Git Version Control System detected, changes not displayed","session.review.noVcs.createGit.title":"Create a Git repository","session.review.noVcs.createGit.description":"Track, review, and undo changes in this project","session.review.noVcs.createGit.actionLoading":"Creating Git repository...","session.review.noVcs.createGit.action":"Create Git repository","session.review.noSnapshot":"Snapshot tracking is disabled in config, so session changes are unavailable","session.review.noChanges":"No changes","session.files.selectToOpen":"Select a file to get started","session.files.all":"All files","session.files.empty":"No files","session.fileTree.newFile":"New File","session.fileTree.newFolder":"New Folder","session.fileTree.expandAll":"Expand All","session.fileTree.collapseAll":"Collapse All","session.fileTree.refresh":"Refresh","session.files.binaryContent":"Binary file (content cannot be displayed)","session.messages.renderEarlier":"Render earlier messages","session.messages.loadingEarlier":"Loading earlier messages...","session.messages.loadEarlier":"Load earlier messages","session.messages.loading":"Loading messages...","session.messages.jumpToLatest":"Jump to latest","session.context.addToContext":"Add {{selection}} to context","session.todo.title":"Todos","session.todo.collapse":"Collapse","session.todo.expand":"Expand","session.todo.progress":"{{done}} of {{total}} todos completed","session.question.progress":"{{current}} of {{total}} questions","session.followupDock.summary.one":"{{count}} queued message","session.followupDock.summary.other":"{{count}} queued messages","session.followupDock.sendNow":"Send now","session.followupDock.edit":"Edit","session.followupDock.collapse":"Collapse queued messages","session.followupDock.expand":"Expand queued messages","session.revertDock.summary.one":"{{count}} rolled back message","session.revertDock.summary.other":"{{count}} rolled back messages","session.revertDock.collapse":"Collapse rolled back messages","session.revertDock.expand":"Expand rolled back messages","session.revertDock.restore":"Restore message","session.changeDock.title.one":"1 file changed","session.changeDock.title.other":"{{count}} files changed","session.changeDock.collapse":"Collapse changed files","session.changeDock.expand":"Expand changed files","session.changeDock.accept":"Accept all","session.changeDock.reject":"Reject all","session.new.title":"Build anything","session.new.worktree.main":"Main branch","session.new.worktree.mainWithBranch":"Main branch ({{branch}})","session.new.worktree.create":"Create new worktree","session.new.lastModified":"Last modified","session.header.search.placeholder":"Search {{project}}","session.header.searchFiles":"Search files","session.header.openIn":"Open in","session.header.open.action":"Open {{app}}","session.header.open.ariaLabel":"Open in {{app}}","session.header.open.menu":"Open options","session.header.open.copyPath":"Copy path","session.header.open.finder":"Finder","session.header.open.fileExplorer":"File Explorer","session.header.open.fileManager":"File Manager","session.header.open.app.vscode":"VS Code","session.header.open.app.cursor":"Cursor","session.header.open.app.zed":"Zed","session.header.open.app.textmate":"TextMate","session.header.open.app.antigravity":"Antigravity","session.header.open.app.terminal":"Terminal","session.header.open.app.iterm2":"iTerm2","session.header.open.app.ghostty":"Ghostty","session.header.open.app.warp":"Warp","session.header.open.app.xcode":"Xcode","session.header.open.app.androidStudio":"Android Studio","session.header.open.app.powershell":"PowerShell","session.header.open.app.sublimeText":"Sublime Text","status.popover.trigger":"Status","status.popover.ariaLabel":"Server configurations","status.popover.tab.servers":"Servers","status.popover.tab.mcp":"MCP","status.popover.tab.lsp":"LSP","status.popover.tab.plugins":"Plugins","status.popover.action.manageServers":"Manage servers","session.share.popover.title":"Publish on web","session.share.popover.description.shared":"This session is public on the web. It is accessible to anyone with the link.","session.share.popover.description.unshared":"Share session publicly on the web. It will be accessible to anyone with the link.","session.share.action.share":"Share","session.share.action.publish":"Publish","session.share.action.publishing":"Publishing...","session.share.action.unpublish":"Unpublish","session.share.action.unpublishing":"Unpublishing...","session.share.action.view":"View","session.share.copy.copied":"Copied","session.share.copy.copyLink":"Copy link","lsp.tooltip.none":"No LSP servers","lsp.label.connected":"{{count}} LSP","prompt.loading":"Loading prompt...","terminal.loading":"Loading terminal...","terminal.title":"Terminal","terminal.title.numbered":"Terminal {{number}}","terminal.close":"Close terminal","terminal.connectionLost.title":"Connection Lost","terminal.connectionLost.abnormalClose":"WebSocket closed abnormally: {{code}}","terminal.connectionLost.description":"The terminal connection was interrupted. This can happen when the server restarts.","common.closeTab":"Close tab","common.dismiss":"Dismiss","common.moreCountSuffix":" (+{{count}} more)","common.requestFailed":"Request failed","common.moreOptions":"More options","common.learnMore":"Learn more","common.rename":"Rename","common.reset":"Reset","common.archive":"Archive","common.delete":"Delete","common.close":"Close","common.edit":"Edit","common.loadMore":"Load more","common.key.esc":"ESC","common.key.ctrl":"Ctrl","common.key.alt":"Alt","common.key.shift":"Shift","common.key.meta":"Meta","common.key.space":"Space","common.key.backspace":"Backspace","common.key.enter":"Enter","common.key.tab":"Tab","common.key.delete":"Delete","common.key.home":"Home","common.key.end":"End","common.key.pageUp":"Page Up","common.key.pageDown":"Page Down","common.key.insert":"Insert","common.unknown":"unknown","common.time.justNow":"Just now","common.time.minutesAgo.short":"{{count}}m ago","common.time.hoursAgo.short":"{{count}}h ago","common.time.daysAgo.short":"{{count}}d ago","sidebar.menu.toggle":"Toggle menu","sidebar.nav.projectsAndSessions":"Projects and sessions","sidebar.settings":"Settings","sidebar.help":"Help","sidebar.workspaces.enable":"Enable workspaces","sidebar.workspaces.disable":"Disable workspaces","sidebar.gettingStarted.title":"Getting started","sidebar.gettingStarted.line1":"OpenCode includes free models so you can start immediately.","sidebar.gettingStarted.line2":"Connect any provider to use models, inc. Claude, GPT, Gemini etc.","sidebar.project.recentSessions":"Recent sessions","sidebar.project.viewAllSessions":"View all sessions","sidebar.project.clearNotifications":"Clear notifications","sidebar.empty.title":"No projects open","sidebar.empty.description":"Open a project to get started","debugBar.ariaLabel":"Development performance diagnostics","debugBar.na":"n/a","debugBar.nav.label":"NAV","debugBar.nav.tip":"Last completed route transition touching a session page, measured from router start until the first paint after it settles.","debugBar.fps.label":"FPS","debugBar.fps.tip":"Rolling frames per second over the last 5 seconds.","debugBar.frame.label":"FRAME","debugBar.frame.tip":"Worst frame time over the last 5 seconds.","debugBar.jank.label":"JANK","debugBar.jank.tip":"Frames over 32ms in the last 5 seconds.","debugBar.long.label":"LONG","debugBar.long.tip":"Blocked time and long-task count in the last 5 seconds. Max task: {{max}}.","debugBar.delay.label":"DELAY","debugBar.delay.tip":"Worst observed input delay in the last 5 seconds.","debugBar.inp.label":"INP","debugBar.inp.tip":"Approximate interaction duration over the last 5 seconds. This is INP-like, not the official Web Vitals INP.","debugBar.cls.label":"CLS","debugBar.cls.tip":"Cumulative layout shift for the current app lifetime.","debugBar.mem.label":"MEM","debugBar.mem.tipUnavailable":"Used JS heap vs heap limit. Chromium only.","debugBar.mem.tip":"Used JS heap vs heap limit. {{used}} of {{limit}}.","app.name.desktop":"OpenCode Desktop","settings.section.desktop":"Desktop","settings.section.server":"Server","settings.tab.general":"General","settings.tab.shortcuts":"Shortcuts","settings.desktop.section.wsl":"WSL","settings.desktop.wsl.title":"WSL integration","settings.desktop.wsl.description":"Run the OpenCode server inside WSL on Windows.","settings.general.section.appearance":"Appearance","settings.general.section.notifications":"System notifications","settings.general.section.updates":"Updates","settings.general.section.sounds":"Sound effects","settings.general.section.feed":"Feed","settings.general.section.display":"Display","settings.general.row.language.title":"Language","settings.general.row.language.description":"Change the display language for OpenCode","settings.general.row.appearance.title":"Appearance","settings.general.row.appearance.description":"Customise how OpenCode looks on your device","settings.general.row.colorScheme.title":"Color scheme","settings.general.row.colorScheme.description":"Choose whether OpenCode follows the system, light, or dark theme","settings.general.row.theme.title":"Theme","settings.general.row.theme.description":"Customise how OpenCode is themed.","settings.general.row.font.title":"Code Font","settings.general.row.font.description":"Customise the font used in code blocks and terminals","settings.general.row.uiFont.title":"UI Font","settings.general.row.uiFont.description":"Customise the font used throughout the interface","settings.general.row.followup.title":"Follow-up behavior","settings.general.row.followup.description":"Choose whether follow-up prompts steer immediately or wait in a queue","settings.general.row.followup.option.queue":"Queue","settings.general.row.followup.option.steer":"Steer","settings.general.row.reasoningSummaries.title":"Show reasoning summaries","settings.general.row.reasoningSummaries.description":"Display model reasoning summaries in the timeline","settings.general.row.shellToolPartsExpanded.title":"Expand shell tool parts","settings.general.row.shellToolPartsExpanded.description":"Show shell tool parts expanded by default in the timeline","settings.general.row.editToolPartsExpanded.title":"Expand edit tool parts","settings.general.row.editToolPartsExpanded.description":"Show edit, write, and patch tool parts expanded by default in the timeline","settings.general.row.wayland.title":"Use native Wayland","settings.general.row.wayland.description":"Disable X11 fallback on Wayland. Requires restart.","settings.general.row.wayland.tooltip":"On Linux with mixed refresh-rate monitors, native Wayland can be more stable.","settings.general.row.releaseNotes.title":"Release notes","settings.general.row.releaseNotes.description":"Show What's New popups after updates","settings.updates.row.startup.title":"Check for updates on startup","settings.updates.row.startup.description":"Automatically check for updates when OpenCode launches","settings.updates.row.check.title":"Check for updates","settings.updates.row.check.description":"Manually check for updates and install if available","settings.updates.action.checkNow":"Check now","settings.updates.action.checking":"Checking...","settings.updates.toast.latest.title":"You're up to date","settings.updates.toast.latest.description":"You're running the latest version of OpenCode.","sound.option.none":"None","sound.option.alert01":"Alert 01","sound.option.alert02":"Alert 02","sound.option.alert03":"Alert 03","sound.option.alert04":"Alert 04","sound.option.alert05":"Alert 05","sound.option.alert06":"Alert 06","sound.option.alert07":"Alert 07","sound.option.alert08":"Alert 08","sound.option.alert09":"Alert 09","sound.option.alert10":"Alert 10","sound.option.bipbop01":"Bip-bop 01","sound.option.bipbop02":"Bip-bop 02","sound.option.bipbop03":"Bip-bop 03","sound.option.bipbop04":"Bip-bop 04","sound.option.bipbop05":"Bip-bop 05","sound.option.bipbop06":"Bip-bop 06","sound.option.bipbop07":"Bip-bop 07","sound.option.bipbop08":"Bip-bop 08","sound.option.bipbop09":"Bip-bop 09","sound.option.bipbop10":"Bip-bop 10","sound.option.staplebops01":"Staplebops 01","sound.option.staplebops02":"Staplebops 02","sound.option.staplebops03":"Staplebops 03","sound.option.staplebops04":"Staplebops 04","sound.option.staplebops05":"Staplebops 05","sound.option.staplebops06":"Staplebops 06","sound.option.staplebops07":"Staplebops 07","sound.option.nope01":"Nope 01","sound.option.nope02":"Nope 02","sound.option.nope03":"Nope 03","sound.option.nope04":"Nope 04","sound.option.nope05":"Nope 05","sound.option.nope06":"Nope 06","sound.option.nope07":"Nope 07","sound.option.nope08":"Nope 08","sound.option.nope09":"Nope 09","sound.option.nope10":"Nope 10","sound.option.nope11":"Nope 11","sound.option.nope12":"Nope 12","sound.option.yup01":"Yup 01","sound.option.yup02":"Yup 02","sound.option.yup03":"Yup 03","sound.option.yup04":"Yup 04","sound.option.yup05":"Yup 05","sound.option.yup06":"Yup 06","settings.general.notifications.agent.title":"Agent","settings.general.notifications.agent.description":"Show system notification when the agent is complete or needs attention","settings.general.notifications.permissions.title":"Permissions","settings.general.notifications.permissions.description":"Show system notification when a permission is required","settings.general.notifications.errors.title":"Errors","settings.general.notifications.errors.description":"Show system notification when an error occurs","settings.general.sounds.agent.title":"Agent","settings.general.sounds.agent.description":"Play sound when the agent is complete or needs attention","settings.general.sounds.permissions.title":"Permissions","settings.general.sounds.permissions.description":"Play sound when a permission is required","settings.general.sounds.errors.title":"Errors","settings.general.sounds.errors.description":"Play sound when an error occurs","settings.shortcuts.title":"Keyboard shortcuts","settings.shortcuts.reset.button":"Reset to defaults","settings.shortcuts.reset.toast.title":"Shortcuts reset","settings.shortcuts.reset.toast.description":"Keyboard shortcuts have been reset to defaults.","settings.shortcuts.conflict.title":"Shortcut already in use","settings.shortcuts.conflict.description":"{{keybind}} is already assigned to {{titles}}.","settings.shortcuts.unassigned":"Unassigned","settings.shortcuts.pressKeys":"Press keys","settings.shortcuts.search.placeholder":"Search shortcuts","settings.shortcuts.search.empty":"No shortcuts found","settings.shortcuts.group.general":"General","settings.shortcuts.group.session":"Session","settings.shortcuts.group.navigation":"Navigation","settings.shortcuts.group.modelAndAgent":"Model and agent","settings.shortcuts.group.terminal":"Terminal","settings.shortcuts.group.prompt":"Prompt","settings.shortcuts.group.editor":"Editor","settings.shortcuts.group.file":"File","settings.shortcuts.group.view":"View","settings.shortcuts.group.app":"App","settings.shortcuts.group.ai":"AI","settings.providers.title":"Providers","settings.providers.description":"Provider settings will be configurable here.","settings.providers.section.connected":"Connected providers","settings.providers.connected.empty":"No connected providers","settings.providers.connected.environmentDescription":"Connected from your environment variables","settings.providers.section.popular":"Popular providers","settings.providers.custom.description":"Add an OpenAI-compatible provider by base URL.","settings.providers.tag.environment":"Environment","settings.providers.tag.config":"Config","settings.providers.tag.custom":"Custom","settings.providers.tag.other":"Other","settings.models.title":"Models","settings.models.description":"Model settings will be configurable here.","settings.agents.title":"Agents","settings.agents.description":"Agent settings will be configurable here.","settings.commands.title":"Commands","settings.commands.description":"Command settings will be configurable here.","settings.mcp.title":"MCP","settings.mcp.description":"MCP settings will be configurable here.","settings.permissions.title":"Permissions","settings.permissions.description":"Control what tools the server can use by default.","settings.permissions.section.tools":"Tools","settings.permissions.toast.updateFailed.title":"Failed to update permissions","settings.permissions.action.allow":"Allow","settings.permissions.action.ask":"Ask","settings.permissions.action.deny":"Deny","settings.permissions.tool.read.title":"Read","settings.permissions.tool.read.description":"Reading a file (matches the file path)","settings.permissions.tool.edit.title":"Edit","settings.permissions.tool.edit.description":"Modify files, including edits, writes, patches, and multi-edits","settings.permissions.tool.glob.title":"Glob","settings.permissions.tool.glob.description":"Match files using glob patterns","settings.permissions.tool.grep.title":"Grep","settings.permissions.tool.grep.description":"Search file contents using regular expressions","settings.permissions.tool.list.title":"List","settings.permissions.tool.list.description":"List files within a directory","settings.permissions.tool.bash.title":"Bash","settings.permissions.tool.bash.description":"Run shell commands","settings.permissions.tool.task.title":"Task","settings.permissions.tool.task.description":"Launch sub-agents","settings.permissions.tool.skill.title":"Skill","settings.permissions.tool.skill.description":"Load a skill by name","settings.permissions.tool.lsp.title":"LSP","settings.permissions.tool.lsp.description":"Run language server queries","settings.permissions.tool.todowrite.title":"Todo Write","settings.permissions.tool.todowrite.description":"Update the todo list","settings.permissions.tool.webfetch.title":"Web Fetch","settings.permissions.tool.webfetch.description":"Fetch content from a URL","settings.permissions.tool.websearch.title":"Web Search","settings.permissions.tool.websearch.description":"Search the web","settings.permissions.tool.codesearch.title":"Code Search","settings.permissions.tool.codesearch.description":"Search code on the web","settings.permissions.tool.external_directory.title":"External Directory","settings.permissions.tool.external_directory.description":"Access files outside the project directory","settings.permissions.tool.doom_loop.title":"Doom Loop","settings.permissions.tool.doom_loop.description":"Detect repeated tool calls with identical input","session.delete.failed.title":"Failed to delete session","session.delete.title":"Delete session","session.delete.confirm":'Delete session "{{name}}"?',"session.delete.button":"Delete session","workspace.new":"New workspace","workspace.type.local":"local","workspace.type.sandbox":"sandbox","workspace.create.failed.title":"Failed to create workspace","workspace.delete.failed.title":"Failed to delete workspace","workspace.resetting.title":"Resetting workspace","workspace.resetting.description":"This may take a minute.","workspace.reset.failed.title":"Failed to reset workspace","workspace.reset.success.title":"Workspace reset","workspace.reset.success.description":"Workspace now matches the default branch.","workspace.error.stillPreparing":"Workspace is still preparing","workspace.status.checking":"Checking for unmerged changes...","workspace.status.error":"Unable to verify git status.","workspace.status.clean":"No unmerged changes detected.","workspace.status.dirty":"Unmerged changes detected in this workspace.","workspace.delete.title":"Delete workspace","workspace.delete.confirm":'Delete workspace "{{name}}"?',"workspace.delete.button":"Delete workspace","workspace.reset.title":"Reset workspace","workspace.reset.confirm":'Reset workspace "{{name}}"?',"workspace.reset.button":"Reset workspace","workspace.reset.archived.none":"No active sessions will be archived.","workspace.reset.archived.one":"1 session will be archived.","workspace.reset.archived.many":"{{count}} sessions will be archived.","workspace.reset.note":"This will reset the workspace to match the default branch."};function rLt(e){return`oc_locale=${encodeURIComponent(e)}; Path=/; Max-Age=31536000; SameSite=Lax`}const wce=["en","zh","zht","ko","de","es","fr","da","ja","pl","ru","bs","ar","no","br","th","tr"],iLt={en:"en",zh:"zh-Hans",zht:"zh-Hant",ko:"ko",de:"de",es:"es",fr:"fr",da:"da",ja:"ja",pl:"pl",ru:"ru",ar:"ar",no:"nb-NO",br:"pt-BR",th:"th",bs:"bs",tr:"tr"},aLt={en:"language.en",zh:"language.zh",zht:"language.zht",ko:"language.ko",de:"language.de",es:"language.es",fr:"language.fr",da:"language.da",ja:"language.ja",pl:"language.pl",ru:"language.ru",ar:"language.ar",no:"language.no",br:"language.br",th:"language.th",bs:"language.bs",tr:"language.tr"},C2=fce({...bce,...Ire}),AB=new Map([["en",C2]]),$r=(e,t)=>Promise.all([e,t]).then(([n,r])=>({...C2,...fce({...n.dict,...r.dict})})),oLt={zh:()=>$r(z(()=>import("./zh-CibzNL3Z.js"),[]),z(()=>import("./zh-DqNk452I.js"),[])),zht:()=>$r(z(()=>import("./zht-DsVmxmyh.js"),[]),z(()=>import("./zht-CfMMeSr0.js"),[])),ko:()=>$r(z(()=>import("./ko-D9Z7tTxK.js"),[]),z(()=>import("./ko-Cz45-37g.js"),[])),de:()=>$r(z(()=>import("./de-BXo_WxK1.js"),[]),z(()=>import("./de-W5dPqUFm.js"),[])),es:()=>$r(z(()=>import("./es-DAHGSdnh.js"),[]),z(()=>import("./es-BKl1__G4.js"),[])),fr:()=>$r(z(()=>import("./fr-P_mrJW12.js"),[]),z(()=>import("./fr-BGWW507w.js"),[])),da:()=>$r(z(()=>import("./da--imEne2-.js"),[]),z(()=>import("./da-DKIMy0WC.js"),[])),ja:()=>$r(z(()=>import("./ja-8gbzy_Uq.js"),[]),z(()=>import("./ja-nNUG5Jbd.js"),[])),pl:()=>$r(z(()=>import("./pl-D8a1LVH2.js"),[]),z(()=>import("./pl-B1PbnQJF.js"),[])),ru:()=>$r(z(()=>import("./ru-BwS-kFcs.js"),[]),z(()=>import("./ru-Cz7sqdk-.js"),[])),ar:()=>$r(z(()=>import("./ar-DNixbgcA.js"),[]),z(()=>import("./ar-BBkUbD-U.js"),[])),no:()=>$r(z(()=>import("./no-BGj8YYYB.js"),[]),z(()=>import("./no-DQ9niEg2.js"),[])),br:()=>$r(z(()=>import("./br-BylU6CIZ.js"),[]),z(()=>import("./br-CZ3IHiCZ.js"),[])),th:()=>$r(z(()=>import("./th-sZWfOGpx.js"),[]),z(()=>import("./th-GkB0dxVv.js"),[])),bs:()=>$r(z(()=>import("./bs-Beusmqm9.js"),[]),z(()=>import("./bs-C7sqWY8X.js"),[])),tr:()=>$r(z(()=>import("./tr-BKF3NFWB.js"),[]),z(()=>import("./tr-EOOdZMuM.js"),[]))};function xce(e){const t=AB.get(e);if(t)return Promise.resolve(t);if(e==="en")return Promise.resolve(C2);const n=oLt[e];return n().then(r=>(AB.set(e,r),r))}const sLt=[{locale:"en",match:e=>e.startsWith("en")},{locale:"zht",match:e=>e.startsWith("zh")&&e.includes("hant")},{locale:"zh",match:e=>e.startsWith("zh")},{locale:"ko",match:e=>e.startsWith("ko")},{locale:"de",match:e=>e.startsWith("de")},{locale:"es",match:e=>e.startsWith("es")},{locale:"fr",match:e=>e.startsWith("fr")},{locale:"da",match:e=>e.startsWith("da")},{locale:"ja",match:e=>e.startsWith("ja")},{locale:"pl",match:e=>e.startsWith("pl")},{locale:"ru",match:e=>e.startsWith("ru")},{locale:"ar",match:e=>e.startsWith("ar")},{locale:"no",match:e=>e.startsWith("no")||e.startsWith("nb")||e.startsWith("nn")},{locale:"br",match:e=>e.startsWith("pt")},{locale:"th",match:e=>e.startsWith("th")},{locale:"bs",match:e=>e.startsWith("bs")},{locale:"tr",match:e=>e.startsWith("tr")}];function _ce(){if(typeof navigator!="object")return"en";const e=navigator.languages?.length?navigator.languages:[navigator.language];for(const t of e){if(!t)continue;const n=t.toLowerCase(),r=sLt.find(i=>i.match(n));if(r)return r.locale}return"en"}function $B(e){return wce.includes(e)?e:"en"}function Mce(){if(typeof localStorage=="object")try{const e=localStorage.getItem("opencode.global.dat:language");if(!e)return;const t=JSON.parse(e);return typeof t?.locale!="string"?void 0:$B(t.locale)}catch{return}}const OQ=Mce()??_ce();OQ!=="en"&&xce(OQ);const{use:_r,provider:lLt}=Nn({name:"Language",init:e=>{const t=e.locale??Mce()??_ce(),[n,r,i,a]=Jn(In.global("language",["language.v1"]),nt({locale:t})),o=Z(()=>$B(n.locale)),s=Z(()=>iLt[o()]),[l]=Yr(o,xce,{initialValue:AB.get(t)??C2}),c=WCt(()=>l()??C2,BCt),u=h=>c(aLt[h]);return he(()=>{typeof document=="object"&&(document.documentElement.lang=o(),document.cookie=rLt(o()))}),{ready:a,locale:o,intl:s,locales:wce,label:u,t:c,setLocale(h){r("locale",$B(h))}}}}),YJt="System Mono",JJt="System Sans",cLt='ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',dLt='ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',uLt=cLt,hLt=dLt;function Sce(e){return e??""}function fLt(e){return/^[\w-]+$/.test(e)?e:`"${e.replaceAll("\\","\\\\").replaceAll('"','\\"')}"`}function Cce(e,t){const n=e?.trim()??"";return n?`${fLt(n)}, ${t}`:t}function QJt(e){return Sce(e)}function eQt(e){return Sce(e)}function pLt(e){return Cce(e,uLt)}function mLt(e){return Cce(e,hLt)}const Tn={general:{autoSave:!0,releaseNotes:!0,followup:"steer",showReasoningSummaries:!0,shellToolPartsExpanded:!0,editToolPartsExpanded:!0},updates:{startup:!0},appearance:{fontSize:14,mono:"",sans:""},keybinds:{"settings.open":"mod+shift+,","settings.shortcuts":"mod+shift+k","session.previous":"mod+,","session.next":"mod+.","file.open":"alt+space,mod+p","tab.close":"mod+w,alt+x,ctrl+x","file.save":"mod+s","file.saveAll":"mod+shift+s","file.new":"mod+n","folder.new":"mod+alt+n","file.findInFiles":"mod+shift+f","tab.moveLeft":"mod+alt+arrowleft,alt+,","tab.moveRight":"mod+alt+arrowright,alt+.","editor.format":"alt+f","editor.quickFix":"alt+q","editor.find":"mod+f","editor.replace":"mod+alt+f","editor.gotoLine":"mod+g","editor.foldAll":"mod+shift+j","editor.unfoldAll":"mod+shift+h","editor.selectToBracket":"alt+shift+]","editor.smartSelect.expand":"mod+shift+arrowright","editor.smartSelect.shrink":"mod+shift+arrowleft","editor.commentLine":"mod+/","editor.deleteLines":"mod+shift+k","editor.copyFilePath":"mod+shift+c","editor.fontZoomIn":"mod+alt+=","editor.fontZoomOut":"mod+alt+-","editor.fontZoomReset":"alt+0","terminal.fontZoomIn":"mod+ctrl+alt+=","terminal.fontZoomOut":"mod+ctrl+alt+-","view.toggleMinimap":"mod+shift+m,mod+alt+m","view.toggleMaximizedPanel":"ctrl+tab","view.toggleActivityBar":"mod+shift+b","view.toggleStatusBar":"ctrl+mod+s","app.quit":"mod+alt+q","app.reload":"mod+shift+alt+r","app.restart":"mod+shift+r","theme.toggleLightDark":"mod+shift+alt+t"},permissions:{autoApprove:!1},notifications:{agent:!0,permissions:!0,errors:!1},sounds:{agentEnabled:!0,agent:"staplebops-01",permissionsEnabled:!0,permissions:"staplebops-02",errorsEnabled:!0,errors:"nope-03"}};function Vn(e,t){return Z(()=>e()??t)}const RQ="mod+w,alt+x",zQ=Tn.keybinds["tab.close"],{use:sm,provider:gLt}=Nn({name:"Settings",init:()=>{const[e,t,n,r]=Jn("settings.v3",nt(Tn));return he(()=>{e.keybinds?.["tab.close"]===RQ&&zQ!==RQ&&t("keybinds","tab.close",zQ)}),he(()=>{if(typeof document>"u")return;const i=document.documentElement;i.style.setProperty("--font-family-mono",pLt(e.appearance?.mono)),i.style.setProperty("--font-family-sans",mLt(e.appearance?.sans))}),{ready:r,get current(){return e},general:{autoSave:Vn(()=>e.general?.autoSave,Tn.general.autoSave),setAutoSave(i){t("general","autoSave",i)},releaseNotes:Vn(()=>e.general?.releaseNotes,Tn.general.releaseNotes),setReleaseNotes(i){t("general","releaseNotes",i)},followup:Vn(()=>e.general?.followup,Tn.general.followup),setFollowup(i){t("general","followup",i)},showReasoningSummaries:Vn(()=>e.general?.showReasoningSummaries,Tn.general.showReasoningSummaries),setShowReasoningSummaries(i){t("general","showReasoningSummaries",i)},shellToolPartsExpanded:Vn(()=>e.general?.shellToolPartsExpanded,Tn.general.shellToolPartsExpanded),setShellToolPartsExpanded(i){t("general","shellToolPartsExpanded",i)},editToolPartsExpanded:Vn(()=>e.general?.editToolPartsExpanded,Tn.general.editToolPartsExpanded),setEditToolPartsExpanded(i){t("general","editToolPartsExpanded",i)}},updates:{startup:Vn(()=>e.updates?.startup,Tn.updates.startup),setStartup(i){t("updates","startup",i)}},appearance:{fontSize:Vn(()=>e.appearance?.fontSize,Tn.appearance.fontSize),setFontSize(i){t("appearance","fontSize",i)},font:Vn(()=>e.appearance?.mono,Tn.appearance.mono),setFont(i){t("appearance","mono",i.trim()?i:"")},uiFont:Vn(()=>e.appearance?.sans,Tn.appearance.sans),setUIFont(i){t("appearance","sans",i.trim()?i:"")}},keybinds:{get:i=>e.keybinds?.[i],set(i,a){t("keybinds",i,a)},reset(i){t("keybinds",a=>{if(!Object.prototype.hasOwnProperty.call(a,i))return a;const o={...a};return delete o[i],o})},resetAll(){t("keybinds",Ct({}))}},permissions:{autoApprove:Vn(()=>e.permissions?.autoApprove,Tn.permissions.autoApprove),setAutoApprove(i){t("permissions","autoApprove",i)}},notifications:{agent:Vn(()=>e.notifications?.agent,Tn.notifications.agent),setAgent(i){t("notifications","agent",i)},permissions:Vn(()=>e.notifications?.permissions,Tn.notifications.permissions),setPermissions(i){t("notifications","permissions",i)},errors:Vn(()=>e.notifications?.errors,Tn.notifications.errors),setErrors(i){t("notifications","errors",i)}},sounds:{agentEnabled:Vn(()=>e.sounds?.agentEnabled,Tn.sounds.agentEnabled),setAgentEnabled(i){t("sounds","agentEnabled",i)},agent:Vn(()=>e.sounds?.agent,Tn.sounds.agent),setAgent(i){t("sounds","agent",i)},permissionsEnabled:Vn(()=>e.sounds?.permissionsEnabled,Tn.sounds.permissionsEnabled),setPermissionsEnabled(i){t("sounds","permissionsEnabled",i)},permissions:Vn(()=>e.sounds?.permissions,Tn.sounds.permissions),setPermissions(i){t("sounds","permissions",i)},errorsEnabled:Vn(()=>e.sounds?.errorsEnabled,Tn.sounds.errorsEnabled),setErrorsEnabled(i){t("sounds","errorsEnabled",i)},errors:Vn(()=>e.sounds?.errors,Tn.sounds.errors),setErrors(i){t("sounds","errors",i)}}}}}),hh=typeof navigator=="object"&&/(Mac|iPod|iPhone|iPad)/.test(navigator.platform),gF="command.palette",qQ="mod+shift+p",Sz="suggested.",yLt=new Set(["terminal.toggle","terminal.new","file.attach"]);function lp(e,t){return t?t(e):bce[e]}function fh(e){return e.startsWith(Sz)?e.slice(Sz.length):e}function Lce(e){return e===","?"comma":e==="+"?"plus":e===" "?"space":e.toLowerCase()}function TB(e,t,n,r,i){const a=(t?1:0)|(n?2:0)|(r?4:0)|(i?8:0);return`${e}:${a}`}function vLt(e){return TB(Lce(e.key),e.ctrlKey,e.metaKey,e.shiftKey,e.altKey)}function kLt(e){return e?yLt.has(fh(e)):!1}function bLt(e,t){return t.key===void 0?[t,...e]:[t,...e.filter(n=>n.key!==t.key)]}function EB(e){return!e||e==="none"?[]:e.split(",").map(t=>{const n=t.trim().toLowerCase().split("+"),r={key:"",ctrl:!1,meta:!1,shift:!1,alt:!1};for(const i of n)switch(i){case"ctrl":case"control":r.ctrl=!0;break;case"meta":case"cmd":case"command":r.meta=!0;break;case"mod":hh?r.meta=!0:r.ctrl=!0;break;case"alt":case"option":r.alt=!0;break;case"shift":r.shift=!0;break;default:r.key=i;break}return r})}function tQt(e,t){const n=Lce(t.key);for(const r of e){const i=r.key===n,a=r.ctrl===(t.ctrlKey||!1),o=r.meta===(t.metaKey||!1),s=r.shift===(t.shiftKey||!1),l=r.alt===(t.altKey||!1);if(i&&a&&o&&s&&l)return!0}return!1}function yF(e,t){if(!e||e==="none")return"";const n=EB(e);if(n.length===0)return"";const r=n[0],i=[];if(r.ctrl&&i.push(hh?"⌃":lp("common.key.ctrl",t)),r.alt&&i.push(hh?"⌥":lp("common.key.alt",t)),r.shift&&i.push(hh?"⇧":lp("common.key.shift",t)),r.meta&&i.push(hh?"⌘":lp("common.key.meta",t)),r.key){const a={arrowup:"↑",arrowdown:"↓",arrowleft:"←",arrowright:"→",comma:",",plus:"+"},o={backspace:"common.key.backspace",delete:"common.key.delete",end:"common.key.end",enter:"common.key.enter",esc:"common.key.esc",escape:"common.key.esc",home:"common.key.home",insert:"common.key.insert",pagedown:"common.key.pageDown",pageup:"common.key.pageUp",space:"common.key.space",tab:"common.key.tab"},s=r.key.toLowerCase(),l=a[s]??(o[s]?lp(o[s],t):s.length===1?s.toUpperCase():s.charAt(0).toUpperCase()+s.slice(1));i.push(l)}return hh?i.join(""):i.join("+")}function wLt(e){return e instanceof HTMLElement?!!(e.isContentEditable||e.closest("[contenteditable='true']")||e.closest("input, textarea, select")):!1}const{use:Ice,provider:xLt}=Nn({name:"Command",init:()=>{const e=lf(),t=sm(),n=_r(),[r,i]=nt({registrations:[],suspendCount:0}),[a,o,s,l]=Jn(In.global("command.catalog.v1"),nt({})),c=(_,C)=>{const S=t.keybinds.get(fh(_))??C;if(!(!S||S==="none"))return S},u=Z(()=>{const _=new Set,C=[];for(const L of r.registrations)for(const S of L.options())_.has(S.id)||(_.add(S.id),C.push(S));return C});he(()=>{l()&&o(u().reduce((_,C)=>{const L=fh(C.id);return _[L]={title:C.title,description:C.description,category:C.category,keybind:C.keybind,slash:C.slash},_},{}))});const h=Z(()=>Object.entries(a).map(([_,C])=>({id:_,...C}))),m=Z(()=>{const _=u().map(L=>({...L,keybind:c(L.id,L.keybind)}));return[..._.filter(L=>L.suggested&&!L.disabled).map(L=>({...L,id:Sz+L.id,category:n.t("command.category.suggested")})),..._]}),g=()=>r.suspendCount>0,y=Z(()=>{const _=t.keybinds.get(gF)??qQ,C=EB(_);return new Set(C.map(L=>TB(L.key,L.ctrl,L.meta,L.shift,L.alt)))}),v=Z(()=>{const _=new Map;for(const C of m()){if(C.id.startsWith(Sz)||C.disabled||!C.keybind)continue;const L=EB(C.keybind);for(const S of L){if(!S.key)continue;const I=TB(S.key,S.ctrl,S.meta,S.shift,S.alt);_.has(I)||_.set(I,C)}}return _}),k=Z(()=>{const _=new Map;for(const C of m())_.set(C.id,C),_.set(fh(C.id),C);return _}),b=(_,C)=>{k().get(_)?.onSelect?.(C)},x=()=>{b("file.open","palette")},w=_=>{if(g()||e.active)return;const C=vLt(_),L=y().has(C),S=v().get(C),I=_.ctrlKey||_.metaKey||_.altKey,A=_.key==="Tab";if(!(wLt(_.target)&&!L&&!kLt(S?.id)&&!I&&!A)){if(L){_.preventDefault(),x();return}S&&(_.preventDefault(),S.onSelect?.("keybind"))}};dn(()=>{document.addEventListener("keydown",w)}),me(()=>{document.removeEventListener("keydown",w)});function M(_,C){const L=typeof _=="string"?_:void 0,S=typeof _=="function"?_:C;if(!S)return;const I=Z(S),A={key:L,options:I};i("registrations",D=>bLt(D,A)),me(()=>{i("registrations",D=>D.filter(P=>P!==A))})}return{register:M,trigger(_,C){b(_,C)},keybind(_){if(_===gF)return yF(t.keybinds.get(gF)??qQ,n.t);const C=fh(_),L=m().find(A=>fh(A.id)===C);if(L?.keybind)return yF(L.keybind,n.t);const S=a[C],I=c(C,S?.keybind);return I?yF(I,n.t):""},show:x,keybinds(_){i("suspendCount",C=>Math.max(0,C+(_?-1:1)))},suspended:g,get catalog(){return h()},get options(){return m()}}}});function Nce(e,t={}){const n=new Map,r=t.now??Date.now,i=(g,y)=>{t.dispose?.(y.value,g)},a=g=>t.ttlMs===void 0?!1:r()-g.touchedAt>=t.ttlMs,o=()=>{if(t.ttlMs!==void 0)for(const[g,y]of n)a(y)&&(n.delete(g),i(g,y))},s=(g,y)=>{y.touchedAt=r(),n.delete(g),n.set(g,y)},l=()=>{if(t.maxEntries!==void 0)for(;n.size>t.maxEntries;){const g=n.keys().next().value;if(!g)return;const y=n.get(g);n.delete(g),y&&i(g,y)}};return{get:g=>{o();const y=n.get(g);if(y&&!a(y))return s(g,y),y.value;y&&(n.delete(g),i(g,y));const v={value:e(g),touchedAt:r()};return n.set(g,v),l(),v.value},peek:g=>{o();const y=n.get(g);if(y){if(!a(y))return y.value;n.delete(g),i(g,y)}},delete:g=>{const y=n.get(g);if(y)return n.delete(g),i(g,y),y.value},clear:()=>{for(const[g,y]of n)i(g,y);n.clear()}}}const vF=()=>Math.random().toString(16).slice(2);function _Lt(){const e=globalThis.crypto;if(!e||typeof e.randomUUID!="function"||typeof globalThis.isSecureContext=="boolean"&&!globalThis.isSecureContext)return vF();try{return e.randomUUID()}catch{return vF()}}const vG="__workspace__",MLt=20;function SLt(e,t){return`${e}
|
|
2476
|
+
{{message}}`,"error.chain.configInvalid":"Config file at {{path}} is invalid","error.chain.configInvalidWithMessage":"Config file at {{path}} is invalid: {{message}}","notification.permission.title":"Permission required","notification.permission.description":"{{sessionTitle}} in {{projectName}} needs permission","notification.question.title":"Question","notification.question.description":"{{sessionTitle}} in {{projectName}} has a question","notification.action.goToSession":"Go to session","notification.session.responseReady.title":"Response ready","notification.session.error.title":"Session error","notification.session.error.fallbackDescription":"An error occurred","home.recentProjects":"Recent projects","home.empty.title":"No recent projects","home.empty.description":"Get started by opening a local project","session.tab.session":"Session","session.tab.review":"Review","session.tab.track":"Track","session.tab.code":"Code","session.tab.context":"Context","session.panel.reviewAndFiles":"Review and files","session.review.filesChanged":"{{count}} Files Changed","session.review.change.one":"Change","session.review.change.other":"Changes","session.review.loadingChanges":"Loading changes...","session.review.empty":"No changes in this session yet","session.review.noVcs":"No Git Version Control System detected, changes not displayed","session.review.noVcs.createGit.title":"Create a Git repository","session.review.noVcs.createGit.description":"Track, review, and undo changes in this project","session.review.noVcs.createGit.actionLoading":"Creating Git repository...","session.review.noVcs.createGit.action":"Create Git repository","session.review.noSnapshot":"Snapshot tracking is disabled in config, so session changes are unavailable","session.review.noChanges":"No changes","session.files.selectToOpen":"Select a file to get started","session.files.all":"All files","session.files.empty":"No files","session.fileTree.newFile":"New File","session.fileTree.newFolder":"New Folder","session.fileTree.expandAll":"Expand All","session.fileTree.collapseAll":"Collapse All","session.fileTree.refresh":"Refresh","session.files.binaryContent":"Binary file (content cannot be displayed)","session.messages.renderEarlier":"Render earlier messages","session.messages.loadingEarlier":"Loading earlier messages...","session.messages.loadEarlier":"Load earlier messages","session.messages.loading":"Loading messages...","session.messages.jumpToLatest":"Jump to latest","session.context.addToContext":"Add {{selection}} to context","session.todo.title":"Todos","session.todo.collapse":"Collapse","session.todo.expand":"Expand","session.todo.progress":"{{done}} of {{total}} todos completed","session.question.progress":"{{current}} of {{total}} questions","session.followupDock.summary.one":"{{count}} queued message","session.followupDock.summary.other":"{{count}} queued messages","session.followupDock.sendNow":"Send now","session.followupDock.edit":"Edit","session.followupDock.collapse":"Collapse queued messages","session.followupDock.expand":"Expand queued messages","session.revertDock.summary.one":"{{count}} rolled back message","session.revertDock.summary.other":"{{count}} rolled back messages","session.revertDock.collapse":"Collapse rolled back messages","session.revertDock.expand":"Expand rolled back messages","session.revertDock.restore":"Restore message","session.changeDock.title.one":"1 file changed","session.changeDock.title.other":"{{count}} files changed","session.changeDock.collapse":"Collapse changed files","session.changeDock.expand":"Expand changed files","session.changeDock.accept":"Accept all","session.changeDock.reject":"Reject all","session.new.title":"Build anything","session.new.worktree.main":"Main branch","session.new.worktree.mainWithBranch":"Main branch ({{branch}})","session.new.worktree.create":"Create new worktree","session.new.lastModified":"Last modified","session.header.search.placeholder":"Search {{project}}","session.header.searchFiles":"Search files","session.header.openIn":"Open in","session.header.open.action":"Open {{app}}","session.header.open.ariaLabel":"Open in {{app}}","session.header.open.menu":"Open options","session.header.open.copyPath":"Copy path","session.header.open.finder":"Finder","session.header.open.fileExplorer":"File Explorer","session.header.open.fileManager":"File Manager","session.header.open.app.vscode":"VS Code","session.header.open.app.cursor":"Cursor","session.header.open.app.zed":"Zed","session.header.open.app.textmate":"TextMate","session.header.open.app.antigravity":"Antigravity","session.header.open.app.terminal":"Terminal","session.header.open.app.iterm2":"iTerm2","session.header.open.app.ghostty":"Ghostty","session.header.open.app.warp":"Warp","session.header.open.app.xcode":"Xcode","session.header.open.app.androidStudio":"Android Studio","session.header.open.app.powershell":"PowerShell","session.header.open.app.sublimeText":"Sublime Text","status.popover.trigger":"Status","status.popover.ariaLabel":"Server configurations","status.popover.tab.servers":"Servers","status.popover.tab.mcp":"MCP","status.popover.tab.lsp":"LSP","status.popover.tab.plugins":"Plugins","status.popover.action.manageServers":"Manage servers","session.share.popover.title":"Publish on web","session.share.popover.description.shared":"This session is public on the web. It is accessible to anyone with the link.","session.share.popover.description.unshared":"Share session publicly on the web. It will be accessible to anyone with the link.","session.share.action.share":"Share","session.share.action.publish":"Publish","session.share.action.publishing":"Publishing...","session.share.action.unpublish":"Unpublish","session.share.action.unpublishing":"Unpublishing...","session.share.action.view":"View","session.share.copy.copied":"Copied","session.share.copy.copyLink":"Copy link","lsp.tooltip.none":"No LSP servers","lsp.label.connected":"{{count}} LSP","prompt.loading":"Loading prompt...","terminal.loading":"Loading terminal...","terminal.title":"Terminal","terminal.title.numbered":"Terminal {{number}}","terminal.close":"Close terminal","terminal.connectionLost.title":"Connection Lost","terminal.connectionLost.abnormalClose":"WebSocket closed abnormally: {{code}}","terminal.connectionLost.description":"The terminal connection was interrupted. This can happen when the server restarts.","common.closeTab":"Close tab","common.dismiss":"Dismiss","common.moreCountSuffix":" (+{{count}} more)","common.requestFailed":"Request failed","common.moreOptions":"More options","common.learnMore":"Learn more","common.rename":"Rename","common.reset":"Reset","common.archive":"Archive","common.delete":"Delete","common.close":"Close","common.edit":"Edit","common.loadMore":"Load more","common.key.esc":"ESC","common.key.ctrl":"Ctrl","common.key.alt":"Alt","common.key.shift":"Shift","common.key.meta":"Meta","common.key.space":"Space","common.key.backspace":"Backspace","common.key.enter":"Enter","common.key.tab":"Tab","common.key.delete":"Delete","common.key.home":"Home","common.key.end":"End","common.key.pageUp":"Page Up","common.key.pageDown":"Page Down","common.key.insert":"Insert","common.unknown":"unknown","common.time.justNow":"Just now","common.time.minutesAgo.short":"{{count}}m ago","common.time.hoursAgo.short":"{{count}}h ago","common.time.daysAgo.short":"{{count}}d ago","sidebar.menu.toggle":"Toggle menu","sidebar.nav.projectsAndSessions":"Projects and sessions","sidebar.settings":"Settings","sidebar.help":"Help","sidebar.workspaces.enable":"Enable workspaces","sidebar.workspaces.disable":"Disable workspaces","sidebar.gettingStarted.title":"Getting started","sidebar.gettingStarted.line1":"OpenCode includes free models so you can start immediately.","sidebar.gettingStarted.line2":"Connect any provider to use models, inc. Claude, GPT, Gemini etc.","sidebar.project.recentSessions":"Recent sessions","sidebar.project.viewAllSessions":"View all sessions","sidebar.project.clearNotifications":"Clear notifications","sidebar.empty.title":"No projects open","sidebar.empty.description":"Open a project to get started","debugBar.ariaLabel":"Development performance diagnostics","debugBar.na":"n/a","debugBar.nav.label":"NAV","debugBar.nav.tip":"Last completed route transition touching a session page, measured from router start until the first paint after it settles.","debugBar.fps.label":"FPS","debugBar.fps.tip":"Rolling frames per second over the last 5 seconds.","debugBar.frame.label":"FRAME","debugBar.frame.tip":"Worst frame time over the last 5 seconds.","debugBar.jank.label":"JANK","debugBar.jank.tip":"Frames over 32ms in the last 5 seconds.","debugBar.long.label":"LONG","debugBar.long.tip":"Blocked time and long-task count in the last 5 seconds. Max task: {{max}}.","debugBar.delay.label":"DELAY","debugBar.delay.tip":"Worst observed input delay in the last 5 seconds.","debugBar.inp.label":"INP","debugBar.inp.tip":"Approximate interaction duration over the last 5 seconds. This is INP-like, not the official Web Vitals INP.","debugBar.cls.label":"CLS","debugBar.cls.tip":"Cumulative layout shift for the current app lifetime.","debugBar.mem.label":"MEM","debugBar.mem.tipUnavailable":"Used JS heap vs heap limit. Chromium only.","debugBar.mem.tip":"Used JS heap vs heap limit. {{used}} of {{limit}}.","app.name.desktop":"OpenCode Desktop","settings.section.desktop":"Desktop","settings.section.server":"Server","settings.tab.general":"General","settings.tab.shortcuts":"Shortcuts","settings.desktop.section.wsl":"WSL","settings.desktop.wsl.title":"WSL integration","settings.desktop.wsl.description":"Run the OpenCode server inside WSL on Windows.","settings.general.section.appearance":"Appearance","settings.general.section.notifications":"System notifications","settings.general.section.updates":"Updates","settings.general.section.sounds":"Sound effects","settings.general.section.feed":"Feed","settings.general.section.display":"Display","settings.general.row.language.title":"Language","settings.general.row.language.description":"Change the display language for OpenCode","settings.general.row.appearance.title":"Appearance","settings.general.row.appearance.description":"Customise how OpenCode looks on your device","settings.general.row.colorScheme.title":"Color scheme","settings.general.row.colorScheme.description":"Choose whether OpenCode follows the system, light, or dark theme","settings.general.row.theme.title":"Theme","settings.general.row.theme.description":"Customise how OpenCode is themed.","settings.general.row.font.title":"Code Font","settings.general.row.font.description":"Customise the font used in code blocks and terminals","settings.general.row.uiFont.title":"UI Font","settings.general.row.uiFont.description":"Customise the font used throughout the interface","settings.general.row.followup.title":"Follow-up behavior","settings.general.row.followup.description":"Choose whether follow-up prompts steer immediately or wait in a queue","settings.general.row.followup.option.queue":"Queue","settings.general.row.followup.option.steer":"Steer","settings.general.row.reasoningSummaries.title":"Show reasoning summaries","settings.general.row.reasoningSummaries.description":"Display model reasoning summaries in the timeline","settings.general.row.shellToolPartsExpanded.title":"Expand shell tool parts","settings.general.row.shellToolPartsExpanded.description":"Show shell tool parts expanded by default in the timeline","settings.general.row.editToolPartsExpanded.title":"Expand edit tool parts","settings.general.row.editToolPartsExpanded.description":"Show edit, write, and patch tool parts expanded by default in the timeline","settings.general.row.wayland.title":"Use native Wayland","settings.general.row.wayland.description":"Disable X11 fallback on Wayland. Requires restart.","settings.general.row.wayland.tooltip":"On Linux with mixed refresh-rate monitors, native Wayland can be more stable.","settings.general.row.releaseNotes.title":"Release notes","settings.general.row.releaseNotes.description":"Show What's New popups after updates","settings.updates.row.startup.title":"Check for updates on startup","settings.updates.row.startup.description":"Automatically check for updates when OpenCode launches","settings.updates.row.check.title":"Check for updates","settings.updates.row.check.description":"Manually check for updates and install if available","settings.updates.action.checkNow":"Check now","settings.updates.action.checking":"Checking...","settings.updates.toast.latest.title":"You're up to date","settings.updates.toast.latest.description":"You're running the latest version of OpenCode.","sound.option.none":"None","sound.option.alert01":"Alert 01","sound.option.alert02":"Alert 02","sound.option.alert03":"Alert 03","sound.option.alert04":"Alert 04","sound.option.alert05":"Alert 05","sound.option.alert06":"Alert 06","sound.option.alert07":"Alert 07","sound.option.alert08":"Alert 08","sound.option.alert09":"Alert 09","sound.option.alert10":"Alert 10","sound.option.bipbop01":"Bip-bop 01","sound.option.bipbop02":"Bip-bop 02","sound.option.bipbop03":"Bip-bop 03","sound.option.bipbop04":"Bip-bop 04","sound.option.bipbop05":"Bip-bop 05","sound.option.bipbop06":"Bip-bop 06","sound.option.bipbop07":"Bip-bop 07","sound.option.bipbop08":"Bip-bop 08","sound.option.bipbop09":"Bip-bop 09","sound.option.bipbop10":"Bip-bop 10","sound.option.staplebops01":"Staplebops 01","sound.option.staplebops02":"Staplebops 02","sound.option.staplebops03":"Staplebops 03","sound.option.staplebops04":"Staplebops 04","sound.option.staplebops05":"Staplebops 05","sound.option.staplebops06":"Staplebops 06","sound.option.staplebops07":"Staplebops 07","sound.option.nope01":"Nope 01","sound.option.nope02":"Nope 02","sound.option.nope03":"Nope 03","sound.option.nope04":"Nope 04","sound.option.nope05":"Nope 05","sound.option.nope06":"Nope 06","sound.option.nope07":"Nope 07","sound.option.nope08":"Nope 08","sound.option.nope09":"Nope 09","sound.option.nope10":"Nope 10","sound.option.nope11":"Nope 11","sound.option.nope12":"Nope 12","sound.option.yup01":"Yup 01","sound.option.yup02":"Yup 02","sound.option.yup03":"Yup 03","sound.option.yup04":"Yup 04","sound.option.yup05":"Yup 05","sound.option.yup06":"Yup 06","settings.general.notifications.agent.title":"Agent","settings.general.notifications.agent.description":"Show system notification when the agent is complete or needs attention","settings.general.notifications.permissions.title":"Permissions","settings.general.notifications.permissions.description":"Show system notification when a permission is required","settings.general.notifications.errors.title":"Errors","settings.general.notifications.errors.description":"Show system notification when an error occurs","settings.general.sounds.agent.title":"Agent","settings.general.sounds.agent.description":"Play sound when the agent is complete or needs attention","settings.general.sounds.permissions.title":"Permissions","settings.general.sounds.permissions.description":"Play sound when a permission is required","settings.general.sounds.errors.title":"Errors","settings.general.sounds.errors.description":"Play sound when an error occurs","settings.shortcuts.title":"Keyboard shortcuts","settings.shortcuts.reset.button":"Reset to defaults","settings.shortcuts.reset.toast.title":"Shortcuts reset","settings.shortcuts.reset.toast.description":"Keyboard shortcuts have been reset to defaults.","settings.shortcuts.conflict.title":"Shortcut already in use","settings.shortcuts.conflict.description":"{{keybind}} is already assigned to {{titles}}.","settings.shortcuts.unassigned":"Unassigned","settings.shortcuts.pressKeys":"Press keys","settings.shortcuts.search.placeholder":"Search shortcuts","settings.shortcuts.search.empty":"No shortcuts found","settings.shortcuts.group.general":"General","settings.shortcuts.group.session":"Session","settings.shortcuts.group.navigation":"Navigation","settings.shortcuts.group.modelAndAgent":"Model and agent","settings.shortcuts.group.terminal":"Terminal","settings.shortcuts.group.prompt":"Prompt","settings.shortcuts.group.editor":"Editor","settings.shortcuts.group.file":"File","settings.shortcuts.group.view":"View","settings.shortcuts.group.app":"App","settings.shortcuts.group.ai":"AI","settings.providers.title":"Providers","settings.providers.description":"Provider settings will be configurable here.","settings.providers.section.connected":"Connected providers","settings.providers.connected.empty":"No connected providers","settings.providers.connected.environmentDescription":"Connected from your environment variables","settings.providers.section.popular":"Popular providers","settings.providers.custom.description":"Add an OpenAI-compatible provider by base URL.","settings.providers.tag.environment":"Environment","settings.providers.tag.config":"Config","settings.providers.tag.custom":"Custom","settings.providers.tag.other":"Other","settings.models.title":"Models","settings.models.description":"Model settings will be configurable here.","settings.agents.title":"Agents","settings.agents.description":"Agent settings will be configurable here.","settings.commands.title":"Commands","settings.commands.description":"Command settings will be configurable here.","settings.mcp.title":"MCP","settings.mcp.description":"MCP settings will be configurable here.","settings.permissions.title":"Permissions","settings.permissions.description":"Control what tools the server can use by default.","settings.permissions.section.tools":"Tools","settings.permissions.toast.updateFailed.title":"Failed to update permissions","settings.permissions.action.allow":"Allow","settings.permissions.action.ask":"Ask","settings.permissions.action.deny":"Deny","settings.permissions.tool.read.title":"Read","settings.permissions.tool.read.description":"Reading a file (matches the file path)","settings.permissions.tool.edit.title":"Edit","settings.permissions.tool.edit.description":"Modify files, including edits, writes, patches, and multi-edits","settings.permissions.tool.glob.title":"Glob","settings.permissions.tool.glob.description":"Match files using glob patterns","settings.permissions.tool.grep.title":"Grep","settings.permissions.tool.grep.description":"Search file contents using regular expressions","settings.permissions.tool.list.title":"List","settings.permissions.tool.list.description":"List files within a directory","settings.permissions.tool.bash.title":"Bash","settings.permissions.tool.bash.description":"Run shell commands","settings.permissions.tool.task.title":"Task","settings.permissions.tool.task.description":"Launch sub-agents","settings.permissions.tool.skill.title":"Skill","settings.permissions.tool.skill.description":"Load a skill by name","settings.permissions.tool.lsp.title":"LSP","settings.permissions.tool.lsp.description":"Run language server queries","settings.permissions.tool.todowrite.title":"Todo Write","settings.permissions.tool.todowrite.description":"Update the todo list","settings.permissions.tool.webfetch.title":"Web Fetch","settings.permissions.tool.webfetch.description":"Fetch content from a URL","settings.permissions.tool.websearch.title":"Web Search","settings.permissions.tool.websearch.description":"Search the web","settings.permissions.tool.codesearch.title":"Code Search","settings.permissions.tool.codesearch.description":"Search code on the web","settings.permissions.tool.external_directory.title":"External Directory","settings.permissions.tool.external_directory.description":"Access files outside the project directory","settings.permissions.tool.doom_loop.title":"Doom Loop","settings.permissions.tool.doom_loop.description":"Detect repeated tool calls with identical input","session.delete.failed.title":"Failed to delete session","session.delete.title":"Delete session","session.delete.confirm":'Delete session "{{name}}"?',"session.delete.button":"Delete session","workspace.new":"New workspace","workspace.type.local":"local","workspace.type.sandbox":"sandbox","workspace.create.failed.title":"Failed to create workspace","workspace.delete.failed.title":"Failed to delete workspace","workspace.resetting.title":"Resetting workspace","workspace.resetting.description":"This may take a minute.","workspace.reset.failed.title":"Failed to reset workspace","workspace.reset.success.title":"Workspace reset","workspace.reset.success.description":"Workspace now matches the default branch.","workspace.error.stillPreparing":"Workspace is still preparing","workspace.status.checking":"Checking for unmerged changes...","workspace.status.error":"Unable to verify git status.","workspace.status.clean":"No unmerged changes detected.","workspace.status.dirty":"Unmerged changes detected in this workspace.","workspace.delete.title":"Delete workspace","workspace.delete.confirm":'Delete workspace "{{name}}"?',"workspace.delete.button":"Delete workspace","workspace.reset.title":"Reset workspace","workspace.reset.confirm":'Reset workspace "{{name}}"?',"workspace.reset.button":"Reset workspace","workspace.reset.archived.none":"No active sessions will be archived.","workspace.reset.archived.one":"1 session will be archived.","workspace.reset.archived.many":"{{count}} sessions will be archived.","workspace.reset.note":"This will reset the workspace to match the default branch."};function rLt(e){return`oc_locale=${encodeURIComponent(e)}; Path=/; Max-Age=31536000; SameSite=Lax`}const wce=["en","zh","zht","ko","de","es","fr","da","ja","pl","ru","bs","ar","no","br","th","tr"],iLt={en:"en",zh:"zh-Hans",zht:"zh-Hant",ko:"ko",de:"de",es:"es",fr:"fr",da:"da",ja:"ja",pl:"pl",ru:"ru",ar:"ar",no:"nb-NO",br:"pt-BR",th:"th",bs:"bs",tr:"tr"},aLt={en:"language.en",zh:"language.zh",zht:"language.zht",ko:"language.ko",de:"language.de",es:"language.es",fr:"language.fr",da:"language.da",ja:"language.ja",pl:"language.pl",ru:"language.ru",ar:"language.ar",no:"language.no",br:"language.br",th:"language.th",bs:"language.bs",tr:"language.tr"},C2=fce({...bce,...Ire}),AB=new Map([["en",C2]]),$r=(e,t)=>Promise.all([e,t]).then(([n,r])=>({...C2,...fce({...n.dict,...r.dict})})),oLt={zh:()=>$r(z(()=>import("./zh-CibzNL3Z.js"),[]),z(()=>import("./zh-DqNk452I.js"),[])),zht:()=>$r(z(()=>import("./zht-DsVmxmyh.js"),[]),z(()=>import("./zht-CfMMeSr0.js"),[])),ko:()=>$r(z(()=>import("./ko-D9Z7tTxK.js"),[]),z(()=>import("./ko-Cz45-37g.js"),[])),de:()=>$r(z(()=>import("./de-BXo_WxK1.js"),[]),z(()=>import("./de-W5dPqUFm.js"),[])),es:()=>$r(z(()=>import("./es-DAHGSdnh.js"),[]),z(()=>import("./es-BKl1__G4.js"),[])),fr:()=>$r(z(()=>import("./fr-P_mrJW12.js"),[]),z(()=>import("./fr-BGWW507w.js"),[])),da:()=>$r(z(()=>import("./da--imEne2-.js"),[]),z(()=>import("./da-DKIMy0WC.js"),[])),ja:()=>$r(z(()=>import("./ja-8gbzy_Uq.js"),[]),z(()=>import("./ja-nNUG5Jbd.js"),[])),pl:()=>$r(z(()=>import("./pl-D8a1LVH2.js"),[]),z(()=>import("./pl-B1PbnQJF.js"),[])),ru:()=>$r(z(()=>import("./ru-BwS-kFcs.js"),[]),z(()=>import("./ru-Cz7sqdk-.js"),[])),ar:()=>$r(z(()=>import("./ar-DNixbgcA.js"),[]),z(()=>import("./ar-BBkUbD-U.js"),[])),no:()=>$r(z(()=>import("./no-BGj8YYYB.js"),[]),z(()=>import("./no-DQ9niEg2.js"),[])),br:()=>$r(z(()=>import("./br-BylU6CIZ.js"),[]),z(()=>import("./br-CZ3IHiCZ.js"),[])),th:()=>$r(z(()=>import("./th-sZWfOGpx.js"),[]),z(()=>import("./th-GkB0dxVv.js"),[])),bs:()=>$r(z(()=>import("./bs-Beusmqm9.js"),[]),z(()=>import("./bs-C7sqWY8X.js"),[])),tr:()=>$r(z(()=>import("./tr-BKF3NFWB.js"),[]),z(()=>import("./tr-EOOdZMuM.js"),[]))};function xce(e){const t=AB.get(e);if(t)return Promise.resolve(t);if(e==="en")return Promise.resolve(C2);const n=oLt[e];return n().then(r=>(AB.set(e,r),r))}const sLt=[{locale:"en",match:e=>e.startsWith("en")},{locale:"zht",match:e=>e.startsWith("zh")&&e.includes("hant")},{locale:"zh",match:e=>e.startsWith("zh")},{locale:"ko",match:e=>e.startsWith("ko")},{locale:"de",match:e=>e.startsWith("de")},{locale:"es",match:e=>e.startsWith("es")},{locale:"fr",match:e=>e.startsWith("fr")},{locale:"da",match:e=>e.startsWith("da")},{locale:"ja",match:e=>e.startsWith("ja")},{locale:"pl",match:e=>e.startsWith("pl")},{locale:"ru",match:e=>e.startsWith("ru")},{locale:"ar",match:e=>e.startsWith("ar")},{locale:"no",match:e=>e.startsWith("no")||e.startsWith("nb")||e.startsWith("nn")},{locale:"br",match:e=>e.startsWith("pt")},{locale:"th",match:e=>e.startsWith("th")},{locale:"bs",match:e=>e.startsWith("bs")},{locale:"tr",match:e=>e.startsWith("tr")}];function _ce(){if(typeof navigator!="object")return"en";const e=navigator.languages?.length?navigator.languages:[navigator.language];for(const t of e){if(!t)continue;const n=t.toLowerCase(),r=sLt.find(i=>i.match(n));if(r)return r.locale}return"en"}function $B(e){return wce.includes(e)?e:"en"}function Mce(){if(typeof localStorage=="object")try{const e=localStorage.getItem("opencode.global.dat:language");if(!e)return;const t=JSON.parse(e);return typeof t?.locale!="string"?void 0:$B(t.locale)}catch{return}}const OQ=Mce()??_ce();OQ!=="en"&&xce(OQ);const{use:_r,provider:lLt}=Nn({name:"Language",init:e=>{const t=e.locale??Mce()??_ce(),[n,r,i,a]=Jn(In.global("language",["language.v1"]),nt({locale:t})),o=Z(()=>$B(n.locale)),s=Z(()=>iLt[o()]),[l]=Yr(o,xce,{initialValue:AB.get(t)??C2}),c=WCt(()=>l()??C2,BCt),u=h=>c(aLt[h]);return he(()=>{typeof document=="object"&&(document.documentElement.lang=o(),document.cookie=rLt(o()))}),{ready:a,locale:o,intl:s,locales:wce,label:u,t:c,setLocale(h){r("locale",$B(h))}}}}),QJt="System Mono",eQt="System Sans",cLt='ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',dLt='ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',uLt=cLt,hLt=dLt;function Sce(e){return e??""}function fLt(e){return/^[\w-]+$/.test(e)?e:`"${e.replaceAll("\\","\\\\").replaceAll('"','\\"')}"`}function Cce(e,t){const n=e?.trim()??"";return n?`${fLt(n)}, ${t}`:t}function tQt(e){return Sce(e)}function nQt(e){return Sce(e)}function pLt(e){return Cce(e,uLt)}function mLt(e){return Cce(e,hLt)}const Tn={general:{autoSave:!0,releaseNotes:!0,followup:"steer",showReasoningSummaries:!0,shellToolPartsExpanded:!0,editToolPartsExpanded:!0},updates:{startup:!0},appearance:{fontSize:14,mono:"",sans:""},keybinds:{"settings.open":"mod+shift+,","settings.shortcuts":"mod+shift+k","session.previous":"mod+,","session.next":"mod+.","file.open":"alt+space,mod+p","tab.close":"mod+w,alt+x,ctrl+x","file.save":"mod+s","file.saveAll":"mod+shift+s","file.new":"mod+n","folder.new":"mod+alt+n","file.findInFiles":"mod+shift+f","tab.moveLeft":"mod+alt+arrowleft,alt+,","tab.moveRight":"mod+alt+arrowright,alt+.","editor.format":"alt+f","editor.quickFix":"alt+q","editor.find":"mod+f","editor.replace":"mod+alt+f","editor.gotoLine":"mod+g","editor.foldAll":"mod+shift+j","editor.unfoldAll":"mod+shift+h","editor.selectToBracket":"alt+shift+]","editor.smartSelect.expand":"mod+shift+arrowright","editor.smartSelect.shrink":"mod+shift+arrowleft","editor.commentLine":"mod+/","editor.deleteLines":"mod+shift+k","editor.copyFilePath":"mod+shift+c","editor.fontZoomIn":"mod+alt+=","editor.fontZoomOut":"mod+alt+-","editor.fontZoomReset":"alt+0","terminal.fontZoomIn":"mod+ctrl+alt+=","terminal.fontZoomOut":"mod+ctrl+alt+-","view.toggleMinimap":"mod+shift+m,mod+alt+m","view.toggleMaximizedPanel":"ctrl+tab","view.toggleActivityBar":"mod+shift+b","view.toggleStatusBar":"ctrl+mod+s","app.quit":"mod+alt+q","app.reload":"mod+shift+alt+r","app.restart":"mod+shift+r","theme.toggleLightDark":"mod+shift+alt+t"},permissions:{autoApprove:!1},notifications:{agent:!0,permissions:!0,errors:!1},sounds:{agentEnabled:!0,agent:"staplebops-01",permissionsEnabled:!0,permissions:"staplebops-02",errorsEnabled:!0,errors:"nope-03"}};function Vn(e,t){return Z(()=>e()??t)}const RQ="mod+w,alt+x",zQ=Tn.keybinds["tab.close"],{use:sm,provider:gLt}=Nn({name:"Settings",init:()=>{const[e,t,n,r]=Jn("settings.v3",nt(Tn));return he(()=>{e.keybinds?.["tab.close"]===RQ&&zQ!==RQ&&t("keybinds","tab.close",zQ)}),he(()=>{if(typeof document>"u")return;const i=document.documentElement;i.style.setProperty("--font-family-mono",pLt(e.appearance?.mono)),i.style.setProperty("--font-family-sans",mLt(e.appearance?.sans))}),{ready:r,get current(){return e},general:{autoSave:Vn(()=>e.general?.autoSave,Tn.general.autoSave),setAutoSave(i){t("general","autoSave",i)},releaseNotes:Vn(()=>e.general?.releaseNotes,Tn.general.releaseNotes),setReleaseNotes(i){t("general","releaseNotes",i)},followup:Vn(()=>e.general?.followup,Tn.general.followup),setFollowup(i){t("general","followup",i)},showReasoningSummaries:Vn(()=>e.general?.showReasoningSummaries,Tn.general.showReasoningSummaries),setShowReasoningSummaries(i){t("general","showReasoningSummaries",i)},shellToolPartsExpanded:Vn(()=>e.general?.shellToolPartsExpanded,Tn.general.shellToolPartsExpanded),setShellToolPartsExpanded(i){t("general","shellToolPartsExpanded",i)},editToolPartsExpanded:Vn(()=>e.general?.editToolPartsExpanded,Tn.general.editToolPartsExpanded),setEditToolPartsExpanded(i){t("general","editToolPartsExpanded",i)}},updates:{startup:Vn(()=>e.updates?.startup,Tn.updates.startup),setStartup(i){t("updates","startup",i)}},appearance:{fontSize:Vn(()=>e.appearance?.fontSize,Tn.appearance.fontSize),setFontSize(i){t("appearance","fontSize",i)},font:Vn(()=>e.appearance?.mono,Tn.appearance.mono),setFont(i){t("appearance","mono",i.trim()?i:"")},uiFont:Vn(()=>e.appearance?.sans,Tn.appearance.sans),setUIFont(i){t("appearance","sans",i.trim()?i:"")}},keybinds:{get:i=>e.keybinds?.[i],set(i,a){t("keybinds",i,a)},reset(i){t("keybinds",a=>{if(!Object.prototype.hasOwnProperty.call(a,i))return a;const o={...a};return delete o[i],o})},resetAll(){t("keybinds",Ct({}))}},permissions:{autoApprove:Vn(()=>e.permissions?.autoApprove,Tn.permissions.autoApprove),setAutoApprove(i){t("permissions","autoApprove",i)}},notifications:{agent:Vn(()=>e.notifications?.agent,Tn.notifications.agent),setAgent(i){t("notifications","agent",i)},permissions:Vn(()=>e.notifications?.permissions,Tn.notifications.permissions),setPermissions(i){t("notifications","permissions",i)},errors:Vn(()=>e.notifications?.errors,Tn.notifications.errors),setErrors(i){t("notifications","errors",i)}},sounds:{agentEnabled:Vn(()=>e.sounds?.agentEnabled,Tn.sounds.agentEnabled),setAgentEnabled(i){t("sounds","agentEnabled",i)},agent:Vn(()=>e.sounds?.agent,Tn.sounds.agent),setAgent(i){t("sounds","agent",i)},permissionsEnabled:Vn(()=>e.sounds?.permissionsEnabled,Tn.sounds.permissionsEnabled),setPermissionsEnabled(i){t("sounds","permissionsEnabled",i)},permissions:Vn(()=>e.sounds?.permissions,Tn.sounds.permissions),setPermissions(i){t("sounds","permissions",i)},errorsEnabled:Vn(()=>e.sounds?.errorsEnabled,Tn.sounds.errorsEnabled),setErrorsEnabled(i){t("sounds","errorsEnabled",i)},errors:Vn(()=>e.sounds?.errors,Tn.sounds.errors),setErrors(i){t("sounds","errors",i)}}}}}),hh=typeof navigator=="object"&&/(Mac|iPod|iPhone|iPad)/.test(navigator.platform),gF="command.palette",qQ="mod+shift+p",Sz="suggested.",yLt=new Set(["terminal.toggle","terminal.new","file.attach"]);function lp(e,t){return t?t(e):bce[e]}function fh(e){return e.startsWith(Sz)?e.slice(Sz.length):e}function Lce(e){return e===","?"comma":e==="+"?"plus":e===" "?"space":e.toLowerCase()}function TB(e,t,n,r,i){const a=(t?1:0)|(n?2:0)|(r?4:0)|(i?8:0);return`${e}:${a}`}function vLt(e){return TB(Lce(e.key),e.ctrlKey,e.metaKey,e.shiftKey,e.altKey)}function kLt(e){return e?yLt.has(fh(e)):!1}function bLt(e,t){return t.key===void 0?[t,...e]:[t,...e.filter(n=>n.key!==t.key)]}function EB(e){return!e||e==="none"?[]:e.split(",").map(t=>{const n=t.trim().toLowerCase().split("+"),r={key:"",ctrl:!1,meta:!1,shift:!1,alt:!1};for(const i of n)switch(i){case"ctrl":case"control":r.ctrl=!0;break;case"meta":case"cmd":case"command":r.meta=!0;break;case"mod":hh?r.meta=!0:r.ctrl=!0;break;case"alt":case"option":r.alt=!0;break;case"shift":r.shift=!0;break;default:r.key=i;break}return r})}function rQt(e,t){const n=Lce(t.key);for(const r of e){const i=r.key===n,a=r.ctrl===(t.ctrlKey||!1),o=r.meta===(t.metaKey||!1),s=r.shift===(t.shiftKey||!1),l=r.alt===(t.altKey||!1);if(i&&a&&o&&s&&l)return!0}return!1}function yF(e,t){if(!e||e==="none")return"";const n=EB(e);if(n.length===0)return"";const r=n[0],i=[];if(r.ctrl&&i.push(hh?"⌃":lp("common.key.ctrl",t)),r.alt&&i.push(hh?"⌥":lp("common.key.alt",t)),r.shift&&i.push(hh?"⇧":lp("common.key.shift",t)),r.meta&&i.push(hh?"⌘":lp("common.key.meta",t)),r.key){const a={arrowup:"↑",arrowdown:"↓",arrowleft:"←",arrowright:"→",comma:",",plus:"+"},o={backspace:"common.key.backspace",delete:"common.key.delete",end:"common.key.end",enter:"common.key.enter",esc:"common.key.esc",escape:"common.key.esc",home:"common.key.home",insert:"common.key.insert",pagedown:"common.key.pageDown",pageup:"common.key.pageUp",space:"common.key.space",tab:"common.key.tab"},s=r.key.toLowerCase(),l=a[s]??(o[s]?lp(o[s],t):s.length===1?s.toUpperCase():s.charAt(0).toUpperCase()+s.slice(1));i.push(l)}return hh?i.join(""):i.join("+")}function wLt(e){return e instanceof HTMLElement?!!(e.isContentEditable||e.closest("[contenteditable='true']")||e.closest("input, textarea, select")):!1}const{use:Ice,provider:xLt}=Nn({name:"Command",init:()=>{const e=lf(),t=sm(),n=_r(),[r,i]=nt({registrations:[],suspendCount:0}),[a,o,s,l]=Jn(In.global("command.catalog.v1"),nt({})),c=(_,C)=>{const S=t.keybinds.get(fh(_))??C;if(!(!S||S==="none"))return S},u=Z(()=>{const _=new Set,C=[];for(const L of r.registrations)for(const S of L.options())_.has(S.id)||(_.add(S.id),C.push(S));return C});he(()=>{l()&&o(u().reduce((_,C)=>{const L=fh(C.id);return _[L]={title:C.title,description:C.description,category:C.category,keybind:C.keybind,slash:C.slash},_},{}))});const h=Z(()=>Object.entries(a).map(([_,C])=>({id:_,...C}))),m=Z(()=>{const _=u().map(L=>({...L,keybind:c(L.id,L.keybind)}));return[..._.filter(L=>L.suggested&&!L.disabled).map(L=>({...L,id:Sz+L.id,category:n.t("command.category.suggested")})),..._]}),g=()=>r.suspendCount>0,y=Z(()=>{const _=t.keybinds.get(gF)??qQ,C=EB(_);return new Set(C.map(L=>TB(L.key,L.ctrl,L.meta,L.shift,L.alt)))}),v=Z(()=>{const _=new Map;for(const C of m()){if(C.id.startsWith(Sz)||C.disabled||!C.keybind)continue;const L=EB(C.keybind);for(const S of L){if(!S.key)continue;const I=TB(S.key,S.ctrl,S.meta,S.shift,S.alt);_.has(I)||_.set(I,C)}}return _}),k=Z(()=>{const _=new Map;for(const C of m())_.set(C.id,C),_.set(fh(C.id),C);return _}),b=(_,C)=>{k().get(_)?.onSelect?.(C)},x=()=>{b("file.open","palette")},w=_=>{if(g()||e.active)return;const C=vLt(_),L=y().has(C),S=v().get(C),I=_.ctrlKey||_.metaKey||_.altKey,A=_.key==="Tab";if(!(wLt(_.target)&&!L&&!kLt(S?.id)&&!I&&!A)){if(L){_.preventDefault(),x();return}S&&(_.preventDefault(),S.onSelect?.("keybind"))}};dn(()=>{document.addEventListener("keydown",w)}),me(()=>{document.removeEventListener("keydown",w)});function M(_,C){const L=typeof _=="string"?_:void 0,S=typeof _=="function"?_:C;if(!S)return;const I=Z(S),A={key:L,options:I};i("registrations",D=>bLt(D,A)),me(()=>{i("registrations",D=>D.filter(P=>P!==A))})}return{register:M,trigger(_,C){b(_,C)},keybind(_){if(_===gF)return yF(t.keybinds.get(gF)??qQ,n.t);const C=fh(_),L=m().find(A=>fh(A.id)===C);if(L?.keybind)return yF(L.keybind,n.t);const S=a[C],I=c(C,S?.keybind);return I?yF(I,n.t):""},show:x,keybinds(_){i("suspendCount",C=>Math.max(0,C+(_?-1:1)))},suspended:g,get catalog(){return h()},get options(){return m()}}}});function Nce(e,t={}){const n=new Map,r=t.now??Date.now,i=(g,y)=>{t.dispose?.(y.value,g)},a=g=>t.ttlMs===void 0?!1:r()-g.touchedAt>=t.ttlMs,o=()=>{if(t.ttlMs!==void 0)for(const[g,y]of n)a(y)&&(n.delete(g),i(g,y))},s=(g,y)=>{y.touchedAt=r(),n.delete(g),n.set(g,y)},l=()=>{if(t.maxEntries!==void 0)for(;n.size>t.maxEntries;){const g=n.keys().next().value;if(!g)return;const y=n.get(g);n.delete(g),y&&i(g,y)}};return{get:g=>{o();const y=n.get(g);if(y&&!a(y))return s(g,y),y.value;y&&(n.delete(g),i(g,y));const v={value:e(g),touchedAt:r()};return n.set(g,v),l(),v.value},peek:g=>{o();const y=n.get(g);if(y){if(!a(y))return y.value;n.delete(g),i(g,y)}},delete:g=>{const y=n.get(g);if(y)return n.delete(g),i(g,y),y.value},clear:()=>{for(const[g,y]of n)i(g,y);n.clear()}}}const vF=()=>Math.random().toString(16).slice(2);function _Lt(){const e=globalThis.crypto;if(!e||typeof e.randomUUID!="function"||typeof globalThis.isSecureContext=="boolean"&&!globalThis.isSecureContext)return vF();try{return e.randomUUID()}catch{return vF()}}const vG="__workspace__",MLt=20;function SLt(e,t){return`${e}
|
|
2477
2477
|
${t??vG}`}function CLt(e){const t=e.lastIndexOf(`
|
|
2478
|
-
`);return t<0?{dir:e,id:vG}:{dir:e.slice(0,t),id:e.slice(t+1)}}function LLt(e){return Object.keys(e).flatMap(t=>e[t]??[]).slice().sort((t,n)=>t.time-n.time)}function Ace(e){const t={start:e.start,end:e.end};return e.side&&(t.side=e.side),e.endSide&&(t.endSide=e.endSide),t}function ILt(e){return{...e,selection:Ace(e.selection)}}function NLt(e){return e.reduce((t,n)=>{const r=t[n.file],i=ILt(n);return r?(r.push(i),t):(t[n.file]=[i],t)},{})}function ALt(e,t){const[n,r]=nt({focus:null,active:null}),i=()=>LLt(e.comments),a=(y,v)=>r(y,v),o=y=>a("focus",y),s=y=>a("active",y);return{list:y=>e.comments[y]??[],all:i,add:y=>{const v={id:_Lt(),time:Date.now(),...y,selection:Ace(y.selection)};return ct(()=>{t("comments",y.file,k=>[...k??[],v]),o({file:y.file,id:v.id})}),v},remove:(y,v)=>{ct(()=>{t("comments",y,k=>(k??[]).filter(b=>b.id!==v)),o(k=>k?.file===y&&k.id===v?null:k)})},update:(y,v,k)=>{t("comments",y,b=>(b??[]).map(x=>x.id!==v?x:{...x,comment:k}))},replace:y=>{ct(()=>{t("comments",Ct(NLt(y))),o(null),s(null)})},clear:()=>{ct(()=>{t("comments",Ct({})),o(null),s(null)})},focus:()=>n.focus,setFocus:o,clearFocus:()=>a("focus",null),active:()=>n.active,setActive:s,clearActive:()=>a("active",null)}}function $Lt(e,t){const n=`${e}/comments${t?"/"+t:""}.v1`,[r,i,a,o]=Jn(In.scoped(e,t,"comments",[n]),nt({comments:{}})),s=ALt(r,i);return{ready:o,list:s.list,all:s.all,add:s.add,remove:s.remove,update:s.update,replace:s.replace,clear:s.clear,focus:s.focus,setFocus:s.setFocus,clearFocus:s.clearFocus,active:s.active,setActive:s.setActive,clearActive:s.clearActive}}const{use:nQt,provider:TLt}=Nn({name:"Comments",gate:!1,init:()=>{const e=di(),t=Nce(i=>{const a=CLt(i);return wr(o=>({value:$Lt(a.dir,a.id===vG?void 0:a.id),dispose:o}))},{maxEntries:MLt,dispose:i=>i.dispose()});me(()=>t.clear());const n=(i,a)=>{const o=SLt(i,a);return t.get(o).value},r=Z(()=>n(e.dir,e.id));return{ready:()=>r().ready(),list:i=>r().list(i),all:()=>r().all(),add:i=>r().add(i),remove:(i,a)=>r().remove(i,a),update:(i,a,o)=>r().update(i,a,o),replace:i=>r().replace(i),clear:()=>r().clear(),focus:()=>r().focus(),setFocus:i=>r().setFocus(i),clearFocus:()=>r().clearFocus(),active:()=>r().active(),setActive:i=>r().setActive(i),clearActive:()=>r().clearActive()}}});var ELt={};Ga(ELt,{CloseButton:()=>Tce,Description:()=>Ece,List:()=>Dce,ProgressFill:()=>Oce,ProgressTrack:()=>Rce,Region:()=>zce,Root:()=>qce,Title:()=>jce,Toast:()=>us,toaster:()=>Kh,useToastContext:()=>lm});var $ce=Tt();function lm(){const e=Lt($ce);if(e===void 0)throw new Error("[kobalte]: `useToastContext` must be used within a `Toast.Root` component");return e}function Tce(e){const t=lm(),[n,r]=Se(e,["aria-label","onClick"]);return d(_0,f({get"aria-label"(){return n["aria-label"]||t.translations().close},onClick:a=>{dt(a,n.onClick),t.close()}},r))}function Ece(e){const t=lm(),n=ft({id:t.generateId("description")},e),[r,i]=Se(n,["id"]);return he(()=>me(t.registerDescriptionId(r.id))),d(zt,f({as:"div",get id(){return r.id}},i))}var Pce=Tt();function kG(){const e=Lt(Pce);if(e===void 0)throw new Error("[kobalte]: `useToastRegionContext` must be used within a `Toast.Region` component");return e}function Dce(e){let t;const n=kG(),[r,i]=Se(e,["ref","onFocusIn","onFocusOut","onPointerMove","onPointerLeave"]),a=c=>{dt(c,r.onFocusIn),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},o=c=>{dt(c,r.onFocusOut),Yn(t,c.relatedTarget)||n.resumeAllTimer()},s=c=>{dt(c,r.onPointerMove),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},l=c=>{dt(c,r.onPointerLeave),Yn(t,ri(t).activeElement)||n.resumeAllTimer()};return he(vn([()=>t,()=>n.hotkey()],([c,u])=>{if(!c)return;const h=ri(c),m=g=>{u.every(v=>g[v]||g.code===v)&&ur(c)};h.addEventListener("keydown",m),me(()=>h.removeEventListener("keydown",m))})),he(()=>{if(!n.pauseOnPageIdle())return;const c=qU(t);c.addEventListener("blur",n.pauseAllTimer),c.addEventListener("focus",n.resumeAllTimer),me(()=>{c.removeEventListener("blur",n.pauseAllTimer),c.removeEventListener("focus",n.resumeAllTimer)})}),d(zt,f({as:"ol",ref(c){var u=hn(h=>t=h,r.ref);typeof u=="function"&&u(c)},tabIndex:-1,onFocusIn:a,onFocusOut:o,onPointerMove:s,onPointerLeave:l},i,{get children(){return d(Qt,{get each(){return n.toasts()},children:c=>c.toastComponent({get toastId(){return c.id}})})}}))}function Oce(e){const t=kG(),n=lm(),[r,i]=Se(e,["style"]),[a,o]=Ce(100);let s=0;return he(()=>{if(t.isPaused()||n.isPersistent())return;const l=setInterval(()=>{const c=new Date().getTime()-n.closeTimerStartTime()+s,u=Math.trunc(100-c/n.duration()*100);o(u<0?0:u)});me(()=>{s+=new Date().getTime()-n.closeTimerStartTime(),clearInterval(l)})}),d(zt,f({as:"div",get style(){return Wa({"--kb-toast-progress-fill-width":`${a()}%`},r.style)}},i))}function Rce(e){return d(zt,f({as:"div","aria-hidden":"true",role:"presentation"},e))}var[bG,cm]=nt({toasts:[]});function PLt(e){cm("toasts",t=>[...t,e])}function DLt(e){return bG.toasts.find(t=>t.id===e)}function OLt(e,t){const n=bG.toasts.findIndex(r=>r.id===e);n!==-1&&cm("toasts",r=>[...r.slice(0,n),t,...r.slice(n+1)])}function RLt(e){cm("toasts",t=>t.id===e,"dismiss",!0)}function zLt(e){cm("toasts",t=>t.filter(n=>n.id!==e))}function qLt(){cm("toasts",[])}var m0={toasts:()=>bG.toasts,add:PLt,get:DLt,update:OLt,dismiss:RLt,remove:zLt,clear:qLt},jQ="{hotkey}",jLt={close:"Close"},HLt={notifications:e=>`Notifications (${e})`};function zce(e){const t=ft({id:`toast-region-${xr()}`,hotkey:["altKey","KeyT"],duration:5e3,limit:3,swipeDirection:"right",swipeThreshold:50,pauseOnInteraction:!0,pauseOnPageIdle:!0,topLayer:!0,translations:HLt},e),[n,r]=Se(t,["translations","style","hotkey","duration","limit","swipeDirection","swipeThreshold","pauseOnInteraction","pauseOnPageIdle","topLayer","aria-label","regionId"]),i=Z(()=>m0.toasts().filter(m=>m.region===n.regionId&&m.dismiss===!1).slice(0,n.limit)),[a,o]=Ce(!1),s=()=>i().length>0,l=()=>n.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),c=()=>(n["aria-label"]||n.translations.notifications(jQ)).replace(jQ,l()),u=()=>({[a2]:n.topLayer?"":void 0}),h={isPaused:a,toasts:i,hotkey:()=>n.hotkey,duration:()=>n.duration,swipeDirection:()=>n.swipeDirection,swipeThreshold:()=>n.swipeThreshold,pauseOnInteraction:()=>n.pauseOnInteraction,pauseOnPageIdle:()=>n.pauseOnPageIdle,pauseAllTimer:()=>o(!0),resumeAllTimer:()=>o(!1),generateId:Io(()=>r.id)};return d(Pce.Provider,{value:h,get children(){return d(zt,f({as:"div",role:"region",tabIndex:-1,get"aria-label"(){return c()},get style(){return Wa({"pointer-events":s()?n.topLayer?"auto":void 0:"none"},n.style)}},u,r))}})}var FLt="toast.swipeStart",VLt="toast.swipeMove",BLt="toast.swipeCancel",ULt="toast.swipeEnd";function qce(e){const t=kG(),n=ft({id:`toast-${xr()}`,priority:"high",translations:jLt},e),[r,i]=Se(n,["ref","translations","toastId","style","priority","duration","persistent","onPause","onResume","onSwipeStart","onSwipeMove","onSwipeCancel","onSwipeEnd","onEscapeKeyDown","onKeyDown","onPointerDown","onPointerMove","onPointerUp"]),[a,o]=Ce(!0),[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(!0),[g,y]=Ce(),{present:v}=i0({show:a,element:()=>g()??null}),k=Z(()=>r.duration||t.duration());let b,x=0,w=k(),M=null,_=null;const C=()=>{o(!1),m(!0)},L=()=>{m0.remove(r.toastId)},S=R=>{!R||r.persistent||(window.clearTimeout(b),x=new Date().getTime(),b=window.setTimeout(C,R))},I=()=>{S(w),r.onResume?.()},A=()=>{const R=new Date().getTime()-x;w=w-R,window.clearTimeout(b),r.onPause?.()},D=R=>{dt(R,r.onKeyDown),R.key==="Escape"&&(r.onEscapeKeyDown?.(R),R.defaultPrevented||C())},P=R=>{dt(R,r.onPointerDown),R.button===0&&(M={x:R.clientX,y:R.clientY})},O=R=>{if(dt(R,r.onPointerMove),!M)return;const H=R.clientX-M.x,Y=R.clientY-M.y,j=!!_,X=["left","right"].includes(t.swipeDirection()),W=["left","up"].includes(t.swipeDirection())?Math.min:Math.max,G=X?W(0,H):0,J=X?0:W(0,Y),oe=R.pointerType==="touch"?10:2,de={x:G,y:J},ye={originalEvent:R,delta:de};if(j){_=de,Cg(VLt,r.onSwipeMove,ye);const{x:ve,y:le}=de;R.currentTarget.setAttribute("data-swipe","move"),R.currentTarget.style.setProperty("--kb-toast-swipe-move-x",`${ve}px`),R.currentTarget.style.setProperty("--kb-toast-swipe-move-y",`${le}px`)}else HQ(de,t.swipeDirection(),oe)?(_=de,Cg(FLt,r.onSwipeStart,ye),R.currentTarget.setAttribute("data-swipe","start"),R.target.setPointerCapture(R.pointerId)):(Math.abs(H)>oe||Math.abs(Y)>oe)&&(M=null)},E=R=>{dt(R,r.onPointerUp);const H=_,Y=R.target;if(Y.hasPointerCapture(R.pointerId)&&Y.releasePointerCapture(R.pointerId),_=null,M=null,H){const j=R.currentTarget,X={originalEvent:R,delta:H};if(HQ(H,t.swipeDirection(),t.swipeThreshold())){Cg(ULt,r.onSwipeEnd,X);const{x:W,y:G}=H;R.currentTarget.setAttribute("data-swipe","end"),R.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),R.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),R.currentTarget.style.setProperty("--kb-toast-swipe-end-x",`${W}px`),R.currentTarget.style.setProperty("--kb-toast-swipe-end-y",`${G}px`),C()}else Cg(BLt,r.onSwipeCancel,X),R.currentTarget.setAttribute("data-swipe","cancel"),R.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),R.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),R.currentTarget.style.removeProperty("--kb-toast-swipe-end-x"),R.currentTarget.style.removeProperty("--kb-toast-swipe-end-y");j.addEventListener("click",W=>W.preventDefault(),{once:!0})}};dn(()=>{t.toasts().find(R=>R.id===r.toastId&&R.update)&&m(!1)}),he(vn(()=>t.isPaused(),R=>{R?A():I()},{defer:!0})),he(vn([a,k],([R,H])=>{R&&!t.isPaused()&&S(H)})),he(vn(()=>m0.get(r.toastId)?.dismiss,R=>R&&C())),he(vn(()=>v(),R=>!R&&L()));const T={translations:()=>r.translations,close:C,duration:k,isPersistent:()=>r.persistent??!1,closeTimerStartTime:()=>x,generateId:Io(()=>i.id),registerTitleId:zr(l),registerDescriptionId:zr(u)};return d(ke,{get when(){return v()},get children(){return d($ce.Provider,{value:T,get children(){return d(zt,f({as:"li",ref(R){var H=hn(y,r.ref);typeof H=="function"&&H(R)},role:"status",tabIndex:0,get style(){return Wa({animation:h()?void 0:"none","user-select":"none","touch-action":"none"},r.style)},get"aria-live"(){return r.priority==="high"?"assertive":"polite"},"aria-atomic":"true",get"aria-labelledby"(){return s()},get"aria-describedby"(){return c()},get"data-opened"(){return a()?"":void 0},get"data-closed"(){return a()?void 0:""},get"data-swipe-direction"(){return t.swipeDirection()},onKeyDown:D,onPointerDown:P,onPointerMove:O,onPointerUp:E},i))}})}})}function HQ(e,t,n=0){const r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t==="left"||t==="right"?a&&r>n:!a&&i>n}function Cg(e,t,n){const r=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function jce(e){const t=lm(),n=ft({id:t.generateId("title")},e),[r,i]=Se(n,["id"]);return he(()=>me(t.registerTitleId(r.id))),d(zt,f({as:"div",get id(){return r.id}},i))}var WLt=0;function Hce(e,t){const n=WLt++;return m0.add({id:n,toastComponent:e,dismiss:!1,update:!1,region:t?.region}),n}function PB(e,t){m0.update(e,{id:e,toastComponent:t,dismiss:!1,update:!0})}function GLt(e,t,n){const r=Hce(i=>t({get toastId(){return i.toastId},state:"pending"}),n);return(nre(e)?e():e).then(i=>PB(r,a=>t({get toastId(){return a.toastId},state:"fulfilled",data:i}))).catch(i=>PB(r,a=>t({get toastId(){return a.toastId},state:"rejected",error:i}))),r}function ZLt(e){return m0.dismiss(e),e}function KLt(){m0.clear()}var Kh={show:Hce,update:PB,promise:GLt,dismiss:ZLt,clear:KLt},us=Object.assign(qce,{CloseButton:Tce,Description:Ece,List:Dce,ProgressFill:Oce,ProgressTrack:Rce,Region:zce,Title:jce,toaster:Kh});function Cr(e){const[t,n]=Se(e,["variant","size","iconSize","class","classList"]);return d(UU,f(n,{"data-component":"icon-button",get"data-icon"(){return e.icon},get"data-size"(){return t.size||"normal"},get"data-variant"(){return t.variant||"secondary"},get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return d(Kt,{get name(){return e.icon},get size(){return t.iconSize??(t.size==="large"?"normal":"small")}})}}))}var XLt=ie("<div data-slot=toast-icon>"),YLt=ie("<div data-slot=toast-content>"),JLt=ie("<div data-slot=toast-actions>"),QLt=ie("<button data-slot=toast-action>");function eIt(e){return d(w0,{get children(){return d(us.Region,f({"data-component":"toast-region"},e,{get children(){return d(us.List,{"data-slot":"toast-list"})}}))}})}function tIt(e){return d(us,f({"data-component":"toast",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}}},e))}function nIt(e){return(()=>{var t=XLt();return K(t,d(Kt,{get name(){return e.name}})),t})()}function rIt(e){return(()=>{var t=YLt();return ki(t,e,!1,!1),t})()}function iIt(e){return d(us.Title,f({"data-slot":"toast-title"},e))}function aIt(e){return d(us.Description,f({"data-slot":"toast-description"},e))}function oIt(e){return(()=>{var t=JLt();return ki(t,e,!1,!1),t})()}function sIt(e){const t=M0();return d(us.CloseButton,f({"data-slot":"toast-close-button",as:Cr,icon:"close",variant:"ghost",get"aria-label"(){return t.t("ui.common.dismiss")}},e))}function lIt(e){return d(us.ProgressTrack,f({"data-slot":"toast-progress-track"},e))}function cIt(e){return d(us.ProgressFill,f({"data-slot":"toast-progress-fill"},e))}const As=Object.assign(tIt,{Region:eIt,Icon:nIt,Content:rIt,Title:iIt,Description:aIt,Actions:oIt,CloseButton:sIt,ProgressTrack:lIt,ProgressFill:cIt});function lr(e){const t=typeof e=="string"?{description:e}:e;return Kh.show(n=>d(As,{get toastId(){return n.toastId},get duration(){return t.duration},get persistent(){return t.persistent},get"data-variant"(){return t.variant??"default"},get children(){return[d(ke,{get when(){return t.icon},get children(){return d(As.Icon,{get name(){return t.icon}})}}),d(As.Content,{get children(){return[d(ke,{get when(){return t.title},get children(){return d(As.Title,{get children(){return t.title}})}}),d(ke,{get when(){return t.description},get children(){return d(As.Description,{get children(){return t.description}})}}),d(ke,{get when(){return t.actions?.length},get children(){return d(As.Actions,{get children(){return t.actions.map(r=>(()=>{var i=QLt();return i.$$click=()=>{typeof r.onClick=="function"&&r.onClick(),Kh.dismiss(n.toastId)},K(i,()=>r.label),i})())}})}})]}}),d(As.CloseButton,{})]}}))}li(["click"]);function Gn(e){if(!e)return"";const n=e.replace(/[\/\\]+$/,"").split(/[\/\\]/);return n[n.length-1]??""}function rQt(e){if(!e)return"";const n=e.replace(/[\/\\]+$/,"").split(/[\/\\]/);return n.slice(0,n.length-1).join("/")+"/"}function iQt(e,t=20){const n=Gn(e);if(n.length<=t)return n;const r=n.lastIndexOf("."),i=r<=0?"":n.slice(r),a=t-i.length-1;return a<=0?n.slice(0,t-1)+"…":n.slice(0,a)+"…"+i}class Fce extends Set{emit(t){for(const n of this)n(t)}}function dIt(){const e=new Fce;return{listen(t){return e.add(t),RU(e.delete.bind(e,t))},emit:e.emit.bind(e),clear:me(e.clear.bind(e))}}class uIt extends Map{on(t,n){let r=this.get(t);r||this.set(t,r=new Fce),r.add(n)}off(t,n){const r=this.get(t);r?.delete(n)&&!r.size&&this.delete(t)}emit(t,n){this.get(t)?.emit(n)}}function hIt(){const e=new uIt;return{on(t,n){return e.on(t,n),RU(e.off.bind(e,t,n))},emit:e.emit.bind(e),clear:me(e.clear.bind(e))}}function Vce(){const e=hIt(),t=dIt();return{on:e.on,clear:e.clear,listen:t.listen,emit(n,r){t.emit({name:n,details:r}),e.emit(n,r)}}}const Bce=Object.freeze({status:"aborted"});function ae(e,t,n){function r(s,l){var c;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(c=s._zod).traits??(c.traits=new Set),s._zod.traits.add(e),t(s,l);for(const u in o.prototype)u in s||Object.defineProperty(s,u,{value:o.prototype[u].bind(s)});s._zod.constr=o,s._zod.def=l}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(s){var l;const c=n?.Parent?new a:this;r(c,s),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}const Uce=Symbol("zod_brand");class e0 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class tj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Cz={};function ii(e){return e&&Object.assign(Cz,e),Cz}function fIt(e){return e}function pIt(e){return e}function mIt(e){}function gIt(e){throw new Error}function yIt(e){}function wG(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function $e(e,t="|"){return e.map(n=>ut(n)).join(t)}function Lz(e,t){return typeof t=="bigint"?t.toString():t}function dm(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function A0(e){return e==null}function nj(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Wce(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const l=r.match(/\d?e-(\d?)/);l?.[1]&&(i=Number.parseInt(l[1]))}const a=n>i?n:i,o=Number.parseInt(e.toFixed(a).replace(".","")),s=Number.parseInt(t.toFixed(a).replace(".",""));return o%s/10**a}const FQ=Symbol("evaluating");function Pt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==FQ)return r===void 0&&(r=FQ,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function rj(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ya(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ul(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function vIt(e){return ul(e._zod.def)}function kIt(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function bIt(e){const t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{const i={};for(let a=0;a<t.length;a++)i[t[a]]=r[a];return i})}function wIt(e=10){const t="abcdefghijklmnopqrstuvwxyz";let n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function DB(e){return JSON.stringify(e)}const xG="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Gce=dm(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function g0(e){if(Xh(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(Xh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ij(e){return g0(e)?{...e}:Array.isArray(e)?[...e]:e}function xIt(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const _It=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Iz=new Set(["string","number","symbol"]),Zce=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ys(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ua(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function we(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function MIt(e){let t;return new Proxy({},{get(n,r,i){return t??(t=e()),Reflect.get(t,r,i)},set(n,r,i,a){return t??(t=e()),Reflect.set(t,r,i,a)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??(t=e()),Reflect.defineProperty(t,r,i)}})}function ut(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Kce(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Xce={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Yce={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Jce(e,t){const n=e._zod.def,r=ul(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return Ya(this,"shape",i),i},checks:[]});return ua(e,r)}function Qce(e,t){const n=e._zod.def,r=ul(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return Ya(this,"shape",i),i},checks:[]});return ua(e,r)}function ede(e,t){if(!g0(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=ul(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Ya(this,"shape",a),a},checks:[]});return ua(e,i)}function tde(e,t){if(!g0(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return Ya(this,"shape",r),r},checks:e._zod.def.checks};return ua(e,n)}function nde(e,t){const n=ul(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Ya(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return ua(e,n)}function rde(e,t,n){const r=ul(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(a[o]=e?new e({type:"optional",innerType:i[o]}):i[o])}else for(const o in i)a[o]=e?new e({type:"optional",innerType:i[o]}):i[o];return Ya(this,"shape",a),a},checks:[]});return ua(t,r)}function ide(e,t,n){const r=ul(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const o in n){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(a[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)a[o]=new e({type:"nonoptional",innerType:i[o]});return Ya(this,"shape",a),a},checks:[]});return ua(t,r)}function W1(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Aa(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function $p(e){return typeof e=="string"?e:e?.message}function Ha(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=$p(e.inst?._zod.def?.error?.(e))??$p(t?.error?.(e))??$p(n.customError?.(e))??$p(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function aj(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function oj(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Yh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function SIt(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function ade(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function ode(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function CIt(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return ade(t+n)}function LIt(e){return ode(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function IIt(e){const t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");const n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function NIt(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class AIt{constructor(...t){}}const sde=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:Yce,Class:AIt,NUMBER_FORMAT_RANGES:Xce,aborted:W1,allowsEval:Gce,assert:yIt,assertEqual:fIt,assertIs:mIt,assertNever:gIt,assertNotEqual:pIt,assignProp:Ya,base64ToUint8Array:ade,base64urlToUint8Array:CIt,cached:dm,captureStackTrace:xG,cleanEnum:SIt,cleanRegex:nj,clone:ua,cloneDef:vIt,createTransparentProxy:MIt,defineLazy:Pt,esc:DB,escapeRegex:Ys,extend:ede,finalizeIssue:Ha,floatSafeRemainder:Wce,getElementAtPath:kIt,getEnumValues:wG,getLengthableOrigin:oj,getParsedType:_It,getSizableOrigin:aj,hexToUint8Array:IIt,isObject:Xh,isPlainObject:g0,issue:Yh,joinValues:$e,jsonStringifyReplacer:Lz,merge:nde,mergeDefs:ul,normalizeParams:we,nullish:A0,numKeys:xIt,objectClone:rj,omit:Qce,optionalKeys:Kce,partial:rde,pick:Jce,prefixIssues:Aa,primitiveTypes:Zce,promiseAllObject:bIt,propertyKeyTypes:Iz,randomString:wIt,required:ide,safeExtend:tde,shallowClone:ij,stringifyPrimitive:ut,uint8ArrayToBase64:ode,uint8ArrayToBase64url:LIt,uint8ArrayToHex:NIt,unwrapMessage:$p},Symbol.toStringTag,{value:"Module"})),lde=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Lz,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},_G=ae("$ZodError",lde),Fi=ae("$ZodError",lde,{Parent:Error});function MG(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function SG(e,t){const n=t||function(a){return a.message},r={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(n(o));else{let s=r,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(o))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return i(e),r}function cde(e,t){const n=t||function(a){return a.message},r={errors:[]},i=(a,o=[])=>{var s,l;for(const c of a.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},c.path));else if(c.code==="invalid_key")i({issues:c.issues},c.path);else if(c.code==="invalid_element")i({issues:c.issues},c.path);else{const u=[...o,...c.path];if(u.length===0){r.errors.push(n(c));continue}let h=r,m=0;for(;m<u.length;){const g=u[m],y=m===u.length-1;typeof g=="string"?(h.properties??(h.properties={}),(s=h.properties)[g]??(s[g]={errors:[]}),h=h.properties[g]):(h.items??(h.items=[]),(l=h.items)[g]??(l[g]={errors:[]}),h=h.items[g]),y&&h.errors.push(n(c)),m++}}};return i(e),r}function dde(e){const t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(const r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function ude(e){const t=[],n=[...e.issues].sort((r,i)=>(r.path??[]).length-(i.path??[]).length);for(const r of n)t.push(`✖ ${r.message}`),r.path?.length&&t.push(` → at ${dde(r.path)}`);return t.join(`
|
|
2478
|
+
`);return t<0?{dir:e,id:vG}:{dir:e.slice(0,t),id:e.slice(t+1)}}function LLt(e){return Object.keys(e).flatMap(t=>e[t]??[]).slice().sort((t,n)=>t.time-n.time)}function Ace(e){const t={start:e.start,end:e.end};return e.side&&(t.side=e.side),e.endSide&&(t.endSide=e.endSide),t}function ILt(e){return{...e,selection:Ace(e.selection)}}function NLt(e){return e.reduce((t,n)=>{const r=t[n.file],i=ILt(n);return r?(r.push(i),t):(t[n.file]=[i],t)},{})}function ALt(e,t){const[n,r]=nt({focus:null,active:null}),i=()=>LLt(e.comments),a=(y,v)=>r(y,v),o=y=>a("focus",y),s=y=>a("active",y);return{list:y=>e.comments[y]??[],all:i,add:y=>{const v={id:_Lt(),time:Date.now(),...y,selection:Ace(y.selection)};return ct(()=>{t("comments",y.file,k=>[...k??[],v]),o({file:y.file,id:v.id})}),v},remove:(y,v)=>{ct(()=>{t("comments",y,k=>(k??[]).filter(b=>b.id!==v)),o(k=>k?.file===y&&k.id===v?null:k)})},update:(y,v,k)=>{t("comments",y,b=>(b??[]).map(x=>x.id!==v?x:{...x,comment:k}))},replace:y=>{ct(()=>{t("comments",Ct(NLt(y))),o(null),s(null)})},clear:()=>{ct(()=>{t("comments",Ct({})),o(null),s(null)})},focus:()=>n.focus,setFocus:o,clearFocus:()=>a("focus",null),active:()=>n.active,setActive:s,clearActive:()=>a("active",null)}}function $Lt(e,t){const n=`${e}/comments${t?"/"+t:""}.v1`,[r,i,a,o]=Jn(In.scoped(e,t,"comments",[n]),nt({comments:{}})),s=ALt(r,i);return{ready:o,list:s.list,all:s.all,add:s.add,remove:s.remove,update:s.update,replace:s.replace,clear:s.clear,focus:s.focus,setFocus:s.setFocus,clearFocus:s.clearFocus,active:s.active,setActive:s.setActive,clearActive:s.clearActive}}const{use:iQt,provider:TLt}=Nn({name:"Comments",gate:!1,init:()=>{const e=di(),t=Nce(i=>{const a=CLt(i);return wr(o=>({value:$Lt(a.dir,a.id===vG?void 0:a.id),dispose:o}))},{maxEntries:MLt,dispose:i=>i.dispose()});me(()=>t.clear());const n=(i,a)=>{const o=SLt(i,a);return t.get(o).value},r=Z(()=>n(e.dir,e.id));return{ready:()=>r().ready(),list:i=>r().list(i),all:()=>r().all(),add:i=>r().add(i),remove:(i,a)=>r().remove(i,a),update:(i,a,o)=>r().update(i,a,o),replace:i=>r().replace(i),clear:()=>r().clear(),focus:()=>r().focus(),setFocus:i=>r().setFocus(i),clearFocus:()=>r().clearFocus(),active:()=>r().active(),setActive:i=>r().setActive(i),clearActive:()=>r().clearActive()}}});var ELt={};Ga(ELt,{CloseButton:()=>Tce,Description:()=>Ece,List:()=>Dce,ProgressFill:()=>Oce,ProgressTrack:()=>Rce,Region:()=>zce,Root:()=>qce,Title:()=>jce,Toast:()=>us,toaster:()=>Kh,useToastContext:()=>lm});var $ce=Tt();function lm(){const e=Lt($ce);if(e===void 0)throw new Error("[kobalte]: `useToastContext` must be used within a `Toast.Root` component");return e}function Tce(e){const t=lm(),[n,r]=Se(e,["aria-label","onClick"]);return d(_0,f({get"aria-label"(){return n["aria-label"]||t.translations().close},onClick:a=>{dt(a,n.onClick),t.close()}},r))}function Ece(e){const t=lm(),n=ft({id:t.generateId("description")},e),[r,i]=Se(n,["id"]);return he(()=>me(t.registerDescriptionId(r.id))),d(zt,f({as:"div",get id(){return r.id}},i))}var Pce=Tt();function kG(){const e=Lt(Pce);if(e===void 0)throw new Error("[kobalte]: `useToastRegionContext` must be used within a `Toast.Region` component");return e}function Dce(e){let t;const n=kG(),[r,i]=Se(e,["ref","onFocusIn","onFocusOut","onPointerMove","onPointerLeave"]),a=c=>{dt(c,r.onFocusIn),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},o=c=>{dt(c,r.onFocusOut),Yn(t,c.relatedTarget)||n.resumeAllTimer()},s=c=>{dt(c,r.onPointerMove),n.pauseOnInteraction()&&!n.isPaused()&&n.pauseAllTimer()},l=c=>{dt(c,r.onPointerLeave),Yn(t,ri(t).activeElement)||n.resumeAllTimer()};return he(vn([()=>t,()=>n.hotkey()],([c,u])=>{if(!c)return;const h=ri(c),m=g=>{u.every(v=>g[v]||g.code===v)&&ur(c)};h.addEventListener("keydown",m),me(()=>h.removeEventListener("keydown",m))})),he(()=>{if(!n.pauseOnPageIdle())return;const c=qU(t);c.addEventListener("blur",n.pauseAllTimer),c.addEventListener("focus",n.resumeAllTimer),me(()=>{c.removeEventListener("blur",n.pauseAllTimer),c.removeEventListener("focus",n.resumeAllTimer)})}),d(zt,f({as:"ol",ref(c){var u=hn(h=>t=h,r.ref);typeof u=="function"&&u(c)},tabIndex:-1,onFocusIn:a,onFocusOut:o,onPointerMove:s,onPointerLeave:l},i,{get children(){return d(Qt,{get each(){return n.toasts()},children:c=>c.toastComponent({get toastId(){return c.id}})})}}))}function Oce(e){const t=kG(),n=lm(),[r,i]=Se(e,["style"]),[a,o]=Ce(100);let s=0;return he(()=>{if(t.isPaused()||n.isPersistent())return;const l=setInterval(()=>{const c=new Date().getTime()-n.closeTimerStartTime()+s,u=Math.trunc(100-c/n.duration()*100);o(u<0?0:u)});me(()=>{s+=new Date().getTime()-n.closeTimerStartTime(),clearInterval(l)})}),d(zt,f({as:"div",get style(){return Wa({"--kb-toast-progress-fill-width":`${a()}%`},r.style)}},i))}function Rce(e){return d(zt,f({as:"div","aria-hidden":"true",role:"presentation"},e))}var[bG,cm]=nt({toasts:[]});function PLt(e){cm("toasts",t=>[...t,e])}function DLt(e){return bG.toasts.find(t=>t.id===e)}function OLt(e,t){const n=bG.toasts.findIndex(r=>r.id===e);n!==-1&&cm("toasts",r=>[...r.slice(0,n),t,...r.slice(n+1)])}function RLt(e){cm("toasts",t=>t.id===e,"dismiss",!0)}function zLt(e){cm("toasts",t=>t.filter(n=>n.id!==e))}function qLt(){cm("toasts",[])}var m0={toasts:()=>bG.toasts,add:PLt,get:DLt,update:OLt,dismiss:RLt,remove:zLt,clear:qLt},jQ="{hotkey}",jLt={close:"Close"},HLt={notifications:e=>`Notifications (${e})`};function zce(e){const t=ft({id:`toast-region-${xr()}`,hotkey:["altKey","KeyT"],duration:5e3,limit:3,swipeDirection:"right",swipeThreshold:50,pauseOnInteraction:!0,pauseOnPageIdle:!0,topLayer:!0,translations:HLt},e),[n,r]=Se(t,["translations","style","hotkey","duration","limit","swipeDirection","swipeThreshold","pauseOnInteraction","pauseOnPageIdle","topLayer","aria-label","regionId"]),i=Z(()=>m0.toasts().filter(m=>m.region===n.regionId&&m.dismiss===!1).slice(0,n.limit)),[a,o]=Ce(!1),s=()=>i().length>0,l=()=>n.hotkey.join("+").replace(/Key/g,"").replace(/Digit/g,""),c=()=>(n["aria-label"]||n.translations.notifications(jQ)).replace(jQ,l()),u=()=>({[a2]:n.topLayer?"":void 0}),h={isPaused:a,toasts:i,hotkey:()=>n.hotkey,duration:()=>n.duration,swipeDirection:()=>n.swipeDirection,swipeThreshold:()=>n.swipeThreshold,pauseOnInteraction:()=>n.pauseOnInteraction,pauseOnPageIdle:()=>n.pauseOnPageIdle,pauseAllTimer:()=>o(!0),resumeAllTimer:()=>o(!1),generateId:Io(()=>r.id)};return d(Pce.Provider,{value:h,get children(){return d(zt,f({as:"div",role:"region",tabIndex:-1,get"aria-label"(){return c()},get style(){return Wa({"pointer-events":s()?n.topLayer?"auto":void 0:"none"},n.style)}},u,r))}})}var FLt="toast.swipeStart",VLt="toast.swipeMove",BLt="toast.swipeCancel",ULt="toast.swipeEnd";function qce(e){const t=kG(),n=ft({id:`toast-${xr()}`,priority:"high",translations:jLt},e),[r,i]=Se(n,["ref","translations","toastId","style","priority","duration","persistent","onPause","onResume","onSwipeStart","onSwipeMove","onSwipeCancel","onSwipeEnd","onEscapeKeyDown","onKeyDown","onPointerDown","onPointerMove","onPointerUp"]),[a,o]=Ce(!0),[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(!0),[g,y]=Ce(),{present:v}=i0({show:a,element:()=>g()??null}),k=Z(()=>r.duration||t.duration());let b,x=0,w=k(),M=null,_=null;const C=()=>{o(!1),m(!0)},L=()=>{m0.remove(r.toastId)},S=R=>{!R||r.persistent||(window.clearTimeout(b),x=new Date().getTime(),b=window.setTimeout(C,R))},I=()=>{S(w),r.onResume?.()},A=()=>{const R=new Date().getTime()-x;w=w-R,window.clearTimeout(b),r.onPause?.()},D=R=>{dt(R,r.onKeyDown),R.key==="Escape"&&(r.onEscapeKeyDown?.(R),R.defaultPrevented||C())},P=R=>{dt(R,r.onPointerDown),R.button===0&&(M={x:R.clientX,y:R.clientY})},O=R=>{if(dt(R,r.onPointerMove),!M)return;const H=R.clientX-M.x,Y=R.clientY-M.y,j=!!_,X=["left","right"].includes(t.swipeDirection()),W=["left","up"].includes(t.swipeDirection())?Math.min:Math.max,G=X?W(0,H):0,J=X?0:W(0,Y),oe=R.pointerType==="touch"?10:2,de={x:G,y:J},ye={originalEvent:R,delta:de};if(j){_=de,Cg(VLt,r.onSwipeMove,ye);const{x:ve,y:le}=de;R.currentTarget.setAttribute("data-swipe","move"),R.currentTarget.style.setProperty("--kb-toast-swipe-move-x",`${ve}px`),R.currentTarget.style.setProperty("--kb-toast-swipe-move-y",`${le}px`)}else HQ(de,t.swipeDirection(),oe)?(_=de,Cg(FLt,r.onSwipeStart,ye),R.currentTarget.setAttribute("data-swipe","start"),R.target.setPointerCapture(R.pointerId)):(Math.abs(H)>oe||Math.abs(Y)>oe)&&(M=null)},E=R=>{dt(R,r.onPointerUp);const H=_,Y=R.target;if(Y.hasPointerCapture(R.pointerId)&&Y.releasePointerCapture(R.pointerId),_=null,M=null,H){const j=R.currentTarget,X={originalEvent:R,delta:H};if(HQ(H,t.swipeDirection(),t.swipeThreshold())){Cg(ULt,r.onSwipeEnd,X);const{x:W,y:G}=H;R.currentTarget.setAttribute("data-swipe","end"),R.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),R.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),R.currentTarget.style.setProperty("--kb-toast-swipe-end-x",`${W}px`),R.currentTarget.style.setProperty("--kb-toast-swipe-end-y",`${G}px`),C()}else Cg(BLt,r.onSwipeCancel,X),R.currentTarget.setAttribute("data-swipe","cancel"),R.currentTarget.style.removeProperty("--kb-toast-swipe-move-x"),R.currentTarget.style.removeProperty("--kb-toast-swipe-move-y"),R.currentTarget.style.removeProperty("--kb-toast-swipe-end-x"),R.currentTarget.style.removeProperty("--kb-toast-swipe-end-y");j.addEventListener("click",W=>W.preventDefault(),{once:!0})}};dn(()=>{t.toasts().find(R=>R.id===r.toastId&&R.update)&&m(!1)}),he(vn(()=>t.isPaused(),R=>{R?A():I()},{defer:!0})),he(vn([a,k],([R,H])=>{R&&!t.isPaused()&&S(H)})),he(vn(()=>m0.get(r.toastId)?.dismiss,R=>R&&C())),he(vn(()=>v(),R=>!R&&L()));const T={translations:()=>r.translations,close:C,duration:k,isPersistent:()=>r.persistent??!1,closeTimerStartTime:()=>x,generateId:Io(()=>i.id),registerTitleId:zr(l),registerDescriptionId:zr(u)};return d(ke,{get when(){return v()},get children(){return d($ce.Provider,{value:T,get children(){return d(zt,f({as:"li",ref(R){var H=hn(y,r.ref);typeof H=="function"&&H(R)},role:"status",tabIndex:0,get style(){return Wa({animation:h()?void 0:"none","user-select":"none","touch-action":"none"},r.style)},get"aria-live"(){return r.priority==="high"?"assertive":"polite"},"aria-atomic":"true",get"aria-labelledby"(){return s()},get"aria-describedby"(){return c()},get"data-opened"(){return a()?"":void 0},get"data-closed"(){return a()?void 0:""},get"data-swipe-direction"(){return t.swipeDirection()},onKeyDown:D,onPointerDown:P,onPointerMove:O,onPointerUp:E},i))}})}})}function HQ(e,t,n=0){const r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t==="left"||t==="right"?a&&r>n:!a&&i>n}function Cg(e,t,n){const r=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),r.dispatchEvent(i)}function jce(e){const t=lm(),n=ft({id:t.generateId("title")},e),[r,i]=Se(n,["id"]);return he(()=>me(t.registerTitleId(r.id))),d(zt,f({as:"div",get id(){return r.id}},i))}var WLt=0;function Hce(e,t){const n=WLt++;return m0.add({id:n,toastComponent:e,dismiss:!1,update:!1,region:t?.region}),n}function PB(e,t){m0.update(e,{id:e,toastComponent:t,dismiss:!1,update:!0})}function GLt(e,t,n){const r=Hce(i=>t({get toastId(){return i.toastId},state:"pending"}),n);return(nre(e)?e():e).then(i=>PB(r,a=>t({get toastId(){return a.toastId},state:"fulfilled",data:i}))).catch(i=>PB(r,a=>t({get toastId(){return a.toastId},state:"rejected",error:i}))),r}function ZLt(e){return m0.dismiss(e),e}function KLt(){m0.clear()}var Kh={show:Hce,update:PB,promise:GLt,dismiss:ZLt,clear:KLt},us=Object.assign(qce,{CloseButton:Tce,Description:Ece,List:Dce,ProgressFill:Oce,ProgressTrack:Rce,Region:zce,Title:jce,toaster:Kh});function Cr(e){const[t,n]=Se(e,["variant","size","iconSize","class","classList"]);return d(UU,f(n,{"data-component":"icon-button",get"data-icon"(){return e.icon},get"data-size"(){return t.size||"normal"},get"data-variant"(){return t.variant||"secondary"},get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return d(Kt,{get name(){return e.icon},get size(){return t.iconSize??(t.size==="large"?"normal":"small")}})}}))}var XLt=ie("<div data-slot=toast-icon>"),YLt=ie("<div data-slot=toast-content>"),JLt=ie("<div data-slot=toast-actions>"),QLt=ie("<button data-slot=toast-action>");function eIt(e){return d(w0,{get children(){return d(us.Region,f({"data-component":"toast-region"},e,{get children(){return d(us.List,{"data-slot":"toast-list"})}}))}})}function tIt(e){return d(us,f({"data-component":"toast",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}}},e))}function nIt(e){return(()=>{var t=XLt();return K(t,d(Kt,{get name(){return e.name}})),t})()}function rIt(e){return(()=>{var t=YLt();return ki(t,e,!1,!1),t})()}function iIt(e){return d(us.Title,f({"data-slot":"toast-title"},e))}function aIt(e){return d(us.Description,f({"data-slot":"toast-description"},e))}function oIt(e){return(()=>{var t=JLt();return ki(t,e,!1,!1),t})()}function sIt(e){const t=M0();return d(us.CloseButton,f({"data-slot":"toast-close-button",as:Cr,icon:"close",variant:"ghost",get"aria-label"(){return t.t("ui.common.dismiss")}},e))}function lIt(e){return d(us.ProgressTrack,f({"data-slot":"toast-progress-track"},e))}function cIt(e){return d(us.ProgressFill,f({"data-slot":"toast-progress-fill"},e))}const As=Object.assign(tIt,{Region:eIt,Icon:nIt,Content:rIt,Title:iIt,Description:aIt,Actions:oIt,CloseButton:sIt,ProgressTrack:lIt,ProgressFill:cIt});function lr(e){const t=typeof e=="string"?{description:e}:e;return Kh.show(n=>d(As,{get toastId(){return n.toastId},get duration(){return t.duration},get persistent(){return t.persistent},get"data-variant"(){return t.variant??"default"},get children(){return[d(ke,{get when(){return t.icon},get children(){return d(As.Icon,{get name(){return t.icon}})}}),d(As.Content,{get children(){return[d(ke,{get when(){return t.title},get children(){return d(As.Title,{get children(){return t.title}})}}),d(ke,{get when(){return t.description},get children(){return d(As.Description,{get children(){return t.description}})}}),d(ke,{get when(){return t.actions?.length},get children(){return d(As.Actions,{get children(){return t.actions.map(r=>(()=>{var i=QLt();return i.$$click=()=>{typeof r.onClick=="function"&&r.onClick(),Kh.dismiss(n.toastId)},K(i,()=>r.label),i})())}})}})]}}),d(As.CloseButton,{})]}}))}li(["click"]);function Gn(e){if(!e)return"";const n=e.replace(/[\/\\]+$/,"").split(/[\/\\]/);return n[n.length-1]??""}function aQt(e){if(!e)return"";const n=e.replace(/[\/\\]+$/,"").split(/[\/\\]/);return n.slice(0,n.length-1).join("/")+"/"}function oQt(e,t=20){const n=Gn(e);if(n.length<=t)return n;const r=n.lastIndexOf("."),i=r<=0?"":n.slice(r),a=t-i.length-1;return a<=0?n.slice(0,t-1)+"…":n.slice(0,a)+"…"+i}class Fce extends Set{emit(t){for(const n of this)n(t)}}function dIt(){const e=new Fce;return{listen(t){return e.add(t),RU(e.delete.bind(e,t))},emit:e.emit.bind(e),clear:me(e.clear.bind(e))}}class uIt extends Map{on(t,n){let r=this.get(t);r||this.set(t,r=new Fce),r.add(n)}off(t,n){const r=this.get(t);r?.delete(n)&&!r.size&&this.delete(t)}emit(t,n){this.get(t)?.emit(n)}}function hIt(){const e=new uIt;return{on(t,n){return e.on(t,n),RU(e.off.bind(e,t,n))},emit:e.emit.bind(e),clear:me(e.clear.bind(e))}}function Vce(){const e=hIt(),t=dIt();return{on:e.on,clear:e.clear,listen:t.listen,emit(n,r){t.emit({name:n,details:r}),e.emit(n,r)}}}const Bce=Object.freeze({status:"aborted"});function ae(e,t,n){function r(s,l){var c;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(c=s._zod).traits??(c.traits=new Set),s._zod.traits.add(e),t(s,l);for(const u in o.prototype)u in s||Object.defineProperty(s,u,{value:o.prototype[u].bind(s)});s._zod.constr=o,s._zod.def=l}const i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(s){var l;const c=n?.Parent?new a:this;r(c,s),(l=c._zod).deferred??(l.deferred=[]);for(const u of c._zod.deferred)u();return c}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}const Uce=Symbol("zod_brand");class e0 extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class tj extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Cz={};function ii(e){return e&&Object.assign(Cz,e),Cz}function fIt(e){return e}function pIt(e){return e}function mIt(e){}function gIt(e){throw new Error}function yIt(e){}function wG(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function $e(e,t="|"){return e.map(n=>ut(n)).join(t)}function Lz(e,t){return typeof t=="bigint"?t.toString():t}function dm(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function A0(e){return e==null}function nj(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function Wce(e,t){const n=(e.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const l=r.match(/\d?e-(\d?)/);l?.[1]&&(i=Number.parseInt(l[1]))}const a=n>i?n:i,o=Number.parseInt(e.toFixed(a).replace(".","")),s=Number.parseInt(t.toFixed(a).replace(".",""));return o%s/10**a}const FQ=Symbol("evaluating");function Pt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==FQ)return r===void 0&&(r=FQ,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function rj(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ya(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function ul(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function vIt(e){return ul(e._zod.def)}function kIt(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function bIt(e){const t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{const i={};for(let a=0;a<t.length;a++)i[t[a]]=r[a];return i})}function wIt(e=10){const t="abcdefghijklmnopqrstuvwxyz";let n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function DB(e){return JSON.stringify(e)}const xG="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Xh(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Gce=dm(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function g0(e){if(Xh(e)===!1)return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(Xh(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ij(e){return g0(e)?{...e}:Array.isArray(e)?[...e]:e}function xIt(e){let t=0;for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const _It=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Iz=new Set(["string","number","symbol"]),Zce=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ys(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ua(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function we(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function MIt(e){let t;return new Proxy({},{get(n,r,i){return t??(t=e()),Reflect.get(t,r,i)},set(n,r,i,a){return t??(t=e()),Reflect.set(t,r,i,a)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??(t=e()),Reflect.defineProperty(t,r,i)}})}function ut(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Kce(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Xce={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Yce={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Jce(e,t){const n=e._zod.def,r=ul(e._zod.def,{get shape(){const i={};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(i[a]=n.shape[a])}return Ya(this,"shape",i),i},checks:[]});return ua(e,r)}function Qce(e,t){const n=e._zod.def,r=ul(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const a in t){if(!(a in n.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete i[a]}return Ya(this,"shape",i),i},checks:[]});return ua(e,r)}function ede(e,t){if(!g0(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const i=ul(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return Ya(this,"shape",a),a},checks:[]});return ua(e,i)}function tde(e,t){if(!g0(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n={...e._zod.def,get shape(){const r={...e._zod.def.shape,...t};return Ya(this,"shape",r),r},checks:e._zod.def.checks};return ua(e,n)}function nde(e,t){const n=ul(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Ya(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return ua(e,n)}function rde(e,t,n){const r=ul(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const o in n){if(!(o in i))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(a[o]=e?new e({type:"optional",innerType:i[o]}):i[o])}else for(const o in i)a[o]=e?new e({type:"optional",innerType:i[o]}):i[o];return Ya(this,"shape",a),a},checks:[]});return ua(t,r)}function ide(e,t,n){const r=ul(t._zod.def,{get shape(){const i=t._zod.def.shape,a={...i};if(n)for(const o in n){if(!(o in a))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(a[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)a[o]=new e({type:"nonoptional",innerType:i[o]});return Ya(this,"shape",a),a},checks:[]});return ua(t,r)}function W1(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Aa(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function $p(e){return typeof e=="string"?e:e?.message}function Ha(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const i=$p(e.inst?._zod.def?.error?.(e))??$p(t?.error?.(e))??$p(n.customError?.(e))??$p(n.localeError?.(e))??"Invalid input";r.message=i}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function aj(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function oj(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Yh(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function SIt(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function ade(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function ode(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function CIt(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return ade(t+n)}function LIt(e){return ode(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function IIt(e){const t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");const n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function NIt(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class AIt{constructor(...t){}}const sde=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:Yce,Class:AIt,NUMBER_FORMAT_RANGES:Xce,aborted:W1,allowsEval:Gce,assert:yIt,assertEqual:fIt,assertIs:mIt,assertNever:gIt,assertNotEqual:pIt,assignProp:Ya,base64ToUint8Array:ade,base64urlToUint8Array:CIt,cached:dm,captureStackTrace:xG,cleanEnum:SIt,cleanRegex:nj,clone:ua,cloneDef:vIt,createTransparentProxy:MIt,defineLazy:Pt,esc:DB,escapeRegex:Ys,extend:ede,finalizeIssue:Ha,floatSafeRemainder:Wce,getElementAtPath:kIt,getEnumValues:wG,getLengthableOrigin:oj,getParsedType:_It,getSizableOrigin:aj,hexToUint8Array:IIt,isObject:Xh,isPlainObject:g0,issue:Yh,joinValues:$e,jsonStringifyReplacer:Lz,merge:nde,mergeDefs:ul,normalizeParams:we,nullish:A0,numKeys:xIt,objectClone:rj,omit:Qce,optionalKeys:Kce,partial:rde,pick:Jce,prefixIssues:Aa,primitiveTypes:Zce,promiseAllObject:bIt,propertyKeyTypes:Iz,randomString:wIt,required:ide,safeExtend:tde,shallowClone:ij,stringifyPrimitive:ut,uint8ArrayToBase64:ode,uint8ArrayToBase64url:LIt,uint8ArrayToHex:NIt,unwrapMessage:$p},Symbol.toStringTag,{value:"Module"})),lde=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Lz,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},_G=ae("$ZodError",lde),Fi=ae("$ZodError",lde,{Parent:Error});function MG(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function SG(e,t){const n=t||function(a){return a.message},r={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>i({issues:s}));else if(o.code==="invalid_key")i({issues:o.issues});else if(o.code==="invalid_element")i({issues:o.issues});else if(o.path.length===0)r._errors.push(n(o));else{let s=r,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(o))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return i(e),r}function cde(e,t){const n=t||function(a){return a.message},r={errors:[]},i=(a,o=[])=>{var s,l;for(const c of a.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(u=>i({issues:u},c.path));else if(c.code==="invalid_key")i({issues:c.issues},c.path);else if(c.code==="invalid_element")i({issues:c.issues},c.path);else{const u=[...o,...c.path];if(u.length===0){r.errors.push(n(c));continue}let h=r,m=0;for(;m<u.length;){const g=u[m],y=m===u.length-1;typeof g=="string"?(h.properties??(h.properties={}),(s=h.properties)[g]??(s[g]={errors:[]}),h=h.properties[g]):(h.items??(h.items=[]),(l=h.items)[g]??(l[g]={errors:[]}),h=h.items[g]),y&&h.errors.push(n(c)),m++}}};return i(e),r}function dde(e){const t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(const r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function ude(e){const t=[],n=[...e.issues].sort((r,i)=>(r.path??[]).length-(i.path??[]).length);for(const r of n)t.push(`✖ ${r.message}`),r.path?.length&&t.push(` → at ${dde(r.path)}`);return t.join(`
|
|
2479
2479
|
`)}const um=e=>(t,n,r,i)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new e0;if(o.issues.length){const s=new(i?.Err??e)(o.issues.map(l=>Ha(l,a,ii())));throw xG(s,i?.callee),s}return o.value},OB=um(Fi),hm=e=>async(t,n,r,i)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){const s=new(i?.Err??e)(o.issues.map(l=>Ha(l,a,ii())));throw xG(s,i?.callee),s}return o.value},RB=hm(Fi),fm=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new e0;return a.issues.length?{success:!1,error:new(e??_G)(a.issues.map(o=>Ha(o,i,ii())))}:{success:!0,data:a.value}},hde=fm(Fi),pm=e=>async(t,n,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(o=>Ha(o,i,ii())))}:{success:!0,data:a.value}},fde=pm(Fi),CG=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return um(e)(t,n,i)},$It=CG(Fi),LG=e=>(t,n,r)=>um(e)(t,n,r),TIt=LG(Fi),IG=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return hm(e)(t,n,i)},EIt=IG(Fi),NG=e=>async(t,n,r)=>hm(e)(t,n,r),PIt=NG(Fi),AG=e=>(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return fm(e)(t,n,i)},DIt=AG(Fi),$G=e=>(t,n,r)=>fm(e)(t,n,r),OIt=$G(Fi),TG=e=>async(t,n,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return pm(e)(t,n,i)},RIt=TG(Fi),EG=e=>async(t,n,r)=>pm(e)(t,n,r),zIt=EG(Fi),pde=/^[cC][^\s-]{8,}$/,mde=/^[0-9a-z]+$/,gde=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,yde=/^[0-9a-vA-V]{20}$/,vde=/^[A-Za-z0-9]{27}$/,kde=/^[a-zA-Z0-9_-]{21}$/,bde=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qIt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,wde=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Jh=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,jIt=Jh(4),HIt=Jh(6),FIt=Jh(7),xde=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,VIt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,BIt=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,_de=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,UIt=_de,WIt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,GIt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Mde(){return new RegExp(GIt,"u")}const Sde=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Cde=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Lde=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ide=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nde=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,PG=/^[A-Za-z0-9_-]*$/,DG=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Ade=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,$de=/^\+(?:[0-9]){6,14}[0-9]$/,Tde="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Ede=new RegExp(`^${Tde}$`);function Pde(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Dde(e){return new RegExp(`^${Pde(e)}$`)}function Ode(e){const t=Pde({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${Tde}T(?:${r})$`)}const Rde=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},zde=/^-?\d+n?$/,qde=/^-?\d+$/,jde=/^-?\d+(?:\.\d+)?/,Hde=/^(?:true|false)$/i,Fde=/^null$/i,Vde=/^undefined$/i,Bde=/^[^A-Z]*$/,Ude=/^[^a-z]*$/,Wde=/^[0-9a-fA-F]*$/;function mm(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function gm(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}const ZIt=/^[0-9a-fA-F]{32}$/,KIt=mm(22,"=="),XIt=gm(22),YIt=/^[0-9a-fA-F]{40}$/,JIt=mm(27,"="),QIt=gm(27),eNt=/^[0-9a-fA-F]{64}$/,tNt=mm(43,"="),nNt=gm(43),rNt=/^[0-9a-fA-F]{96}$/,iNt=mm(64,""),aNt=gm(64),oNt=/^[0-9a-fA-F]{128}$/,sNt=mm(86,"=="),lNt=gm(86),OG=Object.freeze(Object.defineProperty({__proto__:null,base64:Nde,base64url:PG,bigint:zde,boolean:Hde,browserEmail:WIt,cidrv4:Lde,cidrv6:Ide,cuid:pde,cuid2:mde,date:Ede,datetime:Ode,domain:Ade,duration:bde,e164:$de,email:xde,emoji:Mde,extendedDuration:qIt,guid:wde,hex:Wde,hostname:DG,html5Email:VIt,idnEmail:UIt,integer:qde,ipv4:Sde,ipv6:Cde,ksuid:vde,lowercase:Bde,md5_base64:KIt,md5_base64url:XIt,md5_hex:ZIt,nanoid:kde,null:Fde,number:jde,rfc5322Email:BIt,sha1_base64:JIt,sha1_base64url:QIt,sha1_hex:YIt,sha256_base64:tNt,sha256_base64url:nNt,sha256_hex:eNt,sha384_base64:iNt,sha384_base64url:aNt,sha384_hex:rNt,sha512_base64:sNt,sha512_base64url:lNt,sha512_hex:oNt,string:Rde,time:Dde,ulid:gde,undefined:Vde,unicodeEmail:_de,uppercase:Ude,uuid:Jh,uuid4:jIt,uuid6:HIt,uuid7:FIt,xid:yde},Symbol.toStringTag,{value:"Module"})),On=ae("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Gde={number:"number",bigint:"bigint",object:"date"},RG=ae("$ZodCheckLessThan",(e,t)=>{On.init(e,t);const n=Gde[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<a&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),zG=ae("$ZodCheckGreaterThan",(e,t)=>{On.init(e,t);const n=Gde[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,a=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>a&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Zde=ae("$ZodCheckMultipleOf",(e,t)=>{On.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):Wce(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Kde=ae("$ZodCheckNumberFormat",(e,t)=>{On.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,a]=Xce[t.format];e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,s.minimum=i,s.maximum=a,n&&(s.pattern=qde)}),e._zod.check=o=>{const s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:"number",input:s,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:"number",input:s,code:"too_big",maximum:a,inst:e})}}),Xde=ae("$ZodCheckBigIntFormat",(e,t)=>{On.init(e,t);const[n,r]=Yce[t.format];e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,a.minimum=n,a.maximum=r}),e._zod.check=i=>{const a=i.value;a<n&&i.issues.push({origin:"bigint",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:"bigint",input:a,code:"too_big",maximum:r,inst:e})}}),Yde=ae("$ZodCheckMaxSize",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!A0(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;i.size<=t.maximum||r.issues.push({origin:aj(i),code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Jde=ae("$ZodCheckMinSize",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!A0(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;i.size>=t.minimum||r.issues.push({origin:aj(i),code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Qde=ae("$ZodCheckSizeEquals",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!A0(i)&&i.size!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.size,i.maximum=t.size,i.size=t.size}),e._zod.check=r=>{const i=r.value,a=i.size;if(a===t.size)return;const o=a>t.size;r.issues.push({origin:aj(i),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),eue=ae("$ZodCheckMaxLength",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!A0(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=oj(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),tue=ae("$ZodCheckMinLength",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!A0(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=oj(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),nue=ae("$ZodCheckLengthEquals",(e,t)=>{var n;On.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!A0(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,a=i.length;if(a===t.length)return;const o=oj(i),s=a>t.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),ym=ae("$ZodCheckStringFormat",(e,t)=>{var n,r;On.init(e,t),e._zod.onattach.push(i=>{const a=i._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),rue=ae("$ZodCheckRegex",(e,t)=>{ym.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),iue=ae("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Bde),ym.init(e,t)}),aue=ae("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ude),ym.init(e,t)}),oue=ae("$ZodCheckIncludes",(e,t)=>{On.init(e,t);const n=Ys(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),sue=ae("$ZodCheckStartsWith",(e,t)=>{On.init(e,t);const n=new RegExp(`^${Ys(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),lue=ae("$ZodCheckEndsWith",(e,t)=>{On.init(e,t);const n=new RegExp(`.*${Ys(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function VQ(e,t,n){e.issues.length&&t.issues.push(...Aa(n,e.issues))}const cue=ae("$ZodCheckProperty",(e,t)=>{On.init(e,t),e._zod.check=n=>{const r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(i=>VQ(i,n,t.property));VQ(r,n,t.property)}}),due=ae("$ZodCheckMimeType",(e,t)=>{On.init(e,t);const n=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),uue=ae("$ZodCheckOverwrite",(e,t)=>{On.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class hue{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
2480
2480
|
`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),a=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of a)this.content.push(o)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,i.join(`
|
|
2481
2481
|
`))}}const fue={major:4,minor:1,patch:8},vt=ae("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=fue;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const a of i._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,s,l)=>{let c=W1(o),u;for(const h of s){if(h._zod.def.when){if(!h._zod.def.when(o))continue}else if(c)continue;const m=o.issues.length,g=h._zod.check(o);if(g instanceof Promise&&l?.async===!1)throw new e0;if(u||g instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await g,o.issues.length!==m&&(c||(c=W1(o,m)))});else{if(o.issues.length===m)continue;c||(c=W1(o,m))}}return u?u.then(()=>o):o},a=(o,s,l)=>{if(W1(o))return o.aborted=!0,o;const c=i(s,r,l);if(c instanceof Promise){if(l.async===!1)throw new e0;return c.then(u=>e._zod.parse(u,l))}return e._zod.parse(c,l)};e._zod.run=(o,s)=>{if(s.skipChecks)return e._zod.parse(o,s);if(s.direction==="backward"){const c=e._zod.parse({value:o.value,issues:[]},{...s,skipChecks:!0});return c instanceof Promise?c.then(u=>a(u,o,s)):a(c,o,s)}const l=e._zod.parse(o,s);if(l instanceof Promise){if(s.async===!1)throw new e0;return l.then(c=>i(c,r,s))}return i(l,r,s)}}e["~standard"]={validate:i=>{try{const a=hde(e,i);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return fde(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}}),vm=ae("$ZodString",(e,t)=>{vt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Rde(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),pn=ae("$ZodStringFormat",(e,t)=>{ym.init(e,t),vm.init(e,t)}),pue=ae("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=wde),pn.init(e,t)}),mue=ae("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Jh(r))}else t.pattern??(t.pattern=Jh());pn.init(e,t)}),gue=ae("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=xde),pn.init(e,t)}),yue=ae("$ZodURL",(e,t)=>{pn.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:DG.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),vue=ae("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Mde()),pn.init(e,t)}),kue=ae("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=kde),pn.init(e,t)}),bue=ae("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=pde),pn.init(e,t)}),wue=ae("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=mde),pn.init(e,t)}),xue=ae("$ZodULID",(e,t)=>{t.pattern??(t.pattern=gde),pn.init(e,t)}),_ue=ae("$ZodXID",(e,t)=>{t.pattern??(t.pattern=yde),pn.init(e,t)}),Mue=ae("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vde),pn.init(e,t)}),Sue=ae("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ode(t)),pn.init(e,t)}),Cue=ae("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ede),pn.init(e,t)}),Lue=ae("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Dde(t)),pn.init(e,t)}),Iue=ae("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=bde),pn.init(e,t)}),Nue=ae("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Sde),pn.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv4"})}),Aue=ae("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Cde),pn.init(e,t),e._zod.onattach.push(n=>{const r=n._zod.bag;r.format="ipv6"}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),$ue=ae("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Lde),pn.init(e,t)}),Tue=ae("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ide),pn.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,a]=r;if(!a)throw new Error;const o=Number(a);if(`${o}`!==a)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function qG(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Eue=ae("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Nde),pn.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64"}),e._zod.check=n=>{qG(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Pue(e){if(!PG.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return qG(n)}const Due=ae("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=PG),pn.init(e,t),e._zod.onattach.push(n=>{n._zod.bag.contentEncoding="base64url"}),e._zod.check=n=>{Pue(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Oue=ae("$ZodE164",(e,t)=>{t.pattern??(t.pattern=$de),pn.init(e,t)});function Rue(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const zue=ae("$ZodJWT",(e,t)=>{pn.init(e,t),e._zod.check=n=>{Rue(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),que=ae("$ZodCustomStringFormat",(e,t)=>{pn.init(e,t),e._zod.check=n=>{t.fn(n.value)||n.issues.push({code:"invalid_format",format:t.format,input:n.value,inst:e,continue:!t.abort})}}),jG=ae("$ZodNumber",(e,t)=>{vt.init(e,t),e._zod.pattern=e._zod.bag.pattern??jde,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const a=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...a?{received:a}:{}}),n}}),jue=ae("$ZodNumber",(e,t)=>{Kde.init(e,t),jG.init(e,t)}),HG=ae("$ZodBoolean",(e,t)=>{vt.init(e,t),e._zod.pattern=Hde,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),FG=ae("$ZodBigInt",(e,t)=>{vt.init(e,t),e._zod.pattern=zde,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}return typeof n.value=="bigint"||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}}),Hue=ae("$ZodBigInt",(e,t)=>{Xde.init(e,t),FG.init(e,t)}),Fue=ae("$ZodSymbol",(e,t)=>{vt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;return typeof i=="symbol"||n.issues.push({expected:"symbol",code:"invalid_type",input:i,inst:e}),n}}),Vue=ae("$ZodUndefined",(e,t)=>{vt.init(e,t),e._zod.pattern=Vde,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(n,r)=>{const i=n.value;return typeof i>"u"||n.issues.push({expected:"undefined",code:"invalid_type",input:i,inst:e}),n}}),Bue=ae("$ZodNull",(e,t)=>{vt.init(e,t),e._zod.pattern=Fde,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),Uue=ae("$ZodAny",(e,t)=>{vt.init(e,t),e._zod.parse=n=>n}),Wue=ae("$ZodUnknown",(e,t)=>{vt.init(e,t),e._zod.parse=n=>n}),Gue=ae("$ZodNever",(e,t)=>{vt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)}),Zue=ae("$ZodVoid",(e,t)=>{vt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;return typeof i>"u"||n.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),n}}),Kue=ae("$ZodDate",(e,t)=>{vt.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}const i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:i,...a?{received:"Invalid Date"}:{},inst:e}),n}});function BQ(e,t,n){e.issues.length&&t.issues.push(...Aa(n,e.issues)),t.value[n]=e.value}const Xue=ae("$ZodArray",(e,t)=>{vt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const a=[];for(let o=0;o<i.length;o++){const s=i[o],l=t.element._zod.run({value:s,issues:[]},r);l instanceof Promise?a.push(l.then(c=>BQ(c,n,o))):BQ(l,n,o)}return a.length?Promise.all(a).then(()=>n):n}});function Nz(e,t,n,r){e.issues.length&&t.issues.push(...Aa(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Yue(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=Kce(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Jue(e,t,n,r,i,a){const o=[],s=i.keySet,l=i.catchall._zod,c=l.def.type;for(const u of Object.keys(t)){if(s.has(u))continue;if(c==="never"){o.push(u);continue}const h=l.run({value:t[u],issues:[]},r);h instanceof Promise?e.push(h.then(m=>Nz(m,n,u,t))):Nz(h,n,u,t)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Que=ae("$ZodObject",(e,t)=>{vt.init(e,t);const n=dm(()=>Yue(t));Pt(e._zod,"propValues",()=>{const o=t.shape,s={};for(const l in o){const c=o[l]._zod;if(c.values){s[l]??(s[l]=new Set);for(const u of c.values)s[l].add(u)}}return s});const r=Xh,i=t.catchall;let a;e._zod.parse=(o,s)=>{a??(a=n.value);const l=o.value;if(!r(l))return o.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),o;o.value={};const c=[],u=a.shape;for(const h of a.keys){const g=u[h]._zod.run({value:l[h],issues:[]},s);g instanceof Promise?c.push(g.then(y=>Nz(y,o,h,l))):Nz(g,o,h,l)}return i?Jue(c,l,o,s,n.value,e):c.length?Promise.all(c).then(()=>o):o}}),e1e=ae("$ZodObjectJIT",(e,t)=>{Que.init(e,t);const n=e._zod.parse,r=dm(()=>Yue(t)),i=m=>{const g=new hue(["shape","payload","ctx"]),y=r.value,v=w=>{const M=DB(w);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};g.write("const input = payload.value;");const k=Object.create(null);let b=0;for(const w of y.keys)k[w]=`key_${b++}`;g.write("const newResult = {};");for(const w of y.keys){const M=k[w],_=DB(w);g.write(`const ${M} = ${v(w)};`),g.write(`
|
|
@@ -2514,13 +2514,13 @@ ${t}`,gPt=15e3;function yPt(e){if(e.message){if(!e.info||e.info.complete||e.info
|
|
|
2514
2514
|
${t}`,$2=(e,t)=>e<t?-1:e>t?1:0;function XPt(e,t){const n=new Map(e.map(r=>[r.id,r]));for(const r of t)n.set(r.id,r);return[...n.values()].sort((r,i)=>$2(r.id,i.id))}const YPt=(e,t)=>e?t.every(n=>rn.search(e,n.id,r=>r.id).found):t.length===0,JPt=(e,t)=>{if(!e)return Dh(t);const n=[...e];let r=!1;for(const i of t){const a=rn.search(n,i.id,o=>o.id);a.found||(n.splice(a.index,0,i),r=!0)}return r?n:e};function QPt(e,t){if(t.length===0)return{...e,confirmed:[]};const n=[...e.session],r=new Map(e.part.map(a=>[a.id,Dh(a.part)])),i=[];for(const a of t){const o=rn.search(n,a.message.id,c=>c.id),s=o.found;s||n.splice(o.index,0,a.message);const l=r.get(a.message.id);if(s&&YPt(l,a.parts)){i.push(a.message.id);continue}r.set(a.message.id,JPt(l,a.parts))}return{cursor:e.cursor,complete:e.complete,session:n,part:[...r.entries()].sort((a,o)=>$2(a[0],o[0])).map(([a,o])=>({id:a,part:o})),confirmed:i}}function pee(e,t){e("message",t.sessionID,n=>{if(!n)return[t.message];const r=rn.search(n,t.message.id,a=>a.id),i=[...n];return i.splice(r.index,0,t.message),i}),e("part",t.message.id,Dh(t.parts))}function eDt(e,t){e("message",t.sessionID,n=>{if(!n)return n;const r=rn.search(n,t.messageID,a=>a.id);if(!r.found)return n;const i=[...n];return i.splice(r.index,1),i}),e("part",n=>{if(!(t.messageID in n))return n;const r={...n};return delete r[t.messageID],r})}const{use:xj,provider:tDt}=Nn({name:"Sync",init:()=>{const e=ha(),t=Cf(),n=Z(()=>e.child(t.directory)),r=A=>!A||A===t.directory?n():e.child(A),i=A=>(n()[0].path.directory+"/"+A).replace("//","/"),a=80,o=200,s=new Map,l=new Map,c=new Map,u=new Map,h=30,m=new Map,[g,y]=nt({limit:{},cursor:{},complete:{},loading:{}}),v=A=>{const D=n()[0],P=rn.search(D.session,A,O=>O.id);if(P.found)return D.session[P.index]},k=(A,D,P)=>{const O=xa(A,D),E=u.get(O);if(E){E.set(P.message.id,{message:P.message,parts:Dh(P.parts)});return}u.set(O,new Map([[P.message.id,{message:P.message,parts:Dh(P.parts)}]]))},b=(A,D,P)=>{const O=xa(A,D);if(!P){u.delete(O);return}const E=u.get(O);E&&(E.delete(P),E.size===0&&u.delete(O))},x=(A,D)=>[...u.get(xa(A,D))?.values()??[]],w=A=>{const D=m.get(A);if(D)return m.delete(A),m.set(A,D),D;const P=new Set;for(m.set(A,P);m.size>h;){const O=m.keys().next().value;if(!O)break;const E=[...m.get(O)??[]];m.delete(O);const[,T]=e.child(O,{bootstrap:!1});_(O,T,E)}return P},M=(A,D)=>{if(D.length!==0){for(const P of D)b(A,P);y(Je(P=>{for(const O of D){const E=xa(A,O);delete P.limit[E],delete P.cursor[E],delete P.complete[E],delete P.loading[E]}}))}},_=(A,D,P)=>{if(P.length!==0){Ohe(A,P);for(const O of P)e.todo.set(O,void 0);D(Je(O=>{wj(O,P)})),M(A,P)}},C=(A,D,P)=>{const O=qhe({seen:w(A),keep:P,limit:jPt});_(A,D,O)},L=async A=>{const D=await zn(()=>A.client.session.messages({sessionID:A.sessionID,limit:A.limit,before:A.before})),P=(D.data??[]).filter(R=>!!R?.info?.id),O=P.map(R=>R.info).sort((R,H)=>$2(R.id,H.id)),E=P.map(R=>({id:R.info.id,part:Dh(R.parts)})),T=D.response.headers.get("x-next-cursor")??void 0;return{session:O,part:E,cursor:T,complete:!T}},S=(A,D)=>m.get(A)?.has(D)??!1,I=async A=>{const D=xa(A.directory,A.sessionID);g.loading[D]||(y("loading",D,!0),await L(A).then(P=>{if(!S(A.directory,A.sessionID))return;const O=QPt(P,x(A.directory,A.sessionID));for(const H of O.confirmed)b(A.directory,A.sessionID,H);const[E]=e.child(A.directory,{bootstrap:!1}),T=A.mode==="prepend"?E.message[A.sessionID]??[]:[],R=A.mode==="prepend"?XPt(T,O.session):O.session;ct(()=>{A.setStore("message",A.sessionID,Ct(R,{key:"id"}));for(const H of O.part){const Y=H.part.filter(j=>!KPt.has(j.type));Y.length&&A.setStore("part",H.id,Y)}y("limit",D,R.length),y("cursor",D,O.cursor),y("complete",D,O.complete),Dhe({directory:A.directory,sessionID:A.sessionID,limit:R.length,cursor:O.cursor,complete:O.complete})})}).finally(()=>{y(Je(P=>{if(!S(A.directory,A.sessionID)){delete P.loading[D];return}P.loading[D]=!1}))}))};return{get data(){return n()[0]},get set(){return n()[1]},get status(){return n()[0].status},get ready(){return n()[0].status!=="loading"},get project(){const A=n()[0],D=rn.search(e.data.project,A.project,P=>P.id);if(D.found)return e.data.project[D.index]},session:{get:v,optimistic:{add(A){const D=A.directory??t.directory,[,P]=r(A.directory);k(D,A.sessionID,{message:A.message,parts:A.parts}),pee(P,A)},remove(A){const D=A.directory??t.directory,[,P]=r(A.directory);b(D,A.sessionID,A.messageID),eDt(P,A)}},addOptimisticMessage(A){const D={id:A.messageID,sessionID:A.sessionID,role:"user",time:{created:Date.now()},agent:A.agent,model:A.model,variant:A.variant},[,P]=r();k(t.directory,A.sessionID,{message:D,parts:A.parts}),pee(P,{sessionID:A.sessionID,message:D,parts:A.parts})},async sync(A,D){const P=t.directory,O=t.client,[E,T]=e.child(P),R=xa(P,A);C(P,T,A);const H=VB(P,A);return H&&E.message[A]!==void 0&&g.limit[R]===void 0&&ct(()=>{y("limit",R,H.limit),y("cursor",R,H.cursor),y("complete",R,H.complete),y("loading",R,!1)}),xF(s,R,async()=>{const Y=vPt(P,A);if(Y){await Y;const oe=VB(P,A);oe&&E.message[A]!==void 0&&g.limit[R]===void 0&&ct(()=>{y("limit",R,oe.limit),y("cursor",R,oe.cursor),y("complete",R,oe.complete),y("loading",R,!1)})}const j=rn.search(E.session,A,oe=>oe.id).found,X=E.message[A]!==void 0&&g.limit[R]!==void 0;if(X&&j&&!D?.force)return;const W=g.limit[R]??a,G=j&&!D?.force?Promise.resolve():zn(()=>O.session.get({sessionID:A})).then(oe=>{if(!S(P,A))return;const de=oe.data;de&&T("session",Je(ye=>{const ve=rn.search(ye,A,le=>le.id);if(ve.found){ye[ve.index]=de;return}ye.splice(ve.index,0,de)}))}),J=X&&!D?.force?Promise.resolve():I({directory:P,client:O,setStore:T,sessionID:A,limit:W});await Promise.all([G,J])})},async diff(A,D){const P=t.directory,O=t.client,[E,T]=e.child(P);if(C(P,T,A),E.session_diff[A]!==void 0&&!D?.force)return;const R=xa(P,A);return xF(l,R,()=>zn(()=>O.session.diff({sessionID:A})).then(H=>{S(P,A)&&T("session_diff",A,Ct(H.data??[],{key:"file"}))}))},async todo(A,D){const P=t.directory,O=t.client,[E,T]=e.child(P);C(P,T,A);const R=E.todo[A],H=e.data.session_todo[A];if(R!==void 0&&(H===void 0&&e.todo.set(A,R),!D?.force))return;H!==void 0&&T("todo",A,Ct(H,{key:"id"}));const Y=xa(P,A);return xF(c,Y,()=>zn(()=>O.session.todo({sessionID:A})).then(j=>{if(!S(P,A))return;const X=j.data??[];T("todo",A,Ct(X,{key:"id"})),e.todo.set(A,X)}))},history:{more(A){const D=n()[0],P=xa(t.directory,A);return D.message[A]===void 0||g.limit[P]===void 0||g.complete[P]?!1:!!g.cursor[P]},loading(A){const D=xa(t.directory,A);return g.loading[D]??!1},async loadMore(A,D){const P=t.directory,O=t.client,[,E]=e.child(P);C(P,E,A);const T=xa(P,A),R=D??o;if(g.loading[T]||g.complete[T])return;const H=g.cursor[T];H&&await I({directory:P,client:O,setStore:E,sessionID:A,limit:R,before:H,mode:"prepend"})}},evict(A,D=t.directory){const[,P]=e.child(D);w(D).delete(A),_(D,P,[A])},fetch:async(A=10)=>{const D=t.directory,P=t.client,[O,E]=e.child(D);E("limit",T=>T+A),await P.session.list().then(T=>{const R=(T.data??[]).filter(H=>!!H?.id).sort((H,Y)=>$2(H.id,Y.id)).slice(0,O.limit);E("session",Ct(R,{key:"id"}))})},more:Z(()=>n()[0].session.length>=n()[0].limit),archive:async A=>{const D=t.directory,P=t.client,[,O]=e.child(D);await P.session.update({sessionID:A,time:{archived:Date.now()}}),O(Je(E=>{const T=rn.search(E.session,A,R=>R.id);T.found&&E.session.splice(T.index,1)}))}},absolute:i,get directory(){return n()[0].path.directory}}}});function xo(e){if(e!==void 0)try{return Q9e(e)}catch{return}}function mee(e,t){return e===t?!0:!e||!t||e.length!==t.length?!1:e.every((n,r)=>n===t[r])}function nDt(e){const t=e.debounceMs??200,[n,r]=nt({}),i=new Set,a=new Map;function o(v){const k={};if(!v)return k;for(const b of Object.keys(v)){const x=v[b];x&&(k[b]={x:x.x,y:x.y})}return k}function s(v){const k=o(e.getSnapshot(v)),b=n[v];if(!b){r(v,k);return}Object.keys(b).length>0||Object.keys(k).length!==0&&r(v,k)}function l(v,k){return s(v),n[v]?.[k]??e.getSnapshot(v)?.[k]}function c(v){const k=a.get(v);k&&clearTimeout(k),a.set(v,setTimeout(()=>h(v),t))}function u(v,k,b){s(v);const x=n[v]?.[k];x?.x===b.x&&x?.y===b.y||(r(v,k,{x:b.x,y:b.y}),i.add(v),c(v))}function h(v){const k=a.get(v);k&&clearTimeout(k),a.delete(v),i.has(v)&&(i.delete(v),e.onFlush(v,o(n[v])))}function m(){const v=Array.from(i);if(v.length!==0)for(const k of v)h(k)}function g(v){if(v.length!==0){for(const k of v){const b=a.get(k);b&&clearTimeout(b),a.delete(k),i.delete(k)}r(Je(k=>{for(const b of v)delete k[b]}))}}function y(){g(Array.from(a.keys()))}return{cache:n,drop:g,flush:h,flushAll:m,scroll:l,seed:s,setScroll:u,dispose:y}}function rDt(e){return e.startsWith("file://")?e.slice(7):e}function iDt(e){const t=e.indexOf("#"),n=e.indexOf("?");return t!==-1&&n!==-1?e.slice(0,Math.min(t,n)):t!==-1?e.slice(0,t):n!==-1?e.slice(0,n):e}function aDt(e){if(!e.startsWith('"')||!e.endsWith('"'))return e;const t=e.slice(1,-1),n=[];for(let r=0;r<t.length;r++){const i=t[r];if(i!=="\\"){n.push(i.charCodeAt(0));continue}const a=t[r+1];if(!a){n.push(92);continue}if(a>="0"&&a<="7"){const l=t.slice(r+1,r+4).match(/^[0-7]{1,3}/);if(!l){n.push(a.charCodeAt(0)),r++;continue}n.push(parseInt(l[0],8)),r+=l[0].length;continue}const o=a==="n"?`
|
|
2515
2515
|
`:a==="r"?"\r":a==="t"?" ":a==="b"?"\b":a==="f"?"\f":a==="v"?"\v":a==="\\"||a==='"'?a:void 0;n.push((o??a).charCodeAt(0)),r++}return new TextDecoder().decode(new Uint8Array(n))}function oDt(e){try{return decodeURIComponent(e)}catch{return e}}function sDt(e){let t=e.replace(/\\/g,"/");return/^[A-Za-z]:/.test(t)&&(t="/"+t),t.split("/").map((n,r)=>r===1&&/^[A-Za-z]:$/.test(n)?n:encodeURIComponent(n)).join("/")}function Hhe(e){const t=a=>{const o=e();let s=aDt(oDt(iDt(rDt(a))));const l=/^[A-Za-z]:/.test(o)||o.startsWith("\\\\"),c=l?o.replace(/\\/g,"/").toLowerCase():o.replace(/\\/g,"/"),u=l?s.replace(/\\/g,"/").toLowerCase():s.replace(/\\/g,"/");return u.startsWith(c)&&(c.endsWith("/")||u===c||u[c.length]==="/")&&(s=s.slice(o.length)),(s.startsWith("./")||s.startsWith(".\\"))&&(s=s.slice(2)),(s.startsWith("/")||s.startsWith("\\"))&&(s=s.slice(1)),s};return{normalize:t,tab:a=>{const o=t(a);return`file://${sDt(o)}`},pathFromTab:a=>{if(a.startsWith("file://"))return t(a)},normalizeDir:a=>t(a).replace(/\/+$/,"")}}const _R=["pink","mint","orange","purple","cyan","lime"],lDt=344,_s=200,dp=600,gee=280;function cDt(e){return e&&_R.includes(e)?{background:`var(--avatar-background-${e})`,foreground:`var(--avatar-text-${e})`}:{background:"var(--surface-info-base)",foreground:"var(--text-base)"}}function dDt(e,t,n){return t(e),n(e),e}function yee(e,t){const n=typeof e=="function"?e:()=>e;return()=>{const r=n();return t(r),r}}function uDt(e){if(!e.keep)return[];const t=new Set([...e.view,...e.tabs]);if(t.size<=e.max)return[];const n=r=>r===e.keep?Number.MAX_SAFE_INTEGER:e.used.get(r)??0;return Array.from(t).sort((r,i)=>n(i)-n(r)).slice(e.max)}function hDt(e,t){const n=e?.all??[];return t==="review"?{all:n.filter(r=>r!=="review"),active:t}:t==="context"?{all:[t,...n.filter(r=>r!==t)],active:t}:n.includes(t)?{all:n,active:t}:{all:[...n,t],active:t}}const Fhe=e=>{const t=e.split("/")[0];if(!t)return;const n=xo(t);if(n)return Hhe(()=>n)},sK=(e,t)=>!t.startsWith("file://")||!e?t:e.tab(t),Vhe=(e,t)=>{const n=new Set;return t.flatMap(r=>{const i=sK(e,r);return n.has(i)?[]:(n.add(i),[i])})},fDt=(e,t)=>{const n=Fhe(e);return{all:Vhe(n,t.all),active:t.active?sK(n,t.active):t.active}},{use:If,provider:pDt}=Nn({name:"Layout",init:()=>{const e=E0(),t=ha(),n=T0(),r=ms(),i=T=>typeof T=="object"&&T!==null&&!Array.isArray(T),a=T=>{if(!i(T))return T;const R=T.sidebar,H=!i(R)||typeof R.workspaces!="boolean"?R:{...R,workspaces:{},workspacesDefault:R.workspaces},Y=T.review,j=T.fileTree,X=(()=>{if(!i(j)||j.tab==="changes"||j.tab==="all")return j;const oe=typeof j.width=="number"?j.width:_s;return{...j,opened:!0,width:oe===260?_s:oe,tab:"all"}})(),W=(()=>{if(!i(Y)||typeof Y.panelOpened=="boolean")return Y;const oe=i(j)&&typeof j.opened=="boolean"?j.opened:!0;return{...Y,panelOpened:oe}})(),G=T.sessionTabs,J=(()=>{if(!i(G))return G;let oe=!1;const de=Object.fromEntries(Object.entries(G).map(([ye,ve])=>{if(!i(ve)||!Array.isArray(ve.all))return[ye,ve];const le={all:ve.all.filter(Ee=>typeof Ee=="string"),active:typeof ve.active=="string"?ve.active:void 0},pe=fDt(ye,le);return le.all.length!==ve.all.length&&(oe=!0),(!mee(le.all,pe.all)||le.active!==pe.active)&&(oe=!0),ve.active!==void 0&&typeof ve.active!="string"&&(oe=!0),[ye,pe]}));return oe?de:G})();return H===R&&W===Y&&X===j&&J===G?T:{...T,sidebar:H,review:W,fileTree:X,sessionTabs:J}},o=In.global("layout",["layout.v6"]),[s,l,c,u]=Jn({...o,migrate:a},nt({sidebar:{opened:!0,width:lDt,workspaces:{},workspacesDefault:!1},terminal:{height:gee,opened:!0},review:{diffStyle:"split",panelOpened:!0},fileTree:{opened:!0,width:_s,tab:"all"},session:{opened:!0,width:dp},mobileSidebar:{opened:!1},sessionTabs:{},sessionView:{},handoff:{tabs:void 0}})),h=50,m=120*1e3,g={active:void 0,pruned:!1,used:new Map},y=[{key:"prompt",legacy:"prompt",version:"v2"},{key:"terminal",legacy:"terminal",version:"v1"},{key:"file-view",legacy:"file",version:"v1"}],v=T=>{for(const R of T){const H=R.split("/"),Y=H[0],j=H[1];if(Y)for(const X of y){const W=j?In.session(Y,j,X.key):In.workspace(Y,X.key);Mz(W,r);const G=`${Y}/${X.legacy}${j?"/"+j:""}.${X.version}`;Mz({key:G},r)}}};function k(T){const R=uDt({keep:T,max:h,used:g.used,view:Object.keys(s.sessionView),tabs:Object.keys(s.sessionTabs)});if(R.length!==0){l(Je(H=>{for(const Y of R)delete H.sessionView[Y],delete H.sessionTabs[Y]})),x.drop(R),v(R);for(const H of R)g.used.delete(H)}}function b(T){g.active=T,g.used.set(T,Date.now()),u()&&(g.pruned||(g.pruned=!0,k(T)))}const x=nDt({debounceMs:250,getSnapshot:T=>s.sessionView[T]?.scroll,onFlush:(T,R)=>{const H=s.sessionView[T],Y=g.active??T;if(!H){l("sessionView",T,{scroll:R}),k(Y);return}l("sessionView",T,"scroll",j=>({...j??{},...R})),k(Y)}}),w=T=>dDt(T,b,R=>x.seed(R));he(()=>{if(!u()||g.pruned)return;const T=g.active;T&&(g.pruned=!0,k(T))}),dn(()=>{const T=()=>ct(()=>x.flushAll()),R=()=>{document.visibilityState==="hidden"&&T()};window.addEventListener("pagehide",T),document.addEventListener("visibilitychange",R),me(()=>{window.removeEventListener("pagehide",T),document.removeEventListener("visibilitychange",R),x.dispose()})});const[M,_]=nt({}),C=new Map;function L(T){const R=_R.filter(H=>!T.has(H));return R.length===0?_R[Math.floor(Math.random()*_R.length)]:R[Math.floor(Math.random()*R.length)]}function S(T){const[R]=t.child(T.worktree,{bootstrap:!1}),H=R.project,Y=H?t.data.project.find(J=>J.id===H):t.data.project.find(J=>J.worktree===T.worktree),j=R.projectMeta,X=j?.name!==void 0||j?.commands?.start!==void 0||j?.icon?.override!==void 0||j?.icon?.color!==void 0,W={...Y??{},...T,icon:{url:Y?.icon?.url,override:Y?.icon?.override??R.icon,color:Y?.icon?.color}};return H==="global"||Y?.id===void 0&&X?{...W,id:W.id??"global",name:j?.name,commands:j?.commands,icon:{url:W.icon?.url,override:j?.icon?.override,color:j?.icon?.color}}:W}const I=Z(()=>{const T=new Map;for(const R of t.data.project){const H=R.sandboxes??[];for(const Y of H)T.set(Y,R.worktree)}return T}),A=T=>{const R=I();if(R.size===0)return T;const H=new Set,Y=[T];for(;Y.length;){const j=Y[Y.length-1];if(!j)return T;const X=R.get(j);if(!X)return j;if(H.has(X))return T;H.add(X),Y.push(X)}return T};he(()=>{const T=n.projects.list(),R=new Set(T.map(H=>H.worktree));ct(()=>{for(const H of T){const Y=A(H.worktree);Y!==H.worktree&&(n.projects.close(H.worktree),R.has(Y)||(n.projects.open(Y),R.add(Y)),H.expanded&&n.projects.expand(Y))}})});const D=Z(()=>n.projects.list().map(S)),P=Z(()=>D().map(R=>{const H=R.icon?.color??M[R.worktree];if(!H)return R;const Y=R.icon?{...R.icon,color:H}:{color:H};return{...R,icon:Y}}));he(()=>{const T=D();if(T.length!==0&&t.ready)for(const R of T)R.id&&R.id!=="global"&&t.project.icon(R.worktree,R.icon?.override)}),he(()=>{const T=D();if(T.length===0)return;for(const H of T)H.icon?.color&&C.delete(H.worktree);const R=new Set;for(const H of T){const Y=H.icon?.color??M[H.worktree];Y&&R.add(Y)}for(const H of T){if(H.icon?.color)continue;const Y=H.worktree,j=M[Y],X=j??L(R);if(j||(R.add(X),_(Y,X)),!(!H.id||C.get(Y)===X)){if(C.set(Y,X),H.id==="global"){t.project.meta(Y,{icon:{color:X}});continue}e.client.project.update({projectID:H.id,directory:Y,icon:{color:X}}).catch(()=>{C.get(Y)===X&&C.delete(Y)})}}});let O,E;return dn(()=>{O=requestAnimationFrame(()=>{O=void 0,E=window.setTimeout(()=>{E=void 0,Promise.all(n.projects.list().map(T=>t.project.loadSessions(T.worktree)))},0)})}),me(()=>{O!==void 0&&cancelAnimationFrame(O),E!==void 0&&window.clearTimeout(E)}),{ready:u,handoff:{tabs:Z(()=>s.handoff?.tabs),setTabs(T,R){l("handoff","tabs",{dir:T,id:R,at:Date.now()})},clearTabs(){s.handoff?.tabs&&l("handoff","tabs",void 0)}},projects:{list:P,open(T){const R=A(T);n.projects.list().find(H=>H.worktree===R)||(t.project.loadSessions(R),n.projects.open(R))},close(T){n.projects.close(T)},expand(T){n.projects.expand(T)},collapse(T){n.projects.collapse(T)},move(T,R){n.projects.move(T,R)}},sidebar:{opened:Z(()=>s.sidebar.opened),open(){l("sidebar","opened",!0)},close(){l("sidebar","opened",!1)},toggle(){l("sidebar","opened",T=>!T)},width:Z(()=>s.sidebar.width),resize(T){l("sidebar","width",T)},workspaces(T){return()=>s.sidebar.workspaces[T]??s.sidebar.workspacesDefault??!1},setWorkspaces(T,R){l("sidebar","workspaces",T,R)},toggleWorkspaces(T){const R=s.sidebar.workspaces[T]??s.sidebar.workspacesDefault??!1;l("sidebar","workspaces",T,!R)}},terminal:{height:Z(()=>s.terminal.height),resize(T){l("terminal","height",T)}},review:{diffStyle:Z(()=>s.review?.diffStyle??"split"),setDiffStyle(T){if(!s.review){l("review",{diffStyle:T,panelOpened:!0});return}l("review","diffStyle",T)}},fileTree:{opened:Z(()=>s.fileTree?.opened??!0),width:Z(()=>s.fileTree?.width??_s),tab:Z(()=>s.fileTree?.tab??"all"),setTab(T){if(!s.fileTree){l("fileTree",{opened:!0,width:_s,tab:T});return}l("fileTree","tab",T)},open(){if(!s.fileTree){l("fileTree",{opened:!0,width:_s,tab:"all"});return}l("fileTree","opened",!0)},close(){if(!s.fileTree){l("fileTree",{opened:!1,width:_s,tab:"all"});return}l("fileTree","opened",!1)},toggle(){if(!s.fileTree){l("fileTree",{opened:!0,width:_s,tab:"all"});return}l("fileTree","opened",T=>!T)},resize(T){if(!s.fileTree){l("fileTree",{opened:!0,width:T,tab:"all"});return}l("fileTree","width",T)}},session:{opened:Z(()=>s.session?.opened??!0),width:Z(()=>s.session?.width??dp),open(){if(!s.session){l("session",{opened:!0,width:dp});return}l("session","opened",!0)},close(){if(!s.session){l("session",{opened:!1,width:dp});return}l("session","opened",!1)},toggle(){if(!s.session){l("session",{opened:!1,width:dp});return}l("session","opened",T=>!T)},resize(T){if(!s.session){l("session",{opened:!0,width:T});return}l("session","width",T)}},mobileSidebar:{opened:Z(()=>s.mobileSidebar?.opened??!1),show(){l("mobileSidebar","opened",!0)},hide(){l("mobileSidebar","opened",!1)},toggle(){l("mobileSidebar","opened",T=>!T)}},pendingMessage:{set(T,R){const H=Date.now();if(b(T),!s.sessionView[T]){l("sessionView",T,{scroll:{},pendingMessage:R,pendingMessageAt:H}),k(g.active??T);return}l("sessionView",T,Je(j=>{j.pendingMessage=R,j.pendingMessageAt=H}))},consume(T){const R=s.sessionView[T],H=R?.pendingMessage,Y=R?.pendingMessageAt;if(!(!H||!Y)&&(l("sessionView",T,Je(j=>{delete j.pendingMessage,delete j.pendingMessageAt})),!(Date.now()-Y>m)))return H}},view(T){const R=yee(T,w),H=Z(()=>s.sessionView[R()]??{scroll:{}}),Y=Z(()=>s.terminal?.opened??!1),j=Z(()=>s.review?.panelOpened??!0);function X(G){const J=s.terminal;if(!J){l("terminal",{height:gee,opened:G});return}(J.opened??!1)!==G&&l("terminal","opened",G)}function W(G){const J=s.review;if(!J){l("review",{diffStyle:"split",panelOpened:G});return}(J.panelOpened??!0)!==G&&l("review","panelOpened",G)}return{scroll(G){return x.scroll(R(),G)},setScroll(G,J){x.setScroll(R(),G,J)},terminal:{opened:Y,open(){X(!0)},close(){X(!1)},toggle(){X(!Y())}},reviewPanel:{opened:j,open(){W(!0)},close(){W(!1)},toggle(){W(!j())}},review:{open:Z(()=>H().reviewOpen??[]),setOpen(G){const J=R(),oe=Array.from(new Set(G)),de=s.sessionView[J];if(!de){l("sessionView",J,{scroll:{},reviewOpen:oe});return}mee(de.reviewOpen,oe)||l("sessionView",J,"reviewOpen",oe)},openPath(G){const J=R(),oe=s.sessionView[J];if(!oe){l("sessionView",J,{scroll:{},reviewOpen:[G]});return}if(!oe.reviewOpen){l("sessionView",J,"reviewOpen",[G]);return}oe.reviewOpen.includes(G)||l("sessionView",J,"reviewOpen",oe.reviewOpen.length,G)},closePath(G){const J=R(),oe=s.sessionView[J]?.reviewOpen;if(!oe)return;const de=oe.indexOf(G);de!==-1&&l("sessionView",J,"reviewOpen",Je(ye=>{ye&&ye.splice(de,1)}))},togglePath(G){const J=R(),oe=s.sessionView[J]?.reviewOpen;if(!oe||!oe.includes(G)){this.openPath(G);return}this.closePath(G)}}}},tabs(T){const R=yee(T,w),H=Z(()=>Fhe(R())),Y=Z(()=>s.sessionTabs[R()]??{all:[]}),j=W=>sK(H(),W),X=W=>Vhe(H(),W);return{tabs:Y,active:Z(()=>Y().active),all:Z(()=>Y().all.filter(W=>W!=="review")),setActive(W){const G=R(),J=W&&j(W);s.sessionTabs[G]?l("sessionTabs",G,"active",J):l("sessionTabs",G,{all:[],active:J})},setAll(W){const G=R(),J=X(W).filter(oe=>oe!=="review");s.sessionTabs[G]?l("sessionTabs",G,"all",J):l("sessionTabs",G,{all:J,active:void 0})},async open(W){const G=R(),J=hDt(s.sessionTabs[G],j(W));l("sessionTabs",G,J)},close(W){const G=R(),J=s.sessionTabs[G];if(!J)return;if(W==="review"){if(J.active!==W)return;l("sessionTabs",G,"active",J.all[0]);return}const oe=J.all.filter(ve=>ve!==W);if(J.active!==W){l("sessionTabs",G,"all",oe);return}const de=J.all.findIndex(ve=>ve===W),ye=J.all[de-1]??J.all[de+1]??oe[0];ct(()=>{l("sessionTabs",G,"all",oe),l("sessionTabs",G,"active",ye)})},move(W,G){const J=R(),oe=s.sessionTabs[J];if(!oe)return;const de=oe.all.findIndex(ye=>ye===W);de!==-1&&l("sessionTabs",J,"all",Je(ye=>{ye.splice(G,0,ye.splice(de,1)[0])}))}}}}}}),mDt=40,gDt=20*1024*1024,Oa=new Map;let T2=0;function _F(e){const t=e.patch?.hunks.reduce((n,r)=>n+r.lines.reduce((i,a)=>i+a.length,0),0)??0;return((e.content?.length??0)+(e.diff?.length??0)+t)*2}function yDt(e,t){const n=Oa.get(e);n!==void 0&&(T2-=n),Oa.delete(e),Oa.set(e,t),T2+=t}function Bhe(e,t){const n=Oa.get(e);n===void 0&&t===void 0||yDt(e,t??n??0)}function vDt(e){const t=Oa.get(e);t!==void 0&&(Oa.delete(e),T2-=t)}function kDt(){Oa.clear(),T2=0}function bDt(e,t){const n=e??new Set;for(;Oa.size>mDt||T2>gDt;){const r=Oa.keys().next().value;if(!r)return;if(n.has(r)){if(Bhe(r),Oa.size<=n.size)return;continue}vDt(r),t(r)}}function wDt(){kDt()}function $g(e,t){Bhe(e,t)}function xDt(e){return Oa.has(e)}const MF="__workspace__",_Dt=20,vee=500;function UB(e){if(e.start<=e.end)return{...e};const t=e.side,n=e.endSide??t;return{...e,start:e.end,end:e.start,side:n,endSide:t!==n?t:void 0}}function MDt(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const n=UB(e),r=UB(t);return n.start===r.start&&n.end===r.end&&n.side===r.side&&n.endSide===r.endSide}function SDt(e,t){const n=`${e}/file${t?"/"+t:""}.v1`,[r,i,a,o]=Jn(In.scoped(e,t,"file-view",[n]),nt({file:{}})),s={pruned:!1},l=v=>{const k=Object.keys(r.file);if(k.length<=vee)return;const b=k.filter(x=>x!==v).slice(0,k.length-vee);b.length!==0&&i(Je(x=>{for(const w of b)delete x.file[w]}))};return he(()=>{o()&&(s.pruned||(s.pruned=!0,l()))}),{ready:o,scrollTop:v=>r.file[v]?.scrollTop,scrollLeft:v=>r.file[v]?.scrollLeft,selectedLines:v=>r.file[v]?.selectedLines,setScrollTop:(v,k)=>{i(Je(b=>{const x=b.file[v]??(b.file[v]={});x.scrollTop!==k&&(x.scrollTop=k)})),l(v)},setScrollLeft:(v,k)=>{i(Je(b=>{const x=b.file[v]??(b.file[v]={});x.scrollLeft!==k&&(x.scrollLeft=k)})),l(v)},setSelectedLines:(v,k)=>{const b=k?UB(k):null;i(Je(x=>{const w=x.file[v]??(x.file[v]={});MDt(w.selectedLines,b)||(w.selectedLines=b)})),l(v)}}}function CDt(){const e=Nce(t=>{const n=t.lastIndexOf(`
|
|
2516
2516
|
`),r=n>=0?t.slice(0,n):t,i=n>=0?t.slice(n+1):MF;return wr(a=>({value:SDt(r,i===MF?void 0:i),dispose:a}))},{maxEntries:_Dt,dispose:t=>t.dispose()});return{load:(t,n)=>{const r=`${t}
|
|
2517
|
-
${n??MF}`;return e.get(r).value},clear:()=>e.clear()}}function LDt(e){const[t,n]=nt({node:{},dir:{"":{expanded:!0}}}),r=new Map,i=()=>{r.clear(),n("node",Ct({})),n("dir",Ct({})),n("dir","",{expanded:!0})},a=h=>{t.dir[h]||n("dir",h,{expanded:!1})},o=(h,m)=>{const g=e.normalizeDir(h);a(g);const y=t.dir[g];if(!m?.force&&y?.loaded)return Promise.resolve();const v=r.get(g);if(v)return v;n("dir",g,Je(x=>{x.loading=!0,x.error=void 0}));const k=e.scope(),b=e.list(g).then(x=>{if(e.scope()!==k)return;const w=t.dir[g]?.children??[],M=x.map(C=>C.path),_=new Set(M);n("node",Je(C=>{const L=[];for(const S of w){if(_.has(S))continue;C[S]?.type==="directory"&&L.push(S),delete C[S]}if(L.length>0){const S=Object.keys(C);for(const I of S)for(const A of L)if(I.startsWith(A+"/")){delete C[I];break}}for(const S of x)C[S.path]=S})),n("dir",g,Je(C=>{C.loaded=!0,C.loading=!1,C.children=M}))}).catch(x=>{e.scope()===k&&(n("dir",g,Je(w=>{w.loading=!1,w.error=x.message})),e.onError(x.message))}).finally(()=>{r.delete(g)});return r.set(g,b),b};return{listDir:o,expandDir:h=>{const m=e.normalizeDir(h);a(m),n("dir",m,"expanded",!0),o(m)},collapseDir:h=>{const m=e.normalizeDir(h);a(m),n("dir",m,"expanded",!1)},dirState:h=>{const m=e.normalizeDir(h);return t.dir[m]},children:h=>{const m=e.normalizeDir(h),g=t.dir[m]?.children;if(!g)return[];const y=[];for(const v of g){const k=t.node[v];k&&y.push(k)}return y},node:h=>t.node[h],isLoaded:h=>!!t.dir[h]?.loaded,reset:i}}function IDt(e,t){if(e.type!=="file.watcher.updated")return;const n=typeof e.properties=="object"&&e.properties?e.properties:void 0,r=typeof n?.file=="string"?n.file:void 0,i=typeof n?.event=="string"?n.event:void 0;if(!r||!i)return;const a=t.normalize(r);if(!a||a.startsWith(".git/"))return;if((t.hasFile(a)||t.isOpen?.(a))&&t.loadFile(a),i==="change"){const s=(()=>{if(a==="")return"";if(t.node(a)?.type==="directory")return a})();if(s===void 0||!t.isDirLoaded(s))return;t.refreshDir(s);return}if(i!=="add"&&i!=="unlink")return;const o=a.split("/").slice(0,-1).join("/");t.isDirLoaded(o)&&t.refreshDir(o)}function kee(e,t){return e instanceof Error&&e.message?e.message:typeof e=="string"&&e?e:t}function Q0(e){return e?.type==="text"&&e.encoding!=="base64"}function NDt(e){return/\.(md|markdown|mdx|note)$/i.test(e)}const{use:
|
|
2517
|
+
${n??MF}`;return e.get(r).value},clear:()=>e.clear()}}function LDt(e){const[t,n]=nt({node:{},dir:{"":{expanded:!0}}}),r=new Map,i=()=>{r.clear(),n("node",Ct({})),n("dir",Ct({})),n("dir","",{expanded:!0})},a=h=>{t.dir[h]||n("dir",h,{expanded:!1})},o=(h,m)=>{const g=e.normalizeDir(h);a(g);const y=t.dir[g];if(!m?.force&&y?.loaded)return Promise.resolve();const v=r.get(g);if(v)return v;n("dir",g,Je(x=>{x.loading=!0,x.error=void 0}));const k=e.scope(),b=e.list(g).then(x=>{if(e.scope()!==k)return;const w=t.dir[g]?.children??[],M=x.map(C=>C.path),_=new Set(M);n("node",Je(C=>{const L=[];for(const S of w){if(_.has(S))continue;C[S]?.type==="directory"&&L.push(S),delete C[S]}if(L.length>0){const S=Object.keys(C);for(const I of S)for(const A of L)if(I.startsWith(A+"/")){delete C[I];break}}for(const S of x)C[S.path]=S})),n("dir",g,Je(C=>{C.loaded=!0,C.loading=!1,C.children=M}))}).catch(x=>{e.scope()===k&&(n("dir",g,Je(w=>{w.loading=!1,w.error=x.message})),e.onError(x.message))}).finally(()=>{r.delete(g)});return r.set(g,b),b};return{listDir:o,expandDir:h=>{const m=e.normalizeDir(h);a(m),n("dir",m,"expanded",!0),o(m)},collapseDir:h=>{const m=e.normalizeDir(h);a(m),n("dir",m,"expanded",!1)},dirState:h=>{const m=e.normalizeDir(h);return t.dir[m]},children:h=>{const m=e.normalizeDir(h),g=t.dir[m]?.children;if(!g)return[];const y=[];for(const v of g){const k=t.node[v];k&&y.push(k)}return y},node:h=>t.node[h],isLoaded:h=>!!t.dir[h]?.loaded,reset:i}}function IDt(e,t){if(e.type!=="file.watcher.updated")return;const n=typeof e.properties=="object"&&e.properties?e.properties:void 0,r=typeof n?.file=="string"?n.file:void 0,i=typeof n?.event=="string"?n.event:void 0;if(!r||!i)return;const a=t.normalize(r);if(!a||a.startsWith(".git/"))return;if((t.hasFile(a)||t.isOpen?.(a))&&t.loadFile(a),i==="change"){const s=(()=>{if(a==="")return"";if(t.node(a)?.type==="directory")return a})();if(s===void 0||!t.isDirLoaded(s))return;t.refreshDir(s);return}if(i!=="add"&&i!=="unlink")return;const o=a.split("/").slice(0,-1).join("/");t.isDirLoaded(o)&&t.refreshDir(o)}function kee(e,t){return e instanceof Error&&e.message?e.message:typeof e=="string"&&e?e:t}function Q0(e){return e?.type==="text"&&e.encoding!=="base64"}function NDt(e){return/\.(md|markdown|mdx|note)$/i.test(e)}const{use:fQt,provider:ADt}=Nn({name:"File",gate:!1,init:()=>{const e=Cf();xj();const t=di(),n=_r(),r=If(),i=Z(()=>e.directory),a=Hhe(i),o=r.tabs(()=>`${t.dir}${t.id?"/"+t.id:""}`),s=new Map,[l,c]=nt({file:{}}),u=LDt({scope:i,normalizeDir:a.normalizeDir,list:j=>e.client.file.list({path:j}).then(X=>X.data??[]),onError:j=>{lr({variant:"error",title:n.t("toast.file.listFailed.title"),description:j})}}),h=j=>{bDt(j,X=>{l.file[X]&&c("file",X,Je(W=>{W.content=void 0,W.loaded=!1}))})};he(()=>{i(),s.clear(),wDt(),ct(()=>{c("file",Ct({})),u.reset()})});const m=CDt(),g=Z(()=>m.load(i(),t.id)),y=j=>{j&&(l.file[j]||c("file",j,{path:j,name:Gn(j)}))},v=j=>{c("file",j,Je(X=>{X.loading=!0,X.error=void 0}))},k=(j,X)=>{const W=l.file[j],G=Q0(W?.content)?W.content?.content??"":void 0,J=X&&Q0(X)?X.content:void 0,oe=J===void 0?void 0:W?.draft===void 0||G===void 0||W.draft===G?J:W.draft,de=J===void 0||W?.draft===void 0||G===void 0?!1:W.draft!==G&&W.draft!==J;c("file",j,Je(ye=>{ye.loaded=!0,ye.loading=!1,ye.content=X,ye.draft=oe,ye.saving=!1,ye.saveError=void 0,ye.stale=de,ye.mode=ye.mode??(J===void 0?void 0:NDt(j)?"rich":void 0)}))},b=(j,X)=>{c("file",j,Je(W=>{W.loading=!1,W.error=X})),lr({variant:"error",title:n.t("toast.file.loadFailed.title"),description:X})},x=(j,X)=>{const W=a.normalize(j);if(!W)return Promise.resolve();const G=i(),J=`${G}
|
|
2518
2518
|
${W}`;y(W);const oe=l.file[W];if(!X?.force&&oe?.loaded)return Promise.resolve();const de=s.get(J);if(de)return de;v(W);const ye=e.client.file.read({path:W}).then(ve=>{if(i()!==G)return;const le=ve.data;k(W,le),le&&($g(W,_F(le)),h(new Set([W])))}).catch(ve=>{i()===G&&b(W,kee(ve,n.t("error.chain.unknown")))}).finally(()=>{s.delete(J)});return s.set(J,ye),ye},w=(j,X)=>e.client.find.files({query:j,dirs:X}).then(W=>(W.data??[]).map(a.normalize),()=>[]),M=e.event.listen(j=>{IDt(j.details,{normalize:a.normalize,hasFile:X=>!!l.file[X],isOpen:X=>o.all().some(W=>a.pathFromTab(W)===X),loadFile:X=>{x(X,{force:!0})},node:u.node,isDirLoaded:u.isLoaded,refreshDir:X=>{u.listDir(X,{force:!0})}})}),_=j=>{const X=a.normalize(j),W=l.file[X],G=W?.content;return G?xDt(X)?($g(X),W):($g(X,_F(G)),W):W},C=j=>{const X=a.normalize(j),W=_(X),G=W?.content;if(Q0(G))return W.draft??G.content},L=j=>{const X=a.normalize(j),W=l.file[X],G=W?.content;return Q0(G)?(W.draft??G.content)!==G.content:!1},S=(j,X)=>{const W=a.normalize(j),G=l.file[W];Q0(G?.content)&&c("file",W,Je(J=>{J.draft=X,J.saveError=void 0}))},I=(j,X)=>{const W=a.normalize(j);c("file",W,"mode",X)},A=async(j,X)=>{const W=a.normalize(j),G=l.file[W],J=G?.content;if(!Q0(J))return!1;const oe=G.draft??J.content;if(oe===J.content&&!G.stale)return!0;const de=i();return c("file",W,Je(ye=>{ye.saving=!0,ye.saveError=void 0})),console.debug("[file.save]",{path:W,contentType:typeof oe,contentLength:oe?.length,format:X?.format??!0}),e.client.file.write({fileWriteInput:{path:W,content:oe,format:X?.format??!0}}).then(ye=>{if(i()!==de)return!1;const ve=ye.data;return ve?(console.debug("[file.save] response:",{type:typeof ve,hasContent:"content"in ve,contentType:ve.type}),k(W,ve),typeof ve=="object"&&typeof ve.content=="string"&&$g(W,_F(ve)),h(new Set([W])),!0):!1}).catch(ye=>{if(console.error("[file.save] error:",ye,`
|
|
2519
2519
|
type:`,typeof ye,`
|
|
2520
2520
|
constructor:`,ye?.constructor?.name,`
|
|
2521
2521
|
stack:`,ye?.stack),i()!==de)return!1;const ve=kee(ye,n.t("error.chain.unknown"));throw c("file",W,Je(le=>{le.saving=!1,le.saveError=ve})),ye})},D=async j=>{const X=Object.keys(l.file).filter(G=>L(G)||l.file[G]?.stale);return(await Promise.all(X.map(G=>A(G,j)))).every(Boolean)};function P(j,X){return X(a.normalize(j))}const O=j=>P(j,X=>g().scrollTop(X)),E=j=>P(j,X=>g().scrollLeft(X)),T=j=>P(j,X=>g().selectedLines(X)),R=(j,X)=>P(j,W=>g().setScrollTop(W,X)),H=(j,X)=>P(j,W=>g().setScrollLeft(W,X)),Y=(j,X)=>P(j,W=>g().setSelectedLines(W,X));return me(()=>{M(),m.clear()}),{ready:()=>g().ready(),normalize:a.normalize,tab:a.tab,pathFromTab:a.pathFromTab,tree:{list:u.listDir,refresh:j=>u.listDir(j,{force:!0}),state:u.dirState,children:u.children,expand:u.expandDir,collapse:u.collapseDir,toggle(j){if(u.dirState(j)?.expanded){u.collapseDir(j);return}u.expandDir(j)}},get:_,text:C,dirty:L,save:A,saveAll:D,setDraft:S,setMode:I,load:x,scrollTop:O,scrollLeft:E,setScrollTop:R,setScrollLeft:H,selectedLines:T,setSelectedLines:Y,searchFiles:j=>w(j,"false"),searchFilesAndDirectories:j=>w(j,"true")}}});var $Dt=ie("<div data-slot=dialog-header>"),TDt=ie("<div data-slot=dialog-body>"),EDt=ie("<div data-component=dialog><div data-slot=dialog-container>");function jz(e){const t=M0();return(()=>{var n=EDt(),r=n.firstChild;return K(r,d(Ds.Content,{"data-slot":"dialog-content",get"data-no-header"(){return!e.title&&!e.action?"":void 0},get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},onOpenAutoFocus:i=>{const o=i.currentTarget?.querySelector("[autofocus]");o&&(i.preventDefault(),o.focus())},get children(){return[d(ke,{get when(){return e.title||e.action},get children(){var i=$Dt();return K(i,d(ke,{get when(){return e.title},get children(){return d(Ds.Title,{"data-slot":"dialog-title",get children(){return e.title}})}}),null),K(i,d(r0,{get children(){return[d(Zn,{get when(){return e.action},get children(){return e.action}}),d(Zn,{when:!0,get children(){return d(Ds.CloseButton,{"data-slot":"dialog-close-button",as:Cr,icon:"close",variant:"ghost",get"aria-label"(){return t.t("ui.common.close")}})}})]}}),null),i}}),d(ke,{get when(){return e.description},get children(){return d(Ds.Description,{"data-slot":"dialog-description",style:{"margin-left":"-4px"},get children(){return e.description}})}}),(()=>{var i=TDt();return K(i,()=>e.children),i})()]}})),Qe(i=>{var a=e.fit?!0:void 0,o=e.size||"normal",s=e.transition?!0:void 0;return a!==i.e&>(n,"data-fit",i.e=a),o!==i.t&>(n,"data-size",i.t=o),s!==i.a&>(n,"data-transition",i.a=s),i},{e:void 0,t:void 0,a:void 0}),n})()}function Mn(e){const[t,n]=Se(e,["variant","size","icon","class","classList"]);return d(UU,f(n,{"data-component":"button",get"data-size"(){return t.size||"normal"},get"data-variant"(){return t.variant||"secondary"},get"data-icon"(){return t.icon},get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return[d(ke,{get when(){return t.icon},get children(){return d(Kt,{get name(){return t.icon},size:"small"})}}),bt(()=>e.children)]}}))}var PDt=ie('<div class="flex flex-1 min-w-0 min-h-0"tabindex=0 autofocus><div class="flex flex-col flex-1 min-w-0 p-8"><div class="flex flex-col gap-2 pt-22"><div class="flex items-center gap-2"><h1 class="text-16-medium text-text-strong"></h1></div><p class="text-14-regular text-text-base"></p></div><div class=flex-1></div><div class="flex flex-col gap-12"><div class="flex flex-col items-start gap-3">'),DDt=ie('<div class="flex items-center gap-1.5 -my-2.5">'),ODt=ie('<button type=button class="h-6 flex items-center cursor-pointer bg-transparent border-none p-0 transition-all duration-200"><div class="w-full h-0.5 rounded-[1px] transition-colors duration-200">'),RDt=ie('<div class="flex-1 min-w-0 bg-surface-base overflow-hidden rounded-r-xl">'),zDt=ie('<img class="w-full h-full object-cover">'),qDt=ie('<video autoplay loop muted playsinline class="w-full h-full object-cover">');function jDt(e){const t=lf(),n=_r(),r=sm(),[i,a]=Ce(0),o=()=>e.highlights.length,s=()=>Math.max(0,o()-1),l=()=>e.highlights[i()]??e.highlights[s()],c=()=>i()===0,u=()=>i()>=s(),h=()=>o()>1;function m(){u()||a(i()+1)}function g(){t.close()}function y(){r.general.setReleaseNotes(!1),g()}function v(k){if(k.key==="Escape"){k.preventDefault(),g();return}h()&&(k.key==="ArrowLeft"&&!c()&&(k.preventDefault(),a(i()-1)),k.key==="ArrowRight"&&!u()&&(k.preventDefault(),a(i()+1)))}return d(jz,{size:"large",fit:!0,class:"w-[min(calc(100vw-40px),720px)] h-[min(calc(100vh-40px),400px)] -mt-20 min-h-0 overflow-hidden",get children(){var k=PDt(),b=k.firstChild,x=b.firstChild,w=x.firstChild,M=w.firstChild,_=w.nextSibling,C=x.nextSibling,L=C.nextSibling,S=L.firstChild;return k.$$keydown=v,K(M,()=>l()?.title??""),K(_,()=>l()?.description??""),K(S,(()=>{var I=bt(()=>!!u());return()=>I()?d(Mn,{variant:"primary",size:"large",onClick:g,get children(){return n.t("dialog.releaseNotes.action.getStarted")}}):d(Mn,{variant:"secondary",size:"large",onClick:m,get children(){return n.t("dialog.releaseNotes.action.next")}})})(),null),K(S,d(Mn,{variant:"ghost",size:"small",onClick:y,get children(){return n.t("dialog.releaseNotes.action.hideFuture")}}),null),K(L,(()=>{var I=bt(()=>!!h());return()=>I()&&(()=>{var A=DDt();return K(A,()=>e.highlights.map((D,P)=>(()=>{var O=ODt(),E=O.firstChild;return O.$$click=()=>a(P),Qe(T=>{var R=P===i(),H=P!==i(),Y=P===i(),j=P!==i();return R!==T.e&&O.classList.toggle("w-8",T.e=R),H!==T.t&&O.classList.toggle("w-3",T.t=H),Y!==T.a&&E.classList.toggle("bg-icon-strong-base",T.a=Y),j!==T.o&&E.classList.toggle("bg-icon-weak-base",T.o=j),T},{e:void 0,t:void 0,a:void 0,o:void 0}),O})())),A})()})(),null),K(k,(()=>{var I=bt(()=>!!l()?.media);return()=>I()&&(()=>{var A=RDt();return K(A,(()=>{var D=bt(()=>l().media.type==="image");return()=>D()?(()=>{var P=zDt();return Qe(O=>{var E=l().media.src,T=l().media.alt??l()?.title??n.t("dialog.releaseNotes.media.alt");return E!==O.e&>(P,"src",O.e=E),T!==O.t&>(P,"alt",O.t=T),O},{e:void 0,t:void 0}),P})():(()=>{var P=qDt();return Qe(()=>gt(P,"src",l().media.src)),P})()})()),A})()})(),null),k}})}li(["keydown","click"]);const HDt="https://opencode.ai/changelog.json";function E2(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vo(e){if(typeof e=="string"){const t=e.trim();return t.length>0?t:void 0}if(typeof e=="number")return String(e)}function Tg(e){const t=e?.trim();if(t)return t.startsWith("v")||t.startsWith("V")?t.slice(1):t}function FDt(e,t){if(!E2(e))return;const n=vo(e.type)?.toLowerCase(),r=vo(e.src)??vo(e.url);if(r&&!(n!=="image"&&n!=="video"))return{type:n,src:r,alt:t}}function bee(e){if(!E2(e))return;const t=vo(e.title);if(!t)return;const n=vo(e.description)??vo(e.shortDescription);if(!n)return;const r=FDt(e.media,t);return{title:t,description:n,media:r}}function wee(e){if(!E2(e))return;const t=vo(e.tag)??vo(e.tag_name)??vo(e.name);if(!Array.isArray(e.highlights))return{tag:t,highlights:[]};const n=e.highlights.flatMap(r=>{if(!E2(r))return[];const i=vo(r.source);if(!i)return[];if(!i.toLowerCase().includes("desktop"))return[];if(Array.isArray(r.items))return r.items.map(o=>bee(o)).filter(o=>o!==void 0);const a=bee(r);return a?[a]:[]});return{tag:t,highlights:n}}function VDt(e){if(Array.isArray(e))return e.map(wee).filter(t=>t!==void 0);if(E2(e)&&Array.isArray(e.releases))return e.releases.map(wee).filter(t=>t!==void 0)}function BDt(e){const t=Tg(e.current),n=Tg(e.previous),r=e.releases,i=(()=>{if(!t)return 0;const c=r.findIndex(u=>Tg(u.tag)===t);return c===-1?0:c})(),a=(()=>{if(!n)return r.length;const c=r.findIndex((u,h)=>h>=i&&Tg(u.tag)===n);return c===-1?r.length:c})(),o=r.slice(i,a).flatMap(c=>c.highlights),s=new Set;return o.filter(c=>{const u=UDt(c);return s.has(u)?!1:(s.add(u),!0)}).slice(0,5)}function UDt(e){return[e.title,e.description,e.media?.type??"",e.media?.src??""].join(`
|
|
2522
|
-
`)}function WDt(e,t,n){const r=VDt(e);return r?.length?BDt({releases:r,current:t,previous:n}):[]}const{provider:GDt}=Nn({name:"Highlights",gate:!1,init:()=>{const e=ms(),t=lf(),n=sm(),[r,i,a,o]=Jn("highlights.v1",nt({version:void 0})),[s,l]=nt({from:void 0,to:void 0}),c={started:!1};let u;const h=()=>{u!==void 0&&(clearTimeout(u),u=void 0)},m=()=>{e.version&&i("version",e.version)},g=y=>{if(!n.general.releaseNotes()){m();return}const v=e.fetch??fetch,k=new AbortController;me(()=>{k.abort(),h()}),v(HDt,{signal:k.signal,headers:{Accept:"application/json"}}).then(b=>b.ok?b.json():void 0).then(b=>{if(!b)return;const x=WDt(b,e.version,y);if(!k.signal.aborted){if(x.length===0){m();return}u=setTimeout(()=>{u=void 0,m(),t.show(()=>d(jDt,{highlights:x}))},500)}}).catch(()=>{})};return he(()=>{if(c.started||!o()||!n.ready()||!e.version)return;c.started=!0;const y=r.version;if(!y){i("version",e.version);return}y!==e.version&&(l({from:y,to:e.version}),g(y))}),{ready:o,from:()=>s.from,to:()=>s.to,get last(){return r.version},markSeen:m}}});class P0 extends Error{}class ZDt extends P0{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class KDt extends P0{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class XDt extends P0{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class _h extends P0{}class Uhe extends P0{constructor(t){super(`Invalid unit ${t}`)}}class Pr extends P0{}class Ms extends P0{constructor(){super("Zone is an abstract class")}}const Oe="numeric",Fa="short",zi="long",Hz={year:Oe,month:Oe,day:Oe},Whe={year:Oe,month:Fa,day:Oe},YDt={year:Oe,month:Fa,day:Oe,weekday:Fa},Ghe={year:Oe,month:zi,day:Oe},Zhe={year:Oe,month:zi,day:Oe,weekday:zi},Khe={hour:Oe,minute:Oe},Xhe={hour:Oe,minute:Oe,second:Oe},Yhe={hour:Oe,minute:Oe,second:Oe,timeZoneName:Fa},Jhe={hour:Oe,minute:Oe,second:Oe,timeZoneName:zi},Qhe={hour:Oe,minute:Oe,hourCycle:"h23"},efe={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23"},tfe={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Fa},nfe={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:zi},rfe={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe},ife={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe,second:Oe},afe={year:Oe,month:Fa,day:Oe,hour:Oe,minute:Oe},ofe={year:Oe,month:Fa,day:Oe,hour:Oe,minute:Oe,second:Oe},JDt={year:Oe,month:Fa,day:Oe,weekday:Fa,hour:Oe,minute:Oe},sfe={year:Oe,month:zi,day:Oe,hour:Oe,minute:Oe,timeZoneName:Fa},lfe={year:Oe,month:zi,day:Oe,hour:Oe,minute:Oe,second:Oe,timeZoneName:Fa},cfe={year:Oe,month:zi,day:Oe,weekday:zi,hour:Oe,minute:Oe,timeZoneName:zi},dfe={year:Oe,month:zi,day:Oe,weekday:zi,hour:Oe,minute:Oe,second:Oe,timeZoneName:zi};class wm{get type(){throw new Ms}get name(){throw new Ms}get ianaName(){return this.name}get isUniversal(){throw new Ms}offsetName(t,n){throw new Ms}formatOffset(t,n){throw new Ms}offset(t){throw new Ms}equals(t){throw new Ms}get isValid(){throw new Ms}}let SF=null;class _j extends wm{static get instance(){return SF===null&&(SF=new _j),SF}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return wfe(t,n,r)}formatOffset(t,n){return Jp(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const WB=new Map;function QDt(e){let t=WB.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),WB.set(e,t)),t}const eOt={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function tOt(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,a,o,s,l,c,u]=r;return[o,i,a,s,l,c,u]}function nOt(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:a,value:o}=n[i],s=eOt[a];a==="era"?r[s]=o:st(s)||(r[s]=parseInt(o,10))}return r}const CF=new Map;class hs extends wm{static create(t){let n=CF.get(t);return n===void 0&&CF.set(t,n=new hs(t)),n}static resetCache(){CF.clear(),WB.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=hs.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return wfe(t,n,r,this.name)}formatOffset(t,n){return Jp(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=QDt(this.name);let[i,a,o,s,l,c,u]=r.formatToParts?nOt(r,n):tOt(r,n);s==="BC"&&(i=-Math.abs(i)+1);const m=Sj({year:i,month:a,day:o,hour:l===24?0:l,minute:c,second:u,millisecond:0});let g=+n;const y=g%1e3;return g-=y>=0?y:1e3+y,(m-g)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let xee={};function rOt(e,t={}){const n=JSON.stringify([e,t]);let r=xee[n];return r||(r=new Intl.ListFormat(e,t),xee[n]=r),r}const GB=new Map;function ZB(e,t={}){const n=JSON.stringify([e,t]);let r=GB.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),GB.set(n,r)),r}const KB=new Map;function iOt(e,t={}){const n=JSON.stringify([e,t]);let r=KB.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),KB.set(n,r)),r}const XB=new Map;function aOt(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let a=XB.get(i);return a===void 0&&(a=new Intl.RelativeTimeFormat(e,t),XB.set(i,a)),a}let Pp=null;function oOt(){return Pp||(Pp=new Intl.DateTimeFormat().resolvedOptions().locale,Pp)}const YB=new Map;function ufe(e){let t=YB.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),YB.set(e,t)),t}const JB=new Map;function sOt(e){let t=JB.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...hfe,...t}),JB.set(e,t)}return t}function lOt(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,i;try{r=ZB(e).resolvedOptions(),i=e}catch{const l=e.substring(0,n);r=ZB(l).resolvedOptions(),i=l}const{numberingSystem:a,calendar:o}=r;return[i,a,o]}}function cOt(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function dOt(e){const t=[];for(let n=1;n<=12;n++){const r=ot.utc(2009,n,1);t.push(e(r))}return t}function uOt(e){const t=[];for(let n=1;n<=7;n++){const r=ot.utc(2016,11,13+n);t.push(e(r))}return t}function Eg(e,t,n,r){const i=e.listingMode();return i==="error"?null:i==="en"?n(t):r(t)}function hOt(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||ufe(e.locale).numberingSystem==="latn"}class fOt{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:a,...o}=r;if(!n||Object.keys(o).length>0){const s={useGrouping:!1,...r};r.padTo>0&&(s.minimumIntegerDigits=r.padTo),this.inf=iOt(t,s)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):hK(t,3);return Wn(n,this.padTo)}}}class pOt{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const o=-1*(t.offset/60),s=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&hs.create(s).valid?(i=s,this.dt=t):(i="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,i=t.zone.name):(i="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const a={...this.opts};a.timeZone=a.timeZone||i,this.dtf=ZB(n,a)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class mOt{constructor(t,n,r){this.opts={style:"long",...r},!n&&kfe()&&(this.rtf=aOt(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):ROt(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const hfe={firstDay:1,minimalDays:4,weekend:[6,7]};class Yt{static fromOpts(t){return Yt.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,i,a=!1){const o=t||Pn.defaultLocale,s=o||(a?"en-US":oOt()),l=n||Pn.defaultNumberingSystem,c=r||Pn.defaultOutputCalendar,u=eU(i)||Pn.defaultWeekSettings;return new Yt(s,l,c,u,o)}static resetCache(){Pp=null,GB.clear(),KB.clear(),XB.clear(),YB.clear(),JB.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return Yt.create(t,n,r,i)}constructor(t,n,r,i,a){const[o,s,l]=lOt(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||l||null,this.weekSettings=i,this.intl=cOt(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=hOt(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Yt.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,eU(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Eg(this,t,Mfe,()=>{const r=n?{month:t,day:"numeric"}:{month:t},i=n?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=dOt(a=>this.extract(a,r,"month"))),this.monthsCache[i][t]})}weekdays(t,n=!1){return Eg(this,t,Lfe,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},i=n?"format":"standalone";return this.weekdaysCache[i][t]||(this.weekdaysCache[i][t]=uOt(a=>this.extract(a,r,"weekday"))),this.weekdaysCache[i][t]})}meridiems(){return Eg(this,void 0,()=>Ife,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ot.utc(2016,11,13,9),ot.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Eg(this,t,Nfe,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[ot.utc(-40,1,1),ot.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const i=this.dtFormatter(t,n),a=i.formatToParts(),o=a.find(s=>s.type.toLowerCase()===r);return o?o.value:null}numberFormatter(t={}){return new fOt(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new pOt(t,this.intl,n)}relFormatter(t={}){return new mOt(this.intl,this.isEnglish(),t)}listFormatter(t={}){return rOt(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||ufe(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:bfe()?sOt(this.locale):hfe}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let LF=null;class ei extends wm{static get utcInstance(){return LF===null&&(LF=new ei(0)),LF}static instance(t){return t===0?ei.utcInstance:new ei(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ei(Cj(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Jp(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Jp(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Jp(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class gOt extends wm{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Ps(e,t){if(st(e)||e===null)return t;if(e instanceof wm)return e;if(xOt(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?_j.instance:n==="utc"||n==="gmt"?ei.utcInstance:ei.parseSpecifier(n)||hs.create(e)}else return Us(e)?ei.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new gOt(e)}const lK={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},_ee={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},yOt=lK.hanidec.replace(/[\[|\]]/g,"").split("");function vOt(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(lK.hanidec)!==-1)t+=yOt.indexOf(e[n]);else for(const i in _ee){const[a,o]=_ee[i];r>=a&&r<=o&&(t+=r-a)}}return parseInt(t,10)}else return t}const QB=new Map;function kOt(){QB.clear()}function _a({numberingSystem:e},t=""){const n=e||"latn";let r=QB.get(n);r===void 0&&(r=new Map,QB.set(n,r));let i=r.get(t);return i===void 0&&(i=new RegExp(`${lK[n]}${t}`),r.set(t,i)),i}let Mee=()=>Date.now(),See="system",Cee=null,Lee=null,Iee=null,Nee=60,Aee,$ee=null;class Pn{static get now(){return Mee}static set now(t){Mee=t}static set defaultZone(t){See=t}static get defaultZone(){return Ps(See,_j.instance)}static get defaultLocale(){return Cee}static set defaultLocale(t){Cee=t}static get defaultNumberingSystem(){return Lee}static set defaultNumberingSystem(t){Lee=t}static get defaultOutputCalendar(){return Iee}static set defaultOutputCalendar(t){Iee=t}static get defaultWeekSettings(){return $ee}static set defaultWeekSettings(t){$ee=eU(t)}static get twoDigitCutoffYear(){return Nee}static set twoDigitCutoffYear(t){Nee=t%100}static get throwOnInvalid(){return Aee}static set throwOnInvalid(t){Aee=t}static resetCaches(){Yt.resetCache(),hs.resetCache(),ot.resetCache(),kOt()}}class $a{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const ffe=[0,31,59,90,120,151,181,212,243,273,304,334],pfe=[0,31,60,91,121,152,182,213,244,274,305,335];function ea(e,t){return new $a("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function cK(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function mfe(e,t,n){return n+(xm(e)?pfe:ffe)[t-1]}function gfe(e,t){const n=xm(e)?pfe:ffe,r=n.findIndex(a=>a<t),i=t-n[r];return{month:r+1,day:i}}function dK(e,t){return(e-t+7)%7+1}function Fz(e,t=4,n=1){const{year:r,month:i,day:a}=e,o=mfe(r,i,a),s=dK(cK(r,i,a),n);let l=Math.floor((o-s+14-t)/7),c;return l<1?(c=r-1,l=P2(c,t,n)):l>P2(r,t,n)?(c=r+1,l=1):c=r,{weekYear:c,weekNumber:l,weekday:s,...Lj(e)}}function Tee(e,t=4,n=1){const{weekYear:r,weekNumber:i,weekday:a}=e,o=dK(cK(r,1,t),n),s=Oh(r);let l=i*7+a-o-7+t,c;l<1?(c=r-1,l+=Oh(c)):l>s?(c=r+1,l-=Oh(r)):c=r;const{month:u,day:h}=gfe(c,l);return{year:c,month:u,day:h,...Lj(e)}}function IF(e){const{year:t,month:n,day:r}=e,i=mfe(t,n,r);return{year:t,ordinal:i,...Lj(e)}}function Eee(e){const{year:t,ordinal:n}=e,{month:r,day:i}=gfe(t,n);return{year:t,month:r,day:i,...Lj(e)}}function Pee(e,t){if(!st(e.localWeekday)||!st(e.localWeekNumber)||!st(e.localWeekYear)){if(!st(e.weekday)||!st(e.weekNumber)||!st(e.weekYear))throw new _h("Cannot mix locale-based week fields with ISO-based week fields");return st(e.localWeekday)||(e.weekday=e.localWeekday),st(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),st(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function bOt(e,t=4,n=1){const r=Mj(e.weekYear),i=ta(e.weekNumber,1,P2(e.weekYear,t,n)),a=ta(e.weekday,1,7);return r?i?a?!1:ea("weekday",e.weekday):ea("week",e.weekNumber):ea("weekYear",e.weekYear)}function wOt(e){const t=Mj(e.year),n=ta(e.ordinal,1,Oh(e.year));return t?n?!1:ea("ordinal",e.ordinal):ea("year",e.year)}function yfe(e){const t=Mj(e.year),n=ta(e.month,1,12),r=ta(e.day,1,Vz(e.year,e.month));return t?n?r?!1:ea("day",e.day):ea("month",e.month):ea("year",e.year)}function vfe(e){const{hour:t,minute:n,second:r,millisecond:i}=e,a=ta(t,0,23)||t===24&&n===0&&r===0&&i===0,o=ta(n,0,59),s=ta(r,0,59),l=ta(i,0,999);return a?o?s?l?!1:ea("millisecond",i):ea("second",r):ea("minute",n):ea("hour",t)}function st(e){return typeof e>"u"}function Us(e){return typeof e=="number"}function Mj(e){return typeof e=="number"&&e%1===0}function xOt(e){return typeof e=="string"}function _Ot(e){return Object.prototype.toString.call(e)==="[object Date]"}function kfe(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function bfe(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function MOt(e){return Array.isArray(e)?e:[e]}function Dee(e,t,n){if(e.length!==0)return e.reduce((r,i)=>{const a=[t(i),i];return r&&n(r[0],a[0])===r[0]?r:a},null)[1]}function SOt(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function nf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function eU(e){if(e==null)return null;if(typeof e!="object")throw new Pr("Week settings must be an object");if(!ta(e.firstDay,1,7)||!ta(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ta(t,1,7)))throw new Pr("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ta(e,t,n){return Mj(e)&&e>=t&&e<=n}function COt(e,t){return e-t*Math.floor(e/t)}function Wn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function Es(e){if(!(st(e)||e===null||e===""))return parseInt(e,10)}function Ml(e){if(!(st(e)||e===null||e===""))return parseFloat(e)}function uK(e){if(!(st(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function hK(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function xm(e){return e%4===0&&(e%100!==0||e%400===0)}function Oh(e){return xm(e)?366:365}function Vz(e,t){const n=COt(t-1,12)+1,r=e+(t-n)/12;return n===2?xm(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Sj(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Oee(e,t,n){return-dK(cK(e,1,t),n)+t-1}function P2(e,t=4,n=1){const r=Oee(e,t,n),i=Oee(e+1,t,n);return(Oh(e)-r+i)/7}function tU(e){return e>99?e:e>Pn.twoDigitCutoffYear?1900+e:2e3+e}function wfe(e,t,n,r=null){const i=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(a.timeZone=r);const o={timeZoneName:t,...a},s=new Intl.DateTimeFormat(n,o).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return s?s.value:null}function Cj(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function xfe(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new Pr(`Invalid unit value ${e}`);return t}function Bz(e,t){const n={};for(const r in e)if(nf(e,r)){const i=e[r];if(i==null)continue;n[t(r)]=xfe(i)}return n}function Jp(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Wn(n,2)}:${Wn(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Wn(n,2)}${Wn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Lj(e){return SOt(e,["hour","minute","second","millisecond"])}const LOt=["January","February","March","April","May","June","July","August","September","October","November","December"],_fe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],IOt=["J","F","M","A","M","J","J","A","S","O","N","D"];function Mfe(e){switch(e){case"narrow":return[...IOt];case"short":return[..._fe];case"long":return[...LOt];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Sfe=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Cfe=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],NOt=["M","T","W","T","F","S","S"];function Lfe(e){switch(e){case"narrow":return[...NOt];case"short":return[...Cfe];case"long":return[...Sfe];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ife=["AM","PM"],AOt=["Before Christ","Anno Domini"],$Ot=["BC","AD"],TOt=["B","A"];function Nfe(e){switch(e){case"narrow":return[...TOt];case"short":return[...$Ot];case"long":return[...AOt];default:return null}}function EOt(e){return Ife[e.hour<12?0:1]}function POt(e,t){return Lfe(t)[e.weekday-1]}function DOt(e,t){return Mfe(t)[e.month-1]}function OOt(e,t){return Nfe(t)[e.year<0?0:1]}function ROt(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&a){const h=e==="days";switch(t){case 1:return h?"tomorrow":`next ${i[e][0]}`;case-1:return h?"yesterday":`last ${i[e][0]}`;case 0:return h?"today":`this ${i[e][0]}`}}const o=Object.is(t,-0)||t<0,s=Math.abs(t),l=s===1,c=i[e],u=r?l?c[1]:c[2]||c[1]:l?i[e][0]:e;return o?`${s} ${u} ago`:`in ${s} ${u}`}function Ree(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const zOt={D:Hz,DD:Whe,DDD:Ghe,DDDD:Zhe,t:Khe,tt:Xhe,ttt:Yhe,tttt:Jhe,T:Qhe,TT:efe,TTT:tfe,TTTT:nfe,f:rfe,ff:afe,fff:sfe,ffff:cfe,F:ife,FF:ofe,FFF:lfe,FFFF:dfe};class Rr{static create(t,n={}){return new Rr(t,n)}static parseFormat(t){let n=null,r="",i=!1;const a=[];for(let o=0;o<t.length;o++){const s=t.charAt(o);s==="'"?(r.length>0&&a.push({literal:i||/^\s+$/.test(r),val:r}),n=null,r="",i=!i):i||s===n?r+=s:(r.length>0&&a.push({literal:/^\s+$/.test(r),val:r}),r=s,n=s)}return r.length>0&&a.push({literal:i||/^\s+$/.test(r),val:r}),a}static macroTokenToFormatOpts(t){return zOt[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Wn(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(g,y)=>this.loc.extract(t,g,y),o=g=>t.isOffsetFixed&&t.offset===0&&g.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,g.format):"",s=()=>r?EOt(t):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(g,y)=>r?DOt(t,g):a(y?{month:g}:{month:g,day:"numeric"},"month"),c=(g,y)=>r?POt(t,g):a(y?{weekday:g}:{weekday:g,month:"long",day:"numeric"},"weekday"),u=g=>{const y=Rr.macroTokenToFormatOpts(g);return y?this.formatWithSystemDefault(t,y):g},h=g=>r?OOt(t,g):a({era:g},"era"),m=g=>{switch(g){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return s();case"d":return i?a({day:"numeric"},"day"):this.num(t.day);case"dd":return i?a({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return i?a({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?a({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?a({month:"numeric"},"month"):this.num(t.month);case"MM":return i?a({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?a({year:"numeric"},"year"):this.num(t.year);case"yy":return i?a({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?a({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?a({year:"numeric"},"year"):this.num(t.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return u(g)}};return Ree(Rr.parseFormat(n),m)}formatDurationFromString(t,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=l=>c=>{const u=r(c);return u?this.num(l.get(u),c.length):c},a=Rr.parseFormat(n),o=a.reduce((l,{literal:c,val:u})=>c?l:l.concat(u),[]),s=t.shiftTo(...o.map(r).filter(l=>l));return Ree(a,i(s))}}const Afe=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Nf(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function Af(...e){return t=>e.reduce(([n,r,i],a)=>{const[o,s,l]=a(t,i);return[{...n,...o},s||r,l]},[{},null,1]).slice(0,2)}function $f(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const i=n.exec(e);if(i)return r(i)}return[null,null]}function $fe(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=Es(t[n+i]);return[r,null,n+i]}}const Tfe=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,qOt=`(?:${Tfe.source}?(?:\\[(${Afe.source})\\])?)?`,fK=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Efe=RegExp(`${fK.source}${qOt}`),pK=RegExp(`(?:T${Efe.source})?`),jOt=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,HOt=/(\d{4})-?W(\d\d)(?:-?(\d))?/,FOt=/(\d{4})-?(\d{3})/,VOt=$fe("weekYear","weekNumber","weekDay"),BOt=$fe("year","ordinal"),UOt=/(\d{4})-(\d\d)-(\d\d)/,Pfe=RegExp(`${fK.source} ?(?:${Tfe.source}|(${Afe.source}))?`),WOt=RegExp(`(?: ${Pfe.source})?`);function Rh(e,t,n){const r=e[t];return st(r)?n:Es(r)}function GOt(e,t){return[{year:Rh(e,t),month:Rh(e,t+1,1),day:Rh(e,t+2,1)},null,t+3]}function Tf(e,t){return[{hours:Rh(e,t,0),minutes:Rh(e,t+1,0),seconds:Rh(e,t+2,0),milliseconds:uK(e[t+3])},null,t+4]}function _m(e,t){const n=!e[t]&&!e[t+1],r=Cj(e[t+1],e[t+2]),i=n?null:ei.instance(r);return[{},i,t+3]}function Mm(e,t){const n=e[t]?hs.create(e[t]):null;return[{},n,t+1]}const ZOt=RegExp(`^T?${fK.source}$`),KOt=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function XOt(e){const[t,n,r,i,a,o,s,l,c]=e,u=t[0]==="-",h=l&&l[0]==="-",m=(g,y=!1)=>g!==void 0&&(y||g&&u)?-g:g;return[{years:m(Ml(n)),months:m(Ml(r)),weeks:m(Ml(i)),days:m(Ml(a)),hours:m(Ml(o)),minutes:m(Ml(s)),seconds:m(Ml(l),l==="-0"),milliseconds:m(uK(c),h)}]}const YOt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function mK(e,t,n,r,i,a,o){const s={year:t.length===2?tU(Es(t)):Es(t),month:_fe.indexOf(n)+1,day:Es(r),hour:Es(i),minute:Es(a)};return o&&(s.second=Es(o)),e&&(s.weekday=e.length>3?Sfe.indexOf(e)+1:Cfe.indexOf(e)+1),s}const JOt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function QOt(e){const[,t,n,r,i,a,o,s,l,c,u,h]=e,m=mK(t,i,r,n,a,o,s);let g;return l?g=YOt[l]:c?g=0:g=Cj(u,h),[m,new ei(g)]}function eRt(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const tRt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,nRt=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,rRt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function zee(e){const[,t,n,r,i,a,o,s]=e;return[mK(t,i,r,n,a,o,s),ei.utcInstance]}function iRt(e){const[,t,n,r,i,a,o,s]=e;return[mK(t,s,n,r,i,a,o),ei.utcInstance]}const aRt=Nf(jOt,pK),oRt=Nf(HOt,pK),sRt=Nf(FOt,pK),lRt=Nf(Efe),Dfe=Af(GOt,Tf,_m,Mm),cRt=Af(VOt,Tf,_m,Mm),dRt=Af(BOt,Tf,_m,Mm),uRt=Af(Tf,_m,Mm);function hRt(e){return $f(e,[aRt,Dfe],[oRt,cRt],[sRt,dRt],[lRt,uRt])}function fRt(e){return $f(eRt(e),[JOt,QOt])}function pRt(e){return $f(e,[tRt,zee],[nRt,zee],[rRt,iRt])}function mRt(e){return $f(e,[KOt,XOt])}const gRt=Af(Tf);function yRt(e){return $f(e,[ZOt,gRt])}const vRt=Nf(UOt,WOt),kRt=Nf(Pfe),bRt=Af(Tf,_m,Mm);function wRt(e){return $f(e,[vRt,Dfe],[kRt,bRt])}const qee="Invalid Duration",Ofe={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},xRt={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Ofe},Wi=146097/400,eh=146097/4800,_Rt={years:{quarters:4,months:12,weeks:Wi/7,days:Wi,hours:Wi*24,minutes:Wi*24*60,seconds:Wi*24*60*60,milliseconds:Wi*24*60*60*1e3},quarters:{months:3,weeks:Wi/28,days:Wi/4,hours:Wi*24/4,minutes:Wi*24*60/4,seconds:Wi*24*60*60/4,milliseconds:Wi*24*60*60*1e3/4},months:{weeks:eh/7,days:eh,hours:eh*24,minutes:eh*24*60,seconds:eh*24*60*60,milliseconds:eh*24*60*60*1e3},...Ofe},Z1=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],MRt=Z1.slice(0).reverse();function Ss(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Ht(r)}function Rfe(e,t){let n=t.milliseconds??0;for(const r of MRt.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function jee(e,t){const n=Rfe(e,t)<0?-1:1;Z1.reduceRight((r,i)=>{if(st(t[i]))return r;if(r){const a=t[r]*n,o=e[i][r],s=Math.floor(a/o);t[i]+=s*n,t[r]-=s*o*n}return i},null),Z1.reduce((r,i)=>{if(st(t[i]))return r;if(r){const a=t[r]%1;t[r]-=a,t[i]+=a*e[r][i]}return i},null)}function SRt(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class Ht{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?_Rt:xRt;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||Yt.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Ht.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new Pr(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Ht({values:Bz(t,Ht.normalizeUnit),loc:Yt.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Us(t))return Ht.fromMillis(t);if(Ht.isDuration(t))return t;if(typeof t=="object")return Ht.fromObject(t);throw new Pr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=mRt(t);return r?Ht.fromObject(r,n):Ht.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=yRt(t);return r?Ht.fromObject(r,n):Ht.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new Pr("need to specify a reason the Duration is invalid");const r=t instanceof $a?t:new $a(t,n);if(Pn.throwOnInvalid)throw new XDt(r);return new Ht({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new Uhe(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Rr.create(this.loc,r).formatDurationFromString(this,t):qee}toHuman(t={}){if(!this.isValid)return qee;const n=Z1.map(r=>{const i=this.values[r];return st(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=hK(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},ot.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Rfe(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Ht.fromDurationLike(t),r={};for(const i of Z1)(nf(n.values,i)||nf(this.values,i))&&(r[i]=n.get(i)+this.get(i));return Ss(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Ht.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=xfe(t(this.values[r],r));return Ss(this,{values:n},!0)}get(t){return this[Ht.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Bz(t,Ht.normalizeUnit)};return Ss(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:i}={}){const o={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:i,conversionAccuracy:r};return Ss(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return jee(this.matrix,t),Ss(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=SRt(this.normalize().shiftToAll().toObject());return Ss(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>Ht.normalizeUnit(o));const n={},r={},i=this.toObject();let a;for(const o of Z1)if(t.indexOf(o)>=0){a=o;let s=0;for(const c in r)s+=this.matrix[c][o]*r[c],r[c]=0;Us(i[o])&&(s+=i[o]);const l=Math.trunc(s);n[o]=l,r[o]=(s*1e3-l*1e3)/1e3}else Us(i[o])&&(r[o]=i[o]);for(const o in r)r[o]!==0&&(n[a]+=o===a?r[o]:r[o]/this.matrix[a][o]);return jee(this.matrix,n),Ss(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Ss(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of Z1)if(!n(this.values[r],t.values[r]))return!1;return!0}}const th="Invalid Interval";function CRt(e,t){return!e||!e.isValid?En.invalid("missing or invalid start"):!t||!t.isValid?En.invalid("missing or invalid end"):t<e?En.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class En{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new Pr("need to specify a reason the Interval is invalid");const r=t instanceof $a?t:new $a(t,n);if(Pn.throwOnInvalid)throw new KDt(r);return new En({invalid:r})}static fromDateTimes(t,n){const r=up(t),i=up(n),a=CRt(r,i);return a??new En({start:r,end:i})}static after(t,n){const r=Ht.fromDurationLike(n),i=up(t);return En.fromDateTimes(i,i.plus(r))}static before(t,n){const r=Ht.fromDurationLike(n),i=up(t);return En.fromDateTimes(i.minus(r),i)}static fromISO(t,n){const[r,i]=(t||"").split("/",2);if(r&&i){let a,o;try{a=ot.fromISO(r,n),o=a.isValid}catch{o=!1}let s,l;try{s=ot.fromISO(i,n),l=s.isValid}catch{l=!1}if(o&&l)return En.fromDateTimes(a,s);if(o){const c=Ht.fromISO(i,n);if(c.isValid)return En.after(a,c)}else if(l){const c=Ht.fromISO(r,n);if(c.isValid)return En.before(s,c)}}return En.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(t,n);let i;return n?.useLocaleWeeks?i=this.end.reconfigure({locale:r.locale}):i=this.end,i=i.startOf(t,n),Math.floor(i.diff(r,t).get(t))+(i.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?En.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(up).filter(o=>this.contains(o)).sort((o,s)=>o.toMillis()-s.toMillis()),r=[];let{s:i}=this,a=0;for(;i<this.e;){const o=n[a]||this.e,s=+o>+this.e?this.e:o;r.push(En.fromDateTimes(i,s)),i=s,a+=1}return r}splitBy(t){const n=Ht.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,a;const o=[];for(;r<this.e;){const s=this.start.plus(n.mapUnits(l=>l*i));a=+s>+this.e?this.e:s,o.push(En.fromDateTimes(r,a)),r=a,i+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:En.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return En.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((i,a)=>i.s-a.s).reduce(([i,a],o)=>a?a.overlaps(o)||a.abutsStart(o)?[i,a.union(o)]:[i.concat([a]),o]:[i,o],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const i=[],a=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...a),s=o.sort((l,c)=>l.time-c.time);for(const l of s)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push(En.fromDateTimes(n,l.time)),n=null);return En.merge(i)}difference(...t){return En.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:th}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=Hz,n={}){return this.isValid?Rr.create(this.s.loc.clone(n),t).formatInterval(this):th}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:th}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:th}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:th}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:th}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Ht.invalid(this.invalidReason)}mapEndpoints(t){return En.fromDateTimes(t(this.s),t(this.e))}}class Pg{static hasDST(t=Pn.defaultZone){const n=ot.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return hs.isValidZone(t)}static normalizeZone(t){return Ps(t,Pn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||Yt.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||Yt.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||Yt.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||Yt.create(n,r,a)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||Yt.create(n,r,a)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Yt.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Yt.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Yt.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Yt.create(n,null,"gregory").eras(t)}static features(){return{relative:kfe(),localeWeek:bfe()}}}function Hee(e,t){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Ht.fromMillis(r).as("days"))}function LRt(e,t,n){const r=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{const u=Hee(l,c);return(u-u%7)/7}],["days",Hee]],i={},a=e;let o,s;for(const[l,c]of r)n.indexOf(l)>=0&&(o=l,i[l]=c(e,t),s=a.plus(i),s>t?(i[l]--,e=a.plus(i),e>t&&(s=e,i[l]--,e=a.plus(i))):e=s);return[e,i,s,o]}function IRt(e,t,n,r){let[i,a,o,s]=LRt(e,t,n);const l=t-i,c=n.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);c.length===0&&(o<t&&(o=i.plus({[s]:1})),o!==i&&(a[s]=(a[s]||0)+l/(o-i)));const u=Ht.fromObject(a,r);return c.length>0?Ht.fromMillis(l,r).shiftTo(...c).plus(u):u}const NRt="missing Intl.DateTimeFormat.formatToParts support";function Wt(e,t=n=>n){return{regex:e,deser:([n])=>t(vOt(n))}}const ARt=" ",zfe=`[ ${ARt}]`,qfe=new RegExp(zfe,"g");function $Rt(e){return e.replace(/\./g,"\\.?").replace(qfe,zfe)}function Fee(e){return e.replace(/\./g,"").replace(qfe," ").toLowerCase()}function Ma(e,t){return e===null?null:{regex:RegExp(e.map($Rt).join("|")),deser:([n])=>e.findIndex(r=>Fee(n)===Fee(r))+t}}function Vee(e,t){return{regex:e,deser:([,n,r])=>Cj(n,r),groups:t}}function Dg(e){return{regex:e,deser:([t])=>t}}function TRt(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function ERt(e,t){const n=_a(t),r=_a(t,"{2}"),i=_a(t,"{3}"),a=_a(t,"{4}"),o=_a(t,"{6}"),s=_a(t,"{1,2}"),l=_a(t,"{1,3}"),c=_a(t,"{1,6}"),u=_a(t,"{1,9}"),h=_a(t,"{2,4}"),m=_a(t,"{4,6}"),g=k=>({regex:RegExp(TRt(k.val)),deser:([b])=>b,literal:!0}),v=(k=>{if(e.literal)return g(k);switch(k.val){case"G":return Ma(t.eras("short"),0);case"GG":return Ma(t.eras("long"),0);case"y":return Wt(c);case"yy":return Wt(h,tU);case"yyyy":return Wt(a);case"yyyyy":return Wt(m);case"yyyyyy":return Wt(o);case"M":return Wt(s);case"MM":return Wt(r);case"MMM":return Ma(t.months("short",!0),1);case"MMMM":return Ma(t.months("long",!0),1);case"L":return Wt(s);case"LL":return Wt(r);case"LLL":return Ma(t.months("short",!1),1);case"LLLL":return Ma(t.months("long",!1),1);case"d":return Wt(s);case"dd":return Wt(r);case"o":return Wt(l);case"ooo":return Wt(i);case"HH":return Wt(r);case"H":return Wt(s);case"hh":return Wt(r);case"h":return Wt(s);case"mm":return Wt(r);case"m":return Wt(s);case"q":return Wt(s);case"qq":return Wt(r);case"s":return Wt(s);case"ss":return Wt(r);case"S":return Wt(l);case"SSS":return Wt(i);case"u":return Dg(u);case"uu":return Dg(s);case"uuu":return Wt(n);case"a":return Ma(t.meridiems(),0);case"kkkk":return Wt(a);case"kk":return Wt(h,tU);case"W":return Wt(s);case"WW":return Wt(r);case"E":case"c":return Wt(n);case"EEE":return Ma(t.weekdays("short",!1),1);case"EEEE":return Ma(t.weekdays("long",!1),1);case"ccc":return Ma(t.weekdays("short",!0),1);case"cccc":return Ma(t.weekdays("long",!0),1);case"Z":case"ZZ":return Vee(new RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case"ZZZ":return Vee(new RegExp(`([+-]${s.source})(${r.source})?`),2);case"z":return Dg(/[a-z_+-/]{1,256}?/i);case" ":return Dg(/[^\S\n\r]/);default:return g(k)}})(e)||{invalidReason:NRt};return v.token=e,v}const PRt={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function DRt(e,t,n){const{type:r,value:i}=e;if(r==="literal"){const l=/^\s+$/.test(i);return{literal:!l,val:l?" ":i}}const a=t[r];let o=r;r==="hour"&&(t.hour12!=null?o=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?o="hour12":o="hour24":o=n.hour12?"hour12":"hour24");let s=PRt[o];if(typeof s=="object"&&(s=s[a]),s)return{literal:!1,val:s}}function ORt(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function RRt(e,t,n){const r=e.match(t);if(r){const i={};let a=1;for(const o in n)if(nf(n,o)){const s=n[o],l=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(r.slice(a,a+l))),a+=l}return[r,i]}else return[r,{}]}function zRt(e){const t=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return st(e.z)||(n=hs.create(e.z)),st(e.Z)||(n||(n=new ei(e.Z)),r=e.Z),st(e.q)||(e.M=(e.q-1)*3+1),st(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),st(e.u)||(e.S=uK(e.u)),[Object.keys(e).reduce((a,o)=>{const s=t(o);return s&&(a[s]=e[o]),a},{}),n,r]}let NF=null;function qRt(){return NF||(NF=ot.fromMillis(1555555555555)),NF}function jRt(e,t){if(e.literal)return e;const n=Rr.macroTokenToFormatOpts(e.val),r=Vfe(n,t);return r==null||r.includes(void 0)?e:r}function jfe(e,t){return Array.prototype.concat(...e.map(n=>jRt(n,t)))}class Hfe{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=jfe(Rr.parseFormat(n),t),this.units=this.tokens.map(r=>ERt(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,i]=ORt(this.units);this.regex=RegExp(r,"i"),this.handlers=i}}explainFromTokens(t){if(this.isValid){const[n,r]=RRt(t,this.regex,this.handlers),[i,a,o]=r?zRt(r):[null,null,void 0];if(nf(r,"a")&&nf(r,"H"))throw new _h("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:i,zone:a,specificOffset:o}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Ffe(e,t,n){return new Hfe(e,n).explainFromTokens(t)}function HRt(e,t,n){const{result:r,zone:i,specificOffset:a,invalidReason:o}=Ffe(e,t,n);return[r,i,a,o]}function Vfe(e,t){if(!e)return null;const r=Rr.create(t,e).dtFormatter(qRt()),i=r.formatToParts(),a=r.resolvedOptions();return i.map(o=>DRt(o,e,a))}const AF="Invalid DateTime",Bee=864e13;function Dp(e){return new $a("unsupported zone",`the zone "${e.name}" is not supported`)}function $F(e){return e.weekData===null&&(e.weekData=Fz(e.c)),e.weekData}function TF(e){return e.localWeekData===null&&(e.localWeekData=Fz(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Sl(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new ot({...n,...t,old:n})}function Bfe(e,t,n){let r=e-t*60*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;const a=n.offset(r);return i===a?[r,i]:[e-Math.min(i,a)*60*1e3,Math.max(i,a)]}function Og(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function MR(e,t,n){return Bfe(Sj(e),t,n)}function Uee(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,a={...e.c,year:r,month:i,day:Math.min(e.c.day,Vz(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=Ht.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=Sj(a);let[l,c]=Bfe(s,n,e.zone);return o!==0&&(l+=o,c=e.zone.offset(l)),{ts:l,o:c}}function nh(e,t,n,r,i,a){const{setZone:o,zone:s}=n;if(e&&Object.keys(e).length!==0||t){const l=t||s,c=ot.fromObject(e,{...n,zone:l,specificOffset:a});return o?c:c.setZone(s)}else return ot.invalid(new $a("unparsable",`the input "${i}" can't be parsed as ${r}`))}function Rg(e,t,n=!0){return e.isValid?Rr.create(Yt.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function EF(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Wn(e.c.year,n?6:4),t?(r+="-",r+=Wn(e.c.month),r+="-",r+=Wn(e.c.day)):(r+=Wn(e.c.month),r+=Wn(e.c.day)),r}function Wee(e,t,n,r,i,a){let o=Wn(e.c.hour);return t?(o+=":",o+=Wn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(o+=":")):o+=Wn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(o+=Wn(e.c.second),(e.c.millisecond!==0||!r)&&(o+=".",o+=Wn(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!a?o+="Z":e.o<0?(o+="-",o+=Wn(Math.trunc(-e.o/60)),o+=":",o+=Wn(Math.trunc(-e.o%60))):(o+="+",o+=Wn(Math.trunc(e.o/60)),o+=":",o+=Wn(Math.trunc(e.o%60)))),a&&(o+="["+e.zone.ianaName+"]"),o}const Ufe={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},FRt={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},VRt={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Wfe=["year","month","day","hour","minute","second","millisecond"],BRt=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],URt=["year","ordinal","hour","minute","second","millisecond"];function WRt(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new Uhe(e);return t}function Gee(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return WRt(e)}}function GRt(e){if(Op===void 0&&(Op=Pn.now()),e.type!=="iana")return e.offset(Op);const t=e.name;let n=nU.get(t);return n===void 0&&(n=e.offset(Op),nU.set(t,n)),n}function Zee(e,t){const n=Ps(t.zone,Pn.defaultZone);if(!n.isValid)return ot.invalid(Dp(n));const r=Yt.fromObject(t);let i,a;if(st(e.year))i=Pn.now();else{for(const l of Wfe)st(e[l])&&(e[l]=Ufe[l]);const o=yfe(e)||vfe(e);if(o)return ot.invalid(o);const s=GRt(n);[i,a]=MR(e,s,n)}return new ot({ts:i,zone:n,loc:r,o:a})}function Kee(e,t,n){const r=st(n.round)?!0:n.round,i=(o,s)=>(o=hK(o,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(o,s)),a=o=>n.calendary?t.hasSame(e,o)?0:t.startOf(o).diff(e.startOf(o),o).get(o):t.diff(e,o).get(o);if(n.unit)return i(a(n.unit),n.unit);for(const o of n.units){const s=a(o);if(Math.abs(s)>=1)return i(s,o)}return i(e>t?-0:0,n.units[n.units.length-1])}function Xee(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let Op;const nU=new Map;class ot{constructor(t){const n=t.zone||Pn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new $a("invalid input"):null)||(n.isValid?null:Dp(n));this.ts=st(t.ts)?Pn.now():t.ts;let i=null,a=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[i,a]=[t.old.c,t.old.o];else{const s=Us(t.o)&&!t.old?t.o:n.offset(this.ts);i=Og(this.ts,s),r=Number.isNaN(i.year)?new $a("invalid input"):null,i=r?null:i,a=r?null:s}this._zone=n,this.loc=t.loc||Yt.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=i,this.o=a,this.isLuxonDateTime=!0}static now(){return new ot({})}static local(){const[t,n]=Xee(arguments),[r,i,a,o,s,l,c]=n;return Zee({year:r,month:i,day:a,hour:o,minute:s,second:l,millisecond:c},t)}static utc(){const[t,n]=Xee(arguments),[r,i,a,o,s,l,c]=n;return t.zone=ei.utcInstance,Zee({year:r,month:i,day:a,hour:o,minute:s,second:l,millisecond:c},t)}static fromJSDate(t,n={}){const r=_Ot(t)?t.valueOf():NaN;if(Number.isNaN(r))return ot.invalid("invalid input");const i=Ps(n.zone,Pn.defaultZone);return i.isValid?new ot({ts:r,zone:i,loc:Yt.fromObject(n)}):ot.invalid(Dp(i))}static fromMillis(t,n={}){if(Us(t))return t<-Bee||t>Bee?ot.invalid("Timestamp out of range"):new ot({ts:t,zone:Ps(n.zone,Pn.defaultZone),loc:Yt.fromObject(n)});throw new Pr(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Us(t))return new ot({ts:t*1e3,zone:Ps(n.zone,Pn.defaultZone),loc:Yt.fromObject(n)});throw new Pr("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=Ps(n.zone,Pn.defaultZone);if(!r.isValid)return ot.invalid(Dp(r));const i=Yt.fromObject(n),a=Bz(t,Gee),{minDaysInFirstWeek:o,startOfWeek:s}=Pee(a,i),l=Pn.now(),c=st(n.specificOffset)?r.offset(l):n.specificOffset,u=!st(a.ordinal),h=!st(a.year),m=!st(a.month)||!st(a.day),g=h||m,y=a.weekYear||a.weekNumber;if((g||u)&&y)throw new _h("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(m&&u)throw new _h("Can't mix ordinal dates with month/day");const v=y||a.weekday&&!g;let k,b,x=Og(l,c);v?(k=BRt,b=FRt,x=Fz(x,o,s)):u?(k=URt,b=VRt,x=IF(x)):(k=Wfe,b=Ufe);let w=!1;for(const A of k){const D=a[A];st(D)?w?a[A]=b[A]:a[A]=x[A]:w=!0}const M=v?bOt(a,o,s):u?wOt(a):yfe(a),_=M||vfe(a);if(_)return ot.invalid(_);const C=v?Tee(a,o,s):u?Eee(a):a,[L,S]=MR(C,c,r),I=new ot({ts:L,zone:r,o:S,loc:i});return a.weekday&&g&&t.weekday!==I.weekday?ot.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${I.toISO()}`):I.isValid?I:ot.invalid(I.invalid)}static fromISO(t,n={}){const[r,i]=hRt(t);return nh(r,i,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,i]=fRt(t);return nh(r,i,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,i]=pRt(t);return nh(r,i,n,"HTTP",n)}static fromFormat(t,n,r={}){if(st(t)||st(n))throw new Pr("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:a=null}=r,o=Yt.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),[s,l,c,u]=HRt(o,t,n);return u?ot.invalid(u):nh(s,l,r,`format ${n}`,t,c)}static fromString(t,n,r={}){return ot.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,i]=wRt(t);return nh(r,i,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new Pr("need to specify a reason the DateTime is invalid");const r=t instanceof $a?t:new $a(t,n);if(Pn.throwOnInvalid)throw new ZDt(r);return new ot({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=Vfe(t,Yt.fromObject(n));return r?r.map(i=>i?i.val:null).join(""):null}static expandFormat(t,n={}){return jfe(Rr.parseFormat(t),Yt.fromObject(n)).map(i=>i.val).join("")}static resetCache(){Op=void 0,nU.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?$F(this).weekYear:NaN}get weekNumber(){return this.isValid?$F(this).weekNumber:NaN}get weekday(){return this.isValid?$F(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?TF(this).weekday:NaN}get localWeekNumber(){return this.isValid?TF(this).weekNumber:NaN}get localWeekYear(){return this.isValid?TF(this).weekYear:NaN}get ordinal(){return this.isValid?IF(this.c).ordinal:NaN}get monthShort(){return this.isValid?Pg.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Pg.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Pg.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Pg.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,r=Sj(this.c),i=this.zone.offset(r-t),a=this.zone.offset(r+t),o=this.zone.offset(r-i*n),s=this.zone.offset(r-a*n);if(o===s)return[this];const l=r-o*n,c=r-s*n,u=Og(l,o),h=Og(c,s);return u.hour===h.hour&&u.minute===h.minute&&u.second===h.second&&u.millisecond===h.millisecond?[Sl(this,{ts:l}),Sl(this,{ts:c})]:[this]}get isInLeapYear(){return xm(this.year)}get daysInMonth(){return Vz(this.year,this.month)}get daysInYear(){return this.isValid?Oh(this.year):NaN}get weeksInWeekYear(){return this.isValid?P2(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?P2(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:i}=Rr.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(t=0,n={}){return this.setZone(ei.instance(t),n)}toLocal(){return this.setZone(Pn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Ps(t,Pn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(n||r){const a=t.offset(this.ts),o=this.toObject();[i]=MR(o,a,t)}return Sl(this,{ts:i,zone:t})}else return ot.invalid(Dp(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Sl(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Bz(t,Gee),{minDaysInFirstWeek:r,startOfWeek:i}=Pee(n,this.loc),a=!st(n.weekYear)||!st(n.weekNumber)||!st(n.weekday),o=!st(n.ordinal),s=!st(n.year),l=!st(n.month)||!st(n.day),c=s||l,u=n.weekYear||n.weekNumber;if((c||o)&&u)throw new _h("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new _h("Can't mix ordinal dates with month/day");let h;a?h=Tee({...Fz(this.c,r,i),...n},r,i):st(n.ordinal)?(h={...this.toObject(),...n},st(n.day)&&(h.day=Math.min(Vz(h.year,h.month),h.day))):h=Eee({...IF(this.c),...n});const[m,g]=MR(h,this.o,this.zone);return Sl(this,{ts:m,o:g})}plus(t){if(!this.isValid)return this;const n=Ht.fromDurationLike(t);return Sl(this,Uee(this,n))}minus(t){if(!this.isValid)return this;const n=Ht.fromDurationLike(t).negate();return Sl(this,Uee(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},i=Ht.normalizeUnit(t);switch(i){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(i==="weeks")if(n){const a=this.loc.getStartOfWeek(),{weekday:o}=this;o<a&&(r.weekNumber=this.weekNumber-1),r.weekday=a}else r.weekday=1;if(i==="quarters"){const a=Math.ceil(this.month/3);r.month=(a-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?Rr.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):AF}toLocaleString(t=Hz,n={}){return this.isValid?Rr.create(this.loc.clone(n),t).formatDateTime(this):AF}toLocaleParts(t={}){return this.isValid?Rr.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:a=!1}={}){if(!this.isValid)return null;const o=t==="extended";let s=EF(this,o);return s+="T",s+=Wee(this,o,n,r,i,a),s}toISODate({format:t="extended"}={}){return this.isValid?EF(this,t==="extended"):null}toISOWeekDate(){return Rg(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:a=!1,format:o="extended"}={}){return this.isValid?(i?"T":"")+Wee(this,o==="extended",n,t,r,a):null}toRFC2822(){return Rg(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Rg(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?EF(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||t)&&(r&&(i+=" "),n?i+="z":t&&(i+="ZZ")),Rg(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():AF}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Ht.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},a=MOt(n).map(Ht.normalizeUnit),o=t.valueOf()>this.valueOf(),s=o?this:t,l=o?t:this,c=IRt(s,l,a,i);return o?c.negate():c}diffNow(t="milliseconds",n={}){return this.diff(ot.now(),t,n)}until(t){return this.isValid?En.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const i=t.valueOf(),a=this.setZone(t.zone,{keepLocalTime:!0});return a.startOf(n,r)<=i&&i<=a.endOf(n,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||ot.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let i=["years","months","days","hours","minutes","seconds"],a=t.unit;return Array.isArray(t.unit)&&(i=t.unit,a=void 0),Kee(n,this.plus(r),{...t,numeric:"always",units:i,unit:a})}toRelativeCalendar(t={}){return this.isValid?Kee(t.base||ot.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(ot.isDateTime))throw new Pr("min requires all arguments be DateTimes");return Dee(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(ot.isDateTime))throw new Pr("max requires all arguments be DateTimes");return Dee(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:i=null,numberingSystem:a=null}=r,o=Yt.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});return Ffe(o,t,n)}static fromStringExplain(t,n,r={}){return ot.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:i=null}=n,a=Yt.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return new Hfe(a,t)}static fromFormatParser(t,n,r={}){if(st(t)||st(n))throw new Pr("fromFormatParser requires an input string and a format parser");const{locale:i=null,numberingSystem:a=null}=r,o=Yt.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});if(!o.equals(n.locale))throw new Pr(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);const{result:s,zone:l,specificOffset:c,invalidReason:u}=n.explainFromTokens(t);return u?ot.invalid(u):nh(s,l,r,`format ${n.format}`,t,c)}static get DATE_SHORT(){return Hz}static get DATE_MED(){return Whe}static get DATE_MED_WITH_WEEKDAY(){return YDt}static get DATE_FULL(){return Ghe}static get DATE_HUGE(){return Zhe}static get TIME_SIMPLE(){return Khe}static get TIME_WITH_SECONDS(){return Xhe}static get TIME_WITH_SHORT_OFFSET(){return Yhe}static get TIME_WITH_LONG_OFFSET(){return Jhe}static get TIME_24_SIMPLE(){return Qhe}static get TIME_24_WITH_SECONDS(){return efe}static get TIME_24_WITH_SHORT_OFFSET(){return tfe}static get TIME_24_WITH_LONG_OFFSET(){return nfe}static get DATETIME_SHORT(){return rfe}static get DATETIME_SHORT_WITH_SECONDS(){return ife}static get DATETIME_MED(){return afe}static get DATETIME_MED_WITH_SECONDS(){return ofe}static get DATETIME_MED_WITH_WEEKDAY(){return JDt}static get DATETIME_FULL(){return sfe}static get DATETIME_FULL_WITH_SECONDS(){return lfe}static get DATETIME_HUGE(){return cfe}static get DATETIME_HUGE_WITH_SECONDS(){return dfe}}function up(e){if(ot.isDateTime(e))return e;if(e&&e.valueOf&&Us(e.valueOf()))return ot.fromJSDate(e);if(e&&typeof e=="object")return ot.fromObject(e);throw new Pr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function Gfe(e,t,n){let r=i=>e(i,...t);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:t})}function Sm(e,t,n){let r=e.length-t.length;if(r===0)return e(...t);if(r===1)return Gfe(e,t,n);throw new Error("Wrong number of arguments")}var gK={done:!1,hasNext:!1},ZRt=e=>({hasNext:!0,next:e,done:!1});function Uz(e,...t){let n=e,r=t.map(a=>"lazy"in a?KRt(a):void 0),i=0;for(;i<t.length;){if(r[i]===void 0||!XRt(n)){let l=t[i];n=l(n),i+=1;continue}let a=[];for(let l=i;l<t.length;l++){let c=r[l];if(c===void 0||(a.push(c),c.isSingle))break}let o=[];for(let l of n)if(Zfe(l,o,a))break;let{isSingle:s}=a.at(-1);n=s?o[0]:o,i+=a.length}return n}function Zfe(e,t,n){if(n.length===0)return t.push(e),!1;let r=e,i=gK,a=!1;for(let[o,s]of n.entries()){let{index:l,items:c}=s;if(c.push(r),i=s(r,l,c),s.index+=1,i.hasNext){if(i.hasMany??!1){for(let u of i.next)if(Zfe(u,t,n.slice(o+1)))return!0;return a}r=i.next}if(!i.hasNext)break;i.done&&(a=!0)}return i.hasNext&&t.push(r),a}function KRt(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function XRt(e){return typeof e=="string"||typeof e=="object"&&e!==null&&Symbol.iterator in e}function YRt(e,t){let n=t.length-e.length;if(n===1){let[r,...i]=t;return Uz(r,{lazy:e,lazyArgs:i})}if(n===0){let r={lazy:e,lazyArgs:t};return Object.assign(i=>Uz(i,r),r)}throw new Error("Wrong number of arguments")}function JRt(...e){return YRt(QRt,e)}function QRt(e){let t=e,n=new Set;return(r,i,a)=>{let o=t(r,i,a);return n.has(o)?gK:(n.add(o),{done:!1,hasNext:!0,next:r})}}function Yee(...e){return Sm(Object.values,e)}function ezt(...e){return Sm(tzt,e)}var tzt=(e,t)=>e.length>=t,Kfe={asc:(e,t)=>e>t,desc:(e,t)=>e<t};function nzt(e,t){let[n,...r]=t;if(!rzt(n)){let a=rU(...r);return e(n,a)}let i=rU(n,...r);return a=>e(a,i)}function rU(e,t,...n){let r=typeof e=="function"?e:e[0],i=typeof e=="function"?"asc":e[1],{[i]:a}=Kfe,o=t===void 0?void 0:rU(t,...n);return(s,l)=>{let c=r(s),u=r(l);return a(c,u)?1:a(u,c)?-1:o?.(s,l)??0}}function rzt(e){if(Jee(e))return!0;if(typeof e!="object"||!Array.isArray(e))return!1;let[t,n,...r]=e;return Jee(t)&&typeof n=="string"&&n in Kfe&&r.length===0}var Jee=e=>typeof e=="function"&&e.length===1;function izt(...e){return Sm(azt,e)}function azt(e,t){let n={};for(let[r,i]of Object.entries(e)){let a=t(i,r,e);n[r]=a}return n}function Qee(...e){return Sm(ozt,e)}var ozt=(e,t)=>{let n=Object.create(null);for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);if(a!==void 0){let o=n[a];o===void 0?n[a]=[i]:o.push(i)}}return Object.setPrototypeOf(n,Object.prototype),n};function szt(...e){return nzt(lzt,e)}function lzt(e,t){if(!ezt(e,2))return e[0];let[n]=e,[,...r]=e;for(let i of r)t(i,n)<0&&(n=i);return n}function czt(e,t){return typeof e=="object"?ete(e,t):Gfe(ete,[],dzt)}var ete=(e,t)=>t===void 0?e.flat():e.flat(t),dzt=e=>e===void 0||e===1?uzt:e<=0?ZRt:t=>Array.isArray(t)?{next:t.flat(e-1),hasNext:!0,hasMany:!0,done:!1}:{next:t,hasNext:!0,done:!1},uzt=e=>Array.isArray(e)?{next:e,hasNext:!0,hasMany:!0,done:!1}:{next:e,hasNext:!0,done:!1};function hzt(...e){return Sm(fzt,e,pzt)}var fzt=(e,t)=>e.filter(t),pzt=e=>(t,n,r)=>e(t,n,r)?{done:!1,hasNext:!0,next:t}:gK;const mzt=["opencode","opencode-go","anthropic","github-copilot","openai","google","openrouter","vercel"],gzt=new Set(mzt);function yK(){const e=ha(),t=di(),n=Z(()=>xo(t.dir)??""),r=()=>{if(n()){const[i]=e.child(n());if(i.provider_ready)return i.provider}return e.data.provider};return{all:()=>r().all,default:()=>r().default,popular:()=>r().all.filter(i=>gzt.has(i.id)),connected:()=>{const i=new Set(r().connected);return r().all.filter(a=>i.has(a.id))},paid:()=>{const i=new Set(r().connected);return r().all.filter(a=>i.has(a.id)&&(a.id!=="opencode"||Object.values(a.models).some(o=>o.cost?.input)))},free:()=>{const i=new Set(r().connected);return r().all.filter(a=>i.has(a.id)&&a.id==="opencode"&&Object.values(a.models).some(o=>!o.cost||o.cost.input===0))}}}const yzt=5;function zg(e){return`${e.providerID}:${e.modelID}`}const{use:vzt,provider:kzt}=Nn({name:"Models",init:()=>{const e=yK(),[t,n,r,i]=Jn(In.global("model",["model.v1"]),nt({user:[],recent:[],variant:{}})),a=Z(()=>e.connected().flatMap(w=>Object.values(w.models).map(M=>({...M,provider:w})))),o=Z(()=>new Map(a().map(w=>{const M=ot.fromISO(w.release_date);return[zg({providerID:w.provider.id,modelID:w.id}),M]}))),s=Z(()=>Uz(a(),hzt(w=>Math.abs((o().get(zg({providerID:w.provider.id,modelID:w.id}))??ot.invalid("invalid")).diffNow().as("months"))<6),Qee(w=>w.provider.id),izt(w=>Uz(w,Qee(M=>M.family),Yee(),M=>M.flatMap(_=>{const C=szt(_,[L=>L.release_date,"desc"]);return C?[{modelID:C.id,providerID:C.provider.id}]:[]}))),Yee(),czt())),l=Z(()=>new Set(s().map(w=>zg(w)))),c=Z(()=>{const w=new Map;for(const M of t.user)w.set(`${M.providerID}:${M.modelID}`,M.visibility);return w}),u=Z(()=>a().map(w=>({...w,name:w.name.replace("(latest)","").trim(),latest:w.name.includes("(latest)")}))),h=w=>u().find(M=>M.id===w.modelID&&M.provider.id===w.providerID);function m(w,M){const _=t.user.findIndex(C=>C.modelID===w.modelID&&C.providerID===w.providerID);if(_>=0){n("user",_,C=>({...C,visibility:M}));return}n("user",t.user.length,{...w,visibility:M})}const g=w=>{const M=zg(w),_=c().get(M);return _==="hide"?!1:!!(_==="show"||l().has(M)||!o().get(M)?.isValid)},y=(w,M)=>{m(w,M?"show":"hide")},v=w=>{const M=JRt([w,...t.recent],_=>`${_.providerID}:${_.modelID}`);M.length>yzt&&M.pop(),n("recent",M)},k=w=>`${w.providerID}/${w.modelID}`,b=w=>t.variant?.[k(w)],x=(w,M)=>{const _=k(w);if(!t.variant){n("variant",{[_]:M});return}n("variant",_,M)};return{ready:i,list:u,find:h,visible:g,setVisibility:y,recent:{list:Z(()=>t.recent),push:v},variant:{get:b,set:x}}}});let qg,jg;function bzt(){return qg||(qg=Object.assign({"../../../ui/src/assets/audio/alert-01.aac":()=>z(()=>import("./alert-01-BJxg7Br3.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-02.aac":()=>z(()=>import("./alert-02-B_yYorxz.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-03.aac":()=>z(()=>import("./alert-03-DrFH92rH.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-04.aac":()=>z(()=>import("./alert-04-BvTiGxWY.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-05.aac":()=>z(()=>import("./alert-05-CFi_H2fs.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-06.aac":()=>z(()=>import("./alert-06-IqbtOTTn.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-07.aac":()=>z(()=>import("./alert-07-B2AcuX88.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-08.aac":()=>z(()=>import("./alert-08-pIF0yjmQ.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-09.aac":()=>z(()=>import("./alert-09-CidmJWaA.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-10.aac":()=>z(()=>import("./alert-10-84PPn2Zu.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-01.aac":()=>z(()=>import("./bip-bop-01-SdbMMaiV.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-02.aac":()=>z(()=>import("./bip-bop-02-CujvGF7f.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-03.aac":()=>z(()=>import("./bip-bop-03-BPb7xYJT.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-04.aac":()=>z(()=>import("./bip-bop-04-dSUw_8vI.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-05.aac":()=>z(()=>import("./bip-bop-05-BNanGIjD.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-06.aac":()=>z(()=>import("./bip-bop-06-DiKbyBF9.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-07.aac":()=>z(()=>import("./bip-bop-07-BoG3Fd8O.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-08.aac":()=>z(()=>import("./bip-bop-08-C6sK41fd.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-09.aac":()=>z(()=>import("./bip-bop-09-AXzGc7YL.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-10.aac":()=>z(()=>import("./bip-bop-10-E37zfY9y.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-01.aac":()=>z(()=>import("./nope-01-HWHtipgi.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-02.aac":()=>z(()=>import("./nope-02-CzaO3Yrz.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-03.aac":()=>z(()=>import("./nope-03-D3_ztwN2.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-04.aac":()=>z(()=>import("./nope-04-CmCNjd7G.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-05.aac":()=>z(()=>import("./nope-05-DY6LpiuN.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-06.aac":()=>z(()=>import("./nope-06-CfV385SL.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-07.aac":()=>z(()=>import("./nope-07-nvIV4VRE.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-08.aac":()=>z(()=>import("./nope-08-HcI83CoX.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-09.aac":()=>z(()=>import("./nope-09-8gNK4nDO.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-10.aac":()=>z(()=>import("./nope-10-C1PuPJJ6.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-11.aac":()=>z(()=>import("./nope-11-BjKpOuL0.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-12.aac":()=>z(()=>import("./nope-12-XTIkittV.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-01.aac":()=>z(()=>import("./staplebops-01-gmydkbKo.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-02.aac":()=>z(()=>import("./staplebops-02-dGmDElbO.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-03.aac":()=>z(()=>import("./staplebops-03-DK1yH6J2.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-04.aac":()=>z(()=>import("./staplebops-04-Bi3-8HzN.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-05.aac":()=>z(()=>import("./staplebops-05-BVmKob0k.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-06.aac":()=>z(()=>import("./staplebops-06-BAYmihXf.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-07.aac":()=>z(()=>import("./staplebops-07-_-IkdLL4.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-01.aac":()=>z(()=>import("./yup-01-Cv8FIGVN.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-02.aac":()=>z(()=>import("./yup-02-BIvWfOQf.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-03.aac":()=>z(()=>import("./yup-03-DlJPYLhC.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-04.aac":()=>z(()=>import("./yup-04-CrvHiQIe.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-05.aac":()=>z(()=>import("./yup-05-CrtAHyVr.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-06.aac":()=>z(()=>import("./yup-06-W4HuBYhb.js"),[]).then(e=>e.default)}),qg)}const hQt=[{id:"alert-01",label:"sound.option.alert01"},{id:"alert-02",label:"sound.option.alert02"},{id:"alert-03",label:"sound.option.alert03"},{id:"alert-04",label:"sound.option.alert04"},{id:"alert-05",label:"sound.option.alert05"},{id:"alert-06",label:"sound.option.alert06"},{id:"alert-07",label:"sound.option.alert07"},{id:"alert-08",label:"sound.option.alert08"},{id:"alert-09",label:"sound.option.alert09"},{id:"alert-10",label:"sound.option.alert10"},{id:"bip-bop-01",label:"sound.option.bipbop01"},{id:"bip-bop-02",label:"sound.option.bipbop02"},{id:"bip-bop-03",label:"sound.option.bipbop03"},{id:"bip-bop-04",label:"sound.option.bipbop04"},{id:"bip-bop-05",label:"sound.option.bipbop05"},{id:"bip-bop-06",label:"sound.option.bipbop06"},{id:"bip-bop-07",label:"sound.option.bipbop07"},{id:"bip-bop-08",label:"sound.option.bipbop08"},{id:"bip-bop-09",label:"sound.option.bipbop09"},{id:"bip-bop-10",label:"sound.option.bipbop10"},{id:"staplebops-01",label:"sound.option.staplebops01"},{id:"staplebops-02",label:"sound.option.staplebops02"},{id:"staplebops-03",label:"sound.option.staplebops03"},{id:"staplebops-04",label:"sound.option.staplebops04"},{id:"staplebops-05",label:"sound.option.staplebops05"},{id:"staplebops-06",label:"sound.option.staplebops06"},{id:"staplebops-07",label:"sound.option.staplebops07"},{id:"nope-01",label:"sound.option.nope01"},{id:"nope-02",label:"sound.option.nope02"},{id:"nope-03",label:"sound.option.nope03"},{id:"nope-04",label:"sound.option.nope04"},{id:"nope-05",label:"sound.option.nope05"},{id:"nope-06",label:"sound.option.nope06"},{id:"nope-07",label:"sound.option.nope07"},{id:"nope-08",label:"sound.option.nope08"},{id:"nope-09",label:"sound.option.nope09"},{id:"nope-10",label:"sound.option.nope10"},{id:"nope-11",label:"sound.option.nope11"},{id:"nope-12",label:"sound.option.nope12"},{id:"yup-01",label:"sound.option.yup01"},{id:"yup-02",label:"sound.option.yup02"},{id:"yup-03",label:"sound.option.yup03"},{id:"yup-04",label:"sound.option.yup04"},{id:"yup-05",label:"sound.option.yup05"},{id:"yup-06",label:"sound.option.yup06"}];function wzt(){return jg||(jg=Object.fromEntries(Object.entries(bzt()).flatMap(([e,t])=>{const n=e.split("/").at(-1);return n?[[n.replace(/\.aac$/,""),t]]:[]})),jg)}const tte=new Map;function xzt(e){const t=wzt();if(!e||!(e in t))return Promise.resolve(void 0);const n=e,r=tte.get(n);if(r)return r;const i=t[n]().catch(()=>{});return tte.set(n,i),i}function _zt(e){if(typeof Audio>"u"||!e)return;const t=new Audio(e);return t.play().catch(()=>{}),()=>{t.pause(),t.currentTime=0}}function iU(e){return xzt(e).then(t=>_zt(t))}const nte=500,Mzt=1e3*60*60*24*30;function rte(e){const t=Date.now()-Mzt,n=e.filter(r=>r.time>=t);return n.length<=nte?n:n.slice(n.length-nte)}function Szt(){return{session:{all:{},unseen:{},unseenCount:{},unseenHasError:{}},project:{all:{},unseen:{},unseenCount:{},unseenHasError:{}}}}function ite(e){const t=Szt();return e.forEach(n=>{if(n.session){const r=t.session.all[n.session]??[];if(t.session.all[n.session]=[...r,n],!n.viewed){const i=t.session.unseen[n.session]??[];t.session.unseen[n.session]=[...i,n],t.session.unseenCount[n.session]=i.length+1,n.type==="error"&&(t.session.unseenHasError[n.session]=!0)}}if(n.directory){const r=t.project.all[n.directory]??[];if(t.project.all[n.directory]=[...r,n],!n.viewed){const i=t.project.unseen[n.directory]??[];t.project.unseen[n.directory]=[...i,n],t.project.unseenCount[n.directory]=i.length+1,n.type==="error"&&(t.project.unseenHasError[n.directory]=!0)}}}),t}const{use:Ij,provider:Czt}=Nn({name:"Notification",init:()=>{const e=di(),t=E0(),n=ha(),r=ms(),i=sm(),a=_r(),o=[],s=Z(()=>xo(e.dir)),l=Z(()=>e.id),[c,u,h,m]=Jn(In.global("notification",["notification.v1"]),nt({list:[]})),[g,y]=nt(ite(c.list)),v={pruned:!1,disposed:!1},k=(I,A,D)=>{y(I,"unseen",A,D),y(I,"unseenCount",A,D.length),y(I,"unseenHasError",A,D.some(P=>P.type==="error"))},b=I=>{I.session&&(y("session","all",I.session,(A=[])=>[...A,I]),I.viewed||(y("session","unseen",I.session,(A=[])=>[...A,I]),y("session","unseenCount",I.session,(A=0)=>A+1),I.type==="error"&&y("session","unseenHasError",I.session,!0))),I.directory&&(y("project","all",I.directory,(A=[])=>[...A,I]),I.viewed||(y("project","unseen",I.directory,(A=[])=>[...A,I]),y("project","unseenCount",I.directory,(A=0)=>A+1),I.type==="error"&&y("project","unseenHasError",I.directory,!0)))},x=I=>{if(I.session&&(y("session","all",I.session,(A=[])=>A.filter(D=>D!==I)),!I.viewed)){const A=(g.session.unseen[I.session]??o).filter(D=>D!==I);k("session",I.session,A)}if(I.directory&&(y("project","all",I.directory,(A=[])=>A.filter(D=>D!==I)),!I.viewed)){const A=(g.project.unseen[I.directory]??o).filter(D=>D!==I);k("project",I.directory,A)}};he(()=>{if(!m()||v.pruned)return;v.pruned=!0;const I=rte(c.list);ct(()=>{u("list",I),y(Ct(ite(I),{merge:!1}))})});const w=I=>{const A=rte([...c.list,I]),D=new Set(A),P=c.list.filter(O=>!D.has(O));ct(()=>{D.has(I)&&b(I),P.forEach(O=>x(O)),u("list",A)})},M=async(I,A)=>{if(!A)return;const[D]=n.child(I,{bootstrap:!1}),P=rn.search(D.session,A,O=>O.id);return P.found?D.session[P.index]:t.client.session.get({directory:I,sessionID:A}).then(O=>O.data).catch(()=>{})},_=(I,A)=>{const D=s(),P=l();return!D||!P||!A||I!==D?!1:A===P},C=(I,A,D)=>{const P=A.properties.sessionID;M(I,P).then(O=>{if(v.disposed||!O||O.parentID)return;i.sounds.agentEnabled()&&iU(i.sounds.agent()),w({directory:I,time:D,viewed:_(I,P),type:"turn-complete",session:P});const E=`/${St(I)}/session/${P}`;i.notifications.agent()&&r.notify(a.t("notification.session.responseReady.title"),O.title??P,E)})},L=(I,A,D)=>{const P=A.properties.sessionID;M(I,P).then(O=>{if(v.disposed||O?.parentID)return;i.sounds.errorsEnabled()&&iU(i.sounds.errors());const E="error"in A.properties?A.properties.error:void 0;w({directory:I,time:D,viewed:_(I,P),type:"error",session:P??"global",error:E});const T=O?.title??(typeof E=="string"?E:a.t("notification.session.error.fallbackDescription")),R=P?`/${St(I)}/session/${P}`:`/${St(I)}`;i.notifications.errors()&&r.notify(a.t("notification.session.error.title"),T,R)})},S=t.event.listen(I=>{const A=I.details;if(A.type!=="session.idle"&&A.type!=="session.error")return;const D=I.name,P=Date.now();if(A.type==="session.idle"){C(D,A,P);return}L(D,A,P)});return me(()=>{v.disposed=!0,S()}),{ready:m,session:{all(I){return g.session.all[I]??o},unseen(I){return g.session.unseen[I]??o},unseenCount(I){return g.session.unseenCount[I]??0},unseenHasError(I){return g.session.unseenHasError[I]??!1},markViewed(I){const A=g.session.unseen[I]??o;if(!A.length)return;const D=[...new Set(A.flatMap(P=>P.directory?[P.directory]:[]))];ct(()=>{u("list",P=>P.session===I&&!P.viewed,"viewed",!0),k("session",I,[]),D.forEach(P=>{const O=(g.project.unseen[P]??o).filter(E=>E.session!==I);k("project",P,O)})})}},project:{all(I){return g.project.all[I]??o},unseen(I){return g.project.unseen[I]??o},unseenCount(I){return g.project.unseenCount[I]??0},unseenHasError(I){return g.project.unseenHasError[I]??!1},markViewed(I){const A=g.project.unseen[I]??o;if(!A.length)return;const D=[...new Set(A.flatMap(P=>P.session?[P.session]:[]))];ct(()=>{u("list",P=>P.directory===I&&!P.viewed,"viewed",!0),k("project",I,[]),D.forEach(P=>{const O=(g.session.unseen[P]??o).filter(E=>E.directory!==I);k("session",P,O)})})}}}}});function SR(e,t){return t?`${St(t)}/${e}`:e}function Qp(e){return`${St(e)}/*`}function Lzt(e,t,n){const r=SR(t,n),i=n?Qp(n):void 0;return e[r]??e[t]??(i?e[i]:void 0)}function Izt(e,t){const n=Qp(t);return e[n]??!1}function Nzt(e,t){const n=e.reduce((a,o)=>(o.parentID&&a.set(o.id,o.parentID),a),new Map),r=new Set([t]),i=[t];for(const a of i){const o=n.get(a);!o||r.has(o)||(r.add(o),i.push(o))}return i}function ate(e,t,n,r){return Nzt(t,n.sessionID).map(a=>Lzt(e,a,r)).find(a=>a!==void 0)??!1}function Azt(e){if(!e)return!1;if(typeof e=="string")return e!=="allow";if(typeof e!="object"||Array.isArray(e))return!1;for(const t of Object.values(e))if(t!=="allow")return!0;return!1}function $zt(e){return e?typeof e=="string"?e!=="allow":typeof e!="object"||Array.isArray(e)?!1:Object.values(e).some(Azt):!1}const{use:vK,provider:Tzt}=Nn({name:"Permission",init:()=>{const e=di(),t=E0(),n=ha(),r=Z(()=>{const S=xo(e.dir);if(!S)return!1;const[I]=n.child(S);return $zt(I.config.permission)}),[i,a,o,s]=Jn({...In.global("permission",["permission.v3"]),migrate(S){if(!S||typeof S!="object"||Array.isArray(S))return S;const I=S;return I.autoAccept?S:{...I,autoAccept:typeof I.autoAcceptEdits=="object"&&I.autoAcceptEdits&&!Array.isArray(I.autoAcceptEdits)?I.autoAcceptEdits:{}}}},nt({autoAccept:{}}));he(()=>{if(!s())return;const S=xo(e.dir);if(!S)return;const[I]=n.child(S),A=I.config.permission;if(typeof A=="string"&&A==="allow"){const D=Qp(S);i.autoAccept[D]===void 0&&a(Je(P=>{P.autoAccept[D]=!0}))}});const l=1e3,c=3600*1e3,u=new Map,h=new Map;function m(S){for(const[I,A]of u){if(S-A<c)break;u.delete(I)}for(const I of u.keys()){if(u.size<=l)break;u.delete(I)}}const g=S=>{t.client.permission.respond(S).catch(()=>{u.delete(S.permissionID)})};function y(S,I){const A=Date.now(),D=u.has(S.id);u.delete(S.id),u.set(S.id,A),m(A),!D&&g({sessionID:S.sessionID,permissionID:S.id,response:"once",directory:I})}function v(S,I){const A=I?n.child(I,{bootstrap:!1})[0].session:[];return ate(i.autoAccept,A,{sessionID:S},I)}function k(S){return Izt(i.autoAccept,S)}function b(S,I){const A=I?n.child(I,{bootstrap:!1})[0].session:[];return ate(i.autoAccept,A,S,I)}function x(S,I){const A=SR(S,I),D=(h.get(A)??0)+1;return h.set(A,D),D}const w=t.event.listen(S=>{const I=S.details;if(I?.type!=="permission.asked")return;const A=I.properties;b(A,S.name)&&y(A,S.name)});me(w);function M(S){const I=Qp(S);a(Je(A=>{A.autoAccept[I]=!0})),t.client.permission.list({directory:S}).then(A=>{if(k(S))for(const D of A.data??[])D?.id&&b(D,S)&&y(D,S)}).catch(()=>{})}function _(S){const I=Qp(S);a(Je(A=>{A.autoAccept[I]=!1}))}function C(S,I){const A=SR(S,I),D=x(S,I);a(Je(P=>{P.autoAccept[A]=!0,delete P.autoAccept[S]})),t.client.permission.list({directory:I}).then(P=>{if(h.get(A)===D&&v(S,I))for(const O of P.data??[])O?.id&&b(O,I)&&y(O,I)}).catch(()=>{})}function L(S,I){x(S,I);const A=I?SR(S,I):S;a(Je(D=>{D.autoAccept[A]=!1,I&&delete D.autoAccept[S]}))}return{ready:s,respond:g,autoResponds(S,I){return b(S,I)},isAutoAccepting:v,isAutoAcceptingDirectory:k,toggleAutoAccept(S,I){if(v(S,I)){L(S,I);return}C(S,I)},toggleAutoAcceptDirectory(S){if(k(S)){_(S);return}M(S)},enableAutoAccept(S,I){v(S,I)||C(S,I)},disableAutoAccept(S,I){L(S,I)},permissionsEnabled:r,isPermissionAllowAll(S){const[I]=n.child(S),A=I.config.permission;return typeof A=="string"&&A==="allow"}}}}),aU=[{type:"text",content:"",start:0,end:0}];function Ezt(e,t){return!e&&!t?!0:!e||!t?!1:e.startLine===t.startLine&&e.startChar===t.startChar&&e.endLine===t.endLine&&e.endChar===t.endChar}function Pzt(e,t){switch(e.type){case"text":return t.type==="text"&&e.content===t.content;case"file":return t.type==="file"&&e.path===t.path&&Ezt(e.selection,t.selection);case"agent":return t.type==="agent"&&e.name===t.name;case"entity":return t.type==="entity"&&e.entityType===t.entityType&&e.entityId===t.entityId;case"image":return t.type==="image"&&e.id===t.id}}function Dzt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Pzt(e[n],t[n]))return!1;return!0}function Ozt(e){if(e)return{...e}}function Rzt(e){return e.type==="text"?{...e}:e.type==="image"?{...e}:e.type==="agent"?{...e}:e.type==="entity"?{...e}:{...e,selection:Ozt(e.selection)}}function oU(e){return e.map(Rzt)}function PF(e){if(e.type!=="file")return e.type;const t=e.selection?.startLine,n=e.selection?.endLine,r=`${e.type}:${e.path}:${t}:${n}`;if(e.commentID)return`${r}:c=${e.commentID}`;const i=e.comment?.trim();if(!i)return r;const a=Wh(i)??i;return`${r}:c=${a.slice(0,8)}`}function zzt(e){return e.type==="file"&&!!e.comment?.trim()}function qzt(e){return{set(t,n){const r=oU(t);ct(()=>{e("prompt",r),n!==void 0&&e("cursor",n)})},reset(){ct(()=>{e("prompt",oU(aU)),e("cursor",0)})}}}const jzt="__workspace__",Hzt=20;function Fzt(e,t){const n=`${e}/prompt${t?"/"+t:""}.v2`,[r,i,a,o]=Jn(In.scoped(e,t,"prompt",[n]),nt({prompt:oU(aU),cursor:void 0,context:{items:[]}})),s=qzt(i);return{ready:o,current:Z(()=>r.prompt),cursor:Z(()=>r.cursor),dirty:Z(()=>!Dzt(r.prompt,aU)),context:{items:Z(()=>r.context.items),add(l){const c=PF(l);r.context.items.find(u=>u.key===c)||i("context","items",u=>[...u,{key:c,...l}])},remove(l){i("context","items",c=>c.filter(u=>u.key!==l))},removeComment(l,c){i("context","items",u=>u.filter(h=>!(h.type==="file"&&h.path===l&&h.commentID===c)))},updateComment(l,c,u){i("context","items",h=>h.map(m=>{if(m.type!=="file"||m.path!==l||m.commentID!==c)return m;const g={...m,...u};return{...g,key:PF(g)}}))},replaceComments(l){i("context","items",c=>[...c.filter(u=>!zzt(u)),...l.map(u=>({...u,key:PF(u)}))])}},set:s.set,reset:s.reset}}const{use:fQt,provider:Vzt}=Nn({name:"Prompt",gate:!1,init:()=>{const e=di(),t=new Map;me(()=>{for(const l of t.values())l.dispose();t.clear()});const r=()=>{for(;t.size>Hzt;){const l=t.keys().next().value;if(!l)return;t.get(l)?.dispose(),t.delete(l)}},i=qa(),a=(l,c)=>{const u=`${l}:${c??jzt}`,h=t.get(u);if(h)return t.delete(u),t.set(u,h),h.value;const m=wr(g=>({value:Fzt(l,c),dispose:g}),i);return t.set(u,m),r(),m.value},o=Z(()=>a(e.dir,e.id)),s=l=>l?a(l.dir,l.id):o();return{ready:()=>o().ready(),current:()=>o().current(),cursor:()=>o().cursor(),dirty:()=>o().dirty(),context:{items:()=>o().context.items(),add:l=>o().context.add(l),remove:l=>o().context.remove(l),removeComment:(l,c)=>o().context.removeComment(l,c),updateComment:(l,c,u)=>o().context.updateComment(l,c,u),replaceComments:l=>o().context.replaceComments(l)},set:(l,c,u)=>s(u).set(l,c),reset:l=>s(l).reset()}}}),Xfe="Terminal {{number}}",Bzt=[Xfe,"محطة طرفية {{number}}","Терминал {{number}}","ターミナル {{number}}","터미널 {{number}}","เทอร์มินัล {{number}}","终端 {{number}}","終端機 {{number}}"];function ote(e){return Xfe.replace("{{number}}",String(e))}function Uzt(e,t){return Bzt.some(n=>e===n.replace("{{number}}",String(t)))}function Wzt(e,t){return Array.from({length:t},(n,r)=>r+1).find(n=>Uzt(e,n))}const Gzt="__workspace__",Yfe=20;function Jfe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function CR(e){return typeof e=="string"?e:void 0}function hp(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Qfe(e){return Wzt(e,Yfe)}function Zzt(e){if(!Jfe(e))return;const t=CR(e.id);if(!t)return;const n=CR(e.title)??"",r=hp(e.titleNumber),i=hp(e.rows),a=hp(e.cols),o=CR(e.buffer),s=hp(e.scrollY),l=hp(e.cursor);return{id:t,title:n,titleNumber:r&&r>0?r:Qfe(n)??0,...i!==void 0?{rows:i}:{},...a!==void 0?{cols:a}:{},...o!==void 0?{buffer:o}:{},...s!==void 0?{scrollY:s}:{},...l!==void 0?{cursor:l}:{}}}function Kzt(e){if(!Jfe(e))return e;const t=new Set,n=(Array.isArray(e.all)?e.all:[]).flatMap(i=>{const a=Zzt(i);return!a||t.has(a.id)?[]:(t.add(a.id),[a])}),r=CR(e.active);return{active:r&&t.has(r)?r:n[0]?.id,all:n}}function epe(e){return`${e}:${Gzt}`}function sU(e,t){return t?[`${e}/terminal/${t}.v1`,`${e}/terminal.v1`]:[`${e}/terminal.v1`]}const lU=new Set,DF=e=>!e.buffer&&e.cursor===void 0&&e.scrollY===void 0?e:{...e,buffer:void 0,cursor:void 0,scrollY:void 0};function Xzt(e,t,n){const r=epe(e);for(const a of lU)a.get(r)?.value.clear();Mz(In.workspace(e,"terminal"),n);const i=new Set(sU(e));for(const a of t??[])for(const o of sU(e,a))i.add(o);for(const a of i)Mz({key:a},n)}function Yzt(e,t,n){const r=xo(t)??t,i=r.replace(/\/+$/,"").split("/").at(-1)||r.split("\\").at(-1)||r,a=sU(t,n),[o,s,l,c]=Jn({...In.workspace(t,"terminal",a),migrate:Kzt},nt({all:[]})),u=()=>{const w=new Set(o.all.flatMap(M=>{const _=Number.isFinite(M.titleNumber)&&M.titleNumber>0?M.titleNumber:void 0;if(_!==void 0)return[_];const C=Qfe(M.title);return C===void 0?[]:[C]}));return Array.from({length:w.size+1},(M,_)=>_+1).find(M=>!w.has(M))??1},h=w=>{const M=o.all,_=M.findIndex(L=>L.id===w);if(_===-1)return;const C=o.active===w?_===0?M[1]?.id:M[0]?.id:o.active;ct(()=>{s("active",C),s("all",Je(L=>{L.splice(_,1)}))})},m=e.event.on("pty.exited",w=>{h(w.properties.id)});me(m);const g=(w,M)=>{const _=o.all.findIndex(L=>L.id===M.id),C=_>=0?o.all[_]:void 0;_>=0&&s("all",_,L=>({...L,...M})),w.pty.update({ptyID:M.id,title:M.title,size:M.cols&&M.rows?{rows:M.rows,cols:M.cols}:void 0}).catch(L=>{if(C){const S=o.all.findIndex(I=>I.id===M.id);S>=0&&s("all",S,C)}console.error("Failed to update terminal",L)})},y=async(w,M)=>{const _=o.all.findIndex(I=>I.id===M),C=o.all[_];if(!C)return;const L=await w.pty.create({title:C.title}).catch(I=>{console.error("Failed to clone terminal",I)});if(!L?.data)return;const S=o.active===C.id;ct(()=>{s("all",_,{id:L.data.id,title:L.data.title??C.title,titleNumber:C.titleNumber,buffer:void 0,cursor:void 0,scrollY:void 0,rows:void 0,cols:void 0}),S&&s("active",L.data.id)})},v=(w,M,_=null,C=null)=>w.type==="leaf"?null:w.a.type==="leaf"&&w.a.ptyId===M?{parent:w,grandparent:_,parentSide:C,leafSide:"a"}:w.b.type==="leaf"&&w.b.ptyId===M?{parent:w,grandparent:_,parentSide:C,leafSide:"b"}:v(w.a,M,w,"a")??v(w.b,M,w,"b"),k=(w,M,_)=>w.type==="leaf"?w.ptyId===M?_:w:{...w,a:k(w.a,M,_),b:k(w.b,M,_)},b=(w,M,_)=>w===M?_:w.type==="leaf"?w:{...w,a:b(w.a,M,_),b:b(w.b,M,_)},x=w=>w.type==="leaf"?[w.ptyId]:[...x(w.a),...x(w.b)];return{ready:c,all:Z(()=>o.all),active:Z(()=>o.active),clear(){ct(()=>{s("active",void 0),s("all",[])})},new(){const w=u(),M=i||ote(w);e.client.pty.create({title:M}).then(_=>{const C=_.data?.id;if(!C)return;const L={id:C,title:_.data?.title??M,titleNumber:w};s("all",o.all.length,L),s("active",C)}).catch(_=>{console.error("Failed to create terminal",_)})},update(w){g(e.client,w)},trim(w){const M=o.all.findIndex(_=>_.id===w);M!==-1&&s("all",M,_=>DF(_))},trimAll(){s("all",w=>{const M=w.map(DF);return M.every((_,C)=>_===w[C])?w:M})},async clone(w){await y(e.client,w)},bind(){const w=e.client;return{trim(M){const _=o.all.findIndex(C=>C.id===M);_!==-1&&s("all",_,C=>DF(C))},update(M){g(w,M)},async clone(M){await y(w,M)}}},open(w){s("active",w)},next(){const w=o.all.findIndex(_=>_.id===o.active);if(w===-1)return;const M=(w+1)%o.all.length;s("active",o.all[M]?.id)},previous(){const w=o.all.findIndex(_=>_.id===o.active);if(w===-1)return;const M=w===0?o.all.length-1:w-1;s("active",o.all[M]?.id)},async close(w){const M=o.all.findIndex(_=>_.id===w);M!==-1&&ct(()=>{if(o.active===w){const _=M>0?o.all[M-1]?.id:o.all[1]?.id;s("active",_)}s("all",Je(_=>{_.splice(M,1)}))}),await e.client.pty.remove({ptyID:w}).catch(_=>{console.error("Failed to close terminal",_)})},move(w,M){const _=o.all.findIndex(C=>C.id===w);_!==-1&&s("all",Je(C=>{C.splice(M,0,C.splice(_,1)[0])}))},paneTree:Z(()=>o.paneTree),focusedPane:Z(()=>o.focusedPane??o.active),focusPane(w){s("focusedPane",w)},async split(w,M){const _=u(),C=i||ote(_),L=await e.client.pty.create({title:C}).catch(E=>{console.error("Failed to create terminal for split",E)});if(!L?.data?.id)return;const S={id:L.data.id,title:L.data.title??C,titleNumber:_},I={type:"leaf",ptyId:L.data.id},D={type:"split",direction:M,ratio:.5,a:{type:"leaf",ptyId:w},b:I},P=o.paneTree,O=P?k(P,w,D):D;ct(()=>{s("all",o.all.length,S),s("paneTree",O),s("focusedPane",L.data.id)})},unsplit(w){const M=o.paneTree;if(!M)return;const _=v(M,w);if(!_)return;const{parent:C,leafSide:L}=_,S=L==="a"?C.b:C.a,I=x(S),A=M===C?S:b(M,C,S),D=A.type==="leaf"?void 0:A;ct(()=>{s("paneTree",D),o.focusedPane===w&&s("focusedPane",I[0]),s("all",P=>P.filter(O=>O.id!==w))}),e.client.pty.remove({ptyID:w}).catch(P=>{console.error("Failed to close split pane PTY",P)})},resizePane(w,M){const _=o.paneTree;if(!_)return;const C=v(_,w);if(!C)return;const{parent:L}=C,S=I=>I.type==="leaf"?I:I===L?{...I,ratio:Math.min(.9,Math.max(.1,M))}:{...I,a:S(I.a),b:S(I.b)};s("paneTree",S(_))}}}const{use:pQt,provider:Jzt}=Nn({name:"Terminal",gate:!1,init:()=>{const e=Cf(),t=di(),n=new Map;lU.add(n),me(()=>lU.delete(n)),me(()=>{for(const s of n.values())s.dispose();n.clear()});const i=()=>{for(;n.size>Yfe;){const s=n.keys().next().value;if(!s)return;n.get(s)?.dispose(),n.delete(s)}},a=(s,l)=>{const c=epe(s),u=n.get(c);if(u)return n.delete(c),n.set(c,u),u.value;const h=wr(m=>({value:Yzt(e,s,l),dispose:m}));return n.set(c,h),i(),h.value},o=Z(()=>a(t.dir,t.id));return he(vn(()=>({dir:t.dir,id:t.id}),(s,l)=>{l?.dir&&(s.dir===l.dir&&s.id===l.id||s.dir===l.dir&&s.id||a(l.dir,l.id).trimAll())},{defer:!0})),{ready:()=>o().ready(),all:()=>o().all(),active:()=>o().active(),new:()=>o().new(),update:s=>o().update(s),trim:s=>o().trim(s),trimAll:()=>o().trimAll(),clone:s=>o().clone(s),bind:()=>o(),open:s=>o().open(s),close:s=>o().close(s),move:(s,l)=>o().move(s,l),next:()=>o().next(),previous:()=>o().previous(),paneTree:()=>o().paneTree(),focusedPane:()=>o().focusedPane(),focusPane:s=>o().focusPane(s),split:(s,l)=>o().split(s,l),unsplit:s=>o().unsplit(s),resizePane:(s,l)=>o().resizePane(s,l)}}}),Qzt="/auth/callback",Hg="auth.pendingPrompt",OF="auth.pkceVerifier";function ste(){return`${window.location.origin}${Qzt}`}function eqt(e){try{const t=e.split(".");if(t.length!==3)return{};const n=atob(t[1].replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(n)}catch{return{}}}const kK=Tt();function tqt(e){const t=T0(),n=void 0,[r,i]=Jn(In.global("auth.state"),nt({ready:!1}));dn(()=>{i("ready",!0),r.state&&r.state.expires<Date.now()&&n&&a()});async function a(){if(!(!n||!r.state?.refresh))try{const k=await n.refresh(r.state.refresh,{access:r.state.access});if(k.err){i("state",void 0);return}k.tokens&&i("state",{...r.state,access:k.tokens.access,refresh:k.tokens.refresh,expires:Date.now()+3600*1e3})}catch{i("state",void 0)}}const o=Z(()=>{if(r.state)return{accountID:r.state.accountID,email:r.state.email}}),s=Z(()=>!!r.state),l=Z(()=>n?!t.isLocal():!1),c=Z(()=>{if(r.state)return r.state.expires<Date.now()&&a(),r.state.access});async function u(k){if(!n)return;k&&localStorage.setItem(Hg,k);const{challenge:b,url:x}=await n.authorize(ste(),"code",{pkce:!0,provider:"github"});b.verifier&&localStorage.setItem(OF,b.verifier),window.location.href=x}function h(){i("state",void 0),localStorage.removeItem(Hg)}async function m(k){if(!n)return;const b=localStorage.getItem(OF)??void 0;localStorage.removeItem(OF);const x=await n.exchange(k,ste(),b);if(x.err){console.error("Auth exchange failed:",x.err);return}const w=eqt(x.tokens.access),_=w.sub?.properties??w;return i("state",{access:x.tokens.access,refresh:x.tokens.refresh,expires:Date.now()+3600*1e3,accountID:_.accountID??"",email:_.email??""}),g()}function g(){return localStorage.getItem(Hg)??void 0}function y(){localStorage.removeItem(Hg)}const v={user:o,isAuthenticated:s,isAuthRequired:l,token:c,login:u,logout:h,handleCallback:m,pendingPrompt:g,clearPendingPrompt:y,ready:()=>r.ready};return d(kK.Provider,{value:v,get children(){return e.children}})}function mQt(){const e=Lt(kK);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function gQt(){return Lt(kK)}const lte=e=>{if(e)return{...e,model:e.model?{...e.model}:e.model}};let Fg;const tpe=()=>typeof window>"u"?!1:window.__opencode_e2e?.model?.enabled===!0,RF=()=>{if(tpe())return window.__opencode_e2e?.model},zF={bind(e,t){const n=RF();n&&(Fg=e,n.controls=t)},set(e,t){const n=RF();!n||Fg!==e||(n.current={...t,model:t.model?{...t.model}:void 0,last:t.last?{...t.last,model:t.last.model?{...t.last.model}:t.last.model}:void 0,pick:lte(t.pick),base:lte(t.base),variants:t.variants?.slice(),models:t.models?.map(r=>({...r})),agents:t.agents?.map(r=>({...r}))})},clear(e){const t=RF();!t||Fg!==e||(Fg=void 0,t.current=void 0,t.controls=void 0)}};function nqt(e){if(e.agent?.variant&&e.agent.model&&e.model?.variants&&e.agent.model.providerID===e.model.providerID&&e.agent.model.modelID===e.model.modelID&&e.agent.variant in e.model.variants)return e.agent.variant}function rqt(e){if(e.selected!==null){if(e.selected&&e.variants.includes(e.selected))return e.selected;if(e.configured&&e.variants.includes(e.configured))return e.configured}}function iqt(e){if(e.variants.length!==0){if(e.selected===null)return e.variants[0];if(e.selected&&e.variants.includes(e.selected)){const t=e.variants.indexOf(e.selected);return t===e.variants.length-1?void 0:e.variants[t+1]}if(e.configured&&e.variants.includes(e.configured)){const t=e.variants.indexOf(e.configured);return t===e.variants.length-1?e.variants[0]:e.variants[t+1]}return e.variants[0]}}const aqt="__workspace__",rh=new Map,Vg=(e,t)=>`${e}
|
|
2523
|
-
${t}`,oqt=e=>{if(!e||typeof e!="object")return{session:{}};const t=e;return t.session&&typeof t.session=="object"?{session:t.session}:!t.pick||typeof t.pick!="object"?{session:{}}:{session:Object.fromEntries(Object.entries(t.pick).filter(([n])=>n!==aqt))}},cte=e=>{if(e)return{...e,model:e.model?{...e.model}:void 0}},{use:yQt,provider:sqt}=Nn({name:"Local",init:()=>{const e=di(),t=Cf(),n=xj(),r=yK(),i=vzt(),a=Z(()=>e.id||void 0),o=Z(()=>n.data.agent.filter(O=>O.mode!=="subagent"&&!O.hidden)),s=Z(()=>new Set(r.connected().map(O=>O.id))),[l,c]=Jn({...In.workspace(t.directory,"model-selection",["model-selection.v1"]),migrate:oqt},nt({session:{}})),[u,h]=nt({current:o()[0]?.name,draft:void 0,last:void 0}),m=O=>!!r.all().find(T=>T.id===O.providerID)?.models[O.modelID]&&s().has(O.providerID),g=(...O)=>{for(const E of O){const T=E();if(T&&m(T))return T}},y=O=>{const E=o();if(E.length!==0)return E.find(T=>T.name===O)??E[0]};he(()=>{const O=o();if(O.length===0){u.current!==void 0&&h("current",void 0);return}O.some(E=>E.name===u.current)||h("current",O[0]?.name)});const v=Z(()=>{const O=a();return O?l.session[O]??rh.get(Vg(t.directory,O)):u.draft});he(()=>{const O=a();if(!O)return;const E=Vg(t.directory,O),T=rh.get(E);if(T){if(l.session[O]!==void 0){rh.delete(E);return}c("session",O,cte(T)),rh.delete(E)}});const k=()=>{if(!n.data.config.model)return;const[O,E]=n.data.config.model.split("/"),T={providerID:O,modelID:E};if(m(T))return T},b=()=>{for(const O of i.recent.list())if(m(O))return O},x=()=>{const O=r.default();for(const E of r.connected()){const T=O[E.id];if(T){const Y={providerID:E.id,modelID:T};if(m(Y))return Y}const R=Object.values(E.models)[0];if(!R)continue;const H={providerID:E.id,modelID:R.id};if(m(H))return H}},w=Z(()=>k()??b()??x()),M={list:o,current(){return y(v()?.agent??u.current)},set(O){const E=y(O);if(!E){h("current",void 0);return}ct(()=>{h("current",E.name),h("last",{type:"agent",agent:E.name,model:E.model,variant:E.variant??null});const T=v(),R={agent:E.name,model:E.model??T?.model,variant:E.variant??T?.variant},H=a();if(H){c("session",H,R);return}h("draft",R)})},move(O){const E=o();if(E.length===0){h("current",void 0);return}let T=E.findIndex(H=>H.name===M.current()?.name)+O;T<0&&(T=E.length-1),T>=E.length&&(T=0);const R=E[T];R&&M.set(R.name)}},_=()=>{const O=g(()=>v()?.model,()=>M.current()?.model,w);if(O)return i.find(O)},C=()=>{const O=M.current(),E=_();if(!(!O||!E))return nqt({agent:{model:O.model,variant:O.variant},model:{providerID:E.provider.id,modelID:E.id,variants:E.variants}})},L=()=>v()?.variant,S=()=>{const O=_();return{agent:M.current()?.name,model:O?{providerID:O.provider.id,modelID:O.id}:void 0,variant:L()}},I=O=>{const E={...v()??{agent:M.current()?.name},...O},T=a();if(T){c("session",T,E);return}h("draft",E)},A=Z(()=>i.recent.list().map(i.find).filter(Boolean)),D={ready:i.ready,current:_,recent:A,list:i.list,cycle(O){const E=A(),T=_();if(!T)return;const R=E.findIndex(j=>j?.provider.id===T.provider.id&&j?.id===T.id);if(R===-1)return;let H=R+O;H<0&&(H=E.length-1),H>=E.length&&(H=0);const Y=E[H];Y&&D.set({providerID:Y.provider.id,modelID:Y.id})},set(O,E){ct(()=>{h("last",{type:"model",agent:M.current()?.name,model:O??null,variant:L()}),I({model:O}),O&&(i.setVisibility(O,!0),E?.recent&&i.recent.push(O))})},visible(O){return i.visible(O)},setVisibility(O,E){i.setVisibility(O,E)},variant:{configured:C,selected:L,current(){return rqt({variants:this.list(),selected:this.selected(),configured:this.configured()})},list(){const O=_();return O?.variants?Object.keys(O.variants):[]},set(O){ct(()=>{const E=_();h("last",{type:"variant",agent:M.current()?.name,model:E?{providerID:E.provider.id,modelID:E.id}:null,variant:O??null}),I({variant:O??null})})},cycle(){const O=this.list();O.length!==0&&this.set(iqt({variants:O,selected:this.selected(),configured:this.configured()}))}}},P={slug:Z(()=>St(t.directory)),model:D,agent:M,session:{reset(){h("draft",void 0)},promote(O,E){const T=cte(S());if(T){if(O===t.directory){c("session",E,T),h("draft",void 0);return}rh.set(Vg(O,E),T),h("draft",void 0)}},restore(O){const E=a();E&&O.sessionID===E&&l.session[E]===void 0&&(rh.has(Vg(t.directory,E))||c("session",E,{agent:O.agent,model:O.model,variant:O.variant??null}))}}};if(tpe()){const O=Symbol("model-probe");zF.bind(O,{setAgent:M.set,setModel:D.set,setVariant:D.variant.set}),he(()=>{const E=P.agent.current(),T=P.model.current();zF.set(O,{dir:t.directory,sessionID:a(),last:u.last,agent:E?.name,model:T?{providerID:T.provider.id,modelID:T.id,name:T.name}:void 0,variant:P.model.variant.current()??null,selected:P.model.variant.selected(),configured:P.model.variant.configured(),pick:v(),base:void 0,current:u.current,variants:P.model.variant.list(),models:P.model.list().filter(R=>P.model.visible({providerID:R.provider.id,modelID:R.id})).map(R=>({providerID:R.provider.id,modelID:R.id,name:R.name})),agents:P.agent.list().map(R=>({name:R.name}))})}),me(()=>zF.clear(O))}return P}}),bK=Tt();function lqt(e){const[t,n]=Ce(),[r,i]=nt([]),l={activeIssue:t,setActiveIssue:n,jobs:()=>r,addJob:c=>{const u=crypto.randomUUID();return i(Je(h=>h.push({...c,id:u,startedAt:Date.now()}))),u},updateJob:(c,u)=>{i(h=>h.id===c,Je(h=>Object.assign(h,u)))},removeJob:c=>{i(u=>u.filter(h=>h.id!==c))}};return d(bK.Provider,{value:l,get children(){return e.children}})}function cqt(){const e=Lt(bK);if(!e)throw new Error("ActiveTask context must be used within a context provider");return e}function dqt(){return Lt(bK)}const uqt=5e3;function Nj(e,t,n){const r=new URL(`/trellis${n}`,e);return r.searchParams.set("directory",t),r.toString()}function npe(e,t,n,r){return typeof e=="function"?[e,t,n,r]:[fetch,e,t,n]}function rpe(e,t,n,r,i){return typeof e=="function"?[e,t,n,r,i]:[fetch,e,t,n,r]}async function jt(e,t,n,r){const[i,a,o,s]=npe(e,t,n,r),l=await i(Nj(a,o,s));if(!l.ok)return;const c=await l.text();if(c)try{return JSON.parse(c)}catch(u){console.warn(`[trellis] Failed to parse JSON from ${r}:`,u);return}}async function Gt(e,t,n,r,i){const[a,o,s,l,c]=rpe(e,t,n,r,i),u=await a(Nj(o,s,l),{method:"POST",headers:c?{"Content-Type":"application/json"}:void 0,body:c?JSON.stringify(c):void 0});if(u.ok)return u.json()}async function Bg(e,t,n,r,i){const[a,o,s,l,c]=rpe(e,t,n,r,i),u=await a(Nj(o,s,l),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(u.ok)return u.json()}async function dte(e,t,n,r){const[i,a,o,s]=npe(e,t,n,r),l=await i(Nj(a,o,s),{method:"DELETE"});if(l.ok)return l.json()}const ipe=Nn({name:"Trellis",gate:!1,init:()=>{const e=Cf(),t=dqt(),[n,r]=nt({ready:!1,issues:[],ops:[],decisions:[],dogfood:void 0,workUnits:[],cycles:[],milestones:[],roadmaps:[],telos:void 0,planMode:!1,pendingPlan:void 0,suggestions:[]}),i=async(ue,xe,et)=>{const Dt=t?.addJob({type:ue,label:xe,status:"running"});try{const Sr=await et();return Dt&&t?.removeJob(Dt),Sr}catch(Sr){throw Dt&&t?.updateJob(Dt,{status:"error"}),Sr}},a=Z(()=>e.url),o=Z(()=>e.directory),s=e.fetch,l=async()=>{try{const[ue,xe,et,Dt,Sr,xi,fl,Vf,mn,_i]=await Promise.all([jt(s,a(),o(),"/stats"),jt(s,a(),o(),"/issues"),jt(s,a(),o(),"/dogfood"),jt(s,a(),o(),"/workunits"),jt(s,a(),o(),"/cycles"),jt(s,a(),o(),"/milestones"),jt(s,a(),o(),"/roadmaps"),jt(s,a(),o(),"/telos"),jt(s,a(),o(),"/plans/mode"),jt(s,a(),o(),"/watcher/suggestions")]);if(ue&&r("stats",Ct(ue)),xe&&r("issues",Ct(xe,{key:"id"})),Dt&&r("workUnits",Ct(Dt,{key:"id"})),Sr&&r("cycles",Ct(Sr,{key:"id"})),xi&&r("milestones",Ct(xi,{key:"id"})),fl&&r("roadmaps",Ct(fl,{key:"id"})),r("telos",Vf),r("dogfood",et),r("planMode",mn?.active??!1),_i&&r("suggestions",Ct(_i,{key:"id"})),mn?.active){const Bf=await jt(s,a(),o(),"/plans/pending");r("pendingPlan",Bf??void 0)}else r("pendingPlan",void 0);r("ready",!0),r("error",void 0)}catch(ue){r("error",String(ue))}},c=async ue=>n.issues.find(xe=>xe.id===ue),u=async ue=>i("criteria","Running criteria...",async()=>{try{const xe=await s(`${a()}/trellis/issues/${ue}/check?directory=${encodeURIComponent(o())}`,{method:"POST"});if(!xe.ok)throw new Error("Failed to run criteria");return xe.json()}catch{return console.warn("Criteria check endpoint not available, will refresh to get latest status"),{success:!1,error:"Endpoint not available"}}}),h=async(ue,xe)=>{const et=n.issues.findIndex(Sr=>Sr.id===ue);et>=0&&r("issues",et,"status",xe);const Dt=await Bg(s,a(),o(),`/issues/${ue}`,{status:xe});return Dt&&await l(),{success:!!Dt}},m=async(ue,xe)=>{const et=await Bg(s,a(),o(),`/issues/${ue}`,xe);return et&&await l(),et},g=async ue=>{const xe=await Gt(s,a(),o(),`/issues/${ue}/start`);return xe&&await l(),xe},y=async(ue,xe)=>{const et=await Gt(s,a(),o(),`/issues/${ue}/pause`,xe?{note:xe}:void 0);return et&&await l(),et},v=async ue=>{const xe=await Gt(s,a(),o(),`/issues/${ue}/resume`);return xe&&await l(),xe},k=async ue=>{const xe=await Gt(s,a(),o(),`/issues/${ue}/triage`);return xe&&await l(),xe},b=async(ue,xe)=>{const et=await Gt(s,a(),o(),`/issues/${ue}/close`,{confirm:xe});return et&&await l(),et},x=async ue=>{const xe=await Gt(s,a(),o(),`/issues/${ue}/reopen`);return xe&&await l(),xe},w=async(ue,xe)=>{const et=await Gt(s,a(),o(),`/issues/${ue}/assign`,{agent:xe});return et&&await l(),et},M=async(ue,xe,et)=>{const Dt=await Gt(a(),o(),`/issues/${ue}/criteria`,{description:xe,command:et});return Dt&&await l(),Dt},_=async(ue,xe)=>{const et=[];ue&&et.push(`limit=${ue}`),xe&&et.push(`file=${encodeURIComponent(xe)}`);const Dt=et.length?`?${et.join("&")}`:"",Sr=await jt(a(),o(),`/ops${Dt}`);return Sr&&r("ops",Ct(Sr,{key:"hash"})),Sr??[]},C=async ue=>{const xe=[];ue?.tool&&xe.push(`tool=${encodeURIComponent(ue.tool)}`),ue?.agent&&xe.push(`agent=${encodeURIComponent(ue.agent)}`),ue?.limit&&xe.push(`limit=${ue.limit}`);const et=xe.length?`?${xe.join("&")}`:"",Dt=await jt(a(),o(),`/decisions${et}`);return Dt&&r("decisions",Ct(Dt,{key:"id"})),Dt??[]},L=async ue=>await jt(a(),o(),`/decisions/chain/${encodeURIComponent(ue)}`)??[],S=async()=>await jt(a(),o(),"/branches")??[],I=async ue=>Gt(a(),o(),"/branches",{name:ue}),A=async ue=>i("sync",`Switching to ${ue}...`,()=>Gt(a(),o(),"/branches/switch",{name:ue})),D=async()=>await jt(a(),o(),"/milestones")??[],P=async ue=>await jt(a(),o(),`/backlinks/${encodeURIComponent(ue)}`)??[],O=async ue=>await jt(a(),o(),`/refs/${encodeURIComponent(ue)}`)??{outgoing:[],incoming:[]},E=async ue=>jt(a(),o(),`/store/entity/${encodeURIComponent(ue)}`),T=async()=>await jt(a(),o(),"/graph")??{nodes:[],edges:[],hiddenFiles:0,hiddenDirs:0,hiddenNodes:0},R=async(ue,xe)=>Gt(a(),o(),"/sprites",{name:ue,...xe}),H=async ue=>i("sync","Creating milestone...",()=>Gt(a(),o(),"/milestones",{message:ue})),Y=async ue=>{const xe=[];ue?.status&&xe.push(`status=${encodeURIComponent(ue.status)}`),ue?.keyword&&xe.push(`keyword=${encodeURIComponent(ue.keyword)}`),ue?.file&&xe.push(`file=${encodeURIComponent(ue.file)}`),ue?.limit&&xe.push(`limit=${ue.limit}`);const et=xe.length?`?${xe.join("&")}`:"";return await jt(a(),o(),`/garden${et}`)??[]},j=async()=>jt(a(),o(),"/garden/stats"),X=async ue=>Gt(a(),o(),`/garden/${encodeURIComponent(ue)}/revive`),W=async()=>jt(a(),o(),"/eval/summary"),G=async ue=>jt(a(),o(),`/eval/agent/${encodeURIComponent(ue)}`),J=async ue=>jt(a(),o(),`/eval/issue/${encodeURIComponent(ue)}`),oe=async()=>jt(a(),o(),"/dogfood"),de=async()=>i("criteria","Running dogfood eval...",()=>Gt(a(),o(),"/dogfood/run")),ye=async ue=>{const xe=await Gt(a(),o(),"/workunits",ue);return xe&&await l(),xe},ve=async(ue,xe)=>{const et=await Bg(a(),o(),`/workunits/${ue}`,xe);return et&&await l(),et},le=async ue=>{const xe=await dte(a(),o(),`/workunits/${ue}`);return xe&&await l(),xe},pe=async ue=>{const xe=await Gt(a(),o(),"/cycles",ue);return xe&&await l(),xe},Ee=async ue=>{const xe=await Gt(a(),o(),"/milestones",ue);return xe&&await l(),xe},Re=async ue=>{const xe=await Gt(a(),o(),"/roadmaps",ue);return xe&&await l(),xe},wt=async(ue,xe)=>{const et=await Gt(a(),o(),"/telos",{mission:ue,vision:xe});return et&&await l(),et},Ue=async ue=>dte(a(),o(),`/branches/${encodeURIComponent(ue)}`),V=async(ue,xe)=>Gt(a(),o(),`/issues/${ue}/block`,{blockedBy:xe}),Fe=async(ue,xe)=>Gt(a(),o(),`/issues/${ue}/unblock`,{blockedBy:xe}),ze=async ue=>{const xe=await Gt(a(),o(),"/issues",ue);return xe&&await l(),xe},At=async ue=>{const xe=ue?`?status=${encodeURIComponent(ue)}`:"";return await jt(a(),o(),`/plans${xe}`)??[]},De=async(ue,xe)=>{const et=await Gt(a(),o(),"/plans/enter",{title:ue,description:xe});return et&&await l(),et},Nt=async()=>{const ue=await Gt(a(),o(),"/plans/submit");return ue&&await l(),ue},jn=async()=>{const ue=await Gt(a(),o(),"/plans/approve");return ue&&await l(),ue},ui=async ue=>{const xe=await Gt(a(),o(),"/plans/reject",{reason:ue});return xe&&await l(),xe},Mr=async()=>{const ue=await Gt(a(),o(),"/plans/cancel");return ue&&await l(),ue},hi=async ue=>{const xe=await Gt(a(),o(),`/watcher/suggestions/${encodeURIComponent(ue)}/dismiss`);return xe&&await l(),xe},yn=async()=>await jt(a(),o(),"/watcher/rules")??[],Hn=async()=>await jt(a(),o(),"/garden/ideas")??[],en=async ue=>Gt(a(),o(),`/garden/ideas/${encodeURIComponent(ue)}/resurrect`),tn=async ue=>{const xe=ue?`?status=${encodeURIComponent(ue)}`:"";return await jt(a(),o(),`/conversations${xe}`)??[]},Vt=async(ue,xe)=>Gt(a(),o(),"/conversations",{title:ue,...xe}),Ja=async(ue,xe,et)=>{const Dt=await Bg(a(),o(),`/issues/${ue}/criteria/${xe}`,{status:et});return Dt&&await l(),Dt},pa=async ue=>i("criteria","Running criteria...",async()=>{const xe=await Gt(a(),o(),`/issues/${ue}/criteria/run`);return xe&&await l(),xe}),Br=async ue=>jt(a(),o(),`/diff/op/${encodeURIComponent(ue)}`),mr=async(ue,xe)=>{const et=new URLSearchParams;et.set("directory",o()),et.set("a",ue),et.set("b",xe);const Dt=await fetch(`${a()}/trellis/diff/branches?${et}`);if(Dt.ok)return Dt.json()},Ur=async()=>await jt(a(),o(),"/issues/active")??[],fi=async()=>jt(a(),o(),"/workspace/config");let An;he(()=>{a(),o(),l(),An&&clearInterval(An),An=setInterval(l,uqt)}),me(()=>{An&&clearInterval(An)});const ma=Z(()=>n.issues.filter(ue=>ue.status==="in_progress")),hl=Z(()=>{if(n.ops.length!==0)return n.ops[n.ops.length-1]});return{get ready(){return n.ready},get error(){return n.error},get stats(){return n.stats},get issues(){return n.issues},get ops(){return n.ops},get decisions(){return n.decisions},get dogfood(){return n.dogfood},inProgressIssues:ma,latestOp:hl,refresh:l,getIssue:c,runCriteria:u,updateIssueStatus:h,updateIssue:m,createIssue:ze,startIssue:g,pauseIssue:y,resumeIssue:v,triageIssue:k,closeIssue:b,reopenIssue:x,assignIssue:w,addCriterion:M,fetchOps:_,fetchDecisions:C,fetchDecisionChain:L,fetchBranches:S,createBranch:I,switchBranch:A,fetchMilestones:D,createMilestone:H,fetchBacklinks:P,fetchRefs:O,fetchEntity:E,fetchGraph:T,createSprite:R,fetchGarden:Y,fetchGardenStats:j,reviveCluster:X,deleteBranch:Ue,blockIssue:V,unblockIssue:Fe,fetchEvalSummary:W,fetchAgentReport:G,fetchIssueScore:J,fetchDogfood:oe,triggerDogfood:de,createWorkUnit:ye,updateWorkUnit:ve,deleteWorkUnit:le,createCycle:pe,createMilestoneEpic:Ee,createRoadmap:Re,setTelos:wt,get workUnits(){return n.workUnits},get cycles(){return n.cycles},get milestones(){return n.milestones},get roadmaps(){return n.roadmaps},get telos(){return n.telos},get planMode(){return n.planMode},get pendingPlan(){return n.pendingPlan},get suggestions(){return n.suggestions},fetchPlans:At,enterPlanMode:De,submitPlan:Nt,approvePlan:jn,rejectPlan:ui,cancelPlan:Mr,dismissSuggestion:hi,fetchWatcherRules:yn,fetchIdeas:Hn,resurrectIdea:en,fetchConversations:tn,createConversation:Vt,setCriterionStatus:Ja,runAllCriteria:pa,diffFromOp:Br,diffBranches:mr,fetchActiveIssues:Ur,fetchWorkspaceConfig:fi}}}),ape=ipe.use,hqt=ipe.provider;function ope(){try{return ape()}catch{return}}var fqt=ie("<input data-component=inline-input>");function LR(e){const[t,n]=Se(e,["class","width","style"]),r=()=>t.style?typeof t.style=="string"?t.width?`${t.style};width:${t.width}`:t.style:t.width?{...t.style,width:t.width}:t.style:{width:t.width};return(()=>{var i=fqt();return ki(i,f({get class(){return t.class},get style(){return r()}},n),!1,!1),i})()}/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:spe,setPrototypeOf:ute,isFrozen:pqt,getPrototypeOf:mqt,getOwnPropertyDescriptor:gqt}=Object;let{freeze:ai,seal:da,create:cU}=Object,{apply:dU,construct:uU}=typeof Reflect<"u"&&Reflect;ai||(ai=function(t){return t});da||(da=function(t){return t});dU||(dU=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];return t.apply(n,i)});uU||(uU=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const Ug=oi(Array.prototype.forEach),yqt=oi(Array.prototype.lastIndexOf),hte=oi(Array.prototype.pop),fp=oi(Array.prototype.push),vqt=oi(Array.prototype.splice),IR=oi(String.prototype.toLowerCase),qF=oi(String.prototype.toString),jF=oi(String.prototype.match),pp=oi(String.prototype.replace),kqt=oi(String.prototype.indexOf),bqt=oi(String.prototype.trim),Sa=oi(Object.prototype.hasOwnProperty),Gr=oi(RegExp.prototype.test),mp=wqt(TypeError);function oi(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return dU(e,t,r)}}function wqt(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return uU(e,n)}}function $t(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:IR;ute&&ute(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(pqt(t)||(t[r]=a),i=a)}e[i]=!0}return e}function xqt(e){for(let t=0;t<e.length;t++)Sa(e,t)||(e[t]=null);return e}function uo(e){const t=cU(null);for(const[n,r]of spe(e))Sa(e,n)&&(Array.isArray(r)?t[n]=xqt(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=uo(r):t[n]=r);return t}function gp(e,t){for(;e!==null;){const r=gqt(e,t);if(r){if(r.get)return oi(r.get);if(typeof r.value=="function")return oi(r.value)}e=mqt(e)}function n(){return null}return n}const fte=ai(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),HF=ai(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),FF=ai(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),_qt=ai(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),VF=ai(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Mqt=ai(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pte=ai(["#text"]),mte=ai(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),BF=ai(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),gte=ai(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Wg=ai(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Sqt=da(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Cqt=da(/<%[\w\W]*|[\w\W]*%>/gm),Lqt=da(/\$\{[\w\W]*/gm),Iqt=da(/^data-[\-\w.\u00B7-\uFFFF]+$/),Nqt=da(/^aria-[\-\w]+$/),lpe=da(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Aqt=da(/^(?:\w+script|data):/i),$qt=da(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),cpe=da(/^html$/i),Tqt=da(/^[a-z][.\w]*(-[.\w]+)+$/i);var yte=Object.freeze({__proto__:null,ARIA_ATTR:Nqt,ATTR_WHITESPACE:$qt,CUSTOM_ELEMENT:Tqt,DATA_ATTR:Iqt,DOCTYPE_NAME:cpe,ERB_EXPR:Cqt,IS_ALLOWED_URI:lpe,IS_SCRIPT_OR_DATA:Aqt,MUSTACHE_EXPR:Sqt,TMPLIT_EXPR:Lqt});const yp={element:1,text:3,progressingInstruction:7,comment:8,document:9},Eqt=function(){return typeof window>"u"?null:window},Pqt=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},vte=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function dpe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Eqt();const t=We=>dpe(We);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==yp.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:m,trustedTypes:g}=e,y=l.prototype,v=gp(y,"cloneNode"),k=gp(y,"remove"),b=gp(y,"nextSibling"),x=gp(y,"childNodes"),w=gp(y,"parentNode");if(typeof o=="function"){const We=n.createElement("template");We.content&&We.content.ownerDocument&&(n=We.content.ownerDocument)}let M,_="";const{implementation:C,createNodeIterator:L,createDocumentFragment:S,getElementsByTagName:I}=n,{importNode:A}=r;let D=vte();t.isSupported=typeof spe=="function"&&typeof w=="function"&&C&&C.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:P,ERB_EXPR:O,TMPLIT_EXPR:E,DATA_ATTR:T,ARIA_ATTR:R,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:Y,CUSTOM_ELEMENT:j}=yte;let{IS_ALLOWED_URI:X}=yte,W=null;const G=$t({},[...fte,...HF,...FF,...VF,...pte]);let J=null;const oe=$t({},[...mte,...BF,...gte,...Wg]);let de=Object.seal(cU(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ye=null,ve=null;const le=Object.seal(cU(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let pe=!0,Ee=!0,Re=!1,wt=!0,Ue=!1,V=!0,Fe=!1,ze=!1,At=!1,De=!1,Nt=!1,jn=!1,ui=!0,Mr=!1;const hi="user-content-";let yn=!0,Hn=!1,en={},tn=null;const Vt=$t({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ja=null;const pa=$t({},["audio","video","img","source","image","track"]);let Br=null;const mr=$t({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ur="http://www.w3.org/1998/Math/MathML",fi="http://www.w3.org/2000/svg",An="http://www.w3.org/1999/xhtml";let ma=An,hl=!1,ue=null;const xe=$t({},[Ur,fi,An],qF);let et=$t({},["mi","mo","mn","ms","mtext"]),Dt=$t({},["annotation-xml"]);const Sr=$t({},["title","style","font","a","script"]);let xi=null;const fl=["application/xhtml+xml","text/html"],Vf="text/html";let mn=null,_i=null;const Bf=n.createElement("form"),Uf=function(te){return te instanceof RegExp||te instanceof Function},ga=function(){let te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(_i&&_i===te)){if((!te||typeof te!="object")&&(te={}),te=uo(te),xi=fl.indexOf(te.PARSER_MEDIA_TYPE)===-1?Vf:te.PARSER_MEDIA_TYPE,mn=xi==="application/xhtml+xml"?qF:IR,W=Sa(te,"ALLOWED_TAGS")?$t({},te.ALLOWED_TAGS,mn):G,J=Sa(te,"ALLOWED_ATTR")?$t({},te.ALLOWED_ATTR,mn):oe,ue=Sa(te,"ALLOWED_NAMESPACES")?$t({},te.ALLOWED_NAMESPACES,qF):xe,Br=Sa(te,"ADD_URI_SAFE_ATTR")?$t(uo(mr),te.ADD_URI_SAFE_ATTR,mn):mr,Ja=Sa(te,"ADD_DATA_URI_TAGS")?$t(uo(pa),te.ADD_DATA_URI_TAGS,mn):pa,tn=Sa(te,"FORBID_CONTENTS")?$t({},te.FORBID_CONTENTS,mn):Vt,ye=Sa(te,"FORBID_TAGS")?$t({},te.FORBID_TAGS,mn):uo({}),ve=Sa(te,"FORBID_ATTR")?$t({},te.FORBID_ATTR,mn):uo({}),en=Sa(te,"USE_PROFILES")?te.USE_PROFILES:!1,pe=te.ALLOW_ARIA_ATTR!==!1,Ee=te.ALLOW_DATA_ATTR!==!1,Re=te.ALLOW_UNKNOWN_PROTOCOLS||!1,wt=te.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ue=te.SAFE_FOR_TEMPLATES||!1,V=te.SAFE_FOR_XML!==!1,Fe=te.WHOLE_DOCUMENT||!1,De=te.RETURN_DOM||!1,Nt=te.RETURN_DOM_FRAGMENT||!1,jn=te.RETURN_TRUSTED_TYPE||!1,At=te.FORCE_BODY||!1,ui=te.SANITIZE_DOM!==!1,Mr=te.SANITIZE_NAMED_PROPS||!1,yn=te.KEEP_CONTENT!==!1,Hn=te.IN_PLACE||!1,X=te.ALLOWED_URI_REGEXP||lpe,ma=te.NAMESPACE||An,et=te.MATHML_TEXT_INTEGRATION_POINTS||et,Dt=te.HTML_INTEGRATION_POINTS||Dt,de=te.CUSTOM_ELEMENT_HANDLING||{},te.CUSTOM_ELEMENT_HANDLING&&Uf(te.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(de.tagNameCheck=te.CUSTOM_ELEMENT_HANDLING.tagNameCheck),te.CUSTOM_ELEMENT_HANDLING&&Uf(te.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(de.attributeNameCheck=te.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),te.CUSTOM_ELEMENT_HANDLING&&typeof te.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(de.allowCustomizedBuiltInElements=te.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ue&&(Ee=!1),Nt&&(De=!0),en&&(W=$t({},pte),J=[],en.html===!0&&($t(W,fte),$t(J,mte)),en.svg===!0&&($t(W,HF),$t(J,BF),$t(J,Wg)),en.svgFilters===!0&&($t(W,FF),$t(J,BF),$t(J,Wg)),en.mathMl===!0&&($t(W,VF),$t(J,gte),$t(J,Wg))),te.ADD_TAGS&&(typeof te.ADD_TAGS=="function"?le.tagCheck=te.ADD_TAGS:(W===G&&(W=uo(W)),$t(W,te.ADD_TAGS,mn))),te.ADD_ATTR&&(typeof te.ADD_ATTR=="function"?le.attributeCheck=te.ADD_ATTR:(J===oe&&(J=uo(J)),$t(J,te.ADD_ATTR,mn))),te.ADD_URI_SAFE_ATTR&&$t(Br,te.ADD_URI_SAFE_ATTR,mn),te.FORBID_CONTENTS&&(tn===Vt&&(tn=uo(tn)),$t(tn,te.FORBID_CONTENTS,mn)),te.ADD_FORBID_CONTENTS&&(tn===Vt&&(tn=uo(tn)),$t(tn,te.ADD_FORBID_CONTENTS,mn)),yn&&(W["#text"]=!0),Fe&&$t(W,["html","head","body"]),W.table&&($t(W,["tbody"]),delete ye.tbody),te.TRUSTED_TYPES_POLICY){if(typeof te.TRUSTED_TYPES_POLICY.createHTML!="function")throw mp('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof te.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw mp('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=te.TRUSTED_TYPES_POLICY,_=M.createHTML("")}else M===void 0&&(M=Pqt(g,i)),M!==null&&typeof _=="string"&&(_=M.createHTML(""));ai&&ai(te),_i=te}},z0=$t({},[...HF,...FF,..._qt]),Wf=$t({},[...VF,...Mqt]),$m=function(te){let Ne=w(te);(!Ne||!Ne.tagName)&&(Ne={namespaceURI:ma,tagName:"template"});const Ge=IR(te.tagName),an=IR(Ne.tagName);return ue[te.namespaceURI]?te.namespaceURI===fi?Ne.namespaceURI===An?Ge==="svg":Ne.namespaceURI===Ur?Ge==="svg"&&(an==="annotation-xml"||et[an]):!!z0[Ge]:te.namespaceURI===Ur?Ne.namespaceURI===An?Ge==="math":Ne.namespaceURI===fi?Ge==="math"&&Dt[an]:!!Wf[Ge]:te.namespaceURI===An?Ne.namespaceURI===fi&&!Dt[an]||Ne.namespaceURI===Ur&&!et[an]?!1:!Wf[Ge]&&(Sr[Ge]||!z0[Ge]):!!(xi==="application/xhtml+xml"&&ue[te.namespaceURI]):!1},Mi=function(te){fp(t.removed,{element:te});try{w(te).removeChild(te)}catch{k(te)}},ya=function(te,Ne){try{fp(t.removed,{attribute:Ne.getAttributeNode(te),from:Ne})}catch{fp(t.removed,{attribute:null,from:Ne})}if(Ne.removeAttribute(te),te==="is")if(De||Nt)try{Mi(Ne)}catch{}else try{Ne.setAttribute(te,"")}catch{}},Gf=function(te){let Ne=null,Ge=null;if(At)te="<remove></remove>"+te;else{const wn=jF(te,/^[\r\n\t ]+/);Ge=wn&&wn[0]}xi==="application/xhtml+xml"&&ma===An&&(te='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+te+"</body></html>");const an=M?M.createHTML(te):te;if(ma===An)try{Ne=new m().parseFromString(an,xi)}catch{}if(!Ne||!Ne.documentElement){Ne=C.createDocument(ma,"template",null);try{Ne.documentElement.innerHTML=hl?_:an}catch{}}const nr=Ne.body||Ne.documentElement;return te&&Ge&&nr.insertBefore(n.createTextNode(Ge),nr.childNodes[0]||null),ma===An?I.call(Ne,Fe?"html":"body")[0]:Fe?Ne.documentElement:nr},Tm=function(te){return L.call(te.ownerDocument||te,te,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},pl=function(te){return te instanceof h&&(typeof te.nodeName!="string"||typeof te.textContent!="string"||typeof te.removeChild!="function"||!(te.attributes instanceof u)||typeof te.removeAttribute!="function"||typeof te.setAttribute!="function"||typeof te.namespaceURI!="string"||typeof te.insertBefore!="function"||typeof te.hasChildNodes!="function")},ml=function(te){return typeof s=="function"&&te instanceof s};function Bi(We,te,Ne){Ug(We,Ge=>{Ge.call(t,te,Ne,_i)})}const Zf=function(te){let Ne=null;if(Bi(D.beforeSanitizeElements,te,null),pl(te))return Mi(te),!0;const Ge=mn(te.nodeName);if(Bi(D.uponSanitizeElement,te,{tagName:Ge,allowedTags:W}),V&&te.hasChildNodes()&&!ml(te.firstElementChild)&&Gr(/<[/\w!]/g,te.innerHTML)&&Gr(/<[/\w!]/g,te.textContent)||te.nodeType===yp.progressingInstruction||V&&te.nodeType===yp.comment&&Gr(/<[/\w]/g,te.data))return Mi(te),!0;if(!(le.tagCheck instanceof Function&&le.tagCheck(Ge))&&(!W[Ge]||ye[Ge])){if(!ye[Ge]&&Em(Ge)&&(de.tagNameCheck instanceof RegExp&&Gr(de.tagNameCheck,Ge)||de.tagNameCheck instanceof Function&&de.tagNameCheck(Ge)))return!1;if(yn&&!tn[Ge]){const an=w(te)||te.parentNode,nr=x(te)||te.childNodes;if(nr&&an){const wn=nr.length;for(let rr=wn-1;rr>=0;--rr){const va=v(nr[rr],!0);va.__removalCount=(te.__removalCount||0)+1,an.insertBefore(va,b(te))}}}return Mi(te),!0}return te instanceof l&&!$m(te)||(Ge==="noscript"||Ge==="noembed"||Ge==="noframes")&&Gr(/<\/no(script|embed|frames)/i,te.innerHTML)?(Mi(te),!0):(Ue&&te.nodeType===yp.text&&(Ne=te.textContent,Ug([P,O,E],an=>{Ne=pp(Ne,an," ")}),te.textContent!==Ne&&(fp(t.removed,{element:te.cloneNode()}),te.textContent=Ne)),Bi(D.afterSanitizeElements,te,null),!1)},Kf=function(te,Ne,Ge){if(ui&&(Ne==="id"||Ne==="name")&&(Ge in n||Ge in Bf))return!1;if(!(Ee&&!ve[Ne]&&Gr(T,Ne))){if(!(pe&&Gr(R,Ne))){if(!(le.attributeCheck instanceof Function&&le.attributeCheck(Ne,te))){if(!J[Ne]||ve[Ne]){if(!(Em(te)&&(de.tagNameCheck instanceof RegExp&&Gr(de.tagNameCheck,te)||de.tagNameCheck instanceof Function&&de.tagNameCheck(te))&&(de.attributeNameCheck instanceof RegExp&&Gr(de.attributeNameCheck,Ne)||de.attributeNameCheck instanceof Function&&de.attributeNameCheck(Ne,te))||Ne==="is"&&de.allowCustomizedBuiltInElements&&(de.tagNameCheck instanceof RegExp&&Gr(de.tagNameCheck,Ge)||de.tagNameCheck instanceof Function&&de.tagNameCheck(Ge))))return!1}else if(!Br[Ne]){if(!Gr(X,pp(Ge,Y,""))){if(!((Ne==="src"||Ne==="xlink:href"||Ne==="href")&&te!=="script"&&kqt(Ge,"data:")===0&&Ja[te])){if(!(Re&&!Gr(H,pp(Ge,Y,"")))){if(Ge)return!1}}}}}}}return!0},Em=function(te){return te!=="annotation-xml"&&jF(te,j)},gl=function(te){Bi(D.beforeSanitizeAttributes,te,null);const{attributes:Ne}=te;if(!Ne||pl(te))return;const Ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0};let an=Ne.length;for(;an--;){const nr=Ne[an],{name:wn,namespaceURI:rr,value:va}=nr,ks=mn(wn),Xf=va;let ir=wn==="value"?Xf:bqt(Xf);if(Ge.attrName=ks,Ge.attrValue=ir,Ge.keepAttr=!0,Ge.forceKeepAttr=void 0,Bi(D.uponSanitizeAttribute,te,Ge),ir=Ge.attrValue,Mr&&(ks==="id"||ks==="name")&&(ya(wn,te),ir=hi+ir),V&&Gr(/((--!?|])>)|<\/(style|title|textarea)/i,ir)){ya(wn,te);continue}if(ks==="attributename"&&jF(ir,"href")){ya(wn,te);continue}if(Ge.forceKeepAttr)continue;if(!Ge.keepAttr){ya(wn,te);continue}if(!wt&&Gr(/\/>/i,ir)){ya(wn,te);continue}Ue&&Ug([P,O,E],Dm=>{ir=pp(ir,Dm," ")});const Fn=mn(te.nodeName);if(!Kf(Fn,ks,ir)){ya(wn,te);continue}if(M&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!rr)switch(g.getAttributeType(Fn,ks)){case"TrustedHTML":{ir=M.createHTML(ir);break}case"TrustedScriptURL":{ir=M.createScriptURL(ir);break}}if(ir!==Xf)try{rr?te.setAttributeNS(rr,wn,ir):te.setAttribute(wn,ir),pl(te)?Mi(te):hte(t.removed)}catch{ya(wn,te)}}Bi(D.afterSanitizeAttributes,te,null)},Pm=function We(te){let Ne=null;const Ge=Tm(te);for(Bi(D.beforeSanitizeShadowDOM,te,null);Ne=Ge.nextNode();)Bi(D.uponSanitizeShadowNode,Ne,null),Zf(Ne),gl(Ne),Ne.content instanceof a&&We(Ne.content);Bi(D.afterSanitizeShadowDOM,te,null)};return t.sanitize=function(We){let te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ne=null,Ge=null,an=null,nr=null;if(hl=!We,hl&&(We="<!-->"),typeof We!="string"&&!ml(We))if(typeof We.toString=="function"){if(We=We.toString(),typeof We!="string")throw mp("dirty is not a string, aborting")}else throw mp("toString is not a function");if(!t.isSupported)return We;if(ze||ga(te),t.removed=[],typeof We=="string"&&(Hn=!1),Hn){if(We.nodeName){const va=mn(We.nodeName);if(!W[va]||ye[va])throw mp("root node is forbidden and cannot be sanitized in-place")}}else if(We instanceof s)Ne=Gf("<!---->"),Ge=Ne.ownerDocument.importNode(We,!0),Ge.nodeType===yp.element&&Ge.nodeName==="BODY"||Ge.nodeName==="HTML"?Ne=Ge:Ne.appendChild(Ge);else{if(!De&&!Ue&&!Fe&&We.indexOf("<")===-1)return M&&jn?M.createHTML(We):We;if(Ne=Gf(We),!Ne)return De?null:jn?_:""}Ne&&At&&Mi(Ne.firstChild);const wn=Tm(Hn?We:Ne);for(;an=wn.nextNode();)Zf(an),gl(an),an.content instanceof a&&Pm(an.content);if(Hn)return We;if(De){if(Nt)for(nr=S.call(Ne.ownerDocument);Ne.firstChild;)nr.appendChild(Ne.firstChild);else nr=Ne;return(J.shadowroot||J.shadowrootmode)&&(nr=A.call(r,nr,!0)),nr}let rr=Fe?Ne.outerHTML:Ne.innerHTML;return Fe&&W["!doctype"]&&Ne.ownerDocument&&Ne.ownerDocument.doctype&&Ne.ownerDocument.doctype.name&&Gr(cpe,Ne.ownerDocument.doctype.name)&&(rr="<!DOCTYPE "+Ne.ownerDocument.doctype.name+`>
|
|
2522
|
+
`)}function WDt(e,t,n){const r=VDt(e);return r?.length?BDt({releases:r,current:t,previous:n}):[]}const{provider:GDt}=Nn({name:"Highlights",gate:!1,init:()=>{const e=ms(),t=lf(),n=sm(),[r,i,a,o]=Jn("highlights.v1",nt({version:void 0})),[s,l]=nt({from:void 0,to:void 0}),c={started:!1};let u;const h=()=>{u!==void 0&&(clearTimeout(u),u=void 0)},m=()=>{e.version&&i("version",e.version)},g=y=>{if(!n.general.releaseNotes()){m();return}const v=e.fetch??fetch,k=new AbortController;me(()=>{k.abort(),h()}),v(HDt,{signal:k.signal,headers:{Accept:"application/json"}}).then(b=>b.ok?b.json():void 0).then(b=>{if(!b)return;const x=WDt(b,e.version,y);if(!k.signal.aborted){if(x.length===0){m();return}u=setTimeout(()=>{u=void 0,m(),t.show(()=>d(jDt,{highlights:x}))},500)}}).catch(()=>{})};return he(()=>{if(c.started||!o()||!n.ready()||!e.version)return;c.started=!0;const y=r.version;if(!y){i("version",e.version);return}y!==e.version&&(l({from:y,to:e.version}),g(y))}),{ready:o,from:()=>s.from,to:()=>s.to,get last(){return r.version},markSeen:m}}});class P0 extends Error{}class ZDt extends P0{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class KDt extends P0{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class XDt extends P0{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class _h extends P0{}class Uhe extends P0{constructor(t){super(`Invalid unit ${t}`)}}class Pr extends P0{}class Ms extends P0{constructor(){super("Zone is an abstract class")}}const Oe="numeric",Fa="short",zi="long",Hz={year:Oe,month:Oe,day:Oe},Whe={year:Oe,month:Fa,day:Oe},YDt={year:Oe,month:Fa,day:Oe,weekday:Fa},Ghe={year:Oe,month:zi,day:Oe},Zhe={year:Oe,month:zi,day:Oe,weekday:zi},Khe={hour:Oe,minute:Oe},Xhe={hour:Oe,minute:Oe,second:Oe},Yhe={hour:Oe,minute:Oe,second:Oe,timeZoneName:Fa},Jhe={hour:Oe,minute:Oe,second:Oe,timeZoneName:zi},Qhe={hour:Oe,minute:Oe,hourCycle:"h23"},efe={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23"},tfe={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:Fa},nfe={hour:Oe,minute:Oe,second:Oe,hourCycle:"h23",timeZoneName:zi},rfe={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe},ife={year:Oe,month:Oe,day:Oe,hour:Oe,minute:Oe,second:Oe},afe={year:Oe,month:Fa,day:Oe,hour:Oe,minute:Oe},ofe={year:Oe,month:Fa,day:Oe,hour:Oe,minute:Oe,second:Oe},JDt={year:Oe,month:Fa,day:Oe,weekday:Fa,hour:Oe,minute:Oe},sfe={year:Oe,month:zi,day:Oe,hour:Oe,minute:Oe,timeZoneName:Fa},lfe={year:Oe,month:zi,day:Oe,hour:Oe,minute:Oe,second:Oe,timeZoneName:Fa},cfe={year:Oe,month:zi,day:Oe,weekday:zi,hour:Oe,minute:Oe,timeZoneName:zi},dfe={year:Oe,month:zi,day:Oe,weekday:zi,hour:Oe,minute:Oe,second:Oe,timeZoneName:zi};class wm{get type(){throw new Ms}get name(){throw new Ms}get ianaName(){return this.name}get isUniversal(){throw new Ms}offsetName(t,n){throw new Ms}formatOffset(t,n){throw new Ms}offset(t){throw new Ms}equals(t){throw new Ms}get isValid(){throw new Ms}}let SF=null;class _j extends wm{static get instance(){return SF===null&&(SF=new _j),SF}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return wfe(t,n,r)}formatOffset(t,n){return Jp(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}const WB=new Map;function QDt(e){let t=WB.get(e);return t===void 0&&(t=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),WB.set(e,t)),t}const eOt={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function tOt(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,a,o,s,l,c,u]=r;return[o,i,a,s,l,c,u]}function nOt(e,t){const n=e.formatToParts(t),r=[];for(let i=0;i<n.length;i++){const{type:a,value:o}=n[i],s=eOt[a];a==="era"?r[s]=o:st(s)||(r[s]=parseInt(o,10))}return r}const CF=new Map;class hs extends wm{static create(t){let n=CF.get(t);return n===void 0&&CF.set(t,n=new hs(t)),n}static resetCache(){CF.clear(),WB.clear()}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=hs.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return wfe(t,n,r,this.name)}formatOffset(t,n){return Jp(this.offset(t),n)}offset(t){if(!this.valid)return NaN;const n=new Date(t);if(isNaN(n))return NaN;const r=QDt(this.name);let[i,a,o,s,l,c,u]=r.formatToParts?nOt(r,n):tOt(r,n);s==="BC"&&(i=-Math.abs(i)+1);const m=Sj({year:i,month:a,day:o,hour:l===24?0:l,minute:c,second:u,millisecond:0});let g=+n;const y=g%1e3;return g-=y>=0?y:1e3+y,(m-g)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let xee={};function rOt(e,t={}){const n=JSON.stringify([e,t]);let r=xee[n];return r||(r=new Intl.ListFormat(e,t),xee[n]=r),r}const GB=new Map;function ZB(e,t={}){const n=JSON.stringify([e,t]);let r=GB.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),GB.set(n,r)),r}const KB=new Map;function iOt(e,t={}){const n=JSON.stringify([e,t]);let r=KB.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),KB.set(n,r)),r}const XB=new Map;function aOt(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let a=XB.get(i);return a===void 0&&(a=new Intl.RelativeTimeFormat(e,t),XB.set(i,a)),a}let Pp=null;function oOt(){return Pp||(Pp=new Intl.DateTimeFormat().resolvedOptions().locale,Pp)}const YB=new Map;function ufe(e){let t=YB.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),YB.set(e,t)),t}const JB=new Map;function sOt(e){let t=JB.get(e);if(!t){const n=new Intl.Locale(e);t="getWeekInfo"in n?n.getWeekInfo():n.weekInfo,"minimalDays"in t||(t={...hfe,...t}),JB.set(e,t)}return t}function lOt(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,i;try{r=ZB(e).resolvedOptions(),i=e}catch{const l=e.substring(0,n);r=ZB(l).resolvedOptions(),i=l}const{numberingSystem:a,calendar:o}=r;return[i,a,o]}}function cOt(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function dOt(e){const t=[];for(let n=1;n<=12;n++){const r=ot.utc(2009,n,1);t.push(e(r))}return t}function uOt(e){const t=[];for(let n=1;n<=7;n++){const r=ot.utc(2016,11,13+n);t.push(e(r))}return t}function Eg(e,t,n,r){const i=e.listingMode();return i==="error"?null:i==="en"?n(t):r(t)}function hOt(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||ufe(e.locale).numberingSystem==="latn"}class fOt{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:a,...o}=r;if(!n||Object.keys(o).length>0){const s={useGrouping:!1,...r};r.padTo>0&&(s.minimumIntegerDigits=r.padTo),this.inf=iOt(t,s)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):hK(t,3);return Wn(n,this.padTo)}}}class pOt{constructor(t,n,r){this.opts=r,this.originalZone=void 0;let i;if(this.opts.timeZone)this.dt=t;else if(t.zone.type==="fixed"){const o=-1*(t.offset/60),s=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;t.offset!==0&&hs.create(s).valid?(i=s,this.dt=t):(i="UTC",this.dt=t.offset===0?t:t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone)}else t.zone.type==="system"?this.dt=t:t.zone.type==="iana"?(this.dt=t,i=t.zone.name):(i="UTC",this.dt=t.setZone("UTC").plus({minutes:t.offset}),this.originalZone=t.zone);const a={...this.opts};a.timeZone=a.timeZone||i,this.dtf=ZB(n,a)}format(){return this.originalZone?this.formatToParts().map(({value:t})=>t).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const t=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?t.map(n=>{if(n.type==="timeZoneName"){const r=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...n,value:r}}else return n}):t}resolvedOptions(){return this.dtf.resolvedOptions()}}class mOt{constructor(t,n,r){this.opts={style:"long",...r},!n&&kfe()&&(this.rtf=aOt(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):ROt(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}const hfe={firstDay:1,minimalDays:4,weekend:[6,7]};class Yt{static fromOpts(t){return Yt.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,i,a=!1){const o=t||Pn.defaultLocale,s=o||(a?"en-US":oOt()),l=n||Pn.defaultNumberingSystem,c=r||Pn.defaultOutputCalendar,u=eU(i)||Pn.defaultWeekSettings;return new Yt(s,l,c,u,o)}static resetCache(){Pp=null,GB.clear(),KB.clear(),XB.clear(),YB.clear(),JB.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return Yt.create(t,n,r,i)}constructor(t,n,r,i,a){const[o,s,l]=lOt(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||l||null,this.weekSettings=i,this.intl=cOt(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=hOt(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:Yt.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,eU(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1){return Eg(this,t,Mfe,()=>{const r=n?{month:t,day:"numeric"}:{month:t},i=n?"format":"standalone";return this.monthsCache[i][t]||(this.monthsCache[i][t]=dOt(a=>this.extract(a,r,"month"))),this.monthsCache[i][t]})}weekdays(t,n=!1){return Eg(this,t,Lfe,()=>{const r=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},i=n?"format":"standalone";return this.weekdaysCache[i][t]||(this.weekdaysCache[i][t]=uOt(a=>this.extract(a,r,"weekday"))),this.weekdaysCache[i][t]})}meridiems(){return Eg(this,void 0,()=>Ife,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[ot.utc(2016,11,13,9),ot.utc(2016,11,13,19)].map(n=>this.extract(n,t,"dayperiod"))}return this.meridiemCache})}eras(t){return Eg(this,t,Nfe,()=>{const n={era:t};return this.eraCache[t]||(this.eraCache[t]=[ot.utc(-40,1,1),ot.utc(2017,1,1)].map(r=>this.extract(r,n,"era"))),this.eraCache[t]})}extract(t,n,r){const i=this.dtFormatter(t,n),a=i.formatToParts(),o=a.find(s=>s.type.toLowerCase()===r);return o?o.value:null}numberFormatter(t={}){return new fOt(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new pOt(t,this.intl,n)}relFormatter(t={}){return new mOt(this.intl,this.isEnglish(),t)}listFormatter(t={}){return rOt(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||ufe(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:bfe()?sOt(this.locale):hfe}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let LF=null;class ei extends wm{static get utcInstance(){return LF===null&&(LF=new ei(0)),LF}static instance(t){return t===0?ei.utcInstance:new ei(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new ei(Cj(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Jp(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Jp(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Jp(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class gOt extends wm{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Ps(e,t){if(st(e)||e===null)return t;if(e instanceof wm)return e;if(xOt(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?_j.instance:n==="utc"||n==="gmt"?ei.utcInstance:ei.parseSpecifier(n)||hs.create(e)}else return Us(e)?ei.instance(e):typeof e=="object"&&"offset"in e&&typeof e.offset=="function"?e:new gOt(e)}const lK={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},_ee={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},yOt=lK.hanidec.replace(/[\[|\]]/g,"").split("");function vOt(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(lK.hanidec)!==-1)t+=yOt.indexOf(e[n]);else for(const i in _ee){const[a,o]=_ee[i];r>=a&&r<=o&&(t+=r-a)}}return parseInt(t,10)}else return t}const QB=new Map;function kOt(){QB.clear()}function _a({numberingSystem:e},t=""){const n=e||"latn";let r=QB.get(n);r===void 0&&(r=new Map,QB.set(n,r));let i=r.get(t);return i===void 0&&(i=new RegExp(`${lK[n]}${t}`),r.set(t,i)),i}let Mee=()=>Date.now(),See="system",Cee=null,Lee=null,Iee=null,Nee=60,Aee,$ee=null;class Pn{static get now(){return Mee}static set now(t){Mee=t}static set defaultZone(t){See=t}static get defaultZone(){return Ps(See,_j.instance)}static get defaultLocale(){return Cee}static set defaultLocale(t){Cee=t}static get defaultNumberingSystem(){return Lee}static set defaultNumberingSystem(t){Lee=t}static get defaultOutputCalendar(){return Iee}static set defaultOutputCalendar(t){Iee=t}static get defaultWeekSettings(){return $ee}static set defaultWeekSettings(t){$ee=eU(t)}static get twoDigitCutoffYear(){return Nee}static set twoDigitCutoffYear(t){Nee=t%100}static get throwOnInvalid(){return Aee}static set throwOnInvalid(t){Aee=t}static resetCaches(){Yt.resetCache(),hs.resetCache(),ot.resetCache(),kOt()}}class $a{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const ffe=[0,31,59,90,120,151,181,212,243,273,304,334],pfe=[0,31,60,91,121,152,182,213,244,274,305,335];function ea(e,t){return new $a("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function cK(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function mfe(e,t,n){return n+(xm(e)?pfe:ffe)[t-1]}function gfe(e,t){const n=xm(e)?pfe:ffe,r=n.findIndex(a=>a<t),i=t-n[r];return{month:r+1,day:i}}function dK(e,t){return(e-t+7)%7+1}function Fz(e,t=4,n=1){const{year:r,month:i,day:a}=e,o=mfe(r,i,a),s=dK(cK(r,i,a),n);let l=Math.floor((o-s+14-t)/7),c;return l<1?(c=r-1,l=P2(c,t,n)):l>P2(r,t,n)?(c=r+1,l=1):c=r,{weekYear:c,weekNumber:l,weekday:s,...Lj(e)}}function Tee(e,t=4,n=1){const{weekYear:r,weekNumber:i,weekday:a}=e,o=dK(cK(r,1,t),n),s=Oh(r);let l=i*7+a-o-7+t,c;l<1?(c=r-1,l+=Oh(c)):l>s?(c=r+1,l-=Oh(r)):c=r;const{month:u,day:h}=gfe(c,l);return{year:c,month:u,day:h,...Lj(e)}}function IF(e){const{year:t,month:n,day:r}=e,i=mfe(t,n,r);return{year:t,ordinal:i,...Lj(e)}}function Eee(e){const{year:t,ordinal:n}=e,{month:r,day:i}=gfe(t,n);return{year:t,month:r,day:i,...Lj(e)}}function Pee(e,t){if(!st(e.localWeekday)||!st(e.localWeekNumber)||!st(e.localWeekYear)){if(!st(e.weekday)||!st(e.weekNumber)||!st(e.weekYear))throw new _h("Cannot mix locale-based week fields with ISO-based week fields");return st(e.localWeekday)||(e.weekday=e.localWeekday),st(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),st(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function bOt(e,t=4,n=1){const r=Mj(e.weekYear),i=ta(e.weekNumber,1,P2(e.weekYear,t,n)),a=ta(e.weekday,1,7);return r?i?a?!1:ea("weekday",e.weekday):ea("week",e.weekNumber):ea("weekYear",e.weekYear)}function wOt(e){const t=Mj(e.year),n=ta(e.ordinal,1,Oh(e.year));return t?n?!1:ea("ordinal",e.ordinal):ea("year",e.year)}function yfe(e){const t=Mj(e.year),n=ta(e.month,1,12),r=ta(e.day,1,Vz(e.year,e.month));return t?n?r?!1:ea("day",e.day):ea("month",e.month):ea("year",e.year)}function vfe(e){const{hour:t,minute:n,second:r,millisecond:i}=e,a=ta(t,0,23)||t===24&&n===0&&r===0&&i===0,o=ta(n,0,59),s=ta(r,0,59),l=ta(i,0,999);return a?o?s?l?!1:ea("millisecond",i):ea("second",r):ea("minute",n):ea("hour",t)}function st(e){return typeof e>"u"}function Us(e){return typeof e=="number"}function Mj(e){return typeof e=="number"&&e%1===0}function xOt(e){return typeof e=="string"}function _Ot(e){return Object.prototype.toString.call(e)==="[object Date]"}function kfe(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function bfe(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function MOt(e){return Array.isArray(e)?e:[e]}function Dee(e,t,n){if(e.length!==0)return e.reduce((r,i)=>{const a=[t(i),i];return r&&n(r[0],a[0])===r[0]?r:a},null)[1]}function SOt(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function nf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function eU(e){if(e==null)return null;if(typeof e!="object")throw new Pr("Week settings must be an object");if(!ta(e.firstDay,1,7)||!ta(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(t=>!ta(t,1,7)))throw new Pr("Invalid week settings");return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function ta(e,t,n){return Mj(e)&&e>=t&&e<=n}function COt(e,t){return e-t*Math.floor(e/t)}function Wn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function Es(e){if(!(st(e)||e===null||e===""))return parseInt(e,10)}function Ml(e){if(!(st(e)||e===null||e===""))return parseFloat(e)}function uK(e){if(!(st(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function hK(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function xm(e){return e%4===0&&(e%100!==0||e%400===0)}function Oh(e){return xm(e)?366:365}function Vz(e,t){const n=COt(t-1,12)+1,r=e+(t-n)/12;return n===2?xm(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function Sj(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Oee(e,t,n){return-dK(cK(e,1,t),n)+t-1}function P2(e,t=4,n=1){const r=Oee(e,t,n),i=Oee(e+1,t,n);return(Oh(e)-r+i)/7}function tU(e){return e>99?e:e>Pn.twoDigitCutoffYear?1900+e:2e3+e}function wfe(e,t,n,r=null){const i=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(a.timeZone=r);const o={timeZoneName:t,...a},s=new Intl.DateTimeFormat(n,o).formatToParts(i).find(l=>l.type.toLowerCase()==="timezonename");return s?s.value:null}function Cj(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function xfe(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new Pr(`Invalid unit value ${e}`);return t}function Bz(e,t){const n={};for(const r in e)if(nf(e,r)){const i=e[r];if(i==null)continue;n[t(r)]=xfe(i)}return n}function Jp(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${Wn(n,2)}:${Wn(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${Wn(n,2)}${Wn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Lj(e){return SOt(e,["hour","minute","second","millisecond"])}const LOt=["January","February","March","April","May","June","July","August","September","October","November","December"],_fe=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],IOt=["J","F","M","A","M","J","J","A","S","O","N","D"];function Mfe(e){switch(e){case"narrow":return[...IOt];case"short":return[..._fe];case"long":return[...LOt];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const Sfe=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Cfe=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],NOt=["M","T","W","T","F","S","S"];function Lfe(e){switch(e){case"narrow":return[...NOt];case"short":return[...Cfe];case"long":return[...Sfe];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ife=["AM","PM"],AOt=["Before Christ","Anno Domini"],$Ot=["BC","AD"],TOt=["B","A"];function Nfe(e){switch(e){case"narrow":return[...TOt];case"short":return[...$Ot];case"long":return[...AOt];default:return null}}function EOt(e){return Ife[e.hour<12?0:1]}function POt(e,t){return Lfe(t)[e.weekday-1]}function DOt(e,t){return Mfe(t)[e.month-1]}function OOt(e,t){return Nfe(t)[e.year<0?0:1]}function ROt(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&a){const h=e==="days";switch(t){case 1:return h?"tomorrow":`next ${i[e][0]}`;case-1:return h?"yesterday":`last ${i[e][0]}`;case 0:return h?"today":`this ${i[e][0]}`}}const o=Object.is(t,-0)||t<0,s=Math.abs(t),l=s===1,c=i[e],u=r?l?c[1]:c[2]||c[1]:l?i[e][0]:e;return o?`${s} ${u} ago`:`in ${s} ${u}`}function Ree(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const zOt={D:Hz,DD:Whe,DDD:Ghe,DDDD:Zhe,t:Khe,tt:Xhe,ttt:Yhe,tttt:Jhe,T:Qhe,TT:efe,TTT:tfe,TTTT:nfe,f:rfe,ff:afe,fff:sfe,ffff:cfe,F:ife,FF:ofe,FFF:lfe,FFFF:dfe};class Rr{static create(t,n={}){return new Rr(t,n)}static parseFormat(t){let n=null,r="",i=!1;const a=[];for(let o=0;o<t.length;o++){const s=t.charAt(o);s==="'"?(r.length>0&&a.push({literal:i||/^\s+$/.test(r),val:r}),n=null,r="",i=!i):i||s===n?r+=s:(r.length>0&&a.push({literal:/^\s+$/.test(r),val:r}),r=s,n=s)}return r.length>0&&a.push({literal:i||/^\s+$/.test(r),val:r}),a}static macroTokenToFormatOpts(t){return zOt[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}dtFormatter(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n})}formatDateTime(t,n){return this.dtFormatter(t,n).format()}formatDateTimeParts(t,n){return this.dtFormatter(t,n).formatToParts()}formatInterval(t,n){return this.dtFormatter(t.start,n).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n){return this.dtFormatter(t,n).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Wn(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",a=(g,y)=>this.loc.extract(t,g,y),o=g=>t.isOffsetFixed&&t.offset===0&&g.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,g.format):"",s=()=>r?EOt(t):a({hour:"numeric",hourCycle:"h12"},"dayperiod"),l=(g,y)=>r?DOt(t,g):a(y?{month:g}:{month:g,day:"numeric"},"month"),c=(g,y)=>r?POt(t,g):a(y?{weekday:g}:{weekday:g,month:"long",day:"numeric"},"weekday"),u=g=>{const y=Rr.macroTokenToFormatOpts(g);return y?this.formatWithSystemDefault(t,y):g},h=g=>r?OOt(t,g):a({era:g},"era"),m=g=>{switch(g){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return s();case"d":return i?a({day:"numeric"},"day"):this.num(t.day);case"dd":return i?a({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return c("short",!0);case"cccc":return c("long",!0);case"ccccc":return c("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return c("short",!1);case"EEEE":return c("long",!1);case"EEEEE":return c("narrow",!1);case"L":return i?a({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return i?a({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return l("short",!0);case"LLLL":return l("long",!0);case"LLLLL":return l("narrow",!0);case"M":return i?a({month:"numeric"},"month"):this.num(t.month);case"MM":return i?a({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return l("short",!1);case"MMMM":return l("long",!1);case"MMMMM":return l("narrow",!1);case"y":return i?a({year:"numeric"},"year"):this.num(t.year);case"yy":return i?a({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return i?a({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return i?a({year:"numeric"},"year"):this.num(t.year,6);case"G":return h("short");case"GG":return h("long");case"GGGGG":return h("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"n":return this.num(t.localWeekNumber);case"nn":return this.num(t.localWeekNumber,2);case"ii":return this.num(t.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(t.localWeekYear,4);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return u(g)}};return Ree(Rr.parseFormat(n),m)}formatDurationFromString(t,n){const r=l=>{switch(l[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=l=>c=>{const u=r(c);return u?this.num(l.get(u),c.length):c},a=Rr.parseFormat(n),o=a.reduce((l,{literal:c,val:u})=>c?l:l.concat(u),[]),s=t.shiftTo(...o.map(r).filter(l=>l));return Ree(a,i(s))}}const Afe=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Nf(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function Af(...e){return t=>e.reduce(([n,r,i],a)=>{const[o,s,l]=a(t,i);return[{...n,...o},s||r,l]},[{},null,1]).slice(0,2)}function $f(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const i=n.exec(e);if(i)return r(i)}return[null,null]}function $fe(...e){return(t,n)=>{const r={};let i;for(i=0;i<e.length;i++)r[e[i]]=Es(t[n+i]);return[r,null,n+i]}}const Tfe=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,qOt=`(?:${Tfe.source}?(?:\\[(${Afe.source})\\])?)?`,fK=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Efe=RegExp(`${fK.source}${qOt}`),pK=RegExp(`(?:T${Efe.source})?`),jOt=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,HOt=/(\d{4})-?W(\d\d)(?:-?(\d))?/,FOt=/(\d{4})-?(\d{3})/,VOt=$fe("weekYear","weekNumber","weekDay"),BOt=$fe("year","ordinal"),UOt=/(\d{4})-(\d\d)-(\d\d)/,Pfe=RegExp(`${fK.source} ?(?:${Tfe.source}|(${Afe.source}))?`),WOt=RegExp(`(?: ${Pfe.source})?`);function Rh(e,t,n){const r=e[t];return st(r)?n:Es(r)}function GOt(e,t){return[{year:Rh(e,t),month:Rh(e,t+1,1),day:Rh(e,t+2,1)},null,t+3]}function Tf(e,t){return[{hours:Rh(e,t,0),minutes:Rh(e,t+1,0),seconds:Rh(e,t+2,0),milliseconds:uK(e[t+3])},null,t+4]}function _m(e,t){const n=!e[t]&&!e[t+1],r=Cj(e[t+1],e[t+2]),i=n?null:ei.instance(r);return[{},i,t+3]}function Mm(e,t){const n=e[t]?hs.create(e[t]):null;return[{},n,t+1]}const ZOt=RegExp(`^T?${fK.source}$`),KOt=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function XOt(e){const[t,n,r,i,a,o,s,l,c]=e,u=t[0]==="-",h=l&&l[0]==="-",m=(g,y=!1)=>g!==void 0&&(y||g&&u)?-g:g;return[{years:m(Ml(n)),months:m(Ml(r)),weeks:m(Ml(i)),days:m(Ml(a)),hours:m(Ml(o)),minutes:m(Ml(s)),seconds:m(Ml(l),l==="-0"),milliseconds:m(uK(c),h)}]}const YOt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function mK(e,t,n,r,i,a,o){const s={year:t.length===2?tU(Es(t)):Es(t),month:_fe.indexOf(n)+1,day:Es(r),hour:Es(i),minute:Es(a)};return o&&(s.second=Es(o)),e&&(s.weekday=e.length>3?Sfe.indexOf(e)+1:Cfe.indexOf(e)+1),s}const JOt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function QOt(e){const[,t,n,r,i,a,o,s,l,c,u,h]=e,m=mK(t,i,r,n,a,o,s);let g;return l?g=YOt[l]:c?g=0:g=Cj(u,h),[m,new ei(g)]}function eRt(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const tRt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,nRt=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,rRt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function zee(e){const[,t,n,r,i,a,o,s]=e;return[mK(t,i,r,n,a,o,s),ei.utcInstance]}function iRt(e){const[,t,n,r,i,a,o,s]=e;return[mK(t,s,n,r,i,a,o),ei.utcInstance]}const aRt=Nf(jOt,pK),oRt=Nf(HOt,pK),sRt=Nf(FOt,pK),lRt=Nf(Efe),Dfe=Af(GOt,Tf,_m,Mm),cRt=Af(VOt,Tf,_m,Mm),dRt=Af(BOt,Tf,_m,Mm),uRt=Af(Tf,_m,Mm);function hRt(e){return $f(e,[aRt,Dfe],[oRt,cRt],[sRt,dRt],[lRt,uRt])}function fRt(e){return $f(eRt(e),[JOt,QOt])}function pRt(e){return $f(e,[tRt,zee],[nRt,zee],[rRt,iRt])}function mRt(e){return $f(e,[KOt,XOt])}const gRt=Af(Tf);function yRt(e){return $f(e,[ZOt,gRt])}const vRt=Nf(UOt,WOt),kRt=Nf(Pfe),bRt=Af(Tf,_m,Mm);function wRt(e){return $f(e,[vRt,Dfe],[kRt,bRt])}const qee="Invalid Duration",Ofe={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},xRt={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...Ofe},Wi=146097/400,eh=146097/4800,_Rt={years:{quarters:4,months:12,weeks:Wi/7,days:Wi,hours:Wi*24,minutes:Wi*24*60,seconds:Wi*24*60*60,milliseconds:Wi*24*60*60*1e3},quarters:{months:3,weeks:Wi/28,days:Wi/4,hours:Wi*24/4,minutes:Wi*24*60/4,seconds:Wi*24*60*60/4,milliseconds:Wi*24*60*60*1e3/4},months:{weeks:eh/7,days:eh,hours:eh*24,minutes:eh*24*60,seconds:eh*24*60*60,milliseconds:eh*24*60*60*1e3},...Ofe},Z1=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],MRt=Z1.slice(0).reverse();function Ss(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new Ht(r)}function Rfe(e,t){let n=t.milliseconds??0;for(const r of MRt.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function jee(e,t){const n=Rfe(e,t)<0?-1:1;Z1.reduceRight((r,i)=>{if(st(t[i]))return r;if(r){const a=t[r]*n,o=e[i][r],s=Math.floor(a/o);t[i]+=s*n,t[r]-=s*o*n}return i},null),Z1.reduce((r,i)=>{if(st(t[i]))return r;if(r){const a=t[r]%1;t[r]-=a,t[i]+=a*e[r][i]}return i},null)}function SRt(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class Ht{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?_Rt:xRt;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||Yt.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return Ht.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new Pr(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new Ht({values:Bz(t,Ht.normalizeUnit),loc:Yt.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(Us(t))return Ht.fromMillis(t);if(Ht.isDuration(t))return t;if(typeof t=="object")return Ht.fromObject(t);throw new Pr(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=mRt(t);return r?Ht.fromObject(r,n):Ht.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=yRt(t);return r?Ht.fromObject(r,n):Ht.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new Pr("need to specify a reason the Duration is invalid");const r=t instanceof $a?t:new $a(t,n);if(Pn.throwOnInvalid)throw new XDt(r);return new Ht({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new Uhe(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Rr.create(this.loc,r).formatDurationFromString(this,t):qee}toHuman(t={}){if(!this.isValid)return qee;const n=Z1.map(r=>{const i=this.values[r];return st(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=hK(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();return n<0||n>=864e5?null:(t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t,includeOffset:!1},ot.fromMillis(n,{zone:"UTC"}).toISOTime(t))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Rfe(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=Ht.fromDurationLike(t),r={};for(const i of Z1)(nf(n.values,i)||nf(this.values,i))&&(r[i]=n.get(i)+this.get(i));return Ss(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=Ht.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=xfe(t(this.values[r],r));return Ss(this,{values:n},!0)}get(t){return this[Ht.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...Bz(t,Ht.normalizeUnit)};return Ss(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:i}={}){const o={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:i,conversionAccuracy:r};return Ss(this,o)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return jee(this.matrix,t),Ss(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=SRt(this.normalize().shiftToAll().toObject());return Ss(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(o=>Ht.normalizeUnit(o));const n={},r={},i=this.toObject();let a;for(const o of Z1)if(t.indexOf(o)>=0){a=o;let s=0;for(const c in r)s+=this.matrix[c][o]*r[c],r[c]=0;Us(i[o])&&(s+=i[o]);const l=Math.trunc(s);n[o]=l,r[o]=(s*1e3-l*1e3)/1e3}else Us(i[o])&&(r[o]=i[o]);for(const o in r)r[o]!==0&&(n[a]+=o===a?r[o]:r[o]/this.matrix[a][o]);return jee(this.matrix,n),Ss(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return Ss(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of Z1)if(!n(this.values[r],t.values[r]))return!1;return!0}}const th="Invalid Interval";function CRt(e,t){return!e||!e.isValid?En.invalid("missing or invalid start"):!t||!t.isValid?En.invalid("missing or invalid end"):t<e?En.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class En{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new Pr("need to specify a reason the Interval is invalid");const r=t instanceof $a?t:new $a(t,n);if(Pn.throwOnInvalid)throw new KDt(r);return new En({invalid:r})}static fromDateTimes(t,n){const r=up(t),i=up(n),a=CRt(r,i);return a??new En({start:r,end:i})}static after(t,n){const r=Ht.fromDurationLike(n),i=up(t);return En.fromDateTimes(i,i.plus(r))}static before(t,n){const r=Ht.fromDurationLike(n),i=up(t);return En.fromDateTimes(i.minus(r),i)}static fromISO(t,n){const[r,i]=(t||"").split("/",2);if(r&&i){let a,o;try{a=ot.fromISO(r,n),o=a.isValid}catch{o=!1}let s,l;try{s=ot.fromISO(i,n),l=s.isValid}catch{l=!1}if(o&&l)return En.fromDateTimes(a,s);if(o){const c=Ht.fromISO(i,n);if(c.isValid)return En.after(a,c)}else if(l){const c=Ht.fromISO(r,n);if(c.isValid)return En.before(s,c)}}return En.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds",n){if(!this.isValid)return NaN;const r=this.start.startOf(t,n);let i;return n?.useLocaleWeeks?i=this.end.reconfigure({locale:r.locale}):i=this.end,i=i.startOf(t,n),Math.floor(i.diff(r,t).get(t))+(i.valueOf()!==this.end.valueOf())}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?En.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(up).filter(o=>this.contains(o)).sort((o,s)=>o.toMillis()-s.toMillis()),r=[];let{s:i}=this,a=0;for(;i<this.e;){const o=n[a]||this.e,s=+o>+this.e?this.e:o;r.push(En.fromDateTimes(i,s)),i=s,a+=1}return r}splitBy(t){const n=Ht.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,a;const o=[];for(;r<this.e;){const s=this.start.plus(n.mapUnits(l=>l*i));a=+s>+this.e?this.e:s,o.push(En.fromDateTimes(r,a)),r=a,i+=1}return o}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:En.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return En.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((i,a)=>i.s-a.s).reduce(([i,a],o)=>a?a.overlaps(o)||a.abutsStart(o)?[i,a.union(o)]:[i.concat([a]),o]:[i,o],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const i=[],a=t.map(l=>[{time:l.s,type:"s"},{time:l.e,type:"e"}]),o=Array.prototype.concat(...a),s=o.sort((l,c)=>l.time-c.time);for(const l of s)r+=l.type==="s"?1:-1,r===1?n=l.time:(n&&+n!=+l.time&&i.push(En.fromDateTimes(n,l.time)),n=null);return En.merge(i)}difference(...t){return En.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:th}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(t=Hz,n={}){return this.isValid?Rr.create(this.s.loc.clone(n),t).formatInterval(this):th}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:th}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:th}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:th}toFormat(t,{separator:n=" – "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:th}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):Ht.invalid(this.invalidReason)}mapEndpoints(t){return En.fromDateTimes(t(this.s),t(this.e))}}class Pg{static hasDST(t=Pn.defaultZone){const n=ot.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return hs.isValidZone(t)}static normalizeZone(t){return Ps(t,Pn.defaultZone)}static getStartOfWeek({locale:t=null,locObj:n=null}={}){return(n||Yt.create(t)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:t=null,locObj:n=null}={}){return(n||Yt.create(t)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:t=null,locObj:n=null}={}){return(n||Yt.create(t)).getWeekendDays().slice()}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||Yt.create(n,r,a)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:a="gregory"}={}){return(i||Yt.create(n,r,a)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Yt.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||Yt.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return Yt.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return Yt.create(n,null,"gregory").eras(t)}static features(){return{relative:kfe(),localeWeek:bfe()}}}function Hee(e,t){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Ht.fromMillis(r).as("days"))}function LRt(e,t,n){const r=[["years",(l,c)=>c.year-l.year],["quarters",(l,c)=>c.quarter-l.quarter+(c.year-l.year)*4],["months",(l,c)=>c.month-l.month+(c.year-l.year)*12],["weeks",(l,c)=>{const u=Hee(l,c);return(u-u%7)/7}],["days",Hee]],i={},a=e;let o,s;for(const[l,c]of r)n.indexOf(l)>=0&&(o=l,i[l]=c(e,t),s=a.plus(i),s>t?(i[l]--,e=a.plus(i),e>t&&(s=e,i[l]--,e=a.plus(i))):e=s);return[e,i,s,o]}function IRt(e,t,n,r){let[i,a,o,s]=LRt(e,t,n);const l=t-i,c=n.filter(h=>["hours","minutes","seconds","milliseconds"].indexOf(h)>=0);c.length===0&&(o<t&&(o=i.plus({[s]:1})),o!==i&&(a[s]=(a[s]||0)+l/(o-i)));const u=Ht.fromObject(a,r);return c.length>0?Ht.fromMillis(l,r).shiftTo(...c).plus(u):u}const NRt="missing Intl.DateTimeFormat.formatToParts support";function Wt(e,t=n=>n){return{regex:e,deser:([n])=>t(vOt(n))}}const ARt=" ",zfe=`[ ${ARt}]`,qfe=new RegExp(zfe,"g");function $Rt(e){return e.replace(/\./g,"\\.?").replace(qfe,zfe)}function Fee(e){return e.replace(/\./g,"").replace(qfe," ").toLowerCase()}function Ma(e,t){return e===null?null:{regex:RegExp(e.map($Rt).join("|")),deser:([n])=>e.findIndex(r=>Fee(n)===Fee(r))+t}}function Vee(e,t){return{regex:e,deser:([,n,r])=>Cj(n,r),groups:t}}function Dg(e){return{regex:e,deser:([t])=>t}}function TRt(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function ERt(e,t){const n=_a(t),r=_a(t,"{2}"),i=_a(t,"{3}"),a=_a(t,"{4}"),o=_a(t,"{6}"),s=_a(t,"{1,2}"),l=_a(t,"{1,3}"),c=_a(t,"{1,6}"),u=_a(t,"{1,9}"),h=_a(t,"{2,4}"),m=_a(t,"{4,6}"),g=k=>({regex:RegExp(TRt(k.val)),deser:([b])=>b,literal:!0}),v=(k=>{if(e.literal)return g(k);switch(k.val){case"G":return Ma(t.eras("short"),0);case"GG":return Ma(t.eras("long"),0);case"y":return Wt(c);case"yy":return Wt(h,tU);case"yyyy":return Wt(a);case"yyyyy":return Wt(m);case"yyyyyy":return Wt(o);case"M":return Wt(s);case"MM":return Wt(r);case"MMM":return Ma(t.months("short",!0),1);case"MMMM":return Ma(t.months("long",!0),1);case"L":return Wt(s);case"LL":return Wt(r);case"LLL":return Ma(t.months("short",!1),1);case"LLLL":return Ma(t.months("long",!1),1);case"d":return Wt(s);case"dd":return Wt(r);case"o":return Wt(l);case"ooo":return Wt(i);case"HH":return Wt(r);case"H":return Wt(s);case"hh":return Wt(r);case"h":return Wt(s);case"mm":return Wt(r);case"m":return Wt(s);case"q":return Wt(s);case"qq":return Wt(r);case"s":return Wt(s);case"ss":return Wt(r);case"S":return Wt(l);case"SSS":return Wt(i);case"u":return Dg(u);case"uu":return Dg(s);case"uuu":return Wt(n);case"a":return Ma(t.meridiems(),0);case"kkkk":return Wt(a);case"kk":return Wt(h,tU);case"W":return Wt(s);case"WW":return Wt(r);case"E":case"c":return Wt(n);case"EEE":return Ma(t.weekdays("short",!1),1);case"EEEE":return Ma(t.weekdays("long",!1),1);case"ccc":return Ma(t.weekdays("short",!0),1);case"cccc":return Ma(t.weekdays("long",!0),1);case"Z":case"ZZ":return Vee(new RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case"ZZZ":return Vee(new RegExp(`([+-]${s.source})(${r.source})?`),2);case"z":return Dg(/[a-z_+-/]{1,256}?/i);case" ":return Dg(/[^\S\n\r]/);default:return g(k)}})(e)||{invalidReason:NRt};return v.token=e,v}const PRt={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function DRt(e,t,n){const{type:r,value:i}=e;if(r==="literal"){const l=/^\s+$/.test(i);return{literal:!l,val:l?" ":i}}const a=t[r];let o=r;r==="hour"&&(t.hour12!=null?o=t.hour12?"hour12":"hour24":t.hourCycle!=null?t.hourCycle==="h11"||t.hourCycle==="h12"?o="hour12":o="hour24":o=n.hour12?"hour12":"hour24");let s=PRt[o];if(typeof s=="object"&&(s=s[a]),s)return{literal:!1,val:s}}function ORt(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function RRt(e,t,n){const r=e.match(t);if(r){const i={};let a=1;for(const o in n)if(nf(n,o)){const s=n[o],l=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(r.slice(a,a+l))),a+=l}return[r,i]}else return[r,{}]}function zRt(e){const t=a=>{switch(a){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return st(e.z)||(n=hs.create(e.z)),st(e.Z)||(n||(n=new ei(e.Z)),r=e.Z),st(e.q)||(e.M=(e.q-1)*3+1),st(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),st(e.u)||(e.S=uK(e.u)),[Object.keys(e).reduce((a,o)=>{const s=t(o);return s&&(a[s]=e[o]),a},{}),n,r]}let NF=null;function qRt(){return NF||(NF=ot.fromMillis(1555555555555)),NF}function jRt(e,t){if(e.literal)return e;const n=Rr.macroTokenToFormatOpts(e.val),r=Vfe(n,t);return r==null||r.includes(void 0)?e:r}function jfe(e,t){return Array.prototype.concat(...e.map(n=>jRt(n,t)))}class Hfe{constructor(t,n){if(this.locale=t,this.format=n,this.tokens=jfe(Rr.parseFormat(n),t),this.units=this.tokens.map(r=>ERt(r,t)),this.disqualifyingUnit=this.units.find(r=>r.invalidReason),!this.disqualifyingUnit){const[r,i]=ORt(this.units);this.regex=RegExp(r,"i"),this.handlers=i}}explainFromTokens(t){if(this.isValid){const[n,r]=RRt(t,this.regex,this.handlers),[i,a,o]=r?zRt(r):[null,null,void 0];if(nf(r,"a")&&nf(r,"H"))throw new _h("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:this.tokens,regex:this.regex,rawMatches:n,matches:r,result:i,zone:a,specificOffset:o}}else return{input:t,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Ffe(e,t,n){return new Hfe(e,n).explainFromTokens(t)}function HRt(e,t,n){const{result:r,zone:i,specificOffset:a,invalidReason:o}=Ffe(e,t,n);return[r,i,a,o]}function Vfe(e,t){if(!e)return null;const r=Rr.create(t,e).dtFormatter(qRt()),i=r.formatToParts(),a=r.resolvedOptions();return i.map(o=>DRt(o,e,a))}const AF="Invalid DateTime",Bee=864e13;function Dp(e){return new $a("unsupported zone",`the zone "${e.name}" is not supported`)}function $F(e){return e.weekData===null&&(e.weekData=Fz(e.c)),e.weekData}function TF(e){return e.localWeekData===null&&(e.localWeekData=Fz(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function Sl(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new ot({...n,...t,old:n})}function Bfe(e,t,n){let r=e-t*60*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;const a=n.offset(r);return i===a?[r,i]:[e-Math.min(i,a)*60*1e3,Math.max(i,a)]}function Og(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function MR(e,t,n){return Bfe(Sj(e),t,n)}function Uee(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,a={...e.c,year:r,month:i,day:Math.min(e.c.day,Vz(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=Ht.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=Sj(a);let[l,c]=Bfe(s,n,e.zone);return o!==0&&(l+=o,c=e.zone.offset(l)),{ts:l,o:c}}function nh(e,t,n,r,i,a){const{setZone:o,zone:s}=n;if(e&&Object.keys(e).length!==0||t){const l=t||s,c=ot.fromObject(e,{...n,zone:l,specificOffset:a});return o?c:c.setZone(s)}else return ot.invalid(new $a("unparsable",`the input "${i}" can't be parsed as ${r}`))}function Rg(e,t,n=!0){return e.isValid?Rr.create(Yt.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function EF(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Wn(e.c.year,n?6:4),t?(r+="-",r+=Wn(e.c.month),r+="-",r+=Wn(e.c.day)):(r+=Wn(e.c.month),r+=Wn(e.c.day)),r}function Wee(e,t,n,r,i,a){let o=Wn(e.c.hour);return t?(o+=":",o+=Wn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(o+=":")):o+=Wn(e.c.minute),(e.c.millisecond!==0||e.c.second!==0||!n)&&(o+=Wn(e.c.second),(e.c.millisecond!==0||!r)&&(o+=".",o+=Wn(e.c.millisecond,3))),i&&(e.isOffsetFixed&&e.offset===0&&!a?o+="Z":e.o<0?(o+="-",o+=Wn(Math.trunc(-e.o/60)),o+=":",o+=Wn(Math.trunc(-e.o%60))):(o+="+",o+=Wn(Math.trunc(e.o/60)),o+=":",o+=Wn(Math.trunc(e.o%60)))),a&&(o+="["+e.zone.ianaName+"]"),o}const Ufe={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},FRt={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},VRt={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Wfe=["year","month","day","hour","minute","second","millisecond"],BRt=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],URt=["year","ordinal","hour","minute","second","millisecond"];function WRt(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new Uhe(e);return t}function Gee(e){switch(e.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return WRt(e)}}function GRt(e){if(Op===void 0&&(Op=Pn.now()),e.type!=="iana")return e.offset(Op);const t=e.name;let n=nU.get(t);return n===void 0&&(n=e.offset(Op),nU.set(t,n)),n}function Zee(e,t){const n=Ps(t.zone,Pn.defaultZone);if(!n.isValid)return ot.invalid(Dp(n));const r=Yt.fromObject(t);let i,a;if(st(e.year))i=Pn.now();else{for(const l of Wfe)st(e[l])&&(e[l]=Ufe[l]);const o=yfe(e)||vfe(e);if(o)return ot.invalid(o);const s=GRt(n);[i,a]=MR(e,s,n)}return new ot({ts:i,zone:n,loc:r,o:a})}function Kee(e,t,n){const r=st(n.round)?!0:n.round,i=(o,s)=>(o=hK(o,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(o,s)),a=o=>n.calendary?t.hasSame(e,o)?0:t.startOf(o).diff(e.startOf(o),o).get(o):t.diff(e,o).get(o);if(n.unit)return i(a(n.unit),n.unit);for(const o of n.units){const s=a(o);if(Math.abs(s)>=1)return i(s,o)}return i(e>t?-0:0,n.units[n.units.length-1])}function Xee(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}let Op;const nU=new Map;class ot{constructor(t){const n=t.zone||Pn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new $a("invalid input"):null)||(n.isValid?null:Dp(n));this.ts=st(t.ts)?Pn.now():t.ts;let i=null,a=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[i,a]=[t.old.c,t.old.o];else{const s=Us(t.o)&&!t.old?t.o:n.offset(this.ts);i=Og(this.ts,s),r=Number.isNaN(i.year)?new $a("invalid input"):null,i=r?null:i,a=r?null:s}this._zone=n,this.loc=t.loc||Yt.create(),this.invalid=r,this.weekData=null,this.localWeekData=null,this.c=i,this.o=a,this.isLuxonDateTime=!0}static now(){return new ot({})}static local(){const[t,n]=Xee(arguments),[r,i,a,o,s,l,c]=n;return Zee({year:r,month:i,day:a,hour:o,minute:s,second:l,millisecond:c},t)}static utc(){const[t,n]=Xee(arguments),[r,i,a,o,s,l,c]=n;return t.zone=ei.utcInstance,Zee({year:r,month:i,day:a,hour:o,minute:s,second:l,millisecond:c},t)}static fromJSDate(t,n={}){const r=_Ot(t)?t.valueOf():NaN;if(Number.isNaN(r))return ot.invalid("invalid input");const i=Ps(n.zone,Pn.defaultZone);return i.isValid?new ot({ts:r,zone:i,loc:Yt.fromObject(n)}):ot.invalid(Dp(i))}static fromMillis(t,n={}){if(Us(t))return t<-Bee||t>Bee?ot.invalid("Timestamp out of range"):new ot({ts:t,zone:Ps(n.zone,Pn.defaultZone),loc:Yt.fromObject(n)});throw new Pr(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(Us(t))return new ot({ts:t*1e3,zone:Ps(n.zone,Pn.defaultZone),loc:Yt.fromObject(n)});throw new Pr("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=Ps(n.zone,Pn.defaultZone);if(!r.isValid)return ot.invalid(Dp(r));const i=Yt.fromObject(n),a=Bz(t,Gee),{minDaysInFirstWeek:o,startOfWeek:s}=Pee(a,i),l=Pn.now(),c=st(n.specificOffset)?r.offset(l):n.specificOffset,u=!st(a.ordinal),h=!st(a.year),m=!st(a.month)||!st(a.day),g=h||m,y=a.weekYear||a.weekNumber;if((g||u)&&y)throw new _h("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(m&&u)throw new _h("Can't mix ordinal dates with month/day");const v=y||a.weekday&&!g;let k,b,x=Og(l,c);v?(k=BRt,b=FRt,x=Fz(x,o,s)):u?(k=URt,b=VRt,x=IF(x)):(k=Wfe,b=Ufe);let w=!1;for(const A of k){const D=a[A];st(D)?w?a[A]=b[A]:a[A]=x[A]:w=!0}const M=v?bOt(a,o,s):u?wOt(a):yfe(a),_=M||vfe(a);if(_)return ot.invalid(_);const C=v?Tee(a,o,s):u?Eee(a):a,[L,S]=MR(C,c,r),I=new ot({ts:L,zone:r,o:S,loc:i});return a.weekday&&g&&t.weekday!==I.weekday?ot.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${I.toISO()}`):I.isValid?I:ot.invalid(I.invalid)}static fromISO(t,n={}){const[r,i]=hRt(t);return nh(r,i,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,i]=fRt(t);return nh(r,i,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,i]=pRt(t);return nh(r,i,n,"HTTP",n)}static fromFormat(t,n,r={}){if(st(t)||st(n))throw new Pr("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:a=null}=r,o=Yt.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),[s,l,c,u]=HRt(o,t,n);return u?ot.invalid(u):nh(s,l,r,`format ${n}`,t,c)}static fromString(t,n,r={}){return ot.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,i]=wRt(t);return nh(r,i,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new Pr("need to specify a reason the DateTime is invalid");const r=t instanceof $a?t:new $a(t,n);if(Pn.throwOnInvalid)throw new ZDt(r);return new ot({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=Vfe(t,Yt.fromObject(n));return r?r.map(i=>i?i.val:null).join(""):null}static expandFormat(t,n={}){return jfe(Rr.parseFormat(t),Yt.fromObject(n)).map(i=>i.val).join("")}static resetCache(){Op=void 0,nU.clear()}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?$F(this).weekYear:NaN}get weekNumber(){return this.isValid?$F(this).weekNumber:NaN}get weekday(){return this.isValid?$F(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?TF(this).weekday:NaN}get localWeekNumber(){return this.isValid?TF(this).weekNumber:NaN}get localWeekYear(){return this.isValid?TF(this).weekYear:NaN}get ordinal(){return this.isValid?IF(this.c).ordinal:NaN}get monthShort(){return this.isValid?Pg.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Pg.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Pg.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Pg.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const t=864e5,n=6e4,r=Sj(this.c),i=this.zone.offset(r-t),a=this.zone.offset(r+t),o=this.zone.offset(r-i*n),s=this.zone.offset(r-a*n);if(o===s)return[this];const l=r-o*n,c=r-s*n,u=Og(l,o),h=Og(c,s);return u.hour===h.hour&&u.minute===h.minute&&u.second===h.second&&u.millisecond===h.millisecond?[Sl(this,{ts:l}),Sl(this,{ts:c})]:[this]}get isInLeapYear(){return xm(this.year)}get daysInMonth(){return Vz(this.year,this.month)}get daysInYear(){return this.isValid?Oh(this.year):NaN}get weeksInWeekYear(){return this.isValid?P2(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?P2(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:i}=Rr.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(t=0,n={}){return this.setZone(ei.instance(t),n)}toLocal(){return this.setZone(Pn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=Ps(t,Pn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let i=this.ts;if(n||r){const a=t.offset(this.ts),o=this.toObject();[i]=MR(o,a,t)}return Sl(this,{ts:i,zone:t})}else return ot.invalid(Dp(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return Sl(this,{loc:i})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=Bz(t,Gee),{minDaysInFirstWeek:r,startOfWeek:i}=Pee(n,this.loc),a=!st(n.weekYear)||!st(n.weekNumber)||!st(n.weekday),o=!st(n.ordinal),s=!st(n.year),l=!st(n.month)||!st(n.day),c=s||l,u=n.weekYear||n.weekNumber;if((c||o)&&u)throw new _h("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&o)throw new _h("Can't mix ordinal dates with month/day");let h;a?h=Tee({...Fz(this.c,r,i),...n},r,i):st(n.ordinal)?(h={...this.toObject(),...n},st(n.day)&&(h.day=Math.min(Vz(h.year,h.month),h.day))):h=Eee({...IF(this.c),...n});const[m,g]=MR(h,this.o,this.zone);return Sl(this,{ts:m,o:g})}plus(t){if(!this.isValid)return this;const n=Ht.fromDurationLike(t);return Sl(this,Uee(this,n))}minus(t){if(!this.isValid)return this;const n=Ht.fromDurationLike(t).negate();return Sl(this,Uee(this,n))}startOf(t,{useLocaleWeeks:n=!1}={}){if(!this.isValid)return this;const r={},i=Ht.normalizeUnit(t);switch(i){case"years":r.month=1;case"quarters":case"months":r.day=1;case"weeks":case"days":r.hour=0;case"hours":r.minute=0;case"minutes":r.second=0;case"seconds":r.millisecond=0;break}if(i==="weeks")if(n){const a=this.loc.getStartOfWeek(),{weekday:o}=this;o<a&&(r.weekNumber=this.weekNumber-1),r.weekday=a}else r.weekday=1;if(i==="quarters"){const a=Math.ceil(this.month/3);r.month=(a-1)*3+1}return this.set(r)}endOf(t,n){return this.isValid?this.plus({[t]:1}).startOf(t,n).minus(1):this}toFormat(t,n={}){return this.isValid?Rr.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):AF}toLocaleString(t=Hz,n={}){return this.isValid?Rr.create(this.loc.clone(n),t).formatDateTime(this):AF}toLocaleParts(t={}){return this.isValid?Rr.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:a=!1}={}){if(!this.isValid)return null;const o=t==="extended";let s=EF(this,o);return s+="T",s+=Wee(this,o,n,r,i,a),s}toISODate({format:t="extended"}={}){return this.isValid?EF(this,t==="extended"):null}toISOWeekDate(){return Rg(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:a=!1,format:o="extended"}={}){return this.isValid?(i?"T":"")+Wee(this,o==="extended",n,t,r,a):null}toRFC2822(){return Rg(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Rg(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?EF(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||t)&&(r&&(i+=" "),n?i+="z":t&&(i+="ZZ")),Rg(this,i,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():AF}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return Ht.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},a=MOt(n).map(Ht.normalizeUnit),o=t.valueOf()>this.valueOf(),s=o?this:t,l=o?t:this,c=IRt(s,l,a,i);return o?c.negate():c}diffNow(t="milliseconds",n={}){return this.diff(ot.now(),t,n)}until(t){return this.isValid?En.fromDateTimes(this,t):this}hasSame(t,n,r){if(!this.isValid)return!1;const i=t.valueOf(),a=this.setZone(t.zone,{keepLocalTime:!0});return a.startOf(n,r)<=i&&i<=a.endOf(n,r)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||ot.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let i=["years","months","days","hours","minutes","seconds"],a=t.unit;return Array.isArray(t.unit)&&(i=t.unit,a=void 0),Kee(n,this.plus(r),{...t,numeric:"always",units:i,unit:a})}toRelativeCalendar(t={}){return this.isValid?Kee(t.base||ot.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(ot.isDateTime))throw new Pr("min requires all arguments be DateTimes");return Dee(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(ot.isDateTime))throw new Pr("max requires all arguments be DateTimes");return Dee(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:i=null,numberingSystem:a=null}=r,o=Yt.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});return Ffe(o,t,n)}static fromStringExplain(t,n,r={}){return ot.fromFormatExplain(t,n,r)}static buildFormatParser(t,n={}){const{locale:r=null,numberingSystem:i=null}=n,a=Yt.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0});return new Hfe(a,t)}static fromFormatParser(t,n,r={}){if(st(t)||st(n))throw new Pr("fromFormatParser requires an input string and a format parser");const{locale:i=null,numberingSystem:a=null}=r,o=Yt.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});if(!o.equals(n.locale))throw new Pr(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);const{result:s,zone:l,specificOffset:c,invalidReason:u}=n.explainFromTokens(t);return u?ot.invalid(u):nh(s,l,r,`format ${n.format}`,t,c)}static get DATE_SHORT(){return Hz}static get DATE_MED(){return Whe}static get DATE_MED_WITH_WEEKDAY(){return YDt}static get DATE_FULL(){return Ghe}static get DATE_HUGE(){return Zhe}static get TIME_SIMPLE(){return Khe}static get TIME_WITH_SECONDS(){return Xhe}static get TIME_WITH_SHORT_OFFSET(){return Yhe}static get TIME_WITH_LONG_OFFSET(){return Jhe}static get TIME_24_SIMPLE(){return Qhe}static get TIME_24_WITH_SECONDS(){return efe}static get TIME_24_WITH_SHORT_OFFSET(){return tfe}static get TIME_24_WITH_LONG_OFFSET(){return nfe}static get DATETIME_SHORT(){return rfe}static get DATETIME_SHORT_WITH_SECONDS(){return ife}static get DATETIME_MED(){return afe}static get DATETIME_MED_WITH_SECONDS(){return ofe}static get DATETIME_MED_WITH_WEEKDAY(){return JDt}static get DATETIME_FULL(){return sfe}static get DATETIME_FULL_WITH_SECONDS(){return lfe}static get DATETIME_HUGE(){return cfe}static get DATETIME_HUGE_WITH_SECONDS(){return dfe}}function up(e){if(ot.isDateTime(e))return e;if(e&&e.valueOf&&Us(e.valueOf()))return ot.fromJSDate(e);if(e&&typeof e=="object")return ot.fromObject(e);throw new Pr(`Unknown datetime argument: ${e}, of type ${typeof e}`)}function Gfe(e,t,n){let r=i=>e(i,...t);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:t})}function Sm(e,t,n){let r=e.length-t.length;if(r===0)return e(...t);if(r===1)return Gfe(e,t,n);throw new Error("Wrong number of arguments")}var gK={done:!1,hasNext:!1},ZRt=e=>({hasNext:!0,next:e,done:!1});function Uz(e,...t){let n=e,r=t.map(a=>"lazy"in a?KRt(a):void 0),i=0;for(;i<t.length;){if(r[i]===void 0||!XRt(n)){let l=t[i];n=l(n),i+=1;continue}let a=[];for(let l=i;l<t.length;l++){let c=r[l];if(c===void 0||(a.push(c),c.isSingle))break}let o=[];for(let l of n)if(Zfe(l,o,a))break;let{isSingle:s}=a.at(-1);n=s?o[0]:o,i+=a.length}return n}function Zfe(e,t,n){if(n.length===0)return t.push(e),!1;let r=e,i=gK,a=!1;for(let[o,s]of n.entries()){let{index:l,items:c}=s;if(c.push(r),i=s(r,l,c),s.index+=1,i.hasNext){if(i.hasMany??!1){for(let u of i.next)if(Zfe(u,t,n.slice(o+1)))return!0;return a}r=i.next}if(!i.hasNext)break;i.done&&(a=!0)}return i.hasNext&&t.push(r),a}function KRt(e){let{lazy:t,lazyArgs:n}=e,r=t(...n);return Object.assign(r,{isSingle:t.single??!1,index:0,items:[]})}function XRt(e){return typeof e=="string"||typeof e=="object"&&e!==null&&Symbol.iterator in e}function YRt(e,t){let n=t.length-e.length;if(n===1){let[r,...i]=t;return Uz(r,{lazy:e,lazyArgs:i})}if(n===0){let r={lazy:e,lazyArgs:t};return Object.assign(i=>Uz(i,r),r)}throw new Error("Wrong number of arguments")}function JRt(...e){return YRt(QRt,e)}function QRt(e){let t=e,n=new Set;return(r,i,a)=>{let o=t(r,i,a);return n.has(o)?gK:(n.add(o),{done:!1,hasNext:!0,next:r})}}function Yee(...e){return Sm(Object.values,e)}function ezt(...e){return Sm(tzt,e)}var tzt=(e,t)=>e.length>=t,Kfe={asc:(e,t)=>e>t,desc:(e,t)=>e<t};function nzt(e,t){let[n,...r]=t;if(!rzt(n)){let a=rU(...r);return e(n,a)}let i=rU(n,...r);return a=>e(a,i)}function rU(e,t,...n){let r=typeof e=="function"?e:e[0],i=typeof e=="function"?"asc":e[1],{[i]:a}=Kfe,o=t===void 0?void 0:rU(t,...n);return(s,l)=>{let c=r(s),u=r(l);return a(c,u)?1:a(u,c)?-1:o?.(s,l)??0}}function rzt(e){if(Jee(e))return!0;if(typeof e!="object"||!Array.isArray(e))return!1;let[t,n,...r]=e;return Jee(t)&&typeof n=="string"&&n in Kfe&&r.length===0}var Jee=e=>typeof e=="function"&&e.length===1;function izt(...e){return Sm(azt,e)}function azt(e,t){let n={};for(let[r,i]of Object.entries(e)){let a=t(i,r,e);n[r]=a}return n}function Qee(...e){return Sm(ozt,e)}var ozt=(e,t)=>{let n=Object.create(null);for(let r=0;r<e.length;r++){let i=e[r],a=t(i,r,e);if(a!==void 0){let o=n[a];o===void 0?n[a]=[i]:o.push(i)}}return Object.setPrototypeOf(n,Object.prototype),n};function szt(...e){return nzt(lzt,e)}function lzt(e,t){if(!ezt(e,2))return e[0];let[n]=e,[,...r]=e;for(let i of r)t(i,n)<0&&(n=i);return n}function czt(e,t){return typeof e=="object"?ete(e,t):Gfe(ete,[],dzt)}var ete=(e,t)=>t===void 0?e.flat():e.flat(t),dzt=e=>e===void 0||e===1?uzt:e<=0?ZRt:t=>Array.isArray(t)?{next:t.flat(e-1),hasNext:!0,hasMany:!0,done:!1}:{next:t,hasNext:!0,done:!1},uzt=e=>Array.isArray(e)?{next:e,hasNext:!0,hasMany:!0,done:!1}:{next:e,hasNext:!0,done:!1};function hzt(...e){return Sm(fzt,e,pzt)}var fzt=(e,t)=>e.filter(t),pzt=e=>(t,n,r)=>e(t,n,r)?{done:!1,hasNext:!0,next:t}:gK;const mzt=["opencode","opencode-go","anthropic","github-copilot","openai","google","openrouter","vercel"],gzt=new Set(mzt);function yK(){const e=ha(),t=di(),n=Z(()=>xo(t.dir)??""),r=()=>{if(n()){const[i]=e.child(n());if(i.provider_ready)return i.provider}return e.data.provider};return{all:()=>r().all,default:()=>r().default,popular:()=>r().all.filter(i=>gzt.has(i.id)),connected:()=>{const i=new Set(r().connected);return r().all.filter(a=>i.has(a.id))},paid:()=>{const i=new Set(r().connected);return r().all.filter(a=>i.has(a.id)&&(a.id!=="opencode"||Object.values(a.models).some(o=>o.cost?.input)))},free:()=>{const i=new Set(r().connected);return r().all.filter(a=>i.has(a.id)&&a.id==="opencode"&&Object.values(a.models).some(o=>!o.cost||o.cost.input===0))}}}const yzt=5;function zg(e){return`${e.providerID}:${e.modelID}`}const{use:vzt,provider:kzt}=Nn({name:"Models",init:()=>{const e=yK(),[t,n,r,i]=Jn(In.global("model",["model.v1"]),nt({user:[],recent:[],variant:{}})),a=Z(()=>e.connected().flatMap(w=>Object.values(w.models).map(M=>({...M,provider:w})))),o=Z(()=>new Map(a().map(w=>{const M=ot.fromISO(w.release_date);return[zg({providerID:w.provider.id,modelID:w.id}),M]}))),s=Z(()=>Uz(a(),hzt(w=>Math.abs((o().get(zg({providerID:w.provider.id,modelID:w.id}))??ot.invalid("invalid")).diffNow().as("months"))<6),Qee(w=>w.provider.id),izt(w=>Uz(w,Qee(M=>M.family),Yee(),M=>M.flatMap(_=>{const C=szt(_,[L=>L.release_date,"desc"]);return C?[{modelID:C.id,providerID:C.provider.id}]:[]}))),Yee(),czt())),l=Z(()=>new Set(s().map(w=>zg(w)))),c=Z(()=>{const w=new Map;for(const M of t.user)w.set(`${M.providerID}:${M.modelID}`,M.visibility);return w}),u=Z(()=>a().map(w=>({...w,name:w.name.replace("(latest)","").trim(),latest:w.name.includes("(latest)")}))),h=w=>u().find(M=>M.id===w.modelID&&M.provider.id===w.providerID);function m(w,M){const _=t.user.findIndex(C=>C.modelID===w.modelID&&C.providerID===w.providerID);if(_>=0){n("user",_,C=>({...C,visibility:M}));return}n("user",t.user.length,{...w,visibility:M})}const g=w=>{const M=zg(w),_=c().get(M);return _==="hide"?!1:!!(_==="show"||l().has(M)||!o().get(M)?.isValid)},y=(w,M)=>{m(w,M?"show":"hide")},v=w=>{const M=JRt([w,...t.recent],_=>`${_.providerID}:${_.modelID}`);M.length>yzt&&M.pop(),n("recent",M)},k=w=>`${w.providerID}/${w.modelID}`,b=w=>t.variant?.[k(w)],x=(w,M)=>{const _=k(w);if(!t.variant){n("variant",{[_]:M});return}n("variant",_,M)};return{ready:i,list:u,find:h,visible:g,setVisibility:y,recent:{list:Z(()=>t.recent),push:v},variant:{get:b,set:x}}}});let qg,jg;function bzt(){return qg||(qg=Object.assign({"../../../ui/src/assets/audio/alert-01.aac":()=>z(()=>import("./alert-01-BJxg7Br3.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-02.aac":()=>z(()=>import("./alert-02-B_yYorxz.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-03.aac":()=>z(()=>import("./alert-03-DrFH92rH.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-04.aac":()=>z(()=>import("./alert-04-BvTiGxWY.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-05.aac":()=>z(()=>import("./alert-05-CFi_H2fs.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-06.aac":()=>z(()=>import("./alert-06-IqbtOTTn.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-07.aac":()=>z(()=>import("./alert-07-B2AcuX88.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-08.aac":()=>z(()=>import("./alert-08-pIF0yjmQ.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-09.aac":()=>z(()=>import("./alert-09-CidmJWaA.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/alert-10.aac":()=>z(()=>import("./alert-10-84PPn2Zu.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-01.aac":()=>z(()=>import("./bip-bop-01-SdbMMaiV.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-02.aac":()=>z(()=>import("./bip-bop-02-CujvGF7f.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-03.aac":()=>z(()=>import("./bip-bop-03-BPb7xYJT.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-04.aac":()=>z(()=>import("./bip-bop-04-dSUw_8vI.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-05.aac":()=>z(()=>import("./bip-bop-05-BNanGIjD.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-06.aac":()=>z(()=>import("./bip-bop-06-DiKbyBF9.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-07.aac":()=>z(()=>import("./bip-bop-07-BoG3Fd8O.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-08.aac":()=>z(()=>import("./bip-bop-08-C6sK41fd.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-09.aac":()=>z(()=>import("./bip-bop-09-AXzGc7YL.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/bip-bop-10.aac":()=>z(()=>import("./bip-bop-10-E37zfY9y.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-01.aac":()=>z(()=>import("./nope-01-HWHtipgi.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-02.aac":()=>z(()=>import("./nope-02-CzaO3Yrz.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-03.aac":()=>z(()=>import("./nope-03-D3_ztwN2.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-04.aac":()=>z(()=>import("./nope-04-CmCNjd7G.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-05.aac":()=>z(()=>import("./nope-05-DY6LpiuN.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-06.aac":()=>z(()=>import("./nope-06-CfV385SL.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-07.aac":()=>z(()=>import("./nope-07-nvIV4VRE.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-08.aac":()=>z(()=>import("./nope-08-HcI83CoX.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-09.aac":()=>z(()=>import("./nope-09-8gNK4nDO.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-10.aac":()=>z(()=>import("./nope-10-C1PuPJJ6.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-11.aac":()=>z(()=>import("./nope-11-BjKpOuL0.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/nope-12.aac":()=>z(()=>import("./nope-12-XTIkittV.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-01.aac":()=>z(()=>import("./staplebops-01-gmydkbKo.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-02.aac":()=>z(()=>import("./staplebops-02-dGmDElbO.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-03.aac":()=>z(()=>import("./staplebops-03-DK1yH6J2.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-04.aac":()=>z(()=>import("./staplebops-04-Bi3-8HzN.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-05.aac":()=>z(()=>import("./staplebops-05-BVmKob0k.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-06.aac":()=>z(()=>import("./staplebops-06-BAYmihXf.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/staplebops-07.aac":()=>z(()=>import("./staplebops-07-_-IkdLL4.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-01.aac":()=>z(()=>import("./yup-01-Cv8FIGVN.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-02.aac":()=>z(()=>import("./yup-02-BIvWfOQf.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-03.aac":()=>z(()=>import("./yup-03-DlJPYLhC.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-04.aac":()=>z(()=>import("./yup-04-CrvHiQIe.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-05.aac":()=>z(()=>import("./yup-05-CrtAHyVr.js"),[]).then(e=>e.default),"../../../ui/src/assets/audio/yup-06.aac":()=>z(()=>import("./yup-06-W4HuBYhb.js"),[]).then(e=>e.default)}),qg)}const pQt=[{id:"alert-01",label:"sound.option.alert01"},{id:"alert-02",label:"sound.option.alert02"},{id:"alert-03",label:"sound.option.alert03"},{id:"alert-04",label:"sound.option.alert04"},{id:"alert-05",label:"sound.option.alert05"},{id:"alert-06",label:"sound.option.alert06"},{id:"alert-07",label:"sound.option.alert07"},{id:"alert-08",label:"sound.option.alert08"},{id:"alert-09",label:"sound.option.alert09"},{id:"alert-10",label:"sound.option.alert10"},{id:"bip-bop-01",label:"sound.option.bipbop01"},{id:"bip-bop-02",label:"sound.option.bipbop02"},{id:"bip-bop-03",label:"sound.option.bipbop03"},{id:"bip-bop-04",label:"sound.option.bipbop04"},{id:"bip-bop-05",label:"sound.option.bipbop05"},{id:"bip-bop-06",label:"sound.option.bipbop06"},{id:"bip-bop-07",label:"sound.option.bipbop07"},{id:"bip-bop-08",label:"sound.option.bipbop08"},{id:"bip-bop-09",label:"sound.option.bipbop09"},{id:"bip-bop-10",label:"sound.option.bipbop10"},{id:"staplebops-01",label:"sound.option.staplebops01"},{id:"staplebops-02",label:"sound.option.staplebops02"},{id:"staplebops-03",label:"sound.option.staplebops03"},{id:"staplebops-04",label:"sound.option.staplebops04"},{id:"staplebops-05",label:"sound.option.staplebops05"},{id:"staplebops-06",label:"sound.option.staplebops06"},{id:"staplebops-07",label:"sound.option.staplebops07"},{id:"nope-01",label:"sound.option.nope01"},{id:"nope-02",label:"sound.option.nope02"},{id:"nope-03",label:"sound.option.nope03"},{id:"nope-04",label:"sound.option.nope04"},{id:"nope-05",label:"sound.option.nope05"},{id:"nope-06",label:"sound.option.nope06"},{id:"nope-07",label:"sound.option.nope07"},{id:"nope-08",label:"sound.option.nope08"},{id:"nope-09",label:"sound.option.nope09"},{id:"nope-10",label:"sound.option.nope10"},{id:"nope-11",label:"sound.option.nope11"},{id:"nope-12",label:"sound.option.nope12"},{id:"yup-01",label:"sound.option.yup01"},{id:"yup-02",label:"sound.option.yup02"},{id:"yup-03",label:"sound.option.yup03"},{id:"yup-04",label:"sound.option.yup04"},{id:"yup-05",label:"sound.option.yup05"},{id:"yup-06",label:"sound.option.yup06"}];function wzt(){return jg||(jg=Object.fromEntries(Object.entries(bzt()).flatMap(([e,t])=>{const n=e.split("/").at(-1);return n?[[n.replace(/\.aac$/,""),t]]:[]})),jg)}const tte=new Map;function xzt(e){const t=wzt();if(!e||!(e in t))return Promise.resolve(void 0);const n=e,r=tte.get(n);if(r)return r;const i=t[n]().catch(()=>{});return tte.set(n,i),i}function _zt(e){if(typeof Audio>"u"||!e)return;const t=new Audio(e);return t.play().catch(()=>{}),()=>{t.pause(),t.currentTime=0}}function iU(e){return xzt(e).then(t=>_zt(t))}const nte=500,Mzt=1e3*60*60*24*30;function rte(e){const t=Date.now()-Mzt,n=e.filter(r=>r.time>=t);return n.length<=nte?n:n.slice(n.length-nte)}function Szt(){return{session:{all:{},unseen:{},unseenCount:{},unseenHasError:{}},project:{all:{},unseen:{},unseenCount:{},unseenHasError:{}}}}function ite(e){const t=Szt();return e.forEach(n=>{if(n.session){const r=t.session.all[n.session]??[];if(t.session.all[n.session]=[...r,n],!n.viewed){const i=t.session.unseen[n.session]??[];t.session.unseen[n.session]=[...i,n],t.session.unseenCount[n.session]=i.length+1,n.type==="error"&&(t.session.unseenHasError[n.session]=!0)}}if(n.directory){const r=t.project.all[n.directory]??[];if(t.project.all[n.directory]=[...r,n],!n.viewed){const i=t.project.unseen[n.directory]??[];t.project.unseen[n.directory]=[...i,n],t.project.unseenCount[n.directory]=i.length+1,n.type==="error"&&(t.project.unseenHasError[n.directory]=!0)}}}),t}const{use:Ij,provider:Czt}=Nn({name:"Notification",init:()=>{const e=di(),t=E0(),n=ha(),r=ms(),i=sm(),a=_r(),o=[],s=Z(()=>xo(e.dir)),l=Z(()=>e.id),[c,u,h,m]=Jn(In.global("notification",["notification.v1"]),nt({list:[]})),[g,y]=nt(ite(c.list)),v={pruned:!1,disposed:!1},k=(I,A,D)=>{y(I,"unseen",A,D),y(I,"unseenCount",A,D.length),y(I,"unseenHasError",A,D.some(P=>P.type==="error"))},b=I=>{I.session&&(y("session","all",I.session,(A=[])=>[...A,I]),I.viewed||(y("session","unseen",I.session,(A=[])=>[...A,I]),y("session","unseenCount",I.session,(A=0)=>A+1),I.type==="error"&&y("session","unseenHasError",I.session,!0))),I.directory&&(y("project","all",I.directory,(A=[])=>[...A,I]),I.viewed||(y("project","unseen",I.directory,(A=[])=>[...A,I]),y("project","unseenCount",I.directory,(A=0)=>A+1),I.type==="error"&&y("project","unseenHasError",I.directory,!0)))},x=I=>{if(I.session&&(y("session","all",I.session,(A=[])=>A.filter(D=>D!==I)),!I.viewed)){const A=(g.session.unseen[I.session]??o).filter(D=>D!==I);k("session",I.session,A)}if(I.directory&&(y("project","all",I.directory,(A=[])=>A.filter(D=>D!==I)),!I.viewed)){const A=(g.project.unseen[I.directory]??o).filter(D=>D!==I);k("project",I.directory,A)}};he(()=>{if(!m()||v.pruned)return;v.pruned=!0;const I=rte(c.list);ct(()=>{u("list",I),y(Ct(ite(I),{merge:!1}))})});const w=I=>{const A=rte([...c.list,I]),D=new Set(A),P=c.list.filter(O=>!D.has(O));ct(()=>{D.has(I)&&b(I),P.forEach(O=>x(O)),u("list",A)})},M=async(I,A)=>{if(!A)return;const[D]=n.child(I,{bootstrap:!1}),P=rn.search(D.session,A,O=>O.id);return P.found?D.session[P.index]:t.client.session.get({directory:I,sessionID:A}).then(O=>O.data).catch(()=>{})},_=(I,A)=>{const D=s(),P=l();return!D||!P||!A||I!==D?!1:A===P},C=(I,A,D)=>{const P=A.properties.sessionID;M(I,P).then(O=>{if(v.disposed||!O||O.parentID)return;i.sounds.agentEnabled()&&iU(i.sounds.agent()),w({directory:I,time:D,viewed:_(I,P),type:"turn-complete",session:P});const E=`/${St(I)}/session/${P}`;i.notifications.agent()&&r.notify(a.t("notification.session.responseReady.title"),O.title??P,E)})},L=(I,A,D)=>{const P=A.properties.sessionID;M(I,P).then(O=>{if(v.disposed||O?.parentID)return;i.sounds.errorsEnabled()&&iU(i.sounds.errors());const E="error"in A.properties?A.properties.error:void 0;w({directory:I,time:D,viewed:_(I,P),type:"error",session:P??"global",error:E});const T=O?.title??(typeof E=="string"?E:a.t("notification.session.error.fallbackDescription")),R=P?`/${St(I)}/session/${P}`:`/${St(I)}`;i.notifications.errors()&&r.notify(a.t("notification.session.error.title"),T,R)})},S=t.event.listen(I=>{const A=I.details;if(A.type!=="session.idle"&&A.type!=="session.error")return;const D=I.name,P=Date.now();if(A.type==="session.idle"){C(D,A,P);return}L(D,A,P)});return me(()=>{v.disposed=!0,S()}),{ready:m,session:{all(I){return g.session.all[I]??o},unseen(I){return g.session.unseen[I]??o},unseenCount(I){return g.session.unseenCount[I]??0},unseenHasError(I){return g.session.unseenHasError[I]??!1},markViewed(I){const A=g.session.unseen[I]??o;if(!A.length)return;const D=[...new Set(A.flatMap(P=>P.directory?[P.directory]:[]))];ct(()=>{u("list",P=>P.session===I&&!P.viewed,"viewed",!0),k("session",I,[]),D.forEach(P=>{const O=(g.project.unseen[P]??o).filter(E=>E.session!==I);k("project",P,O)})})}},project:{all(I){return g.project.all[I]??o},unseen(I){return g.project.unseen[I]??o},unseenCount(I){return g.project.unseenCount[I]??0},unseenHasError(I){return g.project.unseenHasError[I]??!1},markViewed(I){const A=g.project.unseen[I]??o;if(!A.length)return;const D=[...new Set(A.flatMap(P=>P.session?[P.session]:[]))];ct(()=>{u("list",P=>P.directory===I&&!P.viewed,"viewed",!0),k("project",I,[]),D.forEach(P=>{const O=(g.session.unseen[P]??o).filter(E=>E.directory!==I);k("session",P,O)})})}}}}});function SR(e,t){return t?`${St(t)}/${e}`:e}function Qp(e){return`${St(e)}/*`}function Lzt(e,t,n){const r=SR(t,n),i=n?Qp(n):void 0;return e[r]??e[t]??(i?e[i]:void 0)}function Izt(e,t){const n=Qp(t);return e[n]??!1}function Nzt(e,t){const n=e.reduce((a,o)=>(o.parentID&&a.set(o.id,o.parentID),a),new Map),r=new Set([t]),i=[t];for(const a of i){const o=n.get(a);!o||r.has(o)||(r.add(o),i.push(o))}return i}function ate(e,t,n,r){return Nzt(t,n.sessionID).map(a=>Lzt(e,a,r)).find(a=>a!==void 0)??!1}function Azt(e){if(!e)return!1;if(typeof e=="string")return e!=="allow";if(typeof e!="object"||Array.isArray(e))return!1;for(const t of Object.values(e))if(t!=="allow")return!0;return!1}function $zt(e){return e?typeof e=="string"?e!=="allow":typeof e!="object"||Array.isArray(e)?!1:Object.values(e).some(Azt):!1}const{use:vK,provider:Tzt}=Nn({name:"Permission",init:()=>{const e=di(),t=E0(),n=ha(),r=Z(()=>{const S=xo(e.dir);if(!S)return!1;const[I]=n.child(S);return $zt(I.config.permission)}),[i,a,o,s]=Jn({...In.global("permission",["permission.v3"]),migrate(S){if(!S||typeof S!="object"||Array.isArray(S))return S;const I=S;return I.autoAccept?S:{...I,autoAccept:typeof I.autoAcceptEdits=="object"&&I.autoAcceptEdits&&!Array.isArray(I.autoAcceptEdits)?I.autoAcceptEdits:{}}}},nt({autoAccept:{}}));he(()=>{if(!s())return;const S=xo(e.dir);if(!S)return;const[I]=n.child(S),A=I.config.permission;if(typeof A=="string"&&A==="allow"){const D=Qp(S);i.autoAccept[D]===void 0&&a(Je(P=>{P.autoAccept[D]=!0}))}});const l=1e3,c=3600*1e3,u=new Map,h=new Map;function m(S){for(const[I,A]of u){if(S-A<c)break;u.delete(I)}for(const I of u.keys()){if(u.size<=l)break;u.delete(I)}}const g=S=>{t.client.permission.respond(S).catch(()=>{u.delete(S.permissionID)})};function y(S,I){const A=Date.now(),D=u.has(S.id);u.delete(S.id),u.set(S.id,A),m(A),!D&&g({sessionID:S.sessionID,permissionID:S.id,response:"once",directory:I})}function v(S,I){const A=I?n.child(I,{bootstrap:!1})[0].session:[];return ate(i.autoAccept,A,{sessionID:S},I)}function k(S){return Izt(i.autoAccept,S)}function b(S,I){const A=I?n.child(I,{bootstrap:!1})[0].session:[];return ate(i.autoAccept,A,S,I)}function x(S,I){const A=SR(S,I),D=(h.get(A)??0)+1;return h.set(A,D),D}const w=t.event.listen(S=>{const I=S.details;if(I?.type!=="permission.asked")return;const A=I.properties;b(A,S.name)&&y(A,S.name)});me(w);function M(S){const I=Qp(S);a(Je(A=>{A.autoAccept[I]=!0})),t.client.permission.list({directory:S}).then(A=>{if(k(S))for(const D of A.data??[])D?.id&&b(D,S)&&y(D,S)}).catch(()=>{})}function _(S){const I=Qp(S);a(Je(A=>{A.autoAccept[I]=!1}))}function C(S,I){const A=SR(S,I),D=x(S,I);a(Je(P=>{P.autoAccept[A]=!0,delete P.autoAccept[S]})),t.client.permission.list({directory:I}).then(P=>{if(h.get(A)===D&&v(S,I))for(const O of P.data??[])O?.id&&b(O,I)&&y(O,I)}).catch(()=>{})}function L(S,I){x(S,I);const A=I?SR(S,I):S;a(Je(D=>{D.autoAccept[A]=!1,I&&delete D.autoAccept[S]}))}return{ready:s,respond:g,autoResponds(S,I){return b(S,I)},isAutoAccepting:v,isAutoAcceptingDirectory:k,toggleAutoAccept(S,I){if(v(S,I)){L(S,I);return}C(S,I)},toggleAutoAcceptDirectory(S){if(k(S)){_(S);return}M(S)},enableAutoAccept(S,I){v(S,I)||C(S,I)},disableAutoAccept(S,I){L(S,I)},permissionsEnabled:r,isPermissionAllowAll(S){const[I]=n.child(S),A=I.config.permission;return typeof A=="string"&&A==="allow"}}}}),aU=[{type:"text",content:"",start:0,end:0}];function Ezt(e,t){return!e&&!t?!0:!e||!t?!1:e.startLine===t.startLine&&e.startChar===t.startChar&&e.endLine===t.endLine&&e.endChar===t.endChar}function Pzt(e,t){switch(e.type){case"text":return t.type==="text"&&e.content===t.content;case"file":return t.type==="file"&&e.path===t.path&&Ezt(e.selection,t.selection);case"agent":return t.type==="agent"&&e.name===t.name;case"entity":return t.type==="entity"&&e.entityType===t.entityType&&e.entityId===t.entityId;case"image":return t.type==="image"&&e.id===t.id}}function Dzt(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Pzt(e[n],t[n]))return!1;return!0}function Ozt(e){if(e)return{...e}}function Rzt(e){return e.type==="text"?{...e}:e.type==="image"?{...e}:e.type==="agent"?{...e}:e.type==="entity"?{...e}:{...e,selection:Ozt(e.selection)}}function oU(e){return e.map(Rzt)}function PF(e){if(e.type!=="file")return e.type;const t=e.selection?.startLine,n=e.selection?.endLine,r=`${e.type}:${e.path}:${t}:${n}`;if(e.commentID)return`${r}:c=${e.commentID}`;const i=e.comment?.trim();if(!i)return r;const a=Wh(i)??i;return`${r}:c=${a.slice(0,8)}`}function zzt(e){return e.type==="file"&&!!e.comment?.trim()}function qzt(e){return{set(t,n){const r=oU(t);ct(()=>{e("prompt",r),n!==void 0&&e("cursor",n)})},reset(){ct(()=>{e("prompt",oU(aU)),e("cursor",0)})}}}const jzt="__workspace__",Hzt=20;function Fzt(e,t){const n=`${e}/prompt${t?"/"+t:""}.v2`,[r,i,a,o]=Jn(In.scoped(e,t,"prompt",[n]),nt({prompt:oU(aU),cursor:void 0,context:{items:[]}})),s=qzt(i);return{ready:o,current:Z(()=>r.prompt),cursor:Z(()=>r.cursor),dirty:Z(()=>!Dzt(r.prompt,aU)),context:{items:Z(()=>r.context.items),add(l){const c=PF(l);r.context.items.find(u=>u.key===c)||i("context","items",u=>[...u,{key:c,...l}])},remove(l){i("context","items",c=>c.filter(u=>u.key!==l))},removeComment(l,c){i("context","items",u=>u.filter(h=>!(h.type==="file"&&h.path===l&&h.commentID===c)))},updateComment(l,c,u){i("context","items",h=>h.map(m=>{if(m.type!=="file"||m.path!==l||m.commentID!==c)return m;const g={...m,...u};return{...g,key:PF(g)}}))},replaceComments(l){i("context","items",c=>[...c.filter(u=>!zzt(u)),...l.map(u=>({...u,key:PF(u)}))])}},set:s.set,reset:s.reset}}const{use:mQt,provider:Vzt}=Nn({name:"Prompt",gate:!1,init:()=>{const e=di(),t=new Map;me(()=>{for(const l of t.values())l.dispose();t.clear()});const r=()=>{for(;t.size>Hzt;){const l=t.keys().next().value;if(!l)return;t.get(l)?.dispose(),t.delete(l)}},i=qa(),a=(l,c)=>{const u=`${l}:${c??jzt}`,h=t.get(u);if(h)return t.delete(u),t.set(u,h),h.value;const m=wr(g=>({value:Fzt(l,c),dispose:g}),i);return t.set(u,m),r(),m.value},o=Z(()=>a(e.dir,e.id)),s=l=>l?a(l.dir,l.id):o();return{ready:()=>o().ready(),current:()=>o().current(),cursor:()=>o().cursor(),dirty:()=>o().dirty(),context:{items:()=>o().context.items(),add:l=>o().context.add(l),remove:l=>o().context.remove(l),removeComment:(l,c)=>o().context.removeComment(l,c),updateComment:(l,c,u)=>o().context.updateComment(l,c,u),replaceComments:l=>o().context.replaceComments(l)},set:(l,c,u)=>s(u).set(l,c),reset:l=>s(l).reset()}}}),Xfe="Terminal {{number}}",Bzt=[Xfe,"محطة طرفية {{number}}","Терминал {{number}}","ターミナル {{number}}","터미널 {{number}}","เทอร์มินัล {{number}}","终端 {{number}}","終端機 {{number}}"];function ote(e){return Xfe.replace("{{number}}",String(e))}function Uzt(e,t){return Bzt.some(n=>e===n.replace("{{number}}",String(t)))}function Wzt(e,t){return Array.from({length:t},(n,r)=>r+1).find(n=>Uzt(e,n))}const Gzt="__workspace__",Yfe=20;function Jfe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function CR(e){return typeof e=="string"?e:void 0}function hp(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function Qfe(e){return Wzt(e,Yfe)}function Zzt(e){if(!Jfe(e))return;const t=CR(e.id);if(!t)return;const n=CR(e.title)??"",r=hp(e.titleNumber),i=hp(e.rows),a=hp(e.cols),o=CR(e.buffer),s=hp(e.scrollY),l=hp(e.cursor);return{id:t,title:n,titleNumber:r&&r>0?r:Qfe(n)??0,...i!==void 0?{rows:i}:{},...a!==void 0?{cols:a}:{},...o!==void 0?{buffer:o}:{},...s!==void 0?{scrollY:s}:{},...l!==void 0?{cursor:l}:{}}}function Kzt(e){if(!Jfe(e))return e;const t=new Set,n=(Array.isArray(e.all)?e.all:[]).flatMap(i=>{const a=Zzt(i);return!a||t.has(a.id)?[]:(t.add(a.id),[a])}),r=CR(e.active);return{active:r&&t.has(r)?r:n[0]?.id,all:n}}function epe(e){return`${e}:${Gzt}`}function sU(e,t){return t?[`${e}/terminal/${t}.v1`,`${e}/terminal.v1`]:[`${e}/terminal.v1`]}const lU=new Set,DF=e=>!e.buffer&&e.cursor===void 0&&e.scrollY===void 0?e:{...e,buffer:void 0,cursor:void 0,scrollY:void 0};function Xzt(e,t,n){const r=epe(e);for(const a of lU)a.get(r)?.value.clear();Mz(In.workspace(e,"terminal"),n);const i=new Set(sU(e));for(const a of t??[])for(const o of sU(e,a))i.add(o);for(const a of i)Mz({key:a},n)}function Yzt(e,t,n){const r=xo(t)??t,i=r.replace(/\/+$/,"").split("/").at(-1)||r.split("\\").at(-1)||r,a=sU(t,n),[o,s,l,c]=Jn({...In.workspace(t,"terminal",a),migrate:Kzt},nt({all:[]})),u=()=>{const w=new Set(o.all.flatMap(M=>{const _=Number.isFinite(M.titleNumber)&&M.titleNumber>0?M.titleNumber:void 0;if(_!==void 0)return[_];const C=Qfe(M.title);return C===void 0?[]:[C]}));return Array.from({length:w.size+1},(M,_)=>_+1).find(M=>!w.has(M))??1},h=w=>{const M=o.all,_=M.findIndex(L=>L.id===w);if(_===-1)return;const C=o.active===w?_===0?M[1]?.id:M[0]?.id:o.active;ct(()=>{s("active",C),s("all",Je(L=>{L.splice(_,1)}))})},m=e.event.on("pty.exited",w=>{h(w.properties.id)});me(m);const g=(w,M)=>{const _=o.all.findIndex(L=>L.id===M.id),C=_>=0?o.all[_]:void 0;_>=0&&s("all",_,L=>({...L,...M})),w.pty.update({ptyID:M.id,title:M.title,size:M.cols&&M.rows?{rows:M.rows,cols:M.cols}:void 0}).catch(L=>{if(C){const S=o.all.findIndex(I=>I.id===M.id);S>=0&&s("all",S,C)}console.error("Failed to update terminal",L)})},y=async(w,M)=>{const _=o.all.findIndex(I=>I.id===M),C=o.all[_];if(!C)return;const L=await w.pty.create({title:C.title}).catch(I=>{console.error("Failed to clone terminal",I)});if(!L?.data)return;const S=o.active===C.id;ct(()=>{s("all",_,{id:L.data.id,title:L.data.title??C.title,titleNumber:C.titleNumber,buffer:void 0,cursor:void 0,scrollY:void 0,rows:void 0,cols:void 0}),S&&s("active",L.data.id)})},v=(w,M,_=null,C=null)=>w.type==="leaf"?null:w.a.type==="leaf"&&w.a.ptyId===M?{parent:w,grandparent:_,parentSide:C,leafSide:"a"}:w.b.type==="leaf"&&w.b.ptyId===M?{parent:w,grandparent:_,parentSide:C,leafSide:"b"}:v(w.a,M,w,"a")??v(w.b,M,w,"b"),k=(w,M,_)=>w.type==="leaf"?w.ptyId===M?_:w:{...w,a:k(w.a,M,_),b:k(w.b,M,_)},b=(w,M,_)=>w===M?_:w.type==="leaf"?w:{...w,a:b(w.a,M,_),b:b(w.b,M,_)},x=w=>w.type==="leaf"?[w.ptyId]:[...x(w.a),...x(w.b)];return{ready:c,all:Z(()=>o.all),active:Z(()=>o.active),clear(){ct(()=>{s("active",void 0),s("all",[])})},new(){const w=u(),M=i||ote(w);e.client.pty.create({title:M}).then(_=>{const C=_.data?.id;if(!C)return;const L={id:C,title:_.data?.title??M,titleNumber:w};s("all",o.all.length,L),s("active",C)}).catch(_=>{console.error("Failed to create terminal",_)})},update(w){g(e.client,w)},trim(w){const M=o.all.findIndex(_=>_.id===w);M!==-1&&s("all",M,_=>DF(_))},trimAll(){s("all",w=>{const M=w.map(DF);return M.every((_,C)=>_===w[C])?w:M})},async clone(w){await y(e.client,w)},bind(){const w=e.client;return{trim(M){const _=o.all.findIndex(C=>C.id===M);_!==-1&&s("all",_,C=>DF(C))},update(M){g(w,M)},async clone(M){await y(w,M)}}},open(w){s("active",w)},next(){const w=o.all.findIndex(_=>_.id===o.active);if(w===-1)return;const M=(w+1)%o.all.length;s("active",o.all[M]?.id)},previous(){const w=o.all.findIndex(_=>_.id===o.active);if(w===-1)return;const M=w===0?o.all.length-1:w-1;s("active",o.all[M]?.id)},async close(w){const M=o.all.findIndex(_=>_.id===w);M!==-1&&ct(()=>{if(o.active===w){const _=M>0?o.all[M-1]?.id:o.all[1]?.id;s("active",_)}s("all",Je(_=>{_.splice(M,1)}))}),await e.client.pty.remove({ptyID:w}).catch(_=>{console.error("Failed to close terminal",_)})},move(w,M){const _=o.all.findIndex(C=>C.id===w);_!==-1&&s("all",Je(C=>{C.splice(M,0,C.splice(_,1)[0])}))},paneTree:Z(()=>o.paneTree),focusedPane:Z(()=>o.focusedPane??o.active),focusPane(w){s("focusedPane",w)},async split(w,M){const _=u(),C=i||ote(_),L=await e.client.pty.create({title:C}).catch(E=>{console.error("Failed to create terminal for split",E)});if(!L?.data?.id)return;const S={id:L.data.id,title:L.data.title??C,titleNumber:_},I={type:"leaf",ptyId:L.data.id},D={type:"split",direction:M,ratio:.5,a:{type:"leaf",ptyId:w},b:I},P=o.paneTree,O=P?k(P,w,D):D;ct(()=>{s("all",o.all.length,S),s("paneTree",O),s("focusedPane",L.data.id)})},unsplit(w){const M=o.paneTree;if(!M)return;const _=v(M,w);if(!_)return;const{parent:C,leafSide:L}=_,S=L==="a"?C.b:C.a,I=x(S),A=M===C?S:b(M,C,S),D=A.type==="leaf"?void 0:A;ct(()=>{s("paneTree",D),o.focusedPane===w&&s("focusedPane",I[0]),s("all",P=>P.filter(O=>O.id!==w))}),e.client.pty.remove({ptyID:w}).catch(P=>{console.error("Failed to close split pane PTY",P)})},resizePane(w,M){const _=o.paneTree;if(!_)return;const C=v(_,w);if(!C)return;const{parent:L}=C,S=I=>I.type==="leaf"?I:I===L?{...I,ratio:Math.min(.9,Math.max(.1,M))}:{...I,a:S(I.a),b:S(I.b)};s("paneTree",S(_))}}}const{use:gQt,provider:Jzt}=Nn({name:"Terminal",gate:!1,init:()=>{const e=Cf(),t=di(),n=new Map;lU.add(n),me(()=>lU.delete(n)),me(()=>{for(const s of n.values())s.dispose();n.clear()});const i=()=>{for(;n.size>Yfe;){const s=n.keys().next().value;if(!s)return;n.get(s)?.dispose(),n.delete(s)}},a=(s,l)=>{const c=epe(s),u=n.get(c);if(u)return n.delete(c),n.set(c,u),u.value;const h=wr(m=>({value:Yzt(e,s,l),dispose:m}));return n.set(c,h),i(),h.value},o=Z(()=>a(t.dir,t.id));return he(vn(()=>({dir:t.dir,id:t.id}),(s,l)=>{l?.dir&&(s.dir===l.dir&&s.id===l.id||s.dir===l.dir&&s.id||a(l.dir,l.id).trimAll())},{defer:!0})),{ready:()=>o().ready(),all:()=>o().all(),active:()=>o().active(),new:()=>o().new(),update:s=>o().update(s),trim:s=>o().trim(s),trimAll:()=>o().trimAll(),clone:s=>o().clone(s),bind:()=>o(),open:s=>o().open(s),close:s=>o().close(s),move:(s,l)=>o().move(s,l),next:()=>o().next(),previous:()=>o().previous(),paneTree:()=>o().paneTree(),focusedPane:()=>o().focusedPane(),focusPane:s=>o().focusPane(s),split:(s,l)=>o().split(s,l),unsplit:s=>o().unsplit(s),resizePane:(s,l)=>o().resizePane(s,l)}}}),Qzt="/auth/callback",Hg="auth.pendingPrompt",OF="auth.pkceVerifier";function ste(){return`${window.location.origin}${Qzt}`}function eqt(e){try{const t=e.split(".");if(t.length!==3)return{};const n=atob(t[1].replace(/-/g,"+").replace(/_/g,"/"));return JSON.parse(n)}catch{return{}}}const kK=Tt();function tqt(e){const t=T0(),n=void 0,[r,i]=Jn(In.global("auth.state"),nt({ready:!1}));dn(()=>{i("ready",!0),r.state&&r.state.expires<Date.now()&&n&&a()});async function a(){if(!(!n||!r.state?.refresh))try{const k=await n.refresh(r.state.refresh,{access:r.state.access});if(k.err){i("state",void 0);return}k.tokens&&i("state",{...r.state,access:k.tokens.access,refresh:k.tokens.refresh,expires:Date.now()+3600*1e3})}catch{i("state",void 0)}}const o=Z(()=>{if(r.state)return{accountID:r.state.accountID,email:r.state.email}}),s=Z(()=>!!r.state),l=Z(()=>n?!t.isLocal():!1),c=Z(()=>{if(r.state)return r.state.expires<Date.now()&&a(),r.state.access});async function u(k){if(!n)return;k&&localStorage.setItem(Hg,k);const{challenge:b,url:x}=await n.authorize(ste(),"code",{pkce:!0,provider:"github"});b.verifier&&localStorage.setItem(OF,b.verifier),window.location.href=x}function h(){i("state",void 0),localStorage.removeItem(Hg)}async function m(k){if(!n)return;const b=localStorage.getItem(OF)??void 0;localStorage.removeItem(OF);const x=await n.exchange(k,ste(),b);if(x.err){console.error("Auth exchange failed:",x.err);return}const w=eqt(x.tokens.access),_=w.sub?.properties??w;return i("state",{access:x.tokens.access,refresh:x.tokens.refresh,expires:Date.now()+3600*1e3,accountID:_.accountID??"",email:_.email??""}),g()}function g(){return localStorage.getItem(Hg)??void 0}function y(){localStorage.removeItem(Hg)}const v={user:o,isAuthenticated:s,isAuthRequired:l,token:c,login:u,logout:h,handleCallback:m,pendingPrompt:g,clearPendingPrompt:y,ready:()=>r.ready};return d(kK.Provider,{value:v,get children(){return e.children}})}function yQt(){const e=Lt(kK);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function vQt(){return Lt(kK)}const lte=e=>{if(e)return{...e,model:e.model?{...e.model}:e.model}};let Fg;const tpe=()=>typeof window>"u"?!1:window.__opencode_e2e?.model?.enabled===!0,RF=()=>{if(tpe())return window.__opencode_e2e?.model},zF={bind(e,t){const n=RF();n&&(Fg=e,n.controls=t)},set(e,t){const n=RF();!n||Fg!==e||(n.current={...t,model:t.model?{...t.model}:void 0,last:t.last?{...t.last,model:t.last.model?{...t.last.model}:t.last.model}:void 0,pick:lte(t.pick),base:lte(t.base),variants:t.variants?.slice(),models:t.models?.map(r=>({...r})),agents:t.agents?.map(r=>({...r}))})},clear(e){const t=RF();!t||Fg!==e||(Fg=void 0,t.current=void 0,t.controls=void 0)}};function nqt(e){if(e.agent?.variant&&e.agent.model&&e.model?.variants&&e.agent.model.providerID===e.model.providerID&&e.agent.model.modelID===e.model.modelID&&e.agent.variant in e.model.variants)return e.agent.variant}function rqt(e){if(e.selected!==null){if(e.selected&&e.variants.includes(e.selected))return e.selected;if(e.configured&&e.variants.includes(e.configured))return e.configured}}function iqt(e){if(e.variants.length!==0){if(e.selected===null)return e.variants[0];if(e.selected&&e.variants.includes(e.selected)){const t=e.variants.indexOf(e.selected);return t===e.variants.length-1?void 0:e.variants[t+1]}if(e.configured&&e.variants.includes(e.configured)){const t=e.variants.indexOf(e.configured);return t===e.variants.length-1?e.variants[0]:e.variants[t+1]}return e.variants[0]}}const aqt="__workspace__",rh=new Map,Vg=(e,t)=>`${e}
|
|
2523
|
+
${t}`,oqt=e=>{if(!e||typeof e!="object")return{session:{}};const t=e;return t.session&&typeof t.session=="object"?{session:t.session}:!t.pick||typeof t.pick!="object"?{session:{}}:{session:Object.fromEntries(Object.entries(t.pick).filter(([n])=>n!==aqt))}},cte=e=>{if(e)return{...e,model:e.model?{...e.model}:void 0}},{use:kQt,provider:sqt}=Nn({name:"Local",init:()=>{const e=di(),t=Cf(),n=xj(),r=yK(),i=vzt(),a=Z(()=>e.id||void 0),o=Z(()=>n.data.agent.filter(O=>O.mode!=="subagent"&&!O.hidden)),s=Z(()=>new Set(r.connected().map(O=>O.id))),[l,c]=Jn({...In.workspace(t.directory,"model-selection",["model-selection.v1"]),migrate:oqt},nt({session:{}})),[u,h]=nt({current:o()[0]?.name,draft:void 0,last:void 0}),m=O=>!!r.all().find(T=>T.id===O.providerID)?.models[O.modelID]&&s().has(O.providerID),g=(...O)=>{for(const E of O){const T=E();if(T&&m(T))return T}},y=O=>{const E=o();if(E.length!==0)return E.find(T=>T.name===O)??E[0]};he(()=>{const O=o();if(O.length===0){u.current!==void 0&&h("current",void 0);return}O.some(E=>E.name===u.current)||h("current",O[0]?.name)});const v=Z(()=>{const O=a();return O?l.session[O]??rh.get(Vg(t.directory,O)):u.draft});he(()=>{const O=a();if(!O)return;const E=Vg(t.directory,O),T=rh.get(E);if(T){if(l.session[O]!==void 0){rh.delete(E);return}c("session",O,cte(T)),rh.delete(E)}});const k=()=>{if(!n.data.config.model)return;const[O,E]=n.data.config.model.split("/"),T={providerID:O,modelID:E};if(m(T))return T},b=()=>{for(const O of i.recent.list())if(m(O))return O},x=()=>{const O=r.default();for(const E of r.connected()){const T=O[E.id];if(T){const Y={providerID:E.id,modelID:T};if(m(Y))return Y}const R=Object.values(E.models)[0];if(!R)continue;const H={providerID:E.id,modelID:R.id};if(m(H))return H}},w=Z(()=>k()??b()??x()),M={list:o,current(){return y(v()?.agent??u.current)},set(O){const E=y(O);if(!E){h("current",void 0);return}ct(()=>{h("current",E.name),h("last",{type:"agent",agent:E.name,model:E.model,variant:E.variant??null});const T=v(),R={agent:E.name,model:E.model??T?.model,variant:E.variant??T?.variant},H=a();if(H){c("session",H,R);return}h("draft",R)})},move(O){const E=o();if(E.length===0){h("current",void 0);return}let T=E.findIndex(H=>H.name===M.current()?.name)+O;T<0&&(T=E.length-1),T>=E.length&&(T=0);const R=E[T];R&&M.set(R.name)}},_=()=>{const O=g(()=>v()?.model,()=>M.current()?.model,w);if(O)return i.find(O)},C=()=>{const O=M.current(),E=_();if(!(!O||!E))return nqt({agent:{model:O.model,variant:O.variant},model:{providerID:E.provider.id,modelID:E.id,variants:E.variants}})},L=()=>v()?.variant,S=()=>{const O=_();return{agent:M.current()?.name,model:O?{providerID:O.provider.id,modelID:O.id}:void 0,variant:L()}},I=O=>{const E={...v()??{agent:M.current()?.name},...O},T=a();if(T){c("session",T,E);return}h("draft",E)},A=Z(()=>i.recent.list().map(i.find).filter(Boolean)),D={ready:i.ready,current:_,recent:A,list:i.list,cycle(O){const E=A(),T=_();if(!T)return;const R=E.findIndex(j=>j?.provider.id===T.provider.id&&j?.id===T.id);if(R===-1)return;let H=R+O;H<0&&(H=E.length-1),H>=E.length&&(H=0);const Y=E[H];Y&&D.set({providerID:Y.provider.id,modelID:Y.id})},set(O,E){ct(()=>{h("last",{type:"model",agent:M.current()?.name,model:O??null,variant:L()}),I({model:O}),O&&(i.setVisibility(O,!0),E?.recent&&i.recent.push(O))})},visible(O){return i.visible(O)},setVisibility(O,E){i.setVisibility(O,E)},variant:{configured:C,selected:L,current(){return rqt({variants:this.list(),selected:this.selected(),configured:this.configured()})},list(){const O=_();return O?.variants?Object.keys(O.variants):[]},set(O){ct(()=>{const E=_();h("last",{type:"variant",agent:M.current()?.name,model:E?{providerID:E.provider.id,modelID:E.id}:null,variant:O??null}),I({variant:O??null})})},cycle(){const O=this.list();O.length!==0&&this.set(iqt({variants:O,selected:this.selected(),configured:this.configured()}))}}},P={slug:Z(()=>St(t.directory)),model:D,agent:M,session:{reset(){h("draft",void 0)},promote(O,E){const T=cte(S());if(T){if(O===t.directory){c("session",E,T),h("draft",void 0);return}rh.set(Vg(O,E),T),h("draft",void 0)}},restore(O){const E=a();E&&O.sessionID===E&&l.session[E]===void 0&&(rh.has(Vg(t.directory,E))||c("session",E,{agent:O.agent,model:O.model,variant:O.variant??null}))}}};if(tpe()){const O=Symbol("model-probe");zF.bind(O,{setAgent:M.set,setModel:D.set,setVariant:D.variant.set}),he(()=>{const E=P.agent.current(),T=P.model.current();zF.set(O,{dir:t.directory,sessionID:a(),last:u.last,agent:E?.name,model:T?{providerID:T.provider.id,modelID:T.id,name:T.name}:void 0,variant:P.model.variant.current()??null,selected:P.model.variant.selected(),configured:P.model.variant.configured(),pick:v(),base:void 0,current:u.current,variants:P.model.variant.list(),models:P.model.list().filter(R=>P.model.visible({providerID:R.provider.id,modelID:R.id})).map(R=>({providerID:R.provider.id,modelID:R.id,name:R.name})),agents:P.agent.list().map(R=>({name:R.name}))})}),me(()=>zF.clear(O))}return P}}),bK=Tt();function lqt(e){const[t,n]=Ce(),[r,i]=nt([]),l={activeIssue:t,setActiveIssue:n,jobs:()=>r,addJob:c=>{const u=crypto.randomUUID();return i(Je(h=>h.push({...c,id:u,startedAt:Date.now()}))),u},updateJob:(c,u)=>{i(h=>h.id===c,Je(h=>Object.assign(h,u)))},removeJob:c=>{i(u=>u.filter(h=>h.id!==c))}};return d(bK.Provider,{value:l,get children(){return e.children}})}function cqt(){const e=Lt(bK);if(!e)throw new Error("ActiveTask context must be used within a context provider");return e}function dqt(){return Lt(bK)}const uqt=5e3;function Nj(e,t,n){const r=new URL(`/trellis${n}`,e);return r.searchParams.set("directory",t),r.toString()}function npe(e,t,n,r){return typeof e=="function"?[e,t,n,r]:[fetch,e,t,n]}function rpe(e,t,n,r,i){return typeof e=="function"?[e,t,n,r,i]:[fetch,e,t,n,r]}async function jt(e,t,n,r){const[i,a,o,s]=npe(e,t,n,r),l=await i(Nj(a,o,s));if(!l.ok)return;const c=await l.text();if(c)try{return JSON.parse(c)}catch(u){console.warn(`[trellis] Failed to parse JSON from ${r}:`,u);return}}async function Gt(e,t,n,r,i){const[a,o,s,l,c]=rpe(e,t,n,r,i),u=await a(Nj(o,s,l),{method:"POST",headers:c?{"Content-Type":"application/json"}:void 0,body:c?JSON.stringify(c):void 0});if(u.ok)return u.json()}async function Bg(e,t,n,r,i){const[a,o,s,l,c]=rpe(e,t,n,r,i),u=await a(Nj(o,s,l),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)});if(u.ok)return u.json()}async function dte(e,t,n,r){const[i,a,o,s]=npe(e,t,n,r),l=await i(Nj(a,o,s),{method:"DELETE"});if(l.ok)return l.json()}const ipe=Nn({name:"Trellis",gate:!1,init:()=>{const e=Cf(),t=dqt(),[n,r]=nt({ready:!1,issues:[],ops:[],decisions:[],dogfood:void 0,workUnits:[],cycles:[],milestones:[],roadmaps:[],telos:void 0,planMode:!1,pendingPlan:void 0,suggestions:[]}),i=async(ue,xe,et)=>{const Dt=t?.addJob({type:ue,label:xe,status:"running"});try{const Sr=await et();return Dt&&t?.removeJob(Dt),Sr}catch(Sr){throw Dt&&t?.updateJob(Dt,{status:"error"}),Sr}},a=Z(()=>e.url),o=Z(()=>e.directory),s=e.fetch,l=async()=>{try{const[ue,xe,et,Dt,Sr,xi,fl,Vf,mn,_i]=await Promise.all([jt(s,a(),o(),"/stats"),jt(s,a(),o(),"/issues"),jt(s,a(),o(),"/dogfood"),jt(s,a(),o(),"/workunits"),jt(s,a(),o(),"/cycles"),jt(s,a(),o(),"/milestones"),jt(s,a(),o(),"/roadmaps"),jt(s,a(),o(),"/telos"),jt(s,a(),o(),"/plans/mode"),jt(s,a(),o(),"/watcher/suggestions")]);if(ue&&r("stats",Ct(ue)),xe&&r("issues",Ct(xe,{key:"id"})),Dt&&r("workUnits",Ct(Dt,{key:"id"})),Sr&&r("cycles",Ct(Sr,{key:"id"})),xi&&r("milestones",Ct(xi,{key:"id"})),fl&&r("roadmaps",Ct(fl,{key:"id"})),r("telos",Vf),r("dogfood",et),r("planMode",mn?.active??!1),_i&&r("suggestions",Ct(_i,{key:"id"})),mn?.active){const Bf=await jt(s,a(),o(),"/plans/pending");r("pendingPlan",Bf??void 0)}else r("pendingPlan",void 0);r("ready",!0),r("error",void 0)}catch(ue){r("error",String(ue))}},c=async ue=>n.issues.find(xe=>xe.id===ue),u=async ue=>i("criteria","Running criteria...",async()=>{try{const xe=await s(`${a()}/trellis/issues/${ue}/check?directory=${encodeURIComponent(o())}`,{method:"POST"});if(!xe.ok)throw new Error("Failed to run criteria");return xe.json()}catch{return console.warn("Criteria check endpoint not available, will refresh to get latest status"),{success:!1,error:"Endpoint not available"}}}),h=async(ue,xe)=>{const et=n.issues.findIndex(Sr=>Sr.id===ue);et>=0&&r("issues",et,"status",xe);const Dt=await Bg(s,a(),o(),`/issues/${ue}`,{status:xe});return Dt&&await l(),{success:!!Dt}},m=async(ue,xe)=>{const et=await Bg(s,a(),o(),`/issues/${ue}`,xe);return et&&await l(),et},g=async ue=>{const xe=await Gt(s,a(),o(),`/issues/${ue}/start`);return xe&&await l(),xe},y=async(ue,xe)=>{const et=await Gt(s,a(),o(),`/issues/${ue}/pause`,xe?{note:xe}:void 0);return et&&await l(),et},v=async ue=>{const xe=await Gt(s,a(),o(),`/issues/${ue}/resume`);return xe&&await l(),xe},k=async ue=>{const xe=await Gt(s,a(),o(),`/issues/${ue}/triage`);return xe&&await l(),xe},b=async(ue,xe)=>{const et=await Gt(s,a(),o(),`/issues/${ue}/close`,{confirm:xe});return et&&await l(),et},x=async ue=>{const xe=await Gt(s,a(),o(),`/issues/${ue}/reopen`);return xe&&await l(),xe},w=async(ue,xe)=>{const et=await Gt(s,a(),o(),`/issues/${ue}/assign`,{agent:xe});return et&&await l(),et},M=async(ue,xe,et)=>{const Dt=await Gt(a(),o(),`/issues/${ue}/criteria`,{description:xe,command:et});return Dt&&await l(),Dt},_=async(ue,xe)=>{const et=[];ue&&et.push(`limit=${ue}`),xe&&et.push(`file=${encodeURIComponent(xe)}`);const Dt=et.length?`?${et.join("&")}`:"",Sr=await jt(a(),o(),`/ops${Dt}`);return Sr&&r("ops",Ct(Sr,{key:"hash"})),Sr??[]},C=async ue=>{const xe=[];ue?.tool&&xe.push(`tool=${encodeURIComponent(ue.tool)}`),ue?.agent&&xe.push(`agent=${encodeURIComponent(ue.agent)}`),ue?.limit&&xe.push(`limit=${ue.limit}`);const et=xe.length?`?${xe.join("&")}`:"",Dt=await jt(a(),o(),`/decisions${et}`);return Dt&&r("decisions",Ct(Dt,{key:"id"})),Dt??[]},L=async ue=>await jt(a(),o(),`/decisions/chain/${encodeURIComponent(ue)}`)??[],S=async()=>await jt(a(),o(),"/branches")??[],I=async ue=>Gt(a(),o(),"/branches",{name:ue}),A=async ue=>i("sync",`Switching to ${ue}...`,()=>Gt(a(),o(),"/branches/switch",{name:ue})),D=async()=>await jt(a(),o(),"/milestones")??[],P=async ue=>await jt(a(),o(),`/backlinks/${encodeURIComponent(ue)}`)??[],O=async ue=>await jt(a(),o(),`/refs/${encodeURIComponent(ue)}`)??{outgoing:[],incoming:[]},E=async ue=>jt(a(),o(),`/store/entity/${encodeURIComponent(ue)}`),T=async()=>await jt(a(),o(),"/graph")??{nodes:[],edges:[],hiddenFiles:0,hiddenDirs:0,hiddenNodes:0},R=async(ue,xe)=>Gt(a(),o(),"/sprites",{name:ue,...xe}),H=async ue=>i("sync","Creating milestone...",()=>Gt(a(),o(),"/milestones",{message:ue})),Y=async ue=>{const xe=[];ue?.status&&xe.push(`status=${encodeURIComponent(ue.status)}`),ue?.keyword&&xe.push(`keyword=${encodeURIComponent(ue.keyword)}`),ue?.file&&xe.push(`file=${encodeURIComponent(ue.file)}`),ue?.limit&&xe.push(`limit=${ue.limit}`);const et=xe.length?`?${xe.join("&")}`:"";return await jt(a(),o(),`/garden${et}`)??[]},j=async()=>jt(a(),o(),"/garden/stats"),X=async ue=>Gt(a(),o(),`/garden/${encodeURIComponent(ue)}/revive`),W=async()=>jt(a(),o(),"/eval/summary"),G=async ue=>jt(a(),o(),`/eval/agent/${encodeURIComponent(ue)}`),J=async ue=>jt(a(),o(),`/eval/issue/${encodeURIComponent(ue)}`),oe=async()=>jt(a(),o(),"/dogfood"),de=async()=>i("criteria","Running dogfood eval...",()=>Gt(a(),o(),"/dogfood/run")),ye=async ue=>{const xe=await Gt(a(),o(),"/workunits",ue);return xe&&await l(),xe},ve=async(ue,xe)=>{const et=await Bg(a(),o(),`/workunits/${ue}`,xe);return et&&await l(),et},le=async ue=>{const xe=await dte(a(),o(),`/workunits/${ue}`);return xe&&await l(),xe},pe=async ue=>{const xe=await Gt(a(),o(),"/cycles",ue);return xe&&await l(),xe},Ee=async ue=>{const xe=await Gt(a(),o(),"/milestones",ue);return xe&&await l(),xe},Re=async ue=>{const xe=await Gt(a(),o(),"/roadmaps",ue);return xe&&await l(),xe},wt=async(ue,xe)=>{const et=await Gt(a(),o(),"/telos",{mission:ue,vision:xe});return et&&await l(),et},Ue=async ue=>dte(a(),o(),`/branches/${encodeURIComponent(ue)}`),V=async(ue,xe)=>Gt(a(),o(),`/issues/${ue}/block`,{blockedBy:xe}),Fe=async(ue,xe)=>Gt(a(),o(),`/issues/${ue}/unblock`,{blockedBy:xe}),ze=async ue=>{const xe=await Gt(a(),o(),"/issues",ue);return xe&&await l(),xe},At=async ue=>{const xe=ue?`?status=${encodeURIComponent(ue)}`:"";return await jt(a(),o(),`/plans${xe}`)??[]},De=async(ue,xe)=>{const et=await Gt(a(),o(),"/plans/enter",{title:ue,description:xe});return et&&await l(),et},Nt=async()=>{const ue=await Gt(a(),o(),"/plans/submit");return ue&&await l(),ue},jn=async()=>{const ue=await Gt(a(),o(),"/plans/approve");return ue&&await l(),ue},ui=async ue=>{const xe=await Gt(a(),o(),"/plans/reject",{reason:ue});return xe&&await l(),xe},Mr=async()=>{const ue=await Gt(a(),o(),"/plans/cancel");return ue&&await l(),ue},hi=async ue=>{const xe=await Gt(a(),o(),`/watcher/suggestions/${encodeURIComponent(ue)}/dismiss`);return xe&&await l(),xe},yn=async()=>await jt(a(),o(),"/watcher/rules")??[],Hn=async()=>await jt(a(),o(),"/garden/ideas")??[],en=async ue=>Gt(a(),o(),`/garden/ideas/${encodeURIComponent(ue)}/resurrect`),tn=async ue=>{const xe=ue?`?status=${encodeURIComponent(ue)}`:"";return await jt(a(),o(),`/conversations${xe}`)??[]},Vt=async(ue,xe)=>Gt(a(),o(),"/conversations",{title:ue,...xe}),Ja=async(ue,xe,et)=>{const Dt=await Bg(a(),o(),`/issues/${ue}/criteria/${xe}`,{status:et});return Dt&&await l(),Dt},pa=async ue=>i("criteria","Running criteria...",async()=>{const xe=await Gt(a(),o(),`/issues/${ue}/criteria/run`);return xe&&await l(),xe}),Br=async ue=>jt(a(),o(),`/diff/op/${encodeURIComponent(ue)}`),mr=async(ue,xe)=>{const et=new URLSearchParams;et.set("directory",o()),et.set("a",ue),et.set("b",xe);const Dt=await fetch(`${a()}/trellis/diff/branches?${et}`);if(Dt.ok)return Dt.json()},Ur=async()=>await jt(a(),o(),"/issues/active")??[],fi=async()=>jt(a(),o(),"/workspace/config");let An;he(()=>{a(),o(),l(),An&&clearInterval(An),An=setInterval(l,uqt)}),me(()=>{An&&clearInterval(An)});const ma=Z(()=>n.issues.filter(ue=>ue.status==="in_progress")),hl=Z(()=>{if(n.ops.length!==0)return n.ops[n.ops.length-1]});return{get ready(){return n.ready},get error(){return n.error},get stats(){return n.stats},get issues(){return n.issues},get ops(){return n.ops},get decisions(){return n.decisions},get dogfood(){return n.dogfood},inProgressIssues:ma,latestOp:hl,refresh:l,getIssue:c,runCriteria:u,updateIssueStatus:h,updateIssue:m,createIssue:ze,startIssue:g,pauseIssue:y,resumeIssue:v,triageIssue:k,closeIssue:b,reopenIssue:x,assignIssue:w,addCriterion:M,fetchOps:_,fetchDecisions:C,fetchDecisionChain:L,fetchBranches:S,createBranch:I,switchBranch:A,fetchMilestones:D,createMilestone:H,fetchBacklinks:P,fetchRefs:O,fetchEntity:E,fetchGraph:T,createSprite:R,fetchGarden:Y,fetchGardenStats:j,reviveCluster:X,deleteBranch:Ue,blockIssue:V,unblockIssue:Fe,fetchEvalSummary:W,fetchAgentReport:G,fetchIssueScore:J,fetchDogfood:oe,triggerDogfood:de,createWorkUnit:ye,updateWorkUnit:ve,deleteWorkUnit:le,createCycle:pe,createMilestoneEpic:Ee,createRoadmap:Re,setTelos:wt,get workUnits(){return n.workUnits},get cycles(){return n.cycles},get milestones(){return n.milestones},get roadmaps(){return n.roadmaps},get telos(){return n.telos},get planMode(){return n.planMode},get pendingPlan(){return n.pendingPlan},get suggestions(){return n.suggestions},fetchPlans:At,enterPlanMode:De,submitPlan:Nt,approvePlan:jn,rejectPlan:ui,cancelPlan:Mr,dismissSuggestion:hi,fetchWatcherRules:yn,fetchIdeas:Hn,resurrectIdea:en,fetchConversations:tn,createConversation:Vt,setCriterionStatus:Ja,runAllCriteria:pa,diffFromOp:Br,diffBranches:mr,fetchActiveIssues:Ur,fetchWorkspaceConfig:fi}}}),ape=ipe.use,hqt=ipe.provider;function ope(){try{return ape()}catch{return}}var fqt=ie("<input data-component=inline-input>");function LR(e){const[t,n]=Se(e,["class","width","style"]),r=()=>t.style?typeof t.style=="string"?t.width?`${t.style};width:${t.width}`:t.style:t.width?{...t.style,width:t.width}:t.style:{width:t.width};return(()=>{var i=fqt();return ki(i,f({get class(){return t.class},get style(){return r()}},n),!1,!1),i})()}/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:spe,setPrototypeOf:ute,isFrozen:pqt,getPrototypeOf:mqt,getOwnPropertyDescriptor:gqt}=Object;let{freeze:ai,seal:da,create:cU}=Object,{apply:dU,construct:uU}=typeof Reflect<"u"&&Reflect;ai||(ai=function(t){return t});da||(da=function(t){return t});dU||(dU=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;a<r;a++)i[a-2]=arguments[a];return t.apply(n,i)});uU||(uU=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new t(...r)});const Ug=oi(Array.prototype.forEach),yqt=oi(Array.prototype.lastIndexOf),hte=oi(Array.prototype.pop),fp=oi(Array.prototype.push),vqt=oi(Array.prototype.splice),IR=oi(String.prototype.toLowerCase),qF=oi(String.prototype.toString),jF=oi(String.prototype.match),pp=oi(String.prototype.replace),kqt=oi(String.prototype.indexOf),bqt=oi(String.prototype.trim),Sa=oi(Object.prototype.hasOwnProperty),Gr=oi(RegExp.prototype.test),mp=wqt(TypeError);function oi(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return dU(e,t,r)}}function wqt(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return uU(e,n)}}function $t(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:IR;ute&&ute(e,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const a=n(i);a!==i&&(pqt(t)||(t[r]=a),i=a)}e[i]=!0}return e}function xqt(e){for(let t=0;t<e.length;t++)Sa(e,t)||(e[t]=null);return e}function uo(e){const t=cU(null);for(const[n,r]of spe(e))Sa(e,n)&&(Array.isArray(r)?t[n]=xqt(r):r&&typeof r=="object"&&r.constructor===Object?t[n]=uo(r):t[n]=r);return t}function gp(e,t){for(;e!==null;){const r=gqt(e,t);if(r){if(r.get)return oi(r.get);if(typeof r.value=="function")return oi(r.value)}e=mqt(e)}function n(){return null}return n}const fte=ai(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),HF=ai(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),FF=ai(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),_qt=ai(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),VF=ai(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Mqt=ai(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),pte=ai(["#text"]),mte=ai(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),BF=ai(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),gte=ai(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Wg=ai(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Sqt=da(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Cqt=da(/<%[\w\W]*|[\w\W]*%>/gm),Lqt=da(/\$\{[\w\W]*/gm),Iqt=da(/^data-[\-\w.\u00B7-\uFFFF]+$/),Nqt=da(/^aria-[\-\w]+$/),lpe=da(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Aqt=da(/^(?:\w+script|data):/i),$qt=da(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),cpe=da(/^html$/i),Tqt=da(/^[a-z][.\w]*(-[.\w]+)+$/i);var yte=Object.freeze({__proto__:null,ARIA_ATTR:Nqt,ATTR_WHITESPACE:$qt,CUSTOM_ELEMENT:Tqt,DATA_ATTR:Iqt,DOCTYPE_NAME:cpe,ERB_EXPR:Cqt,IS_ALLOWED_URI:lpe,IS_SCRIPT_OR_DATA:Aqt,MUSTACHE_EXPR:Sqt,TMPLIT_EXPR:Lqt});const yp={element:1,text:3,progressingInstruction:7,comment:8,document:9},Eqt=function(){return typeof window>"u"?null:window},Pqt=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));const a="dompurify"+(r?"#"+r:"");try{return t.createPolicy(a,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+a+" could not be created."),null}},vte=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function dpe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Eqt();const t=We=>dpe(We);if(t.version="3.3.1",t.removed=[],!e||!e.document||e.document.nodeType!==yp.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const r=n,i=r.currentScript,{DocumentFragment:a,HTMLTemplateElement:o,Node:s,Element:l,NodeFilter:c,NamedNodeMap:u=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:m,trustedTypes:g}=e,y=l.prototype,v=gp(y,"cloneNode"),k=gp(y,"remove"),b=gp(y,"nextSibling"),x=gp(y,"childNodes"),w=gp(y,"parentNode");if(typeof o=="function"){const We=n.createElement("template");We.content&&We.content.ownerDocument&&(n=We.content.ownerDocument)}let M,_="";const{implementation:C,createNodeIterator:L,createDocumentFragment:S,getElementsByTagName:I}=n,{importNode:A}=r;let D=vte();t.isSupported=typeof spe=="function"&&typeof w=="function"&&C&&C.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:P,ERB_EXPR:O,TMPLIT_EXPR:E,DATA_ATTR:T,ARIA_ATTR:R,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:Y,CUSTOM_ELEMENT:j}=yte;let{IS_ALLOWED_URI:X}=yte,W=null;const G=$t({},[...fte,...HF,...FF,...VF,...pte]);let J=null;const oe=$t({},[...mte,...BF,...gte,...Wg]);let de=Object.seal(cU(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ye=null,ve=null;const le=Object.seal(cU(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let pe=!0,Ee=!0,Re=!1,wt=!0,Ue=!1,V=!0,Fe=!1,ze=!1,At=!1,De=!1,Nt=!1,jn=!1,ui=!0,Mr=!1;const hi="user-content-";let yn=!0,Hn=!1,en={},tn=null;const Vt=$t({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ja=null;const pa=$t({},["audio","video","img","source","image","track"]);let Br=null;const mr=$t({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ur="http://www.w3.org/1998/Math/MathML",fi="http://www.w3.org/2000/svg",An="http://www.w3.org/1999/xhtml";let ma=An,hl=!1,ue=null;const xe=$t({},[Ur,fi,An],qF);let et=$t({},["mi","mo","mn","ms","mtext"]),Dt=$t({},["annotation-xml"]);const Sr=$t({},["title","style","font","a","script"]);let xi=null;const fl=["application/xhtml+xml","text/html"],Vf="text/html";let mn=null,_i=null;const Bf=n.createElement("form"),Uf=function(te){return te instanceof RegExp||te instanceof Function},ga=function(){let te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(_i&&_i===te)){if((!te||typeof te!="object")&&(te={}),te=uo(te),xi=fl.indexOf(te.PARSER_MEDIA_TYPE)===-1?Vf:te.PARSER_MEDIA_TYPE,mn=xi==="application/xhtml+xml"?qF:IR,W=Sa(te,"ALLOWED_TAGS")?$t({},te.ALLOWED_TAGS,mn):G,J=Sa(te,"ALLOWED_ATTR")?$t({},te.ALLOWED_ATTR,mn):oe,ue=Sa(te,"ALLOWED_NAMESPACES")?$t({},te.ALLOWED_NAMESPACES,qF):xe,Br=Sa(te,"ADD_URI_SAFE_ATTR")?$t(uo(mr),te.ADD_URI_SAFE_ATTR,mn):mr,Ja=Sa(te,"ADD_DATA_URI_TAGS")?$t(uo(pa),te.ADD_DATA_URI_TAGS,mn):pa,tn=Sa(te,"FORBID_CONTENTS")?$t({},te.FORBID_CONTENTS,mn):Vt,ye=Sa(te,"FORBID_TAGS")?$t({},te.FORBID_TAGS,mn):uo({}),ve=Sa(te,"FORBID_ATTR")?$t({},te.FORBID_ATTR,mn):uo({}),en=Sa(te,"USE_PROFILES")?te.USE_PROFILES:!1,pe=te.ALLOW_ARIA_ATTR!==!1,Ee=te.ALLOW_DATA_ATTR!==!1,Re=te.ALLOW_UNKNOWN_PROTOCOLS||!1,wt=te.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ue=te.SAFE_FOR_TEMPLATES||!1,V=te.SAFE_FOR_XML!==!1,Fe=te.WHOLE_DOCUMENT||!1,De=te.RETURN_DOM||!1,Nt=te.RETURN_DOM_FRAGMENT||!1,jn=te.RETURN_TRUSTED_TYPE||!1,At=te.FORCE_BODY||!1,ui=te.SANITIZE_DOM!==!1,Mr=te.SANITIZE_NAMED_PROPS||!1,yn=te.KEEP_CONTENT!==!1,Hn=te.IN_PLACE||!1,X=te.ALLOWED_URI_REGEXP||lpe,ma=te.NAMESPACE||An,et=te.MATHML_TEXT_INTEGRATION_POINTS||et,Dt=te.HTML_INTEGRATION_POINTS||Dt,de=te.CUSTOM_ELEMENT_HANDLING||{},te.CUSTOM_ELEMENT_HANDLING&&Uf(te.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(de.tagNameCheck=te.CUSTOM_ELEMENT_HANDLING.tagNameCheck),te.CUSTOM_ELEMENT_HANDLING&&Uf(te.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(de.attributeNameCheck=te.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),te.CUSTOM_ELEMENT_HANDLING&&typeof te.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(de.allowCustomizedBuiltInElements=te.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Ue&&(Ee=!1),Nt&&(De=!0),en&&(W=$t({},pte),J=[],en.html===!0&&($t(W,fte),$t(J,mte)),en.svg===!0&&($t(W,HF),$t(J,BF),$t(J,Wg)),en.svgFilters===!0&&($t(W,FF),$t(J,BF),$t(J,Wg)),en.mathMl===!0&&($t(W,VF),$t(J,gte),$t(J,Wg))),te.ADD_TAGS&&(typeof te.ADD_TAGS=="function"?le.tagCheck=te.ADD_TAGS:(W===G&&(W=uo(W)),$t(W,te.ADD_TAGS,mn))),te.ADD_ATTR&&(typeof te.ADD_ATTR=="function"?le.attributeCheck=te.ADD_ATTR:(J===oe&&(J=uo(J)),$t(J,te.ADD_ATTR,mn))),te.ADD_URI_SAFE_ATTR&&$t(Br,te.ADD_URI_SAFE_ATTR,mn),te.FORBID_CONTENTS&&(tn===Vt&&(tn=uo(tn)),$t(tn,te.FORBID_CONTENTS,mn)),te.ADD_FORBID_CONTENTS&&(tn===Vt&&(tn=uo(tn)),$t(tn,te.ADD_FORBID_CONTENTS,mn)),yn&&(W["#text"]=!0),Fe&&$t(W,["html","head","body"]),W.table&&($t(W,["tbody"]),delete ye.tbody),te.TRUSTED_TYPES_POLICY){if(typeof te.TRUSTED_TYPES_POLICY.createHTML!="function")throw mp('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof te.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw mp('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');M=te.TRUSTED_TYPES_POLICY,_=M.createHTML("")}else M===void 0&&(M=Pqt(g,i)),M!==null&&typeof _=="string"&&(_=M.createHTML(""));ai&&ai(te),_i=te}},z0=$t({},[...HF,...FF,..._qt]),Wf=$t({},[...VF,...Mqt]),$m=function(te){let Ne=w(te);(!Ne||!Ne.tagName)&&(Ne={namespaceURI:ma,tagName:"template"});const Ge=IR(te.tagName),an=IR(Ne.tagName);return ue[te.namespaceURI]?te.namespaceURI===fi?Ne.namespaceURI===An?Ge==="svg":Ne.namespaceURI===Ur?Ge==="svg"&&(an==="annotation-xml"||et[an]):!!z0[Ge]:te.namespaceURI===Ur?Ne.namespaceURI===An?Ge==="math":Ne.namespaceURI===fi?Ge==="math"&&Dt[an]:!!Wf[Ge]:te.namespaceURI===An?Ne.namespaceURI===fi&&!Dt[an]||Ne.namespaceURI===Ur&&!et[an]?!1:!Wf[Ge]&&(Sr[Ge]||!z0[Ge]):!!(xi==="application/xhtml+xml"&&ue[te.namespaceURI]):!1},Mi=function(te){fp(t.removed,{element:te});try{w(te).removeChild(te)}catch{k(te)}},ya=function(te,Ne){try{fp(t.removed,{attribute:Ne.getAttributeNode(te),from:Ne})}catch{fp(t.removed,{attribute:null,from:Ne})}if(Ne.removeAttribute(te),te==="is")if(De||Nt)try{Mi(Ne)}catch{}else try{Ne.setAttribute(te,"")}catch{}},Gf=function(te){let Ne=null,Ge=null;if(At)te="<remove></remove>"+te;else{const wn=jF(te,/^[\r\n\t ]+/);Ge=wn&&wn[0]}xi==="application/xhtml+xml"&&ma===An&&(te='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+te+"</body></html>");const an=M?M.createHTML(te):te;if(ma===An)try{Ne=new m().parseFromString(an,xi)}catch{}if(!Ne||!Ne.documentElement){Ne=C.createDocument(ma,"template",null);try{Ne.documentElement.innerHTML=hl?_:an}catch{}}const nr=Ne.body||Ne.documentElement;return te&&Ge&&nr.insertBefore(n.createTextNode(Ge),nr.childNodes[0]||null),ma===An?I.call(Ne,Fe?"html":"body")[0]:Fe?Ne.documentElement:nr},Tm=function(te){return L.call(te.ownerDocument||te,te,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},pl=function(te){return te instanceof h&&(typeof te.nodeName!="string"||typeof te.textContent!="string"||typeof te.removeChild!="function"||!(te.attributes instanceof u)||typeof te.removeAttribute!="function"||typeof te.setAttribute!="function"||typeof te.namespaceURI!="string"||typeof te.insertBefore!="function"||typeof te.hasChildNodes!="function")},ml=function(te){return typeof s=="function"&&te instanceof s};function Bi(We,te,Ne){Ug(We,Ge=>{Ge.call(t,te,Ne,_i)})}const Zf=function(te){let Ne=null;if(Bi(D.beforeSanitizeElements,te,null),pl(te))return Mi(te),!0;const Ge=mn(te.nodeName);if(Bi(D.uponSanitizeElement,te,{tagName:Ge,allowedTags:W}),V&&te.hasChildNodes()&&!ml(te.firstElementChild)&&Gr(/<[/\w!]/g,te.innerHTML)&&Gr(/<[/\w!]/g,te.textContent)||te.nodeType===yp.progressingInstruction||V&&te.nodeType===yp.comment&&Gr(/<[/\w]/g,te.data))return Mi(te),!0;if(!(le.tagCheck instanceof Function&&le.tagCheck(Ge))&&(!W[Ge]||ye[Ge])){if(!ye[Ge]&&Em(Ge)&&(de.tagNameCheck instanceof RegExp&&Gr(de.tagNameCheck,Ge)||de.tagNameCheck instanceof Function&&de.tagNameCheck(Ge)))return!1;if(yn&&!tn[Ge]){const an=w(te)||te.parentNode,nr=x(te)||te.childNodes;if(nr&&an){const wn=nr.length;for(let rr=wn-1;rr>=0;--rr){const va=v(nr[rr],!0);va.__removalCount=(te.__removalCount||0)+1,an.insertBefore(va,b(te))}}}return Mi(te),!0}return te instanceof l&&!$m(te)||(Ge==="noscript"||Ge==="noembed"||Ge==="noframes")&&Gr(/<\/no(script|embed|frames)/i,te.innerHTML)?(Mi(te),!0):(Ue&&te.nodeType===yp.text&&(Ne=te.textContent,Ug([P,O,E],an=>{Ne=pp(Ne,an," ")}),te.textContent!==Ne&&(fp(t.removed,{element:te.cloneNode()}),te.textContent=Ne)),Bi(D.afterSanitizeElements,te,null),!1)},Kf=function(te,Ne,Ge){if(ui&&(Ne==="id"||Ne==="name")&&(Ge in n||Ge in Bf))return!1;if(!(Ee&&!ve[Ne]&&Gr(T,Ne))){if(!(pe&&Gr(R,Ne))){if(!(le.attributeCheck instanceof Function&&le.attributeCheck(Ne,te))){if(!J[Ne]||ve[Ne]){if(!(Em(te)&&(de.tagNameCheck instanceof RegExp&&Gr(de.tagNameCheck,te)||de.tagNameCheck instanceof Function&&de.tagNameCheck(te))&&(de.attributeNameCheck instanceof RegExp&&Gr(de.attributeNameCheck,Ne)||de.attributeNameCheck instanceof Function&&de.attributeNameCheck(Ne,te))||Ne==="is"&&de.allowCustomizedBuiltInElements&&(de.tagNameCheck instanceof RegExp&&Gr(de.tagNameCheck,Ge)||de.tagNameCheck instanceof Function&&de.tagNameCheck(Ge))))return!1}else if(!Br[Ne]){if(!Gr(X,pp(Ge,Y,""))){if(!((Ne==="src"||Ne==="xlink:href"||Ne==="href")&&te!=="script"&&kqt(Ge,"data:")===0&&Ja[te])){if(!(Re&&!Gr(H,pp(Ge,Y,"")))){if(Ge)return!1}}}}}}}return!0},Em=function(te){return te!=="annotation-xml"&&jF(te,j)},gl=function(te){Bi(D.beforeSanitizeAttributes,te,null);const{attributes:Ne}=te;if(!Ne||pl(te))return;const Ge={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:J,forceKeepAttr:void 0};let an=Ne.length;for(;an--;){const nr=Ne[an],{name:wn,namespaceURI:rr,value:va}=nr,ks=mn(wn),Xf=va;let ir=wn==="value"?Xf:bqt(Xf);if(Ge.attrName=ks,Ge.attrValue=ir,Ge.keepAttr=!0,Ge.forceKeepAttr=void 0,Bi(D.uponSanitizeAttribute,te,Ge),ir=Ge.attrValue,Mr&&(ks==="id"||ks==="name")&&(ya(wn,te),ir=hi+ir),V&&Gr(/((--!?|])>)|<\/(style|title|textarea)/i,ir)){ya(wn,te);continue}if(ks==="attributename"&&jF(ir,"href")){ya(wn,te);continue}if(Ge.forceKeepAttr)continue;if(!Ge.keepAttr){ya(wn,te);continue}if(!wt&&Gr(/\/>/i,ir)){ya(wn,te);continue}Ue&&Ug([P,O,E],Dm=>{ir=pp(ir,Dm," ")});const Fn=mn(te.nodeName);if(!Kf(Fn,ks,ir)){ya(wn,te);continue}if(M&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!rr)switch(g.getAttributeType(Fn,ks)){case"TrustedHTML":{ir=M.createHTML(ir);break}case"TrustedScriptURL":{ir=M.createScriptURL(ir);break}}if(ir!==Xf)try{rr?te.setAttributeNS(rr,wn,ir):te.setAttribute(wn,ir),pl(te)?Mi(te):hte(t.removed)}catch{ya(wn,te)}}Bi(D.afterSanitizeAttributes,te,null)},Pm=function We(te){let Ne=null;const Ge=Tm(te);for(Bi(D.beforeSanitizeShadowDOM,te,null);Ne=Ge.nextNode();)Bi(D.uponSanitizeShadowNode,Ne,null),Zf(Ne),gl(Ne),Ne.content instanceof a&&We(Ne.content);Bi(D.afterSanitizeShadowDOM,te,null)};return t.sanitize=function(We){let te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ne=null,Ge=null,an=null,nr=null;if(hl=!We,hl&&(We="<!-->"),typeof We!="string"&&!ml(We))if(typeof We.toString=="function"){if(We=We.toString(),typeof We!="string")throw mp("dirty is not a string, aborting")}else throw mp("toString is not a function");if(!t.isSupported)return We;if(ze||ga(te),t.removed=[],typeof We=="string"&&(Hn=!1),Hn){if(We.nodeName){const va=mn(We.nodeName);if(!W[va]||ye[va])throw mp("root node is forbidden and cannot be sanitized in-place")}}else if(We instanceof s)Ne=Gf("<!---->"),Ge=Ne.ownerDocument.importNode(We,!0),Ge.nodeType===yp.element&&Ge.nodeName==="BODY"||Ge.nodeName==="HTML"?Ne=Ge:Ne.appendChild(Ge);else{if(!De&&!Ue&&!Fe&&We.indexOf("<")===-1)return M&&jn?M.createHTML(We):We;if(Ne=Gf(We),!Ne)return De?null:jn?_:""}Ne&&At&&Mi(Ne.firstChild);const wn=Tm(Hn?We:Ne);for(;an=wn.nextNode();)Zf(an),gl(an),an.content instanceof a&&Pm(an.content);if(Hn)return We;if(De){if(Nt)for(nr=S.call(Ne.ownerDocument);Ne.firstChild;)nr.appendChild(Ne.firstChild);else nr=Ne;return(J.shadowroot||J.shadowrootmode)&&(nr=A.call(r,nr,!0)),nr}let rr=Fe?Ne.outerHTML:Ne.innerHTML;return Fe&&W["!doctype"]&&Ne.ownerDocument&&Ne.ownerDocument.doctype&&Ne.ownerDocument.doctype.name&&Gr(cpe,Ne.ownerDocument.doctype.name)&&(rr="<!DOCTYPE "+Ne.ownerDocument.doctype.name+`>
|
|
2524
2524
|
`+rr),Ue&&Ug([P,O,E],va=>{rr=pp(rr,va," ")}),M&&jn?M.createHTML(rr):rr},t.setConfig=function(){let We=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ga(We),ze=!0},t.clearConfig=function(){_i=null,ze=!1},t.isValidAttribute=function(We,te,Ne){_i||ga({});const Ge=mn(We),an=mn(te);return Kf(Ge,an,Ne)},t.addHook=function(We,te){typeof te=="function"&&fp(D[We],te)},t.removeHook=function(We,te){if(te!==void 0){const Ne=yqt(D[We],te);return Ne===-1?void 0:vqt(D[We],Ne,1)[0]}return hte(D[We])},t.removeHooks=function(We){D[We]=[]},t.removeAllHooks=function(){D=vte()},t}var Wz=dpe(),kte=11;function Dqt(e,t){var n=t.attributes,r,i,a,o,s;if(!(t.nodeType===kte||e.nodeType===kte)){for(var l=n.length-1;l>=0;l--)r=n[l],i=r.name,a=r.namespaceURI,o=r.value,a?(i=r.localName||i,s=e.getAttributeNS(a,i),s!==o&&(r.prefix==="xmlns"&&(i=r.name),e.setAttributeNS(a,i,o))):(s=e.getAttribute(i),s!==o&&e.setAttribute(i,o));for(var c=e.attributes,u=c.length-1;u>=0;u--)r=c[u],i=r.name,a=r.namespaceURI,a?(i=r.localName||i,t.hasAttributeNS(a,i)||e.removeAttributeNS(a,i)):t.hasAttribute(i)||e.removeAttribute(i)}}var Gg,Oqt="http://www.w3.org/1999/xhtml",ti=typeof document>"u"?void 0:document,Rqt=!!ti&&"content"in ti.createElement("template"),zqt=!!ti&&ti.createRange&&"createContextualFragment"in ti.createRange();function qqt(e){var t=ti.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function jqt(e){Gg||(Gg=ti.createRange(),Gg.selectNode(ti.body));var t=Gg.createContextualFragment(e);return t.childNodes[0]}function Hqt(e){var t=ti.createElement("body");return t.innerHTML=e,t.childNodes[0]}function Fqt(e){return e=e.trim(),Rqt?qqt(e):zqt?jqt(e):Hqt(e)}function Zg(e,t){var n=e.nodeName,r=t.nodeName,i,a;return n===r?!0:(i=n.charCodeAt(0),a=r.charCodeAt(0),i<=90&&a>=97?n===r.toUpperCase():a<=90&&i>=97?r===n.toUpperCase():!1)}function Vqt(e,t){return!t||t===Oqt?ti.createElement(e):ti.createElementNS(t,e)}function Bqt(e,t){for(var n=e.firstChild;n;){var r=n.nextSibling;t.appendChild(n),n=r}return t}function UF(e,t,n){e[n]!==t[n]&&(e[n]=t[n],e[n]?e.setAttribute(n,""):e.removeAttribute(n))}var bte={OPTION:function(e,t){var n=e.parentNode;if(n){var r=n.nodeName.toUpperCase();r==="OPTGROUP"&&(n=n.parentNode,r=n&&n.nodeName.toUpperCase()),r==="SELECT"&&!n.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),n.selectedIndex=-1)}UF(e,t,"selected")},INPUT:function(e,t){UF(e,t,"checked"),UF(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var n=t.value;e.value!==n&&(e.value=n);var r=e.firstChild;if(r){var i=r.nodeValue;if(i==n||!n&&i==e.placeholder)return;r.nodeValue=n}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var n=-1,r=0,i=e.firstChild,a,o;i;)if(o=i.nodeName&&i.nodeName.toUpperCase(),o==="OPTGROUP")a=i,i=a.firstChild,i||(i=a.nextSibling,a=null);else{if(o==="OPTION"){if(i.hasAttribute("selected")){n=r;break}r++}i=i.nextSibling,!i&&a&&(i=a.nextSibling,a=null)}e.selectedIndex=n}}},vp=1,wte=11,xte=3,_te=8;function Cs(){}function Uqt(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function Wqt(e){return function(n,r,i){if(i||(i={}),typeof r=="string")if(n.nodeName==="#document"||n.nodeName==="HTML"){var a=r;r=ti.createElement("html"),r.innerHTML=a}else if(n.nodeName==="BODY"){var o=r;r=ti.createElement("html"),r.innerHTML=o;var s=r.querySelector("body");s&&(r=s)}else r=Fqt(r);else r.nodeType===wte&&(r=r.firstElementChild);var l=i.getNodeKey||Uqt,c=i.onBeforeNodeAdded||Cs,u=i.onNodeAdded||Cs,h=i.onBeforeElUpdated||Cs,m=i.onElUpdated||Cs,g=i.onBeforeNodeDiscarded||Cs,y=i.onNodeDiscarded||Cs,v=i.onBeforeElChildrenUpdated||Cs,k=i.skipFromChildren||Cs,b=i.addChild||function(j,X){return j.appendChild(X)},x=i.childrenOnly===!0,w=Object.create(null),M=[];function _(j){M.push(j)}function C(j,X){if(j.nodeType===vp)for(var W=j.firstChild;W;){var G=void 0;X&&(G=l(W))?_(G):(y(W),W.firstChild&&C(W,X)),W=W.nextSibling}}function L(j,X,W){g(j)!==!1&&(X&&X.removeChild(j),y(j),C(j,W))}function S(j){if(j.nodeType===vp||j.nodeType===wte)for(var X=j.firstChild;X;){var W=l(X);W&&(w[W]=X),S(X),X=X.nextSibling}}S(n);function I(j){u(j);for(var X=j.firstChild;X;){var W=X.nextSibling,G=l(X);if(G){var J=w[G];J&&Zg(X,J)?(X.parentNode.replaceChild(J,X),D(J,X)):I(X)}else I(X);X=W}}function A(j,X,W){for(;X;){var G=X.nextSibling;(W=l(X))?_(W):L(X,j,!0),X=G}}function D(j,X,W){var G=l(X);if(G&&delete w[G],!W){var J=h(j,X);if(J===!1||(J instanceof HTMLElement&&(j=J,S(j)),e(j,X),m(j),v(j,X)===!1))return}j.nodeName!=="TEXTAREA"?P(j,X):bte.TEXTAREA(j,X)}function P(j,X){var W=k(j,X),G=X.firstChild,J=j.firstChild,oe,de,ye,ve,le;e:for(;G;){for(ve=G.nextSibling,oe=l(G);!W&&J;){if(ye=J.nextSibling,G.isSameNode&&G.isSameNode(J)){G=ve,J=ye;continue e}de=l(J);var pe=J.nodeType,Ee=void 0;if(pe===G.nodeType&&(pe===vp?(oe?oe!==de&&((le=w[oe])?ye===le?Ee=!1:(j.insertBefore(le,J),de?_(de):L(J,j,!0),J=le,de=l(J)):Ee=!1):de&&(Ee=!1),Ee=Ee!==!1&&Zg(J,G),Ee&&D(J,G)):(pe===xte||pe==_te)&&(Ee=!0,J.nodeValue!==G.nodeValue&&(J.nodeValue=G.nodeValue))),Ee){G=ve,J=ye;continue e}de?_(de):L(J,j,!0),J=ye}if(oe&&(le=w[oe])&&Zg(le,G))W||b(j,le),D(le,G);else{var Re=c(G);Re!==!1&&(Re&&(G=Re),G.actualize&&(G=G.actualize(j.ownerDocument||ti)),b(j,G),I(G))}G=ve,J=ye}A(j,J,de);var wt=bte[j.nodeName];wt&&wt(j,X)}var O=n,E=O.nodeType,T=r.nodeType;if(!x){if(E===vp)T===vp?Zg(n,r)||(y(n),O=Bqt(n,Vqt(r.nodeName,r.namespaceURI))):O=r;else if(E===xte||E===_te){if(T===E)return O.nodeValue!==r.nodeValue&&(O.nodeValue=r.nodeValue),O;O=r}}if(O===r)y(n);else{if(r.isSameNode&&r.isSameNode(O))return;if(D(O,r,x),M)for(var R=0,H=M.length;R<H;R++){var Y=w[M[R]];Y&&L(Y,Y.parentNode,!1)}}return!x&&O!==n&&n.parentNode&&(O.actualize&&(O=O.actualize(n.ownerDocument||ti)),n.parentNode.replaceChild(O,n)),O}}var Gqt=Wqt(Dqt),Zqt=Object.defineProperty,Kqt=Object.defineProperties,Xqt=Object.getOwnPropertyDescriptors,Mte=Object.getOwnPropertySymbols,Yqt=Object.prototype.hasOwnProperty,Jqt=Object.prototype.propertyIsEnumerable,Ste=(e,t,n)=>t in e?Zqt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,upe=(e,t)=>{for(var n in t||(t={}))Yqt.call(t,n)&&Ste(e,n,t[n]);if(Mte)for(var n of Mte(t))Jqt.call(t,n)&&Ste(e,n,t[n]);return e},hpe=(e,t)=>Kqt(e,Xqt(t)),si=(e,t)=>{let n=!1,r=!1;for(let i=0;i<t;i+=1){if(e[i]==="\\"&&i+1<e.length&&e[i+1]==="`"){i+=1;continue}if(e.substring(i,i+3)==="```"){r=!r,i+=2;continue}!r&&e[i]==="`"&&(n=!n)}return n||r},Qqt=(e,t)=>{let n=e.substring(t,t+3)==="```",r=t>0&&e.substring(t-1,t+2)==="```",i=t>1&&e.substring(t-2,t+1)==="```";return n||r||i},ejt=e=>{let t=0;for(let n=0;n<e.length;n+=1){if(e[n]==="\\"&&n+1<e.length&&e[n+1]==="`"){n+=1;continue}e[n]==="`"&&!Qqt(e,n)&&(t+=1)}return t},Js=(e,t)=>{let n=!1,r=!1,i=-1;for(let a=0;a<e.length;a+=1){if(e[a]==="\\"&&a+1<e.length&&e[a+1]==="`"){a+=1;continue}if(e.substring(a,a+3)==="```"){r=!r,a+=2;continue}if(!r&&e[a]==="`")if(n){if(i<t&&t<a)return!0;n=!1,i=-1}else n=!0,i=a}return!1},tjt=/^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm,njt=e=>!e||typeof e!="string"||!e.includes(">")?e:e.replace(tjt,(t,n,r,i)=>si(e,i)?t:`${n}\\>${r}`),rjt=/(\*\*)([^*]*\*?)$/,ijt=/(__)([^_]*?)$/,ajt=/(\*\*\*)([^*]*?)$/,ojt=/(\*)([^*]*?)$/,sjt=/(_)([^_]*?)$/,ljt=/(`)([^`]*?)$/,cjt=/(~~)([^~]*?)$/,D0=/^[\s_~*`]*$/,fpe=/^[\s]*[-*+][\s]+$/,djt=/[\p{L}\p{N}_]/u,ujt=/^```[^`\n]*```?$/,hjt=/^\*{4,}$/,fjt=/(__)([^_]+)_$/,pjt=/(~~)([^~]+)~$/,Cte=/~~/g,Qs=e=>{if(!e)return!1;let t=e.charCodeAt(0);return t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122||t===95?!0:djt.test(e)},mjt=(e,t)=>{let n=1;for(let r=t-1;r>=0;r-=1)if(e[r]==="]")n+=1;else if(e[r]==="["&&(n-=1,n===0))return r;return-1},ppe=(e,t)=>{let n=1;for(let r=t+1;r<e.length;r+=1)if(e[r]==="[")n+=1;else if(e[r]==="]"&&(n-=1,n===0))return r;return-1},Aj=(e,t)=>{let n=!1,r=!1;for(let i=0;i<e.length&&i<t;i+=1){if(e[i]==="\\"&&e[i+1]==="$"){i+=1;continue}e[i]==="$"&&(e[i+1]==="$"?(r=!r,i+=1,n=!1):r||(n=!n))}return n||r},gjt=(e,t)=>{for(let n=t;n<e.length;n+=1){if(e[n]===")")return!0;if(e[n]===`
|
|
2525
2525
|
`)return!1}return!1},mpe=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===")")return!1;if(e[n]==="(")return n>0&&e[n-1]==="]"?gjt(e,t):!1;if(e[n]===`
|
|
2526
2526
|
`)return!1}return!1},yjt=(e,t)=>{for(let n=t-1;n>=0;n-=1){if(e[n]===">")return!1;if(e[n]==="<"){let r=n+1<e.length?e[n+1]:"";return r>="a"&&r<="z"||r>="A"&&r<="Z"||r==="/"}if(e[n]===`
|
|
@@ -2543,7 +2543,7 @@ $$`:`${e}$$`},Fjt=e=>qjt(e)%2===0?e:Hjt(e),Vjt=e=>jjt(e)%2===1?`${e}$`:e,Bjt=(e,
|
|
|
2543
2543
|
`);if(t===-1)return e;let n=e.substring(t+1),r=e.substring(0,t),i=n.trim();if(Wjt.test(i)&&!n.match(Gjt)){let a=r.split(`
|
|
2544
2544
|
`).at(-1);if(a&&a.trim().length>0)return`${e}`}if(Zjt.test(i)&&!n.match(Kjt)){let a=r.split(`
|
|
2545
2545
|
`).at(-1);if(a&&a.trim().length>0)return`${e}`}return e},Yjt=new RegExp("(?<=[\\p{L}\\p{N}_])~(?!~)(?=[\\p{L}\\p{N}_])","gu"),Jjt=e=>!e||typeof e!="string"||!e.includes("~")?e:e.replace(Yjt,(t,n)=>si(e,n)?t:"\\~"),Qjt=e=>{var t,n;let r=e.match(cjt);if(r){let i=r[2];if(!i||D0.test(i))return e;let a=e.lastIndexOf(r[1]);if(si(e,a)||Js(e,a))return e;if(((t=e.match(Cte))==null?void 0:t.length)%2===1)return`${e}~~`}else{let i=e.match(pjt);if(i){let a=e.lastIndexOf(i[0].slice(0,2));if(si(e,a)||Js(e,a))return e;if(((n=e.match(Cte))==null?void 0:n.length)%2===1)return`${e}~`}}return e},WF=e=>e!==!1,eHt=e=>e===!0,Zr={SINGLE_TILDE:0,COMPARISON_OPERATORS:5,HTML_TAGS:10,SETEXT_HEADINGS:15,LINKS:20,BOLD_ITALIC:30,BOLD:35,ITALIC_DOUBLE_UNDERSCORE:40,ITALIC_SINGLE_ASTERISK:41,ITALIC_SINGLE_UNDERSCORE:42,INLINE_CODE:50,STRIKETHROUGH:60,KATEX:70,INLINE_KATEX:75,DEFAULT:100},tHt=[{handler:{name:"singleTilde",handle:Jjt,priority:Zr.SINGLE_TILDE},optionKey:"singleTilde"},{handler:{name:"comparisonOperators",handle:njt,priority:Zr.COMPARISON_OPERATORS},optionKey:"comparisonOperators"},{handler:{name:"htmlTags",handle:Djt,priority:Zr.HTML_TAGS},optionKey:"htmlTags"},{handler:{name:"setextHeadings",handle:Xjt,priority:Zr.SETEXT_HEADINGS},optionKey:"setextHeadings"},{handler:{name:"links",handle:kpe,priority:Zr.LINKS},optionKey:"links",earlyReturn:e=>e.endsWith("](streamdown:incomplete-link)")},{handler:{name:"boldItalic",handle:Ejt,priority:Zr.BOLD_ITALIC},optionKey:"boldItalic"},{handler:{name:"bold",handle:_jt,priority:Zr.BOLD},optionKey:"bold"},{handler:{name:"italicDoubleUnderscore",handle:Sjt,priority:Zr.ITALIC_DOUBLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"italicSingleAsterisk",handle:Ljt,priority:Zr.ITALIC_SINGLE_ASTERISK},optionKey:"italic"},{handler:{name:"italicSingleUnderscore",handle:Ajt,priority:Zr.ITALIC_SINGLE_UNDERSCORE},optionKey:"italic"},{handler:{name:"inlineCode",handle:zjt,priority:Zr.INLINE_CODE},optionKey:"inlineCode"},{handler:{name:"strikethrough",handle:Qjt,priority:Zr.STRIKETHROUGH},optionKey:"strikethrough"},{handler:{name:"katex",handle:Fjt,priority:Zr.KATEX},optionKey:"katex"},{handler:{name:"inlineKatex",handle:Vjt,priority:Zr.INLINE_KATEX},optionKey:"inlineKatex"}],nHt=e=>{var t;let n=(t=e?.linkMode)!=null?t:"protocol";return tHt.filter(({handler:r,optionKey:i})=>r.name==="links"?WF(e?.links)||WF(e?.images):r.name==="inlineKatex"?eHt(e?.inlineKatex):WF(e?.[i])).map(({handler:r,earlyReturn:i})=>r.name==="links"?{handler:hpe(upe({},r),{handle:a=>kpe(a,n)}),earlyReturn:n==="protocol"?i:void 0}:{handler:r,earlyReturn:i})},rHt=(e,t)=>{var n;if(!e||typeof e!="string")return e;let r=e.endsWith(" ")&&!e.endsWith(" ")?e.slice(0,-1):e,i=nHt(t),a=((n=t?.handlers)!=null?n:[]).map(s=>{var l;return{handler:hpe(upe({},s),{priority:(l=s.priority)!=null?l:Zr.DEFAULT}),earlyReturn:void 0}}),o=[...i,...a].sort((s,l)=>{var c,u;return((c=s.handler.priority)!=null?c:0)-((u=l.handler.priority)!=null?u:0)});for(let{handler:s,earlyReturn:l}of o)if(r=s.handle(r),l!=null&&l(r))return r;return r},iHt=rHt;function aHt(e){return/^\[[^\]]+\]:\s+\S+/m.test(e)||/^\[\^[^\]]+\]:\s+/m.test(e)}function oHt(e){const t=e.match(/^[ \t]{0,3}(`{3,}|~{3,})/);if(!t)return!1;const n=t[1];if(!n)return!1;const r=n[0],i=n.length,a=e.trimEnd().split(`
|
|
2546
|
-
`).at(-1)?.trim()??"";return!new RegExp(`^[\\t ]{0,3}${r}{${i},}[\\t ]*$`).test(a)}function Nte(e){return iHt(e,{linkMode:"text-only"})}function sHt(e,t){if(!t)return[{raw:e,src:e,mode:"full"}];const n=Nte(e);if(aHt(e))return[{raw:e,src:n,mode:"live"}];const r=Jt.lexer(e),i=r.findLastIndex(l=>l.type!=="space");if(i<0)return[{raw:e,src:n,mode:"live"}];const a=r[i];if(!a||a.type!=="code")return[{raw:e,src:n,mode:"live"}];const o=a;if(!oHt(o.raw))return[{raw:e,src:n,mode:"live"}];const s=r.slice(0,i).map(l=>l.raw).join("");return s?[{raw:s,src:Nte(s),mode:"live"},{raw:o.raw,src:o.raw,mode:"live"}]:[{raw:o.raw,src:o.raw,mode:"live"}]}let lHt=0,Ate=Promise.resolve(),kp=null;function cHt(){return kp||(kp=document.createElement("div"),kp.style.cssText="visibility:hidden;position:fixed;top:-9999px;left:-9999px;width:0;height:0;overflow:hidden;",document.body.appendChild(kp)),kp}async function dHt(){return(await z(()=>import("./mermaid.core-
|
|
2546
|
+
`).at(-1)?.trim()??"";return!new RegExp(`^[\\t ]{0,3}${r}{${i},}[\\t ]*$`).test(a)}function Nte(e){return iHt(e,{linkMode:"text-only"})}function sHt(e,t){if(!t)return[{raw:e,src:e,mode:"full"}];const n=Nte(e);if(aHt(e))return[{raw:e,src:n,mode:"live"}];const r=Jt.lexer(e),i=r.findLastIndex(l=>l.type!=="space");if(i<0)return[{raw:e,src:n,mode:"live"}];const a=r[i];if(!a||a.type!=="code")return[{raw:e,src:n,mode:"live"}];const o=a;if(!oHt(o.raw))return[{raw:e,src:n,mode:"live"}];const s=r.slice(0,i).map(l=>l.raw).join("");return s?[{raw:s,src:Nte(s),mode:"live"},{raw:o.raw,src:o.raw,mode:"live"}]:[{raw:o.raw,src:o.raw,mode:"live"}]}let lHt=0,Ate=Promise.resolve(),kp=null;function cHt(){return kp||(kp=document.createElement("div"),kp.style.cssText="visibility:hidden;position:fixed;top:-9999px;left:-9999px;width:0;height:0;overflow:hidden;",document.body.appendChild(kp)),kp}async function dHt(){return(await z(()=>import("./mermaid.core-BEWtGc16.js").then(t=>t.br),__vite__mapDeps([97,98]))).default}let GF;function uHt(){return GF||(GF=dHt()),GF}function hHt(e,t){const n=Ate.then(async()=>{const r=await uHt();r.initialize({startOnLoad:!1,theme:t?"dark":"default",fontFamily:"inherit",securityLevel:"loose"});const i=`mermaid-${++lHt}`,{svg:a}=await r.render(i,e,cHt());return a}).catch(r=>{throw r});return Ate=n.then(()=>{},()=>{}),n}var NR={exports:{}};/* @license
|
|
2547
2547
|
Papa Parse
|
|
2548
2548
|
v5.5.3
|
|
2549
2549
|
https://github.com/mholt/PapaParse
|
|
@@ -2561,12 +2561,12 @@ License: MIT
|
|
|
2561
2561
|
`).replace(/\n/g,"<br>")}const MHt=/^https?:\/\/[^\s<>()`"']+$/;function SHt(e){const t=e.trim().replace(/[),.;!?]+$/,"");if(MHt.test(t))try{return new URL(t).toString()}catch{return}}function Dte(e,t){const n=document.createElement("div");n.setAttribute("data-component","icon"),n.setAttribute("data-size","small"),n.setAttribute("data-slot",t);const r=document.createElementNS("http://www.w3.org/2000/svg","svg");return r.setAttribute("data-slot","icon-svg"),r.setAttribute("fill","none"),r.setAttribute("viewBox","0 0 20 20"),r.setAttribute("aria-hidden","true"),r.innerHTML=e,n.appendChild(r),n}function Ote(e){const t=document.createElement("button");return t.type="button",t.setAttribute("data-component","icon-button"),t.setAttribute("data-variant","secondary"),t.setAttribute("data-size","small"),t.setAttribute("data-slot","markdown-copy-button"),t.setAttribute("aria-label",e.copy),t.setAttribute("data-tooltip",e.copy),t.appendChild(Dte(Ete.copy,"copy-icon")),t.appendChild(Dte(Ete.check,"check-icon")),t}function AR(e,t,n){if(n){e.setAttribute("data-copied","true"),e.setAttribute("aria-label",t.copied),e.setAttribute("data-tooltip",t.copied);return}e.removeAttribute("data-copied"),e.setAttribute("aria-label",t.copy),e.setAttribute("data-tooltip",t.copy)}function CHt(e,t){const n=e.parentElement;if(!n)return;if(!(n.getAttribute("data-component")==="markdown-code")){const a=document.createElement("div");a.setAttribute("data-component","markdown-code"),n.replaceChild(a,e),a.appendChild(e),a.appendChild(Ote(t));return}const i=Array.from(n.querySelectorAll('[data-slot="markdown-copy-button"]')).filter(a=>a instanceof HTMLButtonElement);if(i.length===0){n.appendChild(Ote(t));return}for(const a of i.slice(1))a.remove()}function LHt(e){const t=Array.from(e.querySelectorAll(":not(pre) > code"));for(const n of t){const r=SHt(n.textContent??""),i=n.parentElement instanceof HTMLAnchorElement&&n.parentElement.classList.contains("external-link")?n.parentElement:null;if(!r){i&&i.replaceWith(n);continue}if(i){i.href=r;continue}const a=document.createElement("a");a.href=r,a.className="external-link",a.target="_blank",a.rel="noopener noreferrer",n.parentNode?.replaceChild(a,n),a.appendChild(n)}}function xpe(e){const t=e.querySelector("code");return t?(t.getAttribute("class")??"").match(/language-(\S+)/)?.[1]:void 0}const IHt='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>';function NHt(e){const t=Array.from(e.querySelectorAll("a.file-link"));for(const n of t){if(n.querySelector(".file-link-icon"))continue;const r=document.createElement("span");r.className="file-link-icon",r.innerHTML=IHt,n.insertBefore(r,n.firstChild)}}function AHt(e,t){if(!t)return;const n=Array.from(e.querySelectorAll("img"));for(const r of n){const i=r.getAttribute("src");if(i&&i.startsWith("/"))try{r.src=new URL(i,t).toString()}catch{console.error("Failed to resolve image URL:",i)}}}function $Ht(e,t,n){const r=Array.from(e.querySelectorAll("pre"));for(const i of r)CHt(i,t);LHt(e),NHt(e),AHt(e,n)}function THt(){let e=null,t=!1,n=null;function r(a,o,s,l,c){if(n&&(clearTimeout(n),n=null),e){const M=e.querySelector(".mention-preview-input");if(M&&M.value===o)return}i(),t=!0,e=document.createElement("div"),e.className="mention-preview";const u=document.createElement("div");u.className="mention-preview-header",u.style.display="flex",u.style.gap="0.5rem",u.style.alignItems="center";const h=document.createElement("span");h.innerHTML='<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>',h.style.flexShrink="0",h.style.opacity="0.7";const m=document.createElement("input");m.className="mention-preview-input",m.value=o,m.style.flex="1",m.style.minWidth="0",m.style.background="transparent",m.style.border="none",m.style.outline="none",m.style.color="inherit",m.style.fontSize="inherit",m.style.fontFamily="inherit",m.style.padding="0",m.spellcheck=!1,m.addEventListener("keydown",M=>{M.key==="Enter"&&(M.preventDefault(),m.blur(),c?.(m.value.trim()),i()),M.key==="Escape"&&(m.blur(),i())}),m.addEventListener("blur",()=>{m.value.trim()!==o&&c?.(m.value.trim())}),u.appendChild(h),u.appendChild(m),e.appendChild(u);const g=document.createElement("pre");g.className="mention-preview-body";const y=s.split(`
|
|
2562
2562
|
`);g.textContent=y.length>12?y.slice(0,12).join(`
|
|
2563
2563
|
`)+`
|
|
2564
|
-
...`:s,e.appendChild(g);const v=document.createElement("div");v.className="mention-preview-footer",v.style.cursor="pointer",v.innerHTML="<span>Click to open</span>",v.addEventListener("click",()=>{l?.(),i()}),e.appendChild(v),e.style.position="fixed";const k=8,b=360,x=Math.min(a.left,window.innerWidth-b-16);e.style.left=`${x}px`,e.style.width=`${b}px`,window.innerHeight-a.bottom-k>200?e.style.top=`${a.bottom+k}px`:e.style.bottom=`${window.innerHeight-a.top+k}px`,e.addEventListener("mouseenter",()=>{t=!0,n&&(clearTimeout(n),n=null)}),e.addEventListener("mouseleave",()=>{t=!1,n=setTimeout(()=>{t||i()},400)}),document.body.appendChild(e),requestAnimationFrame(()=>{e?.classList.add("is-visible")})}function i(){n&&(clearTimeout(n),n=null),t=!1,e&&(e.classList.remove("is-visible"),setTimeout(()=>{e?.remove(),e=null},150))}return{show:r,hide:i,isActive:()=>t||!!n}}const EHt='<svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="M10 4.5C5.5 4.5 2.5 10 2.5 10s3 5.5 7.5 5.5 7.5-5.5 7.5-5.5-3-5.5-7.5-5.5z"/><circle cx="10" cy="10" r="2.5"/></svg>',Rte='<svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="M6.5 6.5L2 10l4.5 3.5M13.5 6.5L18 10l-4.5 3.5M11.5 4.5l-3 11"/></svg>';function PHt(e,t){const n=Array.from(e.querySelectorAll("pre")).filter(r=>xpe(r)==="mermaid");for(const r of n){const i=r.querySelector("code")?.textContent??"";if(!i.trim())continue;const a=r.closest('[data-component="markdown-code"]')??r;a.getAttribute("data-mermaid")||(a.setAttribute("data-mermaid","pending"),hHt(i,t).then(o=>{const s=document.createElement("div");s.setAttribute("data-component","mermaid-block");const l=document.createElement("div");l.setAttribute("data-component","mermaid-block-header");const c=document.createElement("span");c.setAttribute("data-component","code-block-lang"),c.textContent="mermaid";const u=document.createElement("button");u.type="button",u.setAttribute("data-component","mermaid-toggle"),u.setAttribute("aria-label","Show code"),u.innerHTML=Rte,l.appendChild(c),l.appendChild(u),s.appendChild(l);const h=document.createElement("div");h.setAttribute("data-component","mermaid-diagram"),h.innerHTML=o,s.appendChild(h);const m=a.cloneNode(!0);m.removeAttribute("data-mermaid"),m.style.display="none",s.appendChild(m);let g=!0;u.addEventListener("click",()=>{g=!g,h.style.display=g?"":"none",m.style.display=g?"none":"",u.innerHTML=g?Rte:EHt,u.setAttribute("aria-label",g?"Show code":"Show diagram")}),a.replaceWith(s)}).catch(()=>{a.removeAttribute("data-mermaid")}))}}function DHt(e){const t=Array.from(e.querySelectorAll("pre")).filter(n=>xpe(n)==="csv");for(const n of t){const r=n.querySelector("code")?.textContent??"";if(!r.trim())continue;const i=wpe(r);if(!i)continue;const a=n.closest('[data-component="markdown-code"]')??n,o=document.createElement("div");o.innerHTML=yHt(i);const s=o.firstElementChild;s&&a.replaceWith(s)}}function OHt(e,t){const n=new Map,r=o=>{const s=t(),l=o.getAttribute("data-copied")==="true";AR(o,s,l)},i=async o=>{const s=o.target;if(!(s instanceof Element))return;const l=s.closest('[data-slot="markdown-copy-button"]');if(!(l instanceof HTMLButtonElement))return;const u=l.closest('[data-component="markdown-code"]')?.querySelector("code")?.textContent??"";if(!u)return;const h=navigator?.clipboard;if(!h)return;await h.writeText(u);const m=t();AR(l,m,!0);const g=n.get(l);g&&clearTimeout(g);const y=setTimeout(()=>AR(l,m,!1),2e3);n.set(l,y)},a=Array.from(e.querySelectorAll('[data-slot="markdown-copy-button"]'));for(const o of a)o instanceof HTMLButtonElement&&r(o);return e.addEventListener("click",i),()=>{e.removeEventListener("click",i);for(const o of n.values())clearTimeout(o)}}function zte(e,t){if(ph.delete(e),ph.set(e,t),ph.size<=bHt)return;const n=ph.keys().next().value;n&&ph.delete(n)}function RHt(e){const[t,n]=Se(e,["text","cacheKey","streaming","class","classList","onLinkClick","fileFetch"]),r=Y9e(),i=M0(),[a,o]=Ce(),[s]=Yr(()=>({text:t.text,key:t.cacheKey,streaming:t.streaming??!1}),async v=>{if(!v.text)return"";const k=v.key??Wh(v.text);return Promise.all(sHt(v.text,v.streaming).map(async(b,x)=>{const w=Wh(b.raw),M=k?`${k}:${x}:${b.mode}`:w;if(M&&w){const L=ph.get(M);if(L&&L.hash===w)return zte(M,L),L.html}const _=await Promise.resolve(r.parse(b.src)),C=xHt(_);return M&&w&&zte(M,{hash:w,html:C}),C})).then(b=>b.join("")).catch(()=>Pte(v.text))},{initialValue:Pte(t.text)});let l;const c=THt(),u=new Map,h=v=>{const k=v.target;if(!(k instanceof Element))return;const b=k.closest("a[href]");if(!(b instanceof HTMLAnchorElement))return;const x=b.getAttribute("href");x&&(/^(?:https?|mailto|tel|blob|data):/.test(x)||v.preventDefault(),t.onLinkClick?.(x,v))},m=v=>{if(!t.fileFetch)return;const k=v.target;if(!(k instanceof Element))return;const b=k.closest("a.file-link");if(!b){c.isActive()||c.hide();return}const x=b.getAttribute("data-file-path");if(!x)return;const w=()=>{const C=b.getAttribute("href")||x;t.onLinkClick?.(C,new MouseEvent("click"))},M=C=>{const L=b.getAttribute("href")||x,S=C.startsWith("http")||C.startsWith("/")||C.startsWith("./")||C.startsWith("#")?C:`./${C}`;b.setAttribute("href",S),b.setAttribute("data-file-path",C);const I=a();if(!I)return;b.textContent?.replace(/^\s*\S+\s*/,"");const A=u.get(x);A&&(u.delete(x),u.set(C,A)),I.dispatchEvent(new CustomEvent("fileLinkUpdated",{bubbles:!0,detail:{oldHref:L,newHref:S,oldPath:x,newPath:C}}))},_=u.get(x);if(_){c.show(b.getBoundingClientRect(),x,_,w,M);return}t.fileFetch(x).then(C=>{C&&(u.set(x,C),b.matches(":hover")&&c.show(b.getBoundingClientRect(),x,C,w,M))})},g=v=>{const k=v.relatedTarget;k?.closest?.(".mention-preview")||k?.closest?.("a.file-link")},y=v=>{if(v.type==="mousedown"&&!c.isActive()){c.hide();return}if(v.type==="scroll"){if(c.isActive())return;c.hide()}};return he(()=>{const v=vye(),k=a(),b=t.text?s.latest??s()??"":"";if(!k)return;if(!b){k.innerHTML="";return}const x={copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")},w=document.createElement("div");w.innerHTML=b,$Ht(w,x,v.mediaUrl),Gqt(k,w,{childrenOnly:!0,onBeforeElUpdated:(M,_)=>(M instanceof HTMLButtonElement&&_ instanceof HTMLButtonElement&&M.getAttribute("data-slot")==="markdown-copy-button"&&_.getAttribute("data-slot")==="markdown-copy-button"&&M.getAttribute("data-copied")==="true"&&AR(_,x,!0),!M.isEqualNode(_))}),DHt(k),PHt(k,vHt()),l||(l=OHt(k,()=>({copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")}))),t.onLinkClick&&k.addEventListener("click",h),t.fileFetch&&(k.addEventListener("mouseover",m),k.addEventListener("mouseout",g),document.addEventListener("scroll",y,{passive:!0,capture:!0}),document.addEventListener("mousedown",y,{capture:!0}))}),me(()=>{l&&l(),c.hide();const v=a();v&&(t.onLinkClick&&v.removeEventListener("click",h),t.fileFetch&&(v.removeEventListener("mouseover",m),v.removeEventListener("mouseout",g),document.removeEventListener("scroll",y,{capture:!0}),document.removeEventListener("mousedown",y,{capture:!0})))}),(()=>{var v=kHt();return Hr(o,v),ki(v,f({get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}},n),!1,!1),v})()}var zHt=ie("<svg>"),qHt=ie("<svg><rect width=3 height=3 rx=1></svg>",!1,!0,!1);const jHt=new Set([1,2,4,7,8,11,13,14]),HHt=new Set([0,3,12,15]),FHt=Array.from({length:16},(e,t)=>({id:t,x:t%4*4,y:Math.floor(t/4)*4,delay:Math.random()*1.5,duration:1+Math.random()*1,outer:jHt.has(t),corner:HHt.has(t)}));function D2(e){return(()=>{var t=zHt();return ki(t,f(e,{viewBox:"0 0 15 15","data-component":"spinner",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},fill:"currentColor"}),!0,!0),K(t,d(Qt,{each:FHt,children:n=>(()=>{var r=qHt();return Qe(i=>{var a=n.x,o=n.y,s=n.corner?0:void 0,l=n.corner?void 0:`${n.outer?"pulse-opacity-dim":"pulse-opacity"} ${n.duration}s ease-in-out infinite`,c=n.corner?void 0:"both",u=n.corner?void 0:`${n.delay}s`;return a!==i.e&>(r,"x",i.e=a),o!==i.t&>(r,"y",i.t=o),s!==i.a&&kr(r,"opacity",i.a=s),l!==i.o&&kr(r,"animation",i.o=l),c!==i.i&&kr(r,"animation-fill-mode",i.i=c),u!==i.n&&kr(r,"animation-delay",i.n=u),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),r})()})),t})()}var VHt=ie('<div class="h-full flex items-center justify-center text-text-weak">Unable to parse CSV'),BHt=ie('<div data-component=csv-table-editor class="h-full overflow-auto"><table data-slot=csv-table-inner class="w-full border-collapse text-13-regular"><thead class="sticky top-0 z-10"><tr></tr></thead><tbody>'),UHt=ie("<span class=text-text-weak>"),WHt=ie('<th data-slot=csv-th class="px-3 py-2 text-left font-medium text-text-base border-b border-border-weaker-base cursor-pointer select-none hover:bg-surface-raised-base/20 transition-colors"><span class="inline-flex items-center gap-1">'),GHt=ie("<tr class=bg-transparent>"),ZHt=ie('<input type=text class="bg-transparent border border-border-weak-base rounded px-1.5 py-0.5 text-13-regular text-text-base outline-none focus:border-border-base w-full min-w-[60px]"autofocus>'),KHt=ie('<td data-slot=csv-td class="px-3 py-1.5 text-text-base border-b border-border-weaker-base whitespace-nowrap bg-transparent">');function XHt(e){const t=()=>!!e.onChange,[n,r]=Ce(void 0),[i,a]=Ce(!0),[o,s]=Ce(null),[l,c]=Ce(""),u=Z(()=>wpe(e.value)),h=Z(()=>{const v=u();if(!v)return;const k=n();if(k==null)return v;const b=[...v.rows].sort((x,w)=>{const M=x[k]??"",_=w[k]??"",C=Number(M),L=Number(_);return!isNaN(C)&&!isNaN(L)?i()?C-L:L-C:i()?M.localeCompare(_):_.localeCompare(M)});return{headers:v.headers,rows:b}}),m=(v,k,b)=>{if(!e.onChange)return;const x=u();if(!x)return;const w=x.rows.map((M,_)=>_===v?M.map((C,L)=>L===k?b:C):M);e.onChange(gHt({headers:x.headers,rows:w})),s(null)},g=(v,k,b)=>{t()&&(s({row:v,col:k}),c(b))},y=v=>{n()===v?a(!i()):(r(v),a(!0))};return d(ke,{get when(){return h()},get fallback(){return VHt()},children:v=>(()=>{var k=BHt(),b=k.firstChild,x=b.firstChild,w=x.firstChild,M=x.nextSibling;return K(w,d(Qt,{get each(){return v().headers},children:(_,C)=>(()=>{var L=WHt(),S=L.firstChild;return L.$$click=()=>y(C()),K(S,_,null),K(S,d(ke,{get when(){return n()===C()},get children(){var I=UHt();return K(I,()=>i()?"↑":"↓"),I}}),null),L})()})),K(M,d(Qt,{get each(){return v().rows},children:(_,C)=>(()=>{var L=GHt();return K(L,d(Qt,{each:_,children:(S,I)=>{const A=()=>o()?.row===C()&&o()?.col===I();return(()=>{var D=KHt();return D.$$dblclick=()=>g(C(),I(),S),K(D,d(ke,{get when(){return A()},fallback:S,get children(){var P=ZHt();return P.$$keydown=O=>{O.key==="Enter"&&m(C(),I(),l()),O.key==="Escape"&&s(null)},P.addEventListener("blur",()=>m(C(),I(),l())),P.$$input=O=>c(O.currentTarget.value),Qe(()=>P.value=l()),P}})),D})()}})),L})()})),k})()})}li(["click","dblclick","input","keydown"]);var YHt=ie('<svg viewBox="0 0 20 20"fill=none>');const bp={backlog:"#8f8f8f",queue:"#38bdf8",in_progress:"#f59e0b",paused:"#bc8cff",closed:"#10b981",issue:"#e879f9",agent:"#38bdf8",project:"#f472b6",memory:"#a78bfa",mcp:"#34d399",sprite:"#fb923c",workunit:"#60a5fa",cycle:"#22d3ee",epic:"#f43f5e",roadmap:"#a3e635",suggestion:"#fbbf24",file:"#14b8a6",directory:"#eab308",milestone:"#3b82f6",decision:"#c084fc",branch:"#fde047"},ZF={project:'<path d="M2.08 2.92V16.25H17.92V5.42H10L8.33 2.92H2.08Z" stroke="currentColor" stroke-linecap="round"/>',issue:'<path d="M9.58 13.75H17.08M9.58 6.25H17.08M2.92 6.67L4.58 7.92L7.08 4.17M2.92 14.17L4.58 15.42L7.08 11.67" stroke="currentColor" stroke-linecap="square"/>',agent:'<path d="M13.33 8.75C11.49 8.75 10 7.26 10 5.42M6.67 11.25C8.51 11.25 10 12.74 10 14.58M10 2.78V17.07M16 15.05C17.13 14.59 17.92 13.48 17.92 12.2C17.92 11.34 17.56 10.56 16.99 10C17.56 9.44 17.92 8.66 17.92 7.8C17.92 6.21 16.71 4.91 15.17 4.74C14.79 3.21 13.4 2.08 11.76 2.08C11.12 2.08 10.52 2.25 10 2.55C9.48 2.25 8.88 2.08 8.24 2.08C6.59 2.08 5.21 3.21 4.83 4.74C3.28 4.91 2.08 6.21 2.08 7.8C2.08 8.66 2.44 9.44 3.01 10C2.44 10.56 2.08 11.34 2.08 12.2C2.08 13.48 2.87 14.59 3.99 15.05C4.47 16.7 5.99 17.92 7.8 17.92C8.61 17.92 9.37 17.67 10 17.25C10.63 17.67 11.38 17.92 12.2 17.92C14.01 17.92 15.53 16.7 16 15.05Z" stroke="currentColor"/>',memory:'<path d="M10 3.33C6.32 3.33 3.33 6.32 3.33 10C3.33 13.68 6.32 16.67 10 16.67C13.68 16.67 16.67 13.68 16.67 10M10 3.33C13.68 3.33 16.67 6.32 16.67 10M10 3.33V16.67M3.33 10H16.67" stroke="currentColor" stroke-linecap="round"/>',mcp:'<g><path d="M0.97 9.37L9.52 1.6C10.7 0.53 12.62 0.53 13.8 1.6C14.98 2.67 14.98 4.41 13.8 5.49L7.34 11.36" stroke="currentColor" stroke-linecap="round"/><path d="M7.43 11.27L13.8 5.49C14.98 4.41 16.89 4.41 18.07 5.49L18.11 5.53C19.3 6.6 19.3 8.34 18.11 9.41L10.38 16.44C9.99 16.8 9.99 17.38 10.38 17.74L11.97 19.18" stroke="currentColor" stroke-linecap="round"/><path d="M11.66 3.54L5.34 9.29C4.16 10.36 4.16 12.1 5.34 13.18C6.52 14.25 8.43 14.25 9.61 13.18L15.93 7.43" stroke="currentColor" stroke-linecap="round"/></g>',sprite:'<path d="M2.92 7.91V2.91H7.92M12.08 2.91H17.08V7.91M10 10V17.08M10 10L3.33 3.33M10 10L16.67 3.33" stroke="currentColor" stroke-linecap="square"/>',workunit:'<path d="M10 2.08V17.92M7.08 3.75H2.08V16.25H7.08M12.92 16.25H17.92V3.75H12.92" stroke="currentColor" stroke-linecap="square"/>',cycle:'<path d="M5.83 4.16L2.5 7.5L5.83 10.83M3.33 7.5H17.92V15.41H10" stroke="currentColor" stroke-linecap="square"/>',epic:'<path d="M10 7.92V11.67M10 13.74V13.75M10 2.5L1.88 16.25H18.13L10 2.5Z" stroke="currentColor" stroke-linecap="square"/>',roadmap:'<path d="M2.08 10H4.58M2.08 5.42H5.42M2.08 14.58H5.42M16.46 13.96L18.75 16.25M17.92 10C17.92 12.99 15.49 15.42 12.5 15.42C9.51 15.42 7.08 12.99 7.08 10C7.08 7.01 9.51 4.58 12.5 4.58C15.49 4.58 17.92 7.01 17.92 10Z" stroke="currentColor" stroke-linecap="square"/>',suggestion:'<path fill-rule="evenodd" clip-rule="evenodd" d="M17.5 10C12.29 10 10 12.29 10 17.5C10 12.29 7.71 10 2.5 10C7.71 10 10 7.71 10 2.5C10 7.71 12.29 10 17.5 10Z" stroke="currentColor"/>',file:'<path d="M4.17 2.08V17.92H15.83V6.25L11.67 2.08H4.17Z" stroke="currentColor" stroke-linecap="square"/><path d="M11.67 2.08V6.25H15.83" stroke="currentColor" stroke-linecap="square"/>',directory:'<path d="M2.08 2.92V16.25H17.92V5.42H10L8.33 2.92H2.08Z" stroke="currentColor" stroke-linecap="round"/>',milestone:'<path d="M10 2.5V17.5M10 2.5L17.5 5.83L10 9.17M10 2.5L2.5 5.83L10 9.17" stroke="currentColor" stroke-linecap="round"/>',decision:'<path d="M10 1.67L18.33 10L10 18.33L1.67 10L10 1.67Z" stroke="currentColor" stroke-linecap="round"/><path d="M10 6.67V10L12.5 12.5" stroke="currentColor" stroke-linecap="round"/>',branch:'<path d="M6 3.33V16.67M14 6.67V16.67M6 10C6 12.21 7.79 14 10 14C12.21 14 14 12.21 14 10" stroke="currentColor" stroke-linecap="round"/><circle cx="6" cy="3.33" r="1.67" stroke="currentColor"/><circle cx="14" cy="6.67" r="1.67" stroke="currentColor"/><circle cx="6" cy="16.67" r="1.67" stroke="currentColor"/>',entity:'<circle cx="10" cy="10" r="7.5" stroke="currentColor"/><path d="M10 6.67V10M10 13.33V13.34" stroke="currentColor" stroke-linecap="round"/>'};function _pe(e,t){return e&&bp[e]?bp[e]:t&&bp[t]?bp[t]:bp.backlog}function JHt(e){return e&&ZF[e]?ZF[e]:ZF.entity}function vQt(e,t="entity"){if(!e)return t;const n=e.includes(":")?e.split(":")[0]:t;return n==="dir"?"directory":n||t}function QHt(e){const t=()=>e.size??14;return(()=>{var n=YHt();return Qe(r=>{var i=t(),a=t(),o=`shrink-0 ${e.class??""}`,s=e.color??_pe(e.type),l=JHt(e.type);return i!==r.e&>(n,"width",r.e=i),a!==r.t&>(n,"height",r.t=a),o!==r.a&>(n,"class",r.a=o),s!==r.o&&kr(n,"color",r.o=s),l!==r.i&&(n.innerHTML=r.i=l),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n})()}var eFt=ie('<div class="rounded-md border border-border-base bg-background-base px-3 py-2 text-12-regular text-text-weak">Preview unavailable'),tFt=ie('<div class="rounded-md border border-border-base bg-background-base overflow-hidden h-full flex flex-col">'),nFt=ie('<div class="h-full overflow-auto p-3">'),rFt=ie('<div class="h-full overflow-auto">'),iFt=ie('<div class="h-full overflow-auto p-4">'),aFt=ie('<div class="relative h-full w-full overflow-visible">'),oFt=ie('<button class="inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-xs text-text-weak hover:text-text-base hover:bg-surface-raised-base/60 transition-colors"><span class="truncate max-w-40">'),sFt=ie('<div class="absolute inset-0 rounded-xl border border-border-weaker-base bg-surface-base shadow-xl flex flex-col overflow-hidden"style="transform-origin:center center;transition:transform 200ms ease, filter 200ms ease"><div class="shrink-0 border-b border-border-weaker-base px-4 py-3 flex items-center gap-3"><div class="flex-1 min-w-0 flex items-center gap-2"><span class="inline-flex items-center gap-1 rounded-full bg-surface-raised-base px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide"></span><span class="truncate text-12-medium text-text-strong font-mono"></span></div></div><div class="min-h-0 flex-1 overflow-hidden">'),lFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">Attributes</div><div class="flex flex-col gap-1.5">'),cFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">Links</div><div class="flex flex-col gap-1">'),dFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">References</div><div class="flex flex-col gap-1">'),uFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">Backlinks</div><div class="flex flex-col gap-1">'),hFt=ie('<div class="w-72 shrink-0 border-l border-border-weaker-base bg-surface-raised-base/30 flex flex-col"><div class="flex-1 overflow-y-auto p-3 flex flex-col gap-4">'),fFt=ie('<div class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5"><div class="text-10-medium uppercase tracking-wide text-text-weaker"></div><div class="mt-0.5 text-11-regular text-text-strong truncate">'),pFt=ie('<button class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 text-left hover:bg-surface-raised-base/60 transition-colors"><div class="text-10-medium uppercase tracking-wide text-text-weaker"></div><div class="mt-0.5 text-11-medium text-text-strong font-mono truncate">'),mFt=ie('<div class="text-10-regular text-text-warning capitalize">'),gFt=ie('<button class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 text-left transition-colors flex items-start gap-1.5"><div class="flex-1 min-w-0"><div class="text-11-medium text-text-strong font-mono truncate">'),yFt=ie('<div class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 flex items-start gap-1.5"><div class="flex-1 min-w-0"><div class="text-11-medium text-text-strong font-mono truncate"></div><div class="text-10-regular text-text-weak truncate">Line '),vFt=ie('<div class="flex h-full"><div class="flex-1 min-h-0 overflow-auto p-4">'),kFt=ie('<div class="flex flex-col items-center gap-2 py-8 text-text-weak"><div class=text-12-regular>Loading details...'),bFt=ie('<div class="text-13-regular text-text-base whitespace-pre-wrap">'),wFt=ie('<div class="flex flex-wrap gap-1.5">'),xFt=ie('<div class="flex items-center gap-2 flex-wrap">'),_Ft=ie('<div class="flex items-center gap-2 p-2 rounded-md bg-background-base border border-border-base">'),MFt=ie('<div class="p-3 rounded-md bg-background-base border border-border-base flex flex-col gap-2"><div class="flex items-center gap-2">'),SFt=ie('<div class="flex flex-col gap-3"><div class="text-12-medium uppercase tracking-wide text-text-weak">Decision Traces</div><div class="flex flex-col gap-2 max-h-[200px] overflow-y-auto">'),CFt=ie('<div class="flex justify-between"><span>Assignee</span><span>'),LFt=ie('<div class="flex justify-between"><span>Branch</span><span class=text-11-mono>'),IFt=ie('<div class="flex flex-col gap-4"><div class="flex items-center gap-2"><span class="text-12-medium text-text-info"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span></div><h1 class="text-16-semibold text-text-strong leading-tight"></h1><div class="flex flex-col gap-3"><div class="flex items-center justify-between"><div class="text-12-medium uppercase tracking-wide text-text-weak">Acceptance Criteria</div><div class="flex items-center gap-1"></div></div><div class="flex flex-col gap-2 max-h-[300px] overflow-y-auto"></div></div><div class="pt-4 border-t border-border-weaker-base flex flex-col gap-3 text-12-regular text-text-weak"><div class="flex justify-between"><span>Created</span><span>'),NFt=ie('<span class="rounded-full bg-surface-raised-base px-2.5 py-0.5 text-11-medium text-text-weak">'),AFt=ie('<div class="text-12-regular text-text-weaker italic">No criteria defined'),$Ft=ie('<code class="text-11-mono text-text-weak block mt-1 p-1 rounded bg-surface-raised-base truncate">'),TFt=ie('<pre class="mt-1 p-2 rounded bg-background-stronger text-11-mono text-text-weak overflow-x-auto max-h-24">'),EFt=ie('<div class="p-3 rounded-md bg-background-base border border-border-base flex flex-col gap-2"><div class="flex items-start gap-3"><button class="mt-1 shrink-0 cursor-pointer hover:opacity-70 transition-opacity"title="Click to toggle status"></button><div class="flex-1 min-w-0"><div class="text-13-medium text-text-strong leading-normal">'),PFt=ie('<div class="size-3 rounded-full border-2 border-border-strong-base">'),DFt=ie('<div class="text-11-regular text-text-weak truncate">'),OFt=ie('<div class="p-2 rounded-md bg-background-base border border-border-base flex items-start gap-2"><div class="flex-1 min-w-0"><div class="text-12-medium text-text-strong"></div></div><div class="shrink-0 text-11-regular text-text-weaker whitespace-nowrap">'),RFt=ie('<div class="flex flex-col gap-2 flex-1 min-h-0">'),zFt=ie('<div class="flex flex-col gap-1.5 max-h-[220px] overflow-y-auto">'),qFt=ie('<div class="flex flex-col gap-2"><div class="text-12-medium uppercase tracking-wide text-text-weak">Contents'),jFt=ie('<div class="flex flex-col gap-2"><div class="text-11-medium uppercase tracking-wide text-text-weak">Recent Ops</div><div class="flex flex-col gap-1 max-h-[180px] overflow-y-auto">'),HFt=ie('<div class="flex h-full"><div class="flex-1 min-h-0 overflow-auto p-0 flex flex-col gap-4">'),FFt=ie('<div class="flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>Loading file...'),VFt=ie('<div class="flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>Loading directory...'),BFt=ie('<div class="rounded-md border border-border-base bg-background-base px-3 py-2 text-12-regular text-text-weak">Empty directory'),UFt=ie('<button class="rounded-md border border-border-base bg-background-base px-3 py-2 text-left hover:bg-surface-raised-base/60 transition-colors"><div class="flex items-center gap-2"><span class="rounded-full bg-surface-raised-base px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-text-weak"></span><span class="truncate text-12-medium text-text-strong"></span></div><div class="mt-1 truncate text-11-regular text-text-weak font-mono">'),WFt=ie('<div class="rounded-md border border-border-base bg-background-base px-2 py-1.5 text-11-regular text-text-weak"><div class="truncate font-mono"></div><div class=text-text-weaker>'),GFt=ie('<span class="w-2 h-2 rounded-full bg-text-success shrink-0 mt-1">');const qte={w:760,h:620},hU=Tt();function jte(e,t,n){return Math.max(t,Math.min(e,n))}function ZFt(e,t){return t||e.includes(":")&&e.split(":")[0]||"entity"}function KFt(e,t){return e.includes(":")?e:t==="issue"?`issue:${e}`:e}function Gz(e){return e.includes(":")?e.split(":").slice(1).join(":"):e}function Mpe(e){const t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?`${Math.round(t/6e4)}m ago`:t<864e5?`${Math.round(t/36e5)}h ago`:`${Math.round(t/864e5)}d ago`}const XFt=new Set(["title","name","message","description","purpose","summary","type","kind"]);function Hte(e){return e.split("/").pop()||e}function fU(e){return typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e,null,2)??""}function Fte(e,t){const n=t.flatMap(r=>e?.facts.filter(i=>i.a===r)??[])[0];return n?fU(n.v):void 0}function YFt(e){return/\.(md|markdown|mdx|note)$/i.test(e)}function JFt(e){return/\.csv$/i.test(e)}function Vte(e){return e.replaceAll("\\","/").replace(/\/+/g,"/")}function Bte(e,t){const n=t.split("#")[0]?.split("?")[0]?.trim();if(!n||/^(?:[a-z]+:|\/\/)/i.test(n))return;const r=Vte(n);if(r.startsWith("/"))return r.replace(/^\/+/,"");const i=Vte(e).split("/").slice(0,-1);for(const a of r.split("/"))if(!(!a||a===".")){if(a===".."){i.pop();continue}i.push(a)}return i.join("/")}function QFt(e){const t=Ef(),n=Z(()=>{if(!(!e.file||e.file.type!=="text"||e.file.encoding==="base64"))return e.file.content}),r=Z(()=>{const l=n();if(!(!l||!YFt(e.path)))return l}),i=Z(()=>{const l=n();if(!(!l||!JFt(e.path)))return l}),a=Z(()=>lB(e.file?.content??"")),o=l=>t.sdk.client.file.read({path:l}).then(c=>c.data).catch(()=>{}),s=async l=>{const c=await o(l);if(!(!c||c.type!=="text"||c.encoding==="base64"))return c.content};return d(ke,{get when(){return e.file},get fallback(){return eFt()},children:l=>(()=>{var c=tFt();return K(c,d(ke,{get when(){return r()},get fallback(){return d(ke,{get when(){return i()},get fallback(){return(()=>{var u=nFt();return K(u,d(Qse,{mode:"text",get file(){return{name:e.path,contents:l().content,cacheKey:a()}},class:"text-11-mono",get media(){return{mode:"auto",path:e.path,current:l(),readFile:o}}})),u})()},children:u=>(()=>{var h=rFt();return K(h,d(XHt,{get value(){return u()}})),h})()})},children:u=>d(Qne,{data:eVt,get directory(){return t.sdk.directory},get mediaUrl(){return t.sdk.url},get children(){var h=iFt();return K(h,d(RHt,{get text(){return u()},get cacheKey(){return a()},onLinkClick:m=>{const g=Bte(e.path,m);g&&t.push(`file:${g}`,"file")},fileFetch:m=>{const g=Bte(e.path,m);return g?s(g):Promise.resolve(void 0)}})),h}})})),c})()})}const eVt={session:[],session_status:{},session_diff:{},message:{},part:{}};function tVt(e){const t=lf(),n=ape(),r=Cf(),[i,a]=nt({stack:[],size:qte,open:!1,closing:!1}),o={stack:()=>i.stack,size:()=>i.size,trellis:n,sdk:r,push(s,l){const c=KFt(s,l);a("stack",Je(u=>{u[u.length-1]?.id!==c&&u.push({key:`${c}:${Date.now()}`,id:c,type:ZFt(c,l)})}))},pop(){if(i.stack.length<=1){a("stack",[]);return}a("stack",i.stack.slice(0,-1))},clear(){a("stack",[])},setSize(s,l){a("size",{w:jte(s,560,Math.min(920,window.innerWidth-96)),h:jte(l,420,Math.min(760,window.innerHeight-120))})},getTransform(s){const l=i.stack.length-1-s;return l<=0?{scale:1,offsetY:16,brightness:1,interactive:!0}:{scale:Math.max(.82,1-l*.04),offsetY:l*-28,brightness:Math.max(.5,1-l*.14),interactive:!1}}};return he(()=>{if(i.stack.length>0){!i.open&&!i.closing&&(a("open",!0),t.show(()=>d(hU.Provider,{value:o,get children(){return d(nVt,{})}}),()=>{ct(()=>{a("open",!1),a("closing",!1),a("stack",[]),a("size",qte)})}));return}i.open&&!i.closing&&(a("closing",!0),t.close())}),d(hU.Provider,{value:o,get children(){return e.children}})}function Ef(){const e=Lt(hU);if(!e)throw new Error("useEntityDialog must be used within EntityDialogProvider");return e}function nVt(){const e=Ef();return d(jz,{size:"x-large",transition:!0,class:"!h-full !bg-transparent !shadow-none !overflow-visible",get children(){var t=aFt();return K(t,d(Qt,{get each(){return e.stack()},children:(n,r)=>d(rVt,{entry:n,get index(){return r()}})})),t}})}function rVt(e){const t=Ef(),n=Z(()=>t.getTransform(e.index)),r=Z(()=>e.index===t.stack().length-1),i=Z(()=>t.stack()[e.index-1]);return(()=>{var a=sFt(),o=a.firstChild,s=o.firstChild,l=s.firstChild,c=l.nextSibling,u=o.nextSibling;return K(o,d(ke,{get when(){return e.index>0},get children(){var h=oFt(),m=h.firstChild;return h.$$click=()=>t.pop(),K(h,d(Kt,{name:"arrow-left",size:"small"}),m),K(m,(()=>{var g=bt(()=>!!i());return()=>g()?Gz(i().id):"Back"})()),h}}),s),K(l,d(QHt,{get type(){return e.entry.type},size:12}),null),K(l,()=>e.entry.type,null),K(c,()=>Gz(e.entry.id)),K(o,d(ke,{get when(){return r()},get children(){return d(Cr,{icon:"close-small",variant:"ghost",onClick:()=>t.clear()})}}),null),K(u,d(ke,{get when(){return e.entry.type==="issue"},get fallback(){return d(Cpe,{get id(){return e.entry.id},get type(){return e.entry.type}})},get children(){return d(iVt,{get id(){return e.entry.id}})}})),Qe(h=>{var m=`translateY(${n().offsetY}px) scale(${n().scale})`,g=`brightness(${n().brightness})`,y=n().interactive?"auto":"none",v=`${100+e.index}`,k=_pe(e.entry.type);return m!==h.e&&kr(a,"transform",h.e=m),g!==h.t&&kr(a,"filter",h.t=g),y!==h.a&&kr(a,"pointer-events",h.a=y),v!==h.o&&kr(a,"z-index",h.o=v),k!==h.i&&kr(l,"color",h.i=k),h},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()}function Spe(e){const t=Ef(),[n]=Yr(()=>e.entityId,t.trellis.fetchEntity),[r]=Yr(()=>e.entityId,t.trellis.fetchRefs),i=Z(()=>(n()?.facts??[]).filter(s=>!XFt.has(s.a))),a=Z(()=>n()?.links??[]),o=Z(()=>i().length>0||a().length>0||(r()?.outgoing.length??0)>0||(r()?.incoming.length??0)>0);return d(ke,{get when(){return o()},get children(){var s=hFt(),l=s.firstChild;return K(l,d(ke,{get when(){return i().length>0},get children(){var c=lFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"tag",size:"small"}),h),K(m,d(Qt,{get each(){return i().slice(0,24)},children:g=>(()=>{var y=fFt(),v=y.firstChild,k=v.nextSibling;return K(v,()=>g.a),K(k,()=>fU(g.v)),Qe(()=>gt(k,"title",fU(g.v))),y})()})),c}}),null),K(l,d(ke,{get when(){return a().length>0},get children(){var c=cFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"arrow-right",size:"small"}),h),K(m,d(Qt,{get each(){return a().slice(0,16)},children:g=>(()=>{var y=pFt(),v=y.firstChild,k=v.nextSibling;return y.$$click=()=>t.push(g.e2),K(v,()=>g.a),K(k,()=>Gz(g.e2)),y})()})),c}}),null),K(l,d(ke,{get when(){return(r()?.outgoing.length??0)>0},get children(){var c=dFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"link",size:"small"}),h),K(m,d(Qt,{get each(){return r()?.outgoing},children:g=>{const y=`${g.namespace}:${g.target}`,v=g.state==="resolved"&&!!g.namespace&&!!g.target;return(()=>{var k=gFt(),b=k.firstChild,x=b.firstChild;return k.$$click=()=>v&&t.push(y,g.namespace),K(k,d(aVt,{get state(){return g.state}}),b),K(x,()=>g.title??y),K(b,d(ke,{get when(){return g.state!=="resolved"},get children(){var w=mFt();return K(w,()=>g.state,null),K(w,(()=>{var M=bt(()=>!!g.staleReason);return()=>M()?` (${g.staleReason})`:""})(),null),w}}),null),Qe(w=>hr(k,{"hover:bg-surface-raised-base/60 cursor-pointer":v,"cursor-default":!v},w)),k})()}})),c}}),null),K(l,d(ke,{get when(){return(r()?.incoming.length??0)>0},get children(){var c=uFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"arrow-left",size:"small"}),h),K(m,d(Qt,{get each(){return r()?.incoming},children:g=>(()=>{var y=yFt(),v=y.firstChild,k=v.firstChild,b=k.nextSibling;return b.firstChild,K(y,d(Kt,{name:"link",size:"small",class:"mt-0.5 shrink-0 text-icon-weak"}),v),K(k,()=>g.filePath),K(b,()=>g.line,null),y})()})),c}}),null),s}})}function iVt(e){const n=Ef().trellis,[r,i]=nt({busy:!1,adding:!1,newAcDesc:"",newAcCmd:"",assigning:!1,assignee:""}),a=Z(()=>e.id.replace(/^issue:/,"")),[o,s]=Yr(a,g=>n.getIssue(g)),[l]=Yr(a,g=>n.fetchDecisionChain(`issue:${g}`)),c=async g=>{i("busy",!0);try{await g(),await n.refresh(),s.refetch()}catch(y){console.error("[entity-dialog] action failed:",y)}finally{i("busy",!1)}},u=Z(()=>{const g=o();if(!g)return[];const y=[];return g.status==="backlog"&&y.push({label:"Triage",run:()=>void c(()=>n.triageIssue(a()))}),(g.status==="backlog"||g.status==="queue")&&y.push({label:"Start",run:()=>void c(()=>n.startIssue(a()))}),g.status==="in_progress"&&y.push({label:"Pause",run:()=>void c(()=>n.pauseIssue(a()))}),g.status==="paused"&&y.push({label:"Resume",run:()=>void c(()=>n.resumeIssue(a()))}),(g.status==="in_progress"||g.status==="paused")&&y.push({label:"Close",run:()=>void c(()=>n.closeIssue(a(),!0))}),g.status==="closed"&&y.push({label:"Reopen",run:()=>void c(()=>n.reopenIssue(a()))}),y}),h=async()=>{const g=r.newAcDesc.trim();g&&(await c(()=>n.addCriterion(a(),g,r.newAcCmd.trim()||void 0)),ct(()=>{i("newAcDesc",""),i("newAcCmd",""),i("adding",!1)}))},m=async()=>{const g=r.assignee.trim();g&&(await c(()=>n.assignIssue(a(),g)),ct(()=>{i("assignee",""),i("assigning",!1)}))};return(()=>{var g=vFt(),y=g.firstChild;return K(y,d(ke,{get when(){return!o.loading},get fallback(){return(()=>{var v=kFt(),k=v.firstChild;return K(v,d(D2,{}),k),v})()},get children(){return d(ke,{get when(){return o()},get fallback(){return d(Cpe,{get id(){return e.id},type:"issue"})},children:v=>(()=>{var k=IFt(),b=k.firstChild,x=b.firstChild,w=x.nextSibling,M=w.nextSibling,_=b.nextSibling,C=_.nextSibling,L=C.firstChild,S=L.firstChild,I=S.nextSibling,A=L.nextSibling,D=C.nextSibling,P=D.firstChild,O=P.firstChild,E=O.nextSibling;return K(x,()=>v().id),K(w,()=>v().priority),K(M,()=>v().status),K(_,()=>v().title),K(k,d(ke,{get when(){return v().description},get children(){var T=bFt();return K(T,()=>v().description),T}}),C),K(k,d(ke,{get when(){return v().labels.length>0},get children(){var T=wFt();return K(T,d(Qt,{get each(){return v().labels},children:R=>(()=>{var H=NFt();return K(H,R),H})()})),T}}),C),K(k,d(ke,{get when(){return u().length>0},get children(){var T=xFt();return K(T,d(Qt,{get each(){return u()},children:R=>d(Mn,{size:"small",variant:"ghost",get onClick(){return R.run},get disabled(){return r.busy},get children(){return R.label}})}),null),K(T,d(ke,{get when(){return!r.assigning},get children(){return d(Mn,{size:"small",variant:"ghost",onClick:()=>i("assigning",!0),get disabled(){return r.busy},children:"Assign"})}}),null),T}}),C),K(k,d(ke,{get when(){return r.assigning},get children(){var T=_Ft();return K(T,d(LR,{placeholder:"Agent ID...",get value(){return r.assignee},onInput:R=>i("assignee",R.target.value),onKeyDown:R=>R.key==="Enter"&&void m(),class:"flex-1",autofocus:!0}),null),K(T,d(Cr,{icon:"check-small",variant:"ghost",onClick:()=>void m(),get disabled(){return!r.assignee.trim()}}),null),K(T,d(Cr,{icon:"close-small",variant:"ghost",onClick:()=>i("assigning",!1)}),null),T}}),C),K(I,d(Mn,{size:"small",variant:"ghost",onClick:()=>i("adding",!0),get disabled(){return r.adding},children:"Add"}),null),K(I,d(Mn,{size:"small",variant:"ghost",onClick:()=>void c(async()=>{await n.runCriteria(a())}),get disabled(){return r.busy},children:"Run All"}),null),K(A,d(Qt,{get each(){return v().criteria},get fallback(){return AFt()},children:(T,R)=>(()=>{var H=EFt(),Y=H.firstChild,j=Y.firstChild,X=j.nextSibling,W=X.firstChild;return j.$$click=()=>{const G=T.status==="passed"?"failed":T.status==="failed"?"pending":"passed";c(()=>n.setCriterionStatus(a(),R(),G))},K(j,d(ke,{get when(){return T.status==="passed"},get fallback(){return d(ke,{get when(){return T.status==="failed"},get fallback(){return PFt()},get children(){return d(Kt,{name:"close-small",size:"small",class:"text-icon-error"})}})},get children(){return d(Kt,{name:"checklist",size:"small",class:"text-icon-success"})}})),K(W,()=>T.description),K(X,d(ke,{get when(){return T.command},get children(){var G=$Ft();return K(G,()=>T.command),G}}),null),K(H,d(ke,{get when(){return T.lastOutput},get children(){var G=TFt();return K(G,()=>T.lastOutput),G}}),null),Qe(()=>j.disabled=r.busy),H})()}),null),K(A,d(ke,{get when(){return r.adding},get children(){var T=MFt(),R=T.firstChild;return K(T,d(LR,{placeholder:"Criterion description...",get value(){return r.newAcDesc},onInput:H=>i("newAcDesc",H.target.value),onKeyDown:H=>H.key==="Enter"&&void h(),class:"w-full",autofocus:!0}),R),K(R,d(LR,{placeholder:"Command (optional)...",get value(){return r.newAcCmd},onInput:H=>i("newAcCmd",H.target.value),onKeyDown:H=>H.key==="Enter"&&void h(),class:"flex-1"}),null),K(R,d(Cr,{icon:"check-small",variant:"ghost",onClick:()=>void h(),get disabled(){return!r.newAcDesc.trim()}}),null),K(R,d(Cr,{icon:"close-small",variant:"ghost",onClick:()=>{ct(()=>{i("adding",!1),i("newAcDesc",""),i("newAcCmd","")})}}),null),T}}),null),K(k,d(ke,{get when(){return bt(()=>!!l())()&&l().length>0},get children(){var T=SFt(),R=T.firstChild,H=R.nextSibling;return K(H,d(Qt,{get each(){return l()},children:Y=>(()=>{var j=OFt(),X=j.firstChild,W=X.firstChild,G=X.nextSibling;return K(j,d(Kt,{name:"brain",size:"small",class:"mt-0.5 shrink-0 text-icon-weak"}),X),K(W,()=>Y.toolName),K(X,d(ke,{get when(){return Y.outputSummary},get children(){var J=DFt();return K(J,()=>Y.outputSummary),J}}),null),K(G,()=>Mpe(Y.timestamp)),j})()})),T}}),D),K(E,()=>v().createdAt),K(D,d(ke,{get when(){return v().assignee},get children(){var T=CFt(),R=T.firstChild,H=R.nextSibling;return K(H,()=>v().assignee),T}}),null),K(D,d(ke,{get when(){return v().branch},get children(){var T=LFt(),R=T.firstChild,H=R.nextSibling;return K(H,()=>v().branch),T}}),null),k})()})}})),K(g,d(Spe,{get entityId(){return`issue:${a()}`},type:"issue"}),null),g})()}function Cpe(e){const t=Ef(),[n]=Yr(()=>e.id,t.trellis.fetchEntity),[r]=Yr(()=>e.id,t.trellis.fetchDecisionChain),i=Z(()=>Gz(e.id)),[a]=Yr(()=>e.type==="file"?i():void 0,async s=>(await t.sdk.client.file.read({path:s})).data),[o]=Yr(()=>e.type==="directory"?i():void 0,async s=>(await t.sdk.client.file.list({path:s})).data??[]);return Z(()=>Fte(n(),["title","name","message","estimatedIntent","url"])??Hte(i())),Z(()=>Fte(n(),["description","purpose","summary"])),(()=>{var s=HFt(),l=s.firstChild;return K(l,d(ke,{get when(){return e.type==="file"},get children(){var c=RFt();return K(c,d(ke,{get when(){return!a.loading},get fallback(){return(()=>{var u=FFt(),h=u.firstChild;return K(u,d(D2,{}),h),u})()},get children(){return d(QFt,{get path(){return i()},get file(){return a()}})}})),c}}),null),K(l,d(ke,{get when(){return e.type==="directory"},get children(){var c=qFt();return c.firstChild,K(c,d(ke,{get when(){return!o.loading},get fallback(){return(()=>{var u=VFt(),h=u.firstChild;return K(u,d(D2,{}),h),u})()},get children(){return d(ke,{get when(){return(o()?.length??0)>0},get fallback(){return BFt()},get children(){var u=zFt();return K(u,d(Qt,{get each(){return o()?.slice(0,40)},children:h=>(()=>{var m=UFt(),g=m.firstChild,y=g.firstChild,v=y.nextSibling,k=g.nextSibling;return m.$$click=()=>t.push(h.type==="directory"?`dir:${h.path}`:`file:${h.path}`,h.type),K(y,()=>h.type),K(v,()=>Hte(h.path)),K(k,()=>h.path),m})()})),u}})}}),null),c}}),null),K(l,d(ke,{get when(){return bt(()=>!!r())()&&r().length>0},get children(){var c=jFt(),u=c.firstChild,h=u.nextSibling;return K(h,d(Qt,{get each(){return r().slice(0,8)},children:m=>(()=>{var g=WFt(),y=g.firstChild,v=y.nextSibling;return K(y,()=>m.toolName),K(v,()=>Mpe(m.timestamp)),g})()})),c}}),null),K(s,d(Spe,{get entityId(){return e.id},get type(){return e.type}}),null),s})()}function aVt(e){return e.state==="resolved"?GFt():e.state==="stale"?d(Kt,{name:"alert-triangle",size:"small",class:"shrink-0 text-text-warning mt-0.5"}):d(Kt,{name:"x-circle",size:"small",class:"shrink-0 text-text-danger mt-0.5"})}li(["click"]);function oVt(){const e=xj(),t=cqt(),n=di();let r,i;return he(()=>{const a=n.id;if(!a){r&&(t.removeJob(r),r=void 0);return}(e.data.session_status[a]?.type??"idle")!=="idle"?r||(r=t.addJob({type:"generate",label:"Generating...",status:"running"})):r&&(t.removeJob(r),r=void 0)}),he(()=>{const a=e.data.status;a==="loading"||a==="partial"?i||(i=t.addJob({type:"sync",label:"Syncing project...",status:"running"})):i&&(t.removeJob(i),i=void 0)}),me(()=>{r&&t.removeJob(r),i&&t.removeJob(i),r=void 0,i=void 0}),null}const Lpe=Tt(),Ute=50;function sVt(e){const t=ope(),[n,r]=nt({items:[],seen:new Set}),i=(h,m)=>{const g={id:crypto.randomUUID(),title:h,type:m,timestamp:Date.now(),read:!1};r(Je(y=>{y.items.unshift(g),y.items.length>Ute&&(y.items.length=Ute)}))};he(vn(()=>t?.issues?.map(h=>h.id).join(",")??"",(h,m)=>{if(m===void 0)return;const g=new Set(m.split(",").filter(Boolean));for(const y of t?.issues??[])g.has(y.id)||i(`Issue created: ${y.title}`,"issue")})),he(vn(()=>t?.workUnits?.map(h=>h.id).join(",")??"",(h,m)=>{if(m===void 0)return;const g=new Set(m.split(",").filter(Boolean));for(const y of t?.workUnits??[])g.has(y.id)||i(`Work unit: ${y.title}`,"op")}));const a=()=>n.items,o=Z(()=>n.items.filter(h=>!h.read).length),s=Z(()=>n.items[0]),u={items:a,unread:o,latest:s,markRead:h=>{r("items",m=>m.id===h,"read",!0)},markAllRead:()=>{r("items",()=>!0,"read",!0)},push:i};return d(Lpe.Provider,{value:u,get children(){return e.children}})}function kQt(){return Lt(Lpe)}function lVt(e,t){e.indexOf(t)===-1&&e.push(t)}function _K(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const el=(e,t,n)=>n>t?t:n<e?e:n;let MK=()=>{};const tl={},Ipe=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function cVt(e){return typeof e=="object"&&e!==null}const Npe=e=>/^0[^.\s]+$/u.test(e);function Ape(e){let t;return()=>(t===void 0&&(t=e()),t)}const Pf=e=>e,dVt=(e,t)=>n=>t(e(n)),SK=(...e)=>e.reduce(dVt),CK=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class $pe{constructor(){this.subscriptions=[]}add(t){return lVt(this.subscriptions,t),()=>_K(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ia=e=>e*1e3,Ta=e=>e/1e3;function Tpe(e,t){return t?e*(1e3/t):0}const uVt=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e},Epe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,hVt=1e-7,fVt=12;function pVt(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Epe(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>hVt&&++s<fVt);return o}function Cm(e,t,n,r){if(e===t&&n===r)return Pf;const i=a=>pVt(a,0,1,e,n);return a=>a===0||a===1?a:Epe(i(a),t,r)}const Ppe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Dpe=e=>t=>1-e(1-t),Ope=Cm(.33,1.53,.69,.99),LK=Dpe(Ope),Rpe=Ppe(LK),zpe=e=>e>=1?1:(e*=2)<1?.5*LK(e):.5*(2-Math.pow(2,-10*(e-1))),IK=e=>1-Math.sin(Math.acos(e)),mVt=Dpe(IK),qpe=Ppe(IK),gVt=Cm(.42,0,1,1),yVt=Cm(0,0,.58,1),jpe=Cm(.42,0,.58,1),Hpe=e=>Array.isArray(e)&&typeof e[0]!="number";function Fpe(e,t){return Hpe(e)?e[uVt(0,e.length,t)]:e}const Vpe=e=>Array.isArray(e)&&typeof e[0]=="number",vVt={linear:Pf,easeIn:gVt,easeInOut:jpe,easeOut:yVt,circIn:IK,circInOut:qpe,circOut:mVt,backIn:LK,backInOut:Rpe,backOut:Ope,anticipate:zpe},kVt=e=>typeof e=="string",Wte=e=>{if(Vpe(e)){MK(e.length===4);const[t,n,r,i]=e;return Cm(t,n,r,i)}else if(kVt(e))return vVt[e];return e},Kg=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function bVt(e,t){let n=new Set,r=new Set,i=!1,a=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),e()),u(s)}const c={schedule:(u,h=!1,m=!1)=>{const y=m&&i?n:r;return h&&o.add(u),y.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(s=u,i){a=!0;return}i=!0;const h=n;n=r,r=h,n.forEach(l),n.clear(),i=!1,a&&(a=!1,c.process(u))}};return c}const wVt=40;function Bpe(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Kg.reduce((w,M)=>(w[M]=bVt(a),w),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:m,render:g,postRender:y}=o,v=()=>{const w=tl.useManualTiming,M=w?i.timestamp:performance.now();n=!1,w||(i.delta=r?1e3/60:Math.max(Math.min(M-i.timestamp,wVt),1)),i.timestamp=M,i.isProcessing=!0,s.process(i),l.process(i),c.process(i),u.process(i),h.process(i),m.process(i),g.process(i),y.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(v))},k=()=>{n=!0,r=!0,i.isProcessing||e(v)};return{schedule:Kg.reduce((w,M)=>{const _=o[M];return w[M]=(C,L=!1,S=!1)=>(n||k(),_.schedule(C,L,S)),w},{}),cancel:w=>{for(let M=0;M<Kg.length;M++)o[Kg[M]].cancel(w)},state:i,steps:o}}const{schedule:_o,cancel:pU,state:Zz}=Bpe(typeof requestAnimationFrame<"u"?requestAnimationFrame:Pf,!0);let $R;function xVt(){$R=void 0}const Di={now:()=>($R===void 0&&Di.set(Zz.isProcessing||tl.useManualTiming?Zz.timestamp:performance.now()),$R),set:e=>{$R=e,queueMicrotask(xVt)}},Upe=e=>t=>typeof t=="string"&&t.startsWith(e),Wpe=Upe("--"),_Vt=Upe("var(--"),NK=e=>_Vt(e)?MVt.test(e.split("/*")[0].trim()):!1,MVt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Gte(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Df={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},O2={...Df,transform:e=>el(0,1,e)},Xg={...Df,default:1},e2=e=>Math.round(e*1e5)/1e5,AK=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function SVt(e){return e==null}const CVt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$K=(e,t)=>n=>!!(typeof n=="string"&&CVt.test(n)&&n.startsWith(e)||t&&!SVt(n)&&Object.prototype.hasOwnProperty.call(n,t)),Gpe=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,o,s]=r.match(AK);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},LVt=e=>el(0,255,e),KF={...Df,transform:e=>Math.round(LVt(e))},K1={test:$K("rgb","red"),parse:Gpe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+KF.transform(e)+", "+KF.transform(t)+", "+KF.transform(n)+", "+e2(O2.transform(r))+")"};function IVt(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const mU={test:$K("#"),parse:IVt,transform:K1.transform},Lm=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),$s=Lm("deg"),zh=Lm("%"),Ze=Lm("px"),NVt=Lm("vh"),AVt=Lm("vw"),Zte={...zh,parse:e=>zh.parse(e)/100,transform:e=>zh.transform(e*100)},Mh={test:$K("hsl","hue"),parse:Gpe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+zh.transform(e2(t))+", "+zh.transform(e2(n))+", "+e2(O2.transform(r))+")"},Un={test:e=>K1.test(e)||mU.test(e)||Mh.test(e),parse:e=>K1.test(e)?K1.parse(e):Mh.test(e)?Mh.parse(e):mU.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?K1.transform(e):Mh.transform(e),getAnimatableNone:e=>{const t=Un.parse(e);return t.alpha=0,Un.transform(t)}},$Vt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function TVt(e){return isNaN(e)&&typeof e=="string"&&(e.match(AK)?.length||0)+(e.match($Vt)?.length||0)>0}const Zpe="number",Kpe="color",EVt="var",PVt="var(",Kte="${}",DVt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function rf(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(DVt,l=>(Un.test(l)?(r.color.push(a),i.push(Kpe),n.push(Un.parse(l))):l.startsWith(PVt)?(r.var.push(a),i.push(EVt),n.push(l)):(r.number.push(a),i.push(Zpe),n.push(parseFloat(l))),++a,Kte)).split(Kte);return{values:n,split:s,indexes:r,types:i}}function OVt(e){return rf(e).values}function Xpe({split:e,types:t}){const n=e.length;return r=>{let i="";for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){const o=t[a];o===Zpe?i+=e2(r[a]):o===Kpe?i+=Un.transform(r[a]):i+=r[a]}return i}}function RVt(e){return Xpe(rf(e))}const zVt=e=>typeof e=="number"?0:Un.test(e)?Un.getAnimatableNone(e):e,qVt=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:zVt(e);function jVt(e){const t=rf(e);return Xpe(t)(t.values.map((r,i)=>qVt(r,t.split[i])))}const Ra={test:TVt,parse:OVt,createTransformer:RVt,getAnimatableNone:jVt};function XF(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function HVt({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=XF(l,s,e+1/3),a=XF(l,s,e),o=XF(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Kz(e,t){return n=>n>0?t:e}const Of=(e,t,n)=>e+(t-e)*n,YF=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},FVt=[mU,K1,Mh],VVt=e=>FVt.find(t=>t.test(e));function Xte(e){const t=VVt(e);if(!t)return!1;let n=t.parse(e);return t===Mh&&(n=HVt(n)),n}const Yte=(e,t)=>{const n=Xte(e),r=Xte(t);if(!n||!r)return Kz(e,t);const i={...n};return a=>(i.red=YF(n.red,r.red,a),i.green=YF(n.green,r.green,a),i.blue=YF(n.blue,r.blue,a),i.alpha=Of(n.alpha,r.alpha,a),K1.transform(i))},gU=new Set(["none","hidden"]);function BVt(e,t){return gU.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function UVt(e,t){return n=>Of(e,t,n)}function TK(e){return typeof e=="number"?UVt:typeof e=="string"?NK(e)?Kz:Un.test(e)?Yte:ZVt:Array.isArray(e)?Ype:typeof e=="object"?Un.test(e)?Yte:WVt:Kz}function Ype(e,t){const n=[...e],r=n.length,i=e.map((a,o)=>TK(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=i[o](a);return n}}function WVt(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=TK(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function GVt(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}const ZVt=(e,t)=>{const n=Ra.createTransformer(t),r=rf(e),i=rf(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?gU.has(e)&&!i.values.length||gU.has(t)&&!r.values.length?BVt(e,t):SK(Ype(GVt(r,i),i.values),n):Kz(e,t)};function Jpe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Of(e,t,n):TK(e)(e,t)}const KVt=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>_o.update(t,n),stop:()=>pU(t),now:()=>Zz.isProcessing?Zz.timestamp:Di.now()}},Qpe=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=Math.round(e(a/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Xz=2e4;function EK(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Xz;)t+=n,r=e.next(t);return t>=Xz?1/0:t}function e2e(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(EK(r),Xz);return{type:"keyframes",ease:a=>r.next(i*a).value/t,duration:Ta(i)}}const Dn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function yU(e,t){return e*Math.sqrt(1-t*t)}const XVt=12;function YVt(e,t,n){let r=n;for(let i=1;i<XVt;i++)r=r-e(r)/t(r);return r}const JF=.001;function JVt({duration:e=Dn.duration,bounce:t=Dn.bounce,velocity:n=Dn.velocity,mass:r=Dn.mass}){let i,a,o=1-t;o=el(Dn.minDamping,Dn.maxDamping,o),e=el(Dn.minDuration,Dn.maxDuration,Ta(e)),o<1?(i=c=>{const u=c*o,h=u*e,m=u-n,g=yU(c,o),y=Math.exp(-h);return JF-m/g*y},a=c=>{const h=c*o*e,m=h*n+n,g=Math.pow(o,2)*Math.pow(c,2)*e,y=Math.exp(-h),v=yU(Math.pow(c,2),o);return(-i(c)+JF>0?-1:1)*((m-g)*y)/v}):(i=c=>{const u=Math.exp(-c*e),h=(c-n)*e+1;return-JF+u*h},a=c=>{const u=Math.exp(-c*e),h=(n-c)*(e*e);return u*h});const s=5/e,l=YVt(i,a,s);if(e=ia(e),isNaN(l))return{stiffness:Dn.stiffness,damping:Dn.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const QVt=["duration","bounce"],eBt=["stiffness","damping","mass"];function Jte(e,t){return t.some(n=>e[n]!==void 0)}function tBt(e){let t={velocity:Dn.velocity,stiffness:Dn.stiffness,damping:Dn.damping,mass:Dn.mass,isResolvedFromDuration:!1,...e};if(!Jte(e,eBt)&&Jte(e,QVt))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*el(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Dn.mass,stiffness:i,damping:a}}else{const n=JVt({...e,velocity:0});t={...t,...n,mass:Dn.mass},t.isResolvedFromDuration=!0}return t}function R2(e=Dn.visualDuration,t=Dn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:h,velocity:m,isResolvedFromDuration:g}=tBt({...n,velocity:-Ta(n.velocity||0)}),y=m||0,v=c/(2*Math.sqrt(l*u)),k=o-a,b=Ta(Math.sqrt(l/u)),x=Math.abs(k)<5;r||(r=x?Dn.restSpeed.granular:Dn.restSpeed.default),i||(i=x?Dn.restDelta.granular:Dn.restDelta.default);let w,M,_,C,L,S;if(v<1)_=yU(b,v),C=(y+v*b*k)/_,w=A=>{const D=Math.exp(-v*b*A);return o-D*(C*Math.sin(_*A)+k*Math.cos(_*A))},L=v*b*C+k*_,S=v*b*k-C*_,M=A=>Math.exp(-v*b*A)*(L*Math.sin(_*A)+S*Math.cos(_*A));else if(v===1){w=D=>o-Math.exp(-b*D)*(k+(y+b*k)*D);const A=y+b*k;M=D=>Math.exp(-b*D)*(b*A*D-y)}else{const A=b*Math.sqrt(v*v-1);w=E=>{const T=Math.exp(-v*b*E),R=Math.min(A*E,300);return o-T*((y+v*b*k)*Math.sinh(R)+A*k*Math.cosh(R))/A};const D=(y+v*b*k)/A,P=v*b*D-k*A,O=v*b*k-D*A;M=E=>{const T=Math.exp(-v*b*E),R=Math.min(A*E,300);return T*(P*Math.sinh(R)+O*Math.cosh(R))}}const I={calculatedDuration:g&&h||null,velocity:A=>ia(M(A)),next:A=>{if(!g&&v<1){const P=Math.exp(-v*b*A),O=Math.sin(_*A),E=Math.cos(_*A),T=o-P*(C*O+k*E),R=ia(P*(L*O+S*E));return s.done=Math.abs(R)<=r&&Math.abs(o-T)<=i,s.value=s.done?o:T,s}const D=w(A);if(g)s.done=A>=h;else{const P=ia(M(A));s.done=Math.abs(P)<=r&&Math.abs(o-D)<=i}return s.value=s.done?o:D,s},toString:()=>{const A=Math.min(EK(I),Xz),D=Qpe(P=>I.next(A*P).value,A,30);return A+"ms "+D},toTransition:()=>{}};return I}R2.applyToOptions=e=>{const t=e2e(e,100,R2);return e.ease=t.ease,e.duration=ia(t.duration),e.type="keyframes",e};const nBt=5;function t2e(e,t,n){const r=Math.max(t-nBt,0);return Tpe(n-e(r),t-r)}function vU({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:l,restDelta:c=.5,restSpeed:u}){const h=e[0],m={done:!1,value:h},g=S=>s!==void 0&&S<s||l!==void 0&&S>l,y=S=>s===void 0?l:l===void 0||Math.abs(s-S)<Math.abs(l-S)?s:l;let v=n*t;const k=h+v,b=o===void 0?k:o(k);b!==k&&(v=b-h);const x=S=>-v*Math.exp(-S/r),w=S=>b+x(S),M=S=>{const I=x(S),A=w(S);m.done=Math.abs(I)<=c,m.value=m.done?b:A};let _,C;const L=S=>{g(m.value)&&(_=S,C=R2({keyframes:[m.value,y(m.value)],velocity:t2e(w,S,m.value),damping:i,stiffness:a,restDelta:c,restSpeed:u}))};return L(0),{calculatedDuration:null,next:S=>{let I=!1;return!C&&_===void 0&&(I=!0,M(S),L(S)),_!==void 0&&S>=_?C.next(S-_):(!I&&M(S),m)}}}function rBt(e,t,n){const r=[],i=n||tl.mix||Jpe,a=e.length-1;for(let o=0;o<a;o++){let s=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Pf:t;s=SK(l,s)}r.push(s)}return r}function iBt(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(MK(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=rBt(t,r,i),l=s.length,c=u=>{if(o&&u<e[0])return t[0];let h=0;if(l>1)for(;h<e.length-2&&!(u<e[h+1]);h++);const m=CK(e[h],e[h+1],u);return s[h](m)};return n?u=>c(el(e[0],e[a-1],u)):c}function n2e(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=CK(0,t,r);e.push(Of(n,1,i))}}function r2e(e){const t=[0];return n2e(t,e.length-1),t}function aBt(e,t){return e.map(n=>n*t)}function oBt(e,t){return e.map(()=>t||jpe).splice(0,e.length-1)}function t2({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Hpe(r)?r.map(Wte):Wte(r),a={done:!1,value:t[0]},o=aBt(n&&n.length===t.length?n:r2e(t),e),s=iBt(o,t,{ease:Array.isArray(i)?i:oBt(t,i)});return{calculatedDuration:e,next:l=>(a.value=s(l),a.done=l>=e,a)}}const sBt=e=>e!==null;function $j(e,{repeat:t,repeatType:n="loop"},r,i=1){const a=e.filter(sBt),s=i<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!s||r===void 0?a[s]:r}const lBt={decay:vU,inertia:vU,tween:t2,keyframes:t2,spring:R2};function i2e(e){typeof e.type=="string"&&(e.type=lBt[e.type])}class PK{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const cBt=e=>e/100;class Yz extends PK{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Di.now()&&this.tick(Di.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;i2e(t);const{type:n=t2,repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=t;let{keyframes:s}=t;const l=n||t2;l!==t2&&typeof s[0]!="number"&&(this.mixKeyframes=SK(cBt,Jpe(s[0],s[1])),s=[0,100]);const c=l({...t,keyframes:s});a==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...s].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=EK(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:s,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:m,repeatDelay:g,type:y,onUpdate:v,finalKeyframe:k}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const b=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?b<0:b>i;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,M=r;if(h){const S=Math.min(this.currentTime,i)/s;let I=Math.floor(S),A=S%1;!A&&S>=1&&(A=1),A===1&&I--,I=Math.min(I,h+1),!!(I%2)&&(m==="reverse"?(A=1-A,g&&(A-=g/s)):m==="mirror"&&(M=o)),w=el(0,1,A)*s}let _;x?(this.delayState.value=u[0],_=this.delayState):_=M.next(w),a&&!x&&(_.value=a(_.value));let{done:C}=_;!x&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return L&&y!==vU&&(_.value=$j(u,this.options,k,this.speed)),v&&v(_.value),L&&this.finish(),_}then(t,n){return this.finished.then(t,n)}get duration(){return Ta(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ta(t)}get time(){return Ta(this.currentTime)}set time(t){t=ia(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return t2e(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Di.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Ta(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=KVt,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Di.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function dBt(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const X1=e=>e*180/Math.PI,kU=e=>{const t=X1(Math.atan2(e[1],e[0]));return bU(t)},uBt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:kU,rotateZ:kU,skewX:e=>X1(Math.atan(e[1])),skewY:e=>X1(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},bU=e=>(e=e%360,e<0&&(e+=360),e),Qte=kU,ene=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),tne=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),hBt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ene,scaleY:tne,scale:e=>(ene(e)+tne(e))/2,rotateX:e=>bU(X1(Math.atan2(e[6],e[5]))),rotateY:e=>bU(X1(Math.atan2(-e[2],e[0]))),rotateZ:Qte,rotate:Qte,skewX:e=>X1(Math.atan(e[4])),skewY:e=>X1(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function wU(e){return e.includes("scale")?1:0}function xU(e,t){if(!e||e==="none")return wU(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=hBt,i=n;else{const s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=uBt,i=s}if(!i)return wU(t);const a=r[t],o=i[1].split(",").map(pBt);return typeof a=="function"?a(o):o[a]}const fBt=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return xU(n,t)};function pBt(e){return parseFloat(e.trim())}const Rf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zf=new Set(Rf),nne=e=>e===Df||e===Ze,mBt=new Set(["x","y","z"]),gBt=Rf.filter(e=>!mBt.has(e));function yBt(e){const t=[];return gBt.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const zs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>xU(t,"x"),y:(e,{transform:t})=>xU(t,"y")};zs.translateX=zs.x;zs.translateY=zs.y;const t0=new Set;let _U=!1,MU=!1,SU=!1;function a2e(){if(MU){const e=Array.from(t0).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=yBt(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,o])=>{r.getValue(a)?.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}MU=!1,_U=!1,t0.forEach(e=>e.complete(SU)),t0.clear()}function o2e(){t0.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(MU=!0)})}function vBt(){SU=!0,o2e(),a2e(),SU=!1}class DK{constructor(t,n,r,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(t0.add(this),_U||(_U=!0,_o.read(o2e),_o.resolveKeyframes(a2e))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const a=i?.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const s=r.readValue(n,o);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=o),i&&a===void 0&&i.set(t[0])}dBt(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),t0.delete(this)}cancel(){this.state==="scheduled"&&(t0.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const kBt=e=>e.startsWith("--");function s2e(e,t,n){kBt(t)?e.style.setProperty(t,n):e.style[t]=n}const bBt={};function l2e(e,t){const n=Ape(e);return()=>bBt[t]??n()}const wBt=l2e(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),c2e=l2e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Rp=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,rne={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Rp([0,.65,.55,1]),circOut:Rp([.55,0,1,.45]),backIn:Rp([.31,.01,.66,-.59]),backOut:Rp([.33,1.53,.69,.99])};function d2e(e,t){if(e)return typeof e=="function"?c2e()?Qpe(e,t):"ease-out":Vpe(e)?Rp(e):Array.isArray(e)?e.map(n=>d2e(n,t)||rne.easeOut):rne[e]}function xBt(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const h=d2e(s,i);Array.isArray(h)&&(u.easing=h);const m={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return c&&(m.pseudoElement=c),e.animate(u,m)}function OK(e){return typeof e=="function"&&"applyToOptions"in e}function _Bt({type:e,...t}){return OK(e)&&c2e()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class u2e extends PK{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:s,onComplete:l}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,MK(typeof t.type!="string");const c=_Bt(t);this.animation=xBt(n,r,i,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const u=$j(i,this.options,s,this.speed);this.updateMotionValue&&this.updateMotionValue(u),s2e(n,r,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Ta(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ta(t)}get time(){return Ta(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ia(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&wBt()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Pf):i(this)}}const h2e={anticipate:zpe,backInOut:Rpe,circInOut:qpe};function MBt(e){return e in h2e}function SBt(e){typeof e.ease=="string"&&MBt(e.ease)&&(e.ease=h2e[e.ease])}const QF=10;class CBt extends u2e{constructor(t){SBt(t),i2e(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:a,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const s=new Yz({...o,autoplay:!1}),l=Math.max(QF,Di.now()-this.startTime),c=el(0,QF,l-QF),u=s.sample(l).value,{name:h}=this.options;a&&h&&s2e(a,h,u),n.setWithVelocity(s.sample(Math.max(0,l-c)).value,u,c),s.stop()}}const ine=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ra.test(e)||e==="0")&&!e.startsWith("url("));function LBt(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function IBt(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=ine(i,t),s=ine(a,t);return!o||!s?!1:LBt(e)||(n==="spring"||OK(n))&&r}function CU(e){e.duration=0,e.type="keyframes"}const f2e=new Set(["opacity","clipPath","filter","transform"]),NBt=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ABt(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&NBt.test(e[t]))return!0;return!1}const $Bt=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),TBt=Ape(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function EBt(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return TBt()&&n&&(f2e.has(n)||$Bt.has(n)&&ABt(s))&&(n!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&a!==0&&o!=="inertia"}const PBt=40;class DBt extends PK{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:s,name:l,motionValue:c,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Di.now();const m={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:o,name:l,motionValue:c,element:u,...h},g=u?.KeyframeResolver||DK;this.keyframeResolver=new g(s,(y,v,k)=>this.onKeyframesResolved(y,v,m,!k),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:s,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Di.now();let h=!0;IBt(t,a,o,s)||(h=!1,(tl.instantAnimations||!l)&&u?.($j(t,r,n)),t[0]=t[t.length-1],CU(r),r.repeat=0);const g={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>PBt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},y=h&&!c&&EBt(g),v=g.motionValue?.owner?.current;let k;if(y)try{k=new CBt({...g,element:v})}catch{k=new Yz(g)}else k=new Yz(g);k.finished.then(()=>{this.notifyFinished()}).catch(Pf),this.pendingTimeline&&(this.stopTimeline=k.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=k}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),vBt()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class OBt{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t){const n=this.animations.map(r=>r.attachTimeline(t));return()=>{n.forEach((r,i)=>{r&&r(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return ane(this.animations,"duration")}get iterationDuration(){return ane(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function ane(e,t){let n=0;for(let r=0;r<e.length;r++){const i=e[r][t];i!==null&&i>n&&(n=i)}return n}class RBt extends OBt{then(t,n){return this.finished.finally(t).then(()=>{})}}const zBt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function qBt(e){const t=zBt.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function p2e(e,t,n=1){const[r,i]=qBt(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return Ipe(o)?parseFloat(o):o}return NK(i)?p2e(i,t,n+1):i}const jBt={type:"spring",stiffness:500,damping:25,restSpeed:10},HBt=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),FBt={type:"keyframes",duration:.8},VBt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},BBt=(e,{keyframes:t})=>t.length>2?FBt:zf.has(e)?e.startsWith("scale")?HBt(t[1]):jBt:VBt;function m2e(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function g2e(e,t){const n=e?.[t]??e?.default??e;return n!==e?m2e(n,e):n}const UBt=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function WBt(e){for(const t in e)if(!UBt.has(t))return!0;return!1}const y2e=(e,t,n,r={},i,a)=>o=>{const s=g2e(r,e)||{},l=s.delay||r.delay||0;let{elapsed:c=0}=r;c=c-ia(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:m=>{t.set(m),s.onUpdate&&s.onUpdate(m)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};WBt(s)||Object.assign(u,BBt(e,u)),u.duration&&(u.duration=ia(u.duration)),u.repeatDelay&&(u.repeatDelay=ia(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(CU(u),u.delay===0&&(h=!0)),(tl.instantAnimations||tl.skipAnimations||i?.shouldSkipAnimations)&&(h=!0,CU(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,h&&!a&&t.get()!==void 0){const m=$j(u.keyframes,s);if(m!==void 0){_o.update(()=>{u.onUpdate(m),u.onComplete()});return}}return s.isSync?new Yz(u):new DBt(u)};function one(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function v2e(e,t,n,r){if(typeof t=="function"){const[i,a]=one(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=one(r);t=t(n!==void 0?n:e.custom,i,a)}return t}function GBt(e,t,n){const r=e.getProps();return v2e(r,t,r.custom,e)}const k2e=new Set(["width","height","top","left","right","bottom",...Rf]),sne=30,ZBt=e=>!isNaN(parseFloat(e));class KBt{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const i=Di.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Di.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ZBt(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new $pe);const r=this.events[t].add(n);return t==="change"?()=>{r(),_o.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Di.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>sne)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,sne);return Tpe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function af(e,t){return new KBt(e,t)}const XBt=e=>Array.isArray(e);function YBt(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,af(n))}function JBt(e){return XBt(e)?e[e.length-1]||0:e}function QBt(e,t){const n=GBt(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a){const s=JBt(a[o]);YBt(e,o,s)}}const ni=e=>!!(e&&e.getVelocity);function eUt(e){return!!(ni(e)&&e.add)}function tUt(e,t){const n=e.getValue("willChange");if(eUt(n))return n.add(t);if(!n&&tl.WillChange){const r=new tl.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function RK(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const nUt="framerAppearId",rUt="data-"+RK(nUt);function iUt(e){return e.props[rUt]}function aUt({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function oUt(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t;const l=e.getDefaultTransition();a=a?m2e(a,l):l;const c=a?.reduceMotion;r&&(a=r);const u=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const m in s){const g=e.getValue(m,e.latestValues[m]??null),y=s[m];if(y===void 0||h&&aUt(h,m))continue;const v={delay:n,...g2e(a||{},m)},k=g.get();if(k!==void 0&&!g.isAnimating()&&!Array.isArray(y)&&y===k&&!v.velocity){_o.update(()=>g.set(y));continue}let b=!1;if(window.MotionHandoffAnimation){const M=iUt(e);if(M){const _=window.MotionHandoffAnimation(M,m,_o);_!==null&&(v.startTime=_,b=!0)}}tUt(e,m);const x=c??e.shouldReduceMotion;g.start(y2e(m,g,y,x&&k2e.has(m)?{type:!1}:v,e,b));const w=g.animation;w&&u.push(w)}if(o){const m=()=>_o.update(()=>{o&&QBt(e,o)});u.length?Promise.all(u).then(m):m()}return u}const sUt={test:e=>e==="auto",parse:e=>e},b2e=e=>t=>t.test(e),w2e=[Df,Ze,zh,$s,AVt,NVt,sUt],lne=e=>w2e.find(b2e(e));function lUt(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Npe(e):!0}const cUt=new Set(["brightness","contrast","saturate","opacity"]);function dUt(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(AK)||[];if(!r)return e;const i=n.replace(r,"");let a=cUt.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const uUt=/\b([a-z-]*)\(.*?\)/gu,LU={...Ra,getAnimatableNone:e=>{const t=e.match(uUt);return t?t.map(dUt).join(" "):e}},IU={...Ra,getAnimatableNone:e=>{const t=Ra.parse(e);return Ra.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},cne={...Df,transform:Math.round},hUt={rotate:$s,rotateX:$s,rotateY:$s,rotateZ:$s,scale:Xg,scaleX:Xg,scaleY:Xg,scaleZ:Xg,skew:$s,skewX:$s,skewY:$s,distance:Ze,translateX:Ze,translateY:Ze,translateZ:Ze,x:Ze,y:Ze,z:Ze,perspective:Ze,transformPerspective:Ze,opacity:O2,originX:Zte,originY:Zte,originZ:Ze},zK={borderWidth:Ze,borderTopWidth:Ze,borderRightWidth:Ze,borderBottomWidth:Ze,borderLeftWidth:Ze,borderRadius:Ze,borderTopLeftRadius:Ze,borderTopRightRadius:Ze,borderBottomRightRadius:Ze,borderBottomLeftRadius:Ze,width:Ze,maxWidth:Ze,height:Ze,maxHeight:Ze,top:Ze,right:Ze,bottom:Ze,left:Ze,inset:Ze,insetBlock:Ze,insetBlockStart:Ze,insetBlockEnd:Ze,insetInline:Ze,insetInlineStart:Ze,insetInlineEnd:Ze,padding:Ze,paddingTop:Ze,paddingRight:Ze,paddingBottom:Ze,paddingLeft:Ze,paddingBlock:Ze,paddingBlockStart:Ze,paddingBlockEnd:Ze,paddingInline:Ze,paddingInlineStart:Ze,paddingInlineEnd:Ze,margin:Ze,marginTop:Ze,marginRight:Ze,marginBottom:Ze,marginLeft:Ze,marginBlock:Ze,marginBlockStart:Ze,marginBlockEnd:Ze,marginInline:Ze,marginInlineStart:Ze,marginInlineEnd:Ze,fontSize:Ze,backgroundPositionX:Ze,backgroundPositionY:Ze,...hUt,zIndex:cne,fillOpacity:O2,strokeOpacity:O2,numOctaves:cne},fUt={...zK,color:Un,backgroundColor:Un,outlineColor:Un,fill:Un,stroke:Un,borderColor:Un,borderTopColor:Un,borderRightColor:Un,borderBottomColor:Un,borderLeftColor:Un,filter:LU,WebkitFilter:LU,mask:IU,WebkitMask:IU},x2e=e=>fUt[e],pUt=new Set([LU,IU]);function _2e(e,t){let n=x2e(e);return pUt.has(n)||(n=Ra),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const mUt=new Set(["auto","none","0"]);function gUt(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!mUt.has(a)&&rf(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=_2e(n,i)}class yUt extends DK{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let h=t[u];if(typeof h=="string"&&(h=h.trim(),NK(h))){const m=p2e(h,n.current);m!==void 0&&(t[u]=m),u===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!k2e.has(r)||t.length!==2)return;const[i,a]=t,o=lne(i),s=lne(a),l=Gte(i),c=Gte(a);if(l!==c&&zs[r]){this.needsMeasurement=!0;return}if(o!==s)if(nne(o)&&nne(s))for(let u=0;u<t.length;u++){const h=t[u];typeof h=="string"&&(t[u]=parseFloat(h))}else zs[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||lUt(t[i]))&&r.push(i);r.length&&gUt(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=zs[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=zs[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,l])=>{t.getValue(s).set(l)}),this.resolveNoneKeyframes()}}function vUt(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;t&&(r=t.current);const i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const M2e=(e,t)=>t&&typeof e=="number"?t.transform(e):e,{schedule:kUt}=Bpe(queueMicrotask,!1);function S2e(e){return cVt(e)&&"ownerSVGElement"in e}function bUt(e){return S2e(e)&&e.tagName==="svg"}const wUt=[...w2e,Un,Ra],xUt=e=>wUt.find(b2e(e)),dne=()=>({min:0,max:0}),qK=()=>({x:dne(),y:dne()}),z2=new WeakMap;function _Ut(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function MUt(e){return typeof e=="string"||Array.isArray(e)}const SUt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],CUt=["initial",...SUt];function C2e(e){return _Ut(e.animate)||CUt.some(t=>MUt(e[t]))}function LUt(e){return!!(C2e(e)||e.variants)}function IUt(e,t,n){for(const r in t){const i=t[r],a=n[r];if(ni(i))e.addValue(r,i);else if(ni(a))e.addValue(r,af(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,af(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const NU={current:null},L2e={current:!1},NUt=typeof window<"u";function AUt(){if(L2e.current=!0,!!NUt)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>NU.current=e.matches;e.addEventListener("change",t),t()}else NU.current=!1}const une=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let hne={};class I2e{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:o,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=DK,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const g=Di.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,_o.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=s;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=C2e(n),this.isVariantNode=LUt(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const g in m){const y=m[g];c[g]!==void 0&&ni(y)&&y.set(c[g])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,z2.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(L2e.current||AUt(),this.shouldReduceMotion=NU.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),pU(this.notifyUpdate),pU(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&f2e.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:s,times:l,ease:c,duration:u}=n.accelerate,h=new u2e({element:this.current,name:t,keyframes:s,times:l,ease:c,duration:ia(u)}),m=o(h);this.valueSubscriptions.set(t,()=>{m(),h.cancel()});return}const r=zf.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&_o.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in hne){const n=hne[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):qK()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<une.length;r++){const i=une[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=IUt(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=af(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Ipe(r)||Npe(r))?r=parseFloat(r):!xUt(r)&&Ra.test(n)&&(r=_2e(t,n)),this.setBaseTarget(t,ni(r)?r.get():r)),ni(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=v2e(this.props,n,this.presenceContext?.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ni(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new $pe),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){kUt.render(this.render)}}class N2e extends I2e{constructor(){super(...arguments),this.KeyframeResolver=yUt}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ni(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function $Ut({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function TUt(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function EUt(e,t){return $Ut(TUt(e.getBoundingClientRect(),t))}const PUt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},DUt=Rf.length;function OUt(e,t,n){let r="",i=!0;for(let a=0;a<DUt;a++){const o=Rf[a],s=e[o];if(s===void 0)continue;let l=!0;if(typeof s=="number")l=s===(o.startsWith("scale")?1:0);else{const c=parseFloat(s);l=o.startsWith("scale")?c===1:c===0}if(!l||n){const c=M2e(s,zK[o]);if(!l){i=!1;const u=PUt[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function A2e(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let o=!1,s=!1;for(const l in t){const c=t[l];if(zf.has(l)){o=!0;continue}else if(Wpe(l)){i[l]=c;continue}else{const u=M2e(c,zK[l]);l.startsWith("origin")?(s=!0,a[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=OUt(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:l="50%",originY:c="50%",originZ:u=0}=a;r.transformOrigin=`${l} ${c} ${u}`}}function $2e(e,{style:t,vars:n},r,i){const a=e.style;let o;for(o in t)a[o]=t[o];i?.applyProjectionStyles(a,r);for(o in n)a.setProperty(o,n[o])}function fne(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const wp={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ze.test(e))e=parseFloat(e);else return e;const n=fne(e,t.target.x),r=fne(e,t.target.y);return`${n}% ${r}%`}},RUt={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Ra.parse(e);if(i.length>5)return r;const a=Ra.createTransformer(e),o=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=l;const c=Of(s,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),a(i)}},zUt={borderRadius:{...wp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wp,borderTopRightRadius:wp,borderBottomLeftRadius:wp,borderBottomRightRadius:wp,boxShadow:RUt};function qUt(e,{layout:t,layoutId:n}){return zf.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!zUt[e]||e==="opacity")}function T2e(e,t,n){const r=e.style,i=t?.style,a={};if(!r)return a;for(const o in r)(ni(r[o])||i&&ni(i[o])||qUt(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(a[o]=r[o]);return a}function jUt(e){return window.getComputedStyle(e)}class HUt extends N2e{constructor(){super(...arguments),this.type="html",this.renderInstance=$2e}readValueFromInstance(t,n){if(zf.has(n))return this.projection?.isProjecting?wU(n):fBt(t,n);{const r=jUt(t),i=(Wpe(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return EUt(t,n)}build(t,n,r){A2e(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return T2e(t,n,r)}}function FUt(e,t){return e in t}class VUt extends I2e{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(FUt(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return qK()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}const BUt={offset:"stroke-dashoffset",array:"stroke-dasharray"},UUt={offset:"strokeDashoffset",array:"strokeDasharray"};function WUt(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?BUt:UUt;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const GUt=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function ZUt(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},l,c,u){if(A2e(e,s,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m}=e;h.transform&&(m.transform=h.transform,delete h.transform),(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const g of GUt)h[g]!==void 0&&(m[g]=h[g],delete h[g]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&WUt(h,i,a,o,!1)}const E2e=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),KUt=e=>typeof e=="string"&&e.toLowerCase()==="svg";function XUt(e,t,n,r){$2e(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(E2e.has(i)?i:RK(i),t.attrs[i])}function YUt(e,t,n){const r=T2e(e,t,n);for(const i in e)if(ni(e[i])||ni(t[i])){const a=Rf.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}class JUt extends N2e{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=qK}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(zf.has(n)){const r=x2e(n);return r&&r.default||0}return n=E2e.has(n)?n:RK(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return YUt(t,n,r)}build(t,n,r){ZUt(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){XUt(t,n,r,i)}mount(t){this.isSVGTag=KUt(t.tagName),super.mount(t)}}function QUt(e,t,n){const r=ni(e)?e:af(e);return r.start(y2e("",r,t,n)),r.animation}function jK(e){return typeof e=="object"&&!Array.isArray(e)}function P2e(e,t,n,r){return e==null?[]:typeof e=="string"&&jK(t)?vUt(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(i=>i!=null):[e]}function eWt(e,t,n){return e*(t+1)}function pne(e,t,n,r){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function tWt(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];i.at>t&&i.at<n&&(_K(e,i),r--)}}function nWt(e,t,n,r,i,a){tWt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Of(i,a,r[o]),easing:Fpe(n,o)})}function rWt(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function iWt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const aWt="easeInOut";function oWt(e,{defaultTransition:t={},...n}={},r,i){const a=t.duration||.3,o=new Map,s=new Map,l={},c=new Map;let u=0,h=0,m=0;for(let g=0;g<e.length;g++){const y=e[g];if(typeof y=="string"){c.set(y,h);continue}else if(!Array.isArray(y)){c.set(y.name,pne(h,y.at,u,c));continue}let[v,k,b={}]=y;b.at!==void 0&&(h=pne(h,b.at,u,c));let x=0;const w=(M,_,C,L=0,S=0)=>{const I=sWt(M),{delay:A=0,times:D=r2e(I),type:P=t.type||"keyframes",repeat:O,repeatType:E,repeatDelay:T=0,...R}=_;let{ease:H=t.ease||"easeOut",duration:Y}=_;const j=typeof A=="function"?A(L,S):A,X=I.length,W=OK(P)?P:i?.[P||"keyframes"];if(X<=2&&W){let de=100;if(X===2&&dWt(I)){const le=I[1]-I[0];de=Math.abs(le)}const ye={...t,...R};Y!==void 0&&(ye.duration=ia(Y));const ve=e2e(ye,de,W);H=ve.ease,Y=ve.duration}Y??(Y=a);const G=h+j;D.length===1&&D[0]===0&&(D[1]=1);const J=D.length-I.length;if(J>0&&n2e(D,J),I.length===1&&I.unshift(null),O){Y=eWt(Y,O);const de=[...I],ye=[...D];H=Array.isArray(H)?[...H]:[H];const ve=[...H];for(let le=0;le<O;le++){I.push(...de);for(let pe=0;pe<de.length;pe++)D.push(ye[pe]+(le+1)),H.push(pe===0?"linear":Fpe(ve,pe-1))}rWt(D,O)}const oe=G+Y;nWt(C,I,H,D,G,oe),x=Math.max(j+Y,x),m=Math.max(oe,m)};if(ni(v)){const M=mne(v,s);w(k,b,gne("default",M))}else{const M=P2e(v,k,r,l),_=M.length;for(let C=0;C<_;C++){k=k,b=b;const L=M[C],S=mne(L,s);for(const I in k)w(k[I],lWt(b,I),gne(I,S),C,_)}}u=h,h+=x}return s.forEach((g,y)=>{for(const v in g){const k=g[v];k.sort(iWt);const b=[],x=[],w=[];for(let L=0;L<k.length;L++){const{at:S,value:I,easing:A}=k[L];b.push(I),x.push(CK(0,m,S)),w.push(A||"easeOut")}x[0]!==0&&(x.unshift(0),b.unshift(b[0]),w.unshift(aWt)),x[x.length-1]!==1&&(x.push(1),b.push(null)),o.has(y)||o.set(y,{keyframes:{},transition:{}});const M=o.get(y);M.keyframes[v]=b;const{type:_,...C}=t;M.transition[v]={...C,duration:m,ease:w,times:x,...n}}}),o}function mne(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function gne(e,t){return t[e]||(t[e]=[]),t[e]}function sWt(e){return Array.isArray(e)?e:[e]}function lWt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const cWt=e=>typeof e=="number",dWt=e=>e.every(cWt);function uWt(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=S2e(e)&&!bUt(e)?new JUt(t):new HUt(t);n.mount(e),z2.set(e,n)}function hWt(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new VUt(t);n.mount(e),z2.set(e,n)}function fWt(e,t){return ni(e)||typeof e=="number"||typeof e=="string"&&!jK(t)}function D2e(e,t,n,r){const i=[];if(fWt(e,t))i.push(QUt(e,jK(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;const a=P2e(e,t,r),o=a.length;for(let s=0;s<o;s++){const l=a[s],c=l instanceof Element?uWt:hWt;z2.has(l)||c(l);const u=z2.get(l),h={...n};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(s,o)),i.push(...oUt(u,{...t,transition:h},{}))}}return i}function pWt(e,t,n){const r=[],i=e.map(o=>{if(Array.isArray(o)&&typeof o[0]=="function"){const s=o[0],l=af(0);return l.on("change",s),o.length===1?[l,[0,1]]:o.length===2?[l,[0,1],o[1]]:[l,o[1],o[2]]}return o});return oWt(i,t,n,{spring:R2}).forEach(({keyframes:o,transition:s},l)=>{r.push(...D2e(l,o,s))}),r}function mWt(e){return Array.isArray(e)&&e.some(Array.isArray)}function gWt(e={}){const{scope:t,reduceMotion:n}=e;function r(i,a,o){let s=[],l;if(mWt(i)){const{onComplete:u,...h}=a||{};typeof u=="function"&&(l=u),s=pWt(i,n!==void 0?{reduceMotion:n,...h}:h,t)}else{const{onComplete:u,...h}=o||{};typeof u=="function"&&(l=u),s=D2e(i,a,n!==void 0?{reduceMotion:n,...h}:h,t)}const c=new RBt(s);return l&&c.finished.then(l),t&&(t.animations.push(c),c.finished.then(()=>{_K(t.animations,c)})),c}return r}const O2e=gWt();var yWt=ie("<div class=size-full>");function vWt(e){const t=bf(),n=ll(),r=di(),i=xj(),a=E0(),o=Z(()=>St(e.directory));return he(()=>{const s=i.data.path.directory;if(!s||s===e.directory)return;const l=t.pathname.slice(o().length+1);n(`/${St(s)}${l}${t.search}${t.hash}`,{replace:!0})}),he(()=>{const s=r.id;s&&i.session.sync(s)}),d(Qne,{get data(){return i.data},get directory(){return e.directory},get mediaUrl(){return a.url},onNavigateToSession:s=>n(`/${o()}/session/${s}`),onSessionHref:s=>`/${o()}/session/${s}`,get children(){return d(sqt,{get children(){return e.children}})}})}function kWt(e){const t=di(),n=_r(),r=ll();let i="";const a=Z(()=>t.dir?xo(t.dir)??"":"");return he(()=>{const o=t.dir;if(o){if(a()){i="";return}i!==o&&(i=o,lr({variant:"error",title:n.t("common.requestFailed"),description:n.t("directory.error.invalidUrl")}),r("/",{replace:!0}))}}),d(ke,{get when(){return a()},keyed:!0,children:o=>d(fPt,{directory:()=>o,get children(){return d(hqt,{get children(){return d(tVt,{get children(){return d(sVt,{get children(){return d(tDt,{get children(){return[d(oVt,{}),(()=>{var s=yWt();return Hr(l=>requestAnimationFrame(()=>O2e(l,{opacity:[0,1],y:[4,0]},{type:"spring",stiffness:400,damping:30})),s),K(s,d(vWt,{directory:o,get children(){return e.children}})),s})()]}})}})}})}})}})})}var bWt=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),wWt=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function xWt(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return bWt.has(n)}const t=e.split("-")[0];return wWt.has(t)}function _Wt(e){return xWt(e)?"rtl":"ltr"}function R2e(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:_Wt(e)}}var AU=R2e(),zp=new Set;function yne(){AU=R2e();for(const e of zp)e(AU)}function MWt(){const[e,t]=Ce(AU),n=Z(()=>e());return dn(()=>{zp.size===0&&window.addEventListener("languagechange",yne),zp.add(t),me(()=>{zp.delete(t),zp.size===0&&window.removeEventListener("languagechange",yne)})}),{locale:()=>n().locale,direction:()=>n().direction}}var SWt=Tt();function gs(){const e=MWt();return Lt(SWt)||e}var eV=new Map;function CWt(e){const{locale:t}=gs(),n=Z(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return Z(()=>{const r=n();let i;return eV.has(r)&&(i=eV.get(r)),i||(i=new Intl.Collator(t(),e),eV.set(r,i)),i})}const LWt=["top","right","bottom","left"],nl=Math.min,$i=Math.max,Jz=Math.round,Yg=Math.floor,Mo=e=>({x:e,y:e}),IWt={left:"right",right:"left",bottom:"top",top:"bottom"};function $U(e,t,n){return $i(e,nl(t,n))}function O0(e,t){return typeof e=="function"?e(t):e}function rl(e){return e.split("-")[0]}function qf(e){return e.split("-")[1]}function z2e(e){return e==="x"?"y":"x"}function HK(e){return e==="y"?"height":"width"}function Jo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function FK(e){return z2e(Jo(e))}function NWt(e,t,n){n===void 0&&(n=!1);const r=qf(e),i=FK(e),a=HK(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Qz(o)),[o,Qz(o)]}function AWt(e){const t=Qz(e);return[TU(e),t,TU(t)]}function TU(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const vne=["left","right"],kne=["right","left"],$Wt=["top","bottom"],TWt=["bottom","top"];function EWt(e,t,n){switch(e){case"top":case"bottom":return n?t?kne:vne:t?vne:kne;case"left":case"right":return t?$Wt:TWt;default:return[]}}function PWt(e,t,n,r){const i=qf(e);let a=EWt(rl(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(TU)))),a}function Qz(e){const t=rl(e);return IWt[t]+e.slice(t.length)}function DWt(e){return{top:0,right:0,bottom:0,left:0,...e}}function q2e(e){return typeof e!="number"?DWt(e):{top:e,right:e,bottom:e,left:e}}function eq(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function bne(e,t,n){let{reference:r,floating:i}=e;const a=Jo(t),o=FK(t),s=HK(o),l=rl(t),c=a==="y",u=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,m=r[s]/2-i[s]/2;let g;switch(l){case"top":g={x:u,y:r.y-i.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-i.width,y:h};break;default:g={x:r.x,y:r.y}}switch(qf(t)){case"start":g[o]-=m*(n&&c?-1:1);break;case"end":g[o]+=m*(n&&c?-1:1);break}return g}async function OWt(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=O0(t,e),y=q2e(g),k=s[m?h==="floating"?"reference":"floating":h],b=eq(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(k)))==null||n?k:k.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),x=h==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),M=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},_=eq(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:w,strategy:l}):x);return{top:(b.top-_.top+y.top)/M.y,bottom:(_.bottom-b.bottom+y.bottom)/M.y,left:(b.left-_.left+y.left)/M.x,right:(_.right-b.right+y.right)/M.x}}const RWt=50,zWt=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:OWt},l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:h}=bne(c,r,l),m=r,g=0;const y={};for(let v=0;v<a.length;v++){const k=a[v];if(!k)continue;const{name:b,fn:x}=k,{x:w,y:M,data:_,reset:C}=await x({x:u,y:h,initialPlacement:r,placement:m,strategy:i,middlewareData:y,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,h=M??h,y[b]={...y[b],..._},C&&g<RWt&&(g++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(c=C.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:u,y:h}=bne(c,m,l)),v=-1)}return{x:u,y:h,placement:m,strategy:i,middlewareData:y}},qWt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=O0(e,t)||{};if(c==null)return{};const h=q2e(u),m={x:n,y:r},g=FK(i),y=HK(g),v=await o.getDimensions(c),k=g==="y",b=k?"top":"left",x=k?"bottom":"right",w=k?"clientHeight":"clientWidth",M=a.reference[y]+a.reference[g]-m[g]-a.floating[y],_=m[g]-a.reference[g],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let L=C?C[w]:0;(!L||!await(o.isElement==null?void 0:o.isElement(C)))&&(L=s.floating[w]||a.floating[y]);const S=M/2-_/2,I=L/2-v[y]/2-1,A=nl(h[b],I),D=nl(h[x],I),P=A,O=L-v[y]-D,E=L/2-v[y]/2+S,T=$U(P,E,O),R=!l.arrow&&qf(i)!=null&&E!==T&&a.reference[y]/2-(E<P?A:D)-v[y]/2<0,H=R?E<P?E-P:E-O:0;return{[g]:m[g]+H,data:{[g]:T,centerOffset:E-T-H,...R&&{alignmentOffset:H}},reset:R}}}),jWt=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...k}=O0(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=rl(i),x=Jo(s),w=rl(s)===s,M=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=m||(w||!v?[Qz(s)]:AWt(s)),C=y!=="none";!m&&C&&_.push(...PWt(s,v,y,M));const L=[s,..._],S=await l.detectOverflow(t,k),I=[];let A=((r=a.flip)==null?void 0:r.overflows)||[];if(u&&I.push(S[b]),h){const E=NWt(i,o,M);I.push(S[E[0]],S[E[1]])}if(A=[...A,{placement:i,overflows:I}],!I.every(E=>E<=0)){var D,P;const E=(((D=a.flip)==null?void 0:D.index)||0)+1,T=L[E];if(T&&(!(h==="alignment"?x!==Jo(T):!1)||A.every(Y=>Jo(Y.placement)===x?Y.overflows[0]>0:!0)))return{data:{index:E,overflows:A},reset:{placement:T}};let R=(P=A.filter(H=>H.overflows[0]<=0).sort((H,Y)=>H.overflows[1]-Y.overflows[1])[0])==null?void 0:P.placement;if(!R)switch(g){case"bestFit":{var O;const H=(O=A.filter(Y=>{if(C){const j=Jo(Y.placement);return j===x||j==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(j=>j>0).reduce((j,X)=>j+X,0)]).sort((Y,j)=>Y[1]-j[1])[0])==null?void 0:O[0];H&&(R=H);break}case"initialPlacement":R=s;break}if(i!==R)return{reset:{placement:R}}}return{}}}};function wne(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xne(e){return LWt.some(t=>e[t]>=0)}const HWt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=O0(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),s=wne(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:xne(s)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),s=wne(o,n.floating);return{data:{escapedOffsets:s,escaped:xne(s)}}}default:return{}}}}},FWt=new Set(["left","top"]);async function VWt(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rl(n),s=qf(n),l=Jo(n)==="y",c=FWt.has(o)?-1:1,u=a&&l?-1:1,h=O0(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return s&&typeof y=="number"&&(g=s==="end"?y*-1:y),l?{x:g*u,y:m*c}:{x:m*c,y:g*u}}const BWt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await VWt(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},UWt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x,y:w}=b;return{x,y:w}}},...c}=O0(e,t),u={x:n,y:r},h=await a.detectOverflow(t,c),m=Jo(rl(i)),g=z2e(m);let y=u[g],v=u[m];if(o){const b=g==="y"?"top":"left",x=g==="y"?"bottom":"right",w=y+h[b],M=y-h[x];y=$U(w,y,M)}if(s){const b=m==="y"?"top":"left",x=m==="y"?"bottom":"right",w=v+h[b],M=v-h[x];v=$U(w,v,M)}const k=l.fn({...t,[g]:y,[m]:v});return{...k,data:{x:k.x-n,y:k.y-r,enabled:{[g]:o,[m]:s}}}}}},WWt=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:s}=t,{apply:l=()=>{},...c}=O0(e,t),u=await o.detectOverflow(t,c),h=rl(i),m=qf(i),g=Jo(i)==="y",{width:y,height:v}=a.floating;let k,b;h==="top"||h==="bottom"?(k=h,b=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=h,k=m==="end"?"top":"bottom");const x=v-u.top-u.bottom,w=y-u.left-u.right,M=nl(v-u[k],x),_=nl(y-u[b],w),C=!t.middlewareData.shift;let L=M,S=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=x),C&&!m){const A=$i(u.left,0),D=$i(u.right,0),P=$i(u.top,0),O=$i(u.bottom,0);g?S=y-2*(A!==0||D!==0?A+D:$i(u.left,u.right)):L=v-2*(P!==0||O!==0?P+O:$i(u.top,u.bottom))}await l({...t,availableWidth:S,availableHeight:L});const I=await o.getDimensions(s.floating);return y!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function Tj(){return typeof window<"u"}function jf(e){return j2e(e)?(e.nodeName||"").toLowerCase():"#document"}function qi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Eo(e){var t;return(t=(j2e(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function j2e(e){return Tj()?e instanceof Node||e instanceof qi(e).Node:!1}function Va(e){return Tj()?e instanceof Element||e instanceof qi(e).Element:!1}function ys(e){return Tj()?e instanceof HTMLElement||e instanceof qi(e).HTMLElement:!1}function _ne(e){return!Tj()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qi(e).ShadowRoot}function Im(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ba(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function GWt(e){return/^(table|td|th)$/.test(jf(e))}function Ej(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const ZWt=/transform|translate|scale|rotate|perspective|filter/,KWt=/paint|layout|strict|content/,Cl=e=>!!e&&e!=="none";let tV;function VK(e){const t=Va(e)?Ba(e):e;return Cl(t.transform)||Cl(t.translate)||Cl(t.scale)||Cl(t.rotate)||Cl(t.perspective)||!BK()&&(Cl(t.backdropFilter)||Cl(t.filter))||ZWt.test(t.willChange||"")||KWt.test(t.contain||"")}function XWt(e){let t=il(e);for(;ys(t)&&!of(t);){if(VK(t))return t;if(Ej(t))return null;t=il(t)}return null}function BK(){return tV==null&&(tV=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),tV}function of(e){return/^(html|body|#document)$/.test(jf(e))}function Ba(e){return qi(e).getComputedStyle(e)}function Pj(e){return Va(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function il(e){if(jf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_ne(e)&&e.host||Eo(e);return _ne(t)?t.host:t}function H2e(e){const t=il(e);return of(t)?e.ownerDocument?e.ownerDocument.body:e.body:ys(t)&&Im(t)?t:H2e(t)}function q2(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=H2e(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=qi(i);if(a){const s=EU(o);return t.concat(o,o.visualViewport||[],Im(i)?i:[],s&&n?q2(s):[])}else return t.concat(i,q2(i,[],n))}function EU(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function F2e(e){const t=Ba(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ys(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Jz(n)!==a||Jz(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function UK(e){return Va(e)?e:e.contextElement}function qh(e){const t=UK(e);if(!ys(t))return Mo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=F2e(t);let o=(a?Jz(n.width):n.width)/r,s=(a?Jz(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const YWt=Mo(0);function V2e(e){const t=qi(e);return!BK()||!t.visualViewport?YWt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function JWt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qi(e)?!1:t}function k0(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=UK(e);let o=Mo(1);t&&(r?Va(r)&&(o=qh(r)):o=qh(e));const s=JWt(a,n,r)?V2e(a):Mo(0);let l=(i.left+s.x)/o.x,c=(i.top+s.y)/o.y,u=i.width/o.x,h=i.height/o.y;if(a){const m=qi(a),g=r&&Va(r)?qi(r):r;let y=m,v=EU(y);for(;v&&r&&g!==y;){const k=qh(v),b=v.getBoundingClientRect(),x=Ba(v),w=b.left+(v.clientLeft+parseFloat(x.paddingLeft))*k.x,M=b.top+(v.clientTop+parseFloat(x.paddingTop))*k.y;l*=k.x,c*=k.y,u*=k.x,h*=k.y,l+=w,c+=M,y=qi(v),v=EU(y)}}return eq({width:u,height:h,x:l,y:c})}function Dj(e,t){const n=Pj(e).scrollLeft;return t?t.left+n:k0(Eo(e)).left+n}function B2e(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Dj(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function QWt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Eo(r),s=t?Ej(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Mo(1);const u=Mo(0),h=ys(r);if((h||!h&&!a)&&((jf(r)!=="body"||Im(o))&&(l=Pj(r)),h)){const g=k0(r);c=qh(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const m=o&&!h&&!a?B2e(o,l):Mo(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+m.x,y:n.y*c.y-l.scrollTop*c.y+u.y+m.y}}function eGt(e){return Array.from(e.getClientRects())}function tGt(e){const t=Eo(e),n=Pj(e),r=e.ownerDocument.body,i=$i(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=$i(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Dj(e);const s=-n.scrollTop;return Ba(r).direction==="rtl"&&(o+=$i(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}const Mne=25;function nGt(e,t){const n=qi(e),r=Eo(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=BK();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=Dj(r);if(c<=0){const u=r.ownerDocument,h=u.body,m=getComputedStyle(h),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,y=Math.abs(r.clientWidth-h.clientWidth-g);y<=Mne&&(a-=y)}else c<=Mne&&(a+=c);return{width:a,height:o,x:s,y:l}}function rGt(e,t){const n=k0(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ys(e)?qh(e):Mo(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,c=r*a.y;return{width:o,height:s,x:l,y:c}}function Sne(e,t,n){let r;if(t==="viewport")r=nGt(e,n);else if(t==="document")r=tGt(Eo(e));else if(Va(t))r=rGt(t,n);else{const i=V2e(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return eq(r)}function U2e(e,t){const n=il(e);return n===t||!Va(n)||of(n)?!1:Ba(n).position==="fixed"||U2e(n,t)}function iGt(e,t){const n=t.get(e);if(n)return n;let r=q2(e,[],!1).filter(s=>Va(s)&&jf(s)!=="body"),i=null;const a=Ba(e).position==="fixed";let o=a?il(e):e;for(;Va(o)&&!of(o);){const s=Ba(o),l=VK(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Im(o)&&!l&&U2e(e,o))?r=r.filter(u=>u!==o):i=s,o=il(o)}return t.set(e,r),r}function aGt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Ej(t)?[]:iGt(t,this._c):[].concat(n),r],s=Sne(t,o[0],i);let l=s.top,c=s.right,u=s.bottom,h=s.left;for(let m=1;m<o.length;m++){const g=Sne(t,o[m],i);l=$i(g.top,l),c=nl(g.right,c),u=nl(g.bottom,u),h=$i(g.left,h)}return{width:c-h,height:u-l,x:h,y:l}}function oGt(e){const{width:t,height:n}=F2e(e);return{width:t,height:n}}function sGt(e,t,n){const r=ys(t),i=Eo(t),a=n==="fixed",o=k0(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Mo(0);function c(){l.x=Dj(i)}if(r||!r&&!a)if((jf(t)!=="body"||Im(i))&&(s=Pj(t)),r){const g=k0(t,!0,a,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else i&&c();a&&!r&&i&&c();const u=i&&!r&&!a?B2e(i,s):Mo(0),h=o.left+s.scrollLeft-l.x-u.x,m=o.top+s.scrollTop-l.y-u.y;return{x:h,y:m,width:o.width,height:o.height}}function nV(e){return Ba(e).position==="static"}function Cne(e,t){if(!ys(e)||Ba(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Eo(e)===n&&(n=n.ownerDocument.body),n}function W2e(e,t){const n=qi(e);if(Ej(e))return n;if(!ys(e)){let i=il(e);for(;i&&!of(i);){if(Va(i)&&!nV(i))return i;i=il(i)}return n}let r=Cne(e,t);for(;r&&GWt(r)&&nV(r);)r=Cne(r,t);return r&&of(r)&&nV(r)&&!VK(r)?n:r||XWt(e)||n}const lGt=async function(e){const t=this.getOffsetParent||W2e,n=this.getDimensions,r=await n(e.floating);return{reference:sGt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function cGt(e){return Ba(e).direction==="rtl"}const G2e={convertOffsetParentRelativeRectToViewportRelativeRect:QWt,getDocumentElement:Eo,getClippingRect:aGt,getOffsetParent:W2e,getElementRects:lGt,getClientRects:eGt,getDimensions:oGt,getScale:qh,isElement:Va,isRTL:cGt};function Z2e(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function dGt(e,t){let n=null,r;const i=Eo(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:h,width:m,height:g}=c;if(s||t(),!m||!g)return;const y=Yg(h),v=Yg(i.clientWidth-(u+m)),k=Yg(i.clientHeight-(h+g)),b=Yg(u),w={rootMargin:-y+"px "+-v+"px "+-k+"px "+-b+"px",threshold:$i(0,nl(1,l))||1};let M=!0;function _(C){const L=C[0].intersectionRatio;if(L!==l){if(!M)return o();L?o(!1,L):r=setTimeout(()=>{o(!1,1e-7)},1e3)}L===1&&!Z2e(c,e.getBoundingClientRect())&&o(),M=!1}try{n=new IntersectionObserver(_,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,w)}n.observe(e)}return o(!0),a}function uGt(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=UK(e),u=i||a?[...c?q2(c):[],...t?q2(t):[]]:[];u.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const h=c&&s?dGt(c,n):null;let m=-1,g=null;o&&(g=new ResizeObserver(b=>{let[x]=b;x&&x.target===c&&g&&t&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),n()}),c&&!l&&g.observe(c),t&&g.observe(t));let y,v=l?k0(e):null;l&&k();function k(){const b=k0(e);v&&!Z2e(v,b)&&n(),v=b,y=requestAnimationFrame(k)}return n(),()=>{var b;u.forEach(x=>{i&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),h?.(),(b=g)==null||b.disconnect(),g=null,l&&cancelAnimationFrame(y)}}const hGt=BWt,fGt=UWt,pGt=jWt,mGt=WWt,gGt=HWt,yGt=qWt,vGt=(e,t,n)=>{const r=new Map,i={platform:G2e,...n},a={...i.platform,_c:r};return zWt(e,t,{...i,platform:a})};var kGt=ie('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'),WK=Tt();function GK(){const e=Lt(WK);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var PU=30,Lne=PU/2,bGt={top:180,right:-90,bottom:0,left:90};function vs(e){const t=GK(),n=ft({size:PU},e),[r,i]=Se(n,["ref","style","size"]),a=()=>t.currentPlacement().split("-")[0],o=wGt(t.contentRef),s=()=>o()?.getPropertyValue("background-color")||"none",l=()=>o()?.getPropertyValue(`border-${a()}-color`)||"none",c=()=>o()?.getPropertyValue(`border-${a()}-width`)||"0px",u=()=>Number.parseInt(c())*2*(PU/r.size),h=()=>`rotate(${bGt[a()]} ${Lne} ${Lne}) translate(0 2)`;return d(zt,f({as:"div",ref(m){var g=hn(t.setArrowRef,r.ref);typeof g=="function"&&g(m)},"aria-hidden":"true",get style(){return Wa({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:s(),stroke:l(),"stroke-width":u()},r.style)}},i,{get children(){var m=kGt(),g=m.firstChild,y=g.firstChild;return y.nextSibling,Qe(()=>gt(g,"transform",h())),m}}))}function wGt(e){const[t,n]=Ce();return he(()=>{const r=e();r&&n(qU(r).getComputedStyle(r))}),t}function xGt(e){const t=GK(),[n,r]=Se(e,["ref","style"]);return d(zt,f({as:"div",ref(i){var a=hn(t.setPositionerRef,n.ref);typeof a=="function"&&a(i)},"data-popper-positioner":"",get style(){return Wa({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function Ine(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const a={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...a,toJSON:()=>a}}function _Gt(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Ine(r):e?e.getBoundingClientRect():Ine()}}}function MGt(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var SGt={top:"bottom",right:"left",bottom:"top",left:"right"};function CGt(e,t){const[n,r]=e.split("-"),i=SGt[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function LGt(e){const t=ft({getAnchorRect:m=>m?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=Ce(),[i,a]=Ce(),[o,s]=Ce(t.placement),l=()=>_Gt(t.anchorRef?.(),t.getAnchorRect),{direction:c}=gs();async function u(){const m=l(),g=n(),y=i();if(!m||!g)return;const v=(y?.clientHeight||0)/2,k=typeof t.gutter=="number"?t.gutter+v:t.gutter??v;g.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),m.getBoundingClientRect();const b=[hGt(({placement:C})=>{const L=!!C.split("-")[1];return{mainAxis:k,crossAxis:L?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const C=typeof t.flip=="string"?t.flip.split(" "):void 0;if(C!==void 0&&!C.every(MGt))throw new Error("`flip` expects a spaced-delimited list of placements");b.push(pGt({padding:t.overflowPadding,fallbackPlacements:C}))}(t.slide||t.overlap)&&b.push(fGt({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),b.push(mGt({padding:t.overflowPadding,apply({availableWidth:C,availableHeight:L,rects:S}){const I=Math.round(S.reference.width);C=Math.floor(C),L=Math.floor(L),g.style.setProperty("--kb-popper-anchor-width",`${I}px`),g.style.setProperty("--kb-popper-content-available-width",`${C}px`),g.style.setProperty("--kb-popper-content-available-height",`${L}px`),t.sameWidth&&(g.style.width=`${I}px`),t.fitViewport&&(g.style.maxWidth=`${C}px`,g.style.maxHeight=`${L}px`)}})),t.hideWhenDetached&&b.push(gGt({padding:t.detachedPadding})),y&&b.push(yGt({element:y,padding:t.arrowPadding}));const x=await vGt(m,g,{placement:t.placement,strategy:"absolute",middleware:b,platform:{...G2e,isRTL:()=>c()==="rtl"}});if(s(x.placement),t.onCurrentPlacementChange?.(x.placement),!g)return;g.style.setProperty("--kb-popper-content-transform-origin",CGt(x.placement,c()));const w=Math.round(x.x),M=Math.round(x.y);let _;if(t.hideWhenDetached&&(_=x.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(g.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${M}px, 0)`,visibility:_}),y&&x.middlewareData.arrow){const{x:C,y:L}=x.middlewareData.arrow,S=x.placement.split("-")[0];Object.assign(y.style,{left:C!=null?`${C}px`:"",top:L!=null?`${L}px`:"",[S]:"100%"})}}he(()=>{const m=l(),g=n();if(!m||!g)return;const y=uGt(m,g,u,{elementResize:typeof ResizeObserver=="function"});me(y)}),he(()=>{const m=n(),g=t.contentRef?.();!m||!g||queueMicrotask(()=>{m.style.zIndex=getComputedStyle(g).zIndex})});const h={currentPlacement:o,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:a};return d(WK.Provider,{value:h,get children(){return t.children}})}var Hf=Object.assign(LGt,{Arrow:vs,Context:WK,usePopperContext:GK,Positioner:xGt}),IGt={};Ga(IGt,{Arrow:()=>vs,Content:()=>X2e,Portal:()=>Y2e,Root:()=>J2e,Tooltip:()=>qp,Trigger:()=>Q2e,useTooltipContext:()=>Oj});var K2e=Tt();function Oj(){const e=Lt(K2e);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function X2e(e){const t=Oj(),n=ft({id:t.generateId("content")},e),[r,i]=Se(n,["ref","style"]);return he(()=>me(t.registerContentId(i.id))),d(ke,{get when(){return t.contentPresent()},get children(){return d(Hf.Positioner,{get children(){return d(lq,f({ref(a){var o=hn(s=>{t.setContentRef(s)},r.ref);typeof o=="function"&&o(a)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return Wa({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:a=>a.preventDefault(),onDismiss:()=>t.hideTooltip(!0)},()=>t.dataset(),i))}})}})}function Y2e(e){const t=Oj();return d(ke,{get when(){return t.contentPresent()},get children(){return d(w0,e)}})}function NGt(e,t,n){const r=e.split("-")[0],i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=[],s=i.left+i.width/2,l=i.top+i.height/2;switch(r){case"top":o.push([i.left,l]),o.push([a.left,a.bottom]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([i.right,l]);break;case"right":o.push([s,i.top]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([a.left,a.bottom]),o.push([s,i.bottom]);break;case"bottom":o.push([i.left,l]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([a.right,a.top]),o.push([i.right,l]);break;case"left":o.push([s,i.top]),o.push([a.right,a.top]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([s,i.bottom]);break}return o}var Ll={},AGt=0,ih=!1,Ho,xp,ah;function J2e(e){const t=`tooltip-${xr()}`,n=`${++AGt}`,r=ft({id:t,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[i,a]=Se(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let o;const[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(),[g,y]=Ce(a.placement),v=x0({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:E=>i.onOpenChange?.(E)}),{present:k}=i0({show:()=>i.forceMount||v.isOpen(),element:()=>h()??null}),b=()=>{Ll[n]=w},x=()=>{for(const E in Ll)E!==n&&(Ll[E](!0),delete Ll[E])},w=(E=!1)=>{E||i.closeDelay&&i.closeDelay<=0?(window.clearTimeout(o),o=void 0,v.close()):o||(o=window.setTimeout(()=>{o=void 0,v.close()},i.closeDelay)),window.clearTimeout(Ho),Ho=void 0,i.skipDelayDuration&&i.skipDelayDuration>=0&&(ah=window.setTimeout(()=>{window.clearTimeout(ah),ah=void 0},i.skipDelayDuration)),ih&&(window.clearTimeout(xp),xp=window.setTimeout(()=>{delete Ll[n],xp=void 0,ih=!1},i.closeDelay))},M=()=>{clearTimeout(o),o=void 0,x(),b(),ih=!0,v.open(),window.clearTimeout(Ho),Ho=void 0,window.clearTimeout(xp),xp=void 0,window.clearTimeout(ah),ah=void 0},_=()=>{x(),b(),!v.isOpen()&&!Ho&&!ih?Ho=window.setTimeout(()=>{Ho=void 0,ih=!0,M()},i.openDelay):v.isOpen()||M()},C=(E=!1)=>{!E&&i.openDelay&&i.openDelay>0&&!o&&!ah?_():M()},L=()=>{window.clearTimeout(Ho),Ho=void 0,ih=!1},S=()=>{window.clearTimeout(o),o=void 0},I=E=>Yn(c(),E)||Yn(h(),E),A=E=>{const T=c(),R=h();if(!(!T||!R))return NGt(E,T,R)},D=E=>{const T=E.target;if(I(T)){S();return}if(!i.ignoreSafeArea){const R=A(g());if(R&&VU(cre(E),R)){S();return}}o||w()};he(()=>{if(!v.isOpen())return;const E=ri();E.addEventListener("pointermove",D,!0),me(()=>{E.removeEventListener("pointermove",D,!0)})}),he(()=>{const E=c();if(!E||!v.isOpen())return;const T=H=>{const Y=H.target;Yn(Y,E)&&w(!0)},R=qU();R.addEventListener("scroll",T,{capture:!0}),me(()=>{R.removeEventListener("scroll",T,{capture:!0})})}),me(()=>{clearTimeout(o),Ll[n]&&delete Ll[n]});const O={dataset:Z(()=>({"data-expanded":v.isOpen()?"":void 0,"data-closed":v.isOpen()?void 0:""})),isOpen:v.isOpen,isDisabled:()=>i.disabled??!1,triggerOnFocusOnly:()=>i.triggerOnFocusOnly??!1,contentId:s,contentPresent:k,openTooltip:C,hideTooltip:w,cancelOpening:L,generateId:Io(()=>r.id),registerContentId:zr(l),isTargetOnTooltip:I,setTriggerRef:u,setContentRef:m};return d(K2e.Provider,{value:O,get children(){return d(Hf,f({anchorRef:c,contentRef:h,onCurrentPlacementChange:y},a))}})}function Q2e(e){let t;const n=Oj(),[r,i]=Se(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let a=!1,o=!1,s=!1;const l=()=>{a=!1},c=()=>{!n.isOpen()&&(o||s)&&n.openTooltip(s)},u=b=>{n.isOpen()&&!o&&!s&&n.hideTooltip(b)},h=b=>{dt(b,r.onPointerEnter),!(b.pointerType==="touch"||n.triggerOnFocusOnly()||n.isDisabled()||b.defaultPrevented)&&(o=!0,c())},m=b=>{dt(b,r.onPointerLeave),b.pointerType!=="touch"&&(o=!1,s=!1,n.isOpen()?u():n.cancelOpening())},g=b=>{dt(b,r.onPointerDown),a=!0,ri(t).addEventListener("pointerup",l,{once:!0})},y=b=>{dt(b,r.onClick),o=!1,s=!1,u(!0)},v=b=>{dt(b,r.onFocus),!(n.isDisabled()||b.defaultPrevented||a)&&(s=!0,c())},k=b=>{dt(b,r.onBlur);const x=b.relatedTarget;n.isTargetOnTooltip(x)||(o=!1,s=!1,u(!0))};return me(()=>{ri(t).removeEventListener("pointerup",l)}),d(zt,f({as:"button",ref(b){var x=hn(w=>{n.setTriggerRef(w),t=w},r.ref);typeof x=="function"&&x(b)},get"aria-describedby"(){return bt(()=>!!n.isOpen())()?n.contentId():void 0},onPointerEnter:h,onPointerLeave:m,onPointerDown:g,onClick:y,onFocus:v,onBlur:k},()=>n.dataset(),i))}var qp=Object.assign(J2e,{Arrow:vs,Content:X2e,Portal:Y2e,Trigger:Q2e}),$Gt=ie("<div data-slot=tooltip-keybind><span></span><span data-slot=tooltip-keybind-key>");function eme(e){const[t,n]=Se(e,["title","keybind"]);return d(Ua,f(n,{get value(){return(()=>{var r=$Gt(),i=r.firstChild,a=i.nextSibling;return K(i,()=>t.title),K(a,()=>t.keybind),r})()}}))}function Ua(e){let t;const[n,r]=nt({open:!1,block:!1,expand:!1}),[i,a]=Se(e,["children","class","contentClass","contentStyle","inactive","forceOpen","ignoreSafeArea","value"]),o=()=>r("open",!1),s=()=>{const m=document.activeElement;return!t||!m?!1:t.contains(m)},l=(m=n.expand)=>{m||t?.matches(":hover")||s()||r("block",!1)},c=()=>{const m=!!t?.querySelector('[aria-expanded="true"], [data-expanded]');if(r("expand",m),m){r("block",!0),o();return}l(m)},u=()=>{r("block",!0),o()},h=()=>{s()||o(),l()};return he(()=>{if(!t)return;c();const m=new MutationObserver(c);m.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-expanded","data-expanded"]}),me(()=>m.disconnect())}),d(r0,{get children(){return[d(Zn,{get when(){return i.inactive},get children(){return i.children}}),d(Zn,{when:!0,get children(){return d(qp,f({gutter:4},a,{closeDelay:0,get ignoreSafeArea(){return i.ignoreSafeArea??!0},get open(){return i.forceOpen||n.open},onOpenChange:m=>{i.forceOpen||n.block&&m||r("open",m)},get children(){return[d(qp.Trigger,{ref(m){var g=t;typeof g=="function"?g(m):t=m},as:"div","data-component":"tooltip-trigger",get class(){return i.class},onPointerDownCapture:u,onKeyDownCapture:m=>{m.key!=="Enter"&&m.key!==" "||u()},onPointerLeave:h,onFocusOut:()=>requestAnimationFrame(()=>l()),get children(){return i.children}}),d(qp.Portal,{get children(){return d(qp.Content,{"data-component":"tooltip",get"data-placement"(){return e.placement},get"data-force-open"(){return i.forceOpen},get class(){return i.contentClass},get style(){return i.contentStyle},get children(){return i.value}})}})]}}))}})]}})}function tme(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],i=l=>{if(l==null)return"";const c=e.getKey??"key",u=lh(c)?l[c]:c(l);return u!=null?String(u):""},a=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=lh(c)?l[c]:c(l);return u!=null?String(u):""},o=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(lh(c)?l[c]:c(l))??!1},s=l=>{if(l!=null)return lh(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(lh(l)||Aye(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:o(l),level:n,index:t}),t++;continue}if(s(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=s(l)??[];if(c.length>0){const u=tme({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:i(l),textValue:a(l),disabled:o(l),level:n,index:t}),t++}return r}function TGt(e,t=[]){return Z(()=>{const n=tme({dataSource:be(e.dataSource),getKey:be(e.getKey),getTextValue:be(e.getTextValue),getDisabled:be(e.getDisabled),getSectionChildren:be(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var Uo=class nme extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof nme?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function EGt(e){const[t,n]=G2(e);return[()=>t()??new Uo,n]}function rme(e){return Dye()?e.altKey:e.ctrlKey}function mh(e){return sq()?e.metaKey:e.ctrlKey}function Nne(e){return new Uo(e)}function PGt(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function DGt(e){const t=ft({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=Ce(!1),[i,a]=Ce(),o=Z(()=>{const v=be(t.selectedKeys);return v!=null?Nne(v):v}),s=Z(()=>{const v=be(t.defaultSelectedKeys);return v!=null?Nne(v):new Uo}),[l,c]=EGt({value:o,defaultValue:s,onChange:v=>t.onSelectionChange?.(v)}),[u,h]=Ce(be(t.selectionBehavior)),m=()=>be(t.selectionMode),g=()=>be(t.disallowEmptySelection)??!1,y=v=>{(be(t.allowDuplicateSelectionEvents)||!PGt(v,l()))&&c(v)};return he(()=>{const v=l();be(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof v=="object"&&v.size===0&&h("replace")}),he(()=>{h(be(t.selectionBehavior)??"toggle")}),{selectionMode:m,disallowEmptySelection:g,selectionBehavior:u,setSelectionBehavior:h,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:a,selectedKeys:l,setSelectedKeys:y}}function OGt(e){const[t,n]=Ce(""),[r,i]=Ce(-1);return{typeSelectHandlers:{onKeyDown:o=>{if(be(e.isDisabled))return;const s=be(e.keyboardDelegate),l=be(e.selectionManager);if(!s.getKeyForSearch)return;const c=RGt(o.key);if(!c||o.ctrlKey||o.metaKey)return;c===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let u=n(m=>m+c),h=s.getKeyForSearch(u,l.focusedKey())??s.getKeyForSearch(u);h==null&&zGt(u)&&(u=u[0],h=s.getKeyForSearch(u,l.focusedKey())??s.getKeyForSearch(u)),h!=null&&(l.setFocusedKey(h),e.onTypeSelect?.(h)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function RGt(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function zGt(e){return e.split("").every(t=>t===e[0])}function qGt(e,t,n){const i=f({selectOnFocus:()=>be(e.selectionManager).selectionBehavior()==="replace"},e),a=()=>n?.()??t(),{direction:o}=gs();let s={top:0,left:0};Mye(()=>be(i.isVirtualized)?void 0:a(),"scroll",()=>{const k=a();k&&(s={top:k.scrollTop,left:k.scrollLeft})});const{typeSelectHandlers:l}=OGt({isDisabled:()=>be(i.disallowTypeAhead),keyboardDelegate:()=>be(i.keyboardDelegate),selectionManager:()=>be(i.selectionManager)}),c=()=>be(i.orientation)??"vertical",u=k=>{dt(k,l.onKeyDown),k.altKey&&k.key==="Tab"&&k.preventDefault();const b=t();if(!b?.contains(k.target))return;const x=be(i.selectionManager),w=be(i.selectOnFocus),M=S=>{S!=null&&(x.setFocusedKey(S),k.shiftKey&&x.selectionMode()==="multiple"?x.extendSelection(S):w&&!rme(k)&&x.replaceSelection(S))},_=be(i.keyboardDelegate),C=be(i.shouldFocusWrap),L=x.focusedKey();switch(k.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(_.getKeyBelow){k.preventDefault();let S;L!=null?S=_.getKeyBelow(L):S=_.getFirstKey?.(),S==null&&C&&(S=_.getFirstKey?.(L)),M(S)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(_.getKeyAbove){k.preventDefault();let S;L!=null?S=_.getKeyAbove(L):S=_.getLastKey?.(),S==null&&C&&(S=_.getLastKey?.(L)),M(S)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(_.getKeyLeftOf){k.preventDefault();const S=o()==="rtl";let I;L!=null?I=_.getKeyLeftOf(L):I=S?_.getFirstKey?.():_.getLastKey?.(),M(I)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(_.getKeyRightOf){k.preventDefault();const S=o()==="rtl";let I;L!=null?I=_.getKeyRightOf(L):I=S?_.getLastKey?.():_.getFirstKey?.(),M(I)}break}case"Home":if(_.getFirstKey){k.preventDefault();const S=_.getFirstKey(L,mh(k));S!=null&&(x.setFocusedKey(S),mh(k)&&k.shiftKey&&x.selectionMode()==="multiple"?x.extendSelection(S):w&&x.replaceSelection(S))}break;case"End":if(_.getLastKey){k.preventDefault();const S=_.getLastKey(L,mh(k));S!=null&&(x.setFocusedKey(S),mh(k)&&k.shiftKey&&x.selectionMode()==="multiple"?x.extendSelection(S):w&&x.replaceSelection(S))}break;case"PageDown":if(_.getKeyPageBelow&&L!=null){k.preventDefault();const S=_.getKeyPageBelow(L);M(S)}break;case"PageUp":if(_.getKeyPageAbove&&L!=null){k.preventDefault();const S=_.getKeyPageAbove(L);M(S)}break;case"a":mh(k)&&x.selectionMode()==="multiple"&&be(i.disallowSelectAll)!==!0&&(k.preventDefault(),x.selectAll());break;case"Escape":k.defaultPrevented||(k.preventDefault(),be(i.disallowEmptySelection)||x.clearSelection());break;case"Tab":if(!be(i.allowsTabNavigation)){if(k.shiftKey)b.focus();else{const S=Wye(b,{tabbable:!0});let I,A;do A=S.lastChild(),A&&(I=A);while(A);I&&!I.contains(document.activeElement)&&ur(I)}break}}},h=k=>{const b=be(i.selectionManager),x=be(i.keyboardDelegate),w=be(i.selectOnFocus);if(b.isFocused()){k.currentTarget.contains(k.target)||b.setFocused(!1);return}if(k.currentTarget.contains(k.target)){if(b.setFocused(!0),b.focusedKey()==null){const M=C=>{C!=null&&(b.setFocusedKey(C),w&&b.replaceSelection(C))},_=k.relatedTarget;_&&k.currentTarget.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_FOLLOWING?M(b.lastSelectedKey()??x.getLastKey?.()):M(b.firstSelectedKey()??x.getFirstKey?.())}else if(!be(i.isVirtualized)){const M=a();if(M){M.scrollTop=s.top,M.scrollLeft=s.left;const _=M.querySelector(`[data-key="${b.focusedKey()}"]`);_&&(ur(_),fV(M,_))}}}},m=k=>{const b=be(i.selectionManager);k.currentTarget.contains(k.relatedTarget)||b.setFocused(!1)},g=k=>{a()===k.target&&k.preventDefault()},y=()=>{const k=be(i.autoFocus);if(!k)return;const b=be(i.selectionManager),x=be(i.keyboardDelegate);let w;k==="first"&&(w=x.getFirstKey?.()),k==="last"&&(w=x.getLastKey?.());const M=b.selectedKeys();M.size&&(w=M.values().next().value),b.setFocused(!0),b.setFocusedKey(w);const _=t();_&&w==null&&!be(i.shouldUseVirtualFocus)&&ur(_)};return dn(()=>{i.deferAutoFocus?setTimeout(y,0):y()}),he(vn([a,()=>be(i.isVirtualized),()=>be(i.selectionManager).focusedKey()],k=>{const[b,x,w]=k;if(x)w&&i.scrollToKey?.(w);else if(w&&b){const M=b.querySelector(`[data-key="${w}"]`);M&&fV(b,M)}})),{tabIndex:Z(()=>{if(!be(i.shouldUseVirtualFocus))return be(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:g,onFocusIn:h,onFocusOut:m}}function ime(e,t){const n=()=>be(e.selectionManager),r=()=>be(e.key),i=()=>be(e.shouldUseVirtualFocus),a=x=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):x?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||mh(x)||"pointerType"in x&&x.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),s=()=>be(e.disabled)||n().isDisabled(r()),l=()=>!s()&&n().canSelectItem(r());let c=null;const u=x=>{l()&&(c=x.pointerType,x.pointerType==="mouse"&&x.button===0&&!be(e.shouldSelectOnPressUp)&&a(x))},h=x=>{l()&&x.pointerType==="mouse"&&x.button===0&&be(e.shouldSelectOnPressUp)&&be(e.allowsDifferentPressOrigin)&&a(x)},m=x=>{l()&&(be(e.shouldSelectOnPressUp)&&!be(e.allowsDifferentPressOrigin)||c!=="mouse")&&a(x)},g=x=>{!l()||!["Enter"," "].includes(x.key)||(rme(x)?n().toggleSelection(r()):a(x))},y=x=>{s()&&x.preventDefault()},v=x=>{const w=t();i()||s()||!w||x.target===w&&n().setFocusedKey(r())},k=Z(()=>{if(!(i()||s()))return r()===n().focusedKey()?0:-1}),b=Z(()=>be(e.virtualized)?void 0:r());return he(vn([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([x,w,M,_,C])=>{x&&w===_&&C&&!M&&document.activeElement!==x&&(e.focus?e.focus():ur(x))})),{isSelected:o,isDisabled:s,allowsSelection:l,tabIndex:k,dataKey:b,onPointerDown:u,onPointerUp:h,onClick:m,onKeyDown:g,onMouseDown:y,onFocus:v}}var jGt=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index<e.index;(!e||r)&&(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index>e.index;(!e||r)&&(e=n)}return e?.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new Uo(n,r,t);for(const a of this.getKeyRange(r,n.currentKey||t))i.delete(a);for(const a of this.getKeyRange(t,r))this.canSelectItem(a)&&i.add(a);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new Uo(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new Uo([t],t,t):new Uo;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Uo;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Uo)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},Ane=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function HGt(e){const t=DGt(e),r=TGt({dataSource:()=>be(e.dataSource),getKey:()=>be(e.getKey),getTextValue:()=>be(e.getTextValue),getDisabled:()=>be(e.getDisabled),getSectionChildren:()=>be(e.getSectionChildren),factory:a=>e.filter?new Ane(e.filter(a)):new Ane(a)},[()=>e.filter]),i=new jGt(r,t);return r2(()=>{const a=t.focusedKey();a!=null&&!r().getItem(a)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var FGt=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const i=this.collection().getItem(r);if(i){const a=i.textValue.slice(0,e.length);if(i.textValue&&n.compare(a,e)===0)return r}r=this.getKeyBelow(r)}}};function VGt(e,t,n){const r=CWt({usage:"search",sensitivity:"base"}),i=Z(()=>{const a=be(e.keyboardDelegate);return a||new FGt(e.collection,t,r)});return qGt({selectionManager:()=>be(e.selectionManager),keyboardDelegate:i,autoFocus:()=>be(e.autoFocus),deferAutoFocus:()=>be(e.deferAutoFocus),shouldFocusWrap:()=>be(e.shouldFocusWrap),disallowEmptySelection:()=>be(e.disallowEmptySelection),selectOnFocus:()=>be(e.selectOnFocus),disallowTypeAhead:()=>be(e.disallowTypeAhead),shouldUseVirtualFocus:()=>be(e.shouldUseVirtualFocus),allowsTabNavigation:()=>be(e.allowsTabNavigation),isVirtualized:()=>be(e.isVirtualized),scrollToKey:a=>be(e.scrollToKey)?.(a),orientation:()=>be(e.orientation)},t,n)}var ame=Tt();function ome(){return Lt(ame)}function BGt(){const e=ome();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function sme(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function UGt(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const i=e[r]?.ref();if(i&&sme(i,n))return r+1}return 0}function WGt(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[a,o])=>{const s=i.ref(),l=o.ref();return s===l||!s||!l?0:sme(s,l)?(r>a&&(n=!0),-1):(r<a&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function lme(e,t){const n=WGt(e);e!==n&&t(n)}function GGt(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return ri(r).body}function ZGt(e,t){he(()=>{const n=setTimeout(()=>{lme(e(),t)});me(()=>clearTimeout(n))})}function KGt(e,t){if(typeof IntersectionObserver!="function"){ZGt(e,t);return}let n=[];he(()=>{const r=()=>{const o=!!n.length;n=e(),o&&lme(e(),t)},i=GGt(e()),a=new IntersectionObserver(r,{root:i});for(const o of e()){const s=o.ref();s&&a.observe(s)}me(()=>a.disconnect())})}function XGt(e={}){const[t,n]=dve({value:()=>be(e.items),onChange:a=>e.onItemsChange?.(a)});KGt(t,n);const r=a=>(n(o=>{const s=UGt(o,a);return Nye(o,a,s)}),()=>{n(o=>{const s=o.filter(l=>l.ref()!==a.ref());return o.length===s.length?o:s})});return{DomCollectionProvider:a=>d(ame.Provider,{value:{registerItem:r},get children(){return a.children}})}}function YGt(e){const t=BGt(),n=ft({shouldRegisterItem:!0},e);he(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());me(r)})}function JGt(e={}){const[t,n]=gre({value:()=>be(e.isSelected),defaultValue:()=>!!be(e.defaultIsSelected),onChange:a=>e.onSelectedChange?.(a)});return{isSelected:t,setIsSelected:a=>{!be(e.isReadOnly)&&!be(e.isDisabled)&&n(a)},toggle:()=>{!be(e.isReadOnly)&&!be(e.isDisabled)&&n(!t())}}}var QGt=Tt();function Rj(){return Lt(QGt)}var eZt=Tt();function cme(){return Lt(eZt)}var dme=Tt();function ume(){return Lt(dme)}function Po(){const e=ume();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var hme=Tt();function ZK(){const e=Lt(hme);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var fme=Tt();function fa(){const e=Lt(fme);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function KK(e){let t;const n=fa(),r=Po(),i=ft({id:n.generateId(`item-${xr()}`)},e),[a,o]=Se(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(),g=()=>r.listState().selectionManager(),y=()=>o.id,v=()=>g().focusedKey()===y(),k=()=>{a.onSelect?.(),a.closeOnSelect&&setTimeout(()=>{r.close(!0)})};YGt({getItem:()=>({ref:()=>t,type:"item",key:y(),textValue:a.textValue??h()?.textContent??t?.textContent??"",disabled:a.disabled??!1})});const b=ime({key:y,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>a.disabled},()=>t),x=I=>{dt(I,a.onPointerMove),I.pointerType==="mouse"&&(a.disabled?r.onItemLeave(I):(r.onItemEnter(I),I.defaultPrevented||(ur(I.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(y()))))},w=I=>{dt(I,a.onPointerLeave),I.pointerType==="mouse"&&r.onItemLeave(I)},M=I=>{dt(I,a.onPointerUp),!a.disabled&&I.button===0&&k()},_=I=>{if(dt(I,a.onKeyDown),!I.repeat&&!a.disabled)switch(I.key){case"Enter":case" ":k();break}},C=Z(()=>{if(a.indeterminate)return"mixed";if(a.checked!=null)return a.checked}),L=Z(()=>({"data-indeterminate":a.indeterminate?"":void 0,"data-checked":a.checked&&!a.indeterminate?"":void 0,"data-disabled":a.disabled?"":void 0,"data-highlighted":v()?"":void 0})),S={isChecked:()=>a.checked,dataset:L,setLabelRef:m,generateId:Io(()=>o.id),registerLabel:zr(l),registerDescription:zr(u)};return d(hme.Provider,{value:S,get children(){return d(zt,f({as:"div",ref(I){var A=hn(D=>t=D,a.ref);typeof A=="function"&&A(I)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return C()},get"aria-disabled"(){return a.disabled},get"aria-labelledby"(){return s()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return Kn([a.onPointerDown,b.onPointerDown])},get onPointerUp(){return Kn([M,b.onPointerUp])},get onClick(){return Kn([a.onClick,b.onClick])},get onKeyDown(){return Kn([_,b.onKeyDown])},get onMouseDown(){return Kn([a.onMouseDown,b.onMouseDown])},get onFocus(){return Kn([a.onFocus,b.onFocus])},onPointerMove:x,onPointerLeave:w},L,o))}})}function zj(e){const t=ft({closeOnSelect:!1},e),[n,r]=Se(t,["checked","defaultChecked","onChange","onSelect"]),i=JGt({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:o=>n.onChange?.(o),isDisabled:()=>r.disabled});return d(KK,f({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{n.onSelect?.(),i.toggle()}},r))}var j2={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>j2.next(e==="ltr"?"rtl":"ltr",t)},$ne={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function pme(e){const t=fa(),n=Po(),r=Rj(),{direction:i}=gs(),a=ft({id:t.generateId("trigger")},e),[o,s]=Se(a,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>t.value()??o.id,r.lastValue()===void 0&&r.setLastValue(l));const c=Z2(()=>n.triggerRef(),()=>"button"),u=Z(()=>c()==="a"&&n.triggerRef()?.getAttribute("href")!=null);he(vn(()=>r?.value(),b=>{u()&&b===l()&&n.triggerRef()?.focus()}));const h=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},m=b=>{dt(b,o.onPointerDown),b.currentTarget.dataset.pointerType=b.pointerType,!o.disabled&&b.pointerType!=="touch"&&b.button===0&&h()},g=b=>{dt(b,o.onClick),o.disabled||b.currentTarget.dataset.pointerType==="touch"&&h()},y=b=>{if(dt(b,o.onKeyDown),!o.disabled){if(u())switch(b.key){case"Enter":case" ":return}switch(b.key){case"Enter":case" ":case $ne.first(t.orientation()):b.stopPropagation(),b.preventDefault(),Kye(b.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(l);break;case $ne.last(t.orientation()):b.stopPropagation(),b.preventDefault(),n.open("last");break;case j2.next(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.nextMenu();break;case j2.previous(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.previousMenu();break}}},v=b=>{dt(b,o.onMouseOver),n.triggerRef()?.dataset.pointerType!=="touch"&&!o.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},k=b=>{dt(b,o.onFocus),r!==void 0&&b.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return he(()=>me(n.registerTriggerId(o.id))),d(_0,f({ref(b){var x=hn(n.setTriggerRef,o.ref);typeof x=="function"&&x(b)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return bt(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&r?.value()===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:m,onMouseOver:v,onClick:g,onKeyDown:y,onFocus:k,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function mme(e){let t;const n=fa(),r=Po(),i=Rj(),a=cme(),{direction:o}=gs(),s=ft({id:n.generateId(`content-${xr()}`)},e),[l,c]=Se(s,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const h=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),m=VGt({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);fre({trapFocus:()=>h()&&r.isOpen(),onMountAutoFocus:w=>{i===void 0&&l.onOpenAutoFocus?.(w)},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const g=w=>{if(Yn(w.currentTarget,w.target)&&(w.key==="Tab"&&r.isOpen()&&w.preventDefault(),i!==void 0&&w.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(w.key){case j2.next(o(),n.orientation()):w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case j2.previous(o(),n.orientation()):if(w.currentTarget.hasAttribute("data-closed"))break;w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},y=w=>{l.onEscapeKeyDown?.(w),i?.setAutoFocusMenu(!1),r.close(!0)},v=w=>{l.onFocusOutside?.(w),n.isModal()&&w.preventDefault()},k=w=>{dt(w,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},b=w=>{if(dt(w,l.onPointerMove),w.pointerType!=="mouse")return;const M=w.target,_=u!==w.clientX;Yn(w.currentTarget,M)&&_&&(r.setPointerDir(w.clientX>u?"right":"left"),u=w.clientX)};he(()=>me(r.registerContentId(l.id))),me(()=>r.setContentRef(void 0));const x={ref:hn(w=>{r.setContentRef(w),t=w},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return m.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:Kn([l.onKeyDown,m.onKeyDown,g]),onMouseDown:Kn([l.onMouseDown,m.onMouseDown]),onFocusIn:Kn([l.onFocusIn,m.onFocusIn]),onFocusOut:Kn([l.onFocusOut,m.onFocusOut]),onPointerEnter:k,onPointerMove:b,get"data-orientation"(){return n.orientation()}};return d(ke,{get when(){return r.contentPresent()},get children(){return d(ke,{get when(){return a===void 0||r.parentMenuContext()!=null},get fallback(){return d(zt,f({as:"div"},()=>r.dataset(),x,c))},get children(){return d(Hf.Positioner,{get children(){return d(lq,f({get disableOutsidePointerEvents(){return bt(()=>!!h())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Wa({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:y,onFocusOutside:v,get onDismiss(){return r.close}},()=>r.dataset(),x,c))}})}})}})}function gme(e){let t;const n=fa(),r=Po(),[i,a]=Se(e,["ref"]);return yre({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),d(mme,f({ref(o){var s=hn(l=>{t=l},i.ref);typeof s=="function"&&s(o)}},a))}var yme=Tt();function tZt(){const e=Lt(yme);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function Nm(e){const t=fa(),n=ft({id:t.generateId(`group-${xr()}`)},e),[r,i]=Ce(),a={generateId:Io(()=>n.id),registerLabelId:zr(i)};return d(yme.Provider,{value:a,get children(){return d(zt,f({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function qj(e){const t=tZt(),n=ft({id:t.generateId("label")},e),[r,i]=Se(n,["id"]);return he(()=>me(t.registerLabelId(r.id))),d(zt,f({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function jj(e){const t=Po(),n=ft({children:"▼"},e);return d(zt,f({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function Hj(e){return d(KK,f({role:"menuitem",closeOnSelect:!0},e))}function Fj(e){const t=ZK(),n=ft({id:t.generateId("description")},e),[r,i]=Se(n,["id"]);return he(()=>me(t.registerDescription(r.id))),d(zt,f({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function Vj(e){const t=ZK(),n=ft({id:t.generateId("indicator")},e),[r,i]=Se(n,["forceMount"]);return d(ke,{get when(){return r.forceMount||t.isChecked()},get children(){return d(zt,f({as:"div"},()=>t.dataset(),i))}})}function Bj(e){const t=ZK(),n=ft({id:t.generateId("label")},e),[r,i]=Se(n,["ref","id"]);return he(()=>me(t.registerLabel(r.id))),d(zt,f({as:"div",ref(a){var o=hn(t.setLabelRef,r.ref);typeof o=="function"&&o(a)},get id(){return r.id}},()=>t.dataset(),i))}function Uj(e){const t=Po();return d(ke,{get when(){return t.contentPresent()},get children(){return d(w0,e)}})}var vme=Tt();function nZt(){const e=Lt(vme);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function Wj(e){const n=fa().generateId(`radiogroup-${xr()}`),r=ft({id:n},e),[i,a]=Se(r,["value","defaultValue","onChange","disabled"]),[o,s]=G2({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:c=>i.onChange?.(c)}),l={isDisabled:()=>i.disabled,isSelectedValue:c=>c===o(),setSelectedValue:c=>s(c)};return d(vme.Provider,{value:l,get children(){return d(Nm,a)}})}function Gj(e){const t=nZt(),n=ft({closeOnSelect:!1},e),[r,i]=Se(n,["value","onSelect"]);return d(KK,f({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},i))}function rZt(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),a=[],o=t.clientX,s=t.clientY;switch(r){case"top":a.push([o,s+5]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]);break;case"right":a.push([o-5,s]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]);break;case"bottom":a.push([o,s-5]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]);break;case"left":a.push([o+5,s]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top]);break}return a}function iZt(e,t){return t?VU([e.clientX,e.clientY],t):!1}function kme(e){const t=fa(),n=ome(),r=ume(),i=Rj(),a=cme(),o=ft({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[s,l]=Se(o,["open","defaultOpen","onOpenChange"]);let c=0,u=null,h="right";const[m,g]=Ce(),[y,v]=Ce(),[k,b]=Ce(),[x,w]=Ce(),[M,_]=Ce(!0),[C,L]=Ce(l.placement),[S,I]=Ce([]),[A,D]=Ce([]),{DomCollectionProvider:P}=XGt({items:A,onItemsChange:D}),O=x0({open:()=>s.open,defaultOpen:()=>s.defaultOpen,onOpenChange:le=>s.onOpenChange?.(le)}),{present:E}=i0({show:()=>t.forceMount()||O.isOpen(),element:()=>x()??null}),T=HGt({selectionMode:"none",dataSource:A}),R=le=>{_(le),O.open()},H=(le=!1)=>{O.close(),le&&r&&r.close(!0)},Y=le=>{_(le),O.toggle()},j=()=>{const le=x();le&&(ur(le),T.selectionManager().setFocused(!0),T.selectionManager().setFocusedKey(void 0))},X=()=>{a!=null?setTimeout(()=>j()):j()},W=le=>{I(Ee=>[...Ee,le]);const pe=r?.registerNestedMenu(le);return()=>{I(Ee=>hV(Ee,le)),pe?.()}},G=le=>h===u?.side&&iZt(le,u?.area),J=le=>{G(le)&&le.preventDefault()},oe=le=>{G(le)||X()},de=le=>{G(le)&&le.preventDefault()};pre({isDisabled:()=>!(r==null&&O.isOpen()&&t.isModal()),targets:()=>[x(),...S()].filter(Boolean)}),he(()=>{const le=x();if(!le||!r)return;const pe=r.registerNestedMenu(le);me(()=>{pe()})}),he(()=>{r===void 0&&i?.registerMenu(t.value(),[x(),...S()])}),he(()=>{r!==void 0||i===void 0||(i.value()===t.value()?(k()?.focus(),i.autoFocusMenu()&&R(!0)):H())}),he(()=>{r!==void 0||i===void 0||O.isOpen()&&i.setValue(t.value())}),me(()=>{r===void 0&&i?.unregisterMenu(t.value())});const ve={dataset:Z(()=>({"data-expanded":O.isOpen()?"":void 0,"data-closed":O.isOpen()?void 0:""})),isOpen:O.isOpen,contentPresent:E,nestedMenus:S,currentPlacement:C,pointerGraceTimeoutId:()=>c,autoFocus:M,listState:()=>T,parentMenuContext:()=>r,triggerRef:k,contentRef:x,triggerId:m,contentId:y,setTriggerRef:b,setContentRef:w,open:R,close:H,toggle:Y,focusContent:X,onItemEnter:J,onItemLeave:oe,onTriggerLeave:de,setPointerDir:le=>h=le,setPointerGraceTimeoutId:le=>c=le,setPointerGraceIntent:le=>u=le,registerNestedMenu:W,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:zr(g),registerContentId:zr(v)};return d(P,{get children(){return d(dme.Provider,{value:ve,get children(){return d(ke,{when:a===void 0,get fallback(){return l.children},get children(){return d(Hf,f({anchorRef:k,contentRef:x,onCurrentPlacementChange:L},l))}})}})}})}function Zj(e){const{direction:t}=gs();return d(kme,f({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var aZt={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function Kj(e){const t=Po(),n=fa(),[r,i]=Se(e,["onFocusOutside","onKeyDown"]),{direction:a}=gs();return d(mme,f({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{r.onFocusOutside?.(u);const h=u.target;Yn(t.triggerRef(),h)||t.close()},onKeyDown:u=>{dt(u,r.onKeyDown);const h=Yn(u.currentTarget,u.target),m=aZt.close(a(),n.orientation()).includes(u.key),g=t.parentMenuContext()!=null;h&&m&&g&&(t.close(),ur(t.triggerRef()))}},i))}var Tne=["Enter"," "],oZt={open:(e,t)=>e==="ltr"?[...Tne,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Tne,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Xj(e){let t;const n=fa(),r=Po(),i=ft({id:n.generateId(`sub-trigger-${xr()}`)},e),[a,o]=Se(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let s=null;const l=()=>{s&&window.clearTimeout(s),s=null},{direction:c}=gs(),u=()=>a.id,h=()=>{const w=r.parentMenuContext();if(w==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return w.listState().selectionManager()},m=()=>r.listState().collection(),g=()=>h().focusedKey()===u(),y=ime({key:u,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>a.disabled},()=>t),v=w=>{dt(w,a.onClick),!r.isOpen()&&!a.disabled&&r.open(!0)},k=w=>{if(dt(w,a.onPointerMove),w.pointerType!=="mouse")return;const M=r.parentMenuContext();if(M?.onItemEnter(w),!w.defaultPrevented){if(a.disabled){M?.onItemLeave(w);return}!r.isOpen()&&!s&&(r.parentMenuContext()?.setPointerGraceIntent(null),s=window.setTimeout(()=>{r.open(!1),l()},100)),M?.onItemEnter(w),w.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),ur(w.currentTarget),M?.listState().selectionManager().setFocused(!0),M?.listState().selectionManager().setFocusedKey(u()))}},b=w=>{if(dt(w,a.onPointerLeave),w.pointerType!=="mouse")return;l();const M=r.parentMenuContext(),_=r.contentRef();if(_){M?.setPointerGraceIntent({area:rZt(r.currentPlacement(),w,_),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(M?.pointerGraceTimeoutId());const C=window.setTimeout(()=>{M?.setPointerGraceIntent(null)},300);M?.setPointerGraceTimeoutId(C)}else{if(M?.onTriggerLeave(w),w.defaultPrevented)return;M?.setPointerGraceIntent(null)}M?.onItemLeave(w)},x=w=>{dt(w,a.onKeyDown),!w.repeat&&(a.disabled||oZt.open(c(),n.orientation()).includes(w.key)&&(w.stopPropagation(),w.preventDefault(),h().setFocused(!1),h().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(m().getFirstKey())))};return he(()=>{if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const w=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:a.textValue??t?.textContent??"",disabled:a.disabled??!1});me(w)}),he(vn(()=>r.parentMenuContext()?.pointerGraceTimeoutId(),w=>{me(()=>{window.clearTimeout(w),r.parentMenuContext()?.setPointerGraceIntent(null)})})),he(()=>me(r.registerTriggerId(a.id))),me(()=>{l()}),d(zt,f({as:"div",ref(w){var M=hn(_=>{r.setTriggerRef(_),t=_},a.ref);typeof M=="function"&&M(w)},get id(){return a.id},role:"menuitem",get tabIndex(){return y.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return bt(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return a.disabled},get"data-key"(){return y.dataKey()},get"data-highlighted"(){return g()?"":void 0},get"data-disabled"(){return a.disabled?"":void 0},get onPointerDown(){return Kn([a.onPointerDown,y.onPointerDown])},get onPointerUp(){return Kn([a.onPointerUp,y.onPointerUp])},get onClick(){return Kn([v,y.onClick])},get onKeyDown(){return Kn([x,y.onKeyDown])},get onMouseDown(){return Kn([a.onMouseDown,y.onMouseDown])},get onFocus(){return Kn([a.onFocus,y.onFocus])},onPointerMove:k,onPointerLeave:b},()=>r.dataset(),o))}function bme(e){const t=Rj(),n=`menu-${xr()}`,r=ft({id:n,modal:!0},e),[i,a]=Se(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=x0({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>i.onOpenChange?.(l)}),s={isModal:()=>i.modal??!0,preventScroll:()=>i.preventScroll??s.isModal(),forceMount:()=>i.forceMount??!1,generateId:Io(()=>i.id),value:()=>i.value,orientation:()=>i.orientation??t?.orientation()??"horizontal"};return d(fme.Provider,{value:s,get children(){return d(kme,f({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},a))}})}var sZt={};Ga(sZt,{Root:()=>Ff,Separator:()=>lZt});function Ff(e){let t;const n=ft({orientation:"horizontal"},e),[r,i]=Se(n,["ref","orientation"]),a=Z2(()=>t,()=>"hr");return d(zt,f({as:"hr",ref(o){var s=hn(l=>t=l,r.ref);typeof s=="function"&&s(o)},get role(){return a()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var lZt=Ff,cZt={};Ga(cZt,{Arrow:()=>vs,CheckboxItem:()=>zj,Content:()=>wme,DropdownMenu:()=>er,Group:()=>Nm,GroupLabel:()=>qj,Icon:()=>jj,Item:()=>Hj,ItemDescription:()=>Fj,ItemIndicator:()=>Vj,ItemLabel:()=>Bj,Portal:()=>Uj,RadioGroup:()=>Wj,RadioItem:()=>Gj,Root:()=>xme,Separator:()=>Ff,Sub:()=>Zj,SubContent:()=>Kj,SubTrigger:()=>Xj,Trigger:()=>pme});function wme(e){const t=fa(),n=Po(),[r,i]=Se(e,["onCloseAutoFocus","onInteractOutside"]);let a=!1;return d(gme,f({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),a||ur(n.triggerRef()),a=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(a=!0)}},i))}function xme(e){const t=`dropdownmenu-${xr()}`,n=ft({id:t},e);return d(bme,n)}var er=Object.assign(xme,{Arrow:vs,CheckboxItem:zj,Content:wme,Group:Nm,GroupLabel:qj,Icon:jj,Item:Hj,ItemDescription:Fj,ItemIndicator:Vj,ItemLabel:Bj,Portal:Uj,RadioGroup:Wj,RadioItem:Gj,Separator:Ff,Sub:Zj,SubContent:Kj,SubTrigger:Xj,Trigger:pme});function dZt(e){return d(er,f(e,{"data-component":"dropdown-menu"}))}function uZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.Trigger,f(n,{"data-slot":"dropdown-menu-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function hZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.Icon,f(n,{"data-slot":"dropdown-menu-icon",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function fZt(e){return d(er.Portal,e)}function pZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.Content,f(n,{"data-component":"dropdown-menu-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function mZt(e){const[t,n]=Se(e,["class","classList"]);return d(er.Arrow,f(n,{"data-slot":"dropdown-menu-arrow",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function gZt(e){const[t,n]=Se(e,["class","classList"]);return d(er.Separator,f(n,{"data-slot":"dropdown-menu-separator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function yZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.Group,f(n,{"data-slot":"dropdown-menu-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function vZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.GroupLabel,f(n,{"data-slot":"dropdown-menu-group-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function kZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.Item,f(n,{"data-slot":"dropdown-menu-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function bZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.ItemLabel,f(n,{"data-slot":"dropdown-menu-item-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function wZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.ItemDescription,f(n,{"data-slot":"dropdown-menu-item-description",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function xZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.ItemIndicator,f(n,{"data-slot":"dropdown-menu-item-indicator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function _Zt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.RadioGroup,f(n,{"data-slot":"dropdown-menu-radio-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function MZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.RadioItem,f(n,{"data-slot":"dropdown-menu-radio-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function SZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.CheckboxItem,f(n,{"data-slot":"dropdown-menu-checkbox-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function CZt(e){return d(er.Sub,e)}function LZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.SubTrigger,f(n,{"data-slot":"dropdown-menu-sub-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function IZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.SubContent,f(n,{"data-component":"dropdown-menu-sub-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}const Mt=Object.assign(dZt,{Trigger:uZt,Icon:hZt,Portal:fZt,Content:pZt,Arrow:mZt,Separator:gZt,Group:yZt,GroupLabel:vZt,Item:kZt,ItemLabel:bZt,ItemDescription:wZt,ItemIndicator:xZt,RadioGroup:_Zt,RadioItem:MZt,CheckboxItem:SZt,Sub:CZt,SubTrigger:LZt,SubContent:IZt});var NZt=ie("<div>"),Yj=class{x;y;width;height;constructor(t){this.x=Math.floor(t.x),this.y=Math.floor(t.y),this.width=Math.floor(t.width),this.height=Math.floor(t.height)}get rect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get center(){return{x:this.x+this.width*.5,y:this.y+this.height*.5}}get corners(){return{topLeft:{x:this.left,y:this.top},topRight:{x:this.right,y:this.top},bottomRight:{x:this.left,y:this.bottom},bottomLeft:{x:this.right,y:this.bottom}}}},jh=e=>{let t=new Yj(e.getBoundingClientRect());const{transform:n}=getComputedStyle(e);return n&&(t=AZt(t,n)),t},AZt=(e,t)=>{let n,r;if(t.startsWith("matrix3d(")){const i=t.slice(9,-1).split(/, /);n=+i[12],r=+i[13]}else if(t.startsWith("matrix(")){const i=t.slice(7,-1).split(/, /);n=+i[4],r=+i[5]}else n=0,r=0;return new Yj({...e,x:e.x-n,y:e.y-r})},Ea=()=>({x:0,y:0}),XK=(e,t)=>e.x===t.x&&e.y===t.y,rV=(e,t)=>new Yj({...e,x:e.x+t.x,y:e.y+t.y}),$Zt=(e,t)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),TZt=(e,t)=>{const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom),o=i-r,s=a-n;if(r<i&&n<a){const l=e.width*e.height,c=t.width*t.height,u=o*s;return u/(l+c-u)}return 0},iV=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,_me=(e,t,n)=>{const r=e.transformed.center,i={distance:1/0,droppable:null};for(const a of t){const o=$Zt(r,a.layout.center);o<i.distance?(i.distance=o,i.droppable=a):o===i.distance&&a.id===n.activeDroppableId&&(i.droppable=a)}return i.droppable},EZt=(e,t,n)=>{const r=e.transformed,i={ratio:0,droppable:null};for(const a of t){const o=TZt(r,a.layout);o>i.ratio?(i.ratio=o,i.droppable=a):o>0&&o===i.ratio&&a.id===n.activeDroppableId&&(i.droppable=a)}return i.droppable},Mme=Tt(),Sme=e=>{const t=f({collisionDetector:EZt},e),[n,r]=nt({draggables:{},droppables:{},sensors:{},active:{draggableId:null,get draggable(){return n.active.draggableId!==null?n.draggables[n.active.draggableId]:null},droppableId:null,get droppable(){return n.active.droppableId!==null?n.droppables[n.active.droppableId]:null},sensorId:null,get sensor(){return n.active.sensorId!==null?n.sensors[n.active.sensorId]:null},overlay:null}}),i=(E,T,R)=>{E.substring(0,E.length-1),lt(()=>n[E][T])&&r(E,T,"transformers",R.id,R)},a=(E,T,R)=>{E.substring(0,E.length-1),lt(()=>n[E][T])&<(()=>n[E][T].transformers[R])&&r(E,T,"transformers",R,void 0)},o=({id:E,node:T,layout:R,data:H})=>{const Y=n.draggables[E],j={id:E,node:T,layout:R,data:H,_pendingCleanup:!1};let X;if(!Y)Object.defineProperties(j,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{if(n.active.overlay)return Ea();const W=Object.values(n.draggables[E].transformers);return W.sort((G,J)=>G.order-J.order),W.reduce((G,J)=>J.callback(G),Ea())}},transformed:{enumerable:!0,configurable:!0,get:()=>rV(n.draggables[E].layout,n.draggables[E].transform)}});else if(n.active.draggableId===E&&!n.active.overlay){const W={x:Y.layout.x-R.x,y:Y.layout.y-R.y},G="addDraggable-existing-offset",J=Y.transformers[G],oe=J?J.callback(W):W;X={id:G,order:100,callback:de=>({x:de.x+oe.x,y:de.y+oe.y})},D(()=>a("draggables",E,G))}ct(()=>{r("draggables",E,j),X&&i("draggables",E,X)}),n.active.draggable&&M()},s=E=>{lt(()=>n.draggables[E])&&(r("draggables",E,"_pendingCleanup",!0),queueMicrotask(()=>l(E)))},l=E=>{if(n.draggables[E]?._pendingCleanup){const T=n.active.draggableId===E;ct(()=>{T&&r("active","draggableId",null),r("draggables",E,void 0)})}},c=({id:E,node:T,layout:R,data:H})=>{const Y=n.droppables[E],j={id:E,node:T,layout:R,data:H,_pendingCleanup:!1};Y||Object.defineProperties(j,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{const X=Object.values(n.droppables[E].transformers);return X.sort((W,G)=>W.order-G.order),X.reduce((W,G)=>G.callback(W),Ea())}},transformed:{enumerable:!0,configurable:!0,get:()=>rV(n.droppables[E].layout,n.droppables[E].transform)}}),r("droppables",E,j),n.active.draggable&&M()},u=E=>{lt(()=>n.droppables[E])&&(r("droppables",E,"_pendingCleanup",!0),queueMicrotask(()=>h(E)))},h=E=>{if(n.droppables[E]?._pendingCleanup){const T=n.active.droppableId===E;ct(()=>{T&&r("active","droppableId",null),r("droppables",E,void 0)})}},m=({id:E,activators:T})=>{r("sensors",E,{id:E,activators:T,coordinates:{origin:{x:0,y:0},current:{x:0,y:0},get delta(){return{x:n.sensors[E].coordinates.current.x-n.sensors[E].coordinates.origin.x,y:n.sensors[E].coordinates.current.y-n.sensors[E].coordinates.origin.y}}}})},g=E=>{if(!lt(()=>n.sensors[E]))return;const T=n.active.sensorId===E;ct(()=>{T&&r("active","sensorId",null),r("sensors",E,void 0)})},y=({node:E,layout:T})=>{const R=n.active.overlay,H={node:E,layout:T};R||Object.defineProperties(H,{id:{enumerable:!0,configurable:!0,get:()=>n.active.draggable?.id},data:{enumerable:!0,configurable:!0,get:()=>n.active.draggable?.data},transformers:{enumerable:!0,configurable:!0,get:()=>Object.fromEntries(Object.entries(n.active.draggable?n.active.draggable.transformers:{}).filter(([Y])=>Y!=="addDraggable-existing-offset"))},transform:{enumerable:!0,configurable:!0,get:()=>{const Y=Object.values(n.active.overlay?n.active.overlay.transformers:[]);return Y.sort((j,X)=>j.order-X.order),Y.reduce((j,X)=>X.callback(j),Ea())}},transformed:{enumerable:!0,configurable:!0,get:()=>n.active.overlay?rV(n.active.overlay.layout,n.active.overlay.transform):new Yj({x:0,y:0,width:0,height:0})}}),r("active","overlay",H)},v=()=>r("active","overlay",null),k=(E,T)=>{ct(()=>{r("sensors",E,"coordinates",{origin:{...T},current:{...T}}),r("active","sensorId",E)})},b=E=>{const T=n.active.sensorId;T&&r("sensors",T,"coordinates","current",{...E})},x=()=>r("active","sensorId",null),w=(E,T)=>{const R={};for(const Y of Object.values(n.sensors))if(Y)for(const[j,X]of Object.entries(Y.activators))R[j]??=[],R[j].push({sensor:Y,activator:X});const H={};for(const Y in R){let j=Y;T&&(j=`on${Y}`),H[j]=X=>{for(const{activator:W}of R[Y]){if(n.active.sensor)break;W(X,E)}}}return H},M=()=>{let E=!1;const T=Object.values(n.draggables),R=Object.values(n.droppables),H=n.active.overlay;return ct(()=>{const Y=new WeakMap;for(const j of T)if(j){const X=j.layout;Y.has(j.node)||Y.set(j.node,jh(j.node));const W=Y.get(j.node);iV(X,W)||(r("draggables",j.id,"layout",W),E=!0)}for(const j of R)if(j){const X=j.layout;Y.has(j.node)||Y.set(j.node,jh(j.node));const W=Y.get(j.node);iV(X,W)||(r("droppables",j.id,"layout",W),E=!0)}if(H){const j=H.layout,X=jh(H.node);iV(j,X)||(r("active","overlay","layout",X),E=!0)}}),E},_=()=>{const E=n.active.overlay??n.active.draggable;if(E){const T=t.collisionDetector(E,Object.values(n.droppables),{activeDroppableId:n.active.droppableId}),R=T?T.id:null;n.active.droppableId!==R&&r("active","droppableId",R)}},C=E=>{const T={id:"sensorMove",order:0,callback:R=>n.active.sensor?{x:R.x+n.active.sensor.coordinates.delta.x,y:R.y+n.active.sensor.coordinates.delta.y}:R};M(),ct(()=>{r("active","draggableId",E),i("draggables",E,T)}),_()},L=()=>{const E=lt(()=>n.active.draggableId);ct(()=>{E!==null&&a("draggables",E,"sensorMove"),r("active",["draggableId","droppableId"],null)}),M()},S=E=>{he(()=>{const T=n.active.draggable;T&<(()=>E({draggable:T}))})},I=E=>{he(()=>{const T=n.active.draggable;if(T){const R=lt(()=>n.active.overlay);Object.values(R?R.transform:T.transform),lt(()=>E({draggable:T,overlay:R}))}})},A=E=>{he(()=>{const T=n.active.draggable,R=n.active.droppable;T&<(()=>E({draggable:T,droppable:R,overlay:n.active.overlay}))})},D=E=>{he(({previousDraggable:T,previousDroppable:R,previousOverlay:H})=>{const Y=n.active.draggable,j=Y?n.active.droppable:null,X=Y?n.active.overlay:null;return!Y&&T&<(()=>E({draggable:T,droppable:R,overlay:H})),{previousDraggable:Y,previousDroppable:j,previousOverlay:X}},{previousDraggable:null,previousDroppable:null,previousOverlay:null})};I(()=>_()),t.onDragStart&&S(t.onDragStart),t.onDragMove&&I(t.onDragMove),t.onDragOver&&A(t.onDragOver),t.onDragEnd&&D(t.onDragEnd);const O=[n,{addTransformer:i,removeTransformer:a,addDraggable:o,removeDraggable:s,addDroppable:c,removeDroppable:u,addSensor:m,removeSensor:g,setOverlay:y,clearOverlay:v,recomputeLayouts:M,detectCollisions:_,draggableActivators:w,sensorStart:k,sensorMove:b,sensorEnd:x,dragStart:C,dragEnd:L,onDragStart:S,onDragMove:I,onDragOver:A,onDragEnd:D}];return d(Mme.Provider,{value:O,get children(){return t.children}})},R0=()=>Lt(Mme)||null,PZt=(e="pointer-sensor")=>{const[t,{addSensor:n,removeSensor:r,sensorStart:i,sensorMove:a,sensorEnd:o,dragStart:s,dragEnd:l}]=R0(),c=250,u=10;dn(()=>{n({id:e,activators:{pointerdown:v}})}),me(()=>{r(e)});const h=()=>t.active.sensorId===e,m={x:0,y:0};let g=null,y=null;const v=(_,C)=>{_.button===0&&(document.addEventListener("pointermove",x),document.addEventListener("pointerup",w),y=C,m.x=_.clientX,m.y=_.clientY,g=window.setTimeout(b,c))},k=()=>{g&&(clearTimeout(g),g=null),document.removeEventListener("pointermove",x),document.removeEventListener("pointerup",w),document.removeEventListener("selectionchange",M)},b=()=>{t.active.sensor?h()||k():(i(e,m),s(y),M(),document.addEventListener("selectionchange",M))},x=_=>{const C={x:_.clientX,y:_.clientY};if(!t.active.sensor){const L={x:C.x-m.x,y:C.y-m.y};Math.sqrt(L.x**2+L.y**2)>u&&b()}h()&&(_.preventDefault(),a(C))},w=_=>{k(),h()&&(_.preventDefault(),l(),o())},M=()=>{window.getSelection()?.removeAllRanges()}},Cme=e=>(PZt(),bt(()=>e.children)),Jj=e=>({transform:`translate3d(${e.x}px, ${e.y}px, 0)`}),DZt=(e,t={})=>{const[n,{addDraggable:r,removeDraggable:i,draggableActivators:a}]=R0(),[o,s]=Ce(null);dn(()=>{const h=o();h&&r({id:e,node:h,layout:jh(h),data:t})}),me(()=>i(e));const l=()=>n.active.draggableId===e,c=()=>n.draggables[e]?.transform||Ea();return Object.defineProperties((h,m)=>{const g=m?m():{};he(()=>{const y=o(),v=a(e);if(y)for(const k in v)y.addEventListener(k,v[k]);me(()=>{if(y)for(const k in v)y.removeEventListener(k,v[k])})}),s(h),g.skipTransform||he(()=>{const y=c();if(XK(y,Ea()))h.style.removeProperty("transform");else{const v=Jj(c());h.style.setProperty("transform",v.transform??null)}})},{ref:{enumerable:!0,value:s},isActiveDraggable:{enumerable:!0,get:l},dragActivators:{enumerable:!0,get:()=>a(e,!0)},transform:{enumerable:!0,get:c}})},OZt=(e,t={})=>{const[n,{addDroppable:r,removeDroppable:i}]=R0(),[a,o]=Ce(null);dn(()=>{const u=a();u&&r({id:e,node:u,layout:jh(u),data:t})}),me(()=>i(e));const s=()=>n.active.droppableId===e,l=()=>n.droppables[e]?.transform||Ea();return Object.defineProperties((u,h)=>{const m=h?h():{};o(u),m.skipTransform||he(()=>{const g=l();if(XK(g,Ea()))u.style.removeProperty("transform");else{const y=Jj(l());u.style.setProperty("transform",y.transform??null)}})},{ref:{enumerable:!0,value:o},isActiveDroppable:{enumerable:!0,get:s},transform:{enumerable:!0,get:l}})},Lme=e=>{const[t,{onDragStart:n,onDragEnd:r,setOverlay:i,clearOverlay:a}]=R0();let o;n(({draggable:l})=>{i({node:l.node,layout:l.layout}),queueMicrotask(()=>{if(o){const c=jh(o),u={x:(l.layout.width-c.width)/2,y:(l.layout.height-c.height)/2};c.x+=u.x,c.y+=u.y,i({node:o,layout:c})}})}),r(()=>queueMicrotask(a));const s=()=>{const l=t.active.overlay,c=t.active.draggable;return!l||!c?{}:{position:"fixed",transition:"transform 0s",top:`${l.layout.top}px`,left:`${l.layout.left}px`,"min-width":`${c.layout.width}px`,"min-height":`${c.layout.height}px`,...Jj(l.transform),...e.style}};return d(w0,{get mount(){return document.body},get children(){return d(ke,{get when(){return t.active.draggable},get children(){var l=NZt(),c=o;return typeof c=="function"?Hr(c,l):o=l,K(l,(()=>{var u=bt(()=>typeof e.children=="function");return()=>u()?e.children(t.active.draggable):e.children})()),Qe(u=>{var h=e.class,m=s();return h!==u.e&&W2(l,u.e=h),u.t=aq(l,m,u.t),u},{e:void 0,t:void 0}),l}})}})},RZt=(e,t,n)=>{const r=e.slice();return r.splice(n,0,...r.splice(t,1)),r},Ime=Tt(),Nme=e=>{const[t]=R0(),[n,r]=nt({initialIds:[],sortedIds:[]}),i=s=>s>=0&&s<n.initialIds.length;he(()=>{r("initialIds",[...e.ids]),r("sortedIds",[...e.ids])}),he(()=>{t.active.draggableId&&t.active.droppableId?lt(()=>{const s=n.sortedIds.indexOf(t.active.draggableId),l=n.initialIds.indexOf(t.active.droppableId);if(!i(s)||!i(l))r("sortedIds",[...e.ids]);else if(s!==l){const c=RZt(n.sortedIds,s,l);r("sortedIds",c)}}):r("sortedIds",[...e.ids])});const o=[n,{}];return d(Ime.Provider,{value:o,get children(){return e.children}})},zZt=()=>Lt(Ime)||null,qZt=(e,t)=>n=>{e(n),t(n)},Ame=(e,t={})=>{const[n,{addTransformer:r,removeTransformer:i}]=R0(),[a]=zZt(),o=DZt(e,t),s=OZt(e,t),l=qZt(o.ref,s.ref),c=()=>a.initialIds.indexOf(e),u=()=>a.sortedIds.indexOf(e),h=k=>n.droppables[k]?.layout||null,m=()=>{const k=Ea(),b=c(),x=u();if(x!==b){const w=h(e),M=h(a.initialIds[x]);w&&M&&(k.x=M.x-w.x,k.y=M.y-w.y)}return k},g={id:"sortableOffset",order:100,callback:k=>{const b=m();return{x:k.x+b.x,y:k.y+b.y}}};dn(()=>r("droppables",e,g)),me(()=>i("droppables",e,g.id));const y=()=>(e===n.active.draggableId&&!n.active.overlay?n.draggables[e]?.transform:n.droppables[e]?.transform)||Ea();return Object.defineProperties(k=>{o(k,()=>({skipTransform:!0})),s(k,()=>({skipTransform:!0})),he(()=>{const b=y();if(XK(b,Ea()))k.style.removeProperty("transform");else{const x=Jj(y());k.style.setProperty("transform",x.transform??null)}})},{ref:{enumerable:!0,value:l},transform:{enumerable:!0,get:y},isActiveDraggable:{enumerable:!0,get:()=>o.isActiveDraggable},dragActivators:{enumerable:!0,get:()=>o.dragActivators},isActiveDroppable:{enumerable:!0,get:()=>s.isActiveDroppable}})};function jZt(e){const t={locs:[],timer:void 0,pending:void 0,over:void 0,last:void 0},n=e.delay??250,r=e.max??4,i=e.tolerance??80,a=e.edge??18,o=()=>{t.timer!==void 0&&clearTimeout(t.timer),t.timer=void 0,t.pending=void 0},s=()=>{o(),t.over=void 0,t.last=void 0,t.locs.length=0},l=y=>{if(!e.enabled())return;const v=e.el();if(!v)return;const k=v.getBoundingClientRect(),b=y.clientX,x=y.clientY;b<k.left||b>k.right||x<k.top||x>k.bottom||(t.locs.push({x:b,y:x}),t.locs.length>r&&t.locs.shift())},c=()=>{if(!e.enabled()||!e.active())return 0;const y=e.el();if(!y||t.locs.length<2)return 0;const v=y.getBoundingClientRect(),k=t.locs[t.locs.length-1];if(!k)return 0;const b=t.locs[0]??k;if(b.x<v.left||b.x>v.right||b.y<v.top||b.y>v.bottom||t.last&&k.x===t.last.x&&k.y===t.last.y)return 0;if(v.right-k.x<=a)return t.last=k,n;const x={x:v.right,y:v.top-i},w={x:v.right,y:v.bottom+i},M=(I,A)=>(A.y-I.y)/(A.x-I.x),_=M(k,x),C=M(k,w),L=M(b,x),S=M(b,w);return _<L&&C>S?(t.last=k,n):(t.last=void 0,0)},u=y=>{o(),e.onActivate(y)},h=y=>{if(!y||e.active()===y)return;if(!e.active()){u(y);return}const v=c();if(v===0){u(y);return}o(),t.pending=y,t.timer=window.setTimeout(()=>{t.timer=void 0,t.pending===y&&(t.pending=void 0,e.enabled()&&e.active()&&t.over===y&&e.onActivate(y))},v)};return{move:l,enter:(y,v)=>{e.enabled()&&(t.over=y,l(v),h(y))},leave:y=>{t.over===y&&(t.over=void 0),t.pending===y&&o()},activate:u,request:h,cancel:o,reset:s}}let DU;const HZt=e=>{DU=e},FZt=e=>{if(window.focus(),!!e){if(DU)return DU(e);console.warn("notification-click: navigate function not set, falling back to window.location.assign"),window.location.assign(e)}},_p=e=>e.replace(/[\\/]+$/,""),oh=new Map,sh=new Map;function VZt(){const e={resolve:n=>{}};return{promise:new Promise(n=>{e.resolve=n}),resolve:e.resolve}}const Jg={get(e){return oh.get(_p(e))},pending(e){const t=_p(e),n=oh.get(t);n&&n.status!=="pending"||oh.set(t,{status:"pending"})},ready(e){const t=_p(e),n={status:"ready"};oh.set(t,n);const r=sh.get(t);r&&(sh.delete(t),r.resolve(n))},failed(e,t){const n=_p(e),r={status:"failed",message:t};oh.set(n,r);const i=sh.get(n);i&&(sh.delete(n),i.resolve(r))},wait(e){const t=_p(e),n=oh.get(t);if(n&&n.status!=="pending")return Promise.resolve(n);const r=sh.get(t);if(r)return r.promise;const i=VZt();return sh.set(t,i),i.promise}},BZt=40,H2={session:new Map,terminal:new Map},$me=(e,t,n)=>{for(e.delete(t),e.set(t,n);e.size>BZt;){const r=e.keys().next().value;if(r===void 0)return;e.delete(r)}},UZt=(e,t)=>{const n=H2.session.get(e)??{prompt:"",files:{}};$me(H2.session,e,{...n,...t})},wQt=e=>H2.session.get(e),xQt=(e,t)=>{$me(H2.terminal,e,t)},_Qt=e=>H2.terminal.get(e),WZt=e=>typeof e!="object"||e===null?!1:"draggable"in e,tq=e=>{if(!WZt(e))return;const t=e.draggable;if(t)return typeof t.id=="string"?t.id:void 0},GZt=(e,t)=>({id:e,order:100,callback:n=>t==="x"?{...n,x:0}:{...n,y:0}}),Tme=(e,t)=>()=>{const n=R0();if(!n)return null;const[,{onDragStart:r,onDragEnd:i,addTransformer:a,removeTransformer:o}]=n,s=GZt(t,e),l=wr(c=>(r(u=>{const h=tq(u);h&&a("draggables",h,s)}),i(u=>{const h=tq(u);h&&o("draggables",h,s.id)}),c));return me(l),null},Eme=Tme("x","constrain-x-axis"),MQt=Tme("y","constrain-y-axis"),YK=100;function ZZt(e,t,n=YK){if(!e.stack.length){const i=t==="/"?["/"]:["/",t];return{stack:i,index:i.length-1,action:void 0}}const r=e.stack[e.index];return t===r?e.action?{...e,action:void 0}:e:e.action?{...e,action:void 0}:KZt(e,t,n)}function KZt(e,t,n=YK){const r=e.stack.slice(0,e.index+1).concat(t),i=XZt(r,r.length-1,n);return{...e,...i,action:void 0}}function XZt(e,t,n=YK){if(e.length<=n)return{stack:e,index:t};const r=e.length-n;return{stack:e.slice(r),index:Math.max(0,t-r)}}function YZt(e){if(e.index<=0)return;const t=e.index-1,n=e.stack[t];if(n)return{state:{...e,index:t,action:"back"},to:n}}function JZt(e){if(e.index>=e.stack.length-1)return;const t=e.index+1,n=e.stack[t];if(n)return{state:{...e,index:t,action:"forward"},to:n}}var QZt=ie('<div class="h-full shrink-0">'),eKt=ie('<div class="xl:hidden w-10 shrink-0 flex items-center justify-center">'),tKt=ie('<div class="xl:hidden w-[32px] shrink-0 flex items-center justify-center mr-2">'),nKt=ie('<div class="flex items-center shrink-0"><svg width=20 height=20 viewBox="0 0 800 800"fill=none xmlns=http://www.w3.org/2000/svg class=shrink-0><path d="M373.362 226.643C388.087 211.919 411.96 211.919 426.684 226.643L573.37 373.324C588.094 388.047 588.094 411.92 573.37 426.644L426.684 573.324C411.96 588.048 388.087 588.048 373.362 573.324L226.677 426.644C211.952 411.92 211.952 388.047 226.677 373.324L373.362 226.643Z"fill=currentColor class=text-text-base></path><path d="M586.658 513.282C594.02 505.921 605.956 505.921 613.318 513.282L686.659 586.621C694.021 593.983 694.021 605.919 686.659 613.28L613.318 686.619C605.956 693.981 594.02 693.981 586.658 686.619L513.317 613.28C505.955 605.919 505.955 593.983 513.317 586.621L586.658 513.282Z"fill=currentColor class=text-text-base></path><path d="M286.501 586.454C293.957 593.909 293.957 605.997 286.501 613.453L213.5 686.452C206.044 693.907 193.956 693.907 186.5 686.452L113.499 613.453C106.043 605.997 106.043 593.909 113.499 586.454L186.5 513.455C193.956 506 206.044 506 213.5 513.455L286.501 586.454Z"fill=currentColor class=text-text-base></path><path d="M406.524 93.4982C402.934 97.088 397.113 97.088 393.523 93.4982L356.523 56.499C352.933 52.9092 352.933 47.089 356.523 43.4992L393.523 6.50002C397.113 2.91025 402.934 2.91025 406.524 6.50003L443.524 43.4992C447.114 47.089 447.114 52.9092 443.524 56.499L406.524 93.4982Z"fill=currentColor class=text-text-base></path><path d="M186.502 113.498C193.958 106.042 206.046 106.042 213.502 113.498L286.503 186.496C293.959 193.952 293.959 206.04 286.503 213.496L213.502 286.494C206.046 293.95 193.958 293.95 186.502 286.494L113.501 213.496C106.045 206.04 106.045 193.952 113.501 186.496L186.502 113.498Z"fill=currentColor class=text-text-base></path><path d="M686.499 186.483C693.955 193.939 693.955 206.027 686.499 213.482L613.498 286.481C606.042 293.937 593.954 293.937 586.498 286.481L513.497 213.482C506.041 206.027 506.041 193.939 513.497 186.483L586.498 113.484C593.954 106.029 606.042 106.029 613.498 113.484L686.499 186.483Z"fill=currentColor class=text-text-base></path><path d="M356.689 756.666C353.007 752.985 353.007 747.017 356.689 743.336L393.359 706.667C397.04 702.986 403.008 702.986 406.689 706.667L443.359 743.336C447.041 747.017 447.041 752.985 443.359 756.666L406.689 793.335C403.008 797.016 397.04 797.016 393.359 793.335L356.689 756.666Z"fill=currentColor class=text-text-base>'),rKt=ie("<span class=truncate>"),iKt=ie('<div class="flex items-center gap-1.5 text-12-regular text-text-weaker select-none ml-1"><span class=text-text-weak>'),aKt=ie('<div data-tauri-decorum-tb class="flex flex-row">'),oKt=ie('<header class="h-12 shrink-0 bg-transparent relative grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center"data-tauri-drag-region><div><div id=opencode-titlebar-left class="flex items-center gap-3 min-w-0 px-2"></div></div><div class="min-w-0 flex items-center justify-center pointer-events-none"><div class="pointer-events-auto min-w-0 flex items-center justify-center w-fit max-w-full"><div id=opencode-titlebar-center class="min-w-0 flex justify-center"></div></div></div><div data-tauri-drag-region><div id=opencode-titlebar-right class="flex items-center gap-2">'),sKt=ie('<div class="w-36 shrink-0">');const JK=()=>window.__TAURI__,lKt=()=>JK()?.window?.getCurrentWindow?.(),cKt=()=>JK()?.webviewWindow?.getCurrentWebviewWindow?.();function dKt(){const e=If(),t=ms(),n=Ice(),r=_r(),i=ule(),a=lf(),o=ll(),s=bf(),l=di();ope();const[c]=e_t(),[u,h]=Ce(!1),[m,g]=Ce(""),[y,v]=Ce(""),[k,b]=Ce(!1);function x(){z(async()=>{const{DialogCreateProject:G}=await import("./dialog-create-project-DjSz5fKF.js");return{DialogCreateProject:G}},[]).then(({DialogCreateProject:G})=>{a.show(()=>d(G,{onSelect:J=>{if(!J)return;const oe=Array.isArray(J)?J[0]:J;oe&&(e.projects.open(oe),o(`/${St(oe)}/session`))}}))})}function w(){z(async()=>{const{DialogCloneProject:G}=await import("./dialog-clone-project-C7k2pNz7.js");return{DialogCloneProject:G}},[]).then(({DialogCloneProject:G})=>{a.show(()=>d(G,{onSelect:J=>{J&&(e.projects.open(J),o(`/${St(J)}/session`))}}))})}const M=Z(()=>t.platform==="desktop"&&t.os==="macos"),_=Z(()=>t.platform==="desktop"&&t.os==="windows");Z(()=>t.platform==="web");const C=()=>t.webviewZoom?.()??1,L=()=>M()?`${40/C()}px`:void 0,[S,I]=nt({stack:[],index:0,action:void 0}),A=()=>`${s.pathname}${s.search}${s.hash}`;Z(()=>!l.dir||l.id?!1:s.pathname.replace(/\/+$/,"").split("/").at(-1)==="session"),he(()=>{const G=A();lt(()=>{const J=ZZt(S,G);J!==S&&I(J)})}),Z(()=>S.index>0),Z(()=>S.index<S.stack.length-1);const D=Z(()=>e.projects.list().length>0),P=Z(()=>e.projects.list().find(G=>St(G.worktree)===l.dir)),O=Z(()=>{const G=P();return G?G.name||Gn(G.worktree):r.t("command.project.open")}),E={plan:"Plan",track:"Track",project:"Track",data:"Data",ship:"Ship",review:"Review"},T=Z(()=>{const G=c.view,J=Array.isArray(G)?G[0]:G;if(J)return E[J]}),R=()=>{const G=YZt(S);G&&(I(G.state),o(G.to))},H=()=>{const G=JZt(S);G&&(I(G.state),o(G.to))};n.register(()=>[{id:"common.goBack",title:r.t("common.goBack"),category:r.t("command.category.view"),keybind:"mod+[",onSelect:R},{id:"common.goForward",title:r.t("common.goForward"),category:r.t("command.category.view"),keybind:"mod+]",onSelect:H}]);const Y=()=>{if(t.platform==="desktop")return lKt()};he(()=>{if(t.platform!=="desktop")return;const G=i.colorScheme(),J=G==="system"?null:G,oe=cKt();oe?.setTheme&&oe.setTheme(J).catch(()=>{})});const j=G=>G instanceof Element?!!G.closest("button, a, input, textarea, select, option, [role='button'], [role='menuitem'], [contenteditable='true'], [contenteditable='']"):!1,X=G=>{if(t.platform!=="desktop"||G.buttons!==1||j(G.target))return;const J=Y();J?.startDragging&&(G.preventDefault(),J.startDragging().catch(()=>{}))},W=G=>{if(t.platform!=="desktop"||j(G.target)||G.target instanceof Element&&G.target.closest("[data-tauri-decorum-tb]"))return;const J=Y();J?.toggleMaximize&&(G.preventDefault(),J.toggleMaximize().catch(()=>{}))};return(()=>{var G=oKt(),J=G.firstChild,oe=J.firstChild,de=J.nextSibling,ye=de.firstChild,ve=ye.firstChild,le=de.nextSibling;return le.firstChild,G.$$dblclick=W,G.$$mousedown=X,K(J,d(ke,{get when(){return M()},get children(){return[(()=>{var pe=QZt();return Qe(Ee=>kr(pe,"width",`${72/C()}px`)),pe})(),(()=>{var pe=eKt();return K(pe,d(Cr,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return e.mobileSidebar.toggle},get"aria-label"(){return r.t("sidebar.menu.toggle")},get"aria-expanded"(){return e.mobileSidebar.opened()}})),pe})()]}}),oe),K(J,d(ke,{get when(){return!M()},get children(){var pe=tKt();return K(pe,d(Cr,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return e.mobileSidebar.toggle},get"aria-label"(){return r.t("sidebar.menu.toggle")},get"aria-expanded"(){return e.mobileSidebar.opened()}})),pe}}),oe),K(ye,d(ke,{get when(){return D()},get children(){return[nKt(),d(Mt,{placement:"bottom",gutter:4,modal:!1,get children(){return[d(Mt.Trigger,{as:Mn,variant:"ghost",size:"small",class:"flex items-center gap-1 h-6 px-2 text-12-regular text-text-base max-w-[180px]",get children(){return[(()=>{var pe=rKt();return K(pe,O),pe})(),d(Kt,{name:"chevron-down",size:"small",class:"shrink-0 text-icon-weak"})]}}),d(Mt.Portal,{get children(){return d(Mt.Content,{class:"min-w-[180px]",get children(){return[d(Qt,{get each(){return e.projects.list()},children:pe=>d(Mt.Item,{onSelect:()=>o(`/${St(pe.worktree)}/session`),get children(){return d(Mt.ItemLabel,{get children(){return pe.name||Gn(pe.worktree)}})}})}),d(Mt.Separator,{}),d(Mt.Item,{onSelect:()=>n.trigger("project.open"),get children(){return d(Mt.ItemLabel,{get children(){return r.t("command.project.open")}})}}),d(Mt.Separator,{}),d(Mt.Sub,{get children(){return[d(Mt.SubTrigger,{get children(){return r.t("command.project.new")}}),d(Mt.SubContent,{get children(){return[d(Mt.Item,{onSelect:x,get children(){return d(Mt.ItemLabel,{get children(){return r.t("command.project.newBlank")}})}}),d(Mt.Item,{onSelect:w,get children(){return d(Mt.ItemLabel,{get children(){return r.t("command.project.importGitHub")}})}})]}})]}})]}})}})]}})]}}),ve),K(ye,d(ke,{get when(){return T()},get children(){var pe=iKt(),Ee=pe.firstChild;return K(pe,d(Kt,{name:"chevron-right",size:"small",class:"text-icon-weaker shrink-0"}),Ee),K(Ee,T),pe}}),ve),le.$$mousedown=X,K(le,d(eme,{placement:"bottom",get title(){return r.t("sidebar.settings")},get keybind(){return n.keybind("settings.open")??""},get children(){return d(Mn,{variant:"ghost",class:"titlebar-icon w-8 h-6 p-0 box-border shrink-0",onClick:()=>n.trigger("settings.open"),get"aria-label"(){return r.t("sidebar.settings")},get children(){return d(Kt,{size:"small",name:"settings-gear"})}})}}),null),K(le,d(ke,{get when(){return _()},get children(){return[bt(()=>bt(()=>!JK())()&&sKt()),aKt()]}}),null),Qe(pe=>{var Ee=L(),Re={"flex items-center min-w-0":!0,"pl-2":!M()},wt={"flex items-center min-w-0 justify-end":!0,"pr-2":!_()};return Ee!==pe.e&&kr(G,"min-height",pe.e=Ee),pe.t=hr(J,Re,pe.t),pe.a=hr(le,wt,pe.a),pe},{e:void 0,t:void 0,a:void 0}),G})()}li(["mousedown","dblclick"]);const tt=e=>{const t=e.replaceAll("\\","/"),n=t.match(/^([A-Za-z]:)\/+$/);return n?`${n[1]}/`:/^\/+$/i.test(t)?"/":t.replace(/\/+$/,"")};function Pme(e){const t=e-6e4;return(n,r)=>{const i=n.time.updated??n.time.created,a=r.time.updated??r.time.created,o=i>t,s=a>t;return o&&s?n.id<r.id?-1:n.id>r.id?1:0:o&&!s?-1:!o&&s?1:a-i}}const uKt=(e,t)=>tt(e.directory)===tt(t)&&!e.parentID&&!e.time?.archived,Dme=e=>(e.session??[]).filter(t=>uKt(t,e.path.directory)),F2=(e,t)=>Dme(e).sort(Pme(t)),Ene=(e,t)=>e.flatMap(Dme).sort(Pme(t))[0];function hKt(e,t=()=>!0){return Object.values(e??{}).some(n=>n?.some(t))}const nq=e=>{const t=new Map;for(const n of e??[]){if(!n.parentID)continue;const r=t.get(n.parentID);if(r){r.push(n.id);continue}t.set(n.parentID,[n.id])}return t},QK=e=>e.name||Gn(e.worktree),aV=(e,t)=>{if(e&&typeof e=="object"&&"data"in e){const n=e.data;if(n?.message)return n.message}return e instanceof Error?e.message:t},Qg=(e,t,n)=>{const r=tt(e),i=new Map;for(const o of t){const s=tt(o);s!==r&&(i.has(s)||i.set(s,o))}if(!n?.length)return[e,...i.values()];const a=[e];for(const o of n){const s=tt(o);if(s===r)continue;const l=i.get(s);l&&(a.push(l),i.delete(s))}return[...a,...i.values()]},Pne="opencode:deep-link",Ome=e=>{if(e.startsWith("opencode://")&&!(typeof URL.canParse=="function"&&!URL.canParse(e)))try{return new URL(e)}catch{return}},fKt=e=>{const t=Ome(e);if(!t||t.hostname!=="open-project")return;const n=t.searchParams.get("directory");if(n)return n},pKt=e=>{const t=Ome(e);if(!t||t.hostname!=="new-session")return;const n=t.searchParams.get("directory");if(!n)return;const r=t.searchParams.get("prompt")||void 0;return r?{directory:n,prompt:r}:{directory:n}},mKt=e=>e.map(fKt).filter(t=>!!t),gKt=e=>e.map(pKt).filter(t=>!!t),yKt=e=>{const t=e.__OPENCODE__?.deepLinks??[];return t.length===0?[]:(e.__OPENCODE__&&(e.__OPENCODE__.deepLinks=[]),t)};var vKt=ie("<span>");function kKt(){const[e,t]=nt({active:"",value:""}),n=c=>e.active===c,r=()=>e.value,i=(c,u)=>{c&&t({active:c,value:u})},a=()=>t({active:"",value:""}),o=c=>{const u=e.value.trim();if(!u){a();return}a(),c(u)},s=(c,u)=>{if(c.key==="Enter"){c.preventDefault(),o(u);return}c.key==="Escape"&&(c.preventDefault(),a())};return{editor:e,editorOpen:n,editorValue:r,openEditor:i,closeEditor:a,saveEditor:o,editorKeyDown:s,setEditor:t,InlineEditor:c=>{let u;me(()=>{u!==void 0&&cancelAnimationFrame(u)});const h=()=>c.editing??n(c.id),m=()=>c.stopPropagation??!1,g=()=>c.openOnDblClick??!0,y=k=>{m()&&k.stopPropagation()},v=k=>{g()&&(y(k),i(c.id,c.value()))};return d(ke,{get when(){return h()},get fallback(){return(()=>{var k=vKt();return k.$$touchstart=y,k.$$click=y,k.$$mousedown=y,k.$$pointerdown=y,k.$$dblclick=v,K(k,()=>c.value()),Qe(()=>W2(k,c.displayClass??c.class)),k})()},get children(){return d(LR,{ref:k=>{u!==void 0&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=void 0,k.isConnected&&k.focus()})},get value(){return r()},get class(){return c.class},onInput:k=>t("value",k.currentTarget.value),onKeyDown:k=>{k.stopPropagation(),s(k,c.onSave)},onBlur:a,onPointerDown:y,onClick:y,onDblClick:y,onMouseDown:y,onMouseUp:y,onTouchStart:y})}})}}}li(["dblclick","pointerdown","mousedown","click","touchstart"]);var bKt={};Ga(bKt,{Collapsible:()=>Qj,Content:()=>zme,Root:()=>qme,Trigger:()=>jme,useCollapsibleContext:()=>eX});var Rme=Tt();function eX(){const e=Lt(Rme);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function zme(e){const[t,n]=Ce(),r=eX(),i=ft({id:r.generateId("content")},e),[a,o]=Se(i,["ref","id","style"]),{present:s}=i0({show:r.shouldMount,element:()=>t()??null}),[l,c]=Ce(0),[u,h]=Ce(0);let g=r.isOpen()||s();return dn(()=>{const y=requestAnimationFrame(()=>{g=!1});me(()=>{cancelAnimationFrame(y)})}),he(vn(s,()=>{if(!t())return;t().style.transitionDuration="0s",t().style.animationName="none";const y=t().getBoundingClientRect();c(y.height),h(y.width),g||(t().style.transitionDuration="",t().style.animationName="")})),he(vn(r.isOpen,y=>{!y&&t()&&(t().style.transitionDuration="",t().style.animationName="")},{defer:!0})),he(()=>me(r.registerContentId(a.id))),d(ke,{get when(){return s()},get children(){return d(zt,f({as:"div",ref(y){var v=hn(n,a.ref);typeof v=="function"&&v(y)},get id(){return a.id},get style(){return Wa({"--kb-collapsible-content-height":l()?`${l()}px`:void 0,"--kb-collapsible-content-width":u()?`${u()}px`:void 0},a.style)}},()=>r.dataset(),o))}})}function qme(e){const t=`collapsible-${xr()}`,n=ft({id:t},e),[r,i]=Se(n,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[a,o]=Ce(),s=x0({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:u=>r.onOpenChange?.(u)}),l=Z(()=>({"data-expanded":s.isOpen()?"":void 0,"data-closed":s.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),c={dataset:l,isOpen:s.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||s.isOpen(),contentId:a,toggle:s.toggle,generateId:Io(()=>i.id),registerContentId:zr(o)};return d(Rme.Provider,{value:c,get children(){return d(zt,f({as:"div"},l,i))}})}function jme(e){const t=eX(),[n,r]=Se(e,["onClick"]);return d(_0,f({get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return bt(()=>!!t.isOpen())()?t.contentId():void 0},get disabled(){return t.disabled()},onClick:a=>{dt(a,n.onClick),t.toggle()}},()=>t.dataset(),r))}var Qj=Object.assign(qme,{Content:zme,Trigger:jme}),wKt=ie("<div data-slot=collapsible-arrow><span data-slot=collapsible-arrow-icon>");function xKt(e){const[t,n]=Se(e,["class","classList","variant"]);return d(Qj,f({"data-component":"collapsible",get"data-variant"(){return t.variant||"normal"},get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}},n))}function _Kt(e){return d(Qj.Trigger,f({"data-slot":"collapsible-trigger"},e))}function MKt(e){return d(Qj.Content,f({"data-slot":"collapsible-content"},e))}function SKt(e){return(()=>{var t=wKt(),n=t.firstChild;return ki(t,e||{},!1,!0),K(n,d(Kt,{name:"chevron-down",size:"small"})),t})()}const oV=Object.assign(xKt,{Arrow:SKt,Trigger:_Kt,Content:MKt});var CKt=ie("<div>"),LKt=ie("<img data-slot=avatar-image>");const Dne=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function IKt(e){return e?Dne?Dne.segment(e)[Symbol.iterator]().next().value?.segment??Array.from(e)[0]??"":Array.from(e)[0]??"":""}function NKt(e){const[t,n]=Se(e,["fallback","src","background","foreground","size","class","classList","style"]),r=t.src;return(()=>{var i=CKt();return ki(i,f(n,{"data-component":"avatar",get"data-size"(){return t.size||"normal"},"data-has-image":r?"":void 0,get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get style(){return{...typeof t.style=="object"?t.style:{},...!r&&t.background?{"--avatar-bg":t.background}:{},...!r&&t.foreground?{"--avatar-fg":t.foreground}:{}}}}),!1,!0),K(i,d(ke,{when:r,get fallback(){return IKt(t.fallback)},children:a=>(()=>{var o=LKt();return gt(o,"draggable",!1),Qe(()=>gt(o,"src",a())),o})()})),i})()}var AKt={};Ga(AKt,{Link:()=>$Kt,Root:()=>tX});function tX(e){let t;const[n,r]=Se(e,["ref","href","disabled"]),i=Z2(()=>t,()=>"a");return d(zt,f({as:"a",ref(a){var o=hn(s=>t=s,n.ref);typeof o=="function"&&o(a)},get role(){return i()!=="a"||n.disabled?"link":void 0},get tabIndex(){return i()!=="a"&&!n.disabled?0:void 0},get href(){return bt(()=>!n.disabled)()?n.href:void 0},get"aria-disabled"(){return n.disabled?!0:void 0},get"data-disabled"(){return n.disabled?"":void 0}},r))}var $Kt=tX,TKt={};Ga(TKt,{Arrow:()=>vs,Content:()=>Fme,HoverCard:()=>jp,Portal:()=>Vme,Root:()=>Bme,Trigger:()=>Ume,useHoverCardContext:()=>eH});var Hme=Tt();function eH(){const e=Lt(Hme);if(e===void 0)throw new Error("[kobalte]: `useHoverCardContext` must be used within a `HoverCard` component");return e}function Fme(e){const t=eH(),[n,r]=Se(e,["ref","style"]);return d(ke,{get when(){return t.contentPresent()},get children(){return d(Hf.Positioner,{get children(){return d(lq,f({ref(i){var a=hn(o=>{t.setContentRef(o)},n.ref);typeof a=="function"&&a(i)},disableOutsidePointerEvents:!1,get style(){return Wa({"--kb-hovercard-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},n.style)},onFocusOutside:i=>i.preventDefault(),get onDismiss(){return t.close}},()=>t.dataset(),r))}})}})}function Vme(e){const t=eH();return d(ke,{get when(){return t.contentPresent()},get children(){return d(w0,e)}})}function EKt(e,t,n){const r=e.split("-")[0],i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=[],s=i.left+i.width/2,l=i.top+i.height/2;switch(r){case"top":o.push([i.left,l]),o.push([a.left,a.bottom]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([i.right,l]);break;case"right":o.push([s,i.top]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([a.left,a.bottom]),o.push([s,i.bottom]);break;case"bottom":o.push([i.left,l]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([a.right,a.top]),o.push([i.right,l]);break;case"left":o.push([s,i.top]),o.push([a.right,a.top]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([s,i.bottom]);break}return o}function Bme(e){const t=`hovercard-${xr()}`,n=ft({id:t,openDelay:700,closeDelay:300},e),[r,i]=Se(n,["id","open","defaultOpen","onOpenChange","openDelay","closeDelay","ignoreSafeArea","forceMount"]);let a,o;const[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(i.placement),g=x0({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:A=>r.onOpenChange?.(A)}),{present:y}=i0({show:()=>r.forceMount||g.isOpen(),element:()=>c()??null}),{addGlobalListener:v,removeGlobalListener:k}=$ye(),b=()=>{a=window.setTimeout(()=>{a=void 0,g.open()},r.openDelay)},x=()=>{o=window.setTimeout(()=>{o=void 0,g.close()},r.closeDelay)},w=()=>{window.clearTimeout(a),a=void 0},M=()=>{window.clearTimeout(o),o=void 0},_=A=>Yn(s(),A)||Yn(c(),A),C=A=>{const D=s(),P=c();if(!(!D||!P))return EKt(A,D,P)},L=A=>{const D=A.target;if(_(D)){M();return}if(!r.ignoreSafeArea){const P=C(h());if(P&&VU(cre(A),P)){M();return}}o||x()};he(()=>{g.isOpen()&&(v(document,"pointermove",L,!0),me(()=>{k(document,"pointermove",L,!0)}))}),me(()=>{w(),M()});const I={dataset:Z(()=>({"data-expanded":g.isOpen()?"":void 0,"data-closed":g.isOpen()?void 0:""})),isOpen:g.isOpen,contentPresent:y,openWithDelay:b,closeWithDelay:x,cancelOpening:w,cancelClosing:M,close:g.close,isTargetOnHoverCard:_,setTriggerRef:l,setContentRef:u};return d(Hme.Provider,{value:I,get children(){return d(Hf,f({anchorRef:s,contentRef:c,onCurrentPlacementChange:m},i))}})}function Ume(e){const t=eH(),[n,r]=Se(e,["ref","onPointerEnter","onPointerLeave","onFocus","onBlur"]),i=l=>{dt(l,n.onPointerEnter),!(l.pointerType==="touch"||r.disabled||l.defaultPrevented)&&(t.cancelClosing(),t.isOpen()||t.openWithDelay())},a=l=>{dt(l,n.onPointerLeave),l.pointerType!=="touch"&&t.cancelOpening()},o=l=>{dt(l,n.onFocus),!(r.disabled||l.defaultPrevented)&&(t.cancelClosing(),t.isOpen()||t.openWithDelay())},s=l=>{dt(l,n.onBlur),t.cancelOpening();const c=l.relatedTarget;t.isTargetOnHoverCard(c)||t.closeWithDelay()};return me(t.cancelOpening),d(tX,f({ref(l){var c=hn(t.setTriggerRef,n.ref);typeof c=="function"&&c(l)},onPointerEnter:i,onPointerLeave:a,onFocus:o,onBlur:s},()=>t.dataset(),r))}var jp=Object.assign(Bme,{Arrow:vs,Content:Fme,Portal:Vme,Trigger:Ume}),PKt=ie("<div data-slot=hover-card-body>");function Wme(e){const[t,n]=Se(e,["trigger","mount","class","classList","children"]);return d(jp,f({gutter:4},n,{get children(){return[d(jp.Trigger,{as:"div","data-slot":"hover-card-trigger",tabIndex:-1,get children(){return t.trigger}}),d(jp.Portal,{get mount(){return t.mount},get children(){return d(jp.Content,{"data-component":"hover-card-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){var r=PKt();return K(r,()=>t.children),r}})}})]}}))}var DKt=ie('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 18 14"fill=none><g>'),OKt=ie("<span data-slot=diff-changes-additions>"),RKt=ie("<span data-slot=diff-changes-deletions>"),zKt=ie("<div data-component=diff-changes>"),qKt=ie("<svg><rect width=2 height=14 rx=1></svg>",!1,!0,!1);function jKt(e){const t=()=>e.variant??"default",n=Z(()=>Array.isArray(e.changes)?e.changes.reduce((u,h)=>u+(h.additions??0),0):e.changes.additions),r=Z(()=>Array.isArray(e.changes)?e.changes.reduce((u,h)=>u+(h.deletions??0),0):e.changes.deletions),i=Z(()=>(n()??0)+(r()??0)),a=Z(()=>{const h=n()??0,m=r()??0;if(h===0&&m===0)return{added:0,deleted:0,neutral:5};const g=h+m;if(g<5){const S=h>0?1:0,I=m>0?1:0,A=5-S-I;return{added:S,deleted:I,neutral:A}}const y=h>m?h/m:m/h;let v=5;(g<20||y<4)&&(v=4);const k=h/g,b=m/g,x=k*v,w=b*v;let M=h>0?Math.max(1,Math.round(x)):0,_=m>0?Math.max(1,Math.round(w)):0;h>0&&h<=5&&(M=Math.min(M,1)),h>5&&h<=10&&(M=Math.min(M,2)),m>0&&m<=5&&(_=Math.min(_,1)),m>5&&m<=10&&(_=Math.min(_,2));let C=M+_;C>v&&(x>w?M=v-_:_=v-M,C=M+_);const L=Math.max(0,5-C);return{added:M,deleted:_,neutral:L}}),o="var(--icon-diff-add-base)",s="var(--icon-diff-delete-base)",l="var(--icon-weak-base)",c=Z(()=>{const u=a();return[...Array(u.added).fill(o),...Array(u.deleted).fill(s),...Array(u.neutral).fill(l)].slice(0,5)});return d(ke,{get when(){return bt(()=>t()==="default")()?i()>0:!0},get children(){var u=zKt();return K(u,d(r0,{get children(){return[d(Zn,{get when(){return t()==="bars"},get children(){var h=DKt(),m=h.firstChild;return K(m,d(Qt,{get each(){return c()},children:(g,y)=>(()=>{var v=qKt();return gt(v,"fill",g),Qe(()=>gt(v,"x",y()*4)),v})()})),h}}),d(Zn,{get when(){return t()==="default"},get children(){return[(()=>{var h=OKt();return K(h,()=>`+${n()}`),h})(),(()=>{var h=RKt();return K(h,()=>`-${r()}`),h})()]}})]}})),Qe(h=>{var m=t(),g={[e.class??""]:!0};return m!==h.e&>(u,"data-variant",h.e=m),h.t=hr(u,g,h.t),h},{e:void 0,t:void 0}),u}})}var HKt=ie("<ul role=list data-component=message-nav>"),FKt=ie("<div data-slot=message-nav-tick-button role=button tabindex=0><div data-slot=message-nav-tick-line>"),VKt=ie("<button data-slot=message-nav-message-button><div data-slot=message-nav-title-preview>"),BKt=ie("<li data-slot=message-nav-item>"),UKt=ie("<div data-slot=message-nav-tooltip-content>");function Gme(e){const t=M0(),[n,r]=Se(e,["messages","current","size","onMessageSelect","getLabel"]),i=()=>(()=>{var a=HKt();return ki(a,f({get"data-size"(){return n.size}},r),!1,!0),K(a,d(Qt,{get each(){return n.messages},children:o=>{const s=()=>n.onMessageSelect(o),l=c=>{c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),n.onMessageSelect(o))};return(()=>{var c=BKt();return K(c,d(r0,{get children(){return[d(Zn,{get when(){return n.size==="compact"},get children(){var u=FKt();return u.$$keydown=l,u.$$click=s,Qe(()=>gt(u,"data-active",o.id===n.current?.id||void 0)),u}}),d(Zn,{get when(){return n.size==="normal"},get children(){var u=VKt(),h=u.firstChild;return u.$$keydown=l,u.$$click=s,K(u,d(jKt,{get changes(){return o.summary?.diffs??[]},variant:"bars"}),h),K(h,d(ke,{get when(){return n.getLabel?.(o)??o.summary?.title},get fallback(){return t.t("ui.messageNav.newMessage")},get children(){return n.getLabel?.(o)??o.summary?.title}})),Qe(()=>gt(h,"data-active",o.id===n.current?.id||void 0)),u}})]}})),c})()}})),a})();return d(r0,{get children(){return[d(Zn,{get when(){return n.size==="compact"},get children(){return d(Ua,{openDelay:0,placement:"right-start",gutter:-40,shift:-10,overlap:!0,contentClass:"message-nav-tooltip",get value(){return(()=>{var a=UKt();return K(a,d(Gme,f(e,{size:"normal",class:""}))),a})()},get children(){return i()}})}}),d(Zn,{get when(){return n.size==="normal"},get children(){return i()}})]}})}li(["click","keydown"]);const One={ask:"var(--icon-agent-ask-base)",build:"var(--icon-agent-build-base)",docs:"var(--icon-agent-docs-base)",plan:"var(--icon-agent-plan-base)"};function WKt(e,t){return t||(One[e]??One[e.toLowerCase()])}function GKt(e,t){if(e)for(let n=e.length-1;n>=0;n--){const r=e[n];if(!(r.role!=="user"||!r.agent))return WKt(r.agent,t.find(i=>i.name===r.agent)?.color)}}function Zme(e,t,n,r=()=>!0){if(!n)return;const i=e.reduce((l,c)=>{if(!c.parentID)return l;const u=l.get(c.parentID);return u&&u.push(c.id),u||l.set(c.parentID,[c.id]),l},new Map),a=new Set([n]),o=[n];for(const l of o){const c=i.get(l);if(c)for(const u of c)a.has(u)||(a.add(u),o.push(u))}const s=o.find(l=>t[l]?.some(r));if(s)return t[s]?.find(r)}function ZKt(e,t,n,r){return Zme(e,t,n,r)}function SQt(e,t,n,r){return Zme(e,t,n,r)}var KKt=ie("<div>"),XKt=ie('<div><div class="size-full rounded overflow-clip">'),YKt=ie('<div class="size-1.5 rounded-full bg-surface-warning-strong">'),JKt=ie('<div class="size-1.5 rounded-full bg-text-diff-delete-base">'),QKt=ie('<div class="size-1.5 rounded-full bg-text-interactive-base">'),Kme=ie('<div class="shrink-0 size-6 flex items-center justify-center">'),Xme=ie('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">'),eXt=ie('<div class="overflow-y-auto overflow-x-hidden max-h-72 h-full">'),tXt=ie('<div class="min-w-0 w-full">'),nXt=ie('<div class="text-12-regular text-text-weak">'),rXt=ie('<div class="group/session relative w-full min-w-0 rounded-md cursor-default pl-2 pr-3 transition-colors hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[[data-expanded]]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active"><div class="flex min-w-0 items-center gap-1"><div class="min-w-0 flex-1"></div><div class="shrink-0 overflow-hidden transition-[width,opacity]">'),iXt=ie('<div class="group/session relative w-full min-w-0 rounded-md cursor-default transition-colors pl-2 pr-3 hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active">'),aXt=ie('<div class="flex flex-col gap-1">'),oXt=ie('<div class="h-8 w-full rounded-md bg-surface-raised-base opacity-60 animate-pulse">');const sXt="4b0ea68d7af9a6031a7ffda7ad66e0cb83315750",nX=e=>{const t=ha(),n=Ij(),r=vK(),i=Z(()=>[e.project.worktree,...e.project.sandboxes??[]]),a=Z(()=>i().reduce((u,h)=>u+n.project.unseenCount(h),0)),o=Z(()=>i().some(u=>n.project.unseenHasError(u))),s=Z(()=>i().some(u=>{const[h]=t.child(u,{bootstrap:!1});return hKt(h.permission,m=>!r.autoResponds(m,u))})),l=Z(()=>e.notify&&(s()||a()>0)),c=Z(()=>e.project.name||Gn(e.project.worktree));return(()=>{var u=XKt(),h=u.firstChild;return K(h,d(NKt,f({get fallback(){return c()},get src(){return bt(()=>e.project.id===sXt)()?"https://opencode.ai/favicon.svg":e.project.icon?.override}},()=>cDt(e.project.icon?.color),{class:"size-full rounded",get classList(){return{"badge-mask":l()}}}))),K(u,d(ke,{get when(){return l()},get children(){var m=KKt();return Qe(g=>hr(m,{"absolute top-px right-px size-1.5 rounded-full z-10":!0,"bg-surface-warning-strong":s(),"bg-icon-critical-base":!s()&&o(),"bg-text-interactive-base":!s()&&!o()},g)),m}}),null),Qe(()=>W2(u,`relative size-8 shrink-0 rounded ${e.class??""}`)),u})()},lXt=e=>d(lG,{get href(){return`/${e.slug}/session/${e.session.id}`},get class(){return`flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${e.dense?"py-0.5":"py-1"}`},get onPointerDown(){return e.warmPress},get onPointerEnter(){return e.warmHover},get onPointerLeave(){return e.cancelHoverPrefetch},get onFocus(){return e.warmFocus},onClick:()=>{e.setHoverSession(void 0),!e.sidebarOpened()&&e.clearHoverProjectSoon()},get children(){return[(()=>{var t=Kme();return K(t,d(r0,{get fallback(){return d(Kt,{name:"dash",size:"small",class:"text-icon-weak"})},get children(){return[d(Zn,{get when(){return e.isWorking()},get children(){return d(D2,{class:"size-[15px]"})}}),d(Zn,{get when(){return e.hasPermissions()},get children(){return YKt()}}),d(Zn,{get when(){return e.hasError()},get children(){return JKt()}}),d(Zn,{get when(){return e.unseenCount()>0},get children(){return QKt()}})]}})),Qe(n=>kr(t,"color",e.tint()??"var(--icon-interactive-base)")),t})(),(()=>{var t=Xme();return K(t,()=>e.session.title),t})()]}}),cXt=e=>{let t;return d(Wme,{openDelay:1e3,get closeDelay(){return e.sidebarHovering()?600:0},placement:"right-start",gutter:16,shift:-2,get trigger(){return(()=>{var n=tXt(),r=t;return typeof r=="function"?Hr(r,n):t=n,K(n,()=>e.trigger),n})()},get open(){return e.hoverSession()===e.session.id},onOpenChange:n=>{if(!n){e.setHoverSession(void 0);return}t?.matches(":hover")&&e.setHoverSession(e.session.id)},get children(){return d(ke,{get when(){return e.hoverReady()},get fallback(){return(()=>{var n=nXt();return K(n,()=>e.language.t("session.messages.loading")),n})()},get children(){var n=eXt();return K(n,d(Gme,{get messages(){return e.hoverMessages()??[]},current:void 0,get getLabel(){return e.messageLabel},get onMessageSelect(){return e.onMessageSelect},size:"normal",class:"w-60"})),n}})}})},OU=e=>{const t=di(),n=ll(),r=If(),i=_r(),a=Ij(),o=vK(),s=ha(),l=Z(()=>a.session.unseenCount(e.session.id)),c=Z(()=>a.session.unseenHasError(e.session.id)),[u]=s.child(e.session.directory),h=Z(()=>!!ZKt(u.session,u.permission,e.session.id,I=>!o.autoResponds(I,e.session.directory))),m=Z(()=>{if(h())return!1;const I=(u.message[e.session.id]??[]).findLast(D=>D.role==="assistant"&&typeof D.time?.completed!="number"),A=u.session_status[e.session.id];return I!==void 0||A?.type==="busy"||A?.type==="retry"||A!==void 0&&A.type!=="idle"}),g=Z(()=>GKt(u.message[e.session.id],u.agent)),y=Z(()=>u.message[e.session.id]?.filter(I=>I.role==="user")),v=Z(()=>y()!==void 0),k=Z(()=>!e.mobile&&e.sidebarExpanded()),b=Z(()=>(e.popover??!0)&&k()),x=Z(()=>e.session.id===t.id),w=(I,A)=>{const D=e.navList?.(),P=D?.some(E=>E.id===e.session.id&&E.directory===e.session.directory)?D:e.list;e.prefetchSession(e.session,A);const O=P.findIndex(E=>E.id===e.session.id&&E.directory===e.session.directory);if(O!==-1)for(let E=1;E<=I;E++){const T=P[O+E];T&&e.prefetchSession(T,E===1?"high":A);const R=P[O-E];R&&e.prefetchSession(R,E===1?"high":A)}},M={current:void 0},_=()=>{M.current!==void 0&&(clearTimeout(M.current),M.current=void 0)},C=()=>{w(1,"high"),M.current===void 0&&(M.current=setTimeout(()=>{M.current=void 0,w(2,"low")},80))};me(_);const L=I=>(u.part[I.id]??[]).find(P=>P?.type==="text"&&!P.synthetic&&!P.ignored)?.text,S=d(lXt,{get session(){return e.session},get slug(){return e.slug},get mobile(){return e.mobile},get dense(){return e.dense},tint:g,isWorking:m,hasPermissions:h,hasError:c,unseenCount:l,get setHoverSession(){return e.setHoverSession},get clearHoverProjectSoon(){return e.clearHoverProjectSoon},get sidebarOpened(){return r.sidebar.opened},warmHover:C,warmPress:()=>w(2,"high"),warmFocus:()=>w(2,"high"),cancelHoverPrefetch:_});return(()=>{var I=rXt(),A=I.firstChild,D=A.firstChild,P=D.nextSibling;return K(D,d(ke,{get when(){return b()},get fallback(){return d(Ua,{get placement(){return e.mobile?"bottom":"right"},get value(){return e.session.title},gutter:10,class:"min-w-0 w-full",children:S})},get children(){return d(cXt,{get mobile(){return e.mobile},get nav(){return e.nav},get hoverSession(){return e.hoverSession},get session(){return e.session},get sidebarHovering(){return e.sidebarHovering},hoverReady:v,hoverMessages:y,language:i,isActive:x,get slug(){return e.slug},get setHoverSession(){return e.setHoverSession},messageLabel:L,onMessageSelect:O=>{x()||r.pendingMessage.set(`${St(e.session.directory)}/${e.session.id}`,O.id),n(`${e.slug}/session/${e.session.id}#message-${O.id}`)},trigger:S})}})),K(P,d(Ua,{get value(){return i.t("common.archive")},placement:"top",get children(){return d(Cr,{icon:"archive",variant:"ghost",class:"size-6 rounded-md",get"aria-label"(){return i.t("common.archive")},onClick:O=>{O.preventDefault(),O.stopPropagation(),e.archiveSession(e.session)}})}})),Qe(O=>{var E=e.session.id,T={"w-6 opacity-100 pointer-events-auto":!!e.mobile,"w-0 opacity-0 pointer-events-none":!e.mobile,"group-hover/session:w-6 group-hover/session:opacity-100 group-hover/session:pointer-events-auto":!0,"group-focus-within/session:w-6 group-focus-within/session:opacity-100 group-focus-within/session:pointer-events-auto":!0};return E!==O.e&>(I,"data-session-id",O.e=E),O.t=hr(P,T,O.t),O},{e:void 0,t:void 0}),I})()},dXt=e=>{const t=If(),r=_r().t("command.session.new"),i=()=>e.mobile||!e.sidebarExpanded(),a=d(lG,{get href(){return`/${e.slug}/session`},end:!0,get class(){return`flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${e.dense?"py-0.5":"py-1"}`},onClick:()=>{e.setHoverSession(void 0),!t.sidebar.opened()&&e.clearHoverProjectSoon()},get children(){return[(()=>{var o=Kme();return K(o,d(Kt,{name:"new-session",size:"small",class:"text-icon-weak"})),o})(),(()=>{var o=Xme();return K(o,r),o})()]}});return(()=>{var o=iXt();return K(o,d(ke,{get when(){return!i()},get fallback(){return d(Ua,{get placement(){return e.mobile?"bottom":"right"},value:r,gutter:10,class:"min-w-0 w-full",children:a})},children:a})),o})()},uXt=e=>{const t=Array.from({length:e.count??4},(n,r)=>r);return(()=>{var n=aXt();return K(n,d(Qt,{each:t,children:()=>oXt()})),n})()};var hXt=ie('<div class="bg-background-base rounded-md px-2 py-1 text-14-medium text-text-strong">'),fXt=ie('<div class="flex items-center gap-1 min-w-0 flex-1"><div class="flex items-center justify-center shrink-0 size-6"></div><span class="text-14-medium text-text-base shrink-0"> :</span><div class="flex items-center justify-center shrink-0 overflow-hidden w-0 opacity-0 transition-all duration-200 group-hover/workspace:w-3.5 group-hover/workspace:opacity-100 group-focus-within/workspace:w-3.5 group-focus-within/workspace:opacity-100">'),pXt=ie('<span class="text-14-medium text-text-base min-w-0 truncate">'),mXt=ie('<div class="absolute right-1 top-1/2 -translate-y-1/2 flex items-center gap-0.5 transition-opacity">'),gXt=ie('<div class="shrink-0 size-6 flex items-center justify-center">'),yXt=ie('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">Trellis Board'),vXt=ie('<div class="relative w-full py-1">'),kXt=ie('<nav class="flex flex-col gap-1">'),Rne=ie("<div>"),bXt=ie('<div class=py-1><div class="group/workspace relative"data-component=workspace-item><div class="flex items-center gap-1">'),wXt=ie('<div class="size-full flex flex-col py-2 overflow-y-auto no-scrollbar [overflow-anchor:none]">');const xXt=e=>{const t=ha(),n=_r(),r=Z(()=>{const i=e.sidebarProject();if(!i)return;const a=e.activeWorkspace();if(!a)return;const[o]=t.child(a,{bootstrap:!1}),s=a===i.worktree?n.t("workspace.type.local"):n.t("workspace.type.sandbox"),l=e.workspaceLabel(a,o.vcs?.branch,i.id);return`${s} : ${l}`});return d(ke,{get when(){return r()},children:i=>(()=>{var a=hXt();return K(a,i),a})()})},_Xt=e=>(()=>{var t=fXt(),n=t.firstChild,r=n.nextSibling,i=r.firstChild,a=r.nextSibling;return K(n,d(ke,{get when(){return e.busy()},get fallback(){return d(Kt,{name:"branch",size:"small"})},get children(){return d(D2,{class:"size-[15px]"})}})),K(r,(()=>{var o=bt(()=>!!e.local());return()=>o()?e.language.t("workspace.type.local"):e.language.t("workspace.type.sandbox")})(),i),K(t,d(ke,{get when(){return!e.local()},get fallback(){return(()=>{var o=pXt();return K(o,()=>e.branch()??Gn(e.directory)),o})()},get children(){return d(e.InlineEditor,{get id(){return`workspace:${e.directory}`},get value(){return e.workspaceValue},onSave:o=>{const s=o.trim();s&&(e.renameWorkspace(e.directory,s,e.projectId,e.branch()),e.setEditor("value",e.workspaceValue()))},class:"text-14-medium text-text-base min-w-0 truncate",displayClass:"text-14-medium text-text-base min-w-0 truncate",get editing(){return e.workspaceEditActive()},stopPropagation:!1,openOnDblClick:!1})}}),a),K(a,d(Kt,{get name(){return e.open()?"chevron-down":"chevron-right"},size:"small",class:"text-icon-base"})),t})(),MXt=e=>(()=>{var t=mXt();return K(t,d(Mt,{get modal(){return!e.sidebarHovering()},get open(){return e.menuOpen()},onOpenChange:n=>e.setMenuOpen(n),get children(){return[d(Ua,{get value(){return e.language.t("common.moreOptions")},placement:"top",get children(){return d(Mt.Trigger,{as:Cr,icon:"dot-grid",variant:"ghost",class:"size-6 rounded-md","data-action":"workspace-menu",get"data-workspace"(){return St(e.directory)},get"aria-label"(){return e.language.t("common.moreOptions")}})}}),d(Mt.Portal,{get children(){return d(Mt.Content,{onCloseAutoFocus:n=>{e.pendingRename()&&(n.preventDefault(),e.setPendingRename(!1),e.openEditor(`workspace:${e.directory}`,e.workspaceValue()))},get children(){return[d(Mt.Item,{get disabled(){return e.local()},onSelect:()=>{e.setPendingRename(!0),e.setMenuOpen(!1)},get children(){return d(Mt.ItemLabel,{get children(){return e.language.t("common.rename")}})}}),d(Mt.Item,{get disabled(){return e.local()||e.busy()},onSelect:()=>e.showResetWorkspaceDialog(e.root,e.directory),get children(){return d(Mt.ItemLabel,{get children(){return e.language.t("common.reset")}})}}),d(Mt.Item,{get disabled(){return e.local()||e.busy()},onSelect:()=>e.showDeleteWorkspaceDialog(e.root,e.directory),get children(){return d(Mt.ItemLabel,{get children(){return e.language.t("common.delete")}})}})]}})}})]}}),null),K(t,d(ke,{get when(){return!e.touch()},get children(){return d(Ua,{get value(){return e.language.t("command.session.new")},placement:"top",get children(){return d(Cr,{icon:"new-session",variant:"ghost",class:"size-6 rounded-md opacity-0 pointer-events-none group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto","data-action":"workspace-new-session",get"data-workspace"(){return St(e.directory)},get"aria-label"(){return e.language.t("command.session.new")},onClick:n=>{n.preventDefault(),n.stopPropagation(),e.setHoverSession(void 0),e.clearHoverProjectSoon(),e.navigateToNewSession()}})}})}}),null),Qe(n=>hr(t,{"opacity-100 pointer-events-auto":e.menuOpen(),"opacity-0 pointer-events-none":!e.menuOpen(),"group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto":!0,"group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto":!0},n)),t})(),Yme=e=>(()=>{var t=kXt();return K(t,d(lG,{get href(){return`/${e.slug()}/trellis`},class:"flex items-center gap-1 min-w-0 w-full text-left py-1 rounded-md px-2 pr-3 hover:bg-surface-raised-base-hover [&.active]:bg-surface-base-active",onClick:()=>{e.ctx.setHoverSession(void 0),e.ctx.clearHoverProjectSoon()},get children(){return[(()=>{var n=gXt();return K(n,d(Kt,{name:"checklist",size:"small",class:"text-icon-weak"})),n})(),yXt()]}}),null),K(t,d(ke,{get when(){return e.showNew()},get children(){return d(dXt,{get slug(){return e.slug()},get mobile(){return e.mobile},get sidebarExpanded(){return e.ctx.sidebarExpanded},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},get setHoverSession(){return e.ctx.setHoverSession}})}}),null),K(t,d(ke,{get when(){return e.loading()},get children(){return d(uXt,{})}}),null),K(t,d(Qt,{get each(){return e.sessions()},children:n=>d(OU,{session:n,get list(){return e.sessions()},get navList(){return e.ctx.navList},get slug(){return e.slug()},get mobile(){return e.mobile},get popover(){return e.popover},get children(){return e.children()},get sidebarExpanded(){return e.ctx.sidebarExpanded},get sidebarHovering(){return e.ctx.sidebarHovering},get nav(){return e.ctx.nav},get hoverSession(){return e.ctx.hoverSession},get setHoverSession(){return e.ctx.setHoverSession},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},get prefetchSession(){return e.ctx.prefetchSession},get archiveSession(){return e.ctx.archiveSession}})}),null),K(t,d(ke,{get when(){return e.hasMore()},get children(){var n=vXt();return K(n,d(Mn,{variant:"ghost",class:"flex w-full text-left justify-start text-14-regular text-text-weak pl-9 pr-10",size:"large",onClick:r=>{e.loadMore(),r.currentTarget.blur()},get children(){return e.language.t("common.loadMore")}})),n}}),null),t})(),SXt=e=>{const t=ll(),n=di(),r=ha(),i=_r(),a=Ame(e.directory),[o,s]=r.child(e.directory,{bootstrap:!1}),[l,c]=nt({open:!1,pendingRename:!1}),u=Z(()=>St(e.directory)),h=Z(()=>F2(o,e.sortNow())),m=Z(()=>nq(o.session)),g=Z(()=>e.directory===e.project.worktree),y=Z(()=>tt(e.ctx.currentDir())===tt(e.directory)),v=Z(()=>{const E=o.vcs?.branch,T=E??Gn(e.directory);return e.ctx.workspaceName(e.directory,e.project.id,E)??T}),k=Z(()=>e.ctx.workspaceExpanded(e.directory,g())),b=Z(()=>k()||y()),x=Z(E=>E||o.status==="complete",!1),w=Z(()=>h()?.length??0),M=Z(()=>o.sessionTotal>w()),_=Z(()=>e.ctx.isBusy(e.directory)),C=Z(E=>E||_(),!1),L=Z(()=>k()&&!x()&&w()===0&&!C()),S=zU("(hover: none)"),I=Z(()=>!L()&&(S()||w()===0||y()&&!n.id)),A=async()=>{s("limit",E=>(E??0)+5),await r.project.loadSessions(e.directory)},D=Z(()=>e.ctx.editorOpen(`workspace:${e.directory}`)),P=()=>d(_Xt,{local:g,busy:_,open:k,get directory(){return e.directory},language:i,branch:()=>o.vcs?.branch,workspaceValue:v,workspaceEditActive:D,get InlineEditor(){return e.ctx.InlineEditor},get renameWorkspace(){return e.ctx.renameWorkspace},get setEditor(){return e.ctx.setEditor},get projectId(){return e.project.id}}),O=E=>{e.ctx.setWorkspaceExpanded(e.directory,E),!E&&e.ctx.editorOpen(`workspace:${e.directory}`)&&e.ctx.closeEditor()};return he(()=>{b()&&r.child(e.directory,{bootstrap:!0})}),(()=>{var E=Rne();return Hr(a,E,()=>!0),K(E,d(oV,{variant:"ghost",get open(){return k()},class:"shrink-0",onOpenChange:O,get children(){return[(()=>{var T=bXt(),R=T.firstChild,H=R.firstChild;return K(H,d(ke,{get when(){return D()},get fallback(){return d(oV.Trigger,{get class(){return`flex items-center justify-between w-full pl-2 py-1.5 rounded-md hover:bg-surface-raised-base-hover transition-[padding] duration-200 ${l.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`},"data-action":"workspace-toggle",get"data-workspace"(){return St(e.directory)},get children(){return P()}})},get children(){var Y=Rne();return K(Y,P),Qe(()=>W2(Y,`flex items-center justify-between w-full pl-2 py-1.5 rounded-md transition-[padding] duration-200 ${l.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`)),Y}}),null),K(H,d(MXt,{get directory(){return e.directory},local:g,busy:_,menuOpen:()=>l.open,pendingRename:()=>l.pendingRename,setMenuOpen:Y=>c("open",Y),setPendingRename:Y=>c("pendingRename",Y),get sidebarHovering(){return e.ctx.sidebarHovering},touch:S,language:i,workspaceValue:v,get openEditor(){return e.ctx.openEditor},get showResetWorkspaceDialog(){return e.ctx.showResetWorkspaceDialog},get showDeleteWorkspaceDialog(){return e.ctx.showDeleteWorkspaceDialog},get root(){return e.project.worktree},get setHoverSession(){return e.ctx.setHoverSession},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},navigateToNewSession:()=>t(`/${u()}/session?new=1`)}),null),Qe(()=>gt(R,"data-workspace",St(e.directory))),T})(),d(oV.Content,{get children(){return d(Yme,{slug:u,get mobile(){return e.mobile},get popover(){return e.popover},get ctx(){return e.ctx},showNew:I,loading:L,sessions:h,children:m,hasMore:M,loadMore:A,language:i})}})]}})),Qe(T=>hr(E,{"opacity-30":a.isActiveDraggable,"opacity-50 pointer-events-none":_()},T)),E})()},CXt=e=>{const t=ha(),n=_r(),r=Z(()=>{const[m,g]=t.child(e.project.worktree);return{store:m,setStore:g}}),i=Z(()=>St(e.project.worktree)),a=Z(()=>F2(r().store,e.sortNow())),o=Z(()=>nq(r().store.session)),s=Z(m=>m||r().store.status==="complete",!1),l=Z(()=>a()?.length??0),c=Z(()=>!s()&&l()===0),u=Z(()=>r().store.sessionTotal>l()),h=async()=>{r().setStore("limit",m=>(m??0)+5),await t.project.loadSessions(e.project.worktree)};return(()=>{var m=wXt();return Hr(g=>e.ctx.setScrollContainerRef(g,e.mobile),m),K(m,d(Yme,{slug:i,get mobile(){return e.mobile},get popover(){return e.popover},get ctx(){return e.ctx},showNew:()=>!1,loading:c,sessions:a,children:o,hasMore:u,loadMore:h,language:n})),m})()};var LXt={};Ga(LXt,{Arrow:()=>vs,CheckboxItem:()=>zj,Content:()=>Jme,ContextMenu:()=>tr,Group:()=>Nm,GroupLabel:()=>qj,Icon:()=>jj,Item:()=>Hj,ItemDescription:()=>Fj,ItemIndicator:()=>Vj,ItemLabel:()=>Bj,Portal:()=>Uj,RadioGroup:()=>Wj,RadioItem:()=>Gj,Root:()=>tge,Separator:()=>Ff,Sub:()=>Zj,SubContent:()=>Kj,SubTrigger:()=>Xj,Trigger:()=>nge,useContextMenuContext:()=>ege});function Jme(e){const t=fa(),[n,r]=Se(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return d(gme,f({onCloseAutoFocus:s=>{n.onCloseAutoFocus?.(s),!s.defaultPrevented&&i&&s.preventDefault(),i=!1},onInteractOutside:s=>{n.onInteractOutside?.(s),!s.defaultPrevented&&!t.isModal()&&(i=!0)}},r))}var Qme=Tt();function IXt(){return Lt(Qme)}function ege(){const e=IXt();if(e===void 0)throw new Error("[kobalte]: `useContextMenuContext` must be used within a `ContextMenu` component");return e}function tge(e){const t=`contextmenu-${xr()}`,{direction:n}=gs(),r=ft({id:t,placement:n()==="rtl"?"left-start":"right-start",gutter:2,shift:2},e),[i,a]=Se(r,["onOpenChange"]),[o,s]=Ce({x:0,y:0}),l=x0({defaultOpen:!1,onOpenChange:u=>i.onOpenChange?.(u)}),c={setAnchorRect:s};return d(Qme.Provider,{value:c,get children(){return d(bme,f({get open(){return l.isOpen()},get onOpenChange(){return l.setIsOpen},getAnchorRect:o},a))}})}function nge(e){const t=fa(),n=Po(),r=ege(),i=ft({id:t.generateId("trigger")},e),[a,o]=Se(i,["ref","style","disabled","onContextMenu","onPointerDown","onPointerMove","onPointerCancel","onPointerUp"]);let s=0;const l=()=>{window.clearTimeout(s)};me(()=>{l()});const c=v=>{if(a.disabled){dt(v,a.onContextMenu);return}l(),v.preventDefault(),v.stopPropagation(),r.setAnchorRect({x:v.clientX,y:v.clientY}),n.isOpen()?n.focusContent():n.open(!0)},u=v=>v.pointerType==="touch"||v.pointerType==="pen";return d(zt,f({as:"div",ref(v){var k=hn(n.setTriggerRef,a.ref);typeof k=="function"&&k(v)},get style(){return Wa({"-webkit-touch-callout":"none"},a.style)},get"data-disabled"(){return a.disabled?"":void 0},onContextMenu:c,onPointerDown:v=>{dt(v,a.onPointerDown),!a.disabled&&u(v)&&(l(),r.setAnchorRect({x:v.clientX,y:v.clientY}),s=window.setTimeout(()=>n.open(!1),700))},onPointerMove:v=>{dt(v,a.onPointerMove),!a.disabled&&u(v)&&l()},onPointerCancel:v=>{dt(v,a.onPointerCancel),!a.disabled&&u(v)&&l()},onPointerUp:v=>{dt(v,a.onPointerUp),!a.disabled&&u(v)&&l()}},()=>n.dataset(),o))}var tr=Object.assign(tge,{Arrow:vs,CheckboxItem:zj,Content:Jme,Group:Nm,GroupLabel:qj,Icon:jj,Item:Hj,ItemDescription:Fj,ItemIndicator:Vj,ItemLabel:Bj,Portal:Uj,RadioGroup:Wj,RadioItem:Gj,Separator:Ff,Sub:Zj,SubContent:Kj,SubTrigger:Xj,Trigger:nge});function NXt(e){return d(tr,f(e,{"data-component":"context-menu"}))}function AXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.Trigger,f(n,{"data-slot":"context-menu-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function $Xt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.Icon,f(n,{"data-slot":"context-menu-icon",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function TXt(e){return d(tr.Portal,e)}function EXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.Content,f(n,{"data-component":"context-menu-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function PXt(e){const[t,n]=Se(e,["class","classList"]);return d(tr.Arrow,f(n,{"data-slot":"context-menu-arrow",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function DXt(e){const[t,n]=Se(e,["class","classList"]);return d(tr.Separator,f(n,{"data-slot":"context-menu-separator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function OXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.Group,f(n,{"data-slot":"context-menu-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function RXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.GroupLabel,f(n,{"data-slot":"context-menu-group-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function zXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.Item,f(n,{"data-slot":"context-menu-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function qXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.ItemLabel,f(n,{"data-slot":"context-menu-item-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function jXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.ItemDescription,f(n,{"data-slot":"context-menu-item-description",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function HXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.ItemIndicator,f(n,{"data-slot":"context-menu-item-indicator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function FXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.RadioGroup,f(n,{"data-slot":"context-menu-radio-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function VXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.RadioItem,f(n,{"data-slot":"context-menu-radio-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function BXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.CheckboxItem,f(n,{"data-slot":"context-menu-checkbox-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function UXt(e){return d(tr.Sub,e)}function WXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.SubTrigger,f(n,{"data-slot":"context-menu-sub-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function GXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.SubContent,f(n,{"data-component":"context-menu-sub-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}const Li=Object.assign(NXt,{Trigger:AXt,Icon:$Xt,Portal:TXt,Content:EXt,Arrow:PXt,Separator:DXt,Group:OXt,GroupLabel:RXt,Item:zXt,ItemLabel:qXt,ItemDescription:jXt,ItemIndicator:HXt,RadioGroup:FXt,RadioItem:VXt,CheckboxItem:BXt,Sub:UXt,SubTrigger:WXt,SubContent:GXt});var ZXt=ie('<div class="bg-background-base rounded-xl p-1">'),KXt=ie('<div class="-m-3 p-2 flex flex-col w-72"><div class="px-4 pt-2 pb-1 flex items-center gap-2"><div class="text-14-medium text-text-strong truncate grow"></div></div><div class="px-4 pb-2 text-12-medium text-text-weak"></div><div class="px-2 pb-2 flex flex-col gap-2"></div><div class="px-2 py-2 border-t border-border-weak-base">'),XXt=ie('<div class="flex flex-col gap-1"><div class="px-2 py-0.5 flex items-center gap-1 min-w-0"><div class="shrink-0 size-6 flex items-center justify-center"></div><span class="truncate text-14-medium text-text-base">'),YXt=ie("<div>");const JXt=e=>{const t=Z(()=>e.projects().find(n=>n.worktree===e.activeProject()));return d(ke,{get when(){return t()},children:n=>(()=>{var r=ZXt();return K(r,d(nX,{get project(){return n()}})),r})()})},QXt=e=>{const t=Ij(),n=If(),r=Z(()=>e.dirs().reduce((a,o)=>a+t.project.unseenCount(o),0)),i=()=>e.dirs().filter(a=>t.project.unseenCount(a)>0).forEach(a=>t.project.markViewed(a));return d(Li,{get modal(){return!e.sidebarHovering()},onOpenChange:a=>{e.setMenu(a),e.setSuppressHover(a),a&&e.setOpen(!1)},get children(){return[d(Li.Trigger,{as:"button",type:"button",get"aria-label"(){return QK(e.project)},"data-action":"project-switch",get"data-project"(){return St(e.project.worktree)},get classList(){return{"flex items-center justify-center size-10 p-1 rounded-lg overflow-hidden transition-colors cursor-default":!0,"bg-transparent border-2 border-icon-strong-base hover:bg-surface-base-hover":e.selected(),"bg-transparent border border-transparent hover:bg-surface-base-hover hover:border-border-weak-base":!e.selected()&&!e.active(),"bg-surface-base-hover border border-border-weak-base":!e.selected()&&e.active()}},onPointerDown:a=>{if(a.button===0&&!a.ctrlKey){e.setOpen(!1),e.setSuppressHover(!0);return}e.overlay()&&(a.button!==2&&!(a.button===0&&a.ctrlKey)||(e.setOpen(!1),e.setSuppressHover(!0),a.preventDefault()))},onMouseEnter:a=>{e.overlay()&&(e.suppressHover()||e.onProjectMouseEnter(e.project.worktree,a))},onMouseLeave:()=>{e.suppressHover()&&e.setSuppressHover(!1),e.overlay()&&e.onProjectMouseLeave(e.project.worktree)},onFocus:()=>{e.overlay()&&(e.suppressHover()||e.onProjectFocus(e.project.worktree))},onClick:()=>{if(e.setOpen(!1),e.selected()){n.sidebar.toggle();return}e.navigateToProject(e.project.worktree)},onBlur:()=>e.setOpen(!1),get children(){return d(nX,{get project(){return e.project},notify:!0})}}),d(Li.Portal,{get children(){return d(Li.Content,{get children(){return[d(Li.Item,{onSelect:()=>e.showEditProjectDialog(e.project),get children(){return d(Li.ItemLabel,{get children(){return e.language.t("common.edit")}})}}),d(Li.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return St(e.project.worktree)},get disabled(){return bt(()=>e.project.vcs!=="git")()&&!e.workspacesEnabled(e.project)},onSelect:()=>e.toggleProjectWorkspaces(e.project),get children(){return d(Li.ItemLabel,{get children(){return bt(()=>!!e.workspacesEnabled(e.project))()?e.language.t("sidebar.workspaces.disable"):e.language.t("sidebar.workspaces.enable")}})}}),d(Li.Item,{"data-action":"project-clear-notifications",get"data-project"(){return St(e.project.worktree)},get disabled(){return r()===0},onSelect:i,get children(){return d(Li.ItemLabel,{get children(){return e.language.t("sidebar.project.clearNotifications")}})}}),d(Li.Separator,{}),d(Li.Item,{"data-action":"project-close-menu",get"data-project"(){return St(e.project.worktree)},onSelect:()=>e.closeProject(e.project.worktree),get children(){return d(Li.ItemLabel,{get children(){return e.language.t("common.close")}})}})]}})}})]}})},eYt=e=>(()=>{var t=KXt(),n=t.firstChild,r=n.firstChild,i=n.nextSibling,a=i.nextSibling,o=a.nextSibling;return K(r,()=>QK(e.project)),K(i,()=>e.language.t("sidebar.project.recentSessions")),K(a,d(ke,{get when(){return e.workspaceEnabled()},get fallback(){return d(Qt,{get each(){return e.projectSessions().slice(0,2)},children:s=>d(OU,f(()=>e.ctx.sessionProps,{session:s,get list(){return e.projectSessions()},get slug(){return St(e.project.worktree)},dense:!0,get mobile(){return e.mobile},popover:!1,get children(){return e.projectChildren()}}))})},get children(){return d(Qt,{get each(){return e.workspaces()},children:s=>{const l=Z(()=>e.workspaceSessions(s)),c=Z(()=>e.workspaceChildren(s));return(()=>{var u=XXt(),h=u.firstChild,m=h.firstChild,g=m.nextSibling;return K(m,d(Kt,{name:"branch",size:"small",class:"text-icon-base"})),K(g,()=>e.label(s)),K(u,d(Qt,{get each(){return l().slice(0,2)},children:y=>d(OU,f(()=>e.ctx.sessionProps,{session:y,get list(){return l()},get slug(){return St(s)},dense:!0,get mobile(){return e.mobile},popover:!1,get children(){return c()}}))}),null),u})()}})}})),K(o,d(Mn,{variant:"ghost",class:"flex w-full text-left justify-start text-text-base px-2 hover:bg-transparent active:bg-transparent",onClick:()=>{e.ctx.openSidebar(),e.ctx.onHoverOpenChanged(e.project.worktree,!1),!e.selected()&&e.ctx.navigateToProject(e.project.worktree)},get children(){return e.language.t("sidebar.project.viewAllSessions")}})),t})(),tYt=e=>{const t=ha(),n=_r(),r=Ame(e.project.worktree),i=Z(()=>e.ctx.currentProject()?.worktree===e.project.worktree),a=Z(()=>e.ctx.workspaceIds(e.project).slice(0,2)),o=Z(()=>e.ctx.workspacesEnabled(e.project)),s=Z(()=>e.ctx.workspaceIds(e.project)),[l,c]=nt({menu:!1,suppressHover:!1}),u=()=>e.ctx.hoverProject()===e.project.worktree,h=Z(()=>!e.mobile&&e.ctx.sidebarOpened()),m=Z(()=>!e.mobile&&!e.ctx.sidebarOpened()),g=Z(()=>l.menu||(h()||m())&&u()),y=()=>u()&&h()&&!i()&&!l.menu,v=C=>{const[L]=t.child(C,{bootstrap:!1}),S=C===e.project.worktree?n.t("workspace.type.local"):n.t("workspace.type.sandbox"),I=e.ctx.workspaceLabel(C,L.vcs?.branch,e.project.id);return`${S} : ${I}`},k=Z(()=>t.child(e.project.worktree,{bootstrap:!1})[0]),b=Z(()=>F2(k(),e.sortNow())),x=Z(()=>nq(k().session)),w=C=>{const[L]=t.child(C,{bootstrap:!1});return F2(L,e.sortNow())},M=C=>{const[L]=t.child(C,{bootstrap:!1});return nq(L.session)},_=()=>d(QXt,{get project(){return e.project},get mobile(){return e.mobile},get nav(){return e.ctx.nav},get sidebarHovering(){return e.ctx.sidebarHovering},selected:i,active:g,overlay:m,suppressHover:()=>l.suppressHover,dirs:s,get onProjectMouseEnter(){return e.ctx.onProjectMouseEnter},get onProjectMouseLeave(){return e.ctx.onProjectMouseLeave},get onProjectFocus(){return e.ctx.onProjectFocus},get navigateToProject(){return e.ctx.navigateToProject},get showEditProjectDialog(){return e.ctx.showEditProjectDialog},get toggleProjectWorkspaces(){return e.ctx.toggleProjectWorkspaces},get workspacesEnabled(){return e.ctx.workspacesEnabled},get closeProject(){return e.ctx.closeProject},setMenu:C=>c("menu",C),setOpen:C=>e.ctx.onHoverOpenChanged(e.project.worktree,C),setSuppressHover:C=>c("suppressHover",C),language:n});return(()=>{var C=YXt();return Hr(r,C,()=>!0),K(C,d(ke,{get when(){return bt(()=>!!h())()&&!i()},get fallback(){return _()},get children(){return d(Wme,{get open(){return bt(()=>!!(!l.suppressHover&&y()))()&&!l.menu},openDelay:0,closeDelay:0,placement:"right-start",gutter:6,get trigger(){return _()},onOpenChange:L=>{l.menu||L&&l.suppressHover||(e.ctx.onHoverOpenChanged(e.project.worktree,L),L&&e.ctx.setHoverSession(void 0))},get children(){return d(eYt,{get project(){return e.project},get mobile(){return e.mobile},selected:i,workspaceEnabled:o,workspaces:a,label:v,projectSessions:b,projectChildren:x,workspaceSessions:w,workspaceChildren:M,get ctx(){return e.ctx},language:n})}})}})),Qe(()=>C.classList.toggle("opacity-30",!!r.isActiveDraggable)),C})()};var nYt=ie('<div class="h-full w-full flex flex-col items-center gap-3 px-3 py-3 overflow-y-auto no-scrollbar">'),rYt=ie('<div class="flex h-full w-full min-w-0 overflow-hidden"><div data-component=sidebar-rail class="w-16 shrink-0 bg-background-base flex flex-col items-center overflow-hidden"><div class="flex-1 min-h-0 w-full"></div><div class="shrink-0 w-full pt-3 pb-6 flex flex-col items-center gap-2"></div></div><div>'),iYt=ie('<span class="text-icon-base text-12-medium">'),aYt=ie('<div class="flex items-center gap-2"><span>');const oYt=e=>{const t=Z(()=>!!e.mobile||e.opened()),n=()=>e.mobile?"bottom":"right";let r;return he(()=>{const i=r;if(i){if(t()){i.removeAttribute("inert");return}i.setAttribute("inert","")}}),(()=>{var i=rYt(),a=i.firstChild,o=a.firstChild,s=o.nextSibling,l=a.nextSibling;return Y1(a,"mousemove",e.aimMove,!0),K(o,d(Sme,{get onDragStart(){return e.handleDragStart},get onDragEnd(){return e.handleDragEnd},get onDragOver(){return e.handleDragOver},collisionDetector:_me,get children(){return[d(Cme,{}),d(Eme,{}),(()=>{var c=nYt();return K(c,d(Nme,{get ids(){return e.projects().map(u=>u.worktree)},get children(){return d(Qt,{get each(){return e.projects()},children:u=>e.renderProject(u)})}}),null),K(c,d(Ua,{get placement(){return n()},get value(){return(()=>{var u=aYt(),h=u.firstChild;return K(h,()=>e.openProjectLabel),K(u,d(ke,{get when(){return bt(()=>!e.mobile)()&&!!e.openProjectKeybind()},get children(){var m=iYt();return K(m,()=>e.openProjectKeybind()),m}}),null),u})()},get children(){return d(Cr,{icon:"plus",variant:"ghost",size:"large",get onClick(){return e.onOpenProject},get"aria-label"(){return bt(()=>typeof e.openProjectLabel=="string")()?e.openProjectLabel:void 0}})}}),null),c})(),d(Lme,{get children(){return e.renderProjectOverlay()}})]}})),K(s,d(eme,{get placement(){return n()},get title(){return e.settingsLabel()},get keybind(){return e.settingsKeybind()??""},get children(){return d(Cr,{icon:"settings-gear",variant:"ghost",size:"large",get onClick(){return e.onOpenSettings},get"aria-label"(){return e.settingsLabel()}})}}),null),K(s,d(Ua,{get placement(){return n()},get value(){return e.helpLabel()},get children(){return d(Cr,{icon:"help",variant:"ghost",size:"large",get onClick(){return e.onOpenHelp},get"aria-label"(){return e.helpLabel()}})}}),null),Hr(c=>{r=c},l),K(l,()=>e.renderPanel()),Qe(c=>{var u={"flex-1 flex h-full min-h-0 min-w-0 overflow-hidden":!0,"pointer-events-none":!t()},h=!t();return c.e=hr(l,u,c.e),h!==c.t&>(l,"aria-hidden",c.t=h),c},{e:void 0,t:void 0}),i})()};li(["mousemove"]);var sYt=ie('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"></span></div><div class="flex justify-end gap-2">'),lYt=ie('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"> <!> </span></div><div class="flex justify-end gap-2">'),cYt=ie('<span class="text-12-regular text-text-base truncate select-text">'),dYt=ie('<div class="shrink-0 pl-1 py-1"><div class="group/project flex items-start justify-between gap-2 py-2 pl-2 pr-0"><div class="flex flex-col min-w-0">'),zne=ie('<div class="shrink-0 py-4">'),uYt=ie('<div class="relative flex-1 min-h-0"><div class="size-full flex flex-col py-2 gap-4 overflow-y-auto no-scrollbar [overflow-anchor:none]">'),hYt=ie('<div class="flex-1 min-h-0 flex flex-col">'),fYt=ie('<div><div class="shrink-0 px-3 py-3"><div class="rounded-xl bg-background-base shadow-xs-border-base"data-component=getting-started><div class="p-3 flex flex-col gap-6"><div class="flex flex-col gap-2"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div></div><div data-component=getting-started-actions>'),pYt=ie('<div class="flex-1 min-h-0 -mt-4 flex items-center justify-center px-6 pb-64 text-center"><div class="mt-8 flex max-w-60 flex-col items-center gap-6 text-center"><div class="flex flex-col gap-3"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)>'),mYt=ie('<div class="flex-1 min-h-0">'),gYt=ie('<div class=" hidden w-12 shrink-0 bg-background-base flex flex-col items-center py-2 gap-2 z-20"><div class="flex-1 w-full flex flex-col items-center gap-1 overflow-y-auto no-scrollbar"><button type=button class="flex items-center justify-center size-9 p-1 rounded-md transition-colors hover:bg-surface-base-hover"></button></div><div class="shrink-0 w-full flex flex-col items-center gap-1 pb-2"><button type=button class="flex items-center justify-center size-9 p-1 rounded-md transition-colors hover:bg-surface-base-hover">'),qne=ie("<div class=size-full>"),yYt=ie('<div class="relative bg-background-base flex-1 min-h-0 min-w-0 flex flex-col select-none [&_input]:select-text [&_textarea]:select-text [&_[contenteditable]]:select-text"><div class="flex-1 min-h-0 min-w-0 flex overflow-hidden"><div class="flex-1 min-h-0 relative"><div class="size-full relative overflow-x-hidden"><div class=xl:hidden><div></div><nav data-component=sidebar-nav-mobile></nav></div><div><main>'),vYt=ie('<button type=button class="flex items-center justify-center size-9 p-0.5 rounded-md transition-colors">');function kYt(e){const[t,n,,r]=Jn(In.global("layout.page",["layout.page.v1"]),nt({lastProjectSession:{},activeProject:void 0,activeWorkspace:void 0,workspaceOrder:{},workspaceName:{},workspaceBranchName:{},workspaceExpanded:{},gettingStartedDismissed:!1,activityBarVisible:!0,statusBarVisible:!0,minimapVisible:!1,panelMaximized:!1,panelPosition:"bottom",panelAlignment:"center"})),i=Z(()=>r());let a,o=0,s=!1;const l=di(),c=E0(),u=ha(),h=If(),m=Z(()=>h.ready()),g=ms(),y=sm(),v=T0(),k=Ij(),b=vK(),x=ll();HZt(x);const w=yK(),M=lf(),_=Ice(),C=ule(),L=_r(),S=xo(l.dir),I=Z(()=>{const B=l.dir;if(!B)return{slug:B,dir:""};const F=xo(B);return F?{slug:B,dir:u.peek(F,{bootstrap:!1})[0].path.directory||F}:{slug:B,dir:""}}),A=Z(()=>C.ids().map(B=>[B,C.themes()[B]])),D=["system","light","dark"],P={system:"theme.scheme.system",light:"theme.scheme.light",dark:"theme.scheme.dark"},O=B=>L.t(P[B]),E=Z(()=>I().dir),[T,R]=nt({autoselect:!S,busyWorkspaces:{},hoverSession:void 0,hoverProject:void 0,scrollSessionKey:void 0,nav:void 0,sortNow:Date.now(),sizing:!1,peek:void 0,peeked:!1}),H=kKt(),Y=(B,F)=>{const re=tt(B);if(F){R("busyWorkspaces",re,!0);return}R("busyWorkspaces",Je(fe=>{delete fe[re]}))},j=B=>!!T.busyWorkspaces[tt(B)],X=()=>T.sortNow;let W;const G=setTimeout(()=>{R("sortNow",Date.now()),W=setInterval(()=>R("sortNow",Date.now()),6e4)},6e4-Date.now()%6e4),J=jZt({enabled:()=>!h.sidebar.opened(),active:()=>T.hoverProject,el:()=>T.nav?.querySelector("[data-component='sidebar-rail']")??T.nav,onActivate:B=>{u.child(B),R("hoverProject",B),R("hoverSession",void 0)}});me(()=>{s=!0,o+=1,clearTimeout(G),W&&clearInterval(W),Ee!==void 0&&clearTimeout(Ee),J.reset()}),dn(()=>{const B=()=>R("sizing",!1),F=()=>pe(),re=()=>{document.visibilityState==="hidden"&&pe()};window.addEventListener("pointerup",B),window.addEventListener("pointercancel",B),window.addEventListener("blur",B),window.addEventListener("blur",F),document.addEventListener("visibilitychange",re),me(()=>{window.removeEventListener("pointerup",B),window.removeEventListener("pointercancel",B),window.removeEventListener("blur",B),window.removeEventListener("blur",F),document.removeEventListener("visibilitychange",re)})});const oe=Z(()=>!h.sidebar.opened()&&T.hoverProject!==void 0),de=Z(()=>h.sidebar.opened()||oe()),ye=B=>{R("hoverProject",B),J.reset()},ve=()=>queueMicrotask(()=>ye(void 0)),le=B=>R("hoverSession",B),pe=()=>{R("hoverSession",void 0),ye(void 0)};let Ee;const Re=Z(()=>{const B=T.hoverProject;if(B)return h.projects.list().find(F=>F.worktree===B)});Z(()=>{const B=T.peek;if(B)return h.projects.list().find(F=>F.worktree===B)}),he(()=>{const B=Re();if(B){Ee!==void 0&&(clearTimeout(Ee),Ee=void 0),R("peek",B.worktree),R("peeked",!0);return}R("peeked",!1),T.peek!==void 0&&(Ee!==void 0&&clearTimeout(Ee),Ee=window.setTimeout(()=>{Ee=void 0,R("peek",void 0)},180))}),he(()=>{h.sidebar.opened()&&ye(void 0)}),he(()=>{if(!T.autoselect)return;const B=l.dir;!B||!xo(B)||R("autoselect",!1)});const wt=H.editorOpen,Ue=H.openEditor,V=H.closeEditor,Fe=H.setEditor,ze=H.InlineEditor,At=()=>{h.sidebar.opened()||pe()},De=B=>{At(),x(B),h.mobileSidebar.hide()};function Nt(B=1){const F=A().map(([ge])=>ge);if(F.length===0)return;const re=F.indexOf(C.themeId()),fe=re===-1?0:(re+B+F.length)%F.length,_e=F[fe];C.setTheme(_e),lr({title:L.t("toast.theme.title"),description:C.name(_e)})}function jn(B=1){const F=C.colorScheme(),re=D.indexOf(F),fe=re===-1?0:(re+B+D.length)%D.length,_e=D[fe];C.setColorScheme(_e),lr({title:L.t("toast.scheme.title"),description:O(_e)})}function ui(B){B!==L.locale()&&(L.setLocale(B),lr({title:L.t("toast.language.title"),description:L.t("toast.language.description",{language:L.label(B)})}))}function Mr(B=1){const F=L.locales,re=F.indexOf(L.locale()),fe=re===-1?0:(re+B+F.length)%F.length,_e=F[fe];_e&&ui(_e)}function hi(B){const F=y.appearance.fontSize();y.appearance.setFontSize(Math.max(8,Math.min(72,F+B)))}function yn(){y.appearance.setFontSize(14)}const Hn=()=>dn(()=>{if(!g.checkUpdate||!g.update||!g.restart)return;let B,F;const re=()=>g.checkUpdate().then(({updateAvailable:fe,version:_e})=>{fe&&B===void 0&&(B=lr({persistent:!0,icon:"download",title:L.t("toast.update.title"),description:L.t("toast.update.description",{version:_e??""}),actions:[{label:L.t("toast.update.action.installRestart"),onClick:async()=>{await g.update(),await g.restart()}},{label:L.t("toast.update.action.notYet"),onClick:"dismiss"}]}))});he(()=>{if(y.ready()){if(!y.updates.startup()){if(F===void 0)return;clearInterval(F),F=void 0;return}F===void 0&&(re(),F=setInterval(re,600*1e3))}}),me(()=>{F!==void 0&&clearInterval(F)})}),en=()=>dn(()=>{const B=new Map,F=new Map,re=5e3,fe=ge=>{const je=B.get(ge);je!==void 0&&(Kh.dismiss(je),B.delete(ge),F.delete(ge))},_e=c.event.listen(ge=>{if(ge.details?.type==="worktree.ready"){Y(ge.name,!1),Jg.ready(ge.name);return}if(ge.details?.type==="worktree.failed"){Y(ge.name,!1),Jg.failed(ge.name,ge.details.properties?.message??L.t("common.requestFailed"));return}if(ge.details?.type==="question.replied"||ge.details?.type==="question.rejected"||ge.details?.type==="permission.replied"){const q0=ge.details.properties,jm=`${ge.name}:${q0.sessionID}`;fe(jm);return}if(ge.details?.type!=="permission.asked"&&ge.details?.type!=="question.asked")return;const je=ge.details.type==="permission.asked"?L.t("notification.permission.title"):L.t("notification.question.title"),Be=ge.details.type==="permission.asked"?"checklist":"bubble-5",Ye=ge.name,He=ge.details.properties;if(ge.details.type==="permission.asked"&&b.autoResponds(ge.details.properties,Ye))return;const[Ke]=u.child(Ye,{bootstrap:!1}),qt=Ke.session.find(q0=>q0.id===He.sessionID),nn=`${Ye}:${He.sessionID}`,Xt=qt?.title??L.t("command.session.new"),on=Gn(Ye),Rt=ge.details.type==="permission.asked"?L.t("notification.permission.description",{sessionTitle:Xt,projectName:on}):L.t("notification.question.description",{sessionTitle:Xt,projectName:on}),mt=`/${St(Ye)}/session/${He.sessionID}`,Ir=Date.now(),Do=F.get(nn)??0;if(Ir-Do<re)return;F.set(nn,Ir),ge.details.type==="permission.asked"&&(y.sounds.permissionsEnabled()&&iU(y.sounds.permissions()),y.notifications.permissions()&&g.notify(je,Rt,mt)),ge.details.type==="question.asked"&&y.notifications.agent()&&g.notify(je,Rt,mt);const yl=l.id;if(tt(Ye)===tt(E())&&He.sessionID===yl||tt(Ye)===tt(E())&&qt?.parentID===yl)return;fe(nn);const qm=lr({persistent:!0,icon:Be,title:je,description:Rt,actions:[{label:L.t("notification.action.goToSession"),onClick:()=>x(mt)},{label:L.t("common.dismiss"),onClick:"dismiss"}]});B.set(nn,qm)});me(_e),he(()=>{const ge=l.id;if(!E()||!ge)return;const je=`${E()}:${ge}`;fe(je);const[Be]=u.child(E(),{bootstrap:!1}),Ye=Be.session.filter(He=>He.parentID===ge);for(const He of Ye)fe(`${E()}:${He.id}`)})});Hn(),en();function tn(B,F){if(!a||T.scrollSessionKey===F)return;const re=a.querySelector(`[data-session-id="${B}"]`);if(!re)return;const fe=a.getBoundingClientRect(),_e=re.getBoundingClientRect();if(_e.top>=fe.top&&_e.bottom<=fe.bottom){R("scrollSessionKey",F);return}R("scrollSessionKey",F),re.scrollIntoView({block:"nearest",behavior:"smooth"})}const Vt=Z(()=>{const B=E();if(!B)return;const F=tt(B),re=h.projects.list(),fe=re.find(He=>He.sandboxes?.some(Ke=>tt(Ke)===F));if(fe)return fe;const _e=re.find(He=>tt(He.worktree)===F);if(_e)return _e;const[ge]=u.child(B,{bootstrap:!1}),je=ge.project;if(!je)return;const Ye=u.data.project.find(He=>He.id===je)?.worktree;if(Ye)return re.find(He=>He.worktree===Ye)}),[Ja]=Yr(async()=>{if(await r.promise,await h.ready.promise,!lt(()=>T.autoselect))return;const B=h.projects.list(),F=v.projects.last();if(B.length===0){if(!F)return;await We(F,!0)}else{const re=B.find(fe=>fe.worktree===F)??B[0];if(!re)return;await We(re.worktree,!0)}}),pa=(B,F,re)=>{const fe=tt(B),_e=t.workspaceName[fe]??t.workspaceName[B];if(_e)return _e;if(F&&re)return t.workspaceBranchName[F]?.[re]},Br=(B,F,re,fe)=>{const _e=tt(B);n("workspaceName",_e,F),re&&fe&&(t.workspaceBranchName[re]||n("workspaceBranchName",re,{}),n("workspaceBranchName",re,fe,F))},mr=(B,F,re)=>pa(B,re,F)??F??Gn(B),Ur=Z(()=>{const B=Vt();return!B||B.vcs!=="git"?!1:h.sidebar.workspaces(B.worktree)()}),fi=Z(()=>{const B=Vt();if(!B)return[];if(!Ur())return[B.worktree];const F=E();return Rm(B).filter(re=>{const fe=t.workspaceExpanded[re]??re===B.worktree,_e=tt(re)===tt(F);return fe||_e})});he(()=>{if(!i()||!m())return;const B=h.projects.list();for(const[F,re]of Object.entries(t.workspaceExpanded)){if(!re)continue;const fe=tt(F),_e=B.find(ge=>tt(ge.worktree)===fe||ge.sandboxes?.some(je=>tt(je)===fe));_e&&(_e.vcs==="git"&&h.sidebar.workspaces(_e.worktree)()||n("workspaceExpanded",F,!1))}});const An=Z(()=>{const B=Date.now(),F=fi();if(F.length===0)return[];const re=[];for(const fe of F){const[_e]=u.child(fe,{bootstrap:!0}),ge=F2(_e,B);re.push(...ge)}return re}),ma=200,hl=2,ue=10,xe=4,et={value:0},Dt=new Map,Sr=10,xi=new Map,fl=B=>{const F=xi.get(B);if(F)return F;const re=new Set;return xi.set(B,re),re},Vf=(B,F)=>{const re=fl(B);return qhe({seen:re,keep:F,limit:Sr,preserve:l.id&&tt(B)===tt(E())?[l.id]:void 0})};he(()=>{const B=new Set(fi());for(const F of[...xi.keys()])B.has(F)||xi.delete(F)}),he(()=>{I(),c.url,et.value+=1,kPt(),Dt.clear()}),he(()=>{const B=new Set(fi());for(const[F,re]of Dt)B.has(F)||(re.pending.length=0,re.pendingSet.clear(),re.running===0&&Dt.delete(F))});const mn=B=>{const F=Dt.get(B);if(F)return F;const re={inflight:new Set,pending:[],pendingSet:new Set,running:0};return Dt.set(B,re),re},_i=(B,F)=>{if(B.length===0)return F.slice().sort((fe,_e)=>fe.id<_e.id?-1:fe.id>_e.id?1:0);const re=new Map;for(const fe of B)re.set(fe.id,fe);for(const fe of F)re.set(fe.id,fe);return[...re.values()].sort((fe,_e)=>fe.id<_e.id?-1:fe.id>_e.id?1:0)};async function Bf(B,F,re){const[fe,_e]=u.child(B,{bootstrap:!1});return bPt({directory:B,sessionID:F,task:ge=>zn(()=>c.client.session.messages({directory:B,sessionID:F,limit:ma})).then(je=>{if(et.value!==re||!lee(B,F,ge))return;const Be=(je.data??[]).filter(Rt=>!!Rt?.info?.id),Ye=Be.map(Rt=>Rt.info).filter(Rt=>!!Rt?.id),He=_i([],Ye),Ke=Vf(B,F),qt=je.response.headers.get("x-next-cursor")??void 0,nn={limit:He.length,cursor:qt,complete:!qt,at:Date.now()};if(Ke.length>0){Ohe(B,Ke);for(const Rt of Ke)u.todo.set(Rt,void 0)}const Xt=fe.message[F]??[],on=_i(Xt.filter(Rt=>!!Rt?.id),He);if(lee(B,F,ge))return ct(()=>{Ke.length>0&&_e(Je(Rt=>{wj(Rt,Ke)})),_e("message",F,Ct(on,{key:"id"})),Dhe({directory:B,sessionID:F,...nn});for(const Rt of Be){const mt=fe.part[Rt.info.id]??[],Ir=_i(mt.filter(Do=>!!Do?.id),Rt.parts.filter(Do=>!!Do?.id));_e("part",Rt.info.id,Ct(Ir,{key:"id"}))}}),nn}).catch(()=>{})})}const Uf=B=>{const F=mn(B);if(F.running>=hl)return;const re=F.pending.shift();if(!re)return;F.pendingSet.delete(re),F.inflight.add(re),F.running+=1;const fe=et.value;Bf(B,re,fe).finally(()=>{F.running-=1,F.inflight.delete(re),Uf(B)})},ga=(B,F="low")=>{const re=B.directory;if(!re)return;const[fe]=u.child(re,{bootstrap:!1});if(lt(()=>{const Ye=VB(re,B.id);return yPt({message:fe.message[B.id]!==void 0,info:Ye,chunk:ma})}))return;const ge=mn(re);if(ge.inflight.has(B.id))return;if(ge.pendingSet.has(B.id)){if(F!=="high")return;const Ye=ge.pending.indexOf(B.id);Ye>0&&(ge.pending.splice(Ye,1),ge.pending.unshift(B.id));return}const je=fl(re);if(!(!je.has(B.id)&&je.size>=Sr&&F!=="high")){for(F==="high"&&ge.pending.unshift(B.id),F!=="high"&&ge.pending.push(B.id),ge.pendingSet.add(B.id);ge.pending.length>ue;){const Ye=ge.pending.pop();Ye&&ge.pendingSet.delete(Ye)}Uf(re)}},z0=(B,F)=>{for(let re=1;re<=xe;re++){const fe=B[F+re];fe&&ga(fe,re===1?"high":"low");const _e=B[F-re];_e&&ga(_e,re===1?"high":"low")}};he(()=>{const B=An();if(B.length===0)return;const F=l.id?B.findIndex(re=>re.id===l.id):0;if(F!==-1){if(!l.id){const re=B[F];re&&ga(re,"high")}z0(B,F)}});function Wf(B){const F=An();if(F.length===0)return;const re=l.id?F.findIndex(ge=>ge.id===l.id):-1;let fe;re===-1?fe=B>0?0:F.length-1:fe=(re+B+F.length)%F.length;const _e=F[fe];_e&&(ga(_e,"high"),z0(F,fe),Pm(_e))}function $m(B){const F=h.projects.list();if(F.length===0)return;const re=Vt()?.worktree,fe=E()?ml(E()):void 0,_e=re??fe,ge=_e?F.findIndex(Be=>Be.worktree===_e):-1,je=ge===-1?B>0?F[0]:F[F.length-1]:F[(ge+B+F.length)%F.length];je&&(u.child(je.worktree),We(je.worktree))}function Mi(B){const F=An();if(F.length===0||!F.some(ge=>k.session.unseenCount(ge.id)>0))return;const fe=l.id?F.findIndex(ge=>ge.id===l.id):-1,_e=fe===-1?B>0?-1:0:fe;for(let ge=1;ge<=F.length;ge++){const je=B>0?(_e+ge)%F.length:(_e-ge+F.length)%F.length,Be=F[je];if(Be&&k.session.unseenCount(Be.id)!==0){ga(Be,"high"),z0(F,je),Pm(Be);return}}}async function ya(B){const[F,re]=u.child(B.directory),fe=F.session??[],_e=fe.findIndex(je=>je.id===B.id),ge=fe[_e+1]??fe[_e-1];await c.client.session.update({directory:B.directory,sessionID:B.id,time:{archived:Date.now()}}),re(Je(je=>{const Be=rn.search(je.session,B.id,Ye=>Ye.id);Be.found&&je.session.splice(Be.index,1)})),B.id===l.id&&x(ge?`/${l.dir}/session/${ge.id}`:`/${l.dir}/session`)}_.register("layout",()=>{const B=[{id:"sidebar.toggle",title:L.t("command.sidebar.toggle"),category:L.t("command.category.view"),keybind:"mod+b",onSelect:()=>h.sidebar.toggle()},{id:"project.open",title:L.t("command.project.open"),category:L.t("command.category.project"),keybind:"mod+o",onSelect:()=>rr()},{id:"project.previous",title:L.t("command.project.previous"),category:L.t("command.category.project"),keybind:"mod+alt+arrowup",onSelect:()=>$m(-1)},{id:"project.next",title:L.t("command.project.next"),category:L.t("command.category.project"),keybind:"mod+alt+arrowdown",onSelect:()=>$m(1)},{id:"provider.connect",title:L.t("command.provider.connect"),category:L.t("command.category.provider"),onSelect:()=>Gf()},{id:"server.switch",title:L.t("command.server.switch"),category:L.t("command.category.server"),onSelect:()=>Tm()},{id:"settings.open",title:L.t("command.settings.open"),category:L.t("command.category.settings"),keybind:"mod+shift+,",onSelect:()=>pl()},{id:"settings.shortcuts",title:L.t("command.settings.shortcuts"),category:L.t("command.category.settings"),keybind:"mod+shift+k",onSelect:()=>{const F=++o;z(()=>import("./dialog-settings-Bk-jMPkO.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107])).then(re=>{s||o!==F||M.show(()=>d(re.DialogSettings,{tab:"shortcuts"}))})}},{id:"session.previous",title:L.t("command.session.previous"),category:L.t("command.category.session"),keybind:"mod+,",onSelect:()=>Wf(-1)},{id:"session.next",title:L.t("command.session.next"),category:L.t("command.category.session"),keybind:"mod+.",onSelect:()=>Wf(1)},{id:"view.toggleMinimap",title:L.t("command.view.toggleMinimap"),category:L.t("command.category.view"),keybind:"mod+shift+m,mod+alt+m",onSelect:()=>n("minimapVisible",F=>!F)},{id:"view.toggleMaximizedPanel",title:L.t("command.view.toggleMaximizedPanel"),category:L.t("command.category.view"),keybind:"ctrl+tab",onSelect:()=>n("panelMaximized",F=>!F)},{id:"view.toggleActivityBar",title:L.t("command.view.toggleActivityBar"),category:L.t("command.category.view"),keybind:"mod+shift+b",onSelect:()=>n("activityBarVisible",F=>!F)},{id:"view.toggleStatusBar",title:L.t("command.view.toggleStatusBar"),category:L.t("command.category.view"),keybind:"ctrl+mod+s",onSelect:()=>n("statusBarVisible",F=>!F)},{id:"view.moveSidebarLeft",title:L.t("command.view.moveSidebarLeft"),category:L.t("command.category.view"),keybind:"ctrl+shift+alt+left",onSelect:()=>{}},{id:"view.moveSidebarRight",title:L.t("command.view.moveSidebarRight"),category:L.t("command.category.view"),keybind:"ctrl+shift+alt+right",onSelect:()=>{}},{id:"view.alignPanelCenter",title:L.t("command.view.alignPanelCenter"),category:L.t("command.category.view"),keybind:"ctrl+shift+down",onSelect:()=>n("panelAlignment","center")},{id:"view.positionPanelBottom",title:L.t("command.view.positionPanelBottom"),category:L.t("command.category.view"),keybind:"ctrl+shift+down",onSelect:()=>n("panelPosition","bottom")},{id:"view.positionPanelRight",title:L.t("command.view.positionPanelRight"),category:L.t("command.category.view"),keybind:"ctrl+shift+right",onSelect:()=>n("panelPosition","right")},{id:"view.positionPanelLeft",title:L.t("command.view.positionPanelLeft"),category:L.t("command.category.view"),keybind:"ctrl+shift+left",onSelect:()=>n("panelPosition","left")},{id:"app.quit",title:L.t("command.app.quit"),category:L.t("command.category.app"),keybind:"mod+alt+q",onSelect:()=>{}},{id:"app.reload",title:L.t("command.app.reload"),category:L.t("command.category.app"),keybind:"mod+shift+alt+r",onSelect:()=>window.location.reload()},{id:"app.restart",title:L.t("command.app.restart"),category:L.t("command.category.app"),keybind:"mod+shift+r",onSelect:()=>{g.restart?.()}},{id:"theme.select",title:L.t("command.theme.select"),category:L.t("command.category.theme"),keybind:"alt+t",onSelect:()=>{}},{id:"theme.toggleLightDark",title:L.t("command.theme.toggleLightDark"),category:L.t("command.category.theme"),keybind:"mod+shift+alt+t",onSelect:()=>jn(1)},{id:"editor.fontZoomIn",title:L.t("command.editor.fontZoomIn"),category:L.t("command.category.editor"),keybind:"mod+alt+=",onSelect:()=>hi(1)},{id:"editor.fontZoomOut",title:L.t("command.editor.fontZoomOut"),category:L.t("command.category.editor"),keybind:"mod+alt+-",onSelect:()=>hi(-1)},{id:"editor.fontZoomReset",title:L.t("command.editor.fontZoomReset"),category:L.t("command.category.editor"),keybind:"alt+0",onSelect:()=>yn()},{id:"terminal.fontZoomIn",title:L.t("command.terminal.fontZoomIn"),category:L.t("command.category.terminal"),keybind:"mod+ctrl+alt+=",onSelect:()=>hi(1)},{id:"terminal.fontZoomOut",title:L.t("command.terminal.fontZoomOut"),category:L.t("command.category.terminal"),keybind:"mod+ctrl+alt+-",onSelect:()=>hi(-1)},{id:"session.previous.unseen",title:L.t("command.session.previous.unseen"),category:L.t("command.category.session"),keybind:"shift+alt+arrowup",onSelect:()=>Mi(-1)},{id:"session.next.unseen",title:L.t("command.session.next.unseen"),category:L.t("command.category.session"),keybind:"shift+alt+arrowdown",onSelect:()=>Mi(1)},{id:"session.archive",title:L.t("command.session.archive"),category:L.t("command.category.session"),keybind:"mod+shift+backspace",disabled:!l.dir||!l.id,onSelect:()=>{const F=An().find(re=>re.id===l.id);F&&ya(F)}},{id:"workspace.new",title:L.t("workspace.new"),category:L.t("command.category.workspace"),keybind:"mod+shift+w",disabled:!Ur(),onSelect:()=>{const F=Vt();if(F)return aX(F)}},{id:"workspace.toggle",title:L.t("command.workspace.toggle"),description:L.t("command.workspace.toggle.description"),category:L.t("command.category.workspace"),slash:"workspace",disabled:!Vt()||Vt()?.vcs!=="git",onSelect:()=>{const F=Vt();if(!F||F.vcs!=="git")return;const re=h.sidebar.workspaces(F.worktree)();h.sidebar.toggleWorkspaces(F.worktree),lr({title:re?L.t("toast.workspace.disabled.title"):L.t("toast.workspace.enabled.title"),description:re?L.t("toast.workspace.disabled.description"):L.t("toast.workspace.enabled.description")})}},{id:"theme.cycle",title:L.t("command.theme.cycle"),category:L.t("command.category.theme"),keybind:"mod+shift+t",onSelect:()=>Nt(1)}];for(const[F]of A())B.push({id:`theme.set.${F}`,title:L.t("command.theme.set",{theme:C.name(F)}),category:L.t("command.category.theme"),onSelect:()=>C.commitPreview(),onHighlight:()=>(C.previewTheme(F),()=>C.cancelPreview())});B.push({id:"theme.scheme.cycle",title:L.t("command.theme.scheme.cycle"),category:L.t("command.category.theme"),keybind:"mod+shift+s",onSelect:()=>jn(1)});for(const F of D)B.push({id:`theme.scheme.${F}`,title:L.t("command.theme.scheme.set",{scheme:O(F)}),category:L.t("command.category.theme"),onSelect:()=>C.commitPreview(),onHighlight:()=>(C.previewColorScheme(F),()=>C.cancelPreview())});B.push({id:"language.cycle",title:L.t("command.language.cycle"),category:L.t("command.category.language"),onSelect:()=>Mr(1)});for(const F of L.locales)B.push({id:`language.set.${F}`,title:L.t("command.language.set",{language:L.label(F)}),category:L.t("command.category.language"),onSelect:()=>ui(F)});return B});function Gf(){const B=++o;z(()=>import("./dialog-select-provider-BAPqXfpR.js").then(F=>F.d),__vite__mapDeps([107,105,102,106,104])).then(F=>{s||o!==B||M.show(()=>d(F.DialogSelectProvider,{}))})}function Tm(){const B=++o;z(()=>import("./dialog-select-server-CPIZBmuF.js"),__vite__mapDeps([108,105,102,109])).then(F=>{s||o!==B||M.show(()=>d(F.DialogSelectServer,{}))})}function pl(){const B=++o;z(()=>import("./dialog-settings-Bk-jMPkO.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107])).then(F=>{s||o!==B||M.show(()=>d(F.DialogSettings,{}))})}function ml(B){const F=tt(B),re=h.projects.list().find(Be=>tt(Be.worktree)===F||Be.sandboxes?.some(Ye=>tt(Ye)===F));if(re)return re.worktree;const fe=Object.entries(t.workspaceOrder).find(([Be,Ye])=>tt(Be)===F||Ye.some(He=>tt(He)===F));if(fe)return fe[0];const[_e]=u.child(B,{bootstrap:!1}),ge=_e.project;return ge?u.data.project.find(Be=>Be.id===ge)?.worktree??B:B}function Bi(B){return Vt()?.worktree??ml(B)}function Zf(B,F,re=Bi(B)){return n("lastProjectSession",re,{directory:B,id:F,at:Date.now()}),re}function Kf(B){t.lastProjectSession[B]&&n("lastProjectSession",Je(F=>{delete F[B]}))}function Em(B,F,re=Bi(B)){return Zf(B,F,re),k.session.markViewed(F),lt(()=>t.workspaceExpanded[B])===!1&&n("workspaceExpanded",B,!0),requestAnimationFrame(()=>tn(F,`${B}:${F}`)),re}async function gl(B){if(!B)return;const F=ml(B);v.projects.touch(F);const re=h.projects.list().find(Ke=>Ke.worktree===F);let fe=re?Qg(F,[F,...re.sandboxes??[]],t.workspaceOrder[F]):[F];const _e=Ke=>Ke?fe.some(qt=>tt(qt)===tt(Ke)):!1,ge=async Ke=>{if(!Ke||Ke===F||_e(Ke))return _e(Ke);const qt=await c.client.worktree.list({directory:F}).then(nn=>nn.data??[]).catch(()=>[]);return fe=Qg(F,[F,...qt],t.workspaceOrder[F]),_e(Ke)},je=async Ke=>{if(!_e(Ke.directory))return!1;const[qt]=u.child(Ke.directory,{bootstrap:!1});if(qt.session.some(Xt=>Xt.id===Ke.id))return n("lastProjectSession",F,{directory:Ke.directory,id:Ke.id,at:Date.now()}),De(`/${St(Ke.directory)}/session/${Ke.id}`),!0;const nn=await c.client.session.get({sessionID:Ke.id}).then(Xt=>Xt.data).catch(()=>{});return!nn?.directory||!_e(nn.directory)?!1:(n("lastProjectSession",F,{directory:nn.directory,id:nn.id,at:Date.now()}),De(`/${St(nn.directory)}/session/${nn.id}`),!0)},Be=t.lastProjectSession[F];if(Be?.id){if(await ge(Be.directory),await je(Be))return;Kf(F)}const Ye=Ene(fe.map(Ke=>u.child(Ke,{bootstrap:!1})[0]),Date.now());if(Ye&&await je(Ye))return;const He=Ene(await Promise.all(fe.map(async Ke=>({path:{directory:Ke},session:await c.client.session.list({directory:Ke}).then(qt=>qt.data??[]).catch(()=>[])}))),Date.now());He&&await je(He)||De(`/${St(F)}/session`)}function Pm(B){B&&De(`/${St(B.directory)}/session/${B.id}`)}function We(B,F=!0){if(h.projects.open(B),F)return gl(B)}const te=B=>{if(v.isLocal()){for(const F of mKt(B))We(F);for(const F of gKt(B)){We(F.directory,!1);const re=St(F.directory);F.prompt&&UZt(re,{prompt:F.prompt});const fe=F.prompt?`/${re}/session?prompt=${encodeURIComponent(F.prompt)}`:`/${re}/session`;De(fe)}}};dn(()=>{const B=F=>{const fe=F.detail?.urls??[];fe.length!==0&&te(fe)};te(yKt(window)),window.addEventListener(Pne,B),me(()=>window.removeEventListener(Pne,B))});async function Ne(B,F){const re=QK(B);if(F===re)return;const fe=F===Gn(B.worktree)?"":F;if(B.id&&B.id!=="global"){await c.client.project.update({projectID:B.id,directory:B.worktree,name:fe});return}u.project.meta(B.worktree,{name:fe})}const Ge=(B,F,re,fe)=>{(pa(B,re,fe)??fe??Gn(B))!==F&&Br(B,F,re,fe)};function an(B){const F=h.projects.list(),re=tt(B),fe=F.findIndex(je=>tt(je.worktree)===re),_e=tt(Vt()?.worktree??"")===re;if(fe===-1)return;const ge=F[fe+1];if(!_e){h.projects.close(B);return}if(!ge){h.projects.close(B),x("/");return}De(`/${St(ge.worktree)}/session`),h.projects.close(B),queueMicrotask(()=>{gl(ge.worktree)})}function nr(B){if(h.sidebar.workspaces(B.worktree)()){h.sidebar.toggleWorkspaces(B.worktree);return}B.vcs==="git"&&h.sidebar.toggleWorkspaces(B.worktree)}const wn=B=>{const F=++o;z(()=>import("./dialog-edit-project-aGSXOj6x.js"),[]).then(re=>{s||o!==F||M.show(()=>d(re.DialogEditProject,{project:B}))})};async function rr(){function B(F){if(Array.isArray(F)){for(const re of F)We(re,!1);gl(F[0])}else F&&We(F)}if(g.openDirectoryPickerDialog&&v.isLocal()){const F=await g.openDirectoryPickerDialog?.({title:L.t("command.project.open"),multiple:!0});B(F)}else{const F=++o;z(()=>import("./dialog-select-directory-D84XEi3u.js"),__vite__mapDeps([110,111,105,102])).then(re=>{s||o!==F||M.show(()=>d(re.DialogSelectDirectory,{multiple:!0,onSelect:B}),()=>B(null))})}}const va=async(B,F,re=!1)=>{if(F===B)return;const fe=E(),_e=tt(fe),ge=tt(F),je=re||!!l.dir&&_e===ge;!re&&je&&De(`/${St(B)}/session`),Y(F,!0);const Be=await c.client.worktree.remove({directory:B,worktreeRemoveInput:{directory:F}}).then(Xt=>Xt.data).catch(Xt=>(lr({title:L.t("workspace.delete.failed.title"),description:aV(Xt,L.t("common.requestFailed"))}),!1));if(Y(F,!1),!Be||(tt(t.lastProjectSession[B]?.directory??"")===tt(F)&&Kf(B),u.set("project",Je(Xt=>{const on=Xt.find(Rt=>Rt.worktree===B);on&&(on.sandboxes=(on.sandboxes??[]).filter(Rt=>Rt!==F))})),n("workspaceOrder",B,Xt=>(Xt??[]).filter(on=>on!==F)),h.projects.close(F),h.projects.open(B),je))return;const Ye=E(),He=tt(Ye),Ke=h.projects.list().find(Xt=>Xt.worktree===B),nn=(Ke?Qg(B,[B,...Ke.sandboxes??[]],t.workspaceOrder[B]):[B]).some(Xt=>tt(Xt)===He);l.dir&&ml(Ye)===B&&!nn&&De(`/${St(B)}/session`)},ks=async(B,F)=>{if(F===B)return;Y(F,!0);const re=lr({persistent:!0,title:L.t("workspace.resetting.title"),description:L.t("workspace.resetting.description")}),fe=()=>Kh.dismiss(re),_e=await c.client.session.list({directory:F}).then(Be=>Be.data??[]).catch(()=>[]);if(Xzt(F,_e.map(Be=>Be.id),g),await c.client.instance.dispose({directory:F}).catch(()=>{}),!await c.client.worktree.reset({directory:B,worktreeResetInput:{directory:F}}).then(Be=>Be.data).catch(Be=>(lr({title:L.t("workspace.reset.failed.title"),description:aV(Be,L.t("common.requestFailed"))}),!1))){Y(F,!1),fe();return}const je=Date.now();await Promise.all(_e.filter(Be=>Be.time.archived===void 0).map(Be=>c.client.session.update({sessionID:Be.id,directory:Be.directory,time:{archived:je}}).catch(()=>{}))),Y(F,!1),fe(),lr({title:L.t("workspace.reset.success.title"),description:L.t("workspace.reset.success.description"),actions:[{label:L.t("command.session.new"),onClick:()=>{const Be=`/${St(F)}/session?new=1`;x(Be),h.mobileSidebar.hide()}},{label:L.t("common.dismiss"),onClick:"dismiss"}]})};function Xf(B){const F=Z(()=>Gn(B.directory)),[re,fe]=nt({status:"loading",dirty:!1});dn(()=>{c.client.file.status({directory:B.directory}).then(je=>{const Ye=(je.data??[]).length>0;fe({status:"ready",dirty:Ye})}).catch(()=>{fe({status:"error",dirty:!1})})});const _e=()=>{const je=!!l.dir&&tt(E())===tt(B.directory);je&&De(`/${St(B.root)}/session`),M.close(),va(B.root,B.directory,je)},ge=()=>re.status==="loading"?L.t("workspace.status.checking"):re.status==="error"?L.t("workspace.status.error"):re.dirty?L.t("workspace.status.dirty"):L.t("workspace.status.clean");return d(jz,{get title(){return L.t("workspace.delete.title")},fit:!0,get children(){var je=sYt(),Be=je.firstChild,Ye=Be.firstChild,He=Ye.nextSibling,Ke=Be.nextSibling;return K(Ye,()=>L.t("workspace.delete.confirm",{name:F()})),K(He,ge),K(Ke,d(Mn,{variant:"ghost",size:"large",onClick:()=>M.close(),get children(){return L.t("common.cancel")}}),null),K(Ke,d(Mn,{variant:"primary",size:"large",get disabled(){return re.status==="loading"},onClick:_e,get children(){return L.t("workspace.delete.button")}}),null),je}})}function ir(B){const F=Z(()=>Gn(B.directory)),[re,fe]=nt({status:"loading",dirty:!1,sessions:[]}),_e=async()=>{const Ke=(await c.client.session.list({directory:B.directory}).then(qt=>qt.data??[]).catch(()=>[])).filter(qt=>qt.time.archived===void 0);fe({sessions:Ke})};dn(()=>{c.client.file.status({directory:B.directory}).then(He=>{const qt=(He.data??[]).length>0;fe({status:"ready",dirty:qt}),_e()}).catch(()=>{fe({status:"error",dirty:!1})})});const ge=()=>{M.close(),ks(B.root,B.directory)},je=()=>re.sessions.length,Be=()=>re.status==="loading"?L.t("workspace.status.checking"):re.status==="error"?L.t("workspace.status.error"):re.dirty?L.t("workspace.status.dirty"):L.t("workspace.status.clean"),Ye=()=>{const He=je();return He===0?L.t("workspace.reset.archived.none"):He===1?L.t("workspace.reset.archived.one"):L.t("workspace.reset.archived.many",{count:He})};return d(jz,{get title(){return L.t("workspace.reset.title")},fit:!0,get children(){var He=lYt(),Ke=He.firstChild,qt=Ke.firstChild,nn=qt.nextSibling,Xt=nn.firstChild,on=Xt.nextSibling;on.nextSibling;var Rt=Ke.nextSibling;return K(qt,()=>L.t("workspace.reset.confirm",{name:F()})),K(nn,Be,Xt),K(nn,Ye,on),K(nn,()=>L.t("workspace.reset.note"),null),K(Rt,d(Mn,{variant:"ghost",size:"large",onClick:()=>M.close(),get children(){return L.t("common.cancel")}}),null),K(Rt,d(Mn,{variant:"primary",size:"large",get disabled(){return re.status==="loading"},onClick:ge,get children(){return L.t("workspace.reset.button")}}),null),He}})}const Fn={session:"",sessionProject:"",directory:""};he(vn(()=>[i(),I().slug,l.id,Vt()?.worktree,E()],([B,F,re,fe,_e])=>{if(!B||!F||!_e){Fn.session="",Fn.sessionProject="",Fn.directory="";return}if(!re){Fn.session="",Fn.sessionProject="",Fn.directory="";return}const ge=`${F}/${re}`;if(!fe){Fn.session=ge,Fn.directory=_e,Fn.sessionProject="";return}if(v.projects.last()!==fe&&v.projects.touch(fe),ge!==Fn.session||_e!==Fn.directory){Fn.session=ge,Fn.directory=_e,Fn.sessionProject=Em(_e,re,fe);return}fe!==Fn.sessionProject&&(Fn.directory=_e,Fn.sessionProject=Zf(_e,re,fe))})),he(()=>{const B=h.sidebar.opened()?h.sidebar.width():48;document.documentElement.style.setProperty("--dialog-left-margin",`${B}px`)});const Dm=Z(()=>Math.max(h.sidebar.width(),244)),vge=Z(()=>Math.max(Dm()-64,0)),Om=new Set;he(vn(fi,B=>{if(B.length===0){Om.clear();return}const F=new Set(B);for(const re of F)Om.has(re)||u.project.loadSessions(re);Om.clear();for(const re of F)Om.add(re)},{defer:!0}));function kge(B){const F=tq(B);F&&(ye(void 0),n("activeProject",F))}function bge(B){const{draggable:F,droppable:re}=B;if(F&&re){const fe=h.projects.list(),_e=fe.findIndex(je=>je.worktree===F.id.toString()),ge=fe.findIndex(je=>je.worktree===re.id.toString());_e!==ge&&ge!==-1&&h.projects.move(F.id.toString(),ge)}}function wge(){n("activeProject",void 0)}function Rm(B){if(!B)return[];const F=B.worktree,re=[F,...B.sandboxes??[]],fe=Vt(),_e=tt(fe?.worktree??"")===tt(B.worktree)?E():void 0,ge=_e&&tt(_e)!==tt(F)&&!re.some(Ye=>tt(Ye)===tt(_e))?_e:void 0,je=ge?Jg.get(ge)?.status==="pending":!1,Be=Qg(F,re,t.workspaceOrder[B.worktree]);return je&&ge?[F,ge,...Be.filter(Ye=>Ye!==F)]:!ge||je?Be:[...Be,ge]}const iX=Z(()=>{if(h.sidebar.opened())return Vt();const B=Re();return B||Vt()});function xge(B){const F=tq(B);F&&n("activeWorkspace",F)}function _ge(B){const{draggable:F,droppable:re}=B;if(!F||!re)return;const fe=iX();if(!fe)return;const _e=Rm(fe),ge=_e.findIndex(He=>He===F.id.toString()),je=_e.findIndex(He=>He===re.id.toString());if(ge===-1||je===-1||ge===je)return;const Be=_e.slice(),[Ye]=Be.splice(ge,1);Ye&&(Be.splice(je,0,Ye),n("workspaceOrder",fe.worktree,Be.filter(He=>tt(He)!==tt(fe.worktree))))}function Mge(){n("activeWorkspace",void 0)}const aX=async B=>{At();const F=await c.client.worktree.create({directory:B.worktree}).then(ge=>ge.data).catch(ge=>{lr({title:L.t("workspace.create.failed.title"),description:aV(ge,L.t("common.requestFailed"))})});if(!F?.directory)return;Br(F.directory,F.branch,B.id,F.branch);const re=B.worktree,fe=tt(F.directory),_e=tt(re);Y(F.directory,!0),Jg.pending(F.directory),n("workspaceExpanded",fe,!0),fe!==F.directory&&n("workspaceExpanded",F.directory,!0),n("workspaceOrder",B.worktree,ge=>{const Be=(ge??[]).filter(Ye=>{const He=tt(Ye);return He!==_e&&He!==fe});return[F.directory,...Be]}),u.child(F.directory),De(`/${St(F.directory)}/session`)},oX={currentDir:E,navList:An,sidebarExpanded:de,sidebarHovering:oe,nav:()=>T.nav,hoverSession:()=>T.hoverSession,setHoverSession:le,clearHoverProjectSoon:ve,prefetchSession:ga,archiveSession:ya,workspaceName:pa,renameWorkspace:Ge,editorOpen:wt,openEditor:Ue,closeEditor:V,setEditor:Fe,InlineEditor:ze,isBusy:j,workspaceExpanded:(B,F)=>t.workspaceExpanded[B]??F,setWorkspaceExpanded:(B,F)=>n("workspaceExpanded",B,F),showResetWorkspaceDialog:(B,F)=>M.show(()=>d(ir,{root:B,directory:F})),showDeleteWorkspaceDialog:(B,F)=>M.show(()=>d(Xf,{root:B,directory:F})),setScrollContainerRef:(B,F)=>{F||(a=B)}},Sge={currentDir:E,currentProject:Vt,sidebarOpened:()=>h.sidebar.opened(),sidebarHovering:oe,hoverProject:()=>T.hoverProject,nav:()=>T.nav,onProjectMouseEnter:(B,F)=>J.enter(B,F),onProjectMouseLeave:B=>J.leave(B),onProjectFocus:B=>J.activate(B),onHoverOpenChanged:(B,F)=>{!F&&T.hoverProject&&T.hoverProject!==B||R("hoverProject",F?B:void 0)},navigateToProject:gl,openSidebar:()=>h.sidebar.open(),closeProject:an,showEditProjectDialog:wn,toggleProjectWorkspaces:nr,workspacesEnabled:B=>B.vcs==="git"&&h.sidebar.workspaces(B.worktree)(),workspaceIds:Rm,workspaceLabel:mr,sessionProps:{navList:An,sidebarExpanded:de,sidebarHovering:oe,nav:()=>T.nav,hoverSession:()=>T.hoverSession,setHoverSession:le,clearHoverProjectSoon:ve,prefetchSession:ga,archiveSession:ya},setHoverSession:le},Cge=B=>{const F=B.project,re=Z(()=>B.mobile||(B.merged??h.sidebar.opened())),fe=Z(()=>!B.mobile&&B.merged===!1&&!h.sidebar.opened()),_e=Z(()=>!!B.mobile||B.merged===!1||h.sidebar.opened()),ge=Z(()=>!l.dir&&h.projects.list().length===0),je=Z(()=>{const mt=F();return mt?mt.name||Gn(mt.worktree):""}),Be=Z(()=>F()?.id??""),Ye=Z(()=>F()?.worktree??""),He=Z(()=>{const mt=Ye();return mt?St(mt):""}),Ke=Z(()=>{const mt=F();return mt?Rm(mt):[]}),qt=Z(()=>Ke().reduce((mt,Ir)=>mt+k.project.unseenCount(Ir),0)),nn=()=>Ke().filter(mt=>k.project.unseenCount(mt)>0).forEach(mt=>k.project.markViewed(mt)),Xt=Z(()=>{const mt=F();return!mt||mt.vcs!=="git"?!1:h.sidebar.workspaces(mt.worktree)()}),on=Z(()=>{const mt=F();return mt?mt.vcs==="git"||h.sidebar.workspaces(mt.worktree)():!1}),Rt=Z(()=>u.data.path.home);return(()=>{var mt=fYt(),Ir=mt.firstChild,Do=Ir.firstChild,yl=Do.firstChild,qm=yl.firstChild,q0=qm.firstChild,jm=q0.nextSibling,Age=jm.nextSibling,lX=qm.nextSibling;return K(mt,d(ke,{get when(){return F()},get fallback(){return d(ke,{get when(){return ge()},get children(){var Nr=pYt(),ar=Nr.firstChild,Ar=ar.firstChild,xn=Ar.firstChild,Hm=xn.nextSibling;return K(xn,()=>L.t("sidebar.empty.title")),K(Hm,()=>L.t("sidebar.empty.description")),K(ar,d(Mn,{size:"large",icon:"folder-add-left",onClick:rr,get children(){return L.t("command.project.open")}}),null),Nr}})},get children(){return[(()=>{var Nr=dYt(),ar=Nr.firstChild,Ar=ar.firstChild;return K(Ar,d(ze,{get id(){return`project:${Be()}`},value:je,onSave:xn=>{const Hm=F();Hm&&Ne(Hm,xn)},class:"text-14-medium text-text-strong truncate",displayClass:"text-14-medium text-text-strong truncate",stopPropagation:!0}),null),K(Ar,d(Ua,{placement:"bottom",gutter:2,get value(){return Ye()},class:"shrink-0",contentStyle:{"max-width":"640px",transform:"translate3d(52px, 0, 0)"},get children(){var xn=cYt();return K(xn,()=>Ye().replace(Rt(),"~")),xn}}),null),K(ar,d(Mt,{get modal(){return!oe()},get children(){return[d(Mt.Trigger,{as:Cr,icon:"dot-grid",variant:"ghost","data-action":"project-menu",get"data-project"(){return He()},class:"shrink-0 size-6 rounded-md transition-opacity data-[expanded]:bg-surface-base-active",get classList(){return{"opacity-100":B.mobile||re(),"opacity-0 group-hover/project:opacity-100 group-focus-within/project:opacity-100 data-[expanded]:opacity-100":!B.mobile&&!re()}},get"aria-label"(){return L.t("common.moreOptions")}}),d(Mt.Portal,{get children(){return d(Mt.Content,{class:"mt-1",get children(){return[d(Mt.Item,{onSelect:()=>{const xn=F();xn&&wn(xn)},get children(){return d(Mt.ItemLabel,{get children(){return L.t("common.edit")}})}}),d(Mt.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return He()},get disabled(){return!on()},onSelect:()=>{const xn=F();xn&&nr(xn)},get children(){return d(Mt.ItemLabel,{get children(){return bt(()=>!!Xt())()?L.t("sidebar.workspaces.disable"):L.t("sidebar.workspaces.enable")}})}}),d(Mt.Item,{"data-action":"project-clear-notifications",get"data-project"(){return He()},get disabled(){return qt()===0},onSelect:nn,get children(){return d(Mt.ItemLabel,{get children(){return L.t("sidebar.project.clearNotifications")}})}}),d(Mt.Separator,{}),d(Mt.Item,{"data-action":"project-close-menu",get"data-project"(){return He()},onSelect:()=>{const xn=Ye();xn&&an(xn)},get children(){return d(Mt.ItemLabel,{get children(){return L.t("common.close")}})}})]}})}})]}}),null),Nr})(),d(Sme,{onDragStart:xge,onDragEnd:Mge,onDragOver:_ge,collisionDetector:_me,get children(){return[d(Cme,{}),d(Eme,{}),(()=>{var Nr=hYt();return K(Nr,d(ke,{get when(){return Xt()},get fallback(){return[(()=>{var ar=zne();return K(ar,d(Mn,{variant:"secondary",size:"large",icon:"new-session",class:"w-full",onClick:()=>{const Ar=Ye();Ar&&De(`/${St(Ar)}/session?new=1`)},get children(){return L.t("command.session.new")}})),ar})(),(()=>{var ar=mYt();return K(ar,d(CXt,{ctx:oX,get project(){return F()},sortNow:X,get mobile(){return B.mobile},get popover(){return _e()}})),ar})()]},get children(){return[(()=>{var ar=zne();return K(ar,d(Mn,{size:"large",icon:"plus-small",class:"w-full",onClick:()=>{const Ar=F();Ar&&aX(Ar)},get children(){return L.t("workspace.new")}})),ar})(),(()=>{var ar=uYt(),Ar=ar.firstChild;return Hr(xn=>{B.mobile||(a=xn)},Ar),K(Ar,d(Nme,{get ids(){return Ke()},get children(){return d(Qt,{get each(){return Ke()},children:xn=>d(SXt,{ctx:oX,directory:xn,get project(){return F()},sortNow:X,get mobile(){return B.mobile},get popover(){return _e()}})})}})),ar})()]}})),Nr})(),d(Lme,{get children(){return d(xXt,{sidebarProject:iX,activeWorkspace:()=>t.activeWorkspace,workspaceLabel:mr})}})]}})]}}),Ir),K(q0,()=>L.t("sidebar.gettingStarted.title")),K(jm,()=>L.t("sidebar.gettingStarted.line1")),K(Age,()=>L.t("sidebar.gettingStarted.line2")),K(lX,d(Mn,{size:"large",icon:"plus-small",onClick:Gf,get children(){return L.t("command.provider.connect")}}),null),K(lX,d(Mn,{size:"large",variant:"ghost",onClick:()=>n("gettingStartedDismissed",!0),get children(){return L.t("toast.update.action.notYet")}}),null),Qe(Nr=>{var ar={"flex flex-col min-h-0 min-w-0 box-border rounded-tl-[12px] px-3":!0,"border border-b-0 border-border-weak-base":!re(),"border-l border-t border-border-weaker-base":re(),"bg-background-base":re()||fe(),"bg-background-stronger":!re()&&!fe(),"flex-1 min-w-0":B.mobile,"max-w-full overflow-hidden":B.mobile},Ar=B.mobile?void 0:`${vge()}px`,xn=!!(t.gettingStartedDismissed||!(w.all().length>0&&w.paid().length===0));return Nr.e=hr(mt,ar,Nr.e),Ar!==Nr.t&&kr(mt,"width",Nr.t=Ar),xn!==Nr.a&&Ir.classList.toggle("hidden",Nr.a=xn),Nr},{e:void 0,t:void 0,a:void 0}),mt})()},sX=()=>h.projects.list(),Lge=()=>d(JXt,{projects:sX,activeProject:()=>t.activeProject}),Ige=B=>d(oYt,{mobile:B,opened:()=>h.sidebar.opened(),get aimMove(){return J.move},projects:sX,renderProject:F=>d(tYt,{ctx:Sge,project:F,sortNow:X,mobile:B}),handleDragStart:kge,handleDragEnd:wge,handleDragOver:bge,get openProjectLabel(){return L.t("command.project.open")},openProjectKeybind:()=>_.keybind("project.open"),onOpenProject:rr,renderProjectOverlay:Lge,settingsLabel:()=>L.t("sidebar.settings"),settingsKeybind:()=>_.keybind("settings.open"),onOpenSettings:pl,helpLabel:()=>L.t("sidebar.help"),onOpenHelp:()=>g.openLink("https://opencode.ai/desktop-feedback"),renderPanel:()=>d(Cge,{project:Vt,mobile:!0})});let zm;const Nge=bf();return he(()=>{Nge.pathname,zm&&requestAnimationFrame(()=>{O2e(zm,{opacity:[0,1],y:[4,0]},{type:"spring",stiffness:400,damping:30})})}),d(lqt,{get children(){var B=yYt(),F=B.firstChild,re=F.firstChild,fe=re.firstChild,_e=fe.firstChild,ge=_e.firstChild,je=ge.nextSibling,Be=_e.nextSibling,Ye=Be.firstChild;return K(B,d(dKt,{}),F),K(F,d(ke,{get when(){return t.activityBarVisible},get children(){var He=gYt(),Ke=He.firstChild,qt=Ke.firstChild,nn=Ke.nextSibling,Xt=nn.firstChild;return K(Ke,d(Qt,{get each(){return h.projects.list()},children:on=>{const Rt=Z(()=>Vt()?.worktree===on.worktree);return(()=>{var mt=vYt();return mt.$$click=()=>x(`/${St(on.worktree)}/session`),K(mt,d(nX,{project:on,notify:!0})),Qe(Ir=>{var Do={"bg-transparent hover:bg-surface-base-hover":!Rt(),"bg-surface-base-hover border border-border-weak-base":Rt()},yl=on.name||Gn(on.worktree);return Ir.e=hr(mt,Do,Ir.e),yl!==Ir.t&>(mt,"aria-label",Ir.t=yl),Ir},{e:void 0,t:void 0}),mt})()}}),qt),qt.$$click=rr,K(qt,d(Kt,{name:"plus",size:"small",class:"text-icon-weak"})),Xt.$$click=pl,K(Xt,d(Kt,{name:"settings-gear",size:"small",class:"text-icon-weak"})),Qe(on=>{var Rt=L.t("command.project.open"),mt=L.t("sidebar.settings");return Rt!==on.e&>(qt,"aria-label",on.e=Rt),mt!==on.t&>(Xt,"aria-label",on.t=mt),on},{e:void 0,t:void 0}),He}}),re),ge.$$click=He=>{He.target===He.currentTarget&&h.mobileSidebar.hide()},je.$$click=He=>He.stopPropagation(),K(je,()=>Ige(!0)),hr(Be,{"absolute p-3 pt-0 inset-0":!0,"xl:inset-y-0 xl:right-0 xl:left-0":!0,"z-20":!0}),hr(Ye,{"size-full overflow-x-hidden flex flex-col items-start contain-strict rounded-xl":!0}),K(Ye,d(ke,{get when(){return!Ja.loading},get fallback(){return qne()},get children(){var He=qne(),Ke=zm;return typeof Ke=="function"?Hr(Ke,He):zm=He,K(He,()=>e.children),He}})),K(B,d(As.Region,{}),null),Qe(He=>{var Ke={"fixed inset-x-0 top-10 bottom-0 z-40 transition-opacity duration-200":!0,"opacity-100 pointer-events-auto":h.mobileSidebar.opened(),"opacity-0 pointer-events-none":!h.mobileSidebar.opened()},qt=L.t("sidebar.nav.projectsAndSessions"),nn={"@container fixed top-10 bottom-0 left-0 z-50 w-full max-w-[400px] overflow-hidden border-r border-border-weaker-base bg-background-base transition-transform duration-200 ease-out":!0,"translate-x-0":h.mobileSidebar.opened(),"-translate-x-full":!h.mobileSidebar.opened()};return He.e=hr(ge,Ke,He.e),qt!==He.t&>(je,"aria-label",He.t=qt),He.a=hr(je,nn,He.a),He},{e:void 0,t:void 0,a:void 0}),B}})}li(["click"]);var bYt=["id","name","validationState","required","disabled","readOnly"];function wYt(e){const t=`form-control-${xr()}`,n=ft({id:t},e),[r,i]=Ce(),[a,o]=Ce(),[s,l]=Ce(),[c,u]=Ce(),h=(v,k,b)=>{const x=b!=null||r()!=null;return[b,r(),x&&k!=null?v:void 0].filter(Boolean).join(" ")||void 0},m=v=>[s(),c(),v].filter(Boolean).join(" ")||void 0,g=Z(()=>({"data-valid":be(n.validationState)==="valid"?"":void 0,"data-invalid":be(n.validationState)==="invalid"?"":void 0,"data-required":be(n.required)?"":void 0,"data-disabled":be(n.disabled)?"":void 0,"data-readonly":be(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>be(n.name)??be(n.id),dataset:g,validationState:()=>be(n.validationState),isRequired:()=>be(n.required),isDisabled:()=>be(n.disabled),isReadOnly:()=>be(n.readOnly),labelId:r,fieldId:a,descriptionId:s,errorMessageId:c,getAriaLabelledBy:h,getAriaDescribedBy:m,generateId:Io(()=>be(n.id)),registerLabel:zr(i),registerField:zr(o),registerDescription:zr(l),registerErrorMessage:zr(u)}}}var rge=Tt();function Am(){const e=Lt(rge);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function ige(e){const t=Am(),n=ft({id:t.generateId("description")},e);return he(()=>me(t.registerDescription(n.id))),d(zt,f({as:"div"},()=>t.dataset(),n))}var xYt=["id","aria-label","aria-labelledby","aria-describedby"];function _Yt(e){const t=Am(),n=ft({id:t.generateId("field")},e);return he(()=>me(t.registerField(be(n.id)))),{fieldProps:{id:()=>be(n.id),ariaLabel:()=>be(n["aria-label"]),ariaLabelledBy:()=>t.getAriaLabelledBy(be(n.id),be(n["aria-label"]),be(n["aria-labelledby"])),ariaDescribedBy:()=>t.getAriaDescribedBy(be(n["aria-describedby"]))}}}function age(e){let t;const n=Am(),r=ft({id:n.generateId("label")},e),[i,a]=Se(r,["ref"]),o=Z2(()=>t,()=>"label");return he(()=>me(n.registerLabel(a.id))),d(zt,f({as:"label",ref(s){var l=hn(c=>t=c,i.ref);typeof l=="function"&&l(s)},get for(){return bt(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),a))}function MYt(e,t){he(vn(e,n=>{if(n==null)return;const r=SYt(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),me(()=>{r.removeEventListener("reset",t)}))}))}function SYt(e){return CYt(e)?e.form:e.closest("form")}function CYt(e){return e.matches("textarea, input, select, button")}function oge(e){const t=Am(),n=ft({id:t.generateId("error-message")},e),[r,i]=Se(n,["forceMount"]),a=()=>t.validationState()==="invalid";return he(()=>{a()&&me(t.registerErrorMessage(i.id))}),d(ke,{get when(){return r.forceMount||a()},get children(){return d(zt,f({as:"div"},()=>t.dataset(),i))}})}var LYt={};Ga(LYt,{Description:()=>ige,ErrorMessage:()=>oge,Input:()=>lge,Label:()=>age,Root:()=>dge,TextArea:()=>uge,TextField:()=>R1,useTextFieldContext:()=>rX});var sge=Tt();function rX(){const e=Lt(sge);if(e===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return e}function lge(e){return d(cge,f({type:"text"},e))}function cge(e){const t=Am(),n=rX(),r=ft({id:n.generateId("input")},e),[i,a,o]=Se(r,["onInput"],xYt),{fieldProps:s}=_Yt(a);return d(zt,f({as:"input",get id(){return s.id()},get name(){return t.name()},get value(){return n.value()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get"aria-label"(){return s.ariaLabel()},get"aria-labelledby"(){return s.ariaLabelledBy()},get"aria-describedby"(){return s.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},get onInput(){return Kn([i.onInput,n.onInput])}},()=>t.dataset(),o))}function dge(e){let t;const n=`textfield-${xr()}`,r=ft({id:n},e),[i,a,o]=Se(r,["ref","value","defaultValue","onChange"],bYt),s=i.value,[l,c]=G2({value:()=>s===void 0?void 0:i.value??"",defaultValue:()=>i.defaultValue,onChange:g=>i.onChange?.(g)}),{formControlContext:u}=wYt(a);MYt(()=>t,()=>c(i.defaultValue??""));const h=g=>{if(u.isReadOnly()||u.isDisabled())return;const y=g.target;c(y.value),y.value=l()??""},m={value:l,generateId:Io(()=>be(a.id)),onInput:h};return d(rge.Provider,{value:u,get children(){return d(sge.Provider,{value:m,get children(){return d(zt,f({as:"div",ref(g){var y=hn(v=>t=v,i.ref);typeof y=="function"&&y(g)},role:"group",get id(){return be(a.id)}},()=>u.dataset(),o))}})}})}function uge(e){let t;const n=rX(),r=ft({id:n.generateId("textarea")},e),[i,a]=Se(r,["ref","autoResize","submitOnEnter","onKeyPress"]);he(vn([()=>t,()=>i.autoResize,()=>n.value()],([s,l])=>{!s||!l||IYt(s)}));const o=s=>{t&&i.submitOnEnter&&s.key==="Enter"&&!s.shiftKey&&t.form&&(t.form.requestSubmit(),s.preventDefault())};return d(cge,f({as:"textarea",get"aria-multiline"(){return i.submitOnEnter?"false":void 0},get onKeyPress(){return Kn([i.onKeyPress,o])},ref(s){var l=hn(c=>t=c,i.ref);typeof l=="function"&&l(s)}},a))}function IYt(e){const t=e.style.alignSelf,n=e.style.overflow;"MozAppearance"in e.style||(e.style.overflow="hidden"),e.style.alignSelf="start",e.style.height="auto",e.style.height=`${e.scrollHeight+(e.offsetHeight-e.clientHeight)}px`,e.style.overflow=n,e.style.alignSelf=t}var R1=Object.assign(dge,{Description:ige,ErrorMessage:oge,Input:lge,Label:age,TextArea:uge}),NYt=ie("<div data-slot=input-wrapper>");function AYt(e){const t=M0(),[n,r]=Se(e,["name","defaultValue","value","onChange","onKeyDown","validationState","required","disabled","readOnly","class","label","hideLabel","description","error","variant","copyable","copyKind","multiline"]),[i,a]=Ce(!1),o=()=>i()?t.t("ui.textField.copied"):n.copyKind==="link"?t.t("ui.textField.copyLink"):t.t("ui.textField.copyToClipboard"),s=()=>i()?"check":n.copyKind==="link"?"link":"copy";async function l(){const u=n.value??n.defaultValue??"";await navigator.clipboard.writeText(u),a(!0),setTimeout(()=>a(!1),2e3)}function c(){n.copyable&&l()}return d(R1,{"data-component":"input",get"data-variant"(){return n.variant||"normal"},get name(){return n.name},get defaultValue(){return n.defaultValue},get value(){return n.value},get onChange(){return n.onChange},get onKeyDown(){return n.onKeyDown},onClick:c,get required(){return n.required},get disabled(){return n.disabled},get readOnly(){return n.readOnly},get validationState(){return n.validationState},get children(){return[d(ke,{get when(){return n.label},get children(){return d(R1.Label,{"data-slot":"input-label",get classList(){return{"sr-only":n.hideLabel}},get children(){return n.label}})}}),(()=>{var u=NYt();return K(u,d(ke,{get when(){return n.multiline},get fallback(){return d(R1.Input,f(r,{"data-slot":"input-input",get class(){return n.class}}))},get children(){return d(R1.TextArea,f(r,{autoResize:!0,"data-slot":"input-input",get class(){return n.class}}))}}),null),K(u,d(ke,{get when(){return n.copyable},get children(){return d(Ua,{get value(){return o()},placement:"top",gutter:4,get forceOpen(){return i()},skipDelayDuration:0,get children(){return d(Cr,{type:"button",get icon(){return s()},variant:"ghost",onClick:l,tabIndex:-1,"data-slot":"input-copy-button",get"aria-label"(){return o()}})}})}}),null),u})(),d(ke,{get when(){return n.description},get children(){return d(R1.Description,{"data-slot":"input-description",get children(){return n.description}})}}),d(R1.ErrorMessage,{"data-slot":"input-error",get children(){return n.error}})]}})}var $Yt=ie('<div class="relative flex-1 h-screen w-screen min-h-0 flex flex-col items-center justify-center bg-background-base font-sans"><div class="w-2/3 max-w-3xl flex flex-col items-center justify-center gap-8"><div class="flex flex-col items-center gap-2 text-center"><h1 class="text-lg font-medium text-text-strong"></h1><p class="text-sm text-text-weak"></p></div><div class="flex items-center gap-3"></div><div class="flex flex-col items-center gap-2"><div class="flex items-center justify-center gap-1"><button type=button class="flex items-center text-text-interactive-base gap-1"><div>'),TYt=ie('<p class="text-xs text-text-danger-base text-center max-w-2xl">'),EYt=ie('<p class="text-xs text-text-weak">');const ey=`
|
|
2564
|
+
...`:s,e.appendChild(g);const v=document.createElement("div");v.className="mention-preview-footer",v.style.cursor="pointer",v.innerHTML="<span>Click to open</span>",v.addEventListener("click",()=>{l?.(),i()}),e.appendChild(v),e.style.position="fixed";const k=8,b=360,x=Math.min(a.left,window.innerWidth-b-16);e.style.left=`${x}px`,e.style.width=`${b}px`,window.innerHeight-a.bottom-k>200?e.style.top=`${a.bottom+k}px`:e.style.bottom=`${window.innerHeight-a.top+k}px`,e.addEventListener("mouseenter",()=>{t=!0,n&&(clearTimeout(n),n=null)}),e.addEventListener("mouseleave",()=>{t=!1,n=setTimeout(()=>{t||i()},400)}),document.body.appendChild(e),requestAnimationFrame(()=>{e?.classList.add("is-visible")})}function i(){n&&(clearTimeout(n),n=null),t=!1,e&&(e.classList.remove("is-visible"),setTimeout(()=>{e?.remove(),e=null},150))}return{show:r,hide:i,isActive:()=>t||!!n}}const EHt='<svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="M10 4.5C5.5 4.5 2.5 10 2.5 10s3 5.5 7.5 5.5 7.5-5.5 7.5-5.5-3-5.5-7.5-5.5z"/><circle cx="10" cy="10" r="2.5"/></svg>',Rte='<svg width="14" height="14" viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5"><path d="M6.5 6.5L2 10l4.5 3.5M13.5 6.5L18 10l-4.5 3.5M11.5 4.5l-3 11"/></svg>';function PHt(e,t){const n=Array.from(e.querySelectorAll("pre")).filter(r=>xpe(r)==="mermaid");for(const r of n){const i=r.querySelector("code")?.textContent??"";if(!i.trim())continue;const a=r.closest('[data-component="markdown-code"]')??r;a.getAttribute("data-mermaid")||(a.setAttribute("data-mermaid","pending"),hHt(i,t).then(o=>{const s=document.createElement("div");s.setAttribute("data-component","mermaid-block");const l=document.createElement("div");l.setAttribute("data-component","mermaid-block-header");const c=document.createElement("span");c.setAttribute("data-component","code-block-lang"),c.textContent="mermaid";const u=document.createElement("button");u.type="button",u.setAttribute("data-component","mermaid-toggle"),u.setAttribute("aria-label","Show code"),u.innerHTML=Rte,l.appendChild(c),l.appendChild(u),s.appendChild(l);const h=document.createElement("div");h.setAttribute("data-component","mermaid-diagram"),h.innerHTML=o,s.appendChild(h);const m=a.cloneNode(!0);m.removeAttribute("data-mermaid"),m.style.display="none",s.appendChild(m);let g=!0;u.addEventListener("click",()=>{g=!g,h.style.display=g?"":"none",m.style.display=g?"none":"",u.innerHTML=g?Rte:EHt,u.setAttribute("aria-label",g?"Show code":"Show diagram")}),a.replaceWith(s)}).catch(()=>{a.removeAttribute("data-mermaid")}))}}function DHt(e){const t=Array.from(e.querySelectorAll("pre")).filter(n=>xpe(n)==="csv");for(const n of t){const r=n.querySelector("code")?.textContent??"";if(!r.trim())continue;const i=wpe(r);if(!i)continue;const a=n.closest('[data-component="markdown-code"]')??n,o=document.createElement("div");o.innerHTML=yHt(i);const s=o.firstElementChild;s&&a.replaceWith(s)}}function OHt(e,t){const n=new Map,r=o=>{const s=t(),l=o.getAttribute("data-copied")==="true";AR(o,s,l)},i=async o=>{const s=o.target;if(!(s instanceof Element))return;const l=s.closest('[data-slot="markdown-copy-button"]');if(!(l instanceof HTMLButtonElement))return;const u=l.closest('[data-component="markdown-code"]')?.querySelector("code")?.textContent??"";if(!u)return;const h=navigator?.clipboard;if(!h)return;await h.writeText(u);const m=t();AR(l,m,!0);const g=n.get(l);g&&clearTimeout(g);const y=setTimeout(()=>AR(l,m,!1),2e3);n.set(l,y)},a=Array.from(e.querySelectorAll('[data-slot="markdown-copy-button"]'));for(const o of a)o instanceof HTMLButtonElement&&r(o);return e.addEventListener("click",i),()=>{e.removeEventListener("click",i);for(const o of n.values())clearTimeout(o)}}function zte(e,t){if(ph.delete(e),ph.set(e,t),ph.size<=bHt)return;const n=ph.keys().next().value;n&&ph.delete(n)}function RHt(e){const[t,n]=Se(e,["text","cacheKey","streaming","class","classList","onLinkClick","fileFetch"]),r=Y9e(),i=M0(),[a,o]=Ce(),[s]=Yr(()=>({text:t.text,key:t.cacheKey,streaming:t.streaming??!1}),async v=>{if(!v.text)return"";const k=v.key??Wh(v.text);return Promise.all(sHt(v.text,v.streaming).map(async(b,x)=>{const w=Wh(b.raw),M=k?`${k}:${x}:${b.mode}`:w;if(M&&w){const L=ph.get(M);if(L&&L.hash===w)return zte(M,L),L.html}const _=await Promise.resolve(r.parse(b.src)),C=xHt(_);return M&&w&&zte(M,{hash:w,html:C}),C})).then(b=>b.join("")).catch(()=>Pte(v.text))},{initialValue:Pte(t.text)});let l;const c=THt(),u=new Map,h=v=>{const k=v.target;if(!(k instanceof Element))return;const b=k.closest("a[href]");if(!(b instanceof HTMLAnchorElement))return;const x=b.getAttribute("href");x&&(/^(?:https?|mailto|tel|blob|data):/.test(x)||v.preventDefault(),t.onLinkClick?.(x,v))},m=v=>{if(!t.fileFetch)return;const k=v.target;if(!(k instanceof Element))return;const b=k.closest("a.file-link");if(!b){c.isActive()||c.hide();return}const x=b.getAttribute("data-file-path");if(!x)return;const w=()=>{const C=b.getAttribute("href")||x;t.onLinkClick?.(C,new MouseEvent("click"))},M=C=>{const L=b.getAttribute("href")||x,S=C.startsWith("http")||C.startsWith("/")||C.startsWith("./")||C.startsWith("#")?C:`./${C}`;b.setAttribute("href",S),b.setAttribute("data-file-path",C);const I=a();if(!I)return;b.textContent?.replace(/^\s*\S+\s*/,"");const A=u.get(x);A&&(u.delete(x),u.set(C,A)),I.dispatchEvent(new CustomEvent("fileLinkUpdated",{bubbles:!0,detail:{oldHref:L,newHref:S,oldPath:x,newPath:C}}))},_=u.get(x);if(_){c.show(b.getBoundingClientRect(),x,_,w,M);return}t.fileFetch(x).then(C=>{C&&(u.set(x,C),b.matches(":hover")&&c.show(b.getBoundingClientRect(),x,C,w,M))})},g=v=>{const k=v.relatedTarget;k?.closest?.(".mention-preview")||k?.closest?.("a.file-link")},y=v=>{if(v.type==="mousedown"&&!c.isActive()){c.hide();return}if(v.type==="scroll"){if(c.isActive())return;c.hide()}};return he(()=>{const v=vye(),k=a(),b=t.text?s.latest??s()??"":"";if(!k)return;if(!b){k.innerHTML="";return}const x={copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")},w=document.createElement("div");w.innerHTML=b,$Ht(w,x,v.mediaUrl),Gqt(k,w,{childrenOnly:!0,onBeforeElUpdated:(M,_)=>(M instanceof HTMLButtonElement&&_ instanceof HTMLButtonElement&&M.getAttribute("data-slot")==="markdown-copy-button"&&_.getAttribute("data-slot")==="markdown-copy-button"&&M.getAttribute("data-copied")==="true"&&AR(_,x,!0),!M.isEqualNode(_))}),DHt(k),PHt(k,vHt()),l||(l=OHt(k,()=>({copy:i.t("ui.message.copy"),copied:i.t("ui.message.copied")}))),t.onLinkClick&&k.addEventListener("click",h),t.fileFetch&&(k.addEventListener("mouseover",m),k.addEventListener("mouseout",g),document.addEventListener("scroll",y,{passive:!0,capture:!0}),document.addEventListener("mousedown",y,{capture:!0}))}),me(()=>{l&&l(),c.hide();const v=a();v&&(t.onLinkClick&&v.removeEventListener("click",h),t.fileFetch&&(v.removeEventListener("mouseover",m),v.removeEventListener("mouseout",g),document.removeEventListener("scroll",y,{capture:!0}),document.removeEventListener("mousedown",y,{capture:!0})))}),(()=>{var v=kHt();return Hr(o,v),ki(v,f({get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}},n),!1,!1),v})()}var zHt=ie("<svg>"),qHt=ie("<svg><rect width=3 height=3 rx=1></svg>",!1,!0,!1);const jHt=new Set([1,2,4,7,8,11,13,14]),HHt=new Set([0,3,12,15]),FHt=Array.from({length:16},(e,t)=>({id:t,x:t%4*4,y:Math.floor(t/4)*4,delay:Math.random()*1.5,duration:1+Math.random()*1,outer:jHt.has(t),corner:HHt.has(t)}));function D2(e){return(()=>{var t=zHt();return ki(t,f(e,{viewBox:"0 0 15 15","data-component":"spinner",get classList(){return{...e.classList??{},[e.class??""]:!!e.class}},fill:"currentColor"}),!0,!0),K(t,d(Qt,{each:FHt,children:n=>(()=>{var r=qHt();return Qe(i=>{var a=n.x,o=n.y,s=n.corner?0:void 0,l=n.corner?void 0:`${n.outer?"pulse-opacity-dim":"pulse-opacity"} ${n.duration}s ease-in-out infinite`,c=n.corner?void 0:"both",u=n.corner?void 0:`${n.delay}s`;return a!==i.e&>(r,"x",i.e=a),o!==i.t&>(r,"y",i.t=o),s!==i.a&&kr(r,"opacity",i.a=s),l!==i.o&&kr(r,"animation",i.o=l),c!==i.i&&kr(r,"animation-fill-mode",i.i=c),u!==i.n&&kr(r,"animation-delay",i.n=u),i},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0}),r})()})),t})()}var VHt=ie('<div class="h-full flex items-center justify-center text-text-weak">Unable to parse CSV'),BHt=ie('<div data-component=csv-table-editor class="h-full overflow-auto"><table data-slot=csv-table-inner class="w-full border-collapse text-13-regular"><thead class="sticky top-0 z-10"><tr></tr></thead><tbody>'),UHt=ie("<span class=text-text-weak>"),WHt=ie('<th data-slot=csv-th class="px-3 py-2 text-left font-medium text-text-base border-b border-border-weaker-base cursor-pointer select-none hover:bg-surface-raised-base/20 transition-colors"><span class="inline-flex items-center gap-1">'),GHt=ie("<tr class=bg-transparent>"),ZHt=ie('<input type=text class="bg-transparent border border-border-weak-base rounded px-1.5 py-0.5 text-13-regular text-text-base outline-none focus:border-border-base w-full min-w-[60px]"autofocus>'),KHt=ie('<td data-slot=csv-td class="px-3 py-1.5 text-text-base border-b border-border-weaker-base whitespace-nowrap bg-transparent">');function XHt(e){const t=()=>!!e.onChange,[n,r]=Ce(void 0),[i,a]=Ce(!0),[o,s]=Ce(null),[l,c]=Ce(""),u=Z(()=>wpe(e.value)),h=Z(()=>{const v=u();if(!v)return;const k=n();if(k==null)return v;const b=[...v.rows].sort((x,w)=>{const M=x[k]??"",_=w[k]??"",C=Number(M),L=Number(_);return!isNaN(C)&&!isNaN(L)?i()?C-L:L-C:i()?M.localeCompare(_):_.localeCompare(M)});return{headers:v.headers,rows:b}}),m=(v,k,b)=>{if(!e.onChange)return;const x=u();if(!x)return;const w=x.rows.map((M,_)=>_===v?M.map((C,L)=>L===k?b:C):M);e.onChange(gHt({headers:x.headers,rows:w})),s(null)},g=(v,k,b)=>{t()&&(s({row:v,col:k}),c(b))},y=v=>{n()===v?a(!i()):(r(v),a(!0))};return d(ke,{get when(){return h()},get fallback(){return VHt()},children:v=>(()=>{var k=BHt(),b=k.firstChild,x=b.firstChild,w=x.firstChild,M=x.nextSibling;return K(w,d(Qt,{get each(){return v().headers},children:(_,C)=>(()=>{var L=WHt(),S=L.firstChild;return L.$$click=()=>y(C()),K(S,_,null),K(S,d(ke,{get when(){return n()===C()},get children(){var I=UHt();return K(I,()=>i()?"↑":"↓"),I}}),null),L})()})),K(M,d(Qt,{get each(){return v().rows},children:(_,C)=>(()=>{var L=GHt();return K(L,d(Qt,{each:_,children:(S,I)=>{const A=()=>o()?.row===C()&&o()?.col===I();return(()=>{var D=KHt();return D.$$dblclick=()=>g(C(),I(),S),K(D,d(ke,{get when(){return A()},fallback:S,get children(){var P=ZHt();return P.$$keydown=O=>{O.key==="Enter"&&m(C(),I(),l()),O.key==="Escape"&&s(null)},P.addEventListener("blur",()=>m(C(),I(),l())),P.$$input=O=>c(O.currentTarget.value),Qe(()=>P.value=l()),P}})),D})()}})),L})()})),k})()})}li(["click","dblclick","input","keydown"]);var YHt=ie('<svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>');const bp={backlog:"#8f8f8f",queue:"#38bdf8",in_progress:"#f59e0b",paused:"#bc8cff",closed:"#10b981",issue:"#e879f9",agent:"#38bdf8",project:"#f472b6",memory:"#a78bfa",mcp:"#34d399",sprite:"#fb923c",workunit:"#60a5fa",cycle:"#22d3ee",epic:"#f43f5e",roadmap:"#a3e635",suggestion:"#fbbf24",file:"#14b8a6",directory:"#eab308",milestone:"#3b82f6",decision:"#c084fc",branch:"#fde047"},JHt={project:[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17"}]],issue:[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"}],["path",{d:"M13 5v2"}],["path",{d:"M13 17v2"}],["path",{d:"M13 11v2"}]],agent:[["path",{d:"M12 8V4H8"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}],["path",{d:"M2 14h2"}],["path",{d:"M20 14h2"}],["path",{d:"M15 13v2"}],["path",{d:"M9 13v2"}]],memory:[["path",{d:"M12 18V5"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77"}]],mcp:[["path",{d:"M12 22v-5"}],["path",{d:"M15 8V2"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z"}],["path",{d:"M9 8V2"}]],sprite:[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z"}],["path",{d:"M20 2v4"}],["path",{d:"M22 4h-4"}],["circle",{cx:"4",cy:"20",r:"2"}]],workunit:[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344"}],["path",{d:"m9 11 3 3L22 4"}]],cycle:[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}],["path",{d:"M21 3v5h-5"}]],epic:[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528"}]],roadmap:[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"}],["path",{d:"M15 5.764v15"}],["path",{d:"M9 3.236v15"}]],suggestion:[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5"}],["path",{d:"M9 18h6"}],["path",{d:"M10 22h4"}]],file:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}]],directory:[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"}]],milestone:[["path",{d:"M12 13v8"}],["path",{d:"M12 3v3"}],["path",{d:"M18.172 6a2 2 0 0 1 1.414.586l2.06 2.06a1.207 1.207 0 0 1 0 1.708l-2.06 2.06a2 2 0 0 1-1.414.586H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z"}]],decision:[["path",{d:"M12 3v18"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7"}],["path",{d:"M7 21h10"}]],branch:[["path",{d:"M15 6a9 9 0 0 0-9 9V3"}],["circle",{cx:"18",cy:"6",r:"3"}],["circle",{cx:"6",cy:"18",r:"3"}]],entity:[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]]};function QHt(e){return e.map(([t,n])=>{const r=Object.entries(n).map(([i,a])=>`${i}="${a}"`).join(" ");return`<${t} ${r} />`}).join("")}const ZF=Object.fromEntries(Object.entries(JHt).map(([e,t])=>[e,QHt(t)])),bQt="0 0 24 24";function _pe(e,t){return e&&bp[e]?bp[e]:t&&bp[t]?bp[t]:bp.backlog}function eFt(e){return e&&ZF[e]?ZF[e]:ZF.entity}function wQt(e,t="entity"){if(!e)return t;const n=e.includes(":")?e.split(":")[0]:t;return n==="dir"?"directory":n||t}function tFt(e){const t=()=>e.size??14;return(()=>{var n=YHt();return Qe(r=>{var i=t(),a=t(),o=`shrink-0 ${e.class??""}`,s=e.color??_pe(e.type),l=eFt(e.type);return i!==r.e&>(n,"width",r.e=i),a!==r.t&>(n,"height",r.t=a),o!==r.a&>(n,"class",r.a=o),s!==r.o&&kr(n,"color",r.o=s),l!==r.i&&(n.innerHTML=r.i=l),r},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),n})()}var nFt=ie('<div class="rounded-md border border-border-base bg-background-base px-3 py-2 text-12-regular text-text-weak">Preview unavailable'),rFt=ie('<div class="rounded-md border border-border-base bg-background-base overflow-hidden h-full flex flex-col">'),iFt=ie('<div class="h-full overflow-auto p-3">'),aFt=ie('<div class="h-full overflow-auto">'),oFt=ie('<div class="h-full overflow-auto p-4">'),sFt=ie('<div class="relative h-full w-full overflow-visible">'),lFt=ie('<button class="inline-flex items-center gap-1 rounded-md px-1.5 py-1 text-xs text-text-weak hover:text-text-base hover:bg-surface-raised-base/60 transition-colors"><span class="truncate max-w-40">'),cFt=ie('<div class="absolute inset-0 rounded-xl border border-border-weaker-base bg-surface-base shadow-xl flex flex-col overflow-hidden"style="transform-origin:center center;transition:transform 200ms ease, filter 200ms ease"><div class="shrink-0 border-b border-border-weaker-base px-4 py-3 flex items-center gap-3"><div class="flex-1 min-w-0 flex items-center gap-2"><span class="inline-flex items-center gap-1 rounded-full bg-surface-raised-base px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide"></span><span class="truncate text-12-medium text-text-strong font-mono"></span></div></div><div class="min-h-0 flex-1 overflow-hidden">'),dFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">Attributes</div><div class="flex flex-col gap-1.5">'),uFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">Links</div><div class="flex flex-col gap-1">'),hFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">References</div><div class="flex flex-col gap-1">'),fFt=ie('<div class="flex flex-col gap-2"><div class="text-11-semibold uppercase tracking-wide text-text-weak flex items-center gap-1.5">Backlinks</div><div class="flex flex-col gap-1">'),pFt=ie('<div class="w-72 shrink-0 border-l border-border-weaker-base bg-surface-raised-base/30 flex flex-col"><div class="flex-1 overflow-y-auto p-3 flex flex-col gap-4">'),mFt=ie('<div class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5"><div class="text-10-medium uppercase tracking-wide text-text-weaker"></div><div class="mt-0.5 text-11-regular text-text-strong truncate">'),gFt=ie('<button class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 text-left hover:bg-surface-raised-base/60 transition-colors"><div class="text-10-medium uppercase tracking-wide text-text-weaker"></div><div class="mt-0.5 text-11-medium text-text-strong font-mono truncate">'),yFt=ie('<div class="text-10-regular text-text-warning capitalize">'),vFt=ie('<button class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 text-left transition-colors flex items-start gap-1.5"><div class="flex-1 min-w-0"><div class="text-11-medium text-text-strong font-mono truncate">'),kFt=ie('<div class="rounded-md border border-border-base/60 bg-background-base px-2.5 py-1.5 flex items-start gap-1.5"><div class="flex-1 min-w-0"><div class="text-11-medium text-text-strong font-mono truncate"></div><div class="text-10-regular text-text-weak truncate">Line '),bFt=ie('<div class="flex h-full"><div class="flex-1 min-h-0 overflow-auto p-4">'),wFt=ie('<div class="flex flex-col items-center gap-2 py-8 text-text-weak"><div class=text-12-regular>Loading details...'),xFt=ie('<div class="text-13-regular text-text-base whitespace-pre-wrap">'),_Ft=ie('<div class="flex flex-wrap gap-1.5">'),MFt=ie('<div class="flex items-center gap-2 flex-wrap">'),SFt=ie('<div class="flex items-center gap-2 p-2 rounded-md bg-background-base border border-border-base">'),CFt=ie('<div class="p-3 rounded-md bg-background-base border border-border-base flex flex-col gap-2"><div class="flex items-center gap-2">'),LFt=ie('<div class="flex flex-col gap-3"><div class="text-12-medium uppercase tracking-wide text-text-weak">Decision Traces</div><div class="flex flex-col gap-2 max-h-[200px] overflow-y-auto">'),IFt=ie('<div class="flex justify-between"><span>Assignee</span><span>'),NFt=ie('<div class="flex justify-between"><span>Branch</span><span class=text-11-mono>'),AFt=ie('<div class="flex flex-col gap-4"><div class="flex items-center gap-2"><span class="text-12-medium text-text-info"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span><span class="text-10-medium uppercase rounded px-1.5 py-0.5 bg-surface-raised-base text-text-weak"></span></div><h1 class="text-16-semibold text-text-strong leading-tight"></h1><div class="flex flex-col gap-3"><div class="flex items-center justify-between"><div class="text-12-medium uppercase tracking-wide text-text-weak">Acceptance Criteria</div><div class="flex items-center gap-1"></div></div><div class="flex flex-col gap-2 max-h-[300px] overflow-y-auto"></div></div><div class="pt-4 border-t border-border-weaker-base flex flex-col gap-3 text-12-regular text-text-weak"><div class="flex justify-between"><span>Created</span><span>'),$Ft=ie('<span class="rounded-full bg-surface-raised-base px-2.5 py-0.5 text-11-medium text-text-weak">'),TFt=ie('<div class="text-12-regular text-text-weaker italic">No criteria defined'),EFt=ie('<code class="text-11-mono text-text-weak block mt-1 p-1 rounded bg-surface-raised-base truncate">'),PFt=ie('<pre class="mt-1 p-2 rounded bg-background-stronger text-11-mono text-text-weak overflow-x-auto max-h-24">'),DFt=ie('<div class="p-3 rounded-md bg-background-base border border-border-base flex flex-col gap-2"><div class="flex items-start gap-3"><button class="mt-1 shrink-0 cursor-pointer hover:opacity-70 transition-opacity"title="Click to toggle status"></button><div class="flex-1 min-w-0"><div class="text-13-medium text-text-strong leading-normal">'),OFt=ie('<div class="size-3 rounded-full border-2 border-border-strong-base">'),RFt=ie('<div class="text-11-regular text-text-weak truncate">'),zFt=ie('<div class="p-2 rounded-md bg-background-base border border-border-base flex items-start gap-2"><div class="flex-1 min-w-0"><div class="text-12-medium text-text-strong"></div></div><div class="shrink-0 text-11-regular text-text-weaker whitespace-nowrap">'),qFt=ie('<div class="flex flex-col gap-2 flex-1 min-h-0">'),jFt=ie('<div class="flex flex-col gap-1.5 max-h-[220px] overflow-y-auto">'),HFt=ie('<div class="flex flex-col gap-2"><div class="text-12-medium uppercase tracking-wide text-text-weak">Contents'),FFt=ie('<div class="flex flex-col gap-2"><div class="text-11-medium uppercase tracking-wide text-text-weak">Recent Ops</div><div class="flex flex-col gap-1 max-h-[180px] overflow-y-auto">'),VFt=ie('<div class="flex h-full"><div class="flex-1 min-h-0 overflow-auto p-0 flex flex-col gap-4">'),BFt=ie('<div class="flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>Loading file...'),UFt=ie('<div class="flex items-center gap-2 rounded-md border border-border-base bg-background-base px-3 py-2 text-text-weak"><span class=text-12-regular>Loading directory...'),WFt=ie('<div class="rounded-md border border-border-base bg-background-base px-3 py-2 text-12-regular text-text-weak">Empty directory'),GFt=ie('<button class="rounded-md border border-border-base bg-background-base px-3 py-2 text-left hover:bg-surface-raised-base/60 transition-colors"><div class="flex items-center gap-2"><span class="rounded-full bg-surface-raised-base px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide text-text-weak"></span><span class="truncate text-12-medium text-text-strong"></span></div><div class="mt-1 truncate text-11-regular text-text-weak font-mono">'),ZFt=ie('<div class="rounded-md border border-border-base bg-background-base px-2 py-1.5 text-11-regular text-text-weak"><div class="truncate font-mono"></div><div class=text-text-weaker>'),KFt=ie('<span class="w-2 h-2 rounded-full bg-text-success shrink-0 mt-1">');const qte={w:760,h:620},hU=Tt();function jte(e,t,n){return Math.max(t,Math.min(e,n))}function XFt(e,t){return t||e.includes(":")&&e.split(":")[0]||"entity"}function YFt(e,t){return e.includes(":")?e:t==="issue"?`issue:${e}`:e}function Gz(e){return e.includes(":")?e.split(":").slice(1).join(":"):e}function Mpe(e){const t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?`${Math.round(t/6e4)}m ago`:t<864e5?`${Math.round(t/36e5)}h ago`:`${Math.round(t/864e5)}d ago`}const JFt=new Set(["title","name","message","description","purpose","summary","type","kind"]);function Hte(e){return e.split("/").pop()||e}function fU(e){return typeof e=="string"?e:typeof e=="number"||typeof e=="boolean"?String(e):JSON.stringify(e,null,2)??""}function Fte(e,t){const n=t.flatMap(r=>e?.facts.filter(i=>i.a===r)??[])[0];return n?fU(n.v):void 0}function QFt(e){return/\.(md|markdown|mdx|note)$/i.test(e)}function eVt(e){return/\.csv$/i.test(e)}function Vte(e){return e.replaceAll("\\","/").replace(/\/+/g,"/")}function Bte(e,t){const n=t.split("#")[0]?.split("?")[0]?.trim();if(!n||/^(?:[a-z]+:|\/\/)/i.test(n))return;const r=Vte(n);if(r.startsWith("/"))return r.replace(/^\/+/,"");const i=Vte(e).split("/").slice(0,-1);for(const a of r.split("/"))if(!(!a||a===".")){if(a===".."){i.pop();continue}i.push(a)}return i.join("/")}function tVt(e){const t=Ef(),n=Z(()=>{if(!(!e.file||e.file.type!=="text"||e.file.encoding==="base64"))return e.file.content}),r=Z(()=>{const l=n();if(!(!l||!QFt(e.path)))return l}),i=Z(()=>{const l=n();if(!(!l||!eVt(e.path)))return l}),a=Z(()=>lB(e.file?.content??"")),o=l=>t.sdk.client.file.read({path:l}).then(c=>c.data).catch(()=>{}),s=async l=>{const c=await o(l);if(!(!c||c.type!=="text"||c.encoding==="base64"))return c.content};return d(ke,{get when(){return e.file},get fallback(){return nFt()},children:l=>(()=>{var c=rFt();return K(c,d(ke,{get when(){return r()},get fallback(){return d(ke,{get when(){return i()},get fallback(){return(()=>{var u=iFt();return K(u,d(Qse,{mode:"text",get file(){return{name:e.path,contents:l().content,cacheKey:a()}},class:"text-11-mono",get media(){return{mode:"auto",path:e.path,current:l(),readFile:o}}})),u})()},children:u=>(()=>{var h=aFt();return K(h,d(XHt,{get value(){return u()}})),h})()})},children:u=>d(Qne,{data:nVt,get directory(){return t.sdk.directory},get mediaUrl(){return t.sdk.url},get children(){var h=oFt();return K(h,d(RHt,{get text(){return u()},get cacheKey(){return a()},onLinkClick:m=>{const g=Bte(e.path,m);g&&t.push(`file:${g}`,"file")},fileFetch:m=>{const g=Bte(e.path,m);return g?s(g):Promise.resolve(void 0)}})),h}})})),c})()})}const nVt={session:[],session_status:{},session_diff:{},message:{},part:{}};function rVt(e){const t=lf(),n=ape(),r=Cf(),[i,a]=nt({stack:[],size:qte,open:!1,closing:!1}),o={stack:()=>i.stack,size:()=>i.size,trellis:n,sdk:r,push(s,l){const c=YFt(s,l);a("stack",Je(u=>{u[u.length-1]?.id!==c&&u.push({key:`${c}:${Date.now()}`,id:c,type:XFt(c,l)})}))},pop(){if(i.stack.length<=1){a("stack",[]);return}a("stack",i.stack.slice(0,-1))},clear(){a("stack",[])},setSize(s,l){a("size",{w:jte(s,560,Math.min(920,window.innerWidth-96)),h:jte(l,420,Math.min(760,window.innerHeight-120))})},getTransform(s){const l=i.stack.length-1-s;return l<=0?{scale:1,offsetY:16,brightness:1,interactive:!0}:{scale:Math.max(.82,1-l*.04),offsetY:l*-28,brightness:Math.max(.5,1-l*.14),interactive:!1}}};return he(()=>{if(i.stack.length>0){!i.open&&!i.closing&&(a("open",!0),t.show(()=>d(hU.Provider,{value:o,get children(){return d(iVt,{})}}),()=>{ct(()=>{a("open",!1),a("closing",!1),a("stack",[]),a("size",qte)})}));return}i.open&&!i.closing&&(a("closing",!0),t.close())}),d(hU.Provider,{value:o,get children(){return e.children}})}function Ef(){const e=Lt(hU);if(!e)throw new Error("useEntityDialog must be used within EntityDialogProvider");return e}function iVt(){const e=Ef();return d(jz,{size:"x-large",transition:!0,class:"!h-full !bg-transparent !shadow-none !overflow-visible",get children(){var t=sFt();return K(t,d(Qt,{get each(){return e.stack()},children:(n,r)=>d(aVt,{entry:n,get index(){return r()}})})),t}})}function aVt(e){const t=Ef(),n=Z(()=>t.getTransform(e.index)),r=Z(()=>e.index===t.stack().length-1),i=Z(()=>t.stack()[e.index-1]);return(()=>{var a=cFt(),o=a.firstChild,s=o.firstChild,l=s.firstChild,c=l.nextSibling,u=o.nextSibling;return K(o,d(ke,{get when(){return e.index>0},get children(){var h=lFt(),m=h.firstChild;return h.$$click=()=>t.pop(),K(h,d(Kt,{name:"arrow-left",size:"small"}),m),K(m,(()=>{var g=bt(()=>!!i());return()=>g()?Gz(i().id):"Back"})()),h}}),s),K(l,d(tFt,{get type(){return e.entry.type},size:12}),null),K(l,()=>e.entry.type,null),K(c,()=>Gz(e.entry.id)),K(o,d(ke,{get when(){return r()},get children(){return d(Cr,{icon:"close-small",variant:"ghost",onClick:()=>t.clear()})}}),null),K(u,d(ke,{get when(){return e.entry.type==="issue"},get fallback(){return d(Cpe,{get id(){return e.entry.id},get type(){return e.entry.type}})},get children(){return d(oVt,{get id(){return e.entry.id}})}})),Qe(h=>{var m=`translateY(${n().offsetY}px) scale(${n().scale})`,g=`brightness(${n().brightness})`,y=n().interactive?"auto":"none",v=`${100+e.index}`,k=_pe(e.entry.type);return m!==h.e&&kr(a,"transform",h.e=m),g!==h.t&&kr(a,"filter",h.t=g),y!==h.a&&kr(a,"pointer-events",h.a=y),v!==h.o&&kr(a,"z-index",h.o=v),k!==h.i&&kr(l,"color",h.i=k),h},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()}function Spe(e){const t=Ef(),[n]=Yr(()=>e.entityId,t.trellis.fetchEntity),[r]=Yr(()=>e.entityId,t.trellis.fetchRefs),i=Z(()=>(n()?.facts??[]).filter(s=>!JFt.has(s.a))),a=Z(()=>n()?.links??[]),o=Z(()=>i().length>0||a().length>0||(r()?.outgoing.length??0)>0||(r()?.incoming.length??0)>0);return d(ke,{get when(){return o()},get children(){var s=pFt(),l=s.firstChild;return K(l,d(ke,{get when(){return i().length>0},get children(){var c=dFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"tag",size:"small"}),h),K(m,d(Qt,{get each(){return i().slice(0,24)},children:g=>(()=>{var y=mFt(),v=y.firstChild,k=v.nextSibling;return K(v,()=>g.a),K(k,()=>fU(g.v)),Qe(()=>gt(k,"title",fU(g.v))),y})()})),c}}),null),K(l,d(ke,{get when(){return a().length>0},get children(){var c=uFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"arrow-right",size:"small"}),h),K(m,d(Qt,{get each(){return a().slice(0,16)},children:g=>(()=>{var y=gFt(),v=y.firstChild,k=v.nextSibling;return y.$$click=()=>t.push(g.e2),K(v,()=>g.a),K(k,()=>Gz(g.e2)),y})()})),c}}),null),K(l,d(ke,{get when(){return(r()?.outgoing.length??0)>0},get children(){var c=hFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"link",size:"small"}),h),K(m,d(Qt,{get each(){return r()?.outgoing},children:g=>{const y=`${g.namespace}:${g.target}`,v=g.state==="resolved"&&!!g.namespace&&!!g.target;return(()=>{var k=vFt(),b=k.firstChild,x=b.firstChild;return k.$$click=()=>v&&t.push(y,g.namespace),K(k,d(sVt,{get state(){return g.state}}),b),K(x,()=>g.title??y),K(b,d(ke,{get when(){return g.state!=="resolved"},get children(){var w=yFt();return K(w,()=>g.state,null),K(w,(()=>{var M=bt(()=>!!g.staleReason);return()=>M()?` (${g.staleReason})`:""})(),null),w}}),null),Qe(w=>hr(k,{"hover:bg-surface-raised-base/60 cursor-pointer":v,"cursor-default":!v},w)),k})()}})),c}}),null),K(l,d(ke,{get when(){return(r()?.incoming.length??0)>0},get children(){var c=fFt(),u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(u,d(Kt,{name:"arrow-left",size:"small"}),h),K(m,d(Qt,{get each(){return r()?.incoming},children:g=>(()=>{var y=kFt(),v=y.firstChild,k=v.firstChild,b=k.nextSibling;return b.firstChild,K(y,d(Kt,{name:"link",size:"small",class:"mt-0.5 shrink-0 text-icon-weak"}),v),K(k,()=>g.filePath),K(b,()=>g.line,null),y})()})),c}}),null),s}})}function oVt(e){const n=Ef().trellis,[r,i]=nt({busy:!1,adding:!1,newAcDesc:"",newAcCmd:"",assigning:!1,assignee:""}),a=Z(()=>e.id.replace(/^issue:/,"")),[o,s]=Yr(a,g=>n.getIssue(g)),[l]=Yr(a,g=>n.fetchDecisionChain(`issue:${g}`)),c=async g=>{i("busy",!0);try{await g(),await n.refresh(),s.refetch()}catch(y){console.error("[entity-dialog] action failed:",y)}finally{i("busy",!1)}},u=Z(()=>{const g=o();if(!g)return[];const y=[];return g.status==="backlog"&&y.push({label:"Triage",run:()=>void c(()=>n.triageIssue(a()))}),(g.status==="backlog"||g.status==="queue")&&y.push({label:"Start",run:()=>void c(()=>n.startIssue(a()))}),g.status==="in_progress"&&y.push({label:"Pause",run:()=>void c(()=>n.pauseIssue(a()))}),g.status==="paused"&&y.push({label:"Resume",run:()=>void c(()=>n.resumeIssue(a()))}),(g.status==="in_progress"||g.status==="paused")&&y.push({label:"Close",run:()=>void c(()=>n.closeIssue(a(),!0))}),g.status==="closed"&&y.push({label:"Reopen",run:()=>void c(()=>n.reopenIssue(a()))}),y}),h=async()=>{const g=r.newAcDesc.trim();g&&(await c(()=>n.addCriterion(a(),g,r.newAcCmd.trim()||void 0)),ct(()=>{i("newAcDesc",""),i("newAcCmd",""),i("adding",!1)}))},m=async()=>{const g=r.assignee.trim();g&&(await c(()=>n.assignIssue(a(),g)),ct(()=>{i("assignee",""),i("assigning",!1)}))};return(()=>{var g=bFt(),y=g.firstChild;return K(y,d(ke,{get when(){return!o.loading},get fallback(){return(()=>{var v=wFt(),k=v.firstChild;return K(v,d(D2,{}),k),v})()},get children(){return d(ke,{get when(){return o()},get fallback(){return d(Cpe,{get id(){return e.id},type:"issue"})},children:v=>(()=>{var k=AFt(),b=k.firstChild,x=b.firstChild,w=x.nextSibling,M=w.nextSibling,_=b.nextSibling,C=_.nextSibling,L=C.firstChild,S=L.firstChild,I=S.nextSibling,A=L.nextSibling,D=C.nextSibling,P=D.firstChild,O=P.firstChild,E=O.nextSibling;return K(x,()=>v().id),K(w,()=>v().priority),K(M,()=>v().status),K(_,()=>v().title),K(k,d(ke,{get when(){return v().description},get children(){var T=xFt();return K(T,()=>v().description),T}}),C),K(k,d(ke,{get when(){return v().labels.length>0},get children(){var T=_Ft();return K(T,d(Qt,{get each(){return v().labels},children:R=>(()=>{var H=$Ft();return K(H,R),H})()})),T}}),C),K(k,d(ke,{get when(){return u().length>0},get children(){var T=MFt();return K(T,d(Qt,{get each(){return u()},children:R=>d(Mn,{size:"small",variant:"ghost",get onClick(){return R.run},get disabled(){return r.busy},get children(){return R.label}})}),null),K(T,d(ke,{get when(){return!r.assigning},get children(){return d(Mn,{size:"small",variant:"ghost",onClick:()=>i("assigning",!0),get disabled(){return r.busy},children:"Assign"})}}),null),T}}),C),K(k,d(ke,{get when(){return r.assigning},get children(){var T=SFt();return K(T,d(LR,{placeholder:"Agent ID...",get value(){return r.assignee},onInput:R=>i("assignee",R.target.value),onKeyDown:R=>R.key==="Enter"&&void m(),class:"flex-1",autofocus:!0}),null),K(T,d(Cr,{icon:"check-small",variant:"ghost",onClick:()=>void m(),get disabled(){return!r.assignee.trim()}}),null),K(T,d(Cr,{icon:"close-small",variant:"ghost",onClick:()=>i("assigning",!1)}),null),T}}),C),K(I,d(Mn,{size:"small",variant:"ghost",onClick:()=>i("adding",!0),get disabled(){return r.adding},children:"Add"}),null),K(I,d(Mn,{size:"small",variant:"ghost",onClick:()=>void c(async()=>{await n.runCriteria(a())}),get disabled(){return r.busy},children:"Run All"}),null),K(A,d(Qt,{get each(){return v().criteria},get fallback(){return TFt()},children:(T,R)=>(()=>{var H=DFt(),Y=H.firstChild,j=Y.firstChild,X=j.nextSibling,W=X.firstChild;return j.$$click=()=>{const G=T.status==="passed"?"failed":T.status==="failed"?"pending":"passed";c(()=>n.setCriterionStatus(a(),R(),G))},K(j,d(ke,{get when(){return T.status==="passed"},get fallback(){return d(ke,{get when(){return T.status==="failed"},get fallback(){return OFt()},get children(){return d(Kt,{name:"close-small",size:"small",class:"text-icon-error"})}})},get children(){return d(Kt,{name:"checklist",size:"small",class:"text-icon-success"})}})),K(W,()=>T.description),K(X,d(ke,{get when(){return T.command},get children(){var G=EFt();return K(G,()=>T.command),G}}),null),K(H,d(ke,{get when(){return T.lastOutput},get children(){var G=PFt();return K(G,()=>T.lastOutput),G}}),null),Qe(()=>j.disabled=r.busy),H})()}),null),K(A,d(ke,{get when(){return r.adding},get children(){var T=CFt(),R=T.firstChild;return K(T,d(LR,{placeholder:"Criterion description...",get value(){return r.newAcDesc},onInput:H=>i("newAcDesc",H.target.value),onKeyDown:H=>H.key==="Enter"&&void h(),class:"w-full",autofocus:!0}),R),K(R,d(LR,{placeholder:"Command (optional)...",get value(){return r.newAcCmd},onInput:H=>i("newAcCmd",H.target.value),onKeyDown:H=>H.key==="Enter"&&void h(),class:"flex-1"}),null),K(R,d(Cr,{icon:"check-small",variant:"ghost",onClick:()=>void h(),get disabled(){return!r.newAcDesc.trim()}}),null),K(R,d(Cr,{icon:"close-small",variant:"ghost",onClick:()=>{ct(()=>{i("adding",!1),i("newAcDesc",""),i("newAcCmd","")})}}),null),T}}),null),K(k,d(ke,{get when(){return bt(()=>!!l())()&&l().length>0},get children(){var T=LFt(),R=T.firstChild,H=R.nextSibling;return K(H,d(Qt,{get each(){return l()},children:Y=>(()=>{var j=zFt(),X=j.firstChild,W=X.firstChild,G=X.nextSibling;return K(j,d(Kt,{name:"brain",size:"small",class:"mt-0.5 shrink-0 text-icon-weak"}),X),K(W,()=>Y.toolName),K(X,d(ke,{get when(){return Y.outputSummary},get children(){var J=RFt();return K(J,()=>Y.outputSummary),J}}),null),K(G,()=>Mpe(Y.timestamp)),j})()})),T}}),D),K(E,()=>v().createdAt),K(D,d(ke,{get when(){return v().assignee},get children(){var T=IFt(),R=T.firstChild,H=R.nextSibling;return K(H,()=>v().assignee),T}}),null),K(D,d(ke,{get when(){return v().branch},get children(){var T=NFt(),R=T.firstChild,H=R.nextSibling;return K(H,()=>v().branch),T}}),null),k})()})}})),K(g,d(Spe,{get entityId(){return`issue:${a()}`},type:"issue"}),null),g})()}function Cpe(e){const t=Ef(),[n]=Yr(()=>e.id,t.trellis.fetchEntity),[r]=Yr(()=>e.id,t.trellis.fetchDecisionChain),i=Z(()=>Gz(e.id)),[a]=Yr(()=>e.type==="file"?i():void 0,async s=>(await t.sdk.client.file.read({path:s})).data),[o]=Yr(()=>e.type==="directory"?i():void 0,async s=>(await t.sdk.client.file.list({path:s})).data??[]);return Z(()=>Fte(n(),["title","name","message","estimatedIntent","url"])??Hte(i())),Z(()=>Fte(n(),["description","purpose","summary"])),(()=>{var s=VFt(),l=s.firstChild;return K(l,d(ke,{get when(){return e.type==="file"},get children(){var c=qFt();return K(c,d(ke,{get when(){return!a.loading},get fallback(){return(()=>{var u=BFt(),h=u.firstChild;return K(u,d(D2,{}),h),u})()},get children(){return d(tVt,{get path(){return i()},get file(){return a()}})}})),c}}),null),K(l,d(ke,{get when(){return e.type==="directory"},get children(){var c=HFt();return c.firstChild,K(c,d(ke,{get when(){return!o.loading},get fallback(){return(()=>{var u=UFt(),h=u.firstChild;return K(u,d(D2,{}),h),u})()},get children(){return d(ke,{get when(){return(o()?.length??0)>0},get fallback(){return WFt()},get children(){var u=jFt();return K(u,d(Qt,{get each(){return o()?.slice(0,40)},children:h=>(()=>{var m=GFt(),g=m.firstChild,y=g.firstChild,v=y.nextSibling,k=g.nextSibling;return m.$$click=()=>t.push(h.type==="directory"?`dir:${h.path}`:`file:${h.path}`,h.type),K(y,()=>h.type),K(v,()=>Hte(h.path)),K(k,()=>h.path),m})()})),u}})}}),null),c}}),null),K(l,d(ke,{get when(){return bt(()=>!!r())()&&r().length>0},get children(){var c=FFt(),u=c.firstChild,h=u.nextSibling;return K(h,d(Qt,{get each(){return r().slice(0,8)},children:m=>(()=>{var g=ZFt(),y=g.firstChild,v=y.nextSibling;return K(y,()=>m.toolName),K(v,()=>Mpe(m.timestamp)),g})()})),c}}),null),K(s,d(Spe,{get entityId(){return e.id},get type(){return e.type}}),null),s})()}function sVt(e){return e.state==="resolved"?KFt():e.state==="stale"?d(Kt,{name:"alert-triangle",size:"small",class:"shrink-0 text-text-warning mt-0.5"}):d(Kt,{name:"x-circle",size:"small",class:"shrink-0 text-text-danger mt-0.5"})}li(["click"]);function lVt(){const e=xj(),t=cqt(),n=di();let r,i;return he(()=>{const a=n.id;if(!a){r&&(t.removeJob(r),r=void 0);return}(e.data.session_status[a]?.type??"idle")!=="idle"?r||(r=t.addJob({type:"generate",label:"Generating...",status:"running"})):r&&(t.removeJob(r),r=void 0)}),he(()=>{const a=e.data.status;a==="loading"||a==="partial"?i||(i=t.addJob({type:"sync",label:"Syncing project...",status:"running"})):i&&(t.removeJob(i),i=void 0)}),me(()=>{r&&t.removeJob(r),i&&t.removeJob(i),r=void 0,i=void 0}),null}const Lpe=Tt(),Ute=50;function cVt(e){const t=ope(),[n,r]=nt({items:[],seen:new Set}),i=(h,m)=>{const g={id:crypto.randomUUID(),title:h,type:m,timestamp:Date.now(),read:!1};r(Je(y=>{y.items.unshift(g),y.items.length>Ute&&(y.items.length=Ute)}))};he(vn(()=>t?.issues?.map(h=>h.id).join(",")??"",(h,m)=>{if(m===void 0)return;const g=new Set(m.split(",").filter(Boolean));for(const y of t?.issues??[])g.has(y.id)||i(`Issue created: ${y.title}`,"issue")})),he(vn(()=>t?.workUnits?.map(h=>h.id).join(",")??"",(h,m)=>{if(m===void 0)return;const g=new Set(m.split(",").filter(Boolean));for(const y of t?.workUnits??[])g.has(y.id)||i(`Work unit: ${y.title}`,"op")}));const a=()=>n.items,o=Z(()=>n.items.filter(h=>!h.read).length),s=Z(()=>n.items[0]),u={items:a,unread:o,latest:s,markRead:h=>{r("items",m=>m.id===h,"read",!0)},markAllRead:()=>{r("items",()=>!0,"read",!0)},push:i};return d(Lpe.Provider,{value:u,get children(){return e.children}})}function xQt(){return Lt(Lpe)}function dVt(e,t){e.indexOf(t)===-1&&e.push(t)}function _K(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const el=(e,t,n)=>n>t?t:n<e?e:n;let MK=()=>{};const tl={},Ipe=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function uVt(e){return typeof e=="object"&&e!==null}const Npe=e=>/^0[^.\s]+$/u.test(e);function Ape(e){let t;return()=>(t===void 0&&(t=e()),t)}const Pf=e=>e,hVt=(e,t)=>n=>t(e(n)),SK=(...e)=>e.reduce(hVt),CK=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class $pe{constructor(){this.subscriptions=[]}add(t){return dVt(this.subscriptions,t),()=>_K(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let a=0;a<i;a++){const o=this.subscriptions[a];o&&o(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ia=e=>e*1e3,Ta=e=>e/1e3;function Tpe(e,t){return t?e*(1e3/t):0}const fVt=(e,t,n)=>{const r=t-e;return((n-e)%r+r)%r+e},Epe=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,pVt=1e-7,mVt=12;function gVt(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=Epe(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>pVt&&++s<mVt);return o}function Cm(e,t,n,r){if(e===t&&n===r)return Pf;const i=a=>gVt(a,0,1,e,n);return a=>a===0||a===1?a:Epe(i(a),t,r)}const Ppe=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Dpe=e=>t=>1-e(1-t),Ope=Cm(.33,1.53,.69,.99),LK=Dpe(Ope),Rpe=Ppe(LK),zpe=e=>e>=1?1:(e*=2)<1?.5*LK(e):.5*(2-Math.pow(2,-10*(e-1))),IK=e=>1-Math.sin(Math.acos(e)),yVt=Dpe(IK),qpe=Ppe(IK),vVt=Cm(.42,0,1,1),kVt=Cm(0,0,.58,1),jpe=Cm(.42,0,.58,1),Hpe=e=>Array.isArray(e)&&typeof e[0]!="number";function Fpe(e,t){return Hpe(e)?e[fVt(0,e.length,t)]:e}const Vpe=e=>Array.isArray(e)&&typeof e[0]=="number",bVt={linear:Pf,easeIn:vVt,easeInOut:jpe,easeOut:kVt,circIn:IK,circInOut:qpe,circOut:yVt,backIn:LK,backInOut:Rpe,backOut:Ope,anticipate:zpe},wVt=e=>typeof e=="string",Wte=e=>{if(Vpe(e)){MK(e.length===4);const[t,n,r,i]=e;return Cm(t,n,r,i)}else if(wVt(e))return bVt[e];return e},Kg=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function xVt(e,t){let n=new Set,r=new Set,i=!1,a=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),e()),u(s)}const c={schedule:(u,h=!1,m=!1)=>{const y=m&&i?n:r;return h&&o.add(u),y.add(u),u},cancel:u=>{r.delete(u),o.delete(u)},process:u=>{if(s=u,i){a=!0;return}i=!0;const h=n;n=r,r=h,n.forEach(l),n.clear(),i=!1,a&&(a=!1,c.process(u))}};return c}const _Vt=40;function Bpe(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Kg.reduce((w,M)=>(w[M]=xVt(a),w),{}),{setup:s,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:m,render:g,postRender:y}=o,v=()=>{const w=tl.useManualTiming,M=w?i.timestamp:performance.now();n=!1,w||(i.delta=r?1e3/60:Math.max(Math.min(M-i.timestamp,_Vt),1)),i.timestamp=M,i.isProcessing=!0,s.process(i),l.process(i),c.process(i),u.process(i),h.process(i),m.process(i),g.process(i),y.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(v))},k=()=>{n=!0,r=!0,i.isProcessing||e(v)};return{schedule:Kg.reduce((w,M)=>{const _=o[M];return w[M]=(C,L=!1,S=!1)=>(n||k(),_.schedule(C,L,S)),w},{}),cancel:w=>{for(let M=0;M<Kg.length;M++)o[Kg[M]].cancel(w)},state:i,steps:o}}const{schedule:_o,cancel:pU,state:Zz}=Bpe(typeof requestAnimationFrame<"u"?requestAnimationFrame:Pf,!0);let $R;function MVt(){$R=void 0}const Di={now:()=>($R===void 0&&Di.set(Zz.isProcessing||tl.useManualTiming?Zz.timestamp:performance.now()),$R),set:e=>{$R=e,queueMicrotask(MVt)}},Upe=e=>t=>typeof t=="string"&&t.startsWith(e),Wpe=Upe("--"),SVt=Upe("var(--"),NK=e=>SVt(e)?CVt.test(e.split("/*")[0].trim()):!1,CVt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Gte(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Df={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},O2={...Df,transform:e=>el(0,1,e)},Xg={...Df,default:1},e2=e=>Math.round(e*1e5)/1e5,AK=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function LVt(e){return e==null}const IVt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,$K=(e,t)=>n=>!!(typeof n=="string"&&IVt.test(n)&&n.startsWith(e)||t&&!LVt(n)&&Object.prototype.hasOwnProperty.call(n,t)),Gpe=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,a,o,s]=r.match(AK);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s!==void 0?parseFloat(s):1}},NVt=e=>el(0,255,e),KF={...Df,transform:e=>Math.round(NVt(e))},K1={test:$K("rgb","red"),parse:Gpe("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+KF.transform(e)+", "+KF.transform(t)+", "+KF.transform(n)+", "+e2(O2.transform(r))+")"};function AVt(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const mU={test:$K("#"),parse:AVt,transform:K1.transform},Lm=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),$s=Lm("deg"),zh=Lm("%"),Ze=Lm("px"),$Vt=Lm("vh"),TVt=Lm("vw"),Zte={...zh,parse:e=>zh.parse(e)/100,transform:e=>zh.transform(e*100)},Mh={test:$K("hsl","hue"),parse:Gpe("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+zh.transform(e2(t))+", "+zh.transform(e2(n))+", "+e2(O2.transform(r))+")"},Un={test:e=>K1.test(e)||mU.test(e)||Mh.test(e),parse:e=>K1.test(e)?K1.parse(e):Mh.test(e)?Mh.parse(e):mU.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?K1.transform(e):Mh.transform(e),getAnimatableNone:e=>{const t=Un.parse(e);return t.alpha=0,Un.transform(t)}},EVt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function PVt(e){return isNaN(e)&&typeof e=="string"&&(e.match(AK)?.length||0)+(e.match(EVt)?.length||0)>0}const Zpe="number",Kpe="color",DVt="var",OVt="var(",Kte="${}",RVt=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function rf(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let a=0;const s=t.replace(RVt,l=>(Un.test(l)?(r.color.push(a),i.push(Kpe),n.push(Un.parse(l))):l.startsWith(OVt)?(r.var.push(a),i.push(DVt),n.push(l)):(r.number.push(a),i.push(Zpe),n.push(parseFloat(l))),++a,Kte)).split(Kte);return{values:n,split:s,indexes:r,types:i}}function zVt(e){return rf(e).values}function Xpe({split:e,types:t}){const n=e.length;return r=>{let i="";for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){const o=t[a];o===Zpe?i+=e2(r[a]):o===Kpe?i+=Un.transform(r[a]):i+=r[a]}return i}}function qVt(e){return Xpe(rf(e))}const jVt=e=>typeof e=="number"?0:Un.test(e)?Un.getAnimatableNone(e):e,HVt=(e,t)=>typeof e=="number"?t?.trim().endsWith("/")?e:0:jVt(e);function FVt(e){const t=rf(e);return Xpe(t)(t.values.map((r,i)=>HVt(r,t.split[i])))}const Ra={test:PVt,parse:zVt,createTransformer:qVt,getAnimatableNone:FVt};function XF(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function VVt({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{const s=n<.5?n*(1+t):n+t-n*t,l=2*n-s;i=XF(l,s,e+1/3),a=XF(l,s,e),o=XF(l,s,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Kz(e,t){return n=>n>0?t:e}const Of=(e,t,n)=>e+(t-e)*n,YF=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},BVt=[mU,K1,Mh],UVt=e=>BVt.find(t=>t.test(e));function Xte(e){const t=UVt(e);if(!t)return!1;let n=t.parse(e);return t===Mh&&(n=VVt(n)),n}const Yte=(e,t)=>{const n=Xte(e),r=Xte(t);if(!n||!r)return Kz(e,t);const i={...n};return a=>(i.red=YF(n.red,r.red,a),i.green=YF(n.green,r.green,a),i.blue=YF(n.blue,r.blue,a),i.alpha=Of(n.alpha,r.alpha,a),K1.transform(i))},gU=new Set(["none","hidden"]);function WVt(e,t){return gU.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function GVt(e,t){return n=>Of(e,t,n)}function TK(e){return typeof e=="number"?GVt:typeof e=="string"?NK(e)?Kz:Un.test(e)?Yte:XVt:Array.isArray(e)?Ype:typeof e=="object"?Un.test(e)?Yte:ZVt:Kz}function Ype(e,t){const n=[...e],r=n.length,i=e.map((a,o)=>TK(a)(a,t[o]));return a=>{for(let o=0;o<r;o++)n[o]=i[o](a);return n}}function ZVt(e,t){const n={...e,...t},r={};for(const i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=TK(e[i])(e[i],t[i]));return i=>{for(const a in r)n[a]=r[a](i);return n}}function KVt(e,t){const n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){const a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}const XVt=(e,t)=>{const n=Ra.createTransformer(t),r=rf(e),i=rf(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?gU.has(e)&&!i.values.length||gU.has(t)&&!r.values.length?WVt(e,t):SK(Ype(KVt(r,i),i.values),n):Kz(e,t)};function Jpe(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Of(e,t,n):TK(e)(e,t)}const YVt=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>_o.update(t,n),stop:()=>pU(t),now:()=>Zz.isProcessing?Zz.timestamp:Di.now()}},Qpe=(e,t,n=10)=>{let r="";const i=Math.max(Math.round(t/n),2);for(let a=0;a<i;a++)r+=Math.round(e(a/(i-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Xz=2e4;function EK(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Xz;)t+=n,r=e.next(t);return t>=Xz?1/0:t}function e2e(e,t=100,n){const r=n({...e,keyframes:[0,t]}),i=Math.min(EK(r),Xz);return{type:"keyframes",ease:a=>r.next(i*a).value/t,duration:Ta(i)}}const Dn={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function yU(e,t){return e*Math.sqrt(1-t*t)}const JVt=12;function QVt(e,t,n){let r=n;for(let i=1;i<JVt;i++)r=r-e(r)/t(r);return r}const JF=.001;function eBt({duration:e=Dn.duration,bounce:t=Dn.bounce,velocity:n=Dn.velocity,mass:r=Dn.mass}){let i,a,o=1-t;o=el(Dn.minDamping,Dn.maxDamping,o),e=el(Dn.minDuration,Dn.maxDuration,Ta(e)),o<1?(i=c=>{const u=c*o,h=u*e,m=u-n,g=yU(c,o),y=Math.exp(-h);return JF-m/g*y},a=c=>{const h=c*o*e,m=h*n+n,g=Math.pow(o,2)*Math.pow(c,2)*e,y=Math.exp(-h),v=yU(Math.pow(c,2),o);return(-i(c)+JF>0?-1:1)*((m-g)*y)/v}):(i=c=>{const u=Math.exp(-c*e),h=(c-n)*e+1;return-JF+u*h},a=c=>{const u=Math.exp(-c*e),h=(n-c)*(e*e);return u*h});const s=5/e,l=QVt(i,a,s);if(e=ia(e),isNaN(l))return{stiffness:Dn.stiffness,damping:Dn.damping,duration:e};{const c=Math.pow(l,2)*r;return{stiffness:c,damping:o*2*Math.sqrt(r*c),duration:e}}}const tBt=["duration","bounce"],nBt=["stiffness","damping","mass"];function Jte(e,t){return t.some(n=>e[n]!==void 0)}function rBt(e){let t={velocity:Dn.velocity,stiffness:Dn.stiffness,damping:Dn.damping,mass:Dn.mass,isResolvedFromDuration:!1,...e};if(!Jte(e,nBt)&&Jte(e,tBt))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*el(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:Dn.mass,stiffness:i,damping:a}}else{const n=eBt({...e,velocity:0});t={...t,...n,mass:Dn.mass},t.isResolvedFromDuration=!0}return t}function R2(e=Dn.visualDuration,t=Dn.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:i}=n;const a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:h,velocity:m,isResolvedFromDuration:g}=rBt({...n,velocity:-Ta(n.velocity||0)}),y=m||0,v=c/(2*Math.sqrt(l*u)),k=o-a,b=Ta(Math.sqrt(l/u)),x=Math.abs(k)<5;r||(r=x?Dn.restSpeed.granular:Dn.restSpeed.default),i||(i=x?Dn.restDelta.granular:Dn.restDelta.default);let w,M,_,C,L,S;if(v<1)_=yU(b,v),C=(y+v*b*k)/_,w=A=>{const D=Math.exp(-v*b*A);return o-D*(C*Math.sin(_*A)+k*Math.cos(_*A))},L=v*b*C+k*_,S=v*b*k-C*_,M=A=>Math.exp(-v*b*A)*(L*Math.sin(_*A)+S*Math.cos(_*A));else if(v===1){w=D=>o-Math.exp(-b*D)*(k+(y+b*k)*D);const A=y+b*k;M=D=>Math.exp(-b*D)*(b*A*D-y)}else{const A=b*Math.sqrt(v*v-1);w=E=>{const T=Math.exp(-v*b*E),R=Math.min(A*E,300);return o-T*((y+v*b*k)*Math.sinh(R)+A*k*Math.cosh(R))/A};const D=(y+v*b*k)/A,P=v*b*D-k*A,O=v*b*k-D*A;M=E=>{const T=Math.exp(-v*b*E),R=Math.min(A*E,300);return T*(P*Math.sinh(R)+O*Math.cosh(R))}}const I={calculatedDuration:g&&h||null,velocity:A=>ia(M(A)),next:A=>{if(!g&&v<1){const P=Math.exp(-v*b*A),O=Math.sin(_*A),E=Math.cos(_*A),T=o-P*(C*O+k*E),R=ia(P*(L*O+S*E));return s.done=Math.abs(R)<=r&&Math.abs(o-T)<=i,s.value=s.done?o:T,s}const D=w(A);if(g)s.done=A>=h;else{const P=ia(M(A));s.done=Math.abs(P)<=r&&Math.abs(o-D)<=i}return s.value=s.done?o:D,s},toString:()=>{const A=Math.min(EK(I),Xz),D=Qpe(P=>I.next(A*P).value,A,30);return A+"ms "+D},toTransition:()=>{}};return I}R2.applyToOptions=e=>{const t=e2e(e,100,R2);return e.ease=t.ease,e.duration=ia(t.duration),e.type="keyframes",e};const iBt=5;function t2e(e,t,n){const r=Math.max(t-iBt,0);return Tpe(n-e(r),t-r)}function vU({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:l,restDelta:c=.5,restSpeed:u}){const h=e[0],m={done:!1,value:h},g=S=>s!==void 0&&S<s||l!==void 0&&S>l,y=S=>s===void 0?l:l===void 0||Math.abs(s-S)<Math.abs(l-S)?s:l;let v=n*t;const k=h+v,b=o===void 0?k:o(k);b!==k&&(v=b-h);const x=S=>-v*Math.exp(-S/r),w=S=>b+x(S),M=S=>{const I=x(S),A=w(S);m.done=Math.abs(I)<=c,m.value=m.done?b:A};let _,C;const L=S=>{g(m.value)&&(_=S,C=R2({keyframes:[m.value,y(m.value)],velocity:t2e(w,S,m.value),damping:i,stiffness:a,restDelta:c,restSpeed:u}))};return L(0),{calculatedDuration:null,next:S=>{let I=!1;return!C&&_===void 0&&(I=!0,M(S),L(S)),_!==void 0&&S>=_?C.next(S-_):(!I&&M(S),m)}}}function aBt(e,t,n){const r=[],i=n||tl.mix||Jpe,a=e.length-1;for(let o=0;o<a;o++){let s=i(e[o],e[o+1]);if(t){const l=Array.isArray(t)?t[o]||Pf:t;s=SK(l,s)}r.push(s)}return r}function oBt(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const a=e.length;if(MK(a===t.length),a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];const o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=aBt(t,r,i),l=s.length,c=u=>{if(o&&u<e[0])return t[0];let h=0;if(l>1)for(;h<e.length-2&&!(u<e[h+1]);h++);const m=CK(e[h],e[h+1],u);return s[h](m)};return n?u=>c(el(e[0],e[a-1],u)):c}function n2e(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=CK(0,t,r);e.push(Of(n,1,i))}}function r2e(e){const t=[0];return n2e(t,e.length-1),t}function sBt(e,t){return e.map(n=>n*t)}function lBt(e,t){return e.map(()=>t||jpe).splice(0,e.length-1)}function t2({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=Hpe(r)?r.map(Wte):Wte(r),a={done:!1,value:t[0]},o=sBt(n&&n.length===t.length?n:r2e(t),e),s=oBt(o,t,{ease:Array.isArray(i)?i:lBt(t,i)});return{calculatedDuration:e,next:l=>(a.value=s(l),a.done=l>=e,a)}}const cBt=e=>e!==null;function $j(e,{repeat:t,repeatType:n="loop"},r,i=1){const a=e.filter(cBt),s=i<0||t&&n!=="loop"&&t%2===1?0:a.length-1;return!s||r===void 0?a[s]:r}const dBt={decay:vU,inertia:vU,tween:t2,keyframes:t2,spring:R2};function i2e(e){typeof e.type=="string"&&(e.type=dBt[e.type])}class PK{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const uBt=e=>e/100;class Yz extends PK{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==Di.now()&&this.tick(Di.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;i2e(t);const{type:n=t2,repeat:r=0,repeatDelay:i=0,repeatType:a,velocity:o=0}=t;let{keyframes:s}=t;const l=n||t2;l!==t2&&typeof s[0]!="number"&&(this.mixKeyframes=SK(uBt,Jpe(s[0],s[1])),s=[0,100]);const c=l({...t,keyframes:s});a==="mirror"&&(this.mirroredGenerator=l({...t,keyframes:[...s].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=EK(c));const{calculatedDuration:u}=c;this.calculatedDuration=u,this.resolvedDuration=u+i,this.totalDuration=this.resolvedDuration*(r+1)-i,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:i,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:s,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:u,repeat:h,repeatType:m,repeatDelay:g,type:y,onUpdate:v,finalKeyframe:k}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const b=this.currentTime-c*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?b<0:b>i;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,M=r;if(h){const S=Math.min(this.currentTime,i)/s;let I=Math.floor(S),A=S%1;!A&&S>=1&&(A=1),A===1&&I--,I=Math.min(I,h+1),!!(I%2)&&(m==="reverse"?(A=1-A,g&&(A-=g/s)):m==="mirror"&&(M=o)),w=el(0,1,A)*s}let _;x?(this.delayState.value=u[0],_=this.delayState):_=M.next(w),a&&!x&&(_.value=a(_.value));let{done:C}=_;!x&&l!==null&&(C=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const L=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return L&&y!==vU&&(_.value=$j(u,this.options,k,this.speed)),v&&v(_.value),L&&this.finish(),_}then(t,n){return this.finished.then(t,n)}get duration(){return Ta(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ta(t)}get time(){return Ta(this.currentTime)}set time(t){t=ia(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return t2e(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Di.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Ta(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=YVt,startTime:n}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Di.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function hBt(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const X1=e=>e*180/Math.PI,kU=e=>{const t=X1(Math.atan2(e[1],e[0]));return bU(t)},fBt={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:kU,rotateZ:kU,skewX:e=>X1(Math.atan(e[1])),skewY:e=>X1(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},bU=e=>(e=e%360,e<0&&(e+=360),e),Qte=kU,ene=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),tne=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),pBt={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ene,scaleY:tne,scale:e=>(ene(e)+tne(e))/2,rotateX:e=>bU(X1(Math.atan2(e[6],e[5]))),rotateY:e=>bU(X1(Math.atan2(-e[2],e[0]))),rotateZ:Qte,rotate:Qte,skewX:e=>X1(Math.atan(e[4])),skewY:e=>X1(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function wU(e){return e.includes("scale")?1:0}function xU(e,t){if(!e||e==="none")return wU(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,i;if(n)r=pBt,i=n;else{const s=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=fBt,i=s}if(!i)return wU(t);const a=r[t],o=i[1].split(",").map(gBt);return typeof a=="function"?a(o):o[a]}const mBt=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return xU(n,t)};function gBt(e){return parseFloat(e.trim())}const Rf=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zf=new Set(Rf),nne=e=>e===Df||e===Ze,yBt=new Set(["x","y","z"]),vBt=Rf.filter(e=>!yBt.has(e));function kBt(e){const t=[];return vBt.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const zs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const i=e.max-e.min;return r==="border-box"?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>xU(t,"x"),y:(e,{transform:t})=>xU(t,"y")};zs.translateX=zs.x;zs.translateY=zs.y;const t0=new Set;let _U=!1,MU=!1,SU=!1;function a2e(){if(MU){const e=Array.from(t0).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=kBt(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([a,o])=>{r.getValue(a)?.set(o)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}MU=!1,_U=!1,t0.forEach(e=>e.complete(SU)),t0.clear()}function o2e(){t0.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(MU=!0)})}function bBt(){SU=!0,o2e(),a2e(),SU=!1}class DK{constructor(t,n,r,i,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(t0.add(this),_U||(_U=!0,_o.read(o2e),_o.resolveKeyframes(a2e))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;if(t[0]===null){const a=i?.get(),o=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const s=r.readValue(n,o);s!=null&&(t[0]=s)}t[0]===void 0&&(t[0]=o),i&&a===void 0&&i.set(t[0])}hBt(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),t0.delete(this)}cancel(){this.state==="scheduled"&&(t0.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const wBt=e=>e.startsWith("--");function s2e(e,t,n){wBt(t)?e.style.setProperty(t,n):e.style[t]=n}const xBt={};function l2e(e,t){const n=Ape(e);return()=>xBt[t]??n()}const _Bt=l2e(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),c2e=l2e(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Rp=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,rne={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Rp([0,.65,.55,1]),circOut:Rp([.55,0,1,.45]),backIn:Rp([.31,.01,.66,-.59]),backOut:Rp([.33,1.53,.69,.99])};function d2e(e,t){if(e)return typeof e=="function"?c2e()?Qpe(e,t):"ease-out":Vpe(e)?Rp(e):Array.isArray(e)?e.map(n=>d2e(n,t)||rne.easeOut):rne[e]}function MBt(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o="loop",ease:s="easeOut",times:l}={},c=void 0){const u={[t]:n};l&&(u.offset=l);const h=d2e(s,i);Array.isArray(h)&&(u.easing=h);const m={delay:r,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return c&&(m.pseudoElement=c),e.animate(u,m)}function OK(e){return typeof e=="function"&&"applyToOptions"in e}function SBt({type:e,...t}){return OK(e)&&c2e()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class u2e extends PK{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:i,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:s,onComplete:l}=t;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=t,MK(typeof t.type!="string");const c=SBt(t);this.animation=MBt(n,r,i,c,a),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const u=$j(i,this.options,s,this.speed);this.updateMotionValue&&this.updateMotionValue(u),s2e(n,r,u),this.animation.cancel()}l?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Ta(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Ta(t)}get time(){return Ta(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ia(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:i}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&_Bt()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Pf):i(this)}}const h2e={anticipate:zpe,backInOut:Rpe,circInOut:qpe};function CBt(e){return e in h2e}function LBt(e){typeof e.ease=="string"&&CBt(e.ease)&&(e.ease=h2e[e.ease])}const QF=10;class IBt extends u2e{constructor(t){LBt(t),i2e(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:i,element:a,...o}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const s=new Yz({...o,autoplay:!1}),l=Math.max(QF,Di.now()-this.startTime),c=el(0,QF,l-QF),u=s.sample(l).value,{name:h}=this.options;a&&h&&s2e(a,h,u),n.setWithVelocity(s.sample(Math.max(0,l-c)).value,u,c),s.stop()}}const ine=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ra.test(e)||e==="0")&&!e.startsWith("url("));function NBt(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function ABt(e,t,n,r){const i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const a=e[e.length-1],o=ine(i,t),s=ine(a,t);return!o||!s?!1:NBt(e)||(n==="spring"||OK(n))&&r}function CU(e){e.duration=0,e.type="keyframes"}const f2e=new Set(["opacity","clipPath","filter","transform"]),$Bt=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function TBt(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&$Bt.test(e[t]))return!0;return!1}const EBt=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),PBt=Ape(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function DBt(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=t.owner.getProps();return PBt()&&n&&(f2e.has(n)||EBt.has(n)&&TBt(s))&&(n!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&a!==0&&o!=="inertia"}const OBt=40;class RBt extends PK{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:i=0,repeatDelay:a=0,repeatType:o="loop",keyframes:s,name:l,motionValue:c,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Di.now();const m={autoplay:t,delay:n,type:r,repeat:i,repeatDelay:a,repeatType:o,name:l,motionValue:c,element:u,...h},g=u?.KeyframeResolver||DK;this.keyframeResolver=new g(s,(y,v,k)=>this.onKeyframesResolved(y,v,m,!k),l,c,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,r,i){this.keyframeResolver=void 0;const{name:a,type:o,velocity:s,delay:l,isHandoff:c,onUpdate:u}=r;this.resolvedAt=Di.now();let h=!0;ABt(t,a,o,s)||(h=!1,(tl.instantAnimations||!l)&&u?.($j(t,r,n)),t[0]=t[t.length-1],CU(r),r.repeat=0);const g={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>OBt?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},y=h&&!c&&DBt(g),v=g.motionValue?.owner?.current;let k;if(y)try{k=new IBt({...g,element:v})}catch{k=new Yz(g)}else k=new Yz(g);k.finished.then(()=>{this.notifyFinished()}).catch(Pf),this.pendingTimeline&&(this.stopTimeline=k.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=k}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),bBt()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}class zBt{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t){const n=this.animations.map(r=>r.attachTimeline(t));return()=>{n.forEach((r,i)=>{r&&r(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return ane(this.animations,"duration")}get iterationDuration(){return ane(this.animations,"iterationDuration")}runAll(t){this.animations.forEach(n=>n[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function ane(e,t){let n=0;for(let r=0;r<e.length;r++){const i=e[r][t];i!==null&&i>n&&(n=i)}return n}class qBt extends zBt{then(t,n){return this.finished.finally(t).then(()=>{})}}const jBt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function HBt(e){const t=jBt.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}function p2e(e,t,n=1){const[r,i]=HBt(e);if(!r)return;const a=window.getComputedStyle(t).getPropertyValue(r);if(a){const o=a.trim();return Ipe(o)?parseFloat(o):o}return NK(i)?p2e(i,t,n+1):i}const FBt={type:"spring",stiffness:500,damping:25,restSpeed:10},VBt=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),BBt={type:"keyframes",duration:.8},UBt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},WBt=(e,{keyframes:t})=>t.length>2?BBt:zf.has(e)?e.startsWith("scale")?VBt(t[1]):FBt:UBt;function m2e(e,t){if(e?.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function g2e(e,t){const n=e?.[t]??e?.default??e;return n!==e?m2e(n,e):n}const GBt=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function ZBt(e){for(const t in e)if(!GBt.has(t))return!0;return!1}const y2e=(e,t,n,r={},i,a)=>o=>{const s=g2e(r,e)||{},l=s.delay||r.delay||0;let{elapsed:c=0}=r;c=c-ia(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:m=>{t.set(m),s.onUpdate&&s.onUpdate(m)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};ZBt(s)||Object.assign(u,WBt(e,u)),u.duration&&(u.duration=ia(u.duration)),u.repeatDelay&&(u.repeatDelay=ia(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(CU(u),u.delay===0&&(h=!0)),(tl.instantAnimations||tl.skipAnimations||i?.shouldSkipAnimations)&&(h=!0,CU(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,h&&!a&&t.get()!==void 0){const m=$j(u.keyframes,s);if(m!==void 0){_o.update(()=>{u.onUpdate(m),u.onComplete()});return}}return s.isSync?new Yz(u):new RBt(u)};function one(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function v2e(e,t,n,r){if(typeof t=="function"){const[i,a]=one(r);t=t(n!==void 0?n:e.custom,i,a)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,a]=one(r);t=t(n!==void 0?n:e.custom,i,a)}return t}function KBt(e,t,n){const r=e.getProps();return v2e(r,t,r.custom,e)}const k2e=new Set(["width","height","top","left","right","bottom",...Rf]),sne=30,XBt=e=>!isNaN(parseFloat(e));class YBt{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const i=Di.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const a of this.dependents)a.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Di.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=XBt(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new $pe);const r=this.events[t].add(n);return t==="change"?()=>{r(),_o.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Di.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>sne)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,sne);return Tpe(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function af(e,t){return new YBt(e,t)}const JBt=e=>Array.isArray(e);function QBt(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,af(n))}function eUt(e){return JBt(e)?e[e.length-1]||0:e}function tUt(e,t){const n=KBt(e,t);let{transitionEnd:r={},transition:i={},...a}=n||{};a={...a,...r};for(const o in a){const s=eUt(a[o]);QBt(e,o,s)}}const ni=e=>!!(e&&e.getVelocity);function nUt(e){return!!(ni(e)&&e.add)}function rUt(e,t){const n=e.getValue("willChange");if(nUt(n))return n.add(t);if(!n&&tl.WillChange){const r=new tl.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function RK(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const iUt="framerAppearId",aUt="data-"+RK(iUt);function oUt(e){return e.props[aUt]}function sUt({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function lUt(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t;const l=e.getDefaultTransition();a=a?m2e(a,l):l;const c=a?.reduceMotion;r&&(a=r);const u=[],h=i&&e.animationState&&e.animationState.getState()[i];for(const m in s){const g=e.getValue(m,e.latestValues[m]??null),y=s[m];if(y===void 0||h&&sUt(h,m))continue;const v={delay:n,...g2e(a||{},m)},k=g.get();if(k!==void 0&&!g.isAnimating()&&!Array.isArray(y)&&y===k&&!v.velocity){_o.update(()=>g.set(y));continue}let b=!1;if(window.MotionHandoffAnimation){const M=oUt(e);if(M){const _=window.MotionHandoffAnimation(M,m,_o);_!==null&&(v.startTime=_,b=!0)}}rUt(e,m);const x=c??e.shouldReduceMotion;g.start(y2e(m,g,y,x&&k2e.has(m)?{type:!1}:v,e,b));const w=g.animation;w&&u.push(w)}if(o){const m=()=>_o.update(()=>{o&&tUt(e,o)});u.length?Promise.all(u).then(m):m()}return u}const cUt={test:e=>e==="auto",parse:e=>e},b2e=e=>t=>t.test(e),w2e=[Df,Ze,zh,$s,TVt,$Vt,cUt],lne=e=>w2e.find(b2e(e));function dUt(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Npe(e):!0}const uUt=new Set(["brightness","contrast","saturate","opacity"]);function hUt(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(AK)||[];if(!r)return e;const i=n.replace(r,"");let a=uUt.has(t)?1:0;return r!==n&&(a*=100),t+"("+a+i+")"}const fUt=/\b([a-z-]*)\(.*?\)/gu,LU={...Ra,getAnimatableNone:e=>{const t=e.match(fUt);return t?t.map(hUt).join(" "):e}},IU={...Ra,getAnimatableNone:e=>{const t=Ra.parse(e);return Ra.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},cne={...Df,transform:Math.round},pUt={rotate:$s,rotateX:$s,rotateY:$s,rotateZ:$s,scale:Xg,scaleX:Xg,scaleY:Xg,scaleZ:Xg,skew:$s,skewX:$s,skewY:$s,distance:Ze,translateX:Ze,translateY:Ze,translateZ:Ze,x:Ze,y:Ze,z:Ze,perspective:Ze,transformPerspective:Ze,opacity:O2,originX:Zte,originY:Zte,originZ:Ze},zK={borderWidth:Ze,borderTopWidth:Ze,borderRightWidth:Ze,borderBottomWidth:Ze,borderLeftWidth:Ze,borderRadius:Ze,borderTopLeftRadius:Ze,borderTopRightRadius:Ze,borderBottomRightRadius:Ze,borderBottomLeftRadius:Ze,width:Ze,maxWidth:Ze,height:Ze,maxHeight:Ze,top:Ze,right:Ze,bottom:Ze,left:Ze,inset:Ze,insetBlock:Ze,insetBlockStart:Ze,insetBlockEnd:Ze,insetInline:Ze,insetInlineStart:Ze,insetInlineEnd:Ze,padding:Ze,paddingTop:Ze,paddingRight:Ze,paddingBottom:Ze,paddingLeft:Ze,paddingBlock:Ze,paddingBlockStart:Ze,paddingBlockEnd:Ze,paddingInline:Ze,paddingInlineStart:Ze,paddingInlineEnd:Ze,margin:Ze,marginTop:Ze,marginRight:Ze,marginBottom:Ze,marginLeft:Ze,marginBlock:Ze,marginBlockStart:Ze,marginBlockEnd:Ze,marginInline:Ze,marginInlineStart:Ze,marginInlineEnd:Ze,fontSize:Ze,backgroundPositionX:Ze,backgroundPositionY:Ze,...pUt,zIndex:cne,fillOpacity:O2,strokeOpacity:O2,numOctaves:cne},mUt={...zK,color:Un,backgroundColor:Un,outlineColor:Un,fill:Un,stroke:Un,borderColor:Un,borderTopColor:Un,borderRightColor:Un,borderBottomColor:Un,borderLeftColor:Un,filter:LU,WebkitFilter:LU,mask:IU,WebkitMask:IU},x2e=e=>mUt[e],gUt=new Set([LU,IU]);function _2e(e,t){let n=x2e(e);return gUt.has(n)||(n=Ra),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const yUt=new Set(["auto","none","0"]);function vUt(e,t,n){let r=0,i;for(;r<e.length&&!i;){const a=e[r];typeof a=="string"&&!yUt.has(a)&&rf(a).values.length&&(i=e[r]),r++}if(i&&n)for(const a of t)e[a]=_2e(n,i)}class kUt extends DK{constructor(t,n,r,i,a){super(t,n,r,i,a,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let h=t[u];if(typeof h=="string"&&(h=h.trim(),NK(h))){const m=p2e(h,n.current);m!==void 0&&(t[u]=m),u===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!k2e.has(r)||t.length!==2)return;const[i,a]=t,o=lne(i),s=lne(a),l=Gte(i),c=Gte(a);if(l!==c&&zs[r]){this.needsMeasurement=!0;return}if(o!==s)if(nne(o)&&nne(s))for(let u=0;u<t.length;u++){const h=t[u];typeof h=="string"&&(t[u]=parseFloat(h))}else zs[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let i=0;i<t.length;i++)(t[i]===null||dUt(t[i]))&&r.push(i);r.length&&vUt(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=zs[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const i=n[n.length-1];i!==void 0&&t.getValue(r,i).jump(i,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const i=t.getValue(n);i&&i.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=zs[n](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([s,l])=>{t.getValue(s).set(l)}),this.resolveNoneKeyframes()}}function bUt(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;t&&(r=t.current);const i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(r=>r!=null)}const M2e=(e,t)=>t&&typeof e=="number"?t.transform(e):e,{schedule:wUt}=Bpe(queueMicrotask,!1);function S2e(e){return uVt(e)&&"ownerSVGElement"in e}function xUt(e){return S2e(e)&&e.tagName==="svg"}const _Ut=[...w2e,Un,Ra],MUt=e=>_Ut.find(b2e(e)),dne=()=>({min:0,max:0}),qK=()=>({x:dne(),y:dne()}),z2=new WeakMap;function SUt(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function CUt(e){return typeof e=="string"||Array.isArray(e)}const LUt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],IUt=["initial",...LUt];function C2e(e){return SUt(e.animate)||IUt.some(t=>CUt(e[t]))}function NUt(e){return!!(C2e(e)||e.variants)}function AUt(e,t,n){for(const r in t){const i=t[r],a=n[r];if(ni(i))e.addValue(r,i);else if(ni(a))e.addValue(r,af(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){const o=e.getValue(r);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=e.getStaticValue(r);e.addValue(r,af(o!==void 0?o:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const NU={current:null},L2e={current:!1},$Ut=typeof window<"u";function TUt(){if(L2e.current=!0,!!$Ut)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>NU.current=e.matches;e.addEventListener("change",t),t()}else NU.current=!1}const une=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let hne={};class I2e{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,skipAnimations:a,blockInitialAnimation:o,visualState:s},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=DK,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const g=Di.now();this.renderScheduledAt<g&&(this.renderScheduledAt=g,_o.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=s;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=a,this.options=l,this.blockInitialAnimation=!!o,this.isControllingVariants=C2e(n),this.isVariantNode=NUt(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(n,{},this);for(const g in m){const y=m[g];c[g]!==void 0&&ni(y)&&y.set(c[g])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,z2.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(L2e.current||TUt(),this.shouldReduceMotion=NU.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),pU(this.notifyUpdate),pU(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&f2e.has(t)&&this.current instanceof HTMLElement){const{factory:o,keyframes:s,times:l,ease:c,duration:u}=n.accelerate,h=new u2e({element:this.current,name:t,keyframes:s,times:l,ease:c,duration:ia(u)}),m=o(h);this.valueSubscriptions.set(t,()=>{m(),h.cancel()});return}const r=zf.has(t);r&&this.onBindTransform&&this.onBindTransform();const i=n.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&_o.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in hne){const n=hne[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const a=this.features[t];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):qK()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<une.length;r++){const i=une[r];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const a="on"+i,o=t[a];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=AUt(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=af(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(Ipe(r)||Npe(r))?r=parseFloat(r):!MUt(r)&&Ra.test(n)&&(r=_2e(t,n)),this.setBaseTarget(t,ni(r)?r.get():r)),ni(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=v2e(this.props,n,this.presenceContext?.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!ni(i)?i:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new $pe),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){wUt.render(this.render)}}class N2e extends I2e{constructor(){super(...arguments),this.KeyframeResolver=kUt}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ni(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function EUt({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function PUt(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function DUt(e,t){return EUt(PUt(e.getBoundingClientRect(),t))}const OUt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},RUt=Rf.length;function zUt(e,t,n){let r="",i=!0;for(let a=0;a<RUt;a++){const o=Rf[a],s=e[o];if(s===void 0)continue;let l=!0;if(typeof s=="number")l=s===(o.startsWith("scale")?1:0);else{const c=parseFloat(s);l=o.startsWith("scale")?c===1:c===0}if(!l||n){const c=M2e(s,zK[o]);if(!l){i=!1;const u=OUt[o]||o;r+=`${u}(${c}) `}n&&(t[o]=c)}}return r=r.trim(),n?r=n(t,i?"":r):i&&(r="none"),r}function A2e(e,t,n){const{style:r,vars:i,transformOrigin:a}=e;let o=!1,s=!1;for(const l in t){const c=t[l];if(zf.has(l)){o=!0;continue}else if(Wpe(l)){i[l]=c;continue}else{const u=M2e(c,zK[l]);l.startsWith("origin")?(s=!0,a[l]=u):r[l]=u}}if(t.transform||(o||n?r.transform=zUt(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:l="50%",originY:c="50%",originZ:u=0}=a;r.transformOrigin=`${l} ${c} ${u}`}}function $2e(e,{style:t,vars:n},r,i){const a=e.style;let o;for(o in t)a[o]=t[o];i?.applyProjectionStyles(a,r);for(o in n)a.setProperty(o,n[o])}function fne(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const wp={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ze.test(e))e=parseFloat(e);else return e;const n=fne(e,t.target.x),r=fne(e,t.target.y);return`${n}% ${r}%`}},qUt={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=Ra.parse(e);if(i.length>5)return r;const a=Ra.createTransformer(e),o=typeof i[0]!="number"?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=l;const c=Of(s,l,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),a(i)}},jUt={borderRadius:{...wp,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wp,borderTopRightRadius:wp,borderBottomLeftRadius:wp,borderBottomRightRadius:wp,boxShadow:qUt};function HUt(e,{layout:t,layoutId:n}){return zf.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!jUt[e]||e==="opacity")}function T2e(e,t,n){const r=e.style,i=t?.style,a={};if(!r)return a;for(const o in r)(ni(r[o])||i&&ni(i[o])||HUt(o,e)||n?.getValue(o)?.liveStyle!==void 0)&&(a[o]=r[o]);return a}function FUt(e){return window.getComputedStyle(e)}class VUt extends N2e{constructor(){super(...arguments),this.type="html",this.renderInstance=$2e}readValueFromInstance(t,n){if(zf.has(n))return this.projection?.isProjecting?wU(n):mBt(t,n);{const r=FUt(t),i=(Wpe(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return DUt(t,n)}build(t,n,r){A2e(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return T2e(t,n,r)}}function BUt(e,t){return e in t}class UUt extends I2e{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,n){if(BUt(n,t)){const r=t[n];if(typeof r=="string"||typeof r=="number")return r}}getBaseTargetFromProps(){}removeValueFromRenderState(t,n){delete n.output[t]}measureInstanceViewportBox(){return qK()}build(t,n){Object.assign(t.output,n)}renderInstance(t,{output:n}){Object.assign(t,n)}sortInstanceNodePosition(){return 0}}const WUt={offset:"stroke-dashoffset",array:"stroke-dasharray"},GUt={offset:"strokeDashoffset",array:"strokeDasharray"};function ZUt(e,t,n=1,r=0,i=!0){e.pathLength=1;const a=i?WUt:GUt;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}const KUt=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function XUt(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},l,c,u){if(A2e(e,s,c),l){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m}=e;h.transform&&(m.transform=h.transform,delete h.transform),(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const g of KUt)h[g]!==void 0&&(m[g]=h[g],delete h[g]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),i!==void 0&&ZUt(h,i,a,o,!1)}const E2e=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),YUt=e=>typeof e=="string"&&e.toLowerCase()==="svg";function JUt(e,t,n,r){$2e(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(E2e.has(i)?i:RK(i),t.attrs[i])}function QUt(e,t,n){const r=T2e(e,t,n);for(const i in e)if(ni(e[i])||ni(t[i])){const a=Rf.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[a]=e[i]}return r}class eWt extends N2e{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=qK}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(zf.has(n)){const r=x2e(n);return r&&r.default||0}return n=E2e.has(n)?n:RK(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return QUt(t,n,r)}build(t,n,r){XUt(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,i){JUt(t,n,r,i)}mount(t){this.isSVGTag=YUt(t.tagName),super.mount(t)}}function tWt(e,t,n){const r=ni(e)?e:af(e);return r.start(y2e("",r,t,n)),r.animation}function jK(e){return typeof e=="object"&&!Array.isArray(e)}function P2e(e,t,n,r){return e==null?[]:typeof e=="string"&&jK(t)?bUt(e,n,r):e instanceof NodeList?Array.from(e):Array.isArray(e)?e.filter(i=>i!=null):[e]}function nWt(e,t,n){return e*(t+1)}function pne(e,t,n,r){return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,e+parseFloat(t)):t==="<"?n:t.startsWith("<")?Math.max(0,n+parseFloat(t.slice(1))):r.get(t)??e}function rWt(e,t,n){for(let r=0;r<e.length;r++){const i=e[r];i.at>t&&i.at<n&&(_K(e,i),r--)}}function iWt(e,t,n,r,i,a){rWt(e,i,a);for(let o=0;o<t.length;o++)e.push({value:t[o],at:Of(i,a,r[o]),easing:Fpe(n,o)})}function aWt(e,t){for(let n=0;n<e.length;n++)e[n]=e[n]/(t+1)}function oWt(e,t){return e.at===t.at?e.value===null?1:t.value===null?-1:0:e.at-t.at}const sWt="easeInOut";function lWt(e,{defaultTransition:t={},...n}={},r,i){const a=t.duration||.3,o=new Map,s=new Map,l={},c=new Map;let u=0,h=0,m=0;for(let g=0;g<e.length;g++){const y=e[g];if(typeof y=="string"){c.set(y,h);continue}else if(!Array.isArray(y)){c.set(y.name,pne(h,y.at,u,c));continue}let[v,k,b={}]=y;b.at!==void 0&&(h=pne(h,b.at,u,c));let x=0;const w=(M,_,C,L=0,S=0)=>{const I=cWt(M),{delay:A=0,times:D=r2e(I),type:P=t.type||"keyframes",repeat:O,repeatType:E,repeatDelay:T=0,...R}=_;let{ease:H=t.ease||"easeOut",duration:Y}=_;const j=typeof A=="function"?A(L,S):A,X=I.length,W=OK(P)?P:i?.[P||"keyframes"];if(X<=2&&W){let de=100;if(X===2&&hWt(I)){const le=I[1]-I[0];de=Math.abs(le)}const ye={...t,...R};Y!==void 0&&(ye.duration=ia(Y));const ve=e2e(ye,de,W);H=ve.ease,Y=ve.duration}Y??(Y=a);const G=h+j;D.length===1&&D[0]===0&&(D[1]=1);const J=D.length-I.length;if(J>0&&n2e(D,J),I.length===1&&I.unshift(null),O){Y=nWt(Y,O);const de=[...I],ye=[...D];H=Array.isArray(H)?[...H]:[H];const ve=[...H];for(let le=0;le<O;le++){I.push(...de);for(let pe=0;pe<de.length;pe++)D.push(ye[pe]+(le+1)),H.push(pe===0?"linear":Fpe(ve,pe-1))}aWt(D,O)}const oe=G+Y;iWt(C,I,H,D,G,oe),x=Math.max(j+Y,x),m=Math.max(oe,m)};if(ni(v)){const M=mne(v,s);w(k,b,gne("default",M))}else{const M=P2e(v,k,r,l),_=M.length;for(let C=0;C<_;C++){k=k,b=b;const L=M[C],S=mne(L,s);for(const I in k)w(k[I],dWt(b,I),gne(I,S),C,_)}}u=h,h+=x}return s.forEach((g,y)=>{for(const v in g){const k=g[v];k.sort(oWt);const b=[],x=[],w=[];for(let L=0;L<k.length;L++){const{at:S,value:I,easing:A}=k[L];b.push(I),x.push(CK(0,m,S)),w.push(A||"easeOut")}x[0]!==0&&(x.unshift(0),b.unshift(b[0]),w.unshift(sWt)),x[x.length-1]!==1&&(x.push(1),b.push(null)),o.has(y)||o.set(y,{keyframes:{},transition:{}});const M=o.get(y);M.keyframes[v]=b;const{type:_,...C}=t;M.transition[v]={...C,duration:m,ease:w,times:x,...n}}}),o}function mne(e,t){return!t.has(e)&&t.set(e,{}),t.get(e)}function gne(e,t){return t[e]||(t[e]=[]),t[e]}function cWt(e){return Array.isArray(e)?e:[e]}function dWt(e,t){return e&&e[t]?{...e,...e[t]}:{...e}}const uWt=e=>typeof e=="number",hWt=e=>e.every(uWt);function fWt(e){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},n=S2e(e)&&!xUt(e)?new eWt(t):new VUt(t);n.mount(e),z2.set(e,n)}function pWt(e){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},n=new UUt(t);n.mount(e),z2.set(e,n)}function mWt(e,t){return ni(e)||typeof e=="number"||typeof e=="string"&&!jK(t)}function D2e(e,t,n,r){const i=[];if(mWt(e,t))i.push(tWt(e,jK(t)&&t.default||t,n&&(n.default||n)));else{if(e==null)return i;const a=P2e(e,t,r),o=a.length;for(let s=0;s<o;s++){const l=a[s],c=l instanceof Element?fWt:pWt;z2.has(l)||c(l);const u=z2.get(l),h={...n};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(s,o)),i.push(...lUt(u,{...t,transition:h},{}))}}return i}function gWt(e,t,n){const r=[],i=e.map(o=>{if(Array.isArray(o)&&typeof o[0]=="function"){const s=o[0],l=af(0);return l.on("change",s),o.length===1?[l,[0,1]]:o.length===2?[l,[0,1],o[1]]:[l,o[1],o[2]]}return o});return lWt(i,t,n,{spring:R2}).forEach(({keyframes:o,transition:s},l)=>{r.push(...D2e(l,o,s))}),r}function yWt(e){return Array.isArray(e)&&e.some(Array.isArray)}function vWt(e={}){const{scope:t,reduceMotion:n}=e;function r(i,a,o){let s=[],l;if(yWt(i)){const{onComplete:u,...h}=a||{};typeof u=="function"&&(l=u),s=gWt(i,n!==void 0?{reduceMotion:n,...h}:h,t)}else{const{onComplete:u,...h}=o||{};typeof u=="function"&&(l=u),s=D2e(i,a,n!==void 0?{reduceMotion:n,...h}:h,t)}const c=new qBt(s);return l&&c.finished.then(l),t&&(t.animations.push(c),c.finished.then(()=>{_K(t.animations,c)})),c}return r}const O2e=vWt();var kWt=ie("<div class=size-full>");function bWt(e){const t=bf(),n=ll(),r=di(),i=xj(),a=E0(),o=Z(()=>St(e.directory));return he(()=>{const s=i.data.path.directory;if(!s||s===e.directory)return;const l=t.pathname.slice(o().length+1);n(`/${St(s)}${l}${t.search}${t.hash}`,{replace:!0})}),he(()=>{const s=r.id;s&&i.session.sync(s)}),d(Qne,{get data(){return i.data},get directory(){return e.directory},get mediaUrl(){return a.url},onNavigateToSession:s=>n(`/${o()}/session/${s}`),onSessionHref:s=>`/${o()}/session/${s}`,get children(){return d(sqt,{get children(){return e.children}})}})}function wWt(e){const t=di(),n=_r(),r=ll();let i="";const a=Z(()=>t.dir?xo(t.dir)??"":"");return he(()=>{const o=t.dir;if(o){if(a()){i="";return}i!==o&&(i=o,lr({variant:"error",title:n.t("common.requestFailed"),description:n.t("directory.error.invalidUrl")}),r("/",{replace:!0}))}}),d(ke,{get when(){return a()},keyed:!0,children:o=>d(fPt,{directory:()=>o,get children(){return d(hqt,{get children(){return d(rVt,{get children(){return d(cVt,{get children(){return d(tDt,{get children(){return[d(lVt,{}),(()=>{var s=kWt();return Hr(l=>requestAnimationFrame(()=>O2e(l,{opacity:[0,1],y:[4,0]},{type:"spring",stiffness:400,damping:30})),s),K(s,d(bWt,{directory:o,get children(){return e.children}})),s})()]}})}})}})}})}})})}var xWt=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),_Wt=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function MWt(e){if(Intl.Locale){const n=new Intl.Locale(e).maximize().script??"";return xWt.has(n)}const t=e.split("-")[0];return _Wt.has(t)}function SWt(e){return MWt(e)?"rtl":"ltr"}function R2e(){let e=typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:SWt(e)}}var AU=R2e(),zp=new Set;function yne(){AU=R2e();for(const e of zp)e(AU)}function CWt(){const[e,t]=Ce(AU),n=Z(()=>e());return dn(()=>{zp.size===0&&window.addEventListener("languagechange",yne),zp.add(t),me(()=>{zp.delete(t),zp.size===0&&window.removeEventListener("languagechange",yne)})}),{locale:()=>n().locale,direction:()=>n().direction}}var LWt=Tt();function gs(){const e=CWt();return Lt(LWt)||e}var eV=new Map;function IWt(e){const{locale:t}=gs(),n=Z(()=>t()+(e?Object.entries(e).sort((r,i)=>r[0]<i[0]?-1:1).join():""));return Z(()=>{const r=n();let i;return eV.has(r)&&(i=eV.get(r)),i||(i=new Intl.Collator(t(),e),eV.set(r,i)),i})}const NWt=["top","right","bottom","left"],nl=Math.min,$i=Math.max,Jz=Math.round,Yg=Math.floor,Mo=e=>({x:e,y:e}),AWt={left:"right",right:"left",bottom:"top",top:"bottom"};function $U(e,t,n){return $i(e,nl(t,n))}function O0(e,t){return typeof e=="function"?e(t):e}function rl(e){return e.split("-")[0]}function qf(e){return e.split("-")[1]}function z2e(e){return e==="x"?"y":"x"}function HK(e){return e==="y"?"height":"width"}function Jo(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function FK(e){return z2e(Jo(e))}function $Wt(e,t,n){n===void 0&&(n=!1);const r=qf(e),i=FK(e),a=HK(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Qz(o)),[o,Qz(o)]}function TWt(e){const t=Qz(e);return[TU(e),t,TU(t)]}function TU(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const vne=["left","right"],kne=["right","left"],EWt=["top","bottom"],PWt=["bottom","top"];function DWt(e,t,n){switch(e){case"top":case"bottom":return n?t?kne:vne:t?vne:kne;case"left":case"right":return t?EWt:PWt;default:return[]}}function OWt(e,t,n,r){const i=qf(e);let a=DWt(rl(e),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),t&&(a=a.concat(a.map(TU)))),a}function Qz(e){const t=rl(e);return AWt[t]+e.slice(t.length)}function RWt(e){return{top:0,right:0,bottom:0,left:0,...e}}function q2e(e){return typeof e!="number"?RWt(e):{top:e,right:e,bottom:e,left:e}}function eq(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function bne(e,t,n){let{reference:r,floating:i}=e;const a=Jo(t),o=FK(t),s=HK(o),l=rl(t),c=a==="y",u=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,m=r[s]/2-i[s]/2;let g;switch(l){case"top":g={x:u,y:r.y-i.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-i.width,y:h};break;default:g={x:r.x,y:r.y}}switch(qf(t)){case"start":g[o]-=m*(n&&c?-1:1);break;case"end":g[o]+=m*(n&&c?-1:1);break}return g}async function zWt(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:a,rects:o,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:m=!1,padding:g=0}=O0(t,e),y=q2e(g),k=s[m?h==="floating"?"reference":"floating":h],b=eq(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(k)))==null||n?k:k.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),x=h==="floating"?{x:r,y:i,width:o.floating.width,height:o.floating.height}:o.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(s.floating)),M=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},_=eq(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:x,offsetParent:w,strategy:l}):x);return{top:(b.top-_.top+y.top)/M.y,bottom:(_.bottom-b.bottom+y.bottom)/M.y,left:(b.left-_.left+y.left)/M.x,right:(_.right-b.right+y.right)/M.x}}const qWt=50,jWt=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:zWt},l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:h}=bne(c,r,l),m=r,g=0;const y={};for(let v=0;v<a.length;v++){const k=a[v];if(!k)continue;const{name:b,fn:x}=k,{x:w,y:M,data:_,reset:C}=await x({x:u,y:h,initialPlacement:r,placement:m,strategy:i,middlewareData:y,rects:c,platform:s,elements:{reference:e,floating:t}});u=w??u,h=M??h,y[b]={...y[b],..._},C&&g<qWt&&(g++,typeof C=="object"&&(C.placement&&(m=C.placement),C.rects&&(c=C.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:u,y:h}=bne(c,m,l)),v=-1)}return{x:u,y:h,placement:m,strategy:i,middlewareData:y}},HWt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=O0(e,t)||{};if(c==null)return{};const h=q2e(u),m={x:n,y:r},g=FK(i),y=HK(g),v=await o.getDimensions(c),k=g==="y",b=k?"top":"left",x=k?"bottom":"right",w=k?"clientHeight":"clientWidth",M=a.reference[y]+a.reference[g]-m[g]-a.floating[y],_=m[g]-a.reference[g],C=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let L=C?C[w]:0;(!L||!await(o.isElement==null?void 0:o.isElement(C)))&&(L=s.floating[w]||a.floating[y]);const S=M/2-_/2,I=L/2-v[y]/2-1,A=nl(h[b],I),D=nl(h[x],I),P=A,O=L-v[y]-D,E=L/2-v[y]/2+S,T=$U(P,E,O),R=!l.arrow&&qf(i)!=null&&E!==T&&a.reference[y]/2-(E<P?A:D)-v[y]/2<0,H=R?E<P?E-P:E-O:0;return{[g]:m[g]+H,data:{[g]:T,centerOffset:E-T-H,...R&&{alignmentOffset:H}},reset:R}}}),FWt=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:a,rects:o,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:v=!0,...k}=O0(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const b=rl(i),x=Jo(s),w=rl(s)===s,M=await(l.isRTL==null?void 0:l.isRTL(c.floating)),_=m||(w||!v?[Qz(s)]:TWt(s)),C=y!=="none";!m&&C&&_.push(...OWt(s,v,y,M));const L=[s,..._],S=await l.detectOverflow(t,k),I=[];let A=((r=a.flip)==null?void 0:r.overflows)||[];if(u&&I.push(S[b]),h){const E=$Wt(i,o,M);I.push(S[E[0]],S[E[1]])}if(A=[...A,{placement:i,overflows:I}],!I.every(E=>E<=0)){var D,P;const E=(((D=a.flip)==null?void 0:D.index)||0)+1,T=L[E];if(T&&(!(h==="alignment"?x!==Jo(T):!1)||A.every(Y=>Jo(Y.placement)===x?Y.overflows[0]>0:!0)))return{data:{index:E,overflows:A},reset:{placement:T}};let R=(P=A.filter(H=>H.overflows[0]<=0).sort((H,Y)=>H.overflows[1]-Y.overflows[1])[0])==null?void 0:P.placement;if(!R)switch(g){case"bestFit":{var O;const H=(O=A.filter(Y=>{if(C){const j=Jo(Y.placement);return j===x||j==="y"}return!0}).map(Y=>[Y.placement,Y.overflows.filter(j=>j>0).reduce((j,X)=>j+X,0)]).sort((Y,j)=>Y[1]-j[1])[0])==null?void 0:O[0];H&&(R=H);break}case"initialPlacement":R=s;break}if(i!==R)return{reset:{placement:R}}}return{}}}};function wne(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function xne(e){return NWt.some(t=>e[t]>=0)}const VWt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:i="referenceHidden",...a}=O0(e,t);switch(i){case"referenceHidden":{const o=await r.detectOverflow(t,{...a,elementContext:"reference"}),s=wne(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:xne(s)}}}case"escaped":{const o=await r.detectOverflow(t,{...a,altBoundary:!0}),s=wne(o,n.floating);return{data:{escapedOffsets:s,escaped:xne(s)}}}default:return{}}}}},BWt=new Set(["left","top"]);async function UWt(e,t){const{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=rl(n),s=qf(n),l=Jo(n)==="y",c=BWt.has(o)?-1:1,u=a&&l?-1:1,h=O0(t,e);let{mainAxis:m,crossAxis:g,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return s&&typeof y=="number"&&(g=s==="end"?y*-1:y),l?{x:g*u,y:m*c}:{x:m*c,y:g*u}}const WWt=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:a,placement:o,middlewareData:s}=t,l=await UWt(t,e);return o===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:a+l.y,data:{...l,placement:o}}}}},GWt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:b=>{let{x,y:w}=b;return{x,y:w}}},...c}=O0(e,t),u={x:n,y:r},h=await a.detectOverflow(t,c),m=Jo(rl(i)),g=z2e(m);let y=u[g],v=u[m];if(o){const b=g==="y"?"top":"left",x=g==="y"?"bottom":"right",w=y+h[b],M=y-h[x];y=$U(w,y,M)}if(s){const b=m==="y"?"top":"left",x=m==="y"?"bottom":"right",w=v+h[b],M=v-h[x];v=$U(w,v,M)}const k=l.fn({...t,[g]:y,[m]:v});return{...k,data:{x:k.x-n,y:k.y-r,enabled:{[g]:o,[m]:s}}}}}},ZWt=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:a,platform:o,elements:s}=t,{apply:l=()=>{},...c}=O0(e,t),u=await o.detectOverflow(t,c),h=rl(i),m=qf(i),g=Jo(i)==="y",{width:y,height:v}=a.floating;let k,b;h==="top"||h==="bottom"?(k=h,b=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=h,k=m==="end"?"top":"bottom");const x=v-u.top-u.bottom,w=y-u.left-u.right,M=nl(v-u[k],x),_=nl(y-u[b],w),C=!t.middlewareData.shift;let L=M,S=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(S=w),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(L=x),C&&!m){const A=$i(u.left,0),D=$i(u.right,0),P=$i(u.top,0),O=$i(u.bottom,0);g?S=y-2*(A!==0||D!==0?A+D:$i(u.left,u.right)):L=v-2*(P!==0||O!==0?P+O:$i(u.top,u.bottom))}await l({...t,availableWidth:S,availableHeight:L});const I=await o.getDimensions(s.floating);return y!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}};function Tj(){return typeof window<"u"}function jf(e){return j2e(e)?(e.nodeName||"").toLowerCase():"#document"}function qi(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Eo(e){var t;return(t=(j2e(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function j2e(e){return Tj()?e instanceof Node||e instanceof qi(e).Node:!1}function Va(e){return Tj()?e instanceof Element||e instanceof qi(e).Element:!1}function ys(e){return Tj()?e instanceof HTMLElement||e instanceof qi(e).HTMLElement:!1}function _ne(e){return!Tj()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qi(e).ShadowRoot}function Im(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ba(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!=="inline"&&i!=="contents"}function KWt(e){return/^(table|td|th)$/.test(jf(e))}function Ej(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const XWt=/transform|translate|scale|rotate|perspective|filter/,YWt=/paint|layout|strict|content/,Cl=e=>!!e&&e!=="none";let tV;function VK(e){const t=Va(e)?Ba(e):e;return Cl(t.transform)||Cl(t.translate)||Cl(t.scale)||Cl(t.rotate)||Cl(t.perspective)||!BK()&&(Cl(t.backdropFilter)||Cl(t.filter))||XWt.test(t.willChange||"")||YWt.test(t.contain||"")}function JWt(e){let t=il(e);for(;ys(t)&&!of(t);){if(VK(t))return t;if(Ej(t))return null;t=il(t)}return null}function BK(){return tV==null&&(tV=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),tV}function of(e){return/^(html|body|#document)$/.test(jf(e))}function Ba(e){return qi(e).getComputedStyle(e)}function Pj(e){return Va(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function il(e){if(jf(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_ne(e)&&e.host||Eo(e);return _ne(t)?t.host:t}function H2e(e){const t=il(e);return of(t)?e.ownerDocument?e.ownerDocument.body:e.body:ys(t)&&Im(t)?t:H2e(t)}function q2(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=H2e(e),a=i===((r=e.ownerDocument)==null?void 0:r.body),o=qi(i);if(a){const s=EU(o);return t.concat(o,o.visualViewport||[],Im(i)?i:[],s&&n?q2(s):[])}else return t.concat(i,q2(i,[],n))}function EU(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function F2e(e){const t=Ba(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=ys(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Jz(n)!==a||Jz(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function UK(e){return Va(e)?e:e.contextElement}function qh(e){const t=UK(e);if(!ys(t))return Mo(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:a}=F2e(t);let o=(a?Jz(n.width):n.width)/r,s=(a?Jz(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const QWt=Mo(0);function V2e(e){const t=qi(e);return!BK()||!t.visualViewport?QWt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function eGt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qi(e)?!1:t}function k0(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),a=UK(e);let o=Mo(1);t&&(r?Va(r)&&(o=qh(r)):o=qh(e));const s=eGt(a,n,r)?V2e(a):Mo(0);let l=(i.left+s.x)/o.x,c=(i.top+s.y)/o.y,u=i.width/o.x,h=i.height/o.y;if(a){const m=qi(a),g=r&&Va(r)?qi(r):r;let y=m,v=EU(y);for(;v&&r&&g!==y;){const k=qh(v),b=v.getBoundingClientRect(),x=Ba(v),w=b.left+(v.clientLeft+parseFloat(x.paddingLeft))*k.x,M=b.top+(v.clientTop+parseFloat(x.paddingTop))*k.y;l*=k.x,c*=k.y,u*=k.x,h*=k.y,l+=w,c+=M,y=qi(v),v=EU(y)}}return eq({width:u,height:h,x:l,y:c})}function Dj(e,t){const n=Pj(e).scrollLeft;return t?t.left+n:k0(Eo(e)).left+n}function B2e(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Dj(e,n),i=n.top+t.scrollTop;return{x:r,y:i}}function tGt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const a=i==="fixed",o=Eo(r),s=t?Ej(t.floating):!1;if(r===o||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Mo(1);const u=Mo(0),h=ys(r);if((h||!h&&!a)&&((jf(r)!=="body"||Im(o))&&(l=Pj(r)),h)){const g=k0(r);c=qh(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const m=o&&!h&&!a?B2e(o,l):Mo(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+m.x,y:n.y*c.y-l.scrollTop*c.y+u.y+m.y}}function nGt(e){return Array.from(e.getClientRects())}function rGt(e){const t=Eo(e),n=Pj(e),r=e.ownerDocument.body,i=$i(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=$i(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Dj(e);const s=-n.scrollTop;return Ba(r).direction==="rtl"&&(o+=$i(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}const Mne=25;function iGt(e,t){const n=qi(e),r=Eo(e),i=n.visualViewport;let a=r.clientWidth,o=r.clientHeight,s=0,l=0;if(i){a=i.width,o=i.height;const u=BK();(!u||u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}const c=Dj(r);if(c<=0){const u=r.ownerDocument,h=u.body,m=getComputedStyle(h),g=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,y=Math.abs(r.clientWidth-h.clientWidth-g);y<=Mne&&(a-=y)}else c<=Mne&&(a+=c);return{width:a,height:o,x:s,y:l}}function aGt(e,t){const n=k0(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ys(e)?qh(e):Mo(1),o=e.clientWidth*a.x,s=e.clientHeight*a.y,l=i*a.x,c=r*a.y;return{width:o,height:s,x:l,y:c}}function Sne(e,t,n){let r;if(t==="viewport")r=iGt(e,n);else if(t==="document")r=rGt(Eo(e));else if(Va(t))r=aGt(t,n);else{const i=V2e(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return eq(r)}function U2e(e,t){const n=il(e);return n===t||!Va(n)||of(n)?!1:Ba(n).position==="fixed"||U2e(n,t)}function oGt(e,t){const n=t.get(e);if(n)return n;let r=q2(e,[],!1).filter(s=>Va(s)&&jf(s)!=="body"),i=null;const a=Ba(e).position==="fixed";let o=a?il(e):e;for(;Va(o)&&!of(o);){const s=Ba(o),l=VK(o);!l&&s.position==="fixed"&&(i=null),(a?!l&&!i:!l&&s.position==="static"&&!!i&&(i.position==="absolute"||i.position==="fixed")||Im(o)&&!l&&U2e(e,o))?r=r.filter(u=>u!==o):i=s,o=il(o)}return t.set(e,r),r}function sGt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[...n==="clippingAncestors"?Ej(t)?[]:oGt(t,this._c):[].concat(n),r],s=Sne(t,o[0],i);let l=s.top,c=s.right,u=s.bottom,h=s.left;for(let m=1;m<o.length;m++){const g=Sne(t,o[m],i);l=$i(g.top,l),c=nl(g.right,c),u=nl(g.bottom,u),h=$i(g.left,h)}return{width:c-h,height:u-l,x:h,y:l}}function lGt(e){const{width:t,height:n}=F2e(e);return{width:t,height:n}}function cGt(e,t,n){const r=ys(t),i=Eo(t),a=n==="fixed",o=k0(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Mo(0);function c(){l.x=Dj(i)}if(r||!r&&!a)if((jf(t)!=="body"||Im(i))&&(s=Pj(t)),r){const g=k0(t,!0,a,t);l.x=g.x+t.clientLeft,l.y=g.y+t.clientTop}else i&&c();a&&!r&&i&&c();const u=i&&!r&&!a?B2e(i,s):Mo(0),h=o.left+s.scrollLeft-l.x-u.x,m=o.top+s.scrollTop-l.y-u.y;return{x:h,y:m,width:o.width,height:o.height}}function nV(e){return Ba(e).position==="static"}function Cne(e,t){if(!ys(e)||Ba(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Eo(e)===n&&(n=n.ownerDocument.body),n}function W2e(e,t){const n=qi(e);if(Ej(e))return n;if(!ys(e)){let i=il(e);for(;i&&!of(i);){if(Va(i)&&!nV(i))return i;i=il(i)}return n}let r=Cne(e,t);for(;r&&KWt(r)&&nV(r);)r=Cne(r,t);return r&&of(r)&&nV(r)&&!VK(r)?n:r||JWt(e)||n}const dGt=async function(e){const t=this.getOffsetParent||W2e,n=this.getDimensions,r=await n(e.floating);return{reference:cGt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function uGt(e){return Ba(e).direction==="rtl"}const G2e={convertOffsetParentRelativeRectToViewportRelativeRect:tGt,getDocumentElement:Eo,getClippingRect:sGt,getOffsetParent:W2e,getElementRects:dGt,getClientRects:nGt,getDimensions:lGt,getScale:qh,isElement:Va,isRTL:uGt};function Z2e(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function hGt(e,t){let n=null,r;const i=Eo(e);function a(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:h,width:m,height:g}=c;if(s||t(),!m||!g)return;const y=Yg(h),v=Yg(i.clientWidth-(u+m)),k=Yg(i.clientHeight-(h+g)),b=Yg(u),w={rootMargin:-y+"px "+-v+"px "+-k+"px "+-b+"px",threshold:$i(0,nl(1,l))||1};let M=!0;function _(C){const L=C[0].intersectionRatio;if(L!==l){if(!M)return o();L?o(!1,L):r=setTimeout(()=>{o(!1,1e-7)},1e3)}L===1&&!Z2e(c,e.getBoundingClientRect())&&o(),M=!1}try{n=new IntersectionObserver(_,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,w)}n.observe(e)}return o(!0),a}function fGt(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=UK(e),u=i||a?[...c?q2(c):[],...t?q2(t):[]]:[];u.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),a&&b.addEventListener("resize",n)});const h=c&&s?hGt(c,n):null;let m=-1,g=null;o&&(g=new ResizeObserver(b=>{let[x]=b;x&&x.target===c&&g&&t&&(g.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=g)==null||w.observe(t)})),n()}),c&&!l&&g.observe(c),t&&g.observe(t));let y,v=l?k0(e):null;l&&k();function k(){const b=k0(e);v&&!Z2e(v,b)&&n(),v=b,y=requestAnimationFrame(k)}return n(),()=>{var b;u.forEach(x=>{i&&x.removeEventListener("scroll",n),a&&x.removeEventListener("resize",n)}),h?.(),(b=g)==null||b.disconnect(),g=null,l&&cancelAnimationFrame(y)}}const pGt=WWt,mGt=GWt,gGt=FWt,yGt=ZWt,vGt=VWt,kGt=HWt,bGt=(e,t,n)=>{const r=new Map,i={platform:G2e,...n},a={...i.platform,_c:r};return jWt(e,t,{...i,platform:a})};var wGt=ie('<svg display=block viewBox="0 0 30 30"style=transform:scale(1.02)><g><path fill=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z></path><path stroke=none d=M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z>'),WK=Tt();function GK(){const e=Lt(WK);if(e===void 0)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var PU=30,Lne=PU/2,xGt={top:180,right:-90,bottom:0,left:90};function vs(e){const t=GK(),n=ft({size:PU},e),[r,i]=Se(n,["ref","style","size"]),a=()=>t.currentPlacement().split("-")[0],o=_Gt(t.contentRef),s=()=>o()?.getPropertyValue("background-color")||"none",l=()=>o()?.getPropertyValue(`border-${a()}-color`)||"none",c=()=>o()?.getPropertyValue(`border-${a()}-width`)||"0px",u=()=>Number.parseInt(c())*2*(PU/r.size),h=()=>`rotate(${xGt[a()]} ${Lne} ${Lne}) translate(0 2)`;return d(zt,f({as:"div",ref(m){var g=hn(t.setArrowRef,r.ref);typeof g=="function"&&g(m)},"aria-hidden":"true",get style(){return Wa({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:s(),stroke:l(),"stroke-width":u()},r.style)}},i,{get children(){var m=wGt(),g=m.firstChild,y=g.firstChild;return y.nextSibling,Qe(()=>gt(g,"transform",h())),m}}))}function _Gt(e){const[t,n]=Ce();return he(()=>{const r=e();r&&n(qU(r).getComputedStyle(r))}),t}function MGt(e){const t=GK(),[n,r]=Se(e,["ref","style"]);return d(zt,f({as:"div",ref(i){var a=hn(t.setPositionerRef,n.ref);typeof a=="function"&&a(i)},"data-popper-positioner":"",get style(){return Wa({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}function Ine(e){const{x:t=0,y:n=0,width:r=0,height:i=0}=e??{};if(typeof DOMRect=="function")return new DOMRect(t,n,r,i);const a={x:t,y:n,width:r,height:i,top:n,right:t+r,bottom:n+i,left:t};return{...a,toJSON:()=>a}}function SGt(e,t){return{contextElement:e,getBoundingClientRect:()=>{const r=t(e);return r?Ine(r):e?e.getBoundingClientRect():Ine()}}}function CGt(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var LGt={top:"bottom",right:"left",bottom:"top",left:"right"};function IGt(e,t){const[n,r]=e.split("-"),i=LGt[n];return r?n==="left"||n==="right"?`${i} ${r==="start"?"top":"bottom"}`:r==="start"?`${i} ${t==="rtl"?"right":"left"}`:`${i} ${t==="rtl"?"left":"right"}`:`${i} center`}function NGt(e){const t=ft({getAnchorRect:m=>m?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=Ce(),[i,a]=Ce(),[o,s]=Ce(t.placement),l=()=>SGt(t.anchorRef?.(),t.getAnchorRect),{direction:c}=gs();async function u(){const m=l(),g=n(),y=i();if(!m||!g)return;const v=(y?.clientHeight||0)/2,k=typeof t.gutter=="number"?t.gutter+v:t.gutter??v;g.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),m.getBoundingClientRect();const b=[pGt(({placement:C})=>{const L=!!C.split("-")[1];return{mainAxis:k,crossAxis:L?void 0:t.shift,alignmentAxis:t.shift}})];if(t.flip!==!1){const C=typeof t.flip=="string"?t.flip.split(" "):void 0;if(C!==void 0&&!C.every(CGt))throw new Error("`flip` expects a spaced-delimited list of placements");b.push(gGt({padding:t.overflowPadding,fallbackPlacements:C}))}(t.slide||t.overlap)&&b.push(mGt({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),b.push(yGt({padding:t.overflowPadding,apply({availableWidth:C,availableHeight:L,rects:S}){const I=Math.round(S.reference.width);C=Math.floor(C),L=Math.floor(L),g.style.setProperty("--kb-popper-anchor-width",`${I}px`),g.style.setProperty("--kb-popper-content-available-width",`${C}px`),g.style.setProperty("--kb-popper-content-available-height",`${L}px`),t.sameWidth&&(g.style.width=`${I}px`),t.fitViewport&&(g.style.maxWidth=`${C}px`,g.style.maxHeight=`${L}px`)}})),t.hideWhenDetached&&b.push(vGt({padding:t.detachedPadding})),y&&b.push(kGt({element:y,padding:t.arrowPadding}));const x=await bGt(m,g,{placement:t.placement,strategy:"absolute",middleware:b,platform:{...G2e,isRTL:()=>c()==="rtl"}});if(s(x.placement),t.onCurrentPlacementChange?.(x.placement),!g)return;g.style.setProperty("--kb-popper-content-transform-origin",IGt(x.placement,c()));const w=Math.round(x.x),M=Math.round(x.y);let _;if(t.hideWhenDetached&&(_=x.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(g.style,{top:"0",left:"0",transform:`translate3d(${w}px, ${M}px, 0)`,visibility:_}),y&&x.middlewareData.arrow){const{x:C,y:L}=x.middlewareData.arrow,S=x.placement.split("-")[0];Object.assign(y.style,{left:C!=null?`${C}px`:"",top:L!=null?`${L}px`:"",[S]:"100%"})}}he(()=>{const m=l(),g=n();if(!m||!g)return;const y=fGt(m,g,u,{elementResize:typeof ResizeObserver=="function"});me(y)}),he(()=>{const m=n(),g=t.contentRef?.();!m||!g||queueMicrotask(()=>{m.style.zIndex=getComputedStyle(g).zIndex})});const h={currentPlacement:o,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:a};return d(WK.Provider,{value:h,get children(){return t.children}})}var Hf=Object.assign(NGt,{Arrow:vs,Context:WK,usePopperContext:GK,Positioner:MGt}),AGt={};Ga(AGt,{Arrow:()=>vs,Content:()=>X2e,Portal:()=>Y2e,Root:()=>J2e,Tooltip:()=>qp,Trigger:()=>Q2e,useTooltipContext:()=>Oj});var K2e=Tt();function Oj(){const e=Lt(K2e);if(e===void 0)throw new Error("[kobalte]: `useTooltipContext` must be used within a `Tooltip` component");return e}function X2e(e){const t=Oj(),n=ft({id:t.generateId("content")},e),[r,i]=Se(n,["ref","style"]);return he(()=>me(t.registerContentId(i.id))),d(ke,{get when(){return t.contentPresent()},get children(){return d(Hf.Positioner,{get children(){return d(lq,f({ref(a){var o=hn(s=>{t.setContentRef(s)},r.ref);typeof o=="function"&&o(a)},role:"tooltip",disableOutsidePointerEvents:!1,get style(){return Wa({"--kb-tooltip-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},r.style)},onFocusOutside:a=>a.preventDefault(),onDismiss:()=>t.hideTooltip(!0)},()=>t.dataset(),i))}})}})}function Y2e(e){const t=Oj();return d(ke,{get when(){return t.contentPresent()},get children(){return d(w0,e)}})}function $Gt(e,t,n){const r=e.split("-")[0],i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=[],s=i.left+i.width/2,l=i.top+i.height/2;switch(r){case"top":o.push([i.left,l]),o.push([a.left,a.bottom]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([i.right,l]);break;case"right":o.push([s,i.top]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([a.left,a.bottom]),o.push([s,i.bottom]);break;case"bottom":o.push([i.left,l]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([a.right,a.top]),o.push([i.right,l]);break;case"left":o.push([s,i.top]),o.push([a.right,a.top]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([s,i.bottom]);break}return o}var Ll={},TGt=0,ih=!1,Ho,xp,ah;function J2e(e){const t=`tooltip-${xr()}`,n=`${++TGt}`,r=ft({id:t,openDelay:700,closeDelay:300,skipDelayDuration:300},e),[i,a]=Se(r,["id","open","defaultOpen","onOpenChange","disabled","triggerOnFocusOnly","openDelay","closeDelay","skipDelayDuration","ignoreSafeArea","forceMount"]);let o;const[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(),[g,y]=Ce(a.placement),v=x0({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:E=>i.onOpenChange?.(E)}),{present:k}=i0({show:()=>i.forceMount||v.isOpen(),element:()=>h()??null}),b=()=>{Ll[n]=w},x=()=>{for(const E in Ll)E!==n&&(Ll[E](!0),delete Ll[E])},w=(E=!1)=>{E||i.closeDelay&&i.closeDelay<=0?(window.clearTimeout(o),o=void 0,v.close()):o||(o=window.setTimeout(()=>{o=void 0,v.close()},i.closeDelay)),window.clearTimeout(Ho),Ho=void 0,i.skipDelayDuration&&i.skipDelayDuration>=0&&(ah=window.setTimeout(()=>{window.clearTimeout(ah),ah=void 0},i.skipDelayDuration)),ih&&(window.clearTimeout(xp),xp=window.setTimeout(()=>{delete Ll[n],xp=void 0,ih=!1},i.closeDelay))},M=()=>{clearTimeout(o),o=void 0,x(),b(),ih=!0,v.open(),window.clearTimeout(Ho),Ho=void 0,window.clearTimeout(xp),xp=void 0,window.clearTimeout(ah),ah=void 0},_=()=>{x(),b(),!v.isOpen()&&!Ho&&!ih?Ho=window.setTimeout(()=>{Ho=void 0,ih=!0,M()},i.openDelay):v.isOpen()||M()},C=(E=!1)=>{!E&&i.openDelay&&i.openDelay>0&&!o&&!ah?_():M()},L=()=>{window.clearTimeout(Ho),Ho=void 0,ih=!1},S=()=>{window.clearTimeout(o),o=void 0},I=E=>Yn(c(),E)||Yn(h(),E),A=E=>{const T=c(),R=h();if(!(!T||!R))return $Gt(E,T,R)},D=E=>{const T=E.target;if(I(T)){S();return}if(!i.ignoreSafeArea){const R=A(g());if(R&&VU(cre(E),R)){S();return}}o||w()};he(()=>{if(!v.isOpen())return;const E=ri();E.addEventListener("pointermove",D,!0),me(()=>{E.removeEventListener("pointermove",D,!0)})}),he(()=>{const E=c();if(!E||!v.isOpen())return;const T=H=>{const Y=H.target;Yn(Y,E)&&w(!0)},R=qU();R.addEventListener("scroll",T,{capture:!0}),me(()=>{R.removeEventListener("scroll",T,{capture:!0})})}),me(()=>{clearTimeout(o),Ll[n]&&delete Ll[n]});const O={dataset:Z(()=>({"data-expanded":v.isOpen()?"":void 0,"data-closed":v.isOpen()?void 0:""})),isOpen:v.isOpen,isDisabled:()=>i.disabled??!1,triggerOnFocusOnly:()=>i.triggerOnFocusOnly??!1,contentId:s,contentPresent:k,openTooltip:C,hideTooltip:w,cancelOpening:L,generateId:Io(()=>r.id),registerContentId:zr(l),isTargetOnTooltip:I,setTriggerRef:u,setContentRef:m};return d(K2e.Provider,{value:O,get children(){return d(Hf,f({anchorRef:c,contentRef:h,onCurrentPlacementChange:y},a))}})}function Q2e(e){let t;const n=Oj(),[r,i]=Se(e,["ref","onPointerEnter","onPointerLeave","onPointerDown","onClick","onFocus","onBlur"]);let a=!1,o=!1,s=!1;const l=()=>{a=!1},c=()=>{!n.isOpen()&&(o||s)&&n.openTooltip(s)},u=b=>{n.isOpen()&&!o&&!s&&n.hideTooltip(b)},h=b=>{dt(b,r.onPointerEnter),!(b.pointerType==="touch"||n.triggerOnFocusOnly()||n.isDisabled()||b.defaultPrevented)&&(o=!0,c())},m=b=>{dt(b,r.onPointerLeave),b.pointerType!=="touch"&&(o=!1,s=!1,n.isOpen()?u():n.cancelOpening())},g=b=>{dt(b,r.onPointerDown),a=!0,ri(t).addEventListener("pointerup",l,{once:!0})},y=b=>{dt(b,r.onClick),o=!1,s=!1,u(!0)},v=b=>{dt(b,r.onFocus),!(n.isDisabled()||b.defaultPrevented||a)&&(s=!0,c())},k=b=>{dt(b,r.onBlur);const x=b.relatedTarget;n.isTargetOnTooltip(x)||(o=!1,s=!1,u(!0))};return me(()=>{ri(t).removeEventListener("pointerup",l)}),d(zt,f({as:"button",ref(b){var x=hn(w=>{n.setTriggerRef(w),t=w},r.ref);typeof x=="function"&&x(b)},get"aria-describedby"(){return bt(()=>!!n.isOpen())()?n.contentId():void 0},onPointerEnter:h,onPointerLeave:m,onPointerDown:g,onClick:y,onFocus:v,onBlur:k},()=>n.dataset(),i))}var qp=Object.assign(J2e,{Arrow:vs,Content:X2e,Portal:Y2e,Trigger:Q2e}),EGt=ie("<div data-slot=tooltip-keybind><span></span><span data-slot=tooltip-keybind-key>");function eme(e){const[t,n]=Se(e,["title","keybind"]);return d(Ua,f(n,{get value(){return(()=>{var r=EGt(),i=r.firstChild,a=i.nextSibling;return K(i,()=>t.title),K(a,()=>t.keybind),r})()}}))}function Ua(e){let t;const[n,r]=nt({open:!1,block:!1,expand:!1}),[i,a]=Se(e,["children","class","contentClass","contentStyle","inactive","forceOpen","ignoreSafeArea","value"]),o=()=>r("open",!1),s=()=>{const m=document.activeElement;return!t||!m?!1:t.contains(m)},l=(m=n.expand)=>{m||t?.matches(":hover")||s()||r("block",!1)},c=()=>{const m=!!t?.querySelector('[aria-expanded="true"], [data-expanded]');if(r("expand",m),m){r("block",!0),o();return}l(m)},u=()=>{r("block",!0),o()},h=()=>{s()||o(),l()};return he(()=>{if(!t)return;c();const m=new MutationObserver(c);m.observe(t,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["aria-expanded","data-expanded"]}),me(()=>m.disconnect())}),d(r0,{get children(){return[d(Zn,{get when(){return i.inactive},get children(){return i.children}}),d(Zn,{when:!0,get children(){return d(qp,f({gutter:4},a,{closeDelay:0,get ignoreSafeArea(){return i.ignoreSafeArea??!0},get open(){return i.forceOpen||n.open},onOpenChange:m=>{i.forceOpen||n.block&&m||r("open",m)},get children(){return[d(qp.Trigger,{ref(m){var g=t;typeof g=="function"?g(m):t=m},as:"div","data-component":"tooltip-trigger",get class(){return i.class},onPointerDownCapture:u,onKeyDownCapture:m=>{m.key!=="Enter"&&m.key!==" "||u()},onPointerLeave:h,onFocusOut:()=>requestAnimationFrame(()=>l()),get children(){return i.children}}),d(qp.Portal,{get children(){return d(qp.Content,{"data-component":"tooltip",get"data-placement"(){return e.placement},get"data-force-open"(){return i.forceOpen},get class(){return i.contentClass},get style(){return i.contentStyle},get children(){return i.value}})}})]}}))}})]}})}function tme(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],i=l=>{if(l==null)return"";const c=e.getKey??"key",u=lh(c)?l[c]:c(l);return u!=null?String(u):""},a=l=>{if(l==null)return"";const c=e.getTextValue??"textValue",u=lh(c)?l[c]:c(l);return u!=null?String(u):""},o=l=>{if(l==null)return!1;const c=e.getDisabled??"disabled";return(lh(c)?l[c]:c(l))??!1},s=l=>{if(l!=null)return lh(e.getSectionChildren)?l[e.getSectionChildren]:e.getSectionChildren?.(l)};for(const l of e.dataSource){if(lh(l)||Aye(l)){r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:o(l),level:n,index:t}),t++;continue}if(s(l)!=null){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const c=s(l)??[];if(c.length>0){const u=tme({dataSource:c,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...u),t+=u.length}}else r.push({type:"item",rawValue:l,key:i(l),textValue:a(l),disabled:o(l),level:n,index:t}),t++}return r}function PGt(e,t=[]){return Z(()=>{const n=tme({dataSource:be(e.dataSource),getKey:be(e.getKey),getTextValue:be(e.getTextValue),getDisabled:be(e.getDisabled),getSectionChildren:be(e.getSectionChildren)});for(let r=0;r<t.length;r++)t[r]();return e.factory(n)})}var Uo=class nme extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof nme?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function DGt(e){const[t,n]=G2(e);return[()=>t()??new Uo,n]}function rme(e){return Dye()?e.altKey:e.ctrlKey}function mh(e){return sq()?e.metaKey:e.ctrlKey}function Nne(e){return new Uo(e)}function OGt(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function RGt(e){const t=ft({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=Ce(!1),[i,a]=Ce(),o=Z(()=>{const v=be(t.selectedKeys);return v!=null?Nne(v):v}),s=Z(()=>{const v=be(t.defaultSelectedKeys);return v!=null?Nne(v):new Uo}),[l,c]=DGt({value:o,defaultValue:s,onChange:v=>t.onSelectionChange?.(v)}),[u,h]=Ce(be(t.selectionBehavior)),m=()=>be(t.selectionMode),g=()=>be(t.disallowEmptySelection)??!1,y=v=>{(be(t.allowDuplicateSelectionEvents)||!OGt(v,l()))&&c(v)};return he(()=>{const v=l();be(t.selectionBehavior)==="replace"&&u()==="toggle"&&typeof v=="object"&&v.size===0&&h("replace")}),he(()=>{h(be(t.selectionBehavior)??"toggle")}),{selectionMode:m,disallowEmptySelection:g,selectionBehavior:u,setSelectionBehavior:h,isFocused:n,setFocused:r,focusedKey:i,setFocusedKey:a,selectedKeys:l,setSelectedKeys:y}}function zGt(e){const[t,n]=Ce(""),[r,i]=Ce(-1);return{typeSelectHandlers:{onKeyDown:o=>{if(be(e.isDisabled))return;const s=be(e.keyboardDelegate),l=be(e.selectionManager);if(!s.getKeyForSearch)return;const c=qGt(o.key);if(!c||o.ctrlKey||o.metaKey)return;c===" "&&t().trim().length>0&&(o.preventDefault(),o.stopPropagation());let u=n(m=>m+c),h=s.getKeyForSearch(u,l.focusedKey())??s.getKeyForSearch(u);h==null&&jGt(u)&&(u=u[0],h=s.getKeyForSearch(u,l.focusedKey())??s.getKeyForSearch(u)),h!=null&&(l.setFocusedKey(h),e.onTypeSelect?.(h)),clearTimeout(r()),i(window.setTimeout(()=>n(""),500))}}}}function qGt(e){return e.length===1||!/^[A-Z]/i.test(e)?e:""}function jGt(e){return e.split("").every(t=>t===e[0])}function HGt(e,t,n){const i=f({selectOnFocus:()=>be(e.selectionManager).selectionBehavior()==="replace"},e),a=()=>n?.()??t(),{direction:o}=gs();let s={top:0,left:0};Mye(()=>be(i.isVirtualized)?void 0:a(),"scroll",()=>{const k=a();k&&(s={top:k.scrollTop,left:k.scrollLeft})});const{typeSelectHandlers:l}=zGt({isDisabled:()=>be(i.disallowTypeAhead),keyboardDelegate:()=>be(i.keyboardDelegate),selectionManager:()=>be(i.selectionManager)}),c=()=>be(i.orientation)??"vertical",u=k=>{dt(k,l.onKeyDown),k.altKey&&k.key==="Tab"&&k.preventDefault();const b=t();if(!b?.contains(k.target))return;const x=be(i.selectionManager),w=be(i.selectOnFocus),M=S=>{S!=null&&(x.setFocusedKey(S),k.shiftKey&&x.selectionMode()==="multiple"?x.extendSelection(S):w&&!rme(k)&&x.replaceSelection(S))},_=be(i.keyboardDelegate),C=be(i.shouldFocusWrap),L=x.focusedKey();switch(k.key){case(c()==="vertical"?"ArrowDown":"ArrowRight"):{if(_.getKeyBelow){k.preventDefault();let S;L!=null?S=_.getKeyBelow(L):S=_.getFirstKey?.(),S==null&&C&&(S=_.getFirstKey?.(L)),M(S)}break}case(c()==="vertical"?"ArrowUp":"ArrowLeft"):{if(_.getKeyAbove){k.preventDefault();let S;L!=null?S=_.getKeyAbove(L):S=_.getLastKey?.(),S==null&&C&&(S=_.getLastKey?.(L)),M(S)}break}case(c()==="vertical"?"ArrowLeft":"ArrowUp"):{if(_.getKeyLeftOf){k.preventDefault();const S=o()==="rtl";let I;L!=null?I=_.getKeyLeftOf(L):I=S?_.getFirstKey?.():_.getLastKey?.(),M(I)}break}case(c()==="vertical"?"ArrowRight":"ArrowDown"):{if(_.getKeyRightOf){k.preventDefault();const S=o()==="rtl";let I;L!=null?I=_.getKeyRightOf(L):I=S?_.getLastKey?.():_.getFirstKey?.(),M(I)}break}case"Home":if(_.getFirstKey){k.preventDefault();const S=_.getFirstKey(L,mh(k));S!=null&&(x.setFocusedKey(S),mh(k)&&k.shiftKey&&x.selectionMode()==="multiple"?x.extendSelection(S):w&&x.replaceSelection(S))}break;case"End":if(_.getLastKey){k.preventDefault();const S=_.getLastKey(L,mh(k));S!=null&&(x.setFocusedKey(S),mh(k)&&k.shiftKey&&x.selectionMode()==="multiple"?x.extendSelection(S):w&&x.replaceSelection(S))}break;case"PageDown":if(_.getKeyPageBelow&&L!=null){k.preventDefault();const S=_.getKeyPageBelow(L);M(S)}break;case"PageUp":if(_.getKeyPageAbove&&L!=null){k.preventDefault();const S=_.getKeyPageAbove(L);M(S)}break;case"a":mh(k)&&x.selectionMode()==="multiple"&&be(i.disallowSelectAll)!==!0&&(k.preventDefault(),x.selectAll());break;case"Escape":k.defaultPrevented||(k.preventDefault(),be(i.disallowEmptySelection)||x.clearSelection());break;case"Tab":if(!be(i.allowsTabNavigation)){if(k.shiftKey)b.focus();else{const S=Wye(b,{tabbable:!0});let I,A;do A=S.lastChild(),A&&(I=A);while(A);I&&!I.contains(document.activeElement)&&ur(I)}break}}},h=k=>{const b=be(i.selectionManager),x=be(i.keyboardDelegate),w=be(i.selectOnFocus);if(b.isFocused()){k.currentTarget.contains(k.target)||b.setFocused(!1);return}if(k.currentTarget.contains(k.target)){if(b.setFocused(!0),b.focusedKey()==null){const M=C=>{C!=null&&(b.setFocusedKey(C),w&&b.replaceSelection(C))},_=k.relatedTarget;_&&k.currentTarget.compareDocumentPosition(_)&Node.DOCUMENT_POSITION_FOLLOWING?M(b.lastSelectedKey()??x.getLastKey?.()):M(b.firstSelectedKey()??x.getFirstKey?.())}else if(!be(i.isVirtualized)){const M=a();if(M){M.scrollTop=s.top,M.scrollLeft=s.left;const _=M.querySelector(`[data-key="${b.focusedKey()}"]`);_&&(ur(_),fV(M,_))}}}},m=k=>{const b=be(i.selectionManager);k.currentTarget.contains(k.relatedTarget)||b.setFocused(!1)},g=k=>{a()===k.target&&k.preventDefault()},y=()=>{const k=be(i.autoFocus);if(!k)return;const b=be(i.selectionManager),x=be(i.keyboardDelegate);let w;k==="first"&&(w=x.getFirstKey?.()),k==="last"&&(w=x.getLastKey?.());const M=b.selectedKeys();M.size&&(w=M.values().next().value),b.setFocused(!0),b.setFocusedKey(w);const _=t();_&&w==null&&!be(i.shouldUseVirtualFocus)&&ur(_)};return dn(()=>{i.deferAutoFocus?setTimeout(y,0):y()}),he(vn([a,()=>be(i.isVirtualized),()=>be(i.selectionManager).focusedKey()],k=>{const[b,x,w]=k;if(x)w&&i.scrollToKey?.(w);else if(w&&b){const M=b.querySelector(`[data-key="${w}"]`);M&&fV(b,M)}})),{tabIndex:Z(()=>{if(!be(i.shouldUseVirtualFocus))return be(i.selectionManager).focusedKey()==null?0:-1}),onKeyDown:u,onMouseDown:g,onFocusIn:h,onFocusOut:m}}function ime(e,t){const n=()=>be(e.selectionManager),r=()=>be(e.key),i=()=>be(e.shouldUseVirtualFocus),a=x=>{n().selectionMode()!=="none"&&(n().selectionMode()==="single"?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):x?.shiftKey?n().extendSelection(r()):n().selectionBehavior()==="toggle"||mh(x)||"pointerType"in x&&x.pointerType==="touch"?n().toggleSelection(r()):n().replaceSelection(r()))},o=()=>n().isSelected(r()),s=()=>be(e.disabled)||n().isDisabled(r()),l=()=>!s()&&n().canSelectItem(r());let c=null;const u=x=>{l()&&(c=x.pointerType,x.pointerType==="mouse"&&x.button===0&&!be(e.shouldSelectOnPressUp)&&a(x))},h=x=>{l()&&x.pointerType==="mouse"&&x.button===0&&be(e.shouldSelectOnPressUp)&&be(e.allowsDifferentPressOrigin)&&a(x)},m=x=>{l()&&(be(e.shouldSelectOnPressUp)&&!be(e.allowsDifferentPressOrigin)||c!=="mouse")&&a(x)},g=x=>{!l()||!["Enter"," "].includes(x.key)||(rme(x)?n().toggleSelection(r()):a(x))},y=x=>{s()&&x.preventDefault()},v=x=>{const w=t();i()||s()||!w||x.target===w&&n().setFocusedKey(r())},k=Z(()=>{if(!(i()||s()))return r()===n().focusedKey()?0:-1}),b=Z(()=>be(e.virtualized)?void 0:r());return he(vn([t,r,i,()=>n().focusedKey(),()=>n().isFocused()],([x,w,M,_,C])=>{x&&w===_&&C&&!M&&document.activeElement!==x&&(e.focus?e.focus():ur(x))})),{isSelected:o,isDisabled:s,allowsSelection:l,tabIndex:k,dataKey:b,onPointerDown:u,onPointerUp:h,onClick:m,onKeyDown:g,onMouseDown:y,onFocus:v}}var FGt=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(e==null||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if(this.state.selectionMode()==="none")return!1;const t=this.getKey(e);return t==null?!1:this.state.selectedKeys().has(t)}isEmpty(){return this.state.selectedKeys().size===0}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every(t=>e.has(t))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index<e.index;(!e||r)&&(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t),r=n?.index!=null&&e?.index!=null&&n.index>e.index;(!e||r)&&(e=n)}return e?.key}extendSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,i=new Uo(n,r,t);for(const a of this.getKeyRange(r,n.currentKey||t))i.delete(a);for(const a of this.getKeyRange(t,r))this.canSelectItem(a)&&i.add(a);this.state.setSelectedKeys(i)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?n.index!=null&&r.index!=null&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;r!=null;){const i=this.collection().getItem(r);if(i&&i.type==="item"&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?!t||t.type!=="item"?null:t.key:e}toggleSelection(e){if(this.selectionMode()==="none")return;if(this.selectionMode()==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}const t=this.getKey(e);if(t==null)return;const n=new Uo(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),!(this.disallowEmptySelection()&&n.size===0)&&this.state.setSelectedKeys(n)}replaceSelection(e){if(this.selectionMode()==="none")return;const t=this.getKey(e);if(t==null)return;const n=this.canSelectItem(t)?new Uo([t],t,t):new Uo;this.state.setSelectedKeys(n)}setSelectedKeys(e){if(this.selectionMode()==="none")return;const t=new Uo;for(const n of e){const r=this.getKey(n);if(r!=null&&(t.add(r),this.selectionMode()==="single"))break}this.state.setSelectedKeys(t)}selectAll(){this.selectionMode()==="multiple"&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new Uo)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){this.selectionMode()!=="none"&&(this.selectionMode()==="single"?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior()==="toggle"||t&&t.pointerType==="touch"?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if(this.state.selectionMode()==="none")return!1;const t=this.collection().getItem(e);return t!=null&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(n=>{for(;n!=null;){if(this.canSelectItem(n)){const r=this.collection().getItem(n);if(!r)continue;r.type==="item"&&e.push(n)}n=this.collection().getKeyAfter(n)}})(this.collection().getFirstKey()),e}},Ane=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(this.keyMap.size===0)return;let t,n=0;for(const[r,i]of this.keyMap)t?(t.nextKey=r,i.prevKey=t.key):(this.firstKey=r,i.prevKey=void 0),i.type==="item"&&(i.index=n++),t=i,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};function VGt(e){const t=RGt(e),r=PGt({dataSource:()=>be(e.dataSource),getKey:()=>be(e.getKey),getTextValue:()=>be(e.getTextValue),getDisabled:()=>be(e.getDisabled),getSectionChildren:()=>be(e.getSectionChildren),factory:a=>e.filter?new Ane(e.filter(a)):new Ane(a)},[()=>e.filter]),i=new FGt(r,t);return r2(()=>{const a=t.focusedKey();a!=null&&!r().getItem(a)&&t.setFocusedKey(void 0)}),{collection:r,selectionManager:()=>i}}var BGt=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;t!=null;){const n=this.collection().getItem(t);if(n&&n.type==="item"&&!n.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;e!=null;){const t=this.collection().getItem(e);if(t&&t.type==="item"&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop>r;)i=this.getKeyAbove(i),n=i!=null?this.getItem(i):null;return i}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let i=e;for(;i&&n&&n.offsetTop<r;)i=this.getKeyBelow(i),n=i!=null?this.getItem(i):null;return i}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=t!=null?this.getKeyBelow(t):this.getFirstKey();for(;r!=null;){const i=this.collection().getItem(r);if(i){const a=i.textValue.slice(0,e.length);if(i.textValue&&n.compare(a,e)===0)return r}r=this.getKeyBelow(r)}}};function UGt(e,t,n){const r=IWt({usage:"search",sensitivity:"base"}),i=Z(()=>{const a=be(e.keyboardDelegate);return a||new BGt(e.collection,t,r)});return HGt({selectionManager:()=>be(e.selectionManager),keyboardDelegate:i,autoFocus:()=>be(e.autoFocus),deferAutoFocus:()=>be(e.deferAutoFocus),shouldFocusWrap:()=>be(e.shouldFocusWrap),disallowEmptySelection:()=>be(e.disallowEmptySelection),selectOnFocus:()=>be(e.selectOnFocus),disallowTypeAhead:()=>be(e.disallowTypeAhead),shouldUseVirtualFocus:()=>be(e.shouldUseVirtualFocus),allowsTabNavigation:()=>be(e.allowsTabNavigation),isVirtualized:()=>be(e.isVirtualized),scrollToKey:a=>be(e.scrollToKey)?.(a),orientation:()=>be(e.orientation)},t,n)}var ame=Tt();function ome(){return Lt(ame)}function WGt(){const e=ome();if(e===void 0)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}function sme(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function GGt(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const i=e[r]?.ref();if(i&&sme(i,n))return r+1}return 0}function ZGt(e){const t=e.map((r,i)=>[i,r]);let n=!1;return t.sort(([r,i],[a,o])=>{const s=i.ref(),l=o.ref();return s===l||!s||!l?0:sme(s,l)?(r>a&&(n=!0),-1):(r<a&&(n=!0),1)}),n?t.map(([r,i])=>i):e}function lme(e,t){const n=ZGt(e);e!==n&&t(n)}function KGt(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return ri(r).body}function XGt(e,t){he(()=>{const n=setTimeout(()=>{lme(e(),t)});me(()=>clearTimeout(n))})}function YGt(e,t){if(typeof IntersectionObserver!="function"){XGt(e,t);return}let n=[];he(()=>{const r=()=>{const o=!!n.length;n=e(),o&&lme(e(),t)},i=KGt(e()),a=new IntersectionObserver(r,{root:i});for(const o of e()){const s=o.ref();s&&a.observe(s)}me(()=>a.disconnect())})}function JGt(e={}){const[t,n]=dve({value:()=>be(e.items),onChange:a=>e.onItemsChange?.(a)});YGt(t,n);const r=a=>(n(o=>{const s=GGt(o,a);return Nye(o,a,s)}),()=>{n(o=>{const s=o.filter(l=>l.ref()!==a.ref());return o.length===s.length?o:s})});return{DomCollectionProvider:a=>d(ame.Provider,{value:{registerItem:r},get children(){return a.children}})}}function QGt(e){const t=WGt(),n=ft({shouldRegisterItem:!0},e);he(()=>{if(!n.shouldRegisterItem)return;const r=t.registerItem(n.getItem());me(r)})}function eZt(e={}){const[t,n]=gre({value:()=>be(e.isSelected),defaultValue:()=>!!be(e.defaultIsSelected),onChange:a=>e.onSelectedChange?.(a)});return{isSelected:t,setIsSelected:a=>{!be(e.isReadOnly)&&!be(e.isDisabled)&&n(a)},toggle:()=>{!be(e.isReadOnly)&&!be(e.isDisabled)&&n(!t())}}}var tZt=Tt();function Rj(){return Lt(tZt)}var nZt=Tt();function cme(){return Lt(nZt)}var dme=Tt();function ume(){return Lt(dme)}function Po(){const e=ume();if(e===void 0)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var hme=Tt();function ZK(){const e=Lt(hme);if(e===void 0)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var fme=Tt();function fa(){const e=Lt(fme);if(e===void 0)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function KK(e){let t;const n=fa(),r=Po(),i=ft({id:n.generateId(`item-${xr()}`)},e),[a,o]=Se(i,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(),g=()=>r.listState().selectionManager(),y=()=>o.id,v=()=>g().focusedKey()===y(),k=()=>{a.onSelect?.(),a.closeOnSelect&&setTimeout(()=>{r.close(!0)})};QGt({getItem:()=>({ref:()=>t,type:"item",key:y(),textValue:a.textValue??h()?.textContent??t?.textContent??"",disabled:a.disabled??!1})});const b=ime({key:y,selectionManager:g,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>a.disabled},()=>t),x=I=>{dt(I,a.onPointerMove),I.pointerType==="mouse"&&(a.disabled?r.onItemLeave(I):(r.onItemEnter(I),I.defaultPrevented||(ur(I.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(y()))))},w=I=>{dt(I,a.onPointerLeave),I.pointerType==="mouse"&&r.onItemLeave(I)},M=I=>{dt(I,a.onPointerUp),!a.disabled&&I.button===0&&k()},_=I=>{if(dt(I,a.onKeyDown),!I.repeat&&!a.disabled)switch(I.key){case"Enter":case" ":k();break}},C=Z(()=>{if(a.indeterminate)return"mixed";if(a.checked!=null)return a.checked}),L=Z(()=>({"data-indeterminate":a.indeterminate?"":void 0,"data-checked":a.checked&&!a.indeterminate?"":void 0,"data-disabled":a.disabled?"":void 0,"data-highlighted":v()?"":void 0})),S={isChecked:()=>a.checked,dataset:L,setLabelRef:m,generateId:Io(()=>o.id),registerLabel:zr(l),registerDescription:zr(u)};return d(hme.Provider,{value:S,get children(){return d(zt,f({as:"div",ref(I){var A=hn(D=>t=D,a.ref);typeof A=="function"&&A(I)},get tabIndex(){return b.tabIndex()},get"aria-checked"(){return C()},get"aria-disabled"(){return a.disabled},get"aria-labelledby"(){return s()},get"aria-describedby"(){return c()},get"data-key"(){return b.dataKey()},get onPointerDown(){return Kn([a.onPointerDown,b.onPointerDown])},get onPointerUp(){return Kn([M,b.onPointerUp])},get onClick(){return Kn([a.onClick,b.onClick])},get onKeyDown(){return Kn([_,b.onKeyDown])},get onMouseDown(){return Kn([a.onMouseDown,b.onMouseDown])},get onFocus(){return Kn([a.onFocus,b.onFocus])},onPointerMove:x,onPointerLeave:w},L,o))}})}function zj(e){const t=ft({closeOnSelect:!1},e),[n,r]=Se(t,["checked","defaultChecked","onChange","onSelect"]),i=eZt({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:o=>n.onChange?.(o),isDisabled:()=>r.disabled});return d(KK,f({role:"menuitemcheckbox",get checked(){return i.isSelected()},onSelect:()=>{n.onSelect?.(),i.toggle()}},r))}var j2={next:(e,t)=>e==="ltr"?t==="horizontal"?"ArrowRight":"ArrowDown":t==="horizontal"?"ArrowLeft":"ArrowUp",previous:(e,t)=>j2.next(e==="ltr"?"rtl":"ltr",t)},$ne={first:e=>e==="horizontal"?"ArrowDown":"ArrowRight",last:e=>e==="horizontal"?"ArrowUp":"ArrowLeft"};function pme(e){const t=fa(),n=Po(),r=Rj(),{direction:i}=gs(),a=ft({id:t.generateId("trigger")},e),[o,s]=Se(a,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();r!==void 0&&(l=()=>t.value()??o.id,r.lastValue()===void 0&&r.setLastValue(l));const c=Z2(()=>n.triggerRef(),()=>"button"),u=Z(()=>c()==="a"&&n.triggerRef()?.getAttribute("href")!=null);he(vn(()=>r?.value(),b=>{u()&&b===l()&&n.triggerRef()?.focus()}));const h=()=>{r!==void 0?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)},m=b=>{dt(b,o.onPointerDown),b.currentTarget.dataset.pointerType=b.pointerType,!o.disabled&&b.pointerType!=="touch"&&b.button===0&&h()},g=b=>{dt(b,o.onClick),o.disabled||b.currentTarget.dataset.pointerType==="touch"&&h()},y=b=>{if(dt(b,o.onKeyDown),!o.disabled){if(u())switch(b.key){case"Enter":case" ":return}switch(b.key){case"Enter":case" ":case $ne.first(t.orientation()):b.stopPropagation(),b.preventDefault(),Kye(b.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(l);break;case $ne.last(t.orientation()):b.stopPropagation(),b.preventDefault(),n.open("last");break;case j2.next(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.nextMenu();break;case j2.previous(i(),t.orientation()):if(r===void 0)break;b.stopPropagation(),b.preventDefault(),r.previousMenu();break}}},v=b=>{dt(b,o.onMouseOver),n.triggerRef()?.dataset.pointerType!=="touch"&&!o.disabled&&r!==void 0&&r.value()!==void 0&&r.setValue(l)},k=b=>{dt(b,o.onFocus),r!==void 0&&b.currentTarget.dataset.pointerType!=="touch"&&r.setValue(l)};return he(()=>me(n.registerTriggerId(o.id))),d(_0,f({ref(b){var x=hn(n.setTriggerRef,o.ref);typeof x=="function"&&x(b)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return o.id},get disabled(){return o.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return bt(()=>!!n.isOpen())()?n.contentId():void 0},get"data-highlighted"(){return l()!==void 0&&r?.value()===l()?!0:void 0},get tabIndex(){return r!==void 0?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:m,onMouseOver:v,onClick:g,onKeyDown:y,onFocus:k,role:r!==void 0?"menuitem":void 0},()=>n.dataset(),s))}function mme(e){let t;const n=fa(),r=Po(),i=Rj(),a=cme(),{direction:o}=gs(),s=ft({id:n.generateId(`content-${xr()}`)},e),[l,c]=Se(s,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const h=()=>r.parentMenuContext()==null&&i===void 0&&n.isModal(),m=UGt({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>n.orientation()==="horizontal"?"vertical":"horizontal"},()=>t);fre({trapFocus:()=>h()&&r.isOpen(),onMountAutoFocus:w=>{i===void 0&&l.onOpenAutoFocus?.(w)},onUnmountAutoFocus:l.onCloseAutoFocus},()=>t);const g=w=>{if(Yn(w.currentTarget,w.target)&&(w.key==="Tab"&&r.isOpen()&&w.preventDefault(),i!==void 0&&w.currentTarget.getAttribute("aria-haspopup")!=="true"))switch(w.key){case j2.next(o(),n.orientation()):w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.nextMenu();break;case j2.previous(o(),n.orientation()):if(w.currentTarget.hasAttribute("data-closed"))break;w.stopPropagation(),w.preventDefault(),r.close(!0),i.setAutoFocusMenu(!0),i.previousMenu();break}},y=w=>{l.onEscapeKeyDown?.(w),i?.setAutoFocusMenu(!1),r.close(!0)},v=w=>{l.onFocusOutside?.(w),n.isModal()&&w.preventDefault()},k=w=>{dt(w,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},b=w=>{if(dt(w,l.onPointerMove),w.pointerType!=="mouse")return;const M=w.target,_=u!==w.clientX;Yn(w.currentTarget,M)&&_&&(r.setPointerDir(w.clientX>u?"right":"left"),u=w.clientX)};he(()=>me(r.registerContentId(l.id))),me(()=>r.setContentRef(void 0));const x={ref:hn(w=>{r.setContentRef(w),t=w},l.ref),role:"menu",get id(){return l.id},get tabIndex(){return m.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:Kn([l.onKeyDown,m.onKeyDown,g]),onMouseDown:Kn([l.onMouseDown,m.onMouseDown]),onFocusIn:Kn([l.onFocusIn,m.onFocusIn]),onFocusOut:Kn([l.onFocusOut,m.onFocusOut]),onPointerEnter:k,onPointerMove:b,get"data-orientation"(){return n.orientation()}};return d(ke,{get when(){return r.contentPresent()},get children(){return d(ke,{get when(){return a===void 0||r.parentMenuContext()!=null},get fallback(){return d(zt,f({as:"div"},()=>r.dataset(),x,c))},get children(){return d(Hf.Positioner,{get children(){return d(lq,f({get disableOutsidePointerEvents(){return bt(()=>!!h())()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return Wa({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:y,onFocusOutside:v,get onDismiss(){return r.close}},()=>r.dataset(),x,c))}})}})}})}function gme(e){let t;const n=fa(),r=Po(),[i,a]=Se(e,["ref"]);return yre({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),d(mme,f({ref(o){var s=hn(l=>{t=l},i.ref);typeof s=="function"&&s(o)}},a))}var yme=Tt();function rZt(){const e=Lt(yme);if(e===void 0)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}function Nm(e){const t=fa(),n=ft({id:t.generateId(`group-${xr()}`)},e),[r,i]=Ce(),a={generateId:Io(()=>n.id),registerLabelId:zr(i)};return d(yme.Provider,{value:a,get children(){return d(zt,f({as:"div",role:"group",get"aria-labelledby"(){return r()}},n))}})}function qj(e){const t=rZt(),n=ft({id:t.generateId("label")},e),[r,i]=Se(n,["id"]);return he(()=>me(t.registerLabelId(r.id))),d(zt,f({as:"span",get id(){return r.id},"aria-hidden":"true"},i))}function jj(e){const t=Po(),n=ft({children:"▼"},e);return d(zt,f({as:"span","aria-hidden":"true"},()=>t.dataset(),n))}function Hj(e){return d(KK,f({role:"menuitem",closeOnSelect:!0},e))}function Fj(e){const t=ZK(),n=ft({id:t.generateId("description")},e),[r,i]=Se(n,["id"]);return he(()=>me(t.registerDescription(r.id))),d(zt,f({as:"div",get id(){return r.id}},()=>t.dataset(),i))}function Vj(e){const t=ZK(),n=ft({id:t.generateId("indicator")},e),[r,i]=Se(n,["forceMount"]);return d(ke,{get when(){return r.forceMount||t.isChecked()},get children(){return d(zt,f({as:"div"},()=>t.dataset(),i))}})}function Bj(e){const t=ZK(),n=ft({id:t.generateId("label")},e),[r,i]=Se(n,["ref","id"]);return he(()=>me(t.registerLabel(r.id))),d(zt,f({as:"div",ref(a){var o=hn(t.setLabelRef,r.ref);typeof o=="function"&&o(a)},get id(){return r.id}},()=>t.dataset(),i))}function Uj(e){const t=Po();return d(ke,{get when(){return t.contentPresent()},get children(){return d(w0,e)}})}var vme=Tt();function iZt(){const e=Lt(vme);if(e===void 0)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}function Wj(e){const n=fa().generateId(`radiogroup-${xr()}`),r=ft({id:n},e),[i,a]=Se(r,["value","defaultValue","onChange","disabled"]),[o,s]=G2({value:()=>i.value,defaultValue:()=>i.defaultValue,onChange:c=>i.onChange?.(c)}),l={isDisabled:()=>i.disabled,isSelectedValue:c=>c===o(),setSelectedValue:c=>s(c)};return d(vme.Provider,{value:l,get children(){return d(Nm,a)}})}function Gj(e){const t=iZt(),n=ft({closeOnSelect:!1},e),[r,i]=Se(n,["value","onSelect"]);return d(KK,f({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},i))}function aZt(e,t,n){const r=e.split("-")[0],i=n.getBoundingClientRect(),a=[],o=t.clientX,s=t.clientY;switch(r){case"top":a.push([o,s+5]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]);break;case"right":a.push([o-5,s]),a.push([i.left,i.top]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]);break;case"bottom":a.push([o,s-5]),a.push([i.right,i.top]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]);break;case"left":a.push([o+5,s]),a.push([i.right,i.bottom]),a.push([i.left,i.bottom]),a.push([i.left,i.top]),a.push([i.right,i.top]);break}return a}function oZt(e,t){return t?VU([e.clientX,e.clientY],t):!1}function kme(e){const t=fa(),n=ome(),r=ume(),i=Rj(),a=cme(),o=ft({placement:t.orientation()==="horizontal"?"bottom-start":"right-start"},e),[s,l]=Se(o,["open","defaultOpen","onOpenChange"]);let c=0,u=null,h="right";const[m,g]=Ce(),[y,v]=Ce(),[k,b]=Ce(),[x,w]=Ce(),[M,_]=Ce(!0),[C,L]=Ce(l.placement),[S,I]=Ce([]),[A,D]=Ce([]),{DomCollectionProvider:P}=JGt({items:A,onItemsChange:D}),O=x0({open:()=>s.open,defaultOpen:()=>s.defaultOpen,onOpenChange:le=>s.onOpenChange?.(le)}),{present:E}=i0({show:()=>t.forceMount()||O.isOpen(),element:()=>x()??null}),T=VGt({selectionMode:"none",dataSource:A}),R=le=>{_(le),O.open()},H=(le=!1)=>{O.close(),le&&r&&r.close(!0)},Y=le=>{_(le),O.toggle()},j=()=>{const le=x();le&&(ur(le),T.selectionManager().setFocused(!0),T.selectionManager().setFocusedKey(void 0))},X=()=>{a!=null?setTimeout(()=>j()):j()},W=le=>{I(Ee=>[...Ee,le]);const pe=r?.registerNestedMenu(le);return()=>{I(Ee=>hV(Ee,le)),pe?.()}},G=le=>h===u?.side&&oZt(le,u?.area),J=le=>{G(le)&&le.preventDefault()},oe=le=>{G(le)||X()},de=le=>{G(le)&&le.preventDefault()};pre({isDisabled:()=>!(r==null&&O.isOpen()&&t.isModal()),targets:()=>[x(),...S()].filter(Boolean)}),he(()=>{const le=x();if(!le||!r)return;const pe=r.registerNestedMenu(le);me(()=>{pe()})}),he(()=>{r===void 0&&i?.registerMenu(t.value(),[x(),...S()])}),he(()=>{r!==void 0||i===void 0||(i.value()===t.value()?(k()?.focus(),i.autoFocusMenu()&&R(!0)):H())}),he(()=>{r!==void 0||i===void 0||O.isOpen()&&i.setValue(t.value())}),me(()=>{r===void 0&&i?.unregisterMenu(t.value())});const ve={dataset:Z(()=>({"data-expanded":O.isOpen()?"":void 0,"data-closed":O.isOpen()?void 0:""})),isOpen:O.isOpen,contentPresent:E,nestedMenus:S,currentPlacement:C,pointerGraceTimeoutId:()=>c,autoFocus:M,listState:()=>T,parentMenuContext:()=>r,triggerRef:k,contentRef:x,triggerId:m,contentId:y,setTriggerRef:b,setContentRef:w,open:R,close:H,toggle:Y,focusContent:X,onItemEnter:J,onItemLeave:oe,onTriggerLeave:de,setPointerDir:le=>h=le,setPointerGraceTimeoutId:le=>c=le,setPointerGraceIntent:le=>u=le,registerNestedMenu:W,registerItemToParentDomCollection:n?.registerItem,registerTriggerId:zr(g),registerContentId:zr(v)};return d(P,{get children(){return d(dme.Provider,{value:ve,get children(){return d(ke,{when:a===void 0,get fallback(){return l.children},get children(){return d(Hf,f({anchorRef:k,contentRef:x,onCurrentPlacementChange:L},l))}})}})}})}function Zj(e){const{direction:t}=gs();return d(kme,f({get placement(){return t()==="rtl"?"left-start":"right-start"},flip:!0},e))}var sZt={close:(e,t)=>e==="ltr"?[t==="horizontal"?"ArrowLeft":"ArrowUp"]:[t==="horizontal"?"ArrowRight":"ArrowDown"]};function Kj(e){const t=Po(),n=fa(),[r,i]=Se(e,["onFocusOutside","onKeyDown"]),{direction:a}=gs();return d(mme,f({onOpenAutoFocus:u=>{u.preventDefault()},onCloseAutoFocus:u=>{u.preventDefault()},onFocusOutside:u=>{r.onFocusOutside?.(u);const h=u.target;Yn(t.triggerRef(),h)||t.close()},onKeyDown:u=>{dt(u,r.onKeyDown);const h=Yn(u.currentTarget,u.target),m=sZt.close(a(),n.orientation()).includes(u.key),g=t.parentMenuContext()!=null;h&&m&&g&&(t.close(),ur(t.triggerRef()))}},i))}var Tne=["Enter"," "],lZt={open:(e,t)=>e==="ltr"?[...Tne,t==="horizontal"?"ArrowRight":"ArrowDown"]:[...Tne,t==="horizontal"?"ArrowLeft":"ArrowUp"]};function Xj(e){let t;const n=fa(),r=Po(),i=ft({id:n.generateId(`sub-trigger-${xr()}`)},e),[a,o]=Se(i,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let s=null;const l=()=>{s&&window.clearTimeout(s),s=null},{direction:c}=gs(),u=()=>a.id,h=()=>{const w=r.parentMenuContext();if(w==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return w.listState().selectionManager()},m=()=>r.listState().collection(),g=()=>h().focusedKey()===u(),y=ime({key:u,selectionManager:h,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>a.disabled},()=>t),v=w=>{dt(w,a.onClick),!r.isOpen()&&!a.disabled&&r.open(!0)},k=w=>{if(dt(w,a.onPointerMove),w.pointerType!=="mouse")return;const M=r.parentMenuContext();if(M?.onItemEnter(w),!w.defaultPrevented){if(a.disabled){M?.onItemLeave(w);return}!r.isOpen()&&!s&&(r.parentMenuContext()?.setPointerGraceIntent(null),s=window.setTimeout(()=>{r.open(!1),l()},100)),M?.onItemEnter(w),w.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),ur(w.currentTarget),M?.listState().selectionManager().setFocused(!0),M?.listState().selectionManager().setFocusedKey(u()))}},b=w=>{if(dt(w,a.onPointerLeave),w.pointerType!=="mouse")return;l();const M=r.parentMenuContext(),_=r.contentRef();if(_){M?.setPointerGraceIntent({area:aZt(r.currentPlacement(),w,_),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(M?.pointerGraceTimeoutId());const C=window.setTimeout(()=>{M?.setPointerGraceIntent(null)},300);M?.setPointerGraceTimeoutId(C)}else{if(M?.onTriggerLeave(w),w.defaultPrevented)return;M?.setPointerGraceIntent(null)}M?.onItemLeave(w)},x=w=>{dt(w,a.onKeyDown),!w.repeat&&(a.disabled||lZt.open(c(),n.orientation()).includes(w.key)&&(w.stopPropagation(),w.preventDefault(),h().setFocused(!1),h().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(m().getFirstKey())))};return he(()=>{if(r.registerItemToParentDomCollection==null)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");const w=r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:a.textValue??t?.textContent??"",disabled:a.disabled??!1});me(w)}),he(vn(()=>r.parentMenuContext()?.pointerGraceTimeoutId(),w=>{me(()=>{window.clearTimeout(w),r.parentMenuContext()?.setPointerGraceIntent(null)})})),he(()=>me(r.registerTriggerId(a.id))),me(()=>{l()}),d(zt,f({as:"div",ref(w){var M=hn(_=>{r.setTriggerRef(_),t=_},a.ref);typeof M=="function"&&M(w)},get id(){return a.id},role:"menuitem",get tabIndex(){return y.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return bt(()=>!!r.isOpen())()?r.contentId():void 0},get"aria-disabled"(){return a.disabled},get"data-key"(){return y.dataKey()},get"data-highlighted"(){return g()?"":void 0},get"data-disabled"(){return a.disabled?"":void 0},get onPointerDown(){return Kn([a.onPointerDown,y.onPointerDown])},get onPointerUp(){return Kn([a.onPointerUp,y.onPointerUp])},get onClick(){return Kn([v,y.onClick])},get onKeyDown(){return Kn([x,y.onKeyDown])},get onMouseDown(){return Kn([a.onMouseDown,y.onMouseDown])},get onFocus(){return Kn([a.onFocus,y.onFocus])},onPointerMove:k,onPointerLeave:b},()=>r.dataset(),o))}function bme(e){const t=Rj(),n=`menu-${xr()}`,r=ft({id:n,modal:!0},e),[i,a]=Se(r,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),o=x0({open:()=>i.open,defaultOpen:()=>i.defaultOpen,onOpenChange:l=>i.onOpenChange?.(l)}),s={isModal:()=>i.modal??!0,preventScroll:()=>i.preventScroll??s.isModal(),forceMount:()=>i.forceMount??!1,generateId:Io(()=>i.id),value:()=>i.value,orientation:()=>i.orientation??t?.orientation()??"horizontal"};return d(fme.Provider,{value:s,get children(){return d(kme,f({get open(){return o.isOpen()},get onOpenChange(){return o.setIsOpen}},a))}})}var cZt={};Ga(cZt,{Root:()=>Ff,Separator:()=>dZt});function Ff(e){let t;const n=ft({orientation:"horizontal"},e),[r,i]=Se(n,["ref","orientation"]),a=Z2(()=>t,()=>"hr");return d(zt,f({as:"hr",ref(o){var s=hn(l=>t=l,r.ref);typeof s=="function"&&s(o)},get role(){return a()!=="hr"?"separator":void 0},get"aria-orientation"(){return r.orientation==="vertical"?"vertical":void 0},get"data-orientation"(){return r.orientation}},i))}var dZt=Ff,uZt={};Ga(uZt,{Arrow:()=>vs,CheckboxItem:()=>zj,Content:()=>wme,DropdownMenu:()=>er,Group:()=>Nm,GroupLabel:()=>qj,Icon:()=>jj,Item:()=>Hj,ItemDescription:()=>Fj,ItemIndicator:()=>Vj,ItemLabel:()=>Bj,Portal:()=>Uj,RadioGroup:()=>Wj,RadioItem:()=>Gj,Root:()=>xme,Separator:()=>Ff,Sub:()=>Zj,SubContent:()=>Kj,SubTrigger:()=>Xj,Trigger:()=>pme});function wme(e){const t=fa(),n=Po(),[r,i]=Se(e,["onCloseAutoFocus","onInteractOutside"]);let a=!1;return d(gme,f({onCloseAutoFocus:l=>{r.onCloseAutoFocus?.(l),a||ur(n.triggerRef()),a=!1,l.preventDefault()},onInteractOutside:l=>{r.onInteractOutside?.(l),(!t.isModal()||l.detail.isContextMenu)&&(a=!0)}},i))}function xme(e){const t=`dropdownmenu-${xr()}`,n=ft({id:t},e);return d(bme,n)}var er=Object.assign(xme,{Arrow:vs,CheckboxItem:zj,Content:wme,Group:Nm,GroupLabel:qj,Icon:jj,Item:Hj,ItemDescription:Fj,ItemIndicator:Vj,ItemLabel:Bj,Portal:Uj,RadioGroup:Wj,RadioItem:Gj,Separator:Ff,Sub:Zj,SubContent:Kj,SubTrigger:Xj,Trigger:pme});function hZt(e){return d(er,f(e,{"data-component":"dropdown-menu"}))}function fZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.Trigger,f(n,{"data-slot":"dropdown-menu-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function pZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.Icon,f(n,{"data-slot":"dropdown-menu-icon",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function mZt(e){return d(er.Portal,e)}function gZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.Content,f(n,{"data-component":"dropdown-menu-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function yZt(e){const[t,n]=Se(e,["class","classList"]);return d(er.Arrow,f(n,{"data-slot":"dropdown-menu-arrow",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function vZt(e){const[t,n]=Se(e,["class","classList"]);return d(er.Separator,f(n,{"data-slot":"dropdown-menu-separator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function kZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.Group,f(n,{"data-slot":"dropdown-menu-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function bZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.GroupLabel,f(n,{"data-slot":"dropdown-menu-group-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function wZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.Item,f(n,{"data-slot":"dropdown-menu-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function xZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.ItemLabel,f(n,{"data-slot":"dropdown-menu-item-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function _Zt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.ItemDescription,f(n,{"data-slot":"dropdown-menu-item-description",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function MZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.ItemIndicator,f(n,{"data-slot":"dropdown-menu-item-indicator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function SZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.RadioGroup,f(n,{"data-slot":"dropdown-menu-radio-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function CZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.RadioItem,f(n,{"data-slot":"dropdown-menu-radio-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function LZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.CheckboxItem,f(n,{"data-slot":"dropdown-menu-checkbox-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function IZt(e){return d(er.Sub,e)}function NZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.SubTrigger,f(n,{"data-slot":"dropdown-menu-sub-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function AZt(e){const[t,n]=Se(e,["class","classList","children"]);return d(er.SubContent,f(n,{"data-component":"dropdown-menu-sub-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}const Mt=Object.assign(hZt,{Trigger:fZt,Icon:pZt,Portal:mZt,Content:gZt,Arrow:yZt,Separator:vZt,Group:kZt,GroupLabel:bZt,Item:wZt,ItemLabel:xZt,ItemDescription:_Zt,ItemIndicator:MZt,RadioGroup:SZt,RadioItem:CZt,CheckboxItem:LZt,Sub:IZt,SubTrigger:NZt,SubContent:AZt});var $Zt=ie("<div>"),Yj=class{x;y;width;height;constructor(t){this.x=Math.floor(t.x),this.y=Math.floor(t.y),this.width=Math.floor(t.width),this.height=Math.floor(t.height)}get rect(){return{x:this.x,y:this.y,width:this.width,height:this.height}}get left(){return this.x}get top(){return this.y}get right(){return this.x+this.width}get bottom(){return this.y+this.height}get center(){return{x:this.x+this.width*.5,y:this.y+this.height*.5}}get corners(){return{topLeft:{x:this.left,y:this.top},topRight:{x:this.right,y:this.top},bottomRight:{x:this.left,y:this.bottom},bottomLeft:{x:this.right,y:this.bottom}}}},jh=e=>{let t=new Yj(e.getBoundingClientRect());const{transform:n}=getComputedStyle(e);return n&&(t=TZt(t,n)),t},TZt=(e,t)=>{let n,r;if(t.startsWith("matrix3d(")){const i=t.slice(9,-1).split(/, /);n=+i[12],r=+i[13]}else if(t.startsWith("matrix(")){const i=t.slice(7,-1).split(/, /);n=+i[4],r=+i[5]}else n=0,r=0;return new Yj({...e,x:e.x-n,y:e.y-r})},Ea=()=>({x:0,y:0}),XK=(e,t)=>e.x===t.x&&e.y===t.y,rV=(e,t)=>new Yj({...e,x:e.x+t.x,y:e.y+t.y}),EZt=(e,t)=>Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)),PZt=(e,t)=>{const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom),o=i-r,s=a-n;if(r<i&&n<a){const l=e.width*e.height,c=t.width*t.height,u=o*s;return u/(l+c-u)}return 0},iV=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,_me=(e,t,n)=>{const r=e.transformed.center,i={distance:1/0,droppable:null};for(const a of t){const o=EZt(r,a.layout.center);o<i.distance?(i.distance=o,i.droppable=a):o===i.distance&&a.id===n.activeDroppableId&&(i.droppable=a)}return i.droppable},DZt=(e,t,n)=>{const r=e.transformed,i={ratio:0,droppable:null};for(const a of t){const o=PZt(r,a.layout);o>i.ratio?(i.ratio=o,i.droppable=a):o>0&&o===i.ratio&&a.id===n.activeDroppableId&&(i.droppable=a)}return i.droppable},Mme=Tt(),Sme=e=>{const t=f({collisionDetector:DZt},e),[n,r]=nt({draggables:{},droppables:{},sensors:{},active:{draggableId:null,get draggable(){return n.active.draggableId!==null?n.draggables[n.active.draggableId]:null},droppableId:null,get droppable(){return n.active.droppableId!==null?n.droppables[n.active.droppableId]:null},sensorId:null,get sensor(){return n.active.sensorId!==null?n.sensors[n.active.sensorId]:null},overlay:null}}),i=(E,T,R)=>{E.substring(0,E.length-1),lt(()=>n[E][T])&&r(E,T,"transformers",R.id,R)},a=(E,T,R)=>{E.substring(0,E.length-1),lt(()=>n[E][T])&<(()=>n[E][T].transformers[R])&&r(E,T,"transformers",R,void 0)},o=({id:E,node:T,layout:R,data:H})=>{const Y=n.draggables[E],j={id:E,node:T,layout:R,data:H,_pendingCleanup:!1};let X;if(!Y)Object.defineProperties(j,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{if(n.active.overlay)return Ea();const W=Object.values(n.draggables[E].transformers);return W.sort((G,J)=>G.order-J.order),W.reduce((G,J)=>J.callback(G),Ea())}},transformed:{enumerable:!0,configurable:!0,get:()=>rV(n.draggables[E].layout,n.draggables[E].transform)}});else if(n.active.draggableId===E&&!n.active.overlay){const W={x:Y.layout.x-R.x,y:Y.layout.y-R.y},G="addDraggable-existing-offset",J=Y.transformers[G],oe=J?J.callback(W):W;X={id:G,order:100,callback:de=>({x:de.x+oe.x,y:de.y+oe.y})},D(()=>a("draggables",E,G))}ct(()=>{r("draggables",E,j),X&&i("draggables",E,X)}),n.active.draggable&&M()},s=E=>{lt(()=>n.draggables[E])&&(r("draggables",E,"_pendingCleanup",!0),queueMicrotask(()=>l(E)))},l=E=>{if(n.draggables[E]?._pendingCleanup){const T=n.active.draggableId===E;ct(()=>{T&&r("active","draggableId",null),r("draggables",E,void 0)})}},c=({id:E,node:T,layout:R,data:H})=>{const Y=n.droppables[E],j={id:E,node:T,layout:R,data:H,_pendingCleanup:!1};Y||Object.defineProperties(j,{transformers:{enumerable:!0,configurable:!0,writable:!0,value:{}},transform:{enumerable:!0,configurable:!0,get:()=>{const X=Object.values(n.droppables[E].transformers);return X.sort((W,G)=>W.order-G.order),X.reduce((W,G)=>G.callback(W),Ea())}},transformed:{enumerable:!0,configurable:!0,get:()=>rV(n.droppables[E].layout,n.droppables[E].transform)}}),r("droppables",E,j),n.active.draggable&&M()},u=E=>{lt(()=>n.droppables[E])&&(r("droppables",E,"_pendingCleanup",!0),queueMicrotask(()=>h(E)))},h=E=>{if(n.droppables[E]?._pendingCleanup){const T=n.active.droppableId===E;ct(()=>{T&&r("active","droppableId",null),r("droppables",E,void 0)})}},m=({id:E,activators:T})=>{r("sensors",E,{id:E,activators:T,coordinates:{origin:{x:0,y:0},current:{x:0,y:0},get delta(){return{x:n.sensors[E].coordinates.current.x-n.sensors[E].coordinates.origin.x,y:n.sensors[E].coordinates.current.y-n.sensors[E].coordinates.origin.y}}}})},g=E=>{if(!lt(()=>n.sensors[E]))return;const T=n.active.sensorId===E;ct(()=>{T&&r("active","sensorId",null),r("sensors",E,void 0)})},y=({node:E,layout:T})=>{const R=n.active.overlay,H={node:E,layout:T};R||Object.defineProperties(H,{id:{enumerable:!0,configurable:!0,get:()=>n.active.draggable?.id},data:{enumerable:!0,configurable:!0,get:()=>n.active.draggable?.data},transformers:{enumerable:!0,configurable:!0,get:()=>Object.fromEntries(Object.entries(n.active.draggable?n.active.draggable.transformers:{}).filter(([Y])=>Y!=="addDraggable-existing-offset"))},transform:{enumerable:!0,configurable:!0,get:()=>{const Y=Object.values(n.active.overlay?n.active.overlay.transformers:[]);return Y.sort((j,X)=>j.order-X.order),Y.reduce((j,X)=>X.callback(j),Ea())}},transformed:{enumerable:!0,configurable:!0,get:()=>n.active.overlay?rV(n.active.overlay.layout,n.active.overlay.transform):new Yj({x:0,y:0,width:0,height:0})}}),r("active","overlay",H)},v=()=>r("active","overlay",null),k=(E,T)=>{ct(()=>{r("sensors",E,"coordinates",{origin:{...T},current:{...T}}),r("active","sensorId",E)})},b=E=>{const T=n.active.sensorId;T&&r("sensors",T,"coordinates","current",{...E})},x=()=>r("active","sensorId",null),w=(E,T)=>{const R={};for(const Y of Object.values(n.sensors))if(Y)for(const[j,X]of Object.entries(Y.activators))R[j]??=[],R[j].push({sensor:Y,activator:X});const H={};for(const Y in R){let j=Y;T&&(j=`on${Y}`),H[j]=X=>{for(const{activator:W}of R[Y]){if(n.active.sensor)break;W(X,E)}}}return H},M=()=>{let E=!1;const T=Object.values(n.draggables),R=Object.values(n.droppables),H=n.active.overlay;return ct(()=>{const Y=new WeakMap;for(const j of T)if(j){const X=j.layout;Y.has(j.node)||Y.set(j.node,jh(j.node));const W=Y.get(j.node);iV(X,W)||(r("draggables",j.id,"layout",W),E=!0)}for(const j of R)if(j){const X=j.layout;Y.has(j.node)||Y.set(j.node,jh(j.node));const W=Y.get(j.node);iV(X,W)||(r("droppables",j.id,"layout",W),E=!0)}if(H){const j=H.layout,X=jh(H.node);iV(j,X)||(r("active","overlay","layout",X),E=!0)}}),E},_=()=>{const E=n.active.overlay??n.active.draggable;if(E){const T=t.collisionDetector(E,Object.values(n.droppables),{activeDroppableId:n.active.droppableId}),R=T?T.id:null;n.active.droppableId!==R&&r("active","droppableId",R)}},C=E=>{const T={id:"sensorMove",order:0,callback:R=>n.active.sensor?{x:R.x+n.active.sensor.coordinates.delta.x,y:R.y+n.active.sensor.coordinates.delta.y}:R};M(),ct(()=>{r("active","draggableId",E),i("draggables",E,T)}),_()},L=()=>{const E=lt(()=>n.active.draggableId);ct(()=>{E!==null&&a("draggables",E,"sensorMove"),r("active",["draggableId","droppableId"],null)}),M()},S=E=>{he(()=>{const T=n.active.draggable;T&<(()=>E({draggable:T}))})},I=E=>{he(()=>{const T=n.active.draggable;if(T){const R=lt(()=>n.active.overlay);Object.values(R?R.transform:T.transform),lt(()=>E({draggable:T,overlay:R}))}})},A=E=>{he(()=>{const T=n.active.draggable,R=n.active.droppable;T&<(()=>E({draggable:T,droppable:R,overlay:n.active.overlay}))})},D=E=>{he(({previousDraggable:T,previousDroppable:R,previousOverlay:H})=>{const Y=n.active.draggable,j=Y?n.active.droppable:null,X=Y?n.active.overlay:null;return!Y&&T&<(()=>E({draggable:T,droppable:R,overlay:H})),{previousDraggable:Y,previousDroppable:j,previousOverlay:X}},{previousDraggable:null,previousDroppable:null,previousOverlay:null})};I(()=>_()),t.onDragStart&&S(t.onDragStart),t.onDragMove&&I(t.onDragMove),t.onDragOver&&A(t.onDragOver),t.onDragEnd&&D(t.onDragEnd);const O=[n,{addTransformer:i,removeTransformer:a,addDraggable:o,removeDraggable:s,addDroppable:c,removeDroppable:u,addSensor:m,removeSensor:g,setOverlay:y,clearOverlay:v,recomputeLayouts:M,detectCollisions:_,draggableActivators:w,sensorStart:k,sensorMove:b,sensorEnd:x,dragStart:C,dragEnd:L,onDragStart:S,onDragMove:I,onDragOver:A,onDragEnd:D}];return d(Mme.Provider,{value:O,get children(){return t.children}})},R0=()=>Lt(Mme)||null,OZt=(e="pointer-sensor")=>{const[t,{addSensor:n,removeSensor:r,sensorStart:i,sensorMove:a,sensorEnd:o,dragStart:s,dragEnd:l}]=R0(),c=250,u=10;dn(()=>{n({id:e,activators:{pointerdown:v}})}),me(()=>{r(e)});const h=()=>t.active.sensorId===e,m={x:0,y:0};let g=null,y=null;const v=(_,C)=>{_.button===0&&(document.addEventListener("pointermove",x),document.addEventListener("pointerup",w),y=C,m.x=_.clientX,m.y=_.clientY,g=window.setTimeout(b,c))},k=()=>{g&&(clearTimeout(g),g=null),document.removeEventListener("pointermove",x),document.removeEventListener("pointerup",w),document.removeEventListener("selectionchange",M)},b=()=>{t.active.sensor?h()||k():(i(e,m),s(y),M(),document.addEventListener("selectionchange",M))},x=_=>{const C={x:_.clientX,y:_.clientY};if(!t.active.sensor){const L={x:C.x-m.x,y:C.y-m.y};Math.sqrt(L.x**2+L.y**2)>u&&b()}h()&&(_.preventDefault(),a(C))},w=_=>{k(),h()&&(_.preventDefault(),l(),o())},M=()=>{window.getSelection()?.removeAllRanges()}},Cme=e=>(OZt(),bt(()=>e.children)),Jj=e=>({transform:`translate3d(${e.x}px, ${e.y}px, 0)`}),RZt=(e,t={})=>{const[n,{addDraggable:r,removeDraggable:i,draggableActivators:a}]=R0(),[o,s]=Ce(null);dn(()=>{const h=o();h&&r({id:e,node:h,layout:jh(h),data:t})}),me(()=>i(e));const l=()=>n.active.draggableId===e,c=()=>n.draggables[e]?.transform||Ea();return Object.defineProperties((h,m)=>{const g=m?m():{};he(()=>{const y=o(),v=a(e);if(y)for(const k in v)y.addEventListener(k,v[k]);me(()=>{if(y)for(const k in v)y.removeEventListener(k,v[k])})}),s(h),g.skipTransform||he(()=>{const y=c();if(XK(y,Ea()))h.style.removeProperty("transform");else{const v=Jj(c());h.style.setProperty("transform",v.transform??null)}})},{ref:{enumerable:!0,value:s},isActiveDraggable:{enumerable:!0,get:l},dragActivators:{enumerable:!0,get:()=>a(e,!0)},transform:{enumerable:!0,get:c}})},zZt=(e,t={})=>{const[n,{addDroppable:r,removeDroppable:i}]=R0(),[a,o]=Ce(null);dn(()=>{const u=a();u&&r({id:e,node:u,layout:jh(u),data:t})}),me(()=>i(e));const s=()=>n.active.droppableId===e,l=()=>n.droppables[e]?.transform||Ea();return Object.defineProperties((u,h)=>{const m=h?h():{};o(u),m.skipTransform||he(()=>{const g=l();if(XK(g,Ea()))u.style.removeProperty("transform");else{const y=Jj(l());u.style.setProperty("transform",y.transform??null)}})},{ref:{enumerable:!0,value:o},isActiveDroppable:{enumerable:!0,get:s},transform:{enumerable:!0,get:l}})},Lme=e=>{const[t,{onDragStart:n,onDragEnd:r,setOverlay:i,clearOverlay:a}]=R0();let o;n(({draggable:l})=>{i({node:l.node,layout:l.layout}),queueMicrotask(()=>{if(o){const c=jh(o),u={x:(l.layout.width-c.width)/2,y:(l.layout.height-c.height)/2};c.x+=u.x,c.y+=u.y,i({node:o,layout:c})}})}),r(()=>queueMicrotask(a));const s=()=>{const l=t.active.overlay,c=t.active.draggable;return!l||!c?{}:{position:"fixed",transition:"transform 0s",top:`${l.layout.top}px`,left:`${l.layout.left}px`,"min-width":`${c.layout.width}px`,"min-height":`${c.layout.height}px`,...Jj(l.transform),...e.style}};return d(w0,{get mount(){return document.body},get children(){return d(ke,{get when(){return t.active.draggable},get children(){var l=$Zt(),c=o;return typeof c=="function"?Hr(c,l):o=l,K(l,(()=>{var u=bt(()=>typeof e.children=="function");return()=>u()?e.children(t.active.draggable):e.children})()),Qe(u=>{var h=e.class,m=s();return h!==u.e&&W2(l,u.e=h),u.t=aq(l,m,u.t),u},{e:void 0,t:void 0}),l}})}})},qZt=(e,t,n)=>{const r=e.slice();return r.splice(n,0,...r.splice(t,1)),r},Ime=Tt(),Nme=e=>{const[t]=R0(),[n,r]=nt({initialIds:[],sortedIds:[]}),i=s=>s>=0&&s<n.initialIds.length;he(()=>{r("initialIds",[...e.ids]),r("sortedIds",[...e.ids])}),he(()=>{t.active.draggableId&&t.active.droppableId?lt(()=>{const s=n.sortedIds.indexOf(t.active.draggableId),l=n.initialIds.indexOf(t.active.droppableId);if(!i(s)||!i(l))r("sortedIds",[...e.ids]);else if(s!==l){const c=qZt(n.sortedIds,s,l);r("sortedIds",c)}}):r("sortedIds",[...e.ids])});const o=[n,{}];return d(Ime.Provider,{value:o,get children(){return e.children}})},jZt=()=>Lt(Ime)||null,HZt=(e,t)=>n=>{e(n),t(n)},Ame=(e,t={})=>{const[n,{addTransformer:r,removeTransformer:i}]=R0(),[a]=jZt(),o=RZt(e,t),s=zZt(e,t),l=HZt(o.ref,s.ref),c=()=>a.initialIds.indexOf(e),u=()=>a.sortedIds.indexOf(e),h=k=>n.droppables[k]?.layout||null,m=()=>{const k=Ea(),b=c(),x=u();if(x!==b){const w=h(e),M=h(a.initialIds[x]);w&&M&&(k.x=M.x-w.x,k.y=M.y-w.y)}return k},g={id:"sortableOffset",order:100,callback:k=>{const b=m();return{x:k.x+b.x,y:k.y+b.y}}};dn(()=>r("droppables",e,g)),me(()=>i("droppables",e,g.id));const y=()=>(e===n.active.draggableId&&!n.active.overlay?n.draggables[e]?.transform:n.droppables[e]?.transform)||Ea();return Object.defineProperties(k=>{o(k,()=>({skipTransform:!0})),s(k,()=>({skipTransform:!0})),he(()=>{const b=y();if(XK(b,Ea()))k.style.removeProperty("transform");else{const x=Jj(y());k.style.setProperty("transform",x.transform??null)}})},{ref:{enumerable:!0,value:l},transform:{enumerable:!0,get:y},isActiveDraggable:{enumerable:!0,get:()=>o.isActiveDraggable},dragActivators:{enumerable:!0,get:()=>o.dragActivators},isActiveDroppable:{enumerable:!0,get:()=>s.isActiveDroppable}})};function FZt(e){const t={locs:[],timer:void 0,pending:void 0,over:void 0,last:void 0},n=e.delay??250,r=e.max??4,i=e.tolerance??80,a=e.edge??18,o=()=>{t.timer!==void 0&&clearTimeout(t.timer),t.timer=void 0,t.pending=void 0},s=()=>{o(),t.over=void 0,t.last=void 0,t.locs.length=0},l=y=>{if(!e.enabled())return;const v=e.el();if(!v)return;const k=v.getBoundingClientRect(),b=y.clientX,x=y.clientY;b<k.left||b>k.right||x<k.top||x>k.bottom||(t.locs.push({x:b,y:x}),t.locs.length>r&&t.locs.shift())},c=()=>{if(!e.enabled()||!e.active())return 0;const y=e.el();if(!y||t.locs.length<2)return 0;const v=y.getBoundingClientRect(),k=t.locs[t.locs.length-1];if(!k)return 0;const b=t.locs[0]??k;if(b.x<v.left||b.x>v.right||b.y<v.top||b.y>v.bottom||t.last&&k.x===t.last.x&&k.y===t.last.y)return 0;if(v.right-k.x<=a)return t.last=k,n;const x={x:v.right,y:v.top-i},w={x:v.right,y:v.bottom+i},M=(I,A)=>(A.y-I.y)/(A.x-I.x),_=M(k,x),C=M(k,w),L=M(b,x),S=M(b,w);return _<L&&C>S?(t.last=k,n):(t.last=void 0,0)},u=y=>{o(),e.onActivate(y)},h=y=>{if(!y||e.active()===y)return;if(!e.active()){u(y);return}const v=c();if(v===0){u(y);return}o(),t.pending=y,t.timer=window.setTimeout(()=>{t.timer=void 0,t.pending===y&&(t.pending=void 0,e.enabled()&&e.active()&&t.over===y&&e.onActivate(y))},v)};return{move:l,enter:(y,v)=>{e.enabled()&&(t.over=y,l(v),h(y))},leave:y=>{t.over===y&&(t.over=void 0),t.pending===y&&o()},activate:u,request:h,cancel:o,reset:s}}let DU;const VZt=e=>{DU=e},BZt=e=>{if(window.focus(),!!e){if(DU)return DU(e);console.warn("notification-click: navigate function not set, falling back to window.location.assign"),window.location.assign(e)}},_p=e=>e.replace(/[\\/]+$/,""),oh=new Map,sh=new Map;function UZt(){const e={resolve:n=>{}};return{promise:new Promise(n=>{e.resolve=n}),resolve:e.resolve}}const Jg={get(e){return oh.get(_p(e))},pending(e){const t=_p(e),n=oh.get(t);n&&n.status!=="pending"||oh.set(t,{status:"pending"})},ready(e){const t=_p(e),n={status:"ready"};oh.set(t,n);const r=sh.get(t);r&&(sh.delete(t),r.resolve(n))},failed(e,t){const n=_p(e),r={status:"failed",message:t};oh.set(n,r);const i=sh.get(n);i&&(sh.delete(n),i.resolve(r))},wait(e){const t=_p(e),n=oh.get(t);if(n&&n.status!=="pending")return Promise.resolve(n);const r=sh.get(t);if(r)return r.promise;const i=UZt();return sh.set(t,i),i.promise}},WZt=40,H2={session:new Map,terminal:new Map},$me=(e,t,n)=>{for(e.delete(t),e.set(t,n);e.size>WZt;){const r=e.keys().next().value;if(r===void 0)return;e.delete(r)}},GZt=(e,t)=>{const n=H2.session.get(e)??{prompt:"",files:{}};$me(H2.session,e,{...n,...t})},MQt=e=>H2.session.get(e),SQt=(e,t)=>{$me(H2.terminal,e,t)},CQt=e=>H2.terminal.get(e),ZZt=e=>typeof e!="object"||e===null?!1:"draggable"in e,tq=e=>{if(!ZZt(e))return;const t=e.draggable;if(t)return typeof t.id=="string"?t.id:void 0},KZt=(e,t)=>({id:e,order:100,callback:n=>t==="x"?{...n,x:0}:{...n,y:0}}),Tme=(e,t)=>()=>{const n=R0();if(!n)return null;const[,{onDragStart:r,onDragEnd:i,addTransformer:a,removeTransformer:o}]=n,s=KZt(t,e),l=wr(c=>(r(u=>{const h=tq(u);h&&a("draggables",h,s)}),i(u=>{const h=tq(u);h&&o("draggables",h,s.id)}),c));return me(l),null},Eme=Tme("x","constrain-x-axis"),LQt=Tme("y","constrain-y-axis"),YK=100;function XZt(e,t,n=YK){if(!e.stack.length){const i=t==="/"?["/"]:["/",t];return{stack:i,index:i.length-1,action:void 0}}const r=e.stack[e.index];return t===r?e.action?{...e,action:void 0}:e:e.action?{...e,action:void 0}:YZt(e,t,n)}function YZt(e,t,n=YK){const r=e.stack.slice(0,e.index+1).concat(t),i=JZt(r,r.length-1,n);return{...e,...i,action:void 0}}function JZt(e,t,n=YK){if(e.length<=n)return{stack:e,index:t};const r=e.length-n;return{stack:e.slice(r),index:Math.max(0,t-r)}}function QZt(e){if(e.index<=0)return;const t=e.index-1,n=e.stack[t];if(n)return{state:{...e,index:t,action:"back"},to:n}}function eKt(e){if(e.index>=e.stack.length-1)return;const t=e.index+1,n=e.stack[t];if(n)return{state:{...e,index:t,action:"forward"},to:n}}var tKt=ie('<div class="h-full shrink-0">'),nKt=ie('<div class="xl:hidden w-10 shrink-0 flex items-center justify-center">'),rKt=ie('<div class="xl:hidden w-[32px] shrink-0 flex items-center justify-center mr-2">'),iKt=ie('<div class="flex items-center shrink-0"><svg width=20 height=20 viewBox="0 0 800 800"fill=none xmlns=http://www.w3.org/2000/svg class=shrink-0><path d="M373.362 226.643C388.087 211.919 411.96 211.919 426.684 226.643L573.37 373.324C588.094 388.047 588.094 411.92 573.37 426.644L426.684 573.324C411.96 588.048 388.087 588.048 373.362 573.324L226.677 426.644C211.952 411.92 211.952 388.047 226.677 373.324L373.362 226.643Z"fill=currentColor class=text-text-base></path><path d="M586.658 513.282C594.02 505.921 605.956 505.921 613.318 513.282L686.659 586.621C694.021 593.983 694.021 605.919 686.659 613.28L613.318 686.619C605.956 693.981 594.02 693.981 586.658 686.619L513.317 613.28C505.955 605.919 505.955 593.983 513.317 586.621L586.658 513.282Z"fill=currentColor class=text-text-base></path><path d="M286.501 586.454C293.957 593.909 293.957 605.997 286.501 613.453L213.5 686.452C206.044 693.907 193.956 693.907 186.5 686.452L113.499 613.453C106.043 605.997 106.043 593.909 113.499 586.454L186.5 513.455C193.956 506 206.044 506 213.5 513.455L286.501 586.454Z"fill=currentColor class=text-text-base></path><path d="M406.524 93.4982C402.934 97.088 397.113 97.088 393.523 93.4982L356.523 56.499C352.933 52.9092 352.933 47.089 356.523 43.4992L393.523 6.50002C397.113 2.91025 402.934 2.91025 406.524 6.50003L443.524 43.4992C447.114 47.089 447.114 52.9092 443.524 56.499L406.524 93.4982Z"fill=currentColor class=text-text-base></path><path d="M186.502 113.498C193.958 106.042 206.046 106.042 213.502 113.498L286.503 186.496C293.959 193.952 293.959 206.04 286.503 213.496L213.502 286.494C206.046 293.95 193.958 293.95 186.502 286.494L113.501 213.496C106.045 206.04 106.045 193.952 113.501 186.496L186.502 113.498Z"fill=currentColor class=text-text-base></path><path d="M686.499 186.483C693.955 193.939 693.955 206.027 686.499 213.482L613.498 286.481C606.042 293.937 593.954 293.937 586.498 286.481L513.497 213.482C506.041 206.027 506.041 193.939 513.497 186.483L586.498 113.484C593.954 106.029 606.042 106.029 613.498 113.484L686.499 186.483Z"fill=currentColor class=text-text-base></path><path d="M356.689 756.666C353.007 752.985 353.007 747.017 356.689 743.336L393.359 706.667C397.04 702.986 403.008 702.986 406.689 706.667L443.359 743.336C447.041 747.017 447.041 752.985 443.359 756.666L406.689 793.335C403.008 797.016 397.04 797.016 393.359 793.335L356.689 756.666Z"fill=currentColor class=text-text-base>'),aKt=ie("<span class=truncate>"),oKt=ie('<div class="flex items-center gap-1.5 text-12-regular text-text-weaker select-none ml-1"><span class=text-text-weak>'),sKt=ie('<div data-tauri-decorum-tb class="flex flex-row">'),lKt=ie('<header class="h-12 shrink-0 bg-transparent relative grid grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center"data-tauri-drag-region><div><div id=opencode-titlebar-left class="flex items-center gap-3 min-w-0 px-2"></div></div><div class="min-w-0 flex items-center justify-center pointer-events-none"><div class="pointer-events-auto min-w-0 flex items-center justify-center w-fit max-w-full"><div id=opencode-titlebar-center class="min-w-0 flex justify-center"></div></div></div><div data-tauri-drag-region><div id=opencode-titlebar-right class="flex items-center gap-2">'),cKt=ie('<div class="w-36 shrink-0">');const JK=()=>window.__TAURI__,dKt=()=>JK()?.window?.getCurrentWindow?.(),uKt=()=>JK()?.webviewWindow?.getCurrentWebviewWindow?.();function hKt(){const e=If(),t=ms(),n=Ice(),r=_r(),i=ule(),a=lf(),o=ll(),s=bf(),l=di();ope();const[c]=e_t(),[u,h]=Ce(!1),[m,g]=Ce(""),[y,v]=Ce(""),[k,b]=Ce(!1);function x(){z(async()=>{const{DialogCreateProject:G}=await import("./dialog-create-project-DZIA0DQF.js");return{DialogCreateProject:G}},[]).then(({DialogCreateProject:G})=>{a.show(()=>d(G,{onSelect:J=>{if(!J)return;const oe=Array.isArray(J)?J[0]:J;oe&&(e.projects.open(oe),o(`/${St(oe)}/session`))}}))})}function w(){z(async()=>{const{DialogCloneProject:G}=await import("./dialog-clone-project-D78pS1R8.js");return{DialogCloneProject:G}},[]).then(({DialogCloneProject:G})=>{a.show(()=>d(G,{onSelect:J=>{J&&(e.projects.open(J),o(`/${St(J)}/session`))}}))})}const M=Z(()=>t.platform==="desktop"&&t.os==="macos"),_=Z(()=>t.platform==="desktop"&&t.os==="windows");Z(()=>t.platform==="web");const C=()=>t.webviewZoom?.()??1,L=()=>M()?`${40/C()}px`:void 0,[S,I]=nt({stack:[],index:0,action:void 0}),A=()=>`${s.pathname}${s.search}${s.hash}`;Z(()=>!l.dir||l.id?!1:s.pathname.replace(/\/+$/,"").split("/").at(-1)==="session"),he(()=>{const G=A();lt(()=>{const J=XZt(S,G);J!==S&&I(J)})}),Z(()=>S.index>0),Z(()=>S.index<S.stack.length-1);const D=Z(()=>e.projects.list().length>0),P=Z(()=>e.projects.list().find(G=>St(G.worktree)===l.dir)),O=Z(()=>{const G=P();return G?G.name||Gn(G.worktree):r.t("command.project.open")}),E={plan:"Plan",track:"Track",project:"Track",data:"Data",ship:"Ship",review:"Review"},T=Z(()=>{const G=c.view,J=Array.isArray(G)?G[0]:G;if(J)return E[J]}),R=()=>{const G=QZt(S);G&&(I(G.state),o(G.to))},H=()=>{const G=eKt(S);G&&(I(G.state),o(G.to))};n.register(()=>[{id:"common.goBack",title:r.t("common.goBack"),category:r.t("command.category.view"),keybind:"mod+[",onSelect:R},{id:"common.goForward",title:r.t("common.goForward"),category:r.t("command.category.view"),keybind:"mod+]",onSelect:H}]);const Y=()=>{if(t.platform==="desktop")return dKt()};he(()=>{if(t.platform!=="desktop")return;const G=i.colorScheme(),J=G==="system"?null:G,oe=uKt();oe?.setTheme&&oe.setTheme(J).catch(()=>{})});const j=G=>G instanceof Element?!!G.closest("button, a, input, textarea, select, option, [role='button'], [role='menuitem'], [contenteditable='true'], [contenteditable='']"):!1,X=G=>{if(t.platform!=="desktop"||G.buttons!==1||j(G.target))return;const J=Y();J?.startDragging&&(G.preventDefault(),J.startDragging().catch(()=>{}))},W=G=>{if(t.platform!=="desktop"||j(G.target)||G.target instanceof Element&&G.target.closest("[data-tauri-decorum-tb]"))return;const J=Y();J?.toggleMaximize&&(G.preventDefault(),J.toggleMaximize().catch(()=>{}))};return(()=>{var G=lKt(),J=G.firstChild,oe=J.firstChild,de=J.nextSibling,ye=de.firstChild,ve=ye.firstChild,le=de.nextSibling;return le.firstChild,G.$$dblclick=W,G.$$mousedown=X,K(J,d(ke,{get when(){return M()},get children(){return[(()=>{var pe=tKt();return Qe(Ee=>kr(pe,"width",`${72/C()}px`)),pe})(),(()=>{var pe=nKt();return K(pe,d(Cr,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return e.mobileSidebar.toggle},get"aria-label"(){return r.t("sidebar.menu.toggle")},get"aria-expanded"(){return e.mobileSidebar.opened()}})),pe})()]}}),oe),K(J,d(ke,{get when(){return!M()},get children(){var pe=rKt();return K(pe,d(Cr,{icon:"menu",variant:"ghost",class:"titlebar-icon rounded-md",get onClick(){return e.mobileSidebar.toggle},get"aria-label"(){return r.t("sidebar.menu.toggle")},get"aria-expanded"(){return e.mobileSidebar.opened()}})),pe}}),oe),K(ye,d(ke,{get when(){return D()},get children(){return[iKt(),d(Mt,{placement:"bottom",gutter:4,modal:!1,get children(){return[d(Mt.Trigger,{as:Mn,variant:"ghost",size:"small",class:"flex items-center gap-1 h-6 px-2 text-12-regular text-text-base max-w-[180px]",get children(){return[(()=>{var pe=aKt();return K(pe,O),pe})(),d(Kt,{name:"chevron-down",size:"small",class:"shrink-0 text-icon-weak"})]}}),d(Mt.Portal,{get children(){return d(Mt.Content,{class:"min-w-[180px]",get children(){return[d(Qt,{get each(){return e.projects.list()},children:pe=>d(Mt.Item,{onSelect:()=>o(`/${St(pe.worktree)}/session`),get children(){return d(Mt.ItemLabel,{get children(){return pe.name||Gn(pe.worktree)}})}})}),d(Mt.Separator,{}),d(Mt.Item,{onSelect:()=>n.trigger("project.open"),get children(){return d(Mt.ItemLabel,{get children(){return r.t("command.project.open")}})}}),d(Mt.Separator,{}),d(Mt.Sub,{get children(){return[d(Mt.SubTrigger,{get children(){return r.t("command.project.new")}}),d(Mt.SubContent,{get children(){return[d(Mt.Item,{onSelect:x,get children(){return d(Mt.ItemLabel,{get children(){return r.t("command.project.newBlank")}})}}),d(Mt.Item,{onSelect:w,get children(){return d(Mt.ItemLabel,{get children(){return r.t("command.project.importGitHub")}})}})]}})]}})]}})}})]}})]}}),ve),K(ye,d(ke,{get when(){return T()},get children(){var pe=oKt(),Ee=pe.firstChild;return K(pe,d(Kt,{name:"chevron-right",size:"small",class:"text-icon-weaker shrink-0"}),Ee),K(Ee,T),pe}}),ve),le.$$mousedown=X,K(le,d(eme,{placement:"bottom",get title(){return r.t("sidebar.settings")},get keybind(){return n.keybind("settings.open")??""},get children(){return d(Mn,{variant:"ghost",class:"titlebar-icon w-8 h-6 p-0 box-border shrink-0",onClick:()=>n.trigger("settings.open"),get"aria-label"(){return r.t("sidebar.settings")},get children(){return d(Kt,{size:"small",name:"settings-gear"})}})}}),null),K(le,d(ke,{get when(){return _()},get children(){return[bt(()=>bt(()=>!JK())()&&cKt()),sKt()]}}),null),Qe(pe=>{var Ee=L(),Re={"flex items-center min-w-0":!0,"pl-2":!M()},wt={"flex items-center min-w-0 justify-end":!0,"pr-2":!_()};return Ee!==pe.e&&kr(G,"min-height",pe.e=Ee),pe.t=hr(J,Re,pe.t),pe.a=hr(le,wt,pe.a),pe},{e:void 0,t:void 0,a:void 0}),G})()}li(["mousedown","dblclick"]);const tt=e=>{const t=e.replaceAll("\\","/"),n=t.match(/^([A-Za-z]:)\/+$/);return n?`${n[1]}/`:/^\/+$/i.test(t)?"/":t.replace(/\/+$/,"")};function Pme(e){const t=e-6e4;return(n,r)=>{const i=n.time.updated??n.time.created,a=r.time.updated??r.time.created,o=i>t,s=a>t;return o&&s?n.id<r.id?-1:n.id>r.id?1:0:o&&!s?-1:!o&&s?1:a-i}}const fKt=(e,t)=>tt(e.directory)===tt(t)&&!e.parentID&&!e.time?.archived,Dme=e=>(e.session??[]).filter(t=>fKt(t,e.path.directory)),F2=(e,t)=>Dme(e).sort(Pme(t)),Ene=(e,t)=>e.flatMap(Dme).sort(Pme(t))[0];function pKt(e,t=()=>!0){return Object.values(e??{}).some(n=>n?.some(t))}const nq=e=>{const t=new Map;for(const n of e??[]){if(!n.parentID)continue;const r=t.get(n.parentID);if(r){r.push(n.id);continue}t.set(n.parentID,[n.id])}return t},QK=e=>e.name||Gn(e.worktree),aV=(e,t)=>{if(e&&typeof e=="object"&&"data"in e){const n=e.data;if(n?.message)return n.message}return e instanceof Error?e.message:t},Qg=(e,t,n)=>{const r=tt(e),i=new Map;for(const o of t){const s=tt(o);s!==r&&(i.has(s)||i.set(s,o))}if(!n?.length)return[e,...i.values()];const a=[e];for(const o of n){const s=tt(o);if(s===r)continue;const l=i.get(s);l&&(a.push(l),i.delete(s))}return[...a,...i.values()]},Pne="opencode:deep-link",Ome=e=>{if(e.startsWith("opencode://")&&!(typeof URL.canParse=="function"&&!URL.canParse(e)))try{return new URL(e)}catch{return}},mKt=e=>{const t=Ome(e);if(!t||t.hostname!=="open-project")return;const n=t.searchParams.get("directory");if(n)return n},gKt=e=>{const t=Ome(e);if(!t||t.hostname!=="new-session")return;const n=t.searchParams.get("directory");if(!n)return;const r=t.searchParams.get("prompt")||void 0;return r?{directory:n,prompt:r}:{directory:n}},yKt=e=>e.map(mKt).filter(t=>!!t),vKt=e=>e.map(gKt).filter(t=>!!t),kKt=e=>{const t=e.__OPENCODE__?.deepLinks??[];return t.length===0?[]:(e.__OPENCODE__&&(e.__OPENCODE__.deepLinks=[]),t)};var bKt=ie("<span>");function wKt(){const[e,t]=nt({active:"",value:""}),n=c=>e.active===c,r=()=>e.value,i=(c,u)=>{c&&t({active:c,value:u})},a=()=>t({active:"",value:""}),o=c=>{const u=e.value.trim();if(!u){a();return}a(),c(u)},s=(c,u)=>{if(c.key==="Enter"){c.preventDefault(),o(u);return}c.key==="Escape"&&(c.preventDefault(),a())};return{editor:e,editorOpen:n,editorValue:r,openEditor:i,closeEditor:a,saveEditor:o,editorKeyDown:s,setEditor:t,InlineEditor:c=>{let u;me(()=>{u!==void 0&&cancelAnimationFrame(u)});const h=()=>c.editing??n(c.id),m=()=>c.stopPropagation??!1,g=()=>c.openOnDblClick??!0,y=k=>{m()&&k.stopPropagation()},v=k=>{g()&&(y(k),i(c.id,c.value()))};return d(ke,{get when(){return h()},get fallback(){return(()=>{var k=bKt();return k.$$touchstart=y,k.$$click=y,k.$$mousedown=y,k.$$pointerdown=y,k.$$dblclick=v,K(k,()=>c.value()),Qe(()=>W2(k,c.displayClass??c.class)),k})()},get children(){return d(LR,{ref:k=>{u!==void 0&&cancelAnimationFrame(u),u=requestAnimationFrame(()=>{u=void 0,k.isConnected&&k.focus()})},get value(){return r()},get class(){return c.class},onInput:k=>t("value",k.currentTarget.value),onKeyDown:k=>{k.stopPropagation(),s(k,c.onSave)},onBlur:a,onPointerDown:y,onClick:y,onDblClick:y,onMouseDown:y,onMouseUp:y,onTouchStart:y})}})}}}li(["dblclick","pointerdown","mousedown","click","touchstart"]);var xKt={};Ga(xKt,{Collapsible:()=>Qj,Content:()=>zme,Root:()=>qme,Trigger:()=>jme,useCollapsibleContext:()=>eX});var Rme=Tt();function eX(){const e=Lt(Rme);if(e===void 0)throw new Error("[kobalte]: `useCollapsibleContext` must be used within a `Collapsible.Root` component");return e}function zme(e){const[t,n]=Ce(),r=eX(),i=ft({id:r.generateId("content")},e),[a,o]=Se(i,["ref","id","style"]),{present:s}=i0({show:r.shouldMount,element:()=>t()??null}),[l,c]=Ce(0),[u,h]=Ce(0);let g=r.isOpen()||s();return dn(()=>{const y=requestAnimationFrame(()=>{g=!1});me(()=>{cancelAnimationFrame(y)})}),he(vn(s,()=>{if(!t())return;t().style.transitionDuration="0s",t().style.animationName="none";const y=t().getBoundingClientRect();c(y.height),h(y.width),g||(t().style.transitionDuration="",t().style.animationName="")})),he(vn(r.isOpen,y=>{!y&&t()&&(t().style.transitionDuration="",t().style.animationName="")},{defer:!0})),he(()=>me(r.registerContentId(a.id))),d(ke,{get when(){return s()},get children(){return d(zt,f({as:"div",ref(y){var v=hn(n,a.ref);typeof v=="function"&&v(y)},get id(){return a.id},get style(){return Wa({"--kb-collapsible-content-height":l()?`${l()}px`:void 0,"--kb-collapsible-content-width":u()?`${u()}px`:void 0},a.style)}},()=>r.dataset(),o))}})}function qme(e){const t=`collapsible-${xr()}`,n=ft({id:t},e),[r,i]=Se(n,["open","defaultOpen","onOpenChange","disabled","forceMount"]),[a,o]=Ce(),s=x0({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:u=>r.onOpenChange?.(u)}),l=Z(()=>({"data-expanded":s.isOpen()?"":void 0,"data-closed":s.isOpen()?void 0:"","data-disabled":r.disabled?"":void 0})),c={dataset:l,isOpen:s.isOpen,disabled:()=>r.disabled??!1,shouldMount:()=>r.forceMount||s.isOpen(),contentId:a,toggle:s.toggle,generateId:Io(()=>i.id),registerContentId:zr(o)};return d(Rme.Provider,{value:c,get children(){return d(zt,f({as:"div"},l,i))}})}function jme(e){const t=eX(),[n,r]=Se(e,["onClick"]);return d(_0,f({get"aria-expanded"(){return t.isOpen()},get"aria-controls"(){return bt(()=>!!t.isOpen())()?t.contentId():void 0},get disabled(){return t.disabled()},onClick:a=>{dt(a,n.onClick),t.toggle()}},()=>t.dataset(),r))}var Qj=Object.assign(qme,{Content:zme,Trigger:jme}),_Kt=ie("<div data-slot=collapsible-arrow><span data-slot=collapsible-arrow-icon>");function MKt(e){const[t,n]=Se(e,["class","classList","variant"]);return d(Qj,f({"data-component":"collapsible",get"data-variant"(){return t.variant||"normal"},get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}},n))}function SKt(e){return d(Qj.Trigger,f({"data-slot":"collapsible-trigger"},e))}function CKt(e){return d(Qj.Content,f({"data-slot":"collapsible-content"},e))}function LKt(e){return(()=>{var t=_Kt(),n=t.firstChild;return ki(t,e||{},!1,!0),K(n,d(Kt,{name:"chevron-down",size:"small"})),t})()}const oV=Object.assign(MKt,{Arrow:LKt,Trigger:SKt,Content:CKt});var IKt=ie("<div>"),NKt=ie("<img data-slot=avatar-image>");const Dne=typeof Intl<"u"&&"Segmenter"in Intl?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function AKt(e){return e?Dne?Dne.segment(e)[Symbol.iterator]().next().value?.segment??Array.from(e)[0]??"":Array.from(e)[0]??"":""}function $Kt(e){const[t,n]=Se(e,["fallback","src","background","foreground","size","class","classList","style"]),r=t.src;return(()=>{var i=IKt();return ki(i,f(n,{"data-component":"avatar",get"data-size"(){return t.size||"normal"},"data-has-image":r?"":void 0,get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get style(){return{...typeof t.style=="object"?t.style:{},...!r&&t.background?{"--avatar-bg":t.background}:{},...!r&&t.foreground?{"--avatar-fg":t.foreground}:{}}}}),!1,!0),K(i,d(ke,{when:r,get fallback(){return AKt(t.fallback)},children:a=>(()=>{var o=NKt();return gt(o,"draggable",!1),Qe(()=>gt(o,"src",a())),o})()})),i})()}var TKt={};Ga(TKt,{Link:()=>EKt,Root:()=>tX});function tX(e){let t;const[n,r]=Se(e,["ref","href","disabled"]),i=Z2(()=>t,()=>"a");return d(zt,f({as:"a",ref(a){var o=hn(s=>t=s,n.ref);typeof o=="function"&&o(a)},get role(){return i()!=="a"||n.disabled?"link":void 0},get tabIndex(){return i()!=="a"&&!n.disabled?0:void 0},get href(){return bt(()=>!n.disabled)()?n.href:void 0},get"aria-disabled"(){return n.disabled?!0:void 0},get"data-disabled"(){return n.disabled?"":void 0}},r))}var EKt=tX,PKt={};Ga(PKt,{Arrow:()=>vs,Content:()=>Fme,HoverCard:()=>jp,Portal:()=>Vme,Root:()=>Bme,Trigger:()=>Ume,useHoverCardContext:()=>eH});var Hme=Tt();function eH(){const e=Lt(Hme);if(e===void 0)throw new Error("[kobalte]: `useHoverCardContext` must be used within a `HoverCard` component");return e}function Fme(e){const t=eH(),[n,r]=Se(e,["ref","style"]);return d(ke,{get when(){return t.contentPresent()},get children(){return d(Hf.Positioner,{get children(){return d(lq,f({ref(i){var a=hn(o=>{t.setContentRef(o)},n.ref);typeof a=="function"&&a(i)},disableOutsidePointerEvents:!1,get style(){return Wa({"--kb-hovercard-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},n.style)},onFocusOutside:i=>i.preventDefault(),get onDismiss(){return t.close}},()=>t.dataset(),r))}})}})}function Vme(e){const t=eH();return d(ke,{get when(){return t.contentPresent()},get children(){return d(w0,e)}})}function DKt(e,t,n){const r=e.split("-")[0],i=t.getBoundingClientRect(),a=n.getBoundingClientRect(),o=[],s=i.left+i.width/2,l=i.top+i.height/2;switch(r){case"top":o.push([i.left,l]),o.push([a.left,a.bottom]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([i.right,l]);break;case"right":o.push([s,i.top]),o.push([a.left,a.top]),o.push([a.right,a.top]),o.push([a.right,a.bottom]),o.push([a.left,a.bottom]),o.push([s,i.bottom]);break;case"bottom":o.push([i.left,l]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([a.right,a.top]),o.push([i.right,l]);break;case"left":o.push([s,i.top]),o.push([a.right,a.top]),o.push([a.left,a.top]),o.push([a.left,a.bottom]),o.push([a.right,a.bottom]),o.push([s,i.bottom]);break}return o}function Bme(e){const t=`hovercard-${xr()}`,n=ft({id:t,openDelay:700,closeDelay:300},e),[r,i]=Se(n,["id","open","defaultOpen","onOpenChange","openDelay","closeDelay","ignoreSafeArea","forceMount"]);let a,o;const[s,l]=Ce(),[c,u]=Ce(),[h,m]=Ce(i.placement),g=x0({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:A=>r.onOpenChange?.(A)}),{present:y}=i0({show:()=>r.forceMount||g.isOpen(),element:()=>c()??null}),{addGlobalListener:v,removeGlobalListener:k}=$ye(),b=()=>{a=window.setTimeout(()=>{a=void 0,g.open()},r.openDelay)},x=()=>{o=window.setTimeout(()=>{o=void 0,g.close()},r.closeDelay)},w=()=>{window.clearTimeout(a),a=void 0},M=()=>{window.clearTimeout(o),o=void 0},_=A=>Yn(s(),A)||Yn(c(),A),C=A=>{const D=s(),P=c();if(!(!D||!P))return DKt(A,D,P)},L=A=>{const D=A.target;if(_(D)){M();return}if(!r.ignoreSafeArea){const P=C(h());if(P&&VU(cre(A),P)){M();return}}o||x()};he(()=>{g.isOpen()&&(v(document,"pointermove",L,!0),me(()=>{k(document,"pointermove",L,!0)}))}),me(()=>{w(),M()});const I={dataset:Z(()=>({"data-expanded":g.isOpen()?"":void 0,"data-closed":g.isOpen()?void 0:""})),isOpen:g.isOpen,contentPresent:y,openWithDelay:b,closeWithDelay:x,cancelOpening:w,cancelClosing:M,close:g.close,isTargetOnHoverCard:_,setTriggerRef:l,setContentRef:u};return d(Hme.Provider,{value:I,get children(){return d(Hf,f({anchorRef:s,contentRef:c,onCurrentPlacementChange:m},i))}})}function Ume(e){const t=eH(),[n,r]=Se(e,["ref","onPointerEnter","onPointerLeave","onFocus","onBlur"]),i=l=>{dt(l,n.onPointerEnter),!(l.pointerType==="touch"||r.disabled||l.defaultPrevented)&&(t.cancelClosing(),t.isOpen()||t.openWithDelay())},a=l=>{dt(l,n.onPointerLeave),l.pointerType!=="touch"&&t.cancelOpening()},o=l=>{dt(l,n.onFocus),!(r.disabled||l.defaultPrevented)&&(t.cancelClosing(),t.isOpen()||t.openWithDelay())},s=l=>{dt(l,n.onBlur),t.cancelOpening();const c=l.relatedTarget;t.isTargetOnHoverCard(c)||t.closeWithDelay()};return me(t.cancelOpening),d(tX,f({ref(l){var c=hn(t.setTriggerRef,n.ref);typeof c=="function"&&c(l)},onPointerEnter:i,onPointerLeave:a,onFocus:o,onBlur:s},()=>t.dataset(),r))}var jp=Object.assign(Bme,{Arrow:vs,Content:Fme,Portal:Vme,Trigger:Ume}),OKt=ie("<div data-slot=hover-card-body>");function Wme(e){const[t,n]=Se(e,["trigger","mount","class","classList","children"]);return d(jp,f({gutter:4},n,{get children(){return[d(jp.Trigger,{as:"div","data-slot":"hover-card-trigger",tabIndex:-1,get children(){return t.trigger}}),d(jp.Portal,{get mount(){return t.mount},get children(){return d(jp.Content,{"data-component":"hover-card-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){var r=OKt();return K(r,()=>t.children),r}})}})]}}))}var RKt=ie('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 18 14"fill=none><g>'),zKt=ie("<span data-slot=diff-changes-additions>"),qKt=ie("<span data-slot=diff-changes-deletions>"),jKt=ie("<div data-component=diff-changes>"),HKt=ie("<svg><rect width=2 height=14 rx=1></svg>",!1,!0,!1);function FKt(e){const t=()=>e.variant??"default",n=Z(()=>Array.isArray(e.changes)?e.changes.reduce((u,h)=>u+(h.additions??0),0):e.changes.additions),r=Z(()=>Array.isArray(e.changes)?e.changes.reduce((u,h)=>u+(h.deletions??0),0):e.changes.deletions),i=Z(()=>(n()??0)+(r()??0)),a=Z(()=>{const h=n()??0,m=r()??0;if(h===0&&m===0)return{added:0,deleted:0,neutral:5};const g=h+m;if(g<5){const S=h>0?1:0,I=m>0?1:0,A=5-S-I;return{added:S,deleted:I,neutral:A}}const y=h>m?h/m:m/h;let v=5;(g<20||y<4)&&(v=4);const k=h/g,b=m/g,x=k*v,w=b*v;let M=h>0?Math.max(1,Math.round(x)):0,_=m>0?Math.max(1,Math.round(w)):0;h>0&&h<=5&&(M=Math.min(M,1)),h>5&&h<=10&&(M=Math.min(M,2)),m>0&&m<=5&&(_=Math.min(_,1)),m>5&&m<=10&&(_=Math.min(_,2));let C=M+_;C>v&&(x>w?M=v-_:_=v-M,C=M+_);const L=Math.max(0,5-C);return{added:M,deleted:_,neutral:L}}),o="var(--icon-diff-add-base)",s="var(--icon-diff-delete-base)",l="var(--icon-weak-base)",c=Z(()=>{const u=a();return[...Array(u.added).fill(o),...Array(u.deleted).fill(s),...Array(u.neutral).fill(l)].slice(0,5)});return d(ke,{get when(){return bt(()=>t()==="default")()?i()>0:!0},get children(){var u=jKt();return K(u,d(r0,{get children(){return[d(Zn,{get when(){return t()==="bars"},get children(){var h=RKt(),m=h.firstChild;return K(m,d(Qt,{get each(){return c()},children:(g,y)=>(()=>{var v=HKt();return gt(v,"fill",g),Qe(()=>gt(v,"x",y()*4)),v})()})),h}}),d(Zn,{get when(){return t()==="default"},get children(){return[(()=>{var h=zKt();return K(h,()=>`+${n()}`),h})(),(()=>{var h=qKt();return K(h,()=>`-${r()}`),h})()]}})]}})),Qe(h=>{var m=t(),g={[e.class??""]:!0};return m!==h.e&>(u,"data-variant",h.e=m),h.t=hr(u,g,h.t),h},{e:void 0,t:void 0}),u}})}var VKt=ie("<ul role=list data-component=message-nav>"),BKt=ie("<div data-slot=message-nav-tick-button role=button tabindex=0><div data-slot=message-nav-tick-line>"),UKt=ie("<button data-slot=message-nav-message-button><div data-slot=message-nav-title-preview>"),WKt=ie("<li data-slot=message-nav-item>"),GKt=ie("<div data-slot=message-nav-tooltip-content>");function Gme(e){const t=M0(),[n,r]=Se(e,["messages","current","size","onMessageSelect","getLabel"]),i=()=>(()=>{var a=VKt();return ki(a,f({get"data-size"(){return n.size}},r),!1,!0),K(a,d(Qt,{get each(){return n.messages},children:o=>{const s=()=>n.onMessageSelect(o),l=c=>{c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),n.onMessageSelect(o))};return(()=>{var c=WKt();return K(c,d(r0,{get children(){return[d(Zn,{get when(){return n.size==="compact"},get children(){var u=BKt();return u.$$keydown=l,u.$$click=s,Qe(()=>gt(u,"data-active",o.id===n.current?.id||void 0)),u}}),d(Zn,{get when(){return n.size==="normal"},get children(){var u=UKt(),h=u.firstChild;return u.$$keydown=l,u.$$click=s,K(u,d(FKt,{get changes(){return o.summary?.diffs??[]},variant:"bars"}),h),K(h,d(ke,{get when(){return n.getLabel?.(o)??o.summary?.title},get fallback(){return t.t("ui.messageNav.newMessage")},get children(){return n.getLabel?.(o)??o.summary?.title}})),Qe(()=>gt(h,"data-active",o.id===n.current?.id||void 0)),u}})]}})),c})()}})),a})();return d(r0,{get children(){return[d(Zn,{get when(){return n.size==="compact"},get children(){return d(Ua,{openDelay:0,placement:"right-start",gutter:-40,shift:-10,overlap:!0,contentClass:"message-nav-tooltip",get value(){return(()=>{var a=GKt();return K(a,d(Gme,f(e,{size:"normal",class:""}))),a})()},get children(){return i()}})}}),d(Zn,{get when(){return n.size==="normal"},get children(){return i()}})]}})}li(["click","keydown"]);const One={ask:"var(--icon-agent-ask-base)",build:"var(--icon-agent-build-base)",docs:"var(--icon-agent-docs-base)",plan:"var(--icon-agent-plan-base)"};function ZKt(e,t){return t||(One[e]??One[e.toLowerCase()])}function KKt(e,t){if(e)for(let n=e.length-1;n>=0;n--){const r=e[n];if(!(r.role!=="user"||!r.agent))return ZKt(r.agent,t.find(i=>i.name===r.agent)?.color)}}function Zme(e,t,n,r=()=>!0){if(!n)return;const i=e.reduce((l,c)=>{if(!c.parentID)return l;const u=l.get(c.parentID);return u&&u.push(c.id),u||l.set(c.parentID,[c.id]),l},new Map),a=new Set([n]),o=[n];for(const l of o){const c=i.get(l);if(c)for(const u of c)a.has(u)||(a.add(u),o.push(u))}const s=o.find(l=>t[l]?.some(r));if(s)return t[s]?.find(r)}function XKt(e,t,n,r){return Zme(e,t,n,r)}function IQt(e,t,n,r){return Zme(e,t,n,r)}var YKt=ie("<div>"),JKt=ie('<div><div class="size-full rounded overflow-clip">'),QKt=ie('<div class="size-1.5 rounded-full bg-surface-warning-strong">'),eXt=ie('<div class="size-1.5 rounded-full bg-text-diff-delete-base">'),tXt=ie('<div class="size-1.5 rounded-full bg-text-interactive-base">'),Kme=ie('<div class="shrink-0 size-6 flex items-center justify-center">'),Xme=ie('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">'),nXt=ie('<div class="overflow-y-auto overflow-x-hidden max-h-72 h-full">'),rXt=ie('<div class="min-w-0 w-full">'),iXt=ie('<div class="text-12-regular text-text-weak">'),aXt=ie('<div class="group/session relative w-full min-w-0 rounded-md cursor-default pl-2 pr-3 transition-colors hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[[data-expanded]]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active"><div class="flex min-w-0 items-center gap-1"><div class="min-w-0 flex-1"></div><div class="shrink-0 overflow-hidden transition-[width,opacity]">'),oXt=ie('<div class="group/session relative w-full min-w-0 rounded-md cursor-default transition-colors pl-2 pr-3 hover:bg-surface-raised-base-hover [&:has(:focus-visible)]:bg-surface-raised-base-hover has-[.active]:bg-surface-base-active">'),sXt=ie('<div class="flex flex-col gap-1">'),lXt=ie('<div class="h-8 w-full rounded-md bg-surface-raised-base opacity-60 animate-pulse">');const cXt="4b0ea68d7af9a6031a7ffda7ad66e0cb83315750",nX=e=>{const t=ha(),n=Ij(),r=vK(),i=Z(()=>[e.project.worktree,...e.project.sandboxes??[]]),a=Z(()=>i().reduce((u,h)=>u+n.project.unseenCount(h),0)),o=Z(()=>i().some(u=>n.project.unseenHasError(u))),s=Z(()=>i().some(u=>{const[h]=t.child(u,{bootstrap:!1});return pKt(h.permission,m=>!r.autoResponds(m,u))})),l=Z(()=>e.notify&&(s()||a()>0)),c=Z(()=>e.project.name||Gn(e.project.worktree));return(()=>{var u=JKt(),h=u.firstChild;return K(h,d($Kt,f({get fallback(){return c()},get src(){return bt(()=>e.project.id===cXt)()?"https://opencode.ai/favicon.svg":e.project.icon?.override}},()=>cDt(e.project.icon?.color),{class:"size-full rounded",get classList(){return{"badge-mask":l()}}}))),K(u,d(ke,{get when(){return l()},get children(){var m=YKt();return Qe(g=>hr(m,{"absolute top-px right-px size-1.5 rounded-full z-10":!0,"bg-surface-warning-strong":s(),"bg-icon-critical-base":!s()&&o(),"bg-text-interactive-base":!s()&&!o()},g)),m}}),null),Qe(()=>W2(u,`relative size-8 shrink-0 rounded ${e.class??""}`)),u})()},dXt=e=>d(lG,{get href(){return`/${e.slug}/session/${e.session.id}`},get class(){return`flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${e.dense?"py-0.5":"py-1"}`},get onPointerDown(){return e.warmPress},get onPointerEnter(){return e.warmHover},get onPointerLeave(){return e.cancelHoverPrefetch},get onFocus(){return e.warmFocus},onClick:()=>{e.setHoverSession(void 0),!e.sidebarOpened()&&e.clearHoverProjectSoon()},get children(){return[(()=>{var t=Kme();return K(t,d(r0,{get fallback(){return d(Kt,{name:"dash",size:"small",class:"text-icon-weak"})},get children(){return[d(Zn,{get when(){return e.isWorking()},get children(){return d(D2,{class:"size-[15px]"})}}),d(Zn,{get when(){return e.hasPermissions()},get children(){return QKt()}}),d(Zn,{get when(){return e.hasError()},get children(){return eXt()}}),d(Zn,{get when(){return e.unseenCount()>0},get children(){return tXt()}})]}})),Qe(n=>kr(t,"color",e.tint()??"var(--icon-interactive-base)")),t})(),(()=>{var t=Xme();return K(t,()=>e.session.title),t})()]}}),uXt=e=>{let t;return d(Wme,{openDelay:1e3,get closeDelay(){return e.sidebarHovering()?600:0},placement:"right-start",gutter:16,shift:-2,get trigger(){return(()=>{var n=rXt(),r=t;return typeof r=="function"?Hr(r,n):t=n,K(n,()=>e.trigger),n})()},get open(){return e.hoverSession()===e.session.id},onOpenChange:n=>{if(!n){e.setHoverSession(void 0);return}t?.matches(":hover")&&e.setHoverSession(e.session.id)},get children(){return d(ke,{get when(){return e.hoverReady()},get fallback(){return(()=>{var n=iXt();return K(n,()=>e.language.t("session.messages.loading")),n})()},get children(){var n=nXt();return K(n,d(Gme,{get messages(){return e.hoverMessages()??[]},current:void 0,get getLabel(){return e.messageLabel},get onMessageSelect(){return e.onMessageSelect},size:"normal",class:"w-60"})),n}})}})},OU=e=>{const t=di(),n=ll(),r=If(),i=_r(),a=Ij(),o=vK(),s=ha(),l=Z(()=>a.session.unseenCount(e.session.id)),c=Z(()=>a.session.unseenHasError(e.session.id)),[u]=s.child(e.session.directory),h=Z(()=>!!XKt(u.session,u.permission,e.session.id,I=>!o.autoResponds(I,e.session.directory))),m=Z(()=>{if(h())return!1;const I=(u.message[e.session.id]??[]).findLast(D=>D.role==="assistant"&&typeof D.time?.completed!="number"),A=u.session_status[e.session.id];return I!==void 0||A?.type==="busy"||A?.type==="retry"||A!==void 0&&A.type!=="idle"}),g=Z(()=>KKt(u.message[e.session.id],u.agent)),y=Z(()=>u.message[e.session.id]?.filter(I=>I.role==="user")),v=Z(()=>y()!==void 0),k=Z(()=>!e.mobile&&e.sidebarExpanded()),b=Z(()=>(e.popover??!0)&&k()),x=Z(()=>e.session.id===t.id),w=(I,A)=>{const D=e.navList?.(),P=D?.some(E=>E.id===e.session.id&&E.directory===e.session.directory)?D:e.list;e.prefetchSession(e.session,A);const O=P.findIndex(E=>E.id===e.session.id&&E.directory===e.session.directory);if(O!==-1)for(let E=1;E<=I;E++){const T=P[O+E];T&&e.prefetchSession(T,E===1?"high":A);const R=P[O-E];R&&e.prefetchSession(R,E===1?"high":A)}},M={current:void 0},_=()=>{M.current!==void 0&&(clearTimeout(M.current),M.current=void 0)},C=()=>{w(1,"high"),M.current===void 0&&(M.current=setTimeout(()=>{M.current=void 0,w(2,"low")},80))};me(_);const L=I=>(u.part[I.id]??[]).find(P=>P?.type==="text"&&!P.synthetic&&!P.ignored)?.text,S=d(dXt,{get session(){return e.session},get slug(){return e.slug},get mobile(){return e.mobile},get dense(){return e.dense},tint:g,isWorking:m,hasPermissions:h,hasError:c,unseenCount:l,get setHoverSession(){return e.setHoverSession},get clearHoverProjectSoon(){return e.clearHoverProjectSoon},get sidebarOpened(){return r.sidebar.opened},warmHover:C,warmPress:()=>w(2,"high"),warmFocus:()=>w(2,"high"),cancelHoverPrefetch:_});return(()=>{var I=aXt(),A=I.firstChild,D=A.firstChild,P=D.nextSibling;return K(D,d(ke,{get when(){return b()},get fallback(){return d(Ua,{get placement(){return e.mobile?"bottom":"right"},get value(){return e.session.title},gutter:10,class:"min-w-0 w-full",children:S})},get children(){return d(uXt,{get mobile(){return e.mobile},get nav(){return e.nav},get hoverSession(){return e.hoverSession},get session(){return e.session},get sidebarHovering(){return e.sidebarHovering},hoverReady:v,hoverMessages:y,language:i,isActive:x,get slug(){return e.slug},get setHoverSession(){return e.setHoverSession},messageLabel:L,onMessageSelect:O=>{x()||r.pendingMessage.set(`${St(e.session.directory)}/${e.session.id}`,O.id),n(`${e.slug}/session/${e.session.id}#message-${O.id}`)},trigger:S})}})),K(P,d(Ua,{get value(){return i.t("common.archive")},placement:"top",get children(){return d(Cr,{icon:"archive",variant:"ghost",class:"size-6 rounded-md",get"aria-label"(){return i.t("common.archive")},onClick:O=>{O.preventDefault(),O.stopPropagation(),e.archiveSession(e.session)}})}})),Qe(O=>{var E=e.session.id,T={"w-6 opacity-100 pointer-events-auto":!!e.mobile,"w-0 opacity-0 pointer-events-none":!e.mobile,"group-hover/session:w-6 group-hover/session:opacity-100 group-hover/session:pointer-events-auto":!0,"group-focus-within/session:w-6 group-focus-within/session:opacity-100 group-focus-within/session:pointer-events-auto":!0};return E!==O.e&>(I,"data-session-id",O.e=E),O.t=hr(P,T,O.t),O},{e:void 0,t:void 0}),I})()},hXt=e=>{const t=If(),r=_r().t("command.session.new"),i=()=>e.mobile||!e.sidebarExpanded(),a=d(lG,{get href(){return`/${e.slug}/session`},end:!0,get class(){return`flex items-center gap-1 min-w-0 w-full text-left focus:outline-none ${e.dense?"py-0.5":"py-1"}`},onClick:()=>{e.setHoverSession(void 0),!t.sidebar.opened()&&e.clearHoverProjectSoon()},get children(){return[(()=>{var o=Kme();return K(o,d(Kt,{name:"new-session",size:"small",class:"text-icon-weak"})),o})(),(()=>{var o=Xme();return K(o,r),o})()]}});return(()=>{var o=oXt();return K(o,d(ke,{get when(){return!i()},get fallback(){return d(Ua,{get placement(){return e.mobile?"bottom":"right"},value:r,gutter:10,class:"min-w-0 w-full",children:a})},children:a})),o})()},fXt=e=>{const t=Array.from({length:e.count??4},(n,r)=>r);return(()=>{var n=sXt();return K(n,d(Qt,{each:t,children:()=>lXt()})),n})()};var pXt=ie('<div class="bg-background-base rounded-md px-2 py-1 text-14-medium text-text-strong">'),mXt=ie('<div class="flex items-center gap-1 min-w-0 flex-1"><div class="flex items-center justify-center shrink-0 size-6"></div><span class="text-14-medium text-text-base shrink-0"> :</span><div class="flex items-center justify-center shrink-0 overflow-hidden w-0 opacity-0 transition-all duration-200 group-hover/workspace:w-3.5 group-hover/workspace:opacity-100 group-focus-within/workspace:w-3.5 group-focus-within/workspace:opacity-100">'),gXt=ie('<span class="text-14-medium text-text-base min-w-0 truncate">'),yXt=ie('<div class="absolute right-1 top-1/2 -translate-y-1/2 flex items-center gap-0.5 transition-opacity">'),vXt=ie('<div class="shrink-0 size-6 flex items-center justify-center">'),kXt=ie('<span class="text-14-regular text-text-strong min-w-0 flex-1 truncate">Trellis Board'),bXt=ie('<div class="relative w-full py-1">'),wXt=ie('<nav class="flex flex-col gap-1">'),Rne=ie("<div>"),xXt=ie('<div class=py-1><div class="group/workspace relative"data-component=workspace-item><div class="flex items-center gap-1">'),_Xt=ie('<div class="size-full flex flex-col py-2 overflow-y-auto no-scrollbar [overflow-anchor:none]">');const MXt=e=>{const t=ha(),n=_r(),r=Z(()=>{const i=e.sidebarProject();if(!i)return;const a=e.activeWorkspace();if(!a)return;const[o]=t.child(a,{bootstrap:!1}),s=a===i.worktree?n.t("workspace.type.local"):n.t("workspace.type.sandbox"),l=e.workspaceLabel(a,o.vcs?.branch,i.id);return`${s} : ${l}`});return d(ke,{get when(){return r()},children:i=>(()=>{var a=pXt();return K(a,i),a})()})},SXt=e=>(()=>{var t=mXt(),n=t.firstChild,r=n.nextSibling,i=r.firstChild,a=r.nextSibling;return K(n,d(ke,{get when(){return e.busy()},get fallback(){return d(Kt,{name:"branch",size:"small"})},get children(){return d(D2,{class:"size-[15px]"})}})),K(r,(()=>{var o=bt(()=>!!e.local());return()=>o()?e.language.t("workspace.type.local"):e.language.t("workspace.type.sandbox")})(),i),K(t,d(ke,{get when(){return!e.local()},get fallback(){return(()=>{var o=gXt();return K(o,()=>e.branch()??Gn(e.directory)),o})()},get children(){return d(e.InlineEditor,{get id(){return`workspace:${e.directory}`},get value(){return e.workspaceValue},onSave:o=>{const s=o.trim();s&&(e.renameWorkspace(e.directory,s,e.projectId,e.branch()),e.setEditor("value",e.workspaceValue()))},class:"text-14-medium text-text-base min-w-0 truncate",displayClass:"text-14-medium text-text-base min-w-0 truncate",get editing(){return e.workspaceEditActive()},stopPropagation:!1,openOnDblClick:!1})}}),a),K(a,d(Kt,{get name(){return e.open()?"chevron-down":"chevron-right"},size:"small",class:"text-icon-base"})),t})(),CXt=e=>(()=>{var t=yXt();return K(t,d(Mt,{get modal(){return!e.sidebarHovering()},get open(){return e.menuOpen()},onOpenChange:n=>e.setMenuOpen(n),get children(){return[d(Ua,{get value(){return e.language.t("common.moreOptions")},placement:"top",get children(){return d(Mt.Trigger,{as:Cr,icon:"dot-grid",variant:"ghost",class:"size-6 rounded-md","data-action":"workspace-menu",get"data-workspace"(){return St(e.directory)},get"aria-label"(){return e.language.t("common.moreOptions")}})}}),d(Mt.Portal,{get children(){return d(Mt.Content,{onCloseAutoFocus:n=>{e.pendingRename()&&(n.preventDefault(),e.setPendingRename(!1),e.openEditor(`workspace:${e.directory}`,e.workspaceValue()))},get children(){return[d(Mt.Item,{get disabled(){return e.local()},onSelect:()=>{e.setPendingRename(!0),e.setMenuOpen(!1)},get children(){return d(Mt.ItemLabel,{get children(){return e.language.t("common.rename")}})}}),d(Mt.Item,{get disabled(){return e.local()||e.busy()},onSelect:()=>e.showResetWorkspaceDialog(e.root,e.directory),get children(){return d(Mt.ItemLabel,{get children(){return e.language.t("common.reset")}})}}),d(Mt.Item,{get disabled(){return e.local()||e.busy()},onSelect:()=>e.showDeleteWorkspaceDialog(e.root,e.directory),get children(){return d(Mt.ItemLabel,{get children(){return e.language.t("common.delete")}})}})]}})}})]}}),null),K(t,d(ke,{get when(){return!e.touch()},get children(){return d(Ua,{get value(){return e.language.t("command.session.new")},placement:"top",get children(){return d(Cr,{icon:"new-session",variant:"ghost",class:"size-6 rounded-md opacity-0 pointer-events-none group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto","data-action":"workspace-new-session",get"data-workspace"(){return St(e.directory)},get"aria-label"(){return e.language.t("command.session.new")},onClick:n=>{n.preventDefault(),n.stopPropagation(),e.setHoverSession(void 0),e.clearHoverProjectSoon(),e.navigateToNewSession()}})}})}}),null),Qe(n=>hr(t,{"opacity-100 pointer-events-auto":e.menuOpen(),"opacity-0 pointer-events-none":!e.menuOpen(),"group-hover/workspace:opacity-100 group-hover/workspace:pointer-events-auto":!0,"group-focus-within/workspace:opacity-100 group-focus-within/workspace:pointer-events-auto":!0},n)),t})(),Yme=e=>(()=>{var t=wXt();return K(t,d(lG,{get href(){return`/${e.slug()}/trellis`},class:"flex items-center gap-1 min-w-0 w-full text-left py-1 rounded-md px-2 pr-3 hover:bg-surface-raised-base-hover [&.active]:bg-surface-base-active",onClick:()=>{e.ctx.setHoverSession(void 0),e.ctx.clearHoverProjectSoon()},get children(){return[(()=>{var n=vXt();return K(n,d(Kt,{name:"checklist",size:"small",class:"text-icon-weak"})),n})(),kXt()]}}),null),K(t,d(ke,{get when(){return e.showNew()},get children(){return d(hXt,{get slug(){return e.slug()},get mobile(){return e.mobile},get sidebarExpanded(){return e.ctx.sidebarExpanded},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},get setHoverSession(){return e.ctx.setHoverSession}})}}),null),K(t,d(ke,{get when(){return e.loading()},get children(){return d(fXt,{})}}),null),K(t,d(Qt,{get each(){return e.sessions()},children:n=>d(OU,{session:n,get list(){return e.sessions()},get navList(){return e.ctx.navList},get slug(){return e.slug()},get mobile(){return e.mobile},get popover(){return e.popover},get children(){return e.children()},get sidebarExpanded(){return e.ctx.sidebarExpanded},get sidebarHovering(){return e.ctx.sidebarHovering},get nav(){return e.ctx.nav},get hoverSession(){return e.ctx.hoverSession},get setHoverSession(){return e.ctx.setHoverSession},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},get prefetchSession(){return e.ctx.prefetchSession},get archiveSession(){return e.ctx.archiveSession}})}),null),K(t,d(ke,{get when(){return e.hasMore()},get children(){var n=bXt();return K(n,d(Mn,{variant:"ghost",class:"flex w-full text-left justify-start text-14-regular text-text-weak pl-9 pr-10",size:"large",onClick:r=>{e.loadMore(),r.currentTarget.blur()},get children(){return e.language.t("common.loadMore")}})),n}}),null),t})(),LXt=e=>{const t=ll(),n=di(),r=ha(),i=_r(),a=Ame(e.directory),[o,s]=r.child(e.directory,{bootstrap:!1}),[l,c]=nt({open:!1,pendingRename:!1}),u=Z(()=>St(e.directory)),h=Z(()=>F2(o,e.sortNow())),m=Z(()=>nq(o.session)),g=Z(()=>e.directory===e.project.worktree),y=Z(()=>tt(e.ctx.currentDir())===tt(e.directory)),v=Z(()=>{const E=o.vcs?.branch,T=E??Gn(e.directory);return e.ctx.workspaceName(e.directory,e.project.id,E)??T}),k=Z(()=>e.ctx.workspaceExpanded(e.directory,g())),b=Z(()=>k()||y()),x=Z(E=>E||o.status==="complete",!1),w=Z(()=>h()?.length??0),M=Z(()=>o.sessionTotal>w()),_=Z(()=>e.ctx.isBusy(e.directory)),C=Z(E=>E||_(),!1),L=Z(()=>k()&&!x()&&w()===0&&!C()),S=zU("(hover: none)"),I=Z(()=>!L()&&(S()||w()===0||y()&&!n.id)),A=async()=>{s("limit",E=>(E??0)+5),await r.project.loadSessions(e.directory)},D=Z(()=>e.ctx.editorOpen(`workspace:${e.directory}`)),P=()=>d(SXt,{local:g,busy:_,open:k,get directory(){return e.directory},language:i,branch:()=>o.vcs?.branch,workspaceValue:v,workspaceEditActive:D,get InlineEditor(){return e.ctx.InlineEditor},get renameWorkspace(){return e.ctx.renameWorkspace},get setEditor(){return e.ctx.setEditor},get projectId(){return e.project.id}}),O=E=>{e.ctx.setWorkspaceExpanded(e.directory,E),!E&&e.ctx.editorOpen(`workspace:${e.directory}`)&&e.ctx.closeEditor()};return he(()=>{b()&&r.child(e.directory,{bootstrap:!0})}),(()=>{var E=Rne();return Hr(a,E,()=>!0),K(E,d(oV,{variant:"ghost",get open(){return k()},class:"shrink-0",onOpenChange:O,get children(){return[(()=>{var T=xXt(),R=T.firstChild,H=R.firstChild;return K(H,d(ke,{get when(){return D()},get fallback(){return d(oV.Trigger,{get class(){return`flex items-center justify-between w-full pl-2 py-1.5 rounded-md hover:bg-surface-raised-base-hover transition-[padding] duration-200 ${l.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`},"data-action":"workspace-toggle",get"data-workspace"(){return St(e.directory)},get children(){return P()}})},get children(){var Y=Rne();return K(Y,P),Qe(()=>W2(Y,`flex items-center justify-between w-full pl-2 py-1.5 rounded-md transition-[padding] duration-200 ${l.open?"pr-16":"pr-2"} group-hover/workspace:pr-16 group-focus-within/workspace:pr-16`)),Y}}),null),K(H,d(CXt,{get directory(){return e.directory},local:g,busy:_,menuOpen:()=>l.open,pendingRename:()=>l.pendingRename,setMenuOpen:Y=>c("open",Y),setPendingRename:Y=>c("pendingRename",Y),get sidebarHovering(){return e.ctx.sidebarHovering},touch:S,language:i,workspaceValue:v,get openEditor(){return e.ctx.openEditor},get showResetWorkspaceDialog(){return e.ctx.showResetWorkspaceDialog},get showDeleteWorkspaceDialog(){return e.ctx.showDeleteWorkspaceDialog},get root(){return e.project.worktree},get setHoverSession(){return e.ctx.setHoverSession},get clearHoverProjectSoon(){return e.ctx.clearHoverProjectSoon},navigateToNewSession:()=>t(`/${u()}/session?new=1`)}),null),Qe(()=>gt(R,"data-workspace",St(e.directory))),T})(),d(oV.Content,{get children(){return d(Yme,{slug:u,get mobile(){return e.mobile},get popover(){return e.popover},get ctx(){return e.ctx},showNew:I,loading:L,sessions:h,children:m,hasMore:M,loadMore:A,language:i})}})]}})),Qe(T=>hr(E,{"opacity-30":a.isActiveDraggable,"opacity-50 pointer-events-none":_()},T)),E})()},IXt=e=>{const t=ha(),n=_r(),r=Z(()=>{const[m,g]=t.child(e.project.worktree);return{store:m,setStore:g}}),i=Z(()=>St(e.project.worktree)),a=Z(()=>F2(r().store,e.sortNow())),o=Z(()=>nq(r().store.session)),s=Z(m=>m||r().store.status==="complete",!1),l=Z(()=>a()?.length??0),c=Z(()=>!s()&&l()===0),u=Z(()=>r().store.sessionTotal>l()),h=async()=>{r().setStore("limit",m=>(m??0)+5),await t.project.loadSessions(e.project.worktree)};return(()=>{var m=_Xt();return Hr(g=>e.ctx.setScrollContainerRef(g,e.mobile),m),K(m,d(Yme,{slug:i,get mobile(){return e.mobile},get popover(){return e.popover},get ctx(){return e.ctx},showNew:()=>!1,loading:c,sessions:a,children:o,hasMore:u,loadMore:h,language:n})),m})()};var NXt={};Ga(NXt,{Arrow:()=>vs,CheckboxItem:()=>zj,Content:()=>Jme,ContextMenu:()=>tr,Group:()=>Nm,GroupLabel:()=>qj,Icon:()=>jj,Item:()=>Hj,ItemDescription:()=>Fj,ItemIndicator:()=>Vj,ItemLabel:()=>Bj,Portal:()=>Uj,RadioGroup:()=>Wj,RadioItem:()=>Gj,Root:()=>tge,Separator:()=>Ff,Sub:()=>Zj,SubContent:()=>Kj,SubTrigger:()=>Xj,Trigger:()=>nge,useContextMenuContext:()=>ege});function Jme(e){const t=fa(),[n,r]=Se(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return d(gme,f({onCloseAutoFocus:s=>{n.onCloseAutoFocus?.(s),!s.defaultPrevented&&i&&s.preventDefault(),i=!1},onInteractOutside:s=>{n.onInteractOutside?.(s),!s.defaultPrevented&&!t.isModal()&&(i=!0)}},r))}var Qme=Tt();function AXt(){return Lt(Qme)}function ege(){const e=AXt();if(e===void 0)throw new Error("[kobalte]: `useContextMenuContext` must be used within a `ContextMenu` component");return e}function tge(e){const t=`contextmenu-${xr()}`,{direction:n}=gs(),r=ft({id:t,placement:n()==="rtl"?"left-start":"right-start",gutter:2,shift:2},e),[i,a]=Se(r,["onOpenChange"]),[o,s]=Ce({x:0,y:0}),l=x0({defaultOpen:!1,onOpenChange:u=>i.onOpenChange?.(u)}),c={setAnchorRect:s};return d(Qme.Provider,{value:c,get children(){return d(bme,f({get open(){return l.isOpen()},get onOpenChange(){return l.setIsOpen},getAnchorRect:o},a))}})}function nge(e){const t=fa(),n=Po(),r=ege(),i=ft({id:t.generateId("trigger")},e),[a,o]=Se(i,["ref","style","disabled","onContextMenu","onPointerDown","onPointerMove","onPointerCancel","onPointerUp"]);let s=0;const l=()=>{window.clearTimeout(s)};me(()=>{l()});const c=v=>{if(a.disabled){dt(v,a.onContextMenu);return}l(),v.preventDefault(),v.stopPropagation(),r.setAnchorRect({x:v.clientX,y:v.clientY}),n.isOpen()?n.focusContent():n.open(!0)},u=v=>v.pointerType==="touch"||v.pointerType==="pen";return d(zt,f({as:"div",ref(v){var k=hn(n.setTriggerRef,a.ref);typeof k=="function"&&k(v)},get style(){return Wa({"-webkit-touch-callout":"none"},a.style)},get"data-disabled"(){return a.disabled?"":void 0},onContextMenu:c,onPointerDown:v=>{dt(v,a.onPointerDown),!a.disabled&&u(v)&&(l(),r.setAnchorRect({x:v.clientX,y:v.clientY}),s=window.setTimeout(()=>n.open(!1),700))},onPointerMove:v=>{dt(v,a.onPointerMove),!a.disabled&&u(v)&&l()},onPointerCancel:v=>{dt(v,a.onPointerCancel),!a.disabled&&u(v)&&l()},onPointerUp:v=>{dt(v,a.onPointerUp),!a.disabled&&u(v)&&l()}},()=>n.dataset(),o))}var tr=Object.assign(tge,{Arrow:vs,CheckboxItem:zj,Content:Jme,Group:Nm,GroupLabel:qj,Icon:jj,Item:Hj,ItemDescription:Fj,ItemIndicator:Vj,ItemLabel:Bj,Portal:Uj,RadioGroup:Wj,RadioItem:Gj,Separator:Ff,Sub:Zj,SubContent:Kj,SubTrigger:Xj,Trigger:nge});function $Xt(e){return d(tr,f(e,{"data-component":"context-menu"}))}function TXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.Trigger,f(n,{"data-slot":"context-menu-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function EXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.Icon,f(n,{"data-slot":"context-menu-icon",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function PXt(e){return d(tr.Portal,e)}function DXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.Content,f(n,{"data-component":"context-menu-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function OXt(e){const[t,n]=Se(e,["class","classList"]);return d(tr.Arrow,f(n,{"data-slot":"context-menu-arrow",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function RXt(e){const[t,n]=Se(e,["class","classList"]);return d(tr.Separator,f(n,{"data-slot":"context-menu-separator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}}}))}function zXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.Group,f(n,{"data-slot":"context-menu-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function qXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.GroupLabel,f(n,{"data-slot":"context-menu-group-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function jXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.Item,f(n,{"data-slot":"context-menu-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function HXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.ItemLabel,f(n,{"data-slot":"context-menu-item-label",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function FXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.ItemDescription,f(n,{"data-slot":"context-menu-item-description",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function VXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.ItemIndicator,f(n,{"data-slot":"context-menu-item-indicator",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function BXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.RadioGroup,f(n,{"data-slot":"context-menu-radio-group",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function UXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.RadioItem,f(n,{"data-slot":"context-menu-radio-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function WXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.CheckboxItem,f(n,{"data-slot":"context-menu-checkbox-item",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function GXt(e){return d(tr.Sub,e)}function ZXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.SubTrigger,f(n,{"data-slot":"context-menu-sub-trigger",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}function KXt(e){const[t,n]=Se(e,["class","classList","children"]);return d(tr.SubContent,f(n,{"data-component":"context-menu-sub-content",get classList(){return{...t.classList??{},[t.class??""]:!!t.class}},get children(){return t.children}}))}const Li=Object.assign($Xt,{Trigger:TXt,Icon:EXt,Portal:PXt,Content:DXt,Arrow:OXt,Separator:RXt,Group:zXt,GroupLabel:qXt,Item:jXt,ItemLabel:HXt,ItemDescription:FXt,ItemIndicator:VXt,RadioGroup:BXt,RadioItem:UXt,CheckboxItem:WXt,Sub:GXt,SubTrigger:ZXt,SubContent:KXt});var XXt=ie('<div class="bg-background-base rounded-xl p-1">'),YXt=ie('<div class="-m-3 p-2 flex flex-col w-72"><div class="px-4 pt-2 pb-1 flex items-center gap-2"><div class="text-14-medium text-text-strong truncate grow"></div></div><div class="px-4 pb-2 text-12-medium text-text-weak"></div><div class="px-2 pb-2 flex flex-col gap-2"></div><div class="px-2 py-2 border-t border-border-weak-base">'),JXt=ie('<div class="flex flex-col gap-1"><div class="px-2 py-0.5 flex items-center gap-1 min-w-0"><div class="shrink-0 size-6 flex items-center justify-center"></div><span class="truncate text-14-medium text-text-base">'),QXt=ie("<div>");const eYt=e=>{const t=Z(()=>e.projects().find(n=>n.worktree===e.activeProject()));return d(ke,{get when(){return t()},children:n=>(()=>{var r=XXt();return K(r,d(nX,{get project(){return n()}})),r})()})},tYt=e=>{const t=Ij(),n=If(),r=Z(()=>e.dirs().reduce((a,o)=>a+t.project.unseenCount(o),0)),i=()=>e.dirs().filter(a=>t.project.unseenCount(a)>0).forEach(a=>t.project.markViewed(a));return d(Li,{get modal(){return!e.sidebarHovering()},onOpenChange:a=>{e.setMenu(a),e.setSuppressHover(a),a&&e.setOpen(!1)},get children(){return[d(Li.Trigger,{as:"button",type:"button",get"aria-label"(){return QK(e.project)},"data-action":"project-switch",get"data-project"(){return St(e.project.worktree)},get classList(){return{"flex items-center justify-center size-10 p-1 rounded-lg overflow-hidden transition-colors cursor-default":!0,"bg-transparent border-2 border-icon-strong-base hover:bg-surface-base-hover":e.selected(),"bg-transparent border border-transparent hover:bg-surface-base-hover hover:border-border-weak-base":!e.selected()&&!e.active(),"bg-surface-base-hover border border-border-weak-base":!e.selected()&&e.active()}},onPointerDown:a=>{if(a.button===0&&!a.ctrlKey){e.setOpen(!1),e.setSuppressHover(!0);return}e.overlay()&&(a.button!==2&&!(a.button===0&&a.ctrlKey)||(e.setOpen(!1),e.setSuppressHover(!0),a.preventDefault()))},onMouseEnter:a=>{e.overlay()&&(e.suppressHover()||e.onProjectMouseEnter(e.project.worktree,a))},onMouseLeave:()=>{e.suppressHover()&&e.setSuppressHover(!1),e.overlay()&&e.onProjectMouseLeave(e.project.worktree)},onFocus:()=>{e.overlay()&&(e.suppressHover()||e.onProjectFocus(e.project.worktree))},onClick:()=>{if(e.setOpen(!1),e.selected()){n.sidebar.toggle();return}e.navigateToProject(e.project.worktree)},onBlur:()=>e.setOpen(!1),get children(){return d(nX,{get project(){return e.project},notify:!0})}}),d(Li.Portal,{get children(){return d(Li.Content,{get children(){return[d(Li.Item,{onSelect:()=>e.showEditProjectDialog(e.project),get children(){return d(Li.ItemLabel,{get children(){return e.language.t("common.edit")}})}}),d(Li.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return St(e.project.worktree)},get disabled(){return bt(()=>e.project.vcs!=="git")()&&!e.workspacesEnabled(e.project)},onSelect:()=>e.toggleProjectWorkspaces(e.project),get children(){return d(Li.ItemLabel,{get children(){return bt(()=>!!e.workspacesEnabled(e.project))()?e.language.t("sidebar.workspaces.disable"):e.language.t("sidebar.workspaces.enable")}})}}),d(Li.Item,{"data-action":"project-clear-notifications",get"data-project"(){return St(e.project.worktree)},get disabled(){return r()===0},onSelect:i,get children(){return d(Li.ItemLabel,{get children(){return e.language.t("sidebar.project.clearNotifications")}})}}),d(Li.Separator,{}),d(Li.Item,{"data-action":"project-close-menu",get"data-project"(){return St(e.project.worktree)},onSelect:()=>e.closeProject(e.project.worktree),get children(){return d(Li.ItemLabel,{get children(){return e.language.t("common.close")}})}})]}})}})]}})},nYt=e=>(()=>{var t=YXt(),n=t.firstChild,r=n.firstChild,i=n.nextSibling,a=i.nextSibling,o=a.nextSibling;return K(r,()=>QK(e.project)),K(i,()=>e.language.t("sidebar.project.recentSessions")),K(a,d(ke,{get when(){return e.workspaceEnabled()},get fallback(){return d(Qt,{get each(){return e.projectSessions().slice(0,2)},children:s=>d(OU,f(()=>e.ctx.sessionProps,{session:s,get list(){return e.projectSessions()},get slug(){return St(e.project.worktree)},dense:!0,get mobile(){return e.mobile},popover:!1,get children(){return e.projectChildren()}}))})},get children(){return d(Qt,{get each(){return e.workspaces()},children:s=>{const l=Z(()=>e.workspaceSessions(s)),c=Z(()=>e.workspaceChildren(s));return(()=>{var u=JXt(),h=u.firstChild,m=h.firstChild,g=m.nextSibling;return K(m,d(Kt,{name:"branch",size:"small",class:"text-icon-base"})),K(g,()=>e.label(s)),K(u,d(Qt,{get each(){return l().slice(0,2)},children:y=>d(OU,f(()=>e.ctx.sessionProps,{session:y,get list(){return l()},get slug(){return St(s)},dense:!0,get mobile(){return e.mobile},popover:!1,get children(){return c()}}))}),null),u})()}})}})),K(o,d(Mn,{variant:"ghost",class:"flex w-full text-left justify-start text-text-base px-2 hover:bg-transparent active:bg-transparent",onClick:()=>{e.ctx.openSidebar(),e.ctx.onHoverOpenChanged(e.project.worktree,!1),!e.selected()&&e.ctx.navigateToProject(e.project.worktree)},get children(){return e.language.t("sidebar.project.viewAllSessions")}})),t})(),rYt=e=>{const t=ha(),n=_r(),r=Ame(e.project.worktree),i=Z(()=>e.ctx.currentProject()?.worktree===e.project.worktree),a=Z(()=>e.ctx.workspaceIds(e.project).slice(0,2)),o=Z(()=>e.ctx.workspacesEnabled(e.project)),s=Z(()=>e.ctx.workspaceIds(e.project)),[l,c]=nt({menu:!1,suppressHover:!1}),u=()=>e.ctx.hoverProject()===e.project.worktree,h=Z(()=>!e.mobile&&e.ctx.sidebarOpened()),m=Z(()=>!e.mobile&&!e.ctx.sidebarOpened()),g=Z(()=>l.menu||(h()||m())&&u()),y=()=>u()&&h()&&!i()&&!l.menu,v=C=>{const[L]=t.child(C,{bootstrap:!1}),S=C===e.project.worktree?n.t("workspace.type.local"):n.t("workspace.type.sandbox"),I=e.ctx.workspaceLabel(C,L.vcs?.branch,e.project.id);return`${S} : ${I}`},k=Z(()=>t.child(e.project.worktree,{bootstrap:!1})[0]),b=Z(()=>F2(k(),e.sortNow())),x=Z(()=>nq(k().session)),w=C=>{const[L]=t.child(C,{bootstrap:!1});return F2(L,e.sortNow())},M=C=>{const[L]=t.child(C,{bootstrap:!1});return nq(L.session)},_=()=>d(tYt,{get project(){return e.project},get mobile(){return e.mobile},get nav(){return e.ctx.nav},get sidebarHovering(){return e.ctx.sidebarHovering},selected:i,active:g,overlay:m,suppressHover:()=>l.suppressHover,dirs:s,get onProjectMouseEnter(){return e.ctx.onProjectMouseEnter},get onProjectMouseLeave(){return e.ctx.onProjectMouseLeave},get onProjectFocus(){return e.ctx.onProjectFocus},get navigateToProject(){return e.ctx.navigateToProject},get showEditProjectDialog(){return e.ctx.showEditProjectDialog},get toggleProjectWorkspaces(){return e.ctx.toggleProjectWorkspaces},get workspacesEnabled(){return e.ctx.workspacesEnabled},get closeProject(){return e.ctx.closeProject},setMenu:C=>c("menu",C),setOpen:C=>e.ctx.onHoverOpenChanged(e.project.worktree,C),setSuppressHover:C=>c("suppressHover",C),language:n});return(()=>{var C=QXt();return Hr(r,C,()=>!0),K(C,d(ke,{get when(){return bt(()=>!!h())()&&!i()},get fallback(){return _()},get children(){return d(Wme,{get open(){return bt(()=>!!(!l.suppressHover&&y()))()&&!l.menu},openDelay:0,closeDelay:0,placement:"right-start",gutter:6,get trigger(){return _()},onOpenChange:L=>{l.menu||L&&l.suppressHover||(e.ctx.onHoverOpenChanged(e.project.worktree,L),L&&e.ctx.setHoverSession(void 0))},get children(){return d(nYt,{get project(){return e.project},get mobile(){return e.mobile},selected:i,workspaceEnabled:o,workspaces:a,label:v,projectSessions:b,projectChildren:x,workspaceSessions:w,workspaceChildren:M,get ctx(){return e.ctx},language:n})}})}})),Qe(()=>C.classList.toggle("opacity-30",!!r.isActiveDraggable)),C})()};var iYt=ie('<div class="h-full w-full flex flex-col items-center gap-3 px-3 py-3 overflow-y-auto no-scrollbar">'),aYt=ie('<div class="flex h-full w-full min-w-0 overflow-hidden"><div data-component=sidebar-rail class="w-16 shrink-0 bg-background-base flex flex-col items-center overflow-hidden"><div class="flex-1 min-h-0 w-full"></div><div class="shrink-0 w-full pt-3 pb-6 flex flex-col items-center gap-2"></div></div><div>'),oYt=ie('<span class="text-icon-base text-12-medium">'),sYt=ie('<div class="flex items-center gap-2"><span>');const lYt=e=>{const t=Z(()=>!!e.mobile||e.opened()),n=()=>e.mobile?"bottom":"right";let r;return he(()=>{const i=r;if(i){if(t()){i.removeAttribute("inert");return}i.setAttribute("inert","")}}),(()=>{var i=aYt(),a=i.firstChild,o=a.firstChild,s=o.nextSibling,l=a.nextSibling;return Y1(a,"mousemove",e.aimMove,!0),K(o,d(Sme,{get onDragStart(){return e.handleDragStart},get onDragEnd(){return e.handleDragEnd},get onDragOver(){return e.handleDragOver},collisionDetector:_me,get children(){return[d(Cme,{}),d(Eme,{}),(()=>{var c=iYt();return K(c,d(Nme,{get ids(){return e.projects().map(u=>u.worktree)},get children(){return d(Qt,{get each(){return e.projects()},children:u=>e.renderProject(u)})}}),null),K(c,d(Ua,{get placement(){return n()},get value(){return(()=>{var u=sYt(),h=u.firstChild;return K(h,()=>e.openProjectLabel),K(u,d(ke,{get when(){return bt(()=>!e.mobile)()&&!!e.openProjectKeybind()},get children(){var m=oYt();return K(m,()=>e.openProjectKeybind()),m}}),null),u})()},get children(){return d(Cr,{icon:"plus",variant:"ghost",size:"large",get onClick(){return e.onOpenProject},get"aria-label"(){return bt(()=>typeof e.openProjectLabel=="string")()?e.openProjectLabel:void 0}})}}),null),c})(),d(Lme,{get children(){return e.renderProjectOverlay()}})]}})),K(s,d(eme,{get placement(){return n()},get title(){return e.settingsLabel()},get keybind(){return e.settingsKeybind()??""},get children(){return d(Cr,{icon:"settings-gear",variant:"ghost",size:"large",get onClick(){return e.onOpenSettings},get"aria-label"(){return e.settingsLabel()}})}}),null),K(s,d(Ua,{get placement(){return n()},get value(){return e.helpLabel()},get children(){return d(Cr,{icon:"help",variant:"ghost",size:"large",get onClick(){return e.onOpenHelp},get"aria-label"(){return e.helpLabel()}})}}),null),Hr(c=>{r=c},l),K(l,()=>e.renderPanel()),Qe(c=>{var u={"flex-1 flex h-full min-h-0 min-w-0 overflow-hidden":!0,"pointer-events-none":!t()},h=!t();return c.e=hr(l,u,c.e),h!==c.t&>(l,"aria-hidden",c.t=h),c},{e:void 0,t:void 0}),i})()};li(["mousemove"]);var cYt=ie('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"></span></div><div class="flex justify-end gap-2">'),dYt=ie('<div class="flex flex-col gap-4 pl-6 pr-2.5 pb-3"><div class="flex flex-col gap-1"><span class="text-14-regular text-text-strong"></span><span class="text-12-regular text-text-weak"> <!> </span></div><div class="flex justify-end gap-2">'),uYt=ie('<span class="text-12-regular text-text-base truncate select-text">'),hYt=ie('<div class="shrink-0 pl-1 py-1"><div class="group/project flex items-start justify-between gap-2 py-2 pl-2 pr-0"><div class="flex flex-col min-w-0">'),zne=ie('<div class="shrink-0 py-4">'),fYt=ie('<div class="relative flex-1 min-h-0"><div class="size-full flex flex-col py-2 gap-4 overflow-y-auto no-scrollbar [overflow-anchor:none]">'),pYt=ie('<div class="flex-1 min-h-0 flex flex-col">'),mYt=ie('<div><div class="shrink-0 px-3 py-3"><div class="rounded-xl bg-background-base shadow-xs-border-base"data-component=getting-started><div class="p-3 flex flex-col gap-6"><div class="flex flex-col gap-2"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)></div></div><div data-component=getting-started-actions>'),gYt=ie('<div class="flex-1 min-h-0 -mt-4 flex items-center justify-center px-6 pb-64 text-center"><div class="mt-8 flex max-w-60 flex-col items-center gap-6 text-center"><div class="flex flex-col gap-3"><div class="text-14-medium text-text-strong"></div><div class="text-14-regular text-text-base"style=line-height:var(--line-height-normal)>'),yYt=ie('<div class="flex-1 min-h-0">'),vYt=ie('<div class=" hidden w-12 shrink-0 bg-background-base flex flex-col items-center py-2 gap-2 z-20"><div class="flex-1 w-full flex flex-col items-center gap-1 overflow-y-auto no-scrollbar"><button type=button class="flex items-center justify-center size-9 p-1 rounded-md transition-colors hover:bg-surface-base-hover"></button></div><div class="shrink-0 w-full flex flex-col items-center gap-1 pb-2"><button type=button class="flex items-center justify-center size-9 p-1 rounded-md transition-colors hover:bg-surface-base-hover">'),qne=ie("<div class=size-full>"),kYt=ie('<div class="relative bg-background-base flex-1 min-h-0 min-w-0 flex flex-col select-none [&_input]:select-text [&_textarea]:select-text [&_[contenteditable]]:select-text"><div class="flex-1 min-h-0 min-w-0 flex overflow-hidden"><div class="flex-1 min-h-0 relative"><div class="size-full relative overflow-x-hidden"><div class=xl:hidden><div></div><nav data-component=sidebar-nav-mobile></nav></div><div><main>'),bYt=ie('<button type=button class="flex items-center justify-center size-9 p-0.5 rounded-md transition-colors">');function wYt(e){const[t,n,,r]=Jn(In.global("layout.page",["layout.page.v1"]),nt({lastProjectSession:{},activeProject:void 0,activeWorkspace:void 0,workspaceOrder:{},workspaceName:{},workspaceBranchName:{},workspaceExpanded:{},gettingStartedDismissed:!1,activityBarVisible:!0,statusBarVisible:!0,minimapVisible:!1,panelMaximized:!1,panelPosition:"bottom",panelAlignment:"center"})),i=Z(()=>r());let a,o=0,s=!1;const l=di(),c=E0(),u=ha(),h=If(),m=Z(()=>h.ready()),g=ms(),y=sm(),v=T0(),k=Ij(),b=vK(),x=ll();VZt(x);const w=yK(),M=lf(),_=Ice(),C=ule(),L=_r(),S=xo(l.dir),I=Z(()=>{const B=l.dir;if(!B)return{slug:B,dir:""};const F=xo(B);return F?{slug:B,dir:u.peek(F,{bootstrap:!1})[0].path.directory||F}:{slug:B,dir:""}}),A=Z(()=>C.ids().map(B=>[B,C.themes()[B]])),D=["system","light","dark"],P={system:"theme.scheme.system",light:"theme.scheme.light",dark:"theme.scheme.dark"},O=B=>L.t(P[B]),E=Z(()=>I().dir),[T,R]=nt({autoselect:!S,busyWorkspaces:{},hoverSession:void 0,hoverProject:void 0,scrollSessionKey:void 0,nav:void 0,sortNow:Date.now(),sizing:!1,peek:void 0,peeked:!1}),H=wKt(),Y=(B,F)=>{const re=tt(B);if(F){R("busyWorkspaces",re,!0);return}R("busyWorkspaces",Je(fe=>{delete fe[re]}))},j=B=>!!T.busyWorkspaces[tt(B)],X=()=>T.sortNow;let W;const G=setTimeout(()=>{R("sortNow",Date.now()),W=setInterval(()=>R("sortNow",Date.now()),6e4)},6e4-Date.now()%6e4),J=FZt({enabled:()=>!h.sidebar.opened(),active:()=>T.hoverProject,el:()=>T.nav?.querySelector("[data-component='sidebar-rail']")??T.nav,onActivate:B=>{u.child(B),R("hoverProject",B),R("hoverSession",void 0)}});me(()=>{s=!0,o+=1,clearTimeout(G),W&&clearInterval(W),Ee!==void 0&&clearTimeout(Ee),J.reset()}),dn(()=>{const B=()=>R("sizing",!1),F=()=>pe(),re=()=>{document.visibilityState==="hidden"&&pe()};window.addEventListener("pointerup",B),window.addEventListener("pointercancel",B),window.addEventListener("blur",B),window.addEventListener("blur",F),document.addEventListener("visibilitychange",re),me(()=>{window.removeEventListener("pointerup",B),window.removeEventListener("pointercancel",B),window.removeEventListener("blur",B),window.removeEventListener("blur",F),document.removeEventListener("visibilitychange",re)})});const oe=Z(()=>!h.sidebar.opened()&&T.hoverProject!==void 0),de=Z(()=>h.sidebar.opened()||oe()),ye=B=>{R("hoverProject",B),J.reset()},ve=()=>queueMicrotask(()=>ye(void 0)),le=B=>R("hoverSession",B),pe=()=>{R("hoverSession",void 0),ye(void 0)};let Ee;const Re=Z(()=>{const B=T.hoverProject;if(B)return h.projects.list().find(F=>F.worktree===B)});Z(()=>{const B=T.peek;if(B)return h.projects.list().find(F=>F.worktree===B)}),he(()=>{const B=Re();if(B){Ee!==void 0&&(clearTimeout(Ee),Ee=void 0),R("peek",B.worktree),R("peeked",!0);return}R("peeked",!1),T.peek!==void 0&&(Ee!==void 0&&clearTimeout(Ee),Ee=window.setTimeout(()=>{Ee=void 0,R("peek",void 0)},180))}),he(()=>{h.sidebar.opened()&&ye(void 0)}),he(()=>{if(!T.autoselect)return;const B=l.dir;!B||!xo(B)||R("autoselect",!1)});const wt=H.editorOpen,Ue=H.openEditor,V=H.closeEditor,Fe=H.setEditor,ze=H.InlineEditor,At=()=>{h.sidebar.opened()||pe()},De=B=>{At(),x(B),h.mobileSidebar.hide()};function Nt(B=1){const F=A().map(([ge])=>ge);if(F.length===0)return;const re=F.indexOf(C.themeId()),fe=re===-1?0:(re+B+F.length)%F.length,_e=F[fe];C.setTheme(_e),lr({title:L.t("toast.theme.title"),description:C.name(_e)})}function jn(B=1){const F=C.colorScheme(),re=D.indexOf(F),fe=re===-1?0:(re+B+D.length)%D.length,_e=D[fe];C.setColorScheme(_e),lr({title:L.t("toast.scheme.title"),description:O(_e)})}function ui(B){B!==L.locale()&&(L.setLocale(B),lr({title:L.t("toast.language.title"),description:L.t("toast.language.description",{language:L.label(B)})}))}function Mr(B=1){const F=L.locales,re=F.indexOf(L.locale()),fe=re===-1?0:(re+B+F.length)%F.length,_e=F[fe];_e&&ui(_e)}function hi(B){const F=y.appearance.fontSize();y.appearance.setFontSize(Math.max(8,Math.min(72,F+B)))}function yn(){y.appearance.setFontSize(14)}const Hn=()=>dn(()=>{if(!g.checkUpdate||!g.update||!g.restart)return;let B,F;const re=()=>g.checkUpdate().then(({updateAvailable:fe,version:_e})=>{fe&&B===void 0&&(B=lr({persistent:!0,icon:"download",title:L.t("toast.update.title"),description:L.t("toast.update.description",{version:_e??""}),actions:[{label:L.t("toast.update.action.installRestart"),onClick:async()=>{await g.update(),await g.restart()}},{label:L.t("toast.update.action.notYet"),onClick:"dismiss"}]}))});he(()=>{if(y.ready()){if(!y.updates.startup()){if(F===void 0)return;clearInterval(F),F=void 0;return}F===void 0&&(re(),F=setInterval(re,600*1e3))}}),me(()=>{F!==void 0&&clearInterval(F)})}),en=()=>dn(()=>{const B=new Map,F=new Map,re=5e3,fe=ge=>{const je=B.get(ge);je!==void 0&&(Kh.dismiss(je),B.delete(ge),F.delete(ge))},_e=c.event.listen(ge=>{if(ge.details?.type==="worktree.ready"){Y(ge.name,!1),Jg.ready(ge.name);return}if(ge.details?.type==="worktree.failed"){Y(ge.name,!1),Jg.failed(ge.name,ge.details.properties?.message??L.t("common.requestFailed"));return}if(ge.details?.type==="question.replied"||ge.details?.type==="question.rejected"||ge.details?.type==="permission.replied"){const q0=ge.details.properties,jm=`${ge.name}:${q0.sessionID}`;fe(jm);return}if(ge.details?.type!=="permission.asked"&&ge.details?.type!=="question.asked")return;const je=ge.details.type==="permission.asked"?L.t("notification.permission.title"):L.t("notification.question.title"),Be=ge.details.type==="permission.asked"?"checklist":"bubble-5",Ye=ge.name,He=ge.details.properties;if(ge.details.type==="permission.asked"&&b.autoResponds(ge.details.properties,Ye))return;const[Ke]=u.child(Ye,{bootstrap:!1}),qt=Ke.session.find(q0=>q0.id===He.sessionID),nn=`${Ye}:${He.sessionID}`,Xt=qt?.title??L.t("command.session.new"),on=Gn(Ye),Rt=ge.details.type==="permission.asked"?L.t("notification.permission.description",{sessionTitle:Xt,projectName:on}):L.t("notification.question.description",{sessionTitle:Xt,projectName:on}),mt=`/${St(Ye)}/session/${He.sessionID}`,Ir=Date.now(),Do=F.get(nn)??0;if(Ir-Do<re)return;F.set(nn,Ir),ge.details.type==="permission.asked"&&(y.sounds.permissionsEnabled()&&iU(y.sounds.permissions()),y.notifications.permissions()&&g.notify(je,Rt,mt)),ge.details.type==="question.asked"&&y.notifications.agent()&&g.notify(je,Rt,mt);const yl=l.id;if(tt(Ye)===tt(E())&&He.sessionID===yl||tt(Ye)===tt(E())&&qt?.parentID===yl)return;fe(nn);const qm=lr({persistent:!0,icon:Be,title:je,description:Rt,actions:[{label:L.t("notification.action.goToSession"),onClick:()=>x(mt)},{label:L.t("common.dismiss"),onClick:"dismiss"}]});B.set(nn,qm)});me(_e),he(()=>{const ge=l.id;if(!E()||!ge)return;const je=`${E()}:${ge}`;fe(je);const[Be]=u.child(E(),{bootstrap:!1}),Ye=Be.session.filter(He=>He.parentID===ge);for(const He of Ye)fe(`${E()}:${He.id}`)})});Hn(),en();function tn(B,F){if(!a||T.scrollSessionKey===F)return;const re=a.querySelector(`[data-session-id="${B}"]`);if(!re)return;const fe=a.getBoundingClientRect(),_e=re.getBoundingClientRect();if(_e.top>=fe.top&&_e.bottom<=fe.bottom){R("scrollSessionKey",F);return}R("scrollSessionKey",F),re.scrollIntoView({block:"nearest",behavior:"smooth"})}const Vt=Z(()=>{const B=E();if(!B)return;const F=tt(B),re=h.projects.list(),fe=re.find(He=>He.sandboxes?.some(Ke=>tt(Ke)===F));if(fe)return fe;const _e=re.find(He=>tt(He.worktree)===F);if(_e)return _e;const[ge]=u.child(B,{bootstrap:!1}),je=ge.project;if(!je)return;const Ye=u.data.project.find(He=>He.id===je)?.worktree;if(Ye)return re.find(He=>He.worktree===Ye)}),[Ja]=Yr(async()=>{if(await r.promise,await h.ready.promise,!lt(()=>T.autoselect))return;const B=h.projects.list(),F=v.projects.last();if(B.length===0){if(!F)return;await We(F,!0)}else{const re=B.find(fe=>fe.worktree===F)??B[0];if(!re)return;await We(re.worktree,!0)}}),pa=(B,F,re)=>{const fe=tt(B),_e=t.workspaceName[fe]??t.workspaceName[B];if(_e)return _e;if(F&&re)return t.workspaceBranchName[F]?.[re]},Br=(B,F,re,fe)=>{const _e=tt(B);n("workspaceName",_e,F),re&&fe&&(t.workspaceBranchName[re]||n("workspaceBranchName",re,{}),n("workspaceBranchName",re,fe,F))},mr=(B,F,re)=>pa(B,re,F)??F??Gn(B),Ur=Z(()=>{const B=Vt();return!B||B.vcs!=="git"?!1:h.sidebar.workspaces(B.worktree)()}),fi=Z(()=>{const B=Vt();if(!B)return[];if(!Ur())return[B.worktree];const F=E();return Rm(B).filter(re=>{const fe=t.workspaceExpanded[re]??re===B.worktree,_e=tt(re)===tt(F);return fe||_e})});he(()=>{if(!i()||!m())return;const B=h.projects.list();for(const[F,re]of Object.entries(t.workspaceExpanded)){if(!re)continue;const fe=tt(F),_e=B.find(ge=>tt(ge.worktree)===fe||ge.sandboxes?.some(je=>tt(je)===fe));_e&&(_e.vcs==="git"&&h.sidebar.workspaces(_e.worktree)()||n("workspaceExpanded",F,!1))}});const An=Z(()=>{const B=Date.now(),F=fi();if(F.length===0)return[];const re=[];for(const fe of F){const[_e]=u.child(fe,{bootstrap:!0}),ge=F2(_e,B);re.push(...ge)}return re}),ma=200,hl=2,ue=10,xe=4,et={value:0},Dt=new Map,Sr=10,xi=new Map,fl=B=>{const F=xi.get(B);if(F)return F;const re=new Set;return xi.set(B,re),re},Vf=(B,F)=>{const re=fl(B);return qhe({seen:re,keep:F,limit:Sr,preserve:l.id&&tt(B)===tt(E())?[l.id]:void 0})};he(()=>{const B=new Set(fi());for(const F of[...xi.keys()])B.has(F)||xi.delete(F)}),he(()=>{I(),c.url,et.value+=1,kPt(),Dt.clear()}),he(()=>{const B=new Set(fi());for(const[F,re]of Dt)B.has(F)||(re.pending.length=0,re.pendingSet.clear(),re.running===0&&Dt.delete(F))});const mn=B=>{const F=Dt.get(B);if(F)return F;const re={inflight:new Set,pending:[],pendingSet:new Set,running:0};return Dt.set(B,re),re},_i=(B,F)=>{if(B.length===0)return F.slice().sort((fe,_e)=>fe.id<_e.id?-1:fe.id>_e.id?1:0);const re=new Map;for(const fe of B)re.set(fe.id,fe);for(const fe of F)re.set(fe.id,fe);return[...re.values()].sort((fe,_e)=>fe.id<_e.id?-1:fe.id>_e.id?1:0)};async function Bf(B,F,re){const[fe,_e]=u.child(B,{bootstrap:!1});return bPt({directory:B,sessionID:F,task:ge=>zn(()=>c.client.session.messages({directory:B,sessionID:F,limit:ma})).then(je=>{if(et.value!==re||!lee(B,F,ge))return;const Be=(je.data??[]).filter(Rt=>!!Rt?.info?.id),Ye=Be.map(Rt=>Rt.info).filter(Rt=>!!Rt?.id),He=_i([],Ye),Ke=Vf(B,F),qt=je.response.headers.get("x-next-cursor")??void 0,nn={limit:He.length,cursor:qt,complete:!qt,at:Date.now()};if(Ke.length>0){Ohe(B,Ke);for(const Rt of Ke)u.todo.set(Rt,void 0)}const Xt=fe.message[F]??[],on=_i(Xt.filter(Rt=>!!Rt?.id),He);if(lee(B,F,ge))return ct(()=>{Ke.length>0&&_e(Je(Rt=>{wj(Rt,Ke)})),_e("message",F,Ct(on,{key:"id"})),Dhe({directory:B,sessionID:F,...nn});for(const Rt of Be){const mt=fe.part[Rt.info.id]??[],Ir=_i(mt.filter(Do=>!!Do?.id),Rt.parts.filter(Do=>!!Do?.id));_e("part",Rt.info.id,Ct(Ir,{key:"id"}))}}),nn}).catch(()=>{})})}const Uf=B=>{const F=mn(B);if(F.running>=hl)return;const re=F.pending.shift();if(!re)return;F.pendingSet.delete(re),F.inflight.add(re),F.running+=1;const fe=et.value;Bf(B,re,fe).finally(()=>{F.running-=1,F.inflight.delete(re),Uf(B)})},ga=(B,F="low")=>{const re=B.directory;if(!re)return;const[fe]=u.child(re,{bootstrap:!1});if(lt(()=>{const Ye=VB(re,B.id);return yPt({message:fe.message[B.id]!==void 0,info:Ye,chunk:ma})}))return;const ge=mn(re);if(ge.inflight.has(B.id))return;if(ge.pendingSet.has(B.id)){if(F!=="high")return;const Ye=ge.pending.indexOf(B.id);Ye>0&&(ge.pending.splice(Ye,1),ge.pending.unshift(B.id));return}const je=fl(re);if(!(!je.has(B.id)&&je.size>=Sr&&F!=="high")){for(F==="high"&&ge.pending.unshift(B.id),F!=="high"&&ge.pending.push(B.id),ge.pendingSet.add(B.id);ge.pending.length>ue;){const Ye=ge.pending.pop();Ye&&ge.pendingSet.delete(Ye)}Uf(re)}},z0=(B,F)=>{for(let re=1;re<=xe;re++){const fe=B[F+re];fe&&ga(fe,re===1?"high":"low");const _e=B[F-re];_e&&ga(_e,re===1?"high":"low")}};he(()=>{const B=An();if(B.length===0)return;const F=l.id?B.findIndex(re=>re.id===l.id):0;if(F!==-1){if(!l.id){const re=B[F];re&&ga(re,"high")}z0(B,F)}});function Wf(B){const F=An();if(F.length===0)return;const re=l.id?F.findIndex(ge=>ge.id===l.id):-1;let fe;re===-1?fe=B>0?0:F.length-1:fe=(re+B+F.length)%F.length;const _e=F[fe];_e&&(ga(_e,"high"),z0(F,fe),Pm(_e))}function $m(B){const F=h.projects.list();if(F.length===0)return;const re=Vt()?.worktree,fe=E()?ml(E()):void 0,_e=re??fe,ge=_e?F.findIndex(Be=>Be.worktree===_e):-1,je=ge===-1?B>0?F[0]:F[F.length-1]:F[(ge+B+F.length)%F.length];je&&(u.child(je.worktree),We(je.worktree))}function Mi(B){const F=An();if(F.length===0||!F.some(ge=>k.session.unseenCount(ge.id)>0))return;const fe=l.id?F.findIndex(ge=>ge.id===l.id):-1,_e=fe===-1?B>0?-1:0:fe;for(let ge=1;ge<=F.length;ge++){const je=B>0?(_e+ge)%F.length:(_e-ge+F.length)%F.length,Be=F[je];if(Be&&k.session.unseenCount(Be.id)!==0){ga(Be,"high"),z0(F,je),Pm(Be);return}}}async function ya(B){const[F,re]=u.child(B.directory),fe=F.session??[],_e=fe.findIndex(je=>je.id===B.id),ge=fe[_e+1]??fe[_e-1];await c.client.session.update({directory:B.directory,sessionID:B.id,time:{archived:Date.now()}}),re(Je(je=>{const Be=rn.search(je.session,B.id,Ye=>Ye.id);Be.found&&je.session.splice(Be.index,1)})),B.id===l.id&&x(ge?`/${l.dir}/session/${ge.id}`:`/${l.dir}/session`)}_.register("layout",()=>{const B=[{id:"sidebar.toggle",title:L.t("command.sidebar.toggle"),category:L.t("command.category.view"),keybind:"mod+b",onSelect:()=>h.sidebar.toggle()},{id:"project.open",title:L.t("command.project.open"),category:L.t("command.category.project"),keybind:"mod+o",onSelect:()=>rr()},{id:"project.previous",title:L.t("command.project.previous"),category:L.t("command.category.project"),keybind:"mod+alt+arrowup",onSelect:()=>$m(-1)},{id:"project.next",title:L.t("command.project.next"),category:L.t("command.category.project"),keybind:"mod+alt+arrowdown",onSelect:()=>$m(1)},{id:"provider.connect",title:L.t("command.provider.connect"),category:L.t("command.category.provider"),onSelect:()=>Gf()},{id:"server.switch",title:L.t("command.server.switch"),category:L.t("command.category.server"),onSelect:()=>Tm()},{id:"settings.open",title:L.t("command.settings.open"),category:L.t("command.category.settings"),keybind:"mod+shift+,",onSelect:()=>pl()},{id:"settings.shortcuts",title:L.t("command.settings.shortcuts"),category:L.t("command.category.settings"),keybind:"mod+shift+k",onSelect:()=>{const F=++o;z(()=>import("./dialog-settings-Wsa2poSm.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107])).then(re=>{s||o!==F||M.show(()=>d(re.DialogSettings,{tab:"shortcuts"}))})}},{id:"session.previous",title:L.t("command.session.previous"),category:L.t("command.category.session"),keybind:"mod+,",onSelect:()=>Wf(-1)},{id:"session.next",title:L.t("command.session.next"),category:L.t("command.category.session"),keybind:"mod+.",onSelect:()=>Wf(1)},{id:"view.toggleMinimap",title:L.t("command.view.toggleMinimap"),category:L.t("command.category.view"),keybind:"mod+shift+m,mod+alt+m",onSelect:()=>n("minimapVisible",F=>!F)},{id:"view.toggleMaximizedPanel",title:L.t("command.view.toggleMaximizedPanel"),category:L.t("command.category.view"),keybind:"ctrl+tab",onSelect:()=>n("panelMaximized",F=>!F)},{id:"view.toggleActivityBar",title:L.t("command.view.toggleActivityBar"),category:L.t("command.category.view"),keybind:"mod+shift+b",onSelect:()=>n("activityBarVisible",F=>!F)},{id:"view.toggleStatusBar",title:L.t("command.view.toggleStatusBar"),category:L.t("command.category.view"),keybind:"ctrl+mod+s",onSelect:()=>n("statusBarVisible",F=>!F)},{id:"view.moveSidebarLeft",title:L.t("command.view.moveSidebarLeft"),category:L.t("command.category.view"),keybind:"ctrl+shift+alt+left",onSelect:()=>{}},{id:"view.moveSidebarRight",title:L.t("command.view.moveSidebarRight"),category:L.t("command.category.view"),keybind:"ctrl+shift+alt+right",onSelect:()=>{}},{id:"view.alignPanelCenter",title:L.t("command.view.alignPanelCenter"),category:L.t("command.category.view"),keybind:"ctrl+shift+down",onSelect:()=>n("panelAlignment","center")},{id:"view.positionPanelBottom",title:L.t("command.view.positionPanelBottom"),category:L.t("command.category.view"),keybind:"ctrl+shift+down",onSelect:()=>n("panelPosition","bottom")},{id:"view.positionPanelRight",title:L.t("command.view.positionPanelRight"),category:L.t("command.category.view"),keybind:"ctrl+shift+right",onSelect:()=>n("panelPosition","right")},{id:"view.positionPanelLeft",title:L.t("command.view.positionPanelLeft"),category:L.t("command.category.view"),keybind:"ctrl+shift+left",onSelect:()=>n("panelPosition","left")},{id:"app.quit",title:L.t("command.app.quit"),category:L.t("command.category.app"),keybind:"mod+alt+q",onSelect:()=>{}},{id:"app.reload",title:L.t("command.app.reload"),category:L.t("command.category.app"),keybind:"mod+shift+alt+r",onSelect:()=>window.location.reload()},{id:"app.restart",title:L.t("command.app.restart"),category:L.t("command.category.app"),keybind:"mod+shift+r",onSelect:()=>{g.restart?.()}},{id:"theme.select",title:L.t("command.theme.select"),category:L.t("command.category.theme"),keybind:"alt+t",onSelect:()=>{}},{id:"theme.toggleLightDark",title:L.t("command.theme.toggleLightDark"),category:L.t("command.category.theme"),keybind:"mod+shift+alt+t",onSelect:()=>jn(1)},{id:"editor.fontZoomIn",title:L.t("command.editor.fontZoomIn"),category:L.t("command.category.editor"),keybind:"mod+alt+=",onSelect:()=>hi(1)},{id:"editor.fontZoomOut",title:L.t("command.editor.fontZoomOut"),category:L.t("command.category.editor"),keybind:"mod+alt+-",onSelect:()=>hi(-1)},{id:"editor.fontZoomReset",title:L.t("command.editor.fontZoomReset"),category:L.t("command.category.editor"),keybind:"alt+0",onSelect:()=>yn()},{id:"terminal.fontZoomIn",title:L.t("command.terminal.fontZoomIn"),category:L.t("command.category.terminal"),keybind:"mod+ctrl+alt+=",onSelect:()=>hi(1)},{id:"terminal.fontZoomOut",title:L.t("command.terminal.fontZoomOut"),category:L.t("command.category.terminal"),keybind:"mod+ctrl+alt+-",onSelect:()=>hi(-1)},{id:"session.previous.unseen",title:L.t("command.session.previous.unseen"),category:L.t("command.category.session"),keybind:"shift+alt+arrowup",onSelect:()=>Mi(-1)},{id:"session.next.unseen",title:L.t("command.session.next.unseen"),category:L.t("command.category.session"),keybind:"shift+alt+arrowdown",onSelect:()=>Mi(1)},{id:"session.archive",title:L.t("command.session.archive"),category:L.t("command.category.session"),keybind:"mod+shift+backspace",disabled:!l.dir||!l.id,onSelect:()=>{const F=An().find(re=>re.id===l.id);F&&ya(F)}},{id:"workspace.new",title:L.t("workspace.new"),category:L.t("command.category.workspace"),keybind:"mod+shift+w",disabled:!Ur(),onSelect:()=>{const F=Vt();if(F)return aX(F)}},{id:"workspace.toggle",title:L.t("command.workspace.toggle"),description:L.t("command.workspace.toggle.description"),category:L.t("command.category.workspace"),slash:"workspace",disabled:!Vt()||Vt()?.vcs!=="git",onSelect:()=>{const F=Vt();if(!F||F.vcs!=="git")return;const re=h.sidebar.workspaces(F.worktree)();h.sidebar.toggleWorkspaces(F.worktree),lr({title:re?L.t("toast.workspace.disabled.title"):L.t("toast.workspace.enabled.title"),description:re?L.t("toast.workspace.disabled.description"):L.t("toast.workspace.enabled.description")})}},{id:"theme.cycle",title:L.t("command.theme.cycle"),category:L.t("command.category.theme"),keybind:"mod+shift+t",onSelect:()=>Nt(1)}];for(const[F]of A())B.push({id:`theme.set.${F}`,title:L.t("command.theme.set",{theme:C.name(F)}),category:L.t("command.category.theme"),onSelect:()=>C.commitPreview(),onHighlight:()=>(C.previewTheme(F),()=>C.cancelPreview())});B.push({id:"theme.scheme.cycle",title:L.t("command.theme.scheme.cycle"),category:L.t("command.category.theme"),keybind:"mod+shift+s",onSelect:()=>jn(1)});for(const F of D)B.push({id:`theme.scheme.${F}`,title:L.t("command.theme.scheme.set",{scheme:O(F)}),category:L.t("command.category.theme"),onSelect:()=>C.commitPreview(),onHighlight:()=>(C.previewColorScheme(F),()=>C.cancelPreview())});B.push({id:"language.cycle",title:L.t("command.language.cycle"),category:L.t("command.category.language"),onSelect:()=>Mr(1)});for(const F of L.locales)B.push({id:`language.set.${F}`,title:L.t("command.language.set",{language:L.label(F)}),category:L.t("command.category.language"),onSelect:()=>ui(F)});return B});function Gf(){const B=++o;z(()=>import("./dialog-select-provider-Da3OoYdK.js").then(F=>F.d),__vite__mapDeps([107,105,102,106,104])).then(F=>{s||o!==B||M.show(()=>d(F.DialogSelectProvider,{}))})}function Tm(){const B=++o;z(()=>import("./dialog-select-server-UCc0uaGh.js"),__vite__mapDeps([108,105,102,109])).then(F=>{s||o!==B||M.show(()=>d(F.DialogSelectServer,{}))})}function pl(){const B=++o;z(()=>import("./dialog-settings-Wsa2poSm.js"),__vite__mapDeps([99,100,101,102,103,104,105,106,107])).then(F=>{s||o!==B||M.show(()=>d(F.DialogSettings,{}))})}function ml(B){const F=tt(B),re=h.projects.list().find(Be=>tt(Be.worktree)===F||Be.sandboxes?.some(Ye=>tt(Ye)===F));if(re)return re.worktree;const fe=Object.entries(t.workspaceOrder).find(([Be,Ye])=>tt(Be)===F||Ye.some(He=>tt(He)===F));if(fe)return fe[0];const[_e]=u.child(B,{bootstrap:!1}),ge=_e.project;return ge?u.data.project.find(Be=>Be.id===ge)?.worktree??B:B}function Bi(B){return Vt()?.worktree??ml(B)}function Zf(B,F,re=Bi(B)){return n("lastProjectSession",re,{directory:B,id:F,at:Date.now()}),re}function Kf(B){t.lastProjectSession[B]&&n("lastProjectSession",Je(F=>{delete F[B]}))}function Em(B,F,re=Bi(B)){return Zf(B,F,re),k.session.markViewed(F),lt(()=>t.workspaceExpanded[B])===!1&&n("workspaceExpanded",B,!0),requestAnimationFrame(()=>tn(F,`${B}:${F}`)),re}async function gl(B){if(!B)return;const F=ml(B);v.projects.touch(F);const re=h.projects.list().find(Ke=>Ke.worktree===F);let fe=re?Qg(F,[F,...re.sandboxes??[]],t.workspaceOrder[F]):[F];const _e=Ke=>Ke?fe.some(qt=>tt(qt)===tt(Ke)):!1,ge=async Ke=>{if(!Ke||Ke===F||_e(Ke))return _e(Ke);const qt=await c.client.worktree.list({directory:F}).then(nn=>nn.data??[]).catch(()=>[]);return fe=Qg(F,[F,...qt],t.workspaceOrder[F]),_e(Ke)},je=async Ke=>{if(!_e(Ke.directory))return!1;const[qt]=u.child(Ke.directory,{bootstrap:!1});if(qt.session.some(Xt=>Xt.id===Ke.id))return n("lastProjectSession",F,{directory:Ke.directory,id:Ke.id,at:Date.now()}),De(`/${St(Ke.directory)}/session/${Ke.id}`),!0;const nn=await c.client.session.get({sessionID:Ke.id}).then(Xt=>Xt.data).catch(()=>{});return!nn?.directory||!_e(nn.directory)?!1:(n("lastProjectSession",F,{directory:nn.directory,id:nn.id,at:Date.now()}),De(`/${St(nn.directory)}/session/${nn.id}`),!0)},Be=t.lastProjectSession[F];if(Be?.id){if(await ge(Be.directory),await je(Be))return;Kf(F)}const Ye=Ene(fe.map(Ke=>u.child(Ke,{bootstrap:!1})[0]),Date.now());if(Ye&&await je(Ye))return;const He=Ene(await Promise.all(fe.map(async Ke=>({path:{directory:Ke},session:await c.client.session.list({directory:Ke}).then(qt=>qt.data??[]).catch(()=>[])}))),Date.now());He&&await je(He)||De(`/${St(F)}/session`)}function Pm(B){B&&De(`/${St(B.directory)}/session/${B.id}`)}function We(B,F=!0){if(h.projects.open(B),F)return gl(B)}const te=B=>{if(v.isLocal()){for(const F of yKt(B))We(F);for(const F of vKt(B)){We(F.directory,!1);const re=St(F.directory);F.prompt&&GZt(re,{prompt:F.prompt});const fe=F.prompt?`/${re}/session?prompt=${encodeURIComponent(F.prompt)}`:`/${re}/session`;De(fe)}}};dn(()=>{const B=F=>{const fe=F.detail?.urls??[];fe.length!==0&&te(fe)};te(kKt(window)),window.addEventListener(Pne,B),me(()=>window.removeEventListener(Pne,B))});async function Ne(B,F){const re=QK(B);if(F===re)return;const fe=F===Gn(B.worktree)?"":F;if(B.id&&B.id!=="global"){await c.client.project.update({projectID:B.id,directory:B.worktree,name:fe});return}u.project.meta(B.worktree,{name:fe})}const Ge=(B,F,re,fe)=>{(pa(B,re,fe)??fe??Gn(B))!==F&&Br(B,F,re,fe)};function an(B){const F=h.projects.list(),re=tt(B),fe=F.findIndex(je=>tt(je.worktree)===re),_e=tt(Vt()?.worktree??"")===re;if(fe===-1)return;const ge=F[fe+1];if(!_e){h.projects.close(B);return}if(!ge){h.projects.close(B),x("/");return}De(`/${St(ge.worktree)}/session`),h.projects.close(B),queueMicrotask(()=>{gl(ge.worktree)})}function nr(B){if(h.sidebar.workspaces(B.worktree)()){h.sidebar.toggleWorkspaces(B.worktree);return}B.vcs==="git"&&h.sidebar.toggleWorkspaces(B.worktree)}const wn=B=>{const F=++o;z(()=>import("./dialog-edit-project-B91zPs73.js"),[]).then(re=>{s||o!==F||M.show(()=>d(re.DialogEditProject,{project:B}))})};async function rr(){function B(F){if(Array.isArray(F)){for(const re of F)We(re,!1);gl(F[0])}else F&&We(F)}if(g.openDirectoryPickerDialog&&v.isLocal()){const F=await g.openDirectoryPickerDialog?.({title:L.t("command.project.open"),multiple:!0});B(F)}else{const F=++o;z(()=>import("./dialog-select-directory-CuuUL7us.js"),__vite__mapDeps([110,111,105,102])).then(re=>{s||o!==F||M.show(()=>d(re.DialogSelectDirectory,{multiple:!0,onSelect:B}),()=>B(null))})}}const va=async(B,F,re=!1)=>{if(F===B)return;const fe=E(),_e=tt(fe),ge=tt(F),je=re||!!l.dir&&_e===ge;!re&&je&&De(`/${St(B)}/session`),Y(F,!0);const Be=await c.client.worktree.remove({directory:B,worktreeRemoveInput:{directory:F}}).then(Xt=>Xt.data).catch(Xt=>(lr({title:L.t("workspace.delete.failed.title"),description:aV(Xt,L.t("common.requestFailed"))}),!1));if(Y(F,!1),!Be||(tt(t.lastProjectSession[B]?.directory??"")===tt(F)&&Kf(B),u.set("project",Je(Xt=>{const on=Xt.find(Rt=>Rt.worktree===B);on&&(on.sandboxes=(on.sandboxes??[]).filter(Rt=>Rt!==F))})),n("workspaceOrder",B,Xt=>(Xt??[]).filter(on=>on!==F)),h.projects.close(F),h.projects.open(B),je))return;const Ye=E(),He=tt(Ye),Ke=h.projects.list().find(Xt=>Xt.worktree===B),nn=(Ke?Qg(B,[B,...Ke.sandboxes??[]],t.workspaceOrder[B]):[B]).some(Xt=>tt(Xt)===He);l.dir&&ml(Ye)===B&&!nn&&De(`/${St(B)}/session`)},ks=async(B,F)=>{if(F===B)return;Y(F,!0);const re=lr({persistent:!0,title:L.t("workspace.resetting.title"),description:L.t("workspace.resetting.description")}),fe=()=>Kh.dismiss(re),_e=await c.client.session.list({directory:F}).then(Be=>Be.data??[]).catch(()=>[]);if(Xzt(F,_e.map(Be=>Be.id),g),await c.client.instance.dispose({directory:F}).catch(()=>{}),!await c.client.worktree.reset({directory:B,worktreeResetInput:{directory:F}}).then(Be=>Be.data).catch(Be=>(lr({title:L.t("workspace.reset.failed.title"),description:aV(Be,L.t("common.requestFailed"))}),!1))){Y(F,!1),fe();return}const je=Date.now();await Promise.all(_e.filter(Be=>Be.time.archived===void 0).map(Be=>c.client.session.update({sessionID:Be.id,directory:Be.directory,time:{archived:je}}).catch(()=>{}))),Y(F,!1),fe(),lr({title:L.t("workspace.reset.success.title"),description:L.t("workspace.reset.success.description"),actions:[{label:L.t("command.session.new"),onClick:()=>{const Be=`/${St(F)}/session?new=1`;x(Be),h.mobileSidebar.hide()}},{label:L.t("common.dismiss"),onClick:"dismiss"}]})};function Xf(B){const F=Z(()=>Gn(B.directory)),[re,fe]=nt({status:"loading",dirty:!1});dn(()=>{c.client.file.status({directory:B.directory}).then(je=>{const Ye=(je.data??[]).length>0;fe({status:"ready",dirty:Ye})}).catch(()=>{fe({status:"error",dirty:!1})})});const _e=()=>{const je=!!l.dir&&tt(E())===tt(B.directory);je&&De(`/${St(B.root)}/session`),M.close(),va(B.root,B.directory,je)},ge=()=>re.status==="loading"?L.t("workspace.status.checking"):re.status==="error"?L.t("workspace.status.error"):re.dirty?L.t("workspace.status.dirty"):L.t("workspace.status.clean");return d(jz,{get title(){return L.t("workspace.delete.title")},fit:!0,get children(){var je=cYt(),Be=je.firstChild,Ye=Be.firstChild,He=Ye.nextSibling,Ke=Be.nextSibling;return K(Ye,()=>L.t("workspace.delete.confirm",{name:F()})),K(He,ge),K(Ke,d(Mn,{variant:"ghost",size:"large",onClick:()=>M.close(),get children(){return L.t("common.cancel")}}),null),K(Ke,d(Mn,{variant:"primary",size:"large",get disabled(){return re.status==="loading"},onClick:_e,get children(){return L.t("workspace.delete.button")}}),null),je}})}function ir(B){const F=Z(()=>Gn(B.directory)),[re,fe]=nt({status:"loading",dirty:!1,sessions:[]}),_e=async()=>{const Ke=(await c.client.session.list({directory:B.directory}).then(qt=>qt.data??[]).catch(()=>[])).filter(qt=>qt.time.archived===void 0);fe({sessions:Ke})};dn(()=>{c.client.file.status({directory:B.directory}).then(He=>{const qt=(He.data??[]).length>0;fe({status:"ready",dirty:qt}),_e()}).catch(()=>{fe({status:"error",dirty:!1})})});const ge=()=>{M.close(),ks(B.root,B.directory)},je=()=>re.sessions.length,Be=()=>re.status==="loading"?L.t("workspace.status.checking"):re.status==="error"?L.t("workspace.status.error"):re.dirty?L.t("workspace.status.dirty"):L.t("workspace.status.clean"),Ye=()=>{const He=je();return He===0?L.t("workspace.reset.archived.none"):He===1?L.t("workspace.reset.archived.one"):L.t("workspace.reset.archived.many",{count:He})};return d(jz,{get title(){return L.t("workspace.reset.title")},fit:!0,get children(){var He=dYt(),Ke=He.firstChild,qt=Ke.firstChild,nn=qt.nextSibling,Xt=nn.firstChild,on=Xt.nextSibling;on.nextSibling;var Rt=Ke.nextSibling;return K(qt,()=>L.t("workspace.reset.confirm",{name:F()})),K(nn,Be,Xt),K(nn,Ye,on),K(nn,()=>L.t("workspace.reset.note"),null),K(Rt,d(Mn,{variant:"ghost",size:"large",onClick:()=>M.close(),get children(){return L.t("common.cancel")}}),null),K(Rt,d(Mn,{variant:"primary",size:"large",get disabled(){return re.status==="loading"},onClick:ge,get children(){return L.t("workspace.reset.button")}}),null),He}})}const Fn={session:"",sessionProject:"",directory:""};he(vn(()=>[i(),I().slug,l.id,Vt()?.worktree,E()],([B,F,re,fe,_e])=>{if(!B||!F||!_e){Fn.session="",Fn.sessionProject="",Fn.directory="";return}if(!re){Fn.session="",Fn.sessionProject="",Fn.directory="";return}const ge=`${F}/${re}`;if(!fe){Fn.session=ge,Fn.directory=_e,Fn.sessionProject="";return}if(v.projects.last()!==fe&&v.projects.touch(fe),ge!==Fn.session||_e!==Fn.directory){Fn.session=ge,Fn.directory=_e,Fn.sessionProject=Em(_e,re,fe);return}fe!==Fn.sessionProject&&(Fn.directory=_e,Fn.sessionProject=Zf(_e,re,fe))})),he(()=>{const B=h.sidebar.opened()?h.sidebar.width():48;document.documentElement.style.setProperty("--dialog-left-margin",`${B}px`)});const Dm=Z(()=>Math.max(h.sidebar.width(),244)),vge=Z(()=>Math.max(Dm()-64,0)),Om=new Set;he(vn(fi,B=>{if(B.length===0){Om.clear();return}const F=new Set(B);for(const re of F)Om.has(re)||u.project.loadSessions(re);Om.clear();for(const re of F)Om.add(re)},{defer:!0}));function kge(B){const F=tq(B);F&&(ye(void 0),n("activeProject",F))}function bge(B){const{draggable:F,droppable:re}=B;if(F&&re){const fe=h.projects.list(),_e=fe.findIndex(je=>je.worktree===F.id.toString()),ge=fe.findIndex(je=>je.worktree===re.id.toString());_e!==ge&&ge!==-1&&h.projects.move(F.id.toString(),ge)}}function wge(){n("activeProject",void 0)}function Rm(B){if(!B)return[];const F=B.worktree,re=[F,...B.sandboxes??[]],fe=Vt(),_e=tt(fe?.worktree??"")===tt(B.worktree)?E():void 0,ge=_e&&tt(_e)!==tt(F)&&!re.some(Ye=>tt(Ye)===tt(_e))?_e:void 0,je=ge?Jg.get(ge)?.status==="pending":!1,Be=Qg(F,re,t.workspaceOrder[B.worktree]);return je&&ge?[F,ge,...Be.filter(Ye=>Ye!==F)]:!ge||je?Be:[...Be,ge]}const iX=Z(()=>{if(h.sidebar.opened())return Vt();const B=Re();return B||Vt()});function xge(B){const F=tq(B);F&&n("activeWorkspace",F)}function _ge(B){const{draggable:F,droppable:re}=B;if(!F||!re)return;const fe=iX();if(!fe)return;const _e=Rm(fe),ge=_e.findIndex(He=>He===F.id.toString()),je=_e.findIndex(He=>He===re.id.toString());if(ge===-1||je===-1||ge===je)return;const Be=_e.slice(),[Ye]=Be.splice(ge,1);Ye&&(Be.splice(je,0,Ye),n("workspaceOrder",fe.worktree,Be.filter(He=>tt(He)!==tt(fe.worktree))))}function Mge(){n("activeWorkspace",void 0)}const aX=async B=>{At();const F=await c.client.worktree.create({directory:B.worktree}).then(ge=>ge.data).catch(ge=>{lr({title:L.t("workspace.create.failed.title"),description:aV(ge,L.t("common.requestFailed"))})});if(!F?.directory)return;Br(F.directory,F.branch,B.id,F.branch);const re=B.worktree,fe=tt(F.directory),_e=tt(re);Y(F.directory,!0),Jg.pending(F.directory),n("workspaceExpanded",fe,!0),fe!==F.directory&&n("workspaceExpanded",F.directory,!0),n("workspaceOrder",B.worktree,ge=>{const Be=(ge??[]).filter(Ye=>{const He=tt(Ye);return He!==_e&&He!==fe});return[F.directory,...Be]}),u.child(F.directory),De(`/${St(F.directory)}/session`)},oX={currentDir:E,navList:An,sidebarExpanded:de,sidebarHovering:oe,nav:()=>T.nav,hoverSession:()=>T.hoverSession,setHoverSession:le,clearHoverProjectSoon:ve,prefetchSession:ga,archiveSession:ya,workspaceName:pa,renameWorkspace:Ge,editorOpen:wt,openEditor:Ue,closeEditor:V,setEditor:Fe,InlineEditor:ze,isBusy:j,workspaceExpanded:(B,F)=>t.workspaceExpanded[B]??F,setWorkspaceExpanded:(B,F)=>n("workspaceExpanded",B,F),showResetWorkspaceDialog:(B,F)=>M.show(()=>d(ir,{root:B,directory:F})),showDeleteWorkspaceDialog:(B,F)=>M.show(()=>d(Xf,{root:B,directory:F})),setScrollContainerRef:(B,F)=>{F||(a=B)}},Sge={currentDir:E,currentProject:Vt,sidebarOpened:()=>h.sidebar.opened(),sidebarHovering:oe,hoverProject:()=>T.hoverProject,nav:()=>T.nav,onProjectMouseEnter:(B,F)=>J.enter(B,F),onProjectMouseLeave:B=>J.leave(B),onProjectFocus:B=>J.activate(B),onHoverOpenChanged:(B,F)=>{!F&&T.hoverProject&&T.hoverProject!==B||R("hoverProject",F?B:void 0)},navigateToProject:gl,openSidebar:()=>h.sidebar.open(),closeProject:an,showEditProjectDialog:wn,toggleProjectWorkspaces:nr,workspacesEnabled:B=>B.vcs==="git"&&h.sidebar.workspaces(B.worktree)(),workspaceIds:Rm,workspaceLabel:mr,sessionProps:{navList:An,sidebarExpanded:de,sidebarHovering:oe,nav:()=>T.nav,hoverSession:()=>T.hoverSession,setHoverSession:le,clearHoverProjectSoon:ve,prefetchSession:ga,archiveSession:ya},setHoverSession:le},Cge=B=>{const F=B.project,re=Z(()=>B.mobile||(B.merged??h.sidebar.opened())),fe=Z(()=>!B.mobile&&B.merged===!1&&!h.sidebar.opened()),_e=Z(()=>!!B.mobile||B.merged===!1||h.sidebar.opened()),ge=Z(()=>!l.dir&&h.projects.list().length===0),je=Z(()=>{const mt=F();return mt?mt.name||Gn(mt.worktree):""}),Be=Z(()=>F()?.id??""),Ye=Z(()=>F()?.worktree??""),He=Z(()=>{const mt=Ye();return mt?St(mt):""}),Ke=Z(()=>{const mt=F();return mt?Rm(mt):[]}),qt=Z(()=>Ke().reduce((mt,Ir)=>mt+k.project.unseenCount(Ir),0)),nn=()=>Ke().filter(mt=>k.project.unseenCount(mt)>0).forEach(mt=>k.project.markViewed(mt)),Xt=Z(()=>{const mt=F();return!mt||mt.vcs!=="git"?!1:h.sidebar.workspaces(mt.worktree)()}),on=Z(()=>{const mt=F();return mt?mt.vcs==="git"||h.sidebar.workspaces(mt.worktree)():!1}),Rt=Z(()=>u.data.path.home);return(()=>{var mt=mYt(),Ir=mt.firstChild,Do=Ir.firstChild,yl=Do.firstChild,qm=yl.firstChild,q0=qm.firstChild,jm=q0.nextSibling,Age=jm.nextSibling,lX=qm.nextSibling;return K(mt,d(ke,{get when(){return F()},get fallback(){return d(ke,{get when(){return ge()},get children(){var Nr=gYt(),ar=Nr.firstChild,Ar=ar.firstChild,xn=Ar.firstChild,Hm=xn.nextSibling;return K(xn,()=>L.t("sidebar.empty.title")),K(Hm,()=>L.t("sidebar.empty.description")),K(ar,d(Mn,{size:"large",icon:"folder-add-left",onClick:rr,get children(){return L.t("command.project.open")}}),null),Nr}})},get children(){return[(()=>{var Nr=hYt(),ar=Nr.firstChild,Ar=ar.firstChild;return K(Ar,d(ze,{get id(){return`project:${Be()}`},value:je,onSave:xn=>{const Hm=F();Hm&&Ne(Hm,xn)},class:"text-14-medium text-text-strong truncate",displayClass:"text-14-medium text-text-strong truncate",stopPropagation:!0}),null),K(Ar,d(Ua,{placement:"bottom",gutter:2,get value(){return Ye()},class:"shrink-0",contentStyle:{"max-width":"640px",transform:"translate3d(52px, 0, 0)"},get children(){var xn=uYt();return K(xn,()=>Ye().replace(Rt(),"~")),xn}}),null),K(ar,d(Mt,{get modal(){return!oe()},get children(){return[d(Mt.Trigger,{as:Cr,icon:"dot-grid",variant:"ghost","data-action":"project-menu",get"data-project"(){return He()},class:"shrink-0 size-6 rounded-md transition-opacity data-[expanded]:bg-surface-base-active",get classList(){return{"opacity-100":B.mobile||re(),"opacity-0 group-hover/project:opacity-100 group-focus-within/project:opacity-100 data-[expanded]:opacity-100":!B.mobile&&!re()}},get"aria-label"(){return L.t("common.moreOptions")}}),d(Mt.Portal,{get children(){return d(Mt.Content,{class:"mt-1",get children(){return[d(Mt.Item,{onSelect:()=>{const xn=F();xn&&wn(xn)},get children(){return d(Mt.ItemLabel,{get children(){return L.t("common.edit")}})}}),d(Mt.Item,{"data-action":"project-workspaces-toggle",get"data-project"(){return He()},get disabled(){return!on()},onSelect:()=>{const xn=F();xn&&nr(xn)},get children(){return d(Mt.ItemLabel,{get children(){return bt(()=>!!Xt())()?L.t("sidebar.workspaces.disable"):L.t("sidebar.workspaces.enable")}})}}),d(Mt.Item,{"data-action":"project-clear-notifications",get"data-project"(){return He()},get disabled(){return qt()===0},onSelect:nn,get children(){return d(Mt.ItemLabel,{get children(){return L.t("sidebar.project.clearNotifications")}})}}),d(Mt.Separator,{}),d(Mt.Item,{"data-action":"project-close-menu",get"data-project"(){return He()},onSelect:()=>{const xn=Ye();xn&&an(xn)},get children(){return d(Mt.ItemLabel,{get children(){return L.t("common.close")}})}})]}})}})]}}),null),Nr})(),d(Sme,{onDragStart:xge,onDragEnd:Mge,onDragOver:_ge,collisionDetector:_me,get children(){return[d(Cme,{}),d(Eme,{}),(()=>{var Nr=pYt();return K(Nr,d(ke,{get when(){return Xt()},get fallback(){return[(()=>{var ar=zne();return K(ar,d(Mn,{variant:"secondary",size:"large",icon:"new-session",class:"w-full",onClick:()=>{const Ar=Ye();Ar&&De(`/${St(Ar)}/session?new=1`)},get children(){return L.t("command.session.new")}})),ar})(),(()=>{var ar=yYt();return K(ar,d(IXt,{ctx:oX,get project(){return F()},sortNow:X,get mobile(){return B.mobile},get popover(){return _e()}})),ar})()]},get children(){return[(()=>{var ar=zne();return K(ar,d(Mn,{size:"large",icon:"plus-small",class:"w-full",onClick:()=>{const Ar=F();Ar&&aX(Ar)},get children(){return L.t("workspace.new")}})),ar})(),(()=>{var ar=fYt(),Ar=ar.firstChild;return Hr(xn=>{B.mobile||(a=xn)},Ar),K(Ar,d(Nme,{get ids(){return Ke()},get children(){return d(Qt,{get each(){return Ke()},children:xn=>d(LXt,{ctx:oX,directory:xn,get project(){return F()},sortNow:X,get mobile(){return B.mobile},get popover(){return _e()}})})}})),ar})()]}})),Nr})(),d(Lme,{get children(){return d(MXt,{sidebarProject:iX,activeWorkspace:()=>t.activeWorkspace,workspaceLabel:mr})}})]}})]}}),Ir),K(q0,()=>L.t("sidebar.gettingStarted.title")),K(jm,()=>L.t("sidebar.gettingStarted.line1")),K(Age,()=>L.t("sidebar.gettingStarted.line2")),K(lX,d(Mn,{size:"large",icon:"plus-small",onClick:Gf,get children(){return L.t("command.provider.connect")}}),null),K(lX,d(Mn,{size:"large",variant:"ghost",onClick:()=>n("gettingStartedDismissed",!0),get children(){return L.t("toast.update.action.notYet")}}),null),Qe(Nr=>{var ar={"flex flex-col min-h-0 min-w-0 box-border rounded-tl-[12px] px-3":!0,"border border-b-0 border-border-weak-base":!re(),"border-l border-t border-border-weaker-base":re(),"bg-background-base":re()||fe(),"bg-background-stronger":!re()&&!fe(),"flex-1 min-w-0":B.mobile,"max-w-full overflow-hidden":B.mobile},Ar=B.mobile?void 0:`${vge()}px`,xn=!!(t.gettingStartedDismissed||!(w.all().length>0&&w.paid().length===0));return Nr.e=hr(mt,ar,Nr.e),Ar!==Nr.t&&kr(mt,"width",Nr.t=Ar),xn!==Nr.a&&Ir.classList.toggle("hidden",Nr.a=xn),Nr},{e:void 0,t:void 0,a:void 0}),mt})()},sX=()=>h.projects.list(),Lge=()=>d(eYt,{projects:sX,activeProject:()=>t.activeProject}),Ige=B=>d(lYt,{mobile:B,opened:()=>h.sidebar.opened(),get aimMove(){return J.move},projects:sX,renderProject:F=>d(rYt,{ctx:Sge,project:F,sortNow:X,mobile:B}),handleDragStart:kge,handleDragEnd:wge,handleDragOver:bge,get openProjectLabel(){return L.t("command.project.open")},openProjectKeybind:()=>_.keybind("project.open"),onOpenProject:rr,renderProjectOverlay:Lge,settingsLabel:()=>L.t("sidebar.settings"),settingsKeybind:()=>_.keybind("settings.open"),onOpenSettings:pl,helpLabel:()=>L.t("sidebar.help"),onOpenHelp:()=>g.openLink("https://opencode.ai/desktop-feedback"),renderPanel:()=>d(Cge,{project:Vt,mobile:!0})});let zm;const Nge=bf();return he(()=>{Nge.pathname,zm&&requestAnimationFrame(()=>{O2e(zm,{opacity:[0,1],y:[4,0]},{type:"spring",stiffness:400,damping:30})})}),d(lqt,{get children(){var B=kYt(),F=B.firstChild,re=F.firstChild,fe=re.firstChild,_e=fe.firstChild,ge=_e.firstChild,je=ge.nextSibling,Be=_e.nextSibling,Ye=Be.firstChild;return K(B,d(hKt,{}),F),K(F,d(ke,{get when(){return t.activityBarVisible},get children(){var He=vYt(),Ke=He.firstChild,qt=Ke.firstChild,nn=Ke.nextSibling,Xt=nn.firstChild;return K(Ke,d(Qt,{get each(){return h.projects.list()},children:on=>{const Rt=Z(()=>Vt()?.worktree===on.worktree);return(()=>{var mt=bYt();return mt.$$click=()=>x(`/${St(on.worktree)}/session`),K(mt,d(nX,{project:on,notify:!0})),Qe(Ir=>{var Do={"bg-transparent hover:bg-surface-base-hover":!Rt(),"bg-surface-base-hover border border-border-weak-base":Rt()},yl=on.name||Gn(on.worktree);return Ir.e=hr(mt,Do,Ir.e),yl!==Ir.t&>(mt,"aria-label",Ir.t=yl),Ir},{e:void 0,t:void 0}),mt})()}}),qt),qt.$$click=rr,K(qt,d(Kt,{name:"plus",size:"small",class:"text-icon-weak"})),Xt.$$click=pl,K(Xt,d(Kt,{name:"settings-gear",size:"small",class:"text-icon-weak"})),Qe(on=>{var Rt=L.t("command.project.open"),mt=L.t("sidebar.settings");return Rt!==on.e&>(qt,"aria-label",on.e=Rt),mt!==on.t&>(Xt,"aria-label",on.t=mt),on},{e:void 0,t:void 0}),He}}),re),ge.$$click=He=>{He.target===He.currentTarget&&h.mobileSidebar.hide()},je.$$click=He=>He.stopPropagation(),K(je,()=>Ige(!0)),hr(Be,{"absolute p-3 pt-0 inset-0":!0,"xl:inset-y-0 xl:right-0 xl:left-0":!0,"z-20":!0}),hr(Ye,{"size-full overflow-x-hidden flex flex-col items-start contain-strict rounded-xl":!0}),K(Ye,d(ke,{get when(){return!Ja.loading},get fallback(){return qne()},get children(){var He=qne(),Ke=zm;return typeof Ke=="function"?Hr(Ke,He):zm=He,K(He,()=>e.children),He}})),K(B,d(As.Region,{}),null),Qe(He=>{var Ke={"fixed inset-x-0 top-10 bottom-0 z-40 transition-opacity duration-200":!0,"opacity-100 pointer-events-auto":h.mobileSidebar.opened(),"opacity-0 pointer-events-none":!h.mobileSidebar.opened()},qt=L.t("sidebar.nav.projectsAndSessions"),nn={"@container fixed top-10 bottom-0 left-0 z-50 w-full max-w-[400px] overflow-hidden border-r border-border-weaker-base bg-background-base transition-transform duration-200 ease-out":!0,"translate-x-0":h.mobileSidebar.opened(),"-translate-x-full":!h.mobileSidebar.opened()};return He.e=hr(ge,Ke,He.e),qt!==He.t&>(je,"aria-label",He.t=qt),He.a=hr(je,nn,He.a),He},{e:void 0,t:void 0,a:void 0}),B}})}li(["click"]);var xYt=["id","name","validationState","required","disabled","readOnly"];function _Yt(e){const t=`form-control-${xr()}`,n=ft({id:t},e),[r,i]=Ce(),[a,o]=Ce(),[s,l]=Ce(),[c,u]=Ce(),h=(v,k,b)=>{const x=b!=null||r()!=null;return[b,r(),x&&k!=null?v:void 0].filter(Boolean).join(" ")||void 0},m=v=>[s(),c(),v].filter(Boolean).join(" ")||void 0,g=Z(()=>({"data-valid":be(n.validationState)==="valid"?"":void 0,"data-invalid":be(n.validationState)==="invalid"?"":void 0,"data-required":be(n.required)?"":void 0,"data-disabled":be(n.disabled)?"":void 0,"data-readonly":be(n.readOnly)?"":void 0}));return{formControlContext:{name:()=>be(n.name)??be(n.id),dataset:g,validationState:()=>be(n.validationState),isRequired:()=>be(n.required),isDisabled:()=>be(n.disabled),isReadOnly:()=>be(n.readOnly),labelId:r,fieldId:a,descriptionId:s,errorMessageId:c,getAriaLabelledBy:h,getAriaDescribedBy:m,generateId:Io(()=>be(n.id)),registerLabel:zr(i),registerField:zr(o),registerDescription:zr(l),registerErrorMessage:zr(u)}}}var rge=Tt();function Am(){const e=Lt(rge);if(e===void 0)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function ige(e){const t=Am(),n=ft({id:t.generateId("description")},e);return he(()=>me(t.registerDescription(n.id))),d(zt,f({as:"div"},()=>t.dataset(),n))}var MYt=["id","aria-label","aria-labelledby","aria-describedby"];function SYt(e){const t=Am(),n=ft({id:t.generateId("field")},e);return he(()=>me(t.registerField(be(n.id)))),{fieldProps:{id:()=>be(n.id),ariaLabel:()=>be(n["aria-label"]),ariaLabelledBy:()=>t.getAriaLabelledBy(be(n.id),be(n["aria-label"]),be(n["aria-labelledby"])),ariaDescribedBy:()=>t.getAriaDescribedBy(be(n["aria-describedby"]))}}}function age(e){let t;const n=Am(),r=ft({id:n.generateId("label")},e),[i,a]=Se(r,["ref"]),o=Z2(()=>t,()=>"label");return he(()=>me(n.registerLabel(a.id))),d(zt,f({as:"label",ref(s){var l=hn(c=>t=c,i.ref);typeof l=="function"&&l(s)},get for(){return bt(()=>o()==="label")()?n.fieldId():void 0}},()=>n.dataset(),a))}function CYt(e,t){he(vn(e,n=>{if(n==null)return;const r=LYt(n);r!=null&&(r.addEventListener("reset",t,{passive:!0}),me(()=>{r.removeEventListener("reset",t)}))}))}function LYt(e){return IYt(e)?e.form:e.closest("form")}function IYt(e){return e.matches("textarea, input, select, button")}function oge(e){const t=Am(),n=ft({id:t.generateId("error-message")},e),[r,i]=Se(n,["forceMount"]),a=()=>t.validationState()==="invalid";return he(()=>{a()&&me(t.registerErrorMessage(i.id))}),d(ke,{get when(){return r.forceMount||a()},get children(){return d(zt,f({as:"div"},()=>t.dataset(),i))}})}var NYt={};Ga(NYt,{Description:()=>ige,ErrorMessage:()=>oge,Input:()=>lge,Label:()=>age,Root:()=>dge,TextArea:()=>uge,TextField:()=>R1,useTextFieldContext:()=>rX});var sge=Tt();function rX(){const e=Lt(sge);if(e===void 0)throw new Error("[kobalte]: `useTextFieldContext` must be used within a `TextField` component");return e}function lge(e){return d(cge,f({type:"text"},e))}function cge(e){const t=Am(),n=rX(),r=ft({id:n.generateId("input")},e),[i,a,o]=Se(r,["onInput"],MYt),{fieldProps:s}=SYt(a);return d(zt,f({as:"input",get id(){return s.id()},get name(){return t.name()},get value(){return n.value()},get required(){return t.isRequired()},get disabled(){return t.isDisabled()},get readonly(){return t.isReadOnly()},get"aria-label"(){return s.ariaLabel()},get"aria-labelledby"(){return s.ariaLabelledBy()},get"aria-describedby"(){return s.ariaDescribedBy()},get"aria-invalid"(){return t.validationState()==="invalid"||void 0},get"aria-required"(){return t.isRequired()||void 0},get"aria-disabled"(){return t.isDisabled()||void 0},get"aria-readonly"(){return t.isReadOnly()||void 0},get onInput(){return Kn([i.onInput,n.onInput])}},()=>t.dataset(),o))}function dge(e){let t;const n=`textfield-${xr()}`,r=ft({id:n},e),[i,a,o]=Se(r,["ref","value","defaultValue","onChange"],xYt),s=i.value,[l,c]=G2({value:()=>s===void 0?void 0:i.value??"",defaultValue:()=>i.defaultValue,onChange:g=>i.onChange?.(g)}),{formControlContext:u}=_Yt(a);CYt(()=>t,()=>c(i.defaultValue??""));const h=g=>{if(u.isReadOnly()||u.isDisabled())return;const y=g.target;c(y.value),y.value=l()??""},m={value:l,generateId:Io(()=>be(a.id)),onInput:h};return d(rge.Provider,{value:u,get children(){return d(sge.Provider,{value:m,get children(){return d(zt,f({as:"div",ref(g){var y=hn(v=>t=v,i.ref);typeof y=="function"&&y(g)},role:"group",get id(){return be(a.id)}},()=>u.dataset(),o))}})}})}function uge(e){let t;const n=rX(),r=ft({id:n.generateId("textarea")},e),[i,a]=Se(r,["ref","autoResize","submitOnEnter","onKeyPress"]);he(vn([()=>t,()=>i.autoResize,()=>n.value()],([s,l])=>{!s||!l||AYt(s)}));const o=s=>{t&&i.submitOnEnter&&s.key==="Enter"&&!s.shiftKey&&t.form&&(t.form.requestSubmit(),s.preventDefault())};return d(cge,f({as:"textarea",get"aria-multiline"(){return i.submitOnEnter?"false":void 0},get onKeyPress(){return Kn([i.onKeyPress,o])},ref(s){var l=hn(c=>t=c,i.ref);typeof l=="function"&&l(s)}},a))}function AYt(e){const t=e.style.alignSelf,n=e.style.overflow;"MozAppearance"in e.style||(e.style.overflow="hidden"),e.style.alignSelf="start",e.style.height="auto",e.style.height=`${e.scrollHeight+(e.offsetHeight-e.clientHeight)}px`,e.style.overflow=n,e.style.alignSelf=t}var R1=Object.assign(dge,{Description:ige,ErrorMessage:oge,Input:lge,Label:age,TextArea:uge}),$Yt=ie("<div data-slot=input-wrapper>");function TYt(e){const t=M0(),[n,r]=Se(e,["name","defaultValue","value","onChange","onKeyDown","validationState","required","disabled","readOnly","class","label","hideLabel","description","error","variant","copyable","copyKind","multiline"]),[i,a]=Ce(!1),o=()=>i()?t.t("ui.textField.copied"):n.copyKind==="link"?t.t("ui.textField.copyLink"):t.t("ui.textField.copyToClipboard"),s=()=>i()?"check":n.copyKind==="link"?"link":"copy";async function l(){const u=n.value??n.defaultValue??"";await navigator.clipboard.writeText(u),a(!0),setTimeout(()=>a(!1),2e3)}function c(){n.copyable&&l()}return d(R1,{"data-component":"input",get"data-variant"(){return n.variant||"normal"},get name(){return n.name},get defaultValue(){return n.defaultValue},get value(){return n.value},get onChange(){return n.onChange},get onKeyDown(){return n.onKeyDown},onClick:c,get required(){return n.required},get disabled(){return n.disabled},get readOnly(){return n.readOnly},get validationState(){return n.validationState},get children(){return[d(ke,{get when(){return n.label},get children(){return d(R1.Label,{"data-slot":"input-label",get classList(){return{"sr-only":n.hideLabel}},get children(){return n.label}})}}),(()=>{var u=$Yt();return K(u,d(ke,{get when(){return n.multiline},get fallback(){return d(R1.Input,f(r,{"data-slot":"input-input",get class(){return n.class}}))},get children(){return d(R1.TextArea,f(r,{autoResize:!0,"data-slot":"input-input",get class(){return n.class}}))}}),null),K(u,d(ke,{get when(){return n.copyable},get children(){return d(Ua,{get value(){return o()},placement:"top",gutter:4,get forceOpen(){return i()},skipDelayDuration:0,get children(){return d(Cr,{type:"button",get icon(){return s()},variant:"ghost",onClick:l,tabIndex:-1,"data-slot":"input-copy-button",get"aria-label"(){return o()}})}})}}),null),u})(),d(ke,{get when(){return n.description},get children(){return d(R1.Description,{"data-slot":"input-description",get children(){return n.description}})}}),d(R1.ErrorMessage,{"data-slot":"input-error",get children(){return n.error}})]}})}var EYt=ie('<div class="relative flex-1 h-screen w-screen min-h-0 flex flex-col items-center justify-center bg-background-base font-sans"><div class="w-2/3 max-w-3xl flex flex-col items-center justify-center gap-8"><div class="flex flex-col items-center gap-2 text-center"><h1 class="text-lg font-medium text-text-strong"></h1><p class="text-sm text-text-weak"></p></div><div class="flex items-center gap-3"></div><div class="flex flex-col items-center gap-2"><div class="flex items-center justify-center gap-1"><button type=button class="flex items-center text-text-interactive-base gap-1"><div>'),PYt=ie('<p class="text-xs text-text-danger-base text-center max-w-2xl">'),DYt=ie('<p class="text-xs text-text-weak">');const ey=`
|
|
2565
2565
|
`+"─".repeat(40)+`
|
|
2566
|
-
`;function
|
|
2566
|
+
`;function OYt(e){if(!e||typeof e!="object"||!("message"in e)||!("path"in e))return!1;const t=e.message,n=e.path;return typeof t!="string"||!Array.isArray(n)?!1:n.every(r=>typeof r=="string")}function RYt(e){return typeof e=="object"&&e!==null&&"name"in e&&"data"in e&&typeof e.data=="object"}function hge(e,t){const n=new WeakSet;return JSON.stringify(e,(i,a)=>{if(typeof a=="bigint")return a.toString();if(typeof a=="object"&&a){if(n.has(a))return t;n.add(a)}return a},2)??String(e)}function zYt(e,t){const n=e.data,r=i=>hge(i,t("error.page.circular"));switch(e.name){case"MCPFailed":{const i=typeof n.name=="string"?n.name:"";return t("error.chain.mcpFailed",{name:i})}case"ProviderAuthError":{const i=typeof n.providerID=="string"?n.providerID:t("common.unknown"),a=typeof n.message=="string"?n.message:r(n.message);return t("error.chain.providerAuthFailed",{provider:i,message:a})}case"APIError":{const a=[typeof n.message=="string"?n.message:t("error.chain.apiError")];return typeof n.statusCode=="number"&&a.push(t("error.chain.status",{status:n.statusCode})),typeof n.isRetryable=="boolean"&&a.push(t("error.chain.retryable",{retryable:n.isRetryable})),typeof n.responseBody=="string"&&n.responseBody&&a.push(t("error.chain.responseBody",{body:n.responseBody})),a.join(`
|
|
2567
2567
|
`)}case"ProviderModelNotFoundError":{const{providerID:i,modelID:a,suggestions:o}=n,s=Array.isArray(o)&&o.length?[t("error.chain.didYouMean",{suggestions:o.join(", ")})]:[];return[t("error.chain.modelNotFound",{provider:i,model:a}),...s,t("error.chain.checkConfig")].join(`
|
|
2568
|
-
`)}case"ProviderInitError":{const i=typeof n.providerID=="string"?n.providerID:t("common.unknown");return t("error.chain.providerInitFailed",{provider:i})}case"ConfigJsonError":{const i=typeof n.path=="string"?n.path:r(n.path),a=typeof n.message=="string"?n.message:"";return a?t("error.chain.configJsonInvalidWithMessage",{path:i,message:a}):t("error.chain.configJsonInvalid",{path:i})}case"ConfigDirectoryTypoError":{const i=typeof n.path=="string"?n.path:r(n.path),a=typeof n.dir=="string"?n.dir:r(n.dir),o=typeof n.suggestion=="string"?n.suggestion:r(n.suggestion);return t("error.chain.configDirectoryTypo",{dir:a,path:i,suggestion:o})}case"ConfigFrontmatterError":{const i=typeof n.path=="string"?n.path:r(n.path),a=typeof n.message=="string"?n.message:r(n.message);return t("error.chain.configFrontmatterError",{path:i,message:a})}case"ConfigInvalidError":{const i=Array.isArray(n.issues)?n.issues.filter(
|
|
2569
|
-
`)}case"UnknownError":return typeof n.message=="string"?n.message:r(n);default:return typeof n.message=="string"?n.message:r(n)}}function fge(e,t,n=0,r){const i=o=>hge(o,t("error.page.circular"));if(!e)return t("error.chain.unknown");if(
|
|
2568
|
+
`)}case"ProviderInitError":{const i=typeof n.providerID=="string"?n.providerID:t("common.unknown");return t("error.chain.providerInitFailed",{provider:i})}case"ConfigJsonError":{const i=typeof n.path=="string"?n.path:r(n.path),a=typeof n.message=="string"?n.message:"";return a?t("error.chain.configJsonInvalidWithMessage",{path:i,message:a}):t("error.chain.configJsonInvalid",{path:i})}case"ConfigDirectoryTypoError":{const i=typeof n.path=="string"?n.path:r(n.path),a=typeof n.dir=="string"?n.dir:r(n.dir),o=typeof n.suggestion=="string"?n.suggestion:r(n.suggestion);return t("error.chain.configDirectoryTypo",{dir:a,path:i,suggestion:o})}case"ConfigFrontmatterError":{const i=typeof n.path=="string"?n.path:r(n.path),a=typeof n.message=="string"?n.message:r(n.message);return t("error.chain.configFrontmatterError",{path:i,message:a})}case"ConfigInvalidError":{const i=Array.isArray(n.issues)?n.issues.filter(OYt).map(l=>"↳ "+l.message+" "+l.path.join(".")):[],a=typeof n.message=="string"?n.message:"",o=typeof n.path=="string"?n.path:r(n.path);return[a?t("error.chain.configInvalidWithMessage",{path:o,message:a}):t("error.chain.configInvalid",{path:o}),...i].join(`
|
|
2569
|
+
`)}case"UnknownError":return typeof n.message=="string"?n.message:r(n);default:return typeof n.message=="string"?n.message:r(n)}}function fge(e,t,n=0,r){const i=o=>hge(o,t("error.page.circular"));if(!e)return t("error.chain.unknown");if(RYt(e)){const o=zYt(e,t);return n>0&&r===o?"":(n>0?`
|
|
2570
2570
|
${ey}${t("error.chain.causedBy")}
|
|
2571
2571
|
`:"")+`${e.name}
|
|
2572
2572
|
${o}`}if(e instanceof Error){const o=n>0&&r===e.message,s=[],l=n>0?`
|
|
@@ -2580,5 +2580,5 @@ ${u}`)}if(!u&&!o&&s.push(l+c),e.cause){const h=fge(e.cause,t,n+1,e.message);h&&s
|
|
|
2580
2580
|
${ey}${t("error.chain.causedBy")}
|
|
2581
2581
|
`:"")+e:(n>0?`
|
|
2582
2582
|
${ey}${t("error.chain.causedBy")}
|
|
2583
|
-
`:"")+i(e)}function ty(e,t){return fge(e,t,0)}const
|
|
2584
|
-
${l}`)});async function a(){t.checkUpdate&&(i("checking",!0),await t.checkUpdate().then(s=>{i("actionError",void 0),s.updateAvailable&&s.version&&i("version",s.version)}).catch(s=>{i("actionError",ty(s,n.t))}).finally(()=>{i("checking",!1)}))}async function o(){!t.update||!t.restart||await t.update().then(()=>t.restart()).then(()=>i("actionError",void 0)).catch(s=>{i("actionError",ty(s,n.t))})}return(()=>{var s=$Yt(),l=s.firstChild,c=l.firstChild,u=c.firstChild,h=u.nextSibling,m=c.nextSibling,g=m.nextSibling,y=g.firstChild,v=y.firstChild,k=v.firstChild;return K(l,d(xxt,{class:"w-58.5 opacity-12 shrink-0"}),c),K(u,()=>n.t("error.page.title")),K(h,()=>n.t("error.page.description")),K(l,d(AYt,{get value(){return ty(e.error,n.t)},readOnly:!0,copyable:!0,multiline:!0,class:"max-h-96 w-full font-mono text-xs no-scrollbar",get label(){return n.t("error.page.details.label")},hideLabel:!0}),m),K(m,d(Mn,{size:"large",get onClick(){return t.restart},get children(){return n.t("error.page.action.restart")}}),null),K(m,d(ke,{get when(){return t.checkUpdate},get children(){return d(ke,{get when(){return r.version},get fallback(){return d(Mn,{size:"large",variant:"ghost",onClick:a,get disabled(){return r.checking},get children(){return bt(()=>!!r.checking)()?n.t("error.page.action.checking"):n.t("error.page.action.checkUpdates")}})},get children(){return d(Mn,{size:"large",onClick:o,get children(){return n.t("error.page.action.updateTo",{version:r.version??""})}})}})}}),null),K(l,d(ke,{get when(){return r.actionError},children:b=>(()=>{var x=TYt();return K(x,b),x})()}),g),K(y,()=>n.t("error.page.report.prefix"),v),v.$$click=()=>t.openLink("https://opencode.ai/desktop-feedback"),K(k,()=>n.t("error.page.report.discord")),K(v,d(Kt,{name:"discord",class:"text-text-interactive-base"}),null),K(g,d(ke,{get when(){return t.version},children:b=>(()=>{var x=EYt();return K(x,()=>n.t("error.page.version",{version:b()})),x})()}),null),s})()};li(["click"]);var zYt=ie("<div class=size-full>"),qYt=ie('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base">'),jYt=ie('<div class="flex flex-col gap-2 w-full max-w-sm"><span class="text-12-regular text-text-base text-center"></span><div class="flex flex-col gap-1 bg-surface-base rounded-lg p-2">'),HYt=ie('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base gap-6 p-6"><div class="flex flex-col items-center max-w-md text-center"><p class="text-14-regular text-text-base"><span class="text-text-strong font-medium"></span></p><p class="mt-1 text-12-regular text-text-weak">'),FYt=ie('<button type=button class="flex items-center gap-3 w-full px-3 py-2 rounded-md hover:bg-surface-raised-base-hover transition-colors text-left"><span class="text-14-regular text-text-strong truncate">');const VYt=U2(()=>z(()=>import("./home-BKqFRRgM.js"),__vite__mapDeps([112,110,111,105,102,113]))),BYt=U2(()=>z(()=>import("./auth-callback-ZxYbdxkK.js"),[])),pge=()=>z(()=>import("./session-CHqBQBtu.js").then(e=>e.s),__vite__mapDeps([114,100,101,102,105,115,98,116,117,106,111])),UYt=U2(pge),WYt=U2(()=>z(()=>import("./trellis-B7oy118W.js").then(e=>e.c),__vite__mapDeps([115,101,102,98,116,117]))),GYt=U2(()=>z(()=>import("./trellis-badge-demo-sGSBW7BL.js"),__vite__mapDeps([118,116]))),ZYt=()=>zYt();typeof location=="object"&&/\/session(?:\/|$)/.test(location.pathname)&&pge();const jne=()=>d(QYt,{get children(){return d(UYt,{})}}),KYt=()=>d(v_t,{href:"session"});function XYt(e){const t=_r();return d($ve,{get value(){return{locale:t.intl,t:t.t}},get children(){return e.children}})}function YYt(e){const t=new J_t;return d(X_t,{client:t,get children(){return e.children}})}function JYt(e){return d(gLt,{get children(){return d(Tzt,{get children(){return d(pDt,{get children(){return d(Czt,{get children(){return d(kzt,{get children(){return d(xLt,{get children(){return d(GDt,{get children(){return d(kYt,{get children(){return e.children}})}})}})}})}})}})}})}})}function QYt(e){return d(Jzt,{get children(){return d(ADt,{get children(){return d(Vzt,{get children(){return d(TLt,{get children(){return e.children}})}})}})}})}function eJt(e){return d(JYt,{get children(){return d(Zge,{get fallback(){return d(ZYt,{})},get children(){return[bt(()=>e.appChildren),bt(()=>e.children)]}})}})}function tJt(e){return d(jxt,{get children(){return[d(cxt,{}),d(Oxt,{onThemeApplied:(t,n)=>{window.api?.setTitlebar?.({mode:n})},get children(){return d(lLt,{get locale(){return e.locale},get children(){return d(XYt,{get children(){return d(Wge,{fallback:t=>d(RYt,{error:t}),get children(){return d(YYt,{get children(){return d(Ive,{get children(){return d(J9e,{get children(){return d(kye,{component:Qse,get children(){return e.children}})}})}})}})}})}})}})}})]}})}const nJt=e=>t=>PCt([t,HCt(e)],{concurrency:"unbounded"}).pipe(qCt(n=>n[0]));function rJt(e){const t=T0(),n=The(),[r,i]=Ce("blocking"),[a,o]=Yr(()=>e.disableHealthCheck?!0:zCt(function*(){if(!t.current)return!0;const{http:s,type:l}=t.current;for(;;){if((yield*DCt(()=>n(s))).healthy)return!0;if(r()==="background"||l==="http")return!1}}).pipe(nJt(r()==="blocking"?"1.2 seconds":0),jCt({duration:"10 seconds",orElse:()=>OCt(!1)}),FCt(RCt(()=>i("background"))),VCt));return d(ke,{get when(){return bt(()=>r()==="blocking")()?!a.loading:a.state!=="pending"},get fallback(){return(()=>{var s=qYt();return K(s,d(ele,{class:"w-16 h-20 opacity-50 animate-pulse"})),s})()},get children(){return d(ke,{get when(){return a()},get fallback(){return d(iJt,{onRetry:()=>{r()==="background"&&o.refetch()},onServerSelected:s=>{i("blocking"),t.setActive(s),o.refetch()}})},get children(){return e.children}})}})}function iJt(e){const t=_r(),n=T0(),r=()=>n.list.filter(l=>yo.key(l)!==n.key),i=Z(()=>n.name||n.key),a="\0server\0",o=Z(()=>t.t("app.server.unreachable",{server:a}).split(a)),s=setInterval(()=>e.onRetry?.(),1e3);return me(()=>clearInterval(s)),(()=>{var l=HYt(),c=l.firstChild,u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(c,d(ele,{class:"w-12 h-15 mb-4"}),u),K(u,()=>o()[0],h),K(h,i),K(u,()=>o()[1],null),K(m,()=>t.t("app.server.retrying")),K(l,d(ke,{get when(){return r().length>0},get children(){var g=jYt(),y=g.firstChild,v=y.nextSibling;return K(y,()=>t.t("app.server.otherServers")),K(v,d(Qt,{get each(){return r()},children:k=>{const b=yo.key(k);return(()=>{var x=FYt(),w=x.firstChild;return x.$$click=()=>e.onServerSelected?.(b),K(w,()=>Ehe(k)),x})()}})),g}}),null),l})()}function aJt(e){const t=T0();return d(ke,{get when(){return t.key},keyed:!0,get children(){return e.children}})}function oJt(e){return d(dPt,{get defaultServer(){return e.defaultServer},get disableHealthCheck(){return e.disableHealthCheck},get servers(){return e.servers},get children(){return d(rJt,{get disableHealthCheck(){return e.disableHealthCheck},get children(){return d(aJt,{get children(){return d(hPt,{get children(){return d(ZPt,{get children(){return d(tqt,{get children(){return d(oq,{get component(){return e.router??g_t},root:t=>d(eJt,{get appChildren(){return e.children},get children(){return t.children}}),get children(){return[d(xs,{path:"/",component:VYt}),d(xs,{path:"/auth/callback",component:BYt}),d(xs,{path:"/trellis-badge",component:GYt}),d(xs,{path:"/:dir",component:kWt,get children(){return[d(xs,{path:"/",component:KYt}),d(xs,{path:"/session",component:jne}),d(xs,{path:"/session/:id",component:jne}),d(xs,{path:"/trellis",component:WYt})]}})]}})}})}})}})}})}})}})}li(["click"]);const sJt="1.3.5",lJt={version:sJt},mge="opencode.settings.dat:defaultServerUrl",cJt=e=>{if(typeof localStorage>"u")return null;try{return localStorage.getItem(e)}catch{return null}},dJt=(e,t)=>{if(!(typeof localStorage>"u"))try{if(t!==null){localStorage.setItem(e,t);return}localStorage.removeItem(e)}catch{return}},gge=()=>cJt(mge),uJt=e=>dJt(mge,e),hJt=async(e,t,n)=>{if(!("Notification"in window)||(Notification.permission==="default"?await Notification.requestPermission().catch(()=>"denied"):Notification.permission)!=="granted"||document.visibilityState==="visible"&&document.hasFocus())return;const a=new Notification(e,{body:t??"",icon:"https://opencode.ai/favicon-96x96-v3.png"});a.onclick=()=>{FZt(n),a.close()}},fJt=e=>{window.open(e,"_blank")},pJt=()=>{window.history.back()},mJt=()=>{window.history.forward()},gJt=async()=>{window.location.reload()},Hne=document.getElementById("root"),yge=()=>location.hostname.includes("opencode.ai")?"http://localhost:4096":location.origin,yJt=()=>{const e=gge();return e||yge()},vJt={platform:"web",version:lJt.version,openLink:fJt,back:pJt,forward:mJt,restart:gJt,notify:hJt,getDefaultServer:async()=>{const e=gge();return e?yo.Key.make(e):null},setDefaultServer:uJt};if(Hne instanceof HTMLElement){const e={type:"http",http:{url:yge()}};aye(()=>d(GCt,{value:vJt,get children(){return d(tJt,{get children(){return d(oJt,{get defaultServer(){return yo.Key.make(yJt())},servers:[e],disableHealthCheck:!0})}})}}),Hne)}export{f as $,Yr as A,Mn as B,Gn as C,ot as D,rQt as E,Qt as F,jz as G,nt as H,Kt as I,lr as J,The as K,XJt as L,lPt as M,yo as N,he as O,me as P,Cr as Q,Mt as R,ke as S,xxt as T,Ct as U,hr as V,Ehe as W,iq as X,Ua as Y,NKt as Z,z as _,If as a,TR as a$,cDt as a0,xj as a1,Cf as a2,vn as a3,di as a4,fQt as a5,yQt as a6,yK as a7,mzt as a8,Wz as a9,ire as aA,Ga as aB,r0 as aC,Zn as aD,D2 as aE,Je as aF,dqt as aG,ct as aH,Ice as aI,uQt as aJ,xo as aK,yF as aL,xJt as aM,vX as aN,_Jt as aO,XGt as aP,YGt as aQ,ime as aR,Kn as aS,gs as aT,qGt as aU,i0 as aV,Wye as aW,G2 as aX,HGt as aY,MJt as aZ,ur as a_,Se as aa,xr as ab,ki as ac,Sm as ad,ft as ae,bYt as af,wYt as ag,JGt as ah,MYt as ai,zt as aj,be as ak,hn as al,rge as am,Am as an,age as ao,xYt as ap,_Yt as aq,Wa as ar,Xye as as,oge as at,ige as au,Tt as av,Io as aw,nre as ax,dt as ay,Lt as az,ms as b,Wh as b$,lt as b0,wr as b1,PGt as b2,aq as b3,sq as b4,VGt as b5,zr as b6,vs as b7,OGt as b8,_0 as b9,aE as bA,iN as bB,eD as bC,rx as bD,rR as bE,uP as bF,Fse as bG,Er as bH,M0 as bI,_o as bJ,ni as bK,Yz as bL,mee as bM,Yn as bN,U2 as bO,Zge as bP,pQt as bQ,Jn as bR,In as bS,GKt as bT,eme as bU,eX as bV,jme as bW,zme as bX,qme as bY,Y1 as bZ,RHt as b_,w0 as ba,pre as bb,yre as bc,fre as bd,Hf as be,lq as bf,x0 as bg,Uo as bh,CWt as bi,FGt as bj,Uz as bk,Qee as bl,ule as bm,sm as bn,JJt as bo,mLt as bp,YJt as bq,pLt as br,eQt as bs,QJt as bt,hQt as bu,iU as bv,EB as bw,vzt as bx,O1 as by,lN as bz,lf as c,_Qt as c$,Qse as c0,Ame as c1,Uzt as c2,xl as c3,tQt as c4,lle as c5,iee as c6,sDt as c7,vK as c8,Jg as c9,Pxe as cA,BJt as cB,Nn as cC,Nj as cD,Ef as cE,QHt as cF,_pe as cG,lB as cH,zU as cI,CL as cJ,E_ as cK,u9 as cL,x8 as cM,Eb as cN,Y7 as cO,n9 as cP,o6 as cQ,Q3 as cR,oA as cS,Sme as cT,_me as cU,Cme as cV,MQt as cW,Nme as cX,Lme as cY,tq as cZ,xQt as c_,Yp as ca,rn as cb,af as cc,_Lt as cd,iQt as ce,Ds as cf,nQt as cg,ape as ch,Dzt as ci,aU as cj,jKt as ck,bJt as cl,wQt as cm,UZt as cn,SQt as co,ZKt as cp,oq as cq,oV as cr,vye as cs,wJt as ct,bf as cu,FJt as cv,UJt as cw,VJt as cx,aye as cy,WJt as cz,ll as d,gQt as d0,ope as d1,kQt as d2,r2 as d3,VB as d4,gPt as d5,Jt as d6,vHt as d7,hHt as d8,B9e as d9,vQt as da,JHt as db,XHt as dc,bp as dd,ZF as de,LR as df,OZt as dg,DZt as dh,GJt as di,EJt as dj,T0 as e,_r as f,mQt as g,Ce as h,Z as i,Hr as j,O2e as k,K as l,d as m,bt as n,dn as o,AYt as p,Qe as q,St as r,kr as s,ie as t,ha as u,li as v,e_t as w,W2 as x,gt as y,E0 as z};
|
|
2583
|
+
`:"")+i(e)}function ty(e,t){return fge(e,t,0)}const qYt=e=>{const t=ms(),n=_r(),[r,i]=nt({checking:!1,version:void 0,actionError:void 0});dn(()=>{if(!window.__opencode_e2e)return;const l=ty(e.error,n.t);console.error(`[e2e:error-boundary] ${window.location.pathname}
|
|
2584
|
+
${l}`)});async function a(){t.checkUpdate&&(i("checking",!0),await t.checkUpdate().then(s=>{i("actionError",void 0),s.updateAvailable&&s.version&&i("version",s.version)}).catch(s=>{i("actionError",ty(s,n.t))}).finally(()=>{i("checking",!1)}))}async function o(){!t.update||!t.restart||await t.update().then(()=>t.restart()).then(()=>i("actionError",void 0)).catch(s=>{i("actionError",ty(s,n.t))})}return(()=>{var s=EYt(),l=s.firstChild,c=l.firstChild,u=c.firstChild,h=u.nextSibling,m=c.nextSibling,g=m.nextSibling,y=g.firstChild,v=y.firstChild,k=v.firstChild;return K(l,d(xxt,{class:"w-58.5 opacity-12 shrink-0"}),c),K(u,()=>n.t("error.page.title")),K(h,()=>n.t("error.page.description")),K(l,d(TYt,{get value(){return ty(e.error,n.t)},readOnly:!0,copyable:!0,multiline:!0,class:"max-h-96 w-full font-mono text-xs no-scrollbar",get label(){return n.t("error.page.details.label")},hideLabel:!0}),m),K(m,d(Mn,{size:"large",get onClick(){return t.restart},get children(){return n.t("error.page.action.restart")}}),null),K(m,d(ke,{get when(){return t.checkUpdate},get children(){return d(ke,{get when(){return r.version},get fallback(){return d(Mn,{size:"large",variant:"ghost",onClick:a,get disabled(){return r.checking},get children(){return bt(()=>!!r.checking)()?n.t("error.page.action.checking"):n.t("error.page.action.checkUpdates")}})},get children(){return d(Mn,{size:"large",onClick:o,get children(){return n.t("error.page.action.updateTo",{version:r.version??""})}})}})}}),null),K(l,d(ke,{get when(){return r.actionError},children:b=>(()=>{var x=PYt();return K(x,b),x})()}),g),K(y,()=>n.t("error.page.report.prefix"),v),v.$$click=()=>t.openLink("https://opencode.ai/desktop-feedback"),K(k,()=>n.t("error.page.report.discord")),K(v,d(Kt,{name:"discord",class:"text-text-interactive-base"}),null),K(g,d(ke,{get when(){return t.version},children:b=>(()=>{var x=DYt();return K(x,()=>n.t("error.page.version",{version:b()})),x})()}),null),s})()};li(["click"]);var jYt=ie("<div class=size-full>"),HYt=ie('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base">'),FYt=ie('<div class="flex flex-col gap-2 w-full max-w-sm"><span class="text-12-regular text-text-base text-center"></span><div class="flex flex-col gap-1 bg-surface-base rounded-lg p-2">'),VYt=ie('<div class="h-dvh w-screen flex flex-col items-center justify-center bg-background-base gap-6 p-6"><div class="flex flex-col items-center max-w-md text-center"><p class="text-14-regular text-text-base"><span class="text-text-strong font-medium"></span></p><p class="mt-1 text-12-regular text-text-weak">'),BYt=ie('<button type=button class="flex items-center gap-3 w-full px-3 py-2 rounded-md hover:bg-surface-raised-base-hover transition-colors text-left"><span class="text-14-regular text-text-strong truncate">');const UYt=U2(()=>z(()=>import("./home-KBuxIbfS.js"),__vite__mapDeps([112,110,111,105,102,113]))),WYt=U2(()=>z(()=>import("./auth-callback-_vvdzu1l.js"),[])),pge=()=>z(()=>import("./session-gJuaiFTU.js").then(e=>e.s),__vite__mapDeps([114,100,101,102,105,115,98,116,117,106,111])),GYt=U2(pge),ZYt=U2(()=>z(()=>import("./trellis-DJj85d6A.js").then(e=>e.c),__vite__mapDeps([115,101,102,98,116,117]))),KYt=U2(()=>z(()=>import("./trellis-badge-demo-CVRLg01T.js"),__vite__mapDeps([118,116]))),XYt=()=>jYt();typeof location=="object"&&/\/session(?:\/|$)/.test(location.pathname)&&pge();const jne=()=>d(tJt,{get children(){return d(GYt,{})}}),YYt=()=>d(v_t,{href:"session"});function JYt(e){const t=_r();return d($ve,{get value(){return{locale:t.intl,t:t.t}},get children(){return e.children}})}function QYt(e){const t=new J_t;return d(X_t,{client:t,get children(){return e.children}})}function eJt(e){return d(gLt,{get children(){return d(Tzt,{get children(){return d(pDt,{get children(){return d(Czt,{get children(){return d(kzt,{get children(){return d(xLt,{get children(){return d(GDt,{get children(){return d(wYt,{get children(){return e.children}})}})}})}})}})}})}})}})}function tJt(e){return d(Jzt,{get children(){return d(ADt,{get children(){return d(Vzt,{get children(){return d(TLt,{get children(){return e.children}})}})}})}})}function nJt(e){return d(eJt,{get children(){return d(Zge,{get fallback(){return d(XYt,{})},get children(){return[bt(()=>e.appChildren),bt(()=>e.children)]}})}})}function rJt(e){return d(jxt,{get children(){return[d(cxt,{}),d(Oxt,{onThemeApplied:(t,n)=>{window.api?.setTitlebar?.({mode:n})},get children(){return d(lLt,{get locale(){return e.locale},get children(){return d(JYt,{get children(){return d(Wge,{fallback:t=>d(qYt,{error:t}),get children(){return d(QYt,{get children(){return d(Ive,{get children(){return d(J9e,{get children(){return d(kye,{component:Qse,get children(){return e.children}})}})}})}})}})}})}})}})]}})}const iJt=e=>t=>PCt([t,HCt(e)],{concurrency:"unbounded"}).pipe(qCt(n=>n[0]));function aJt(e){const t=T0(),n=The(),[r,i]=Ce("blocking"),[a,o]=Yr(()=>e.disableHealthCheck?!0:zCt(function*(){if(!t.current)return!0;const{http:s,type:l}=t.current;for(;;){if((yield*DCt(()=>n(s))).healthy)return!0;if(r()==="background"||l==="http")return!1}}).pipe(iJt(r()==="blocking"?"1.2 seconds":0),jCt({duration:"10 seconds",orElse:()=>OCt(!1)}),FCt(RCt(()=>i("background"))),VCt));return d(ke,{get when(){return bt(()=>r()==="blocking")()?!a.loading:a.state!=="pending"},get fallback(){return(()=>{var s=HYt();return K(s,d(ele,{class:"w-16 h-20 opacity-50 animate-pulse"})),s})()},get children(){return d(ke,{get when(){return a()},get fallback(){return d(oJt,{onRetry:()=>{r()==="background"&&o.refetch()},onServerSelected:s=>{i("blocking"),t.setActive(s),o.refetch()}})},get children(){return e.children}})}})}function oJt(e){const t=_r(),n=T0(),r=()=>n.list.filter(l=>yo.key(l)!==n.key),i=Z(()=>n.name||n.key),a="\0server\0",o=Z(()=>t.t("app.server.unreachable",{server:a}).split(a)),s=setInterval(()=>e.onRetry?.(),1e3);return me(()=>clearInterval(s)),(()=>{var l=VYt(),c=l.firstChild,u=c.firstChild,h=u.firstChild,m=u.nextSibling;return K(c,d(ele,{class:"w-12 h-15 mb-4"}),u),K(u,()=>o()[0],h),K(h,i),K(u,()=>o()[1],null),K(m,()=>t.t("app.server.retrying")),K(l,d(ke,{get when(){return r().length>0},get children(){var g=FYt(),y=g.firstChild,v=y.nextSibling;return K(y,()=>t.t("app.server.otherServers")),K(v,d(Qt,{get each(){return r()},children:k=>{const b=yo.key(k);return(()=>{var x=BYt(),w=x.firstChild;return x.$$click=()=>e.onServerSelected?.(b),K(w,()=>Ehe(k)),x})()}})),g}}),null),l})()}function sJt(e){const t=T0();return d(ke,{get when(){return t.key},keyed:!0,get children(){return e.children}})}function lJt(e){return d(dPt,{get defaultServer(){return e.defaultServer},get disableHealthCheck(){return e.disableHealthCheck},get servers(){return e.servers},get children(){return d(aJt,{get disableHealthCheck(){return e.disableHealthCheck},get children(){return d(sJt,{get children(){return d(hPt,{get children(){return d(ZPt,{get children(){return d(tqt,{get children(){return d(oq,{get component(){return e.router??g_t},root:t=>d(nJt,{get appChildren(){return e.children},get children(){return t.children}}),get children(){return[d(xs,{path:"/",component:UYt}),d(xs,{path:"/auth/callback",component:WYt}),d(xs,{path:"/trellis-badge",component:KYt}),d(xs,{path:"/:dir",component:wWt,get children(){return[d(xs,{path:"/",component:YYt}),d(xs,{path:"/session",component:jne}),d(xs,{path:"/session/:id",component:jne}),d(xs,{path:"/trellis",component:ZYt})]}})]}})}})}})}})}})}})}})}li(["click"]);const cJt="1.3.5",dJt={version:cJt},mge="opencode.settings.dat:defaultServerUrl",uJt=e=>{if(typeof localStorage>"u")return null;try{return localStorage.getItem(e)}catch{return null}},hJt=(e,t)=>{if(!(typeof localStorage>"u"))try{if(t!==null){localStorage.setItem(e,t);return}localStorage.removeItem(e)}catch{return}},gge=()=>uJt(mge),fJt=e=>hJt(mge,e),pJt=async(e,t,n)=>{if(!("Notification"in window)||(Notification.permission==="default"?await Notification.requestPermission().catch(()=>"denied"):Notification.permission)!=="granted"||document.visibilityState==="visible"&&document.hasFocus())return;const a=new Notification(e,{body:t??"",icon:"https://opencode.ai/favicon-96x96-v3.png"});a.onclick=()=>{BZt(n),a.close()}},mJt=e=>{window.open(e,"_blank")},gJt=()=>{window.history.back()},yJt=()=>{window.history.forward()},vJt=async()=>{window.location.reload()},Hne=document.getElementById("root"),yge=()=>location.hostname.includes("opencode.ai")?"http://localhost:4096":location.origin,kJt=()=>{const e=gge();return e||yge()},bJt={platform:"web",version:dJt.version,openLink:mJt,back:gJt,forward:yJt,restart:vJt,notify:pJt,getDefaultServer:async()=>{const e=gge();return e?yo.Key.make(e):null},setDefaultServer:fJt};if(Hne instanceof HTMLElement){const e={type:"http",http:{url:yge()}};aye(()=>d(GCt,{value:bJt,get children(){return d(rJt,{get children(){return d(lJt,{get defaultServer(){return yo.Key.make(kJt())},servers:[e],disableHealthCheck:!0})}})}}),Hne)}export{f as $,Yr as A,Mn as B,Gn as C,ot as D,aQt as E,Qt as F,jz as G,nt as H,Kt as I,lr as J,The as K,JJt as L,lPt as M,yo as N,he as O,me as P,Cr as Q,Mt as R,ke as S,xxt as T,Ct as U,hr as V,Ehe as W,iq as X,Ua as Y,$Kt as Z,z as _,If as a,TR as a$,cDt as a0,xj as a1,Cf as a2,vn as a3,di as a4,mQt as a5,kQt as a6,yK as a7,mzt as a8,Wz as a9,ire as aA,Ga as aB,r0 as aC,Zn as aD,D2 as aE,Je as aF,dqt as aG,ct as aH,Ice as aI,fQt as aJ,xo as aK,yF as aL,MJt as aM,vX as aN,SJt as aO,JGt as aP,QGt as aQ,ime as aR,Kn as aS,gs as aT,HGt as aU,i0 as aV,Wye as aW,G2 as aX,VGt as aY,CJt as aZ,ur as a_,Se as aa,xr as ab,ki as ac,Sm as ad,ft as ae,xYt as af,_Yt as ag,eZt as ah,CYt as ai,zt as aj,be as ak,hn as al,rge as am,Am as an,age as ao,MYt as ap,SYt as aq,Wa as ar,Xye as as,oge as at,ige as au,Tt as av,Io as aw,nre as ax,dt as ay,Lt as az,ms as b,Wh as b$,lt as b0,wr as b1,OGt as b2,aq as b3,sq as b4,UGt as b5,zr as b6,vs as b7,zGt as b8,_0 as b9,aE as bA,iN as bB,eD as bC,rx as bD,rR as bE,uP as bF,Fse as bG,Er as bH,M0 as bI,_o as bJ,ni as bK,Yz as bL,mee as bM,Yn as bN,U2 as bO,Zge as bP,gQt as bQ,Jn as bR,In as bS,KKt as bT,eme as bU,eX as bV,jme as bW,zme as bX,qme as bY,Y1 as bZ,RHt as b_,w0 as ba,pre as bb,yre as bc,fre as bd,Hf as be,lq as bf,x0 as bg,Uo as bh,IWt as bi,BGt as bj,Uz as bk,Qee as bl,ule as bm,sm as bn,eQt as bo,mLt as bp,QJt as bq,pLt as br,nQt as bs,tQt as bt,pQt as bu,iU as bv,EB as bw,vzt as bx,O1 as by,lN as bz,lf as c,CQt as c$,Qse as c0,Ame as c1,Uzt as c2,xl as c3,rQt as c4,lle as c5,iee as c6,sDt as c7,vK as c8,Jg as c9,Pxe as cA,WJt as cB,Nn as cC,Nj as cD,Ef as cE,tFt as cF,_pe as cG,lB as cH,zU as cI,CL as cJ,E_ as cK,u9 as cL,x8 as cM,Eb as cN,Y7 as cO,n9 as cP,o6 as cQ,Q3 as cR,oA as cS,Sme as cT,_me as cU,Cme as cV,LQt as cW,Nme as cX,Lme as cY,tq as cZ,SQt as c_,Yp as ca,rn as cb,af as cc,_Lt as cd,oQt as ce,Ds as cf,iQt as cg,ape as ch,Dzt as ci,aU as cj,FKt as ck,xJt as cl,MQt as cm,GZt as cn,IQt as co,XKt as cp,oq as cq,oV as cr,vye as cs,_Jt as ct,bf as cu,BJt as cv,GJt as cw,UJt as cx,aye as cy,ZJt as cz,ll as d,vQt as d0,ope as d1,xQt as d2,r2 as d3,VB as d4,gPt as d5,Jt as d6,vHt as d7,hHt as d8,B9e as d9,wQt as da,eFt as db,XHt as dc,bQt as dd,bp as de,ZF as df,LR as dg,zZt as dh,RZt as di,KJt as dj,DJt as dk,T0 as e,_r as f,yQt as g,Ce as h,Z as i,Hr as j,O2e as k,K as l,d as m,bt as n,dn as o,TYt as p,Qe as q,St as r,kr as s,ie as t,ha as u,li as v,e_t as w,W2 as x,gt as y,E0 as z};
|