dsh-open-artifact 0.16.2 → 0.16.3
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/CHANGELOG.md +26 -0
- package/icon.svg +1 -1
- package/lib/client.js +2504 -2430
- package/lib/index.js +26 -8
- package/package.json +1 -1
- package/skills/open-artifact/SKILL.md +8 -5
- package/vendor/frame-host/client/comments.js +1 -1
- package/vendor/frame-host/frame-host.mjs +15 -2
- package/vendor/harnesses/antigravity.json +3 -0
- package/vendor/harnesses/chatgpt.json +3 -0
- package/vendor/harnesses/claude-code.json +3 -0
- package/vendor/harnesses/codex.json +3 -0
- package/vendor/harnesses/copilot.json +3 -0
- package/vendor/harnesses/cursor.json +3 -0
- package/vendor/harnesses/dsh.json +3 -0
- package/vendor/harnesses/zcode.json +3 -0
- package/vendor/home/assets/index-BMcfb5B7.css +1 -0
- package/vendor/home/assets/index-CxVzqoE0.js +43 -0
- package/vendor/home/index.html +2 -2
- package/vendor/open-artifact.mjs +1278 -456
- package/vendor/runtime.json +1 -1
- package/vendor/shell/assets/index-BMcfb5B7.css +1 -0
- package/vendor/{type-server/shell/assets/index-xloVcJb_.js → shell/assets/index-C_XsG-Qe.js} +1 -1
- package/vendor/shell/index.html +2 -2
- package/vendor/type-server/cli.mjs +16 -3
- package/vendor/type-server/editors/data/assets/{index-DcaVBiGm.js → index-CMhqwoHV.js} +1 -1
- package/vendor/type-server/editors/data/index.html +1 -1
- package/vendor/type-server/editors/design/assets/{index-B5Wv_tnf.js → index-DUW-k3ks.js} +1 -1
- package/vendor/type-server/editors/design/index.html +1 -1
- package/vendor/type-server/editors/design-system/assets/{index-BqDGbG4f.js → index-l9dVDF3y.js} +1 -1
- package/vendor/type-server/editors/design-system/index.html +1 -1
- package/vendor/type-server/editors/docs/assets/{abnfDiagram-WEYOIA3C-CDTl-yCx.js → abnfDiagram-WEYOIA3C-C7HiIlhQ.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{architectureDiagram-ZHVYKT53-BOl_bS-V.js → architectureDiagram-ZHVYKT53-BNtmYbnl.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{blockDiagram-RJAE7QA3-CkMxyQ6a.js → blockDiagram-RJAE7QA3-CmB3Jqrq.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{c4Diagram-XDPPPE54-BLHAzoyQ.js → c4Diagram-XDPPPE54-BInEfPqU.js} +1 -1
- package/vendor/type-server/editors/docs/assets/channel-BT2p6jtG.js +1 -0
- package/vendor/type-server/editors/docs/assets/{chunk-2E7WHVMD-B2ZKLsyS.js → chunk-2E7WHVMD-DERsVzyR.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-2Q5K7J3B-DkNtD1xL.js → chunk-2Q5K7J3B-C5h24pTP.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-4EMNKR2T-C3xRZwqt.js → chunk-4EMNKR2T-CtlMesOe.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-55XCU76K-DEOjkZqt.js → chunk-55XCU76K-BcHXSlto.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-5VM5RSS4-DCKBSHxZ.js → chunk-5VM5RSS4-DnqXPWSg.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-JWPE2WC7-DrvooUmN.js → chunk-JWPE2WC7-Bls1jQHy.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-VQ5W62QI-DYMeK3pU.js → chunk-VQ5W62QI-B-9NPBBl.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-XXDRQBXY-Cvl-anAV.js → chunk-XXDRQBXY-DqHJwIOI.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{chunk-ZCHMQSOR-gWl3U20G.js → chunk-ZCHMQSOR-CO0N7boC.js} +2 -2
- package/vendor/type-server/editors/docs/assets/{classDiagram-v2-4MYWR3UA-On9X3_w5.js → classDiagram-v2-4MYWR3UA-Dm4tBHd-.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{core-Cw4Llisp.js → core-CMnn1N7u.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{cose-bilkent-JH36ORCC-B72D_yQn.js → cose-bilkent-JH36ORCC-DGyUtGAA.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{cynefin-EF2NZ3EQ-B_v4ABxk.js → cynefin-EF2NZ3EQ-BdlZazYw.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{cynefinDiagram-WF24UDRP-Bu9uLebD.js → cynefinDiagram-WF24UDRP-BjKufr-c.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{dagre-NK4GIZVX-DOkgWNtI.js → dagre-NK4GIZVX-BZlO2--v.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{diagram-CBK3MWTC-CgIhmBRJ.js → diagram-CBK3MWTC-3STWIa1n.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{diagram-I5XIIV2D-HpeiOnYm.js → diagram-I5XIIV2D-BIiZBp1S.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{diagram-ODIL2UCW-CWmar6iG.js → diagram-ODIL2UCW-Cxn7JmvU.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{diagram-PFBEJUXE-CXcCGIYn.js → diagram-PFBEJUXE-D2k1jJ3f.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{diagram-RJA3I4VV-jEFt8GAQ.js → diagram-RJA3I4VV-7ZRL3Uk6.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{diagram-TYUNFSNR-Da-kw_Xm.js → diagram-TYUNFSNR-Jyx-ylJA.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{ebnfDiagram-V4P3TTPT-BaZ03UMA.js → ebnfDiagram-V4P3TTPT-DGfWrKui.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{elk-QONTBCTQ-Bri5BDi4.js → elk-QONTBCTQ-B7tKj3Ar.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{erDiagram-KYQIGQAA-aju23vzr.js → erDiagram-KYQIGQAA-D06HHDAP.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{flowDiagram-IUGLLWBU-DezRFFND.js → flowDiagram-IUGLLWBU-CZJZKHIM.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{ganttDiagram-R7GPNTJY-DDDYA5M0.js → ganttDiagram-R7GPNTJY-BaBRsp-X.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{gitGraphDiagram-PDYL7XHY-Brbvftki.js → gitGraphDiagram-PDYL7XHY-B2bt-1sQ.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{index-rie6Fmea.js → index-YZPGEMCI.js} +3 -3
- package/vendor/type-server/editors/docs/assets/{infoDiagram-MVDRKAX5-Buk7jjzD.js → infoDiagram-MVDRKAX5-C1qijMFd.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{ishikawaDiagram-HPEHV2GE-k1-dGoms.js → ishikawaDiagram-HPEHV2GE-C2fcPeVy.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{journeyDiagram-BOSHW7O7-fuODgQ0y.js → journeyDiagram-BOSHW7O7-DAdGOjA_.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{kanban-definition-FNSA4HC5-0EJOb8QO.js → kanban-definition-FNSA4HC5-Cjm2BYYa.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{mermaid.core-rflC9T3b.js → mermaid.core-T4owCd57.js} +4 -4
- package/vendor/type-server/editors/docs/assets/{mindmap-definition-6OY57UG3-BA4jPnUz.js → mindmap-definition-6OY57UG3-DqNbrCsa.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{pegDiagram-ECIUJNBX-D1mSs1Df.js → pegDiagram-ECIUJNBX-B8pnl9eq.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{pieDiagram-GNMPY74T-DISpmq94.js → pieDiagram-GNMPY74T-CqN2ryDn.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{quadrantDiagram-D57K4MC3-C_DveStJ.js → quadrantDiagram-D57K4MC3-D6ZHYaMj.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{railroadDiagram-Y72NRBL7-XkLhMgFv.js → railroadDiagram-Y72NRBL7-DbFNy0DV.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{requirementDiagram-EQYSW5RA-DKtU2dUB.js → requirementDiagram-EQYSW5RA-CBjn24a2.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{sankeyDiagram-SY24JHO5-DXnpKoyA.js → sankeyDiagram-SY24JHO5-Be5yf8X0.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{sequenceDiagram-BLEHNHQU-D3XryRDT.js → sequenceDiagram-BLEHNHQU-CM75oaFL.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{sizeCapture-INFHLROL-Ce0anhUv.js → sizeCapture-INFHLROL-BS3ZKpfq.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{stateDiagram-v2-A6IESKWZ-C_-4V6la.js → stateDiagram-v2-A6IESKWZ-DBao6lhy.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{swimlanes-B3ENRKFQ-DsaAidHj.js → swimlanes-B3ENRKFQ-OBdPnY1S.js} +1 -1
- package/vendor/type-server/editors/docs/assets/swimlanesDiagram-AYQRV4AK-D73Zrbfj.js +8 -0
- package/vendor/type-server/editors/docs/assets/{timeline-definition-JXYKGLGB-DfKECQ2o.js → timeline-definition-JXYKGLGB-BqkDYP31.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{usecaseDiagram-WPOLBNNX-Dc8tWzRe.js → usecaseDiagram-WPOLBNNX-0IvdCTW3.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{vennDiagram-Q3Y3IDCW-tc61BjSp.js → vennDiagram-Q3Y3IDCW-Dt2rtwRE.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{wardleyDiagram-IVAIDKWA-DyVqcsy4.js → wardleyDiagram-IVAIDKWA-G9f9s0F7.js} +1 -1
- package/vendor/type-server/editors/docs/assets/{xychartDiagram-4URNHDU4-B8VxiLaY.js → xychartDiagram-4URNHDU4-CaUTu_0n.js} +1 -1
- package/vendor/type-server/editors/docs/index.html +1 -1
- package/vendor/type-server/editors/motion/assets/{gif-jobs-DY7KR2r5.js → gif-jobs-C1zQj3s9.js} +1 -1
- package/vendor/type-server/editors/motion/assets/{index-DBRxctvJ.js → index-Cw_UcKR5.js} +3 -3
- package/vendor/type-server/editors/motion/assets/{src-CP9lpzx7.js → src-wn9P_DUt.js} +1 -1
- package/vendor/type-server/editors/motion/index.html +1 -1
- package/vendor/type-server/editors/sheets/assets/{index-B6FKM2kq.js → index-C3CIL5GM.js} +2 -2
- package/vendor/type-server/editors/sheets/assets/{workbook-worker-D4VqJhLz.js → workbook-worker-CbhVg0YQ.js} +1 -1
- package/vendor/type-server/editors/sheets/index.html +1 -1
- package/vendor/type-server/editors/slides/assets/{index-DI_AWWuc.js → index-fJEPQZQY.js} +2 -2
- package/vendor/type-server/editors/slides/assets/{src-CWCcr2Hw.js → src-mZdWgqty.js} +1 -1
- package/vendor/type-server/editors/slides/index.html +1 -1
- package/vendor/type-server/editors/whiteboard/assets/{drawing-look-worker-CS2Hv0Nf.js → drawing-look-worker-gMYrygDq.js} +2 -2
- package/vendor/type-server/editors/whiteboard/assets/{index-BkWtA61j.js → index-BtZ30wGI.js} +2 -2
- package/vendor/type-server/editors/whiteboard/index.html +1 -1
- package/vendor/type-server/shell/assets/index-BMcfb5B7.css +1 -0
- package/vendor/{shell/assets/index-xloVcJb_.js → type-server/shell/assets/index-C_XsG-Qe.js} +1 -1
- package/vendor/type-server/shell/index.html +2 -2
- package/vendor/home/assets/index-CQTGVxZi.js +0 -43
- package/vendor/home/assets/index-CkjifzaW.css +0 -1
- package/vendor/shell/assets/index-CkjifzaW.css +0 -1
- package/vendor/type-server/editors/docs/assets/channel-CR_04g-H.js +0 -1
- package/vendor/type-server/editors/docs/assets/swimlanesDiagram-AYQRV4AK-iNMg14LW.js +0 -8
- package/vendor/type-server/shell/assets/index-CkjifzaW.css +0 -1
|
@@ -7,7 +7,7 @@ function oq(t,e){for(var n=0;n<e.length;n++){const o=e[n];if(typeof o!="string"&
|
|
|
7
7
|
`+V[m].replace(" at new "," at ");return a.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",a.displayName)),ae}while(1<=m&&0<=x);break}}}finally{Fe=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?Oe(f):""}function Ee(a,c){switch(a.tag){case 26:case 27:case 5:return Oe(a.type);case 16:return Oe("Lazy");case 13:return a.child!==c&&c!==null?Oe("Suspense Fallback"):Oe("Suspense");case 19:return Oe("SuspenseList");case 0:case 15:return nt(a.type,!1);case 11:return nt(a.type.render,!1);case 1:return nt(a.type,!0);case 31:return Oe("Activity");default:return""}}function Je(a){try{var c="",f=null;do c+=Ee(a,f),f=a,a=a.return;while(a);return c}catch(m){return`
|
|
8
8
|
Error generating stack: `+m.message+`
|
|
9
9
|
`+m.stack}}var _e=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,Pe=t.unstable_cancelCallback,bt=t.unstable_shouldYield,Be=t.unstable_requestPaint,fe=t.unstable_now,xe=t.unstable_getCurrentPriorityLevel,pe=t.unstable_ImmediatePriority,re=t.unstable_UserBlockingPriority,ve=t.unstable_NormalPriority,Ze=t.unstable_LowPriority,Ln=t.unstable_IdlePriority,So=t.log,dn=t.unstable_setDisableYieldValue,Te=null,rt=null;function _t(a){if(typeof So=="function"&&dn(a),rt&&typeof rt.setStrictMode=="function")try{rt.setStrictMode(Te,a)}catch{}}var Jt=Math.clz32?Math.clz32:cs,ls=Math.log,Bs=Math.LN2;function cs(a){return a>>>=0,a===0?32:31-(ls(a)/Bs|0)|0}var vn=256,zs=262144,dt=4194304;function un(a){var c=a&42;if(c!==0)return c;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Un(a,c,f){var m=a.pendingLanes;if(m===0)return 0;var x=0,v=a.suspendedLanes,A=a.pingedLanes;a=a.warmLanes;var L=m&134217727;return L!==0?(m=L&~v,m!==0?x=un(m):(A&=L,A!==0?x=un(A):f||(f=L&~a,f!==0&&(x=un(f))))):(L=m&~v,L!==0?x=un(L):A!==0?x=un(A):f||(f=m&~a,f!==0&&(x=un(f)))),x===0?0:c!==0&&c!==x&&(c&v)===0&&(v=x&-x,f=c&-c,v>=f||v===32&&(f&4194048)!==0)?c:x}function kn(a,c){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&c)===0}function ni(a,c){switch(a){case 1:case 2:case 4:case 8:case 64:return c+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jo(){var a=dt;return dt<<=1,(dt&62914560)===0&&(dt=4194304),a}function _r(a){for(var c=[],f=0;31>f;f++)c.push(a);return c}function us(a,c){a.pendingLanes|=c,c!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function ic(a,c,f,m,x,v){var A=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var L=a.entanglements,V=a.expirationTimes,ee=a.hiddenUpdates;for(f=A&~f;0<f;){var ae=31-Jt(f),ue=1<<ae;L[ae]=0,V[ae]=-1;var te=ee[ae];if(te!==null)for(ee[ae]=null,ae=0;ae<te.length;ae++){var se=te[ae];se!==null&&(se.lane&=-536870913)}f&=~ue}m!==0&&Is(a,m,0),v!==0&&x===0&&a.tag!==0&&(a.suspendedLanes|=v&~(A&~c))}function Is(a,c,f){a.pendingLanes|=c,a.suspendedLanes&=~c;var m=31-Jt(c);a.entangledLanes|=c,a.entanglements[m]=a.entanglements[m]|1073741824|f&261930}function Mr(a,c){var f=a.entangledLanes|=c;for(a=a.entanglements;f;){var m=31-Jt(f),x=1<<m;x&c|a[m]&c&&(a[m]|=c),f&=~x}}function Or(a,c){var f=c&-c;return f=(f&42)!==0?1:Ar(f),(f&(a.suspendedLanes|c))!==0?0:f}function Ar(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function Xa(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function bp(){var a=q.p;return a!==0?a:(a=window.event,a===void 0?32:hO(a.type))}function wp(a,c){var f=q.p;try{return q.p=a,c()}finally{q.p=f}}var Rr=Math.random().toString(36).slice(2),Vn="__reactFiber$"+Rr,Co="__reactProps$"+Rr,rc="__reactContainer$"+Rr,gw="__reactEvents$"+Rr,K6="__reactListeners$"+Rr,W6="__reactHandles$"+Rr,OT="__reactResources$"+Rr,rd="__reactMarker$"+Rr;function yw(a){delete a[Vn],delete a[Co],delete a[gw],delete a[K6],delete a[W6]}function ac(a){var c=a[Vn];if(c)return c;for(var f=a.parentNode;f;){if(c=f[rc]||f[Vn]){if(f=c.alternate,c.child!==null||f!==null&&f.child!==null)for(a=JM(a);a!==null;){if(f=a[Vn])return f;a=JM(a)}return c}a=f,f=a.parentNode}return null}function lc(a){if(a=a[Vn]||a[rc]){var c=a.tag;if(c===5||c===6||c===13||c===31||c===26||c===27||c===3)return a}return null}function ad(a){var c=a.tag;if(c===5||c===26||c===27||c===6)return a.stateNode;throw Error(o(33))}function cc(a){var c=a[OT];return c||(c=a[OT]={hoistableStyles:new Map,hoistableScripts:new Map}),c}function $n(a){a[rd]=!0}var AT=new Set,RT={};function Ja(a,c){uc(a,c),uc(a+"Capture",c)}function uc(a,c){for(RT[a]=c,a=0;a<c.length;a++)AT.add(c[a])}var Y6=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),NT={},DT={};function G6(a){return _e.call(DT,a)?!0:_e.call(NT,a)?!1:Y6.test(a)?DT[a]=!0:(NT[a]=!0,!1)}function xp(a,c,f){if(G6(c))if(f===null)a.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":a.removeAttribute(c);return;case"boolean":var m=c.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(c);return}}a.setAttribute(c,""+f)}}function vp(a,c,f){if(f===null)a.removeAttribute(c);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttribute(c,""+f)}}function _i(a,c,f,m){if(m===null)a.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(f);return}a.setAttributeNS(c,f,""+m)}}function ds(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function PT(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function X6(a,c,f){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,c);if(!a.hasOwnProperty(c)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var x=m.get,v=m.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return x.call(this)},set:function(A){f=""+A,v.call(this,A)}}),Object.defineProperty(a,c,{enumerable:m.enumerable}),{getValue:function(){return f},setValue:function(A){f=""+A},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function bw(a){if(!a._valueTracker){var c=PT(a)?"checked":"value";a._valueTracker=X6(a,c,""+a[c])}}function BT(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var f=c.getValue(),m="";return a&&(m=PT(a)?a.checked?"true":"false":a.value),a=m,a!==f?(c.setValue(a),!0):!1}function kp(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var J6=/[\n"\\]/g;function fs(a){return a.replace(J6,function(c){return"\\"+c.charCodeAt(0).toString(16)+" "})}function ww(a,c,f,m,x,v,A,L){a.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?a.type=A:a.removeAttribute("type"),c!=null?A==="number"?(c===0&&a.value===""||a.value!=c)&&(a.value=""+ds(c)):a.value!==""+ds(c)&&(a.value=""+ds(c)):A!=="submit"&&A!=="reset"||a.removeAttribute("value"),c!=null?xw(a,A,ds(c)):f!=null?xw(a,A,ds(f)):m!=null&&a.removeAttribute("value"),x==null&&v!=null&&(a.defaultChecked=!!v),x!=null&&(a.checked=x&&typeof x!="function"&&typeof x!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?a.name=""+ds(L):a.removeAttribute("name")}function zT(a,c,f,m,x,v,A,L){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(a.type=v),c!=null||f!=null){if(!(v!=="submit"&&v!=="reset"||c!=null)){bw(a);return}f=f!=null?""+ds(f):"",c=c!=null?""+ds(c):f,L||c===a.value||(a.value=c),a.defaultValue=c}m=m??x,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=L?a.checked:!!m,a.defaultChecked=!!m,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(a.name=A),bw(a)}function xw(a,c,f){c==="number"&&kp(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function dc(a,c,f,m){if(a=a.options,c){c={};for(var x=0;x<f.length;x++)c["$"+f[x]]=!0;for(f=0;f<a.length;f++)x=c.hasOwnProperty("$"+a[f].value),a[f].selected!==x&&(a[f].selected=x),x&&m&&(a[f].defaultSelected=!0)}else{for(f=""+ds(f),c=null,x=0;x<a.length;x++){if(a[x].value===f){a[x].selected=!0,m&&(a[x].defaultSelected=!0);return}c!==null||a[x].disabled||(c=a[x])}c!==null&&(c.selected=!0)}}function IT(a,c,f){if(c!=null&&(c=""+ds(c),c!==a.value&&(a.value=c),f==null)){a.defaultValue!==c&&(a.defaultValue=c);return}a.defaultValue=f!=null?""+ds(f):""}function LT(a,c,f,m){if(c==null){if(m!=null){if(f!=null)throw Error(o(92));if(K(m)){if(1<m.length)throw Error(o(93));m=m[0]}f=m}f==null&&(f=""),c=f}f=ds(c),a.defaultValue=f,m=a.textContent,m===f&&m!==""&&m!==null&&(a.value=m),bw(a)}function fc(a,c){if(c){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=c;return}}a.textContent=c}var Q6=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function $T(a,c,f){var m=c.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?m?a.setProperty(c,""):c==="float"?a.cssFloat="":a[c]="":m?a.setProperty(c,f):typeof f!="number"||f===0||Q6.has(c)?c==="float"?a.cssFloat=f:a[c]=(""+f).trim():a[c]=f+"px"}function FT(a,c,f){if(c!=null&&typeof c!="object")throw Error(o(62));if(a=a.style,f!=null){for(var m in f)!f.hasOwnProperty(m)||c!=null&&c.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var x in c)m=c[x],c.hasOwnProperty(x)&&f[x]!==m&&$T(a,x,m)}else for(var v in c)c.hasOwnProperty(v)&&$T(a,v,c[v])}function vw(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Z6=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),e8=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Sp(a){return e8.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Mi(){}var kw=null;function Sw(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var hc=null,pc=null;function HT(a){var c=lc(a);if(c&&(a=c.stateNode)){var f=a[Co]||null;e:switch(a=c.stateNode,c.type){case"input":if(ww(a,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),c=f.name,f.type==="radio"&&c!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+fs(""+c)+'"][type="radio"]'),c=0;c<f.length;c++){var m=f[c];if(m!==a&&m.form===a.form){var x=m[Co]||null;if(!x)throw Error(o(90));ww(m,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(c=0;c<f.length;c++)m=f[c],m.form===a.form&&BT(m)}break e;case"textarea":IT(a,f.value,f.defaultValue);break e;case"select":c=f.value,c!=null&&dc(a,!!f.multiple,c,!1)}}}var jw=!1;function qT(a,c,f){if(jw)return a(c,f);jw=!0;try{var m=a(c);return m}finally{if(jw=!1,(hc!==null||pc!==null)&&(um(),hc&&(c=hc,a=pc,pc=hc=null,HT(c),a)))for(c=0;c<a.length;c++)HT(a[c])}}function ld(a,c){var f=a.stateNode;if(f===null)return null;var m=f[Co]||null;if(m===null)return null;f=m[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(o(231,c,typeof f));return f}var Oi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cw=!1;if(Oi)try{var cd={};Object.defineProperty(cd,"passive",{get:function(){Cw=!0}}),window.addEventListener("test",cd,cd),window.removeEventListener("test",cd,cd)}catch{Cw=!1}var Nr=null,Tw=null,jp=null;function UT(){if(jp)return jp;var a,c=Tw,f=c.length,m,x="value"in Nr?Nr.value:Nr.textContent,v=x.length;for(a=0;a<f&&c[a]===x[a];a++);var A=f-a;for(m=1;m<=A&&c[f-m]===x[v-m];m++);return jp=x.slice(a,1<m?1-m:void 0)}function Cp(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function Tp(){return!0}function VT(){return!1}function To(a){function c(f,m,x,v,A){this._reactName=f,this._targetInst=x,this.type=m,this.nativeEvent=v,this.target=A,this.currentTarget=null;for(var L in a)a.hasOwnProperty(L)&&(f=a[L],this[L]=f?f(v):v[L]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Tp:VT,this.isPropagationStopped=VT,this}return p(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Tp)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Tp)},persist:function(){},isPersistent:Tp}),c}var Qa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ep=To(Qa),ud=p({},Qa,{view:0,detail:0}),t8=To(ud),Ew,_w,dd,_p=p({},ud,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ow,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==dd&&(dd&&a.type==="mousemove"?(Ew=a.screenX-dd.screenX,_w=a.screenY-dd.screenY):_w=Ew=0,dd=a),Ew)},movementY:function(a){return"movementY"in a?a.movementY:_w}}),KT=To(_p),n8=p({},_p,{dataTransfer:0}),o8=To(n8),s8=p({},ud,{relatedTarget:0}),Mw=To(s8),i8=p({},Qa,{animationName:0,elapsedTime:0,pseudoElement:0}),r8=To(i8),a8=p({},Qa,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),l8=To(a8),c8=p({},Qa,{data:0}),WT=To(c8),u8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},d8={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},f8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function h8(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=f8[a])?!!c[a]:!1}function Ow(){return h8}var p8=p({},ud,{key:function(a){if(a.key){var c=u8[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=Cp(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?d8[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ow,charCode:function(a){return a.type==="keypress"?Cp(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Cp(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),m8=To(p8),g8=p({},_p,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),YT=To(g8),y8=p({},ud,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ow}),b8=To(y8),w8=p({},Qa,{propertyName:0,elapsedTime:0,pseudoElement:0}),x8=To(w8),v8=p({},_p,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),k8=To(v8),S8=p({},Qa,{newState:0,oldState:0}),j8=To(S8),C8=[9,13,27,32],Aw=Oi&&"CompositionEvent"in window,fd=null;Oi&&"documentMode"in document&&(fd=document.documentMode);var T8=Oi&&"TextEvent"in window&&!fd,GT=Oi&&(!Aw||fd&&8<fd&&11>=fd),XT=" ",JT=!1;function QT(a,c){switch(a){case"keyup":return C8.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ZT(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var mc=!1;function E8(a,c){switch(a){case"compositionend":return ZT(c);case"keypress":return c.which!==32?null:(JT=!0,XT);case"textInput":return a=c.data,a===XT&&JT?null:a;default:return null}}function _8(a,c){if(mc)return a==="compositionend"||!Aw&&QT(a,c)?(a=UT(),jp=Tw=Nr=null,mc=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return GT&&c.locale!=="ko"?null:c.data;default:return null}}var M8={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function eE(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!M8[a.type]:c==="textarea"}function tE(a,c,f,m){hc?pc?pc.push(m):pc=[m]:hc=m,c=ym(c,"onChange"),0<c.length&&(f=new Ep("onChange","change",null,f,m),a.push({event:f,listeners:c}))}var hd=null,pd=null;function O8(a){zM(a,0)}function Mp(a){var c=ad(a);if(BT(c))return a}function nE(a,c){if(a==="change")return c}var oE=!1;if(Oi){var Rw;if(Oi){var Nw="oninput"in document;if(!Nw){var sE=document.createElement("div");sE.setAttribute("oninput","return;"),Nw=typeof sE.oninput=="function"}Rw=Nw}else Rw=!1;oE=Rw&&(!document.documentMode||9<document.documentMode)}function iE(){hd&&(hd.detachEvent("onpropertychange",rE),pd=hd=null)}function rE(a){if(a.propertyName==="value"&&Mp(pd)){var c=[];tE(c,pd,a,Sw(a)),qT(O8,c)}}function A8(a,c,f){a==="focusin"?(iE(),hd=c,pd=f,hd.attachEvent("onpropertychange",rE)):a==="focusout"&&iE()}function R8(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Mp(pd)}function N8(a,c){if(a==="click")return Mp(c)}function D8(a,c){if(a==="input"||a==="change")return Mp(c)}function P8(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var Uo=typeof Object.is=="function"?Object.is:P8;function md(a,c){if(Uo(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var f=Object.keys(a),m=Object.keys(c);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var x=f[m];if(!_e.call(c,x)||!Uo(a[x],c[x]))return!1}return!0}function aE(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function lE(a,c){var f=aE(a);a=0;for(var m;f;){if(f.nodeType===3){if(m=a+f.textContent.length,a<=c&&m>=c)return{node:f,offset:c-a};a=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=aE(f)}}function cE(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?cE(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function uE(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var c=kp(a.document);c instanceof a.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)a=c.contentWindow;else break;c=kp(a.document)}return c}function Dw(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}var B8=Oi&&"documentMode"in document&&11>=document.documentMode,gc=null,Pw=null,gd=null,Bw=!1;function dE(a,c,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Bw||gc==null||gc!==kp(m)||(m=gc,"selectionStart"in m&&Dw(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),gd&&md(gd,m)||(gd=m,m=ym(Pw,"onSelect"),0<m.length&&(c=new Ep("onSelect","select",null,c,f),a.push({event:c,listeners:m}),c.target=gc)))}function Za(a,c){var f={};return f[a.toLowerCase()]=c.toLowerCase(),f["Webkit"+a]="webkit"+c,f["Moz"+a]="moz"+c,f}var yc={animationend:Za("Animation","AnimationEnd"),animationiteration:Za("Animation","AnimationIteration"),animationstart:Za("Animation","AnimationStart"),transitionrun:Za("Transition","TransitionRun"),transitionstart:Za("Transition","TransitionStart"),transitioncancel:Za("Transition","TransitionCancel"),transitionend:Za("Transition","TransitionEnd")},zw={},fE={};Oi&&(fE=document.createElement("div").style,"AnimationEvent"in window||(delete yc.animationend.animation,delete yc.animationiteration.animation,delete yc.animationstart.animation),"TransitionEvent"in window||delete yc.transitionend.transition);function el(a){if(zw[a])return zw[a];if(!yc[a])return a;var c=yc[a],f;for(f in c)if(c.hasOwnProperty(f)&&f in fE)return zw[a]=c[f];return a}var hE=el("animationend"),pE=el("animationiteration"),mE=el("animationstart"),z8=el("transitionrun"),I8=el("transitionstart"),L8=el("transitioncancel"),gE=el("transitionend"),yE=new Map,Iw="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Iw.push("scrollEnd");function Ls(a,c){yE.set(a,c),Ja(c,[a])}var Op=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},hs=[],bc=0,Lw=0;function Ap(){for(var a=bc,c=Lw=bc=0;c<a;){var f=hs[c];hs[c++]=null;var m=hs[c];hs[c++]=null;var x=hs[c];hs[c++]=null;var v=hs[c];if(hs[c++]=null,m!==null&&x!==null){var A=m.pending;A===null?x.next=x:(x.next=A.next,A.next=x),m.pending=x}v!==0&&bE(f,x,v)}}function Rp(a,c,f,m){hs[bc++]=a,hs[bc++]=c,hs[bc++]=f,hs[bc++]=m,Lw|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function $w(a,c,f,m){return Rp(a,c,f,m),Np(a)}function tl(a,c){return Rp(a,null,null,c),Np(a)}function bE(a,c,f){a.lanes|=f;var m=a.alternate;m!==null&&(m.lanes|=f);for(var x=!1,v=a.return;v!==null;)v.childLanes|=f,m=v.alternate,m!==null&&(m.childLanes|=f),v.tag===22&&(a=v.stateNode,a===null||a._visibility&1||(x=!0)),a=v,v=v.return;return a.tag===3?(v=a.stateNode,x&&c!==null&&(x=31-Jt(f),a=v.hiddenUpdates,m=a[x],m===null?a[x]=[c]:m.push(c),c.lane=f|536870912),v):null}function Np(a){if(50<Id)throw Id=0,Gx=null,Error(o(185));for(var c=a.return;c!==null;)a=c,c=a.return;return a.tag===3?a.stateNode:null}var wc={};function $8(a,c,f,m){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vo(a,c,f,m){return new $8(a,c,f,m)}function Fw(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Ai(a,c){var f=a.alternate;return f===null?(f=Vo(a.tag,c,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=c,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&65011712,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,c=a.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f.refCleanup=a.refCleanup,f}function wE(a,c){a.flags&=65011714;var f=a.alternate;return f===null?(a.childLanes=0,a.lanes=c,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=f.childLanes,a.lanes=f.lanes,a.child=f.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=f.memoizedProps,a.memoizedState=f.memoizedState,a.updateQueue=f.updateQueue,a.type=f.type,c=f.dependencies,a.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),a}function Dp(a,c,f,m,x,v){var A=0;if(m=a,typeof a=="function")Fw(a)&&(A=1);else if(typeof a=="string")A=VH(a,f,X.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case R:return a=Vo(31,f,c,x),a.elementType=R,a.lanes=v,a;case k:return nl(f.children,x,v,c);case j:A=8,x|=24;break;case C:return a=Vo(12,f,c,x|2),a.elementType=C,a.lanes=v,a;case O:return a=Vo(13,f,c,x),a.elementType=O,a.lanes=v,a;case N:return a=Vo(19,f,c,x),a.elementType=N,a.lanes=v,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case T:A=10;break e;case _:A=9;break e;case M:A=11;break e;case D:A=14;break e;case E:A=16,m=null;break e}A=29,f=Error(o(130,a===null?"null":typeof a,"")),m=null}return c=Vo(A,f,c,x),c.elementType=a,c.type=m,c.lanes=v,c}function nl(a,c,f,m){return a=Vo(7,a,m,c),a.lanes=f,a}function Hw(a,c,f){return a=Vo(6,a,null,c),a.lanes=f,a}function xE(a){var c=Vo(18,null,null,0);return c.stateNode=a,c}function qw(a,c,f){return c=Vo(4,a.children!==null?a.children:[],a.key,c),c.lanes=f,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}var vE=new WeakMap;function ps(a,c){if(typeof a=="object"&&a!==null){var f=vE.get(a);return f!==void 0?f:(c={value:a,source:c,stack:Je(c)},vE.set(a,c),c)}return{value:a,source:c,stack:Je(c)}}var xc=[],vc=0,Pp=null,yd=0,ms=[],gs=0,Dr=null,oi=1,si="";function Ri(a,c){xc[vc++]=yd,xc[vc++]=Pp,Pp=a,yd=c}function kE(a,c,f){ms[gs++]=oi,ms[gs++]=si,ms[gs++]=Dr,Dr=a;var m=oi;a=si;var x=32-Jt(m)-1;m&=~(1<<x),f+=1;var v=32-Jt(c)+x;if(30<v){var A=x-x%5;v=(m&(1<<A)-1).toString(32),m>>=A,x-=A,oi=1<<32-Jt(c)+x|f<<x|m,si=v+a}else oi=1<<v|f<<x|m,si=a}function Uw(a){a.return!==null&&(Ri(a,1),kE(a,1,0))}function Vw(a){for(;a===Pp;)Pp=xc[--vc],xc[vc]=null,yd=xc[--vc],xc[vc]=null;for(;a===Dr;)Dr=ms[--gs],ms[gs]=null,si=ms[--gs],ms[gs]=null,oi=ms[--gs],ms[gs]=null}function SE(a,c){ms[gs++]=oi,ms[gs++]=si,ms[gs++]=Dr,oi=c.id,si=c.overflow,Dr=a}var Kn=null,en=null,Tt=!1,Pr=null,ys=!1,Kw=Error(o(519));function Br(a){var c=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bd(ps(c,a)),Kw}function jE(a){var c=a.stateNode,f=a.type,m=a.memoizedProps;switch(c[Vn]=a,c[Co]=m,f){case"dialog":xt("cancel",c),xt("close",c);break;case"iframe":case"object":case"embed":xt("load",c);break;case"video":case"audio":for(f=0;f<$d.length;f++)xt($d[f],c);break;case"source":xt("error",c);break;case"img":case"image":case"link":xt("error",c),xt("load",c);break;case"details":xt("toggle",c);break;case"input":xt("invalid",c),zT(c,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":xt("invalid",c);break;case"textarea":xt("invalid",c),LT(c,m.value,m.defaultValue,m.children)}f=m.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||c.textContent===""+f||m.suppressHydrationWarning===!0||FM(c.textContent,f)?(m.popover!=null&&(xt("beforetoggle",c),xt("toggle",c)),m.onScroll!=null&&xt("scroll",c),m.onScrollEnd!=null&&xt("scrollend",c),m.onClick!=null&&(c.onclick=Mi),c=!0):c=!1,c||Br(a,!0)}function CE(a){for(Kn=a.return;Kn;)switch(Kn.tag){case 5:case 31:case 13:ys=!1;return;case 27:case 3:ys=!0;return;default:Kn=Kn.return}}function kc(a){if(a!==Kn)return!1;if(!Tt)return CE(a),Tt=!0,!1;var c=a.tag,f;if((f=c!==3&&c!==27)&&((f=c===5)&&(f=a.type,f=!(f!=="form"&&f!=="button")||u0(a.type,a.memoizedProps)),f=!f),f&&en&&Br(a),CE(a),c===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(o(317));en=XM(a)}else if(c===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(o(317));en=XM(a)}else c===27?(c=en,Xr(a.type)?(a=m0,m0=null,en=a):en=c):en=Kn?ws(a.stateNode.nextSibling):null;return!0}function ol(){en=Kn=null,Tt=!1}function Ww(){var a=Pr;return a!==null&&(Oo===null?Oo=a:Oo.push.apply(Oo,a),Pr=null),a}function bd(a){Pr===null?Pr=[a]:Pr.push(a)}var Yw=z(null),sl=null,Ni=null;function zr(a,c,f){J(Yw,c._currentValue),c._currentValue=f}function Di(a){a._currentValue=Yw.current,U(Yw)}function Gw(a,c,f){for(;a!==null;){var m=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,m!==null&&(m.childLanes|=c)):m!==null&&(m.childLanes&c)!==c&&(m.childLanes|=c),a===f)break;a=a.return}}function Xw(a,c,f,m){var x=a.child;for(x!==null&&(x.return=a);x!==null;){var v=x.dependencies;if(v!==null){var A=x.child;v=v.firstContext;e:for(;v!==null;){var L=v;v=x;for(var V=0;V<c.length;V++)if(L.context===c[V]){v.lanes|=f,L=v.alternate,L!==null&&(L.lanes|=f),Gw(v.return,f,a),m||(A=null);break e}v=L.next}}else if(x.tag===18){if(A=x.return,A===null)throw Error(o(341));A.lanes|=f,v=A.alternate,v!==null&&(v.lanes|=f),Gw(A,f,a),A=null}else A=x.child;if(A!==null)A.return=x;else for(A=x;A!==null;){if(A===a){A=null;break}if(x=A.sibling,x!==null){x.return=A.return,A=x;break}A=A.return}x=A}}function Sc(a,c,f,m){a=null;for(var x=c,v=!1;x!==null;){if(!v){if((x.flags&524288)!==0)v=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var A=x.alternate;if(A===null)throw Error(o(387));if(A=A.memoizedProps,A!==null){var L=x.type;Uo(x.pendingProps.value,A.value)||(a!==null?a.push(L):a=[L])}}else if(x===be.current){if(A=x.alternate,A===null)throw Error(o(387));A.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(a!==null?a.push(Vd):a=[Vd])}x=x.return}a!==null&&Xw(c,a,f,m),c.flags|=262144}function Bp(a){for(a=a.firstContext;a!==null;){if(!Uo(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function il(a){sl=a,Ni=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Wn(a){return TE(sl,a)}function zp(a,c){return sl===null&&il(a),TE(a,c)}function TE(a,c){var f=c._currentValue;if(c={context:c,memoizedValue:f,next:null},Ni===null){if(a===null)throw Error(o(308));Ni=c,a.dependencies={lanes:0,firstContext:c},a.flags|=524288}else Ni=Ni.next=c;return f}var F8=typeof AbortController<"u"?AbortController:function(){var a=[],c=this.signal={aborted:!1,addEventListener:function(f,m){a.push(m)}};this.abort=function(){c.aborted=!0,a.forEach(function(f){return f()})}},H8=t.unstable_scheduleCallback,q8=t.unstable_NormalPriority,Sn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jw(){return{controller:new F8,data:new Map,refCount:0}}function wd(a){a.refCount--,a.refCount===0&&H8(q8,function(){a.controller.abort()})}var xd=null,Qw=0,jc=0,Cc=null;function U8(a,c){if(xd===null){var f=xd=[];Qw=0,jc=t0(),Cc={status:"pending",value:void 0,then:function(m){f.push(m)}}}return Qw++,c.then(EE,EE),c}function EE(){if(--Qw===0&&xd!==null){Cc!==null&&(Cc.status="fulfilled");var a=xd;xd=null,jc=0,Cc=null;for(var c=0;c<a.length;c++)(0,a[c])()}}function V8(a,c){var f=[],m={status:"pending",value:null,reason:null,then:function(x){f.push(x)}};return a.then(function(){m.status="fulfilled",m.value=c;for(var x=0;x<f.length;x++)(0,f[x])(c)},function(x){for(m.status="rejected",m.reason=x,x=0;x<f.length;x++)(0,f[x])(void 0)}),m}var _E=F.S;F.S=function(a,c){dM=fe(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&U8(a,c),_E!==null&&_E(a,c)};var rl=z(null);function Zw(){var a=rl.current;return a!==null?a:Qt.pooledCache}function Ip(a,c){c===null?J(rl,rl.current):J(rl,c.pool)}function ME(){var a=Zw();return a===null?null:{parent:Sn._currentValue,pool:a}}var Tc=Error(o(460)),ex=Error(o(474)),Lp=Error(o(542)),$p={then:function(){}};function OE(a){return a=a.status,a==="fulfilled"||a==="rejected"}function AE(a,c,f){switch(f=a[f],f===void 0?a.push(c):f!==c&&(c.then(Mi,Mi),c=f),c.status){case"fulfilled":return c.value;case"rejected":throw a=c.reason,NE(a),a;default:if(typeof c.status=="string")c.then(Mi,Mi);else{if(a=Qt,a!==null&&100<a.shellSuspendCounter)throw Error(o(482));a=c,a.status="pending",a.then(function(m){if(c.status==="pending"){var x=c;x.status="fulfilled",x.value=m}},function(m){if(c.status==="pending"){var x=c;x.status="rejected",x.reason=m}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw a=c.reason,NE(a),a}throw ll=c,Tc}}function al(a){try{var c=a._init;return c(a._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(ll=f,Tc):f}}var ll=null;function RE(){if(ll===null)throw Error(o(459));var a=ll;return ll=null,a}function NE(a){if(a===Tc||a===Lp)throw Error(o(483))}var Ec=null,vd=0;function Fp(a){var c=vd;return vd+=1,Ec===null&&(Ec=[]),AE(Ec,a,c)}function kd(a,c){c=c.props.ref,a.ref=c!==void 0?c:null}function Hp(a,c){throw c.$$typeof===g?Error(o(525)):(a=Object.prototype.toString.call(c),Error(o(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a)))}function DE(a){function c(Q,G){if(a){var Z=Q.deletions;Z===null?(Q.deletions=[G],Q.flags|=16):Z.push(G)}}function f(Q,G){if(!a)return null;for(;G!==null;)c(Q,G),G=G.sibling;return null}function m(Q){for(var G=new Map;Q!==null;)Q.key!==null?G.set(Q.key,Q):G.set(Q.index,Q),Q=Q.sibling;return G}function x(Q,G){return Q=Ai(Q,G),Q.index=0,Q.sibling=null,Q}function v(Q,G,Z){return Q.index=Z,a?(Z=Q.alternate,Z!==null?(Z=Z.index,Z<G?(Q.flags|=67108866,G):Z):(Q.flags|=67108866,G)):(Q.flags|=1048576,G)}function A(Q){return a&&Q.alternate===null&&(Q.flags|=67108866),Q}function L(Q,G,Z,le){return G===null||G.tag!==6?(G=Hw(Z,Q.mode,le),G.return=Q,G):(G=x(G,Z),G.return=Q,G)}function V(Q,G,Z,le){var Ue=Z.type;return Ue===k?ae(Q,G,Z.props.children,le,Z.key):G!==null&&(G.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===E&&al(Ue)===G.type)?(G=x(G,Z.props),kd(G,Z),G.return=Q,G):(G=Dp(Z.type,Z.key,Z.props,null,Q.mode,le),kd(G,Z),G.return=Q,G)}function ee(Q,G,Z,le){return G===null||G.tag!==4||G.stateNode.containerInfo!==Z.containerInfo||G.stateNode.implementation!==Z.implementation?(G=qw(Z,Q.mode,le),G.return=Q,G):(G=x(G,Z.children||[]),G.return=Q,G)}function ae(Q,G,Z,le,Ue){return G===null||G.tag!==7?(G=nl(Z,Q.mode,le,Ue),G.return=Q,G):(G=x(G,Z),G.return=Q,G)}function ue(Q,G,Z){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Hw(""+G,Q.mode,Z),G.return=Q,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return Z=Dp(G.type,G.key,G.props,null,Q.mode,Z),kd(Z,G),Z.return=Q,Z;case w:return G=qw(G,Q.mode,Z),G.return=Q,G;case E:return G=al(G),ue(Q,G,Z)}if(K(G)||P(G))return G=nl(G,Q.mode,Z,null),G.return=Q,G;if(typeof G.then=="function")return ue(Q,Fp(G),Z);if(G.$$typeof===T)return ue(Q,zp(Q,G),Z);Hp(Q,G)}return null}function te(Q,G,Z,le){var Ue=G!==null?G.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Ue!==null?null:L(Q,G,""+Z,le);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:return Z.key===Ue?V(Q,G,Z,le):null;case w:return Z.key===Ue?ee(Q,G,Z,le):null;case E:return Z=al(Z),te(Q,G,Z,le)}if(K(Z)||P(Z))return Ue!==null?null:ae(Q,G,Z,le,null);if(typeof Z.then=="function")return te(Q,G,Fp(Z),le);if(Z.$$typeof===T)return te(Q,G,zp(Q,Z),le);Hp(Q,Z)}return null}function se(Q,G,Z,le,Ue){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Q=Q.get(Z)||null,L(G,Q,""+le,Ue);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case b:return Q=Q.get(le.key===null?Z:le.key)||null,V(G,Q,le,Ue);case w:return Q=Q.get(le.key===null?Z:le.key)||null,ee(G,Q,le,Ue);case E:return le=al(le),se(Q,G,Z,le,Ue)}if(K(le)||P(le))return Q=Q.get(Z)||null,ae(G,Q,le,Ue,null);if(typeof le.then=="function")return se(Q,G,Z,Fp(le),Ue);if(le.$$typeof===T)return se(Q,G,Z,zp(G,le),Ue);Hp(G,le)}return null}function Ne(Q,G,Z,le){for(var Ue=null,Ot=null,ze=G,ct=G=0,Ct=null;ze!==null&&ct<Z.length;ct++){ze.index>ct?(Ct=ze,ze=null):Ct=ze.sibling;var At=te(Q,ze,Z[ct],le);if(At===null){ze===null&&(ze=Ct);break}a&&ze&&At.alternate===null&&c(Q,ze),G=v(At,G,ct),Ot===null?Ue=At:Ot.sibling=At,Ot=At,ze=Ct}if(ct===Z.length)return f(Q,ze),Tt&&Ri(Q,ct),Ue;if(ze===null){for(;ct<Z.length;ct++)ze=ue(Q,Z[ct],le),ze!==null&&(G=v(ze,G,ct),Ot===null?Ue=ze:Ot.sibling=ze,Ot=ze);return Tt&&Ri(Q,ct),Ue}for(ze=m(ze);ct<Z.length;ct++)Ct=se(ze,Q,ct,Z[ct],le),Ct!==null&&(a&&Ct.alternate!==null&&ze.delete(Ct.key===null?ct:Ct.key),G=v(Ct,G,ct),Ot===null?Ue=Ct:Ot.sibling=Ct,Ot=Ct);return a&&ze.forEach(function(ta){return c(Q,ta)}),Tt&&Ri(Q,ct),Ue}function Xe(Q,G,Z,le){if(Z==null)throw Error(o(151));for(var Ue=null,Ot=null,ze=G,ct=G=0,Ct=null,At=Z.next();ze!==null&&!At.done;ct++,At=Z.next()){ze.index>ct?(Ct=ze,ze=null):Ct=ze.sibling;var ta=te(Q,ze,At.value,le);if(ta===null){ze===null&&(ze=Ct);break}a&&ze&&ta.alternate===null&&c(Q,ze),G=v(ta,G,ct),Ot===null?Ue=ta:Ot.sibling=ta,Ot=ta,ze=Ct}if(At.done)return f(Q,ze),Tt&&Ri(Q,ct),Ue;if(ze===null){for(;!At.done;ct++,At=Z.next())At=ue(Q,At.value,le),At!==null&&(G=v(At,G,ct),Ot===null?Ue=At:Ot.sibling=At,Ot=At);return Tt&&Ri(Q,ct),Ue}for(ze=m(ze);!At.done;ct++,At=Z.next())At=se(ze,Q,ct,At.value,le),At!==null&&(a&&At.alternate!==null&&ze.delete(At.key===null?ct:At.key),G=v(At,G,ct),Ot===null?Ue=At:Ot.sibling=At,Ot=At);return a&&ze.forEach(function(nq){return c(Q,nq)}),Tt&&Ri(Q,ct),Ue}function Wt(Q,G,Z,le){if(typeof Z=="object"&&Z!==null&&Z.type===k&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:e:{for(var Ue=Z.key;G!==null;){if(G.key===Ue){if(Ue=Z.type,Ue===k){if(G.tag===7){f(Q,G.sibling),le=x(G,Z.props.children),le.return=Q,Q=le;break e}}else if(G.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===E&&al(Ue)===G.type){f(Q,G.sibling),le=x(G,Z.props),kd(le,Z),le.return=Q,Q=le;break e}f(Q,G);break}else c(Q,G);G=G.sibling}Z.type===k?(le=nl(Z.props.children,Q.mode,le,Z.key),le.return=Q,Q=le):(le=Dp(Z.type,Z.key,Z.props,null,Q.mode,le),kd(le,Z),le.return=Q,Q=le)}return A(Q);case w:e:{for(Ue=Z.key;G!==null;){if(G.key===Ue)if(G.tag===4&&G.stateNode.containerInfo===Z.containerInfo&&G.stateNode.implementation===Z.implementation){f(Q,G.sibling),le=x(G,Z.children||[]),le.return=Q,Q=le;break e}else{f(Q,G);break}else c(Q,G);G=G.sibling}le=qw(Z,Q.mode,le),le.return=Q,Q=le}return A(Q);case E:return Z=al(Z),Wt(Q,G,Z,le)}if(K(Z))return Ne(Q,G,Z,le);if(P(Z)){if(Ue=P(Z),typeof Ue!="function")throw Error(o(150));return Z=Ue.call(Z),Xe(Q,G,Z,le)}if(typeof Z.then=="function")return Wt(Q,G,Fp(Z),le);if(Z.$$typeof===T)return Wt(Q,G,zp(Q,Z),le);Hp(Q,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,G!==null&&G.tag===6?(f(Q,G.sibling),le=x(G,Z),le.return=Q,Q=le):(f(Q,G),le=Hw(Z,Q.mode,le),le.return=Q,Q=le),A(Q)):f(Q,G)}return function(Q,G,Z,le){try{vd=0;var Ue=Wt(Q,G,Z,le);return Ec=null,Ue}catch(ze){if(ze===Tc||ze===Lp)throw ze;var Ot=Vo(29,ze,null,Q.mode);return Ot.lanes=le,Ot.return=Q,Ot}}}var cl=DE(!0),PE=DE(!1),Ir=!1;function tx(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nx(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Lr(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function $r(a,c,f){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(Nt&2)!==0){var x=m.pending;return x===null?c.next=c:(c.next=x.next,x.next=c),m.pending=c,c=Np(a),bE(a,null,f),c}return Rp(a,m,c,f),Np(a)}function Sd(a,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194048)!==0)){var m=c.lanes;m&=a.pendingLanes,f|=m,c.lanes=f,Mr(a,f)}}function ox(a,c){var f=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var x=null,v=null;if(f=f.firstBaseUpdate,f!==null){do{var A={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};v===null?x=v=A:v=v.next=A,f=f.next}while(f!==null);v===null?x=v=c:v=v.next=c}else x=v=c;f={baseState:m.baseState,firstBaseUpdate:x,lastBaseUpdate:v,shared:m.shared,callbacks:m.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=c}var sx=!1;function jd(){if(sx){var a=Cc;if(a!==null)throw a}}function Cd(a,c,f,m){sx=!1;var x=a.updateQueue;Ir=!1;var v=x.firstBaseUpdate,A=x.lastBaseUpdate,L=x.shared.pending;if(L!==null){x.shared.pending=null;var V=L,ee=V.next;V.next=null,A===null?v=ee:A.next=ee,A=V;var ae=a.alternate;ae!==null&&(ae=ae.updateQueue,L=ae.lastBaseUpdate,L!==A&&(L===null?ae.firstBaseUpdate=ee:L.next=ee,ae.lastBaseUpdate=V))}if(v!==null){var ue=x.baseState;A=0,ae=ee=V=null,L=v;do{var te=L.lane&-536870913,se=te!==L.lane;if(se?(jt&te)===te:(m&te)===te){te!==0&&te===jc&&(sx=!0),ae!==null&&(ae=ae.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{var Ne=a,Xe=L;te=c;var Wt=f;switch(Xe.tag){case 1:if(Ne=Xe.payload,typeof Ne=="function"){ue=Ne.call(Wt,ue,te);break e}ue=Ne;break e;case 3:Ne.flags=Ne.flags&-65537|128;case 0:if(Ne=Xe.payload,te=typeof Ne=="function"?Ne.call(Wt,ue,te):Ne,te==null)break e;ue=p({},ue,te);break e;case 2:Ir=!0}}te=L.callback,te!==null&&(a.flags|=64,se&&(a.flags|=8192),se=x.callbacks,se===null?x.callbacks=[te]:se.push(te))}else se={lane:te,tag:L.tag,payload:L.payload,callback:L.callback,next:null},ae===null?(ee=ae=se,V=ue):ae=ae.next=se,A|=te;if(L=L.next,L===null){if(L=x.shared.pending,L===null)break;se=L,L=se.next,se.next=null,x.lastBaseUpdate=se,x.shared.pending=null}}while(!0);ae===null&&(V=ue),x.baseState=V,x.firstBaseUpdate=ee,x.lastBaseUpdate=ae,v===null&&(x.shared.lanes=0),Vr|=A,a.lanes=A,a.memoizedState=ue}}function BE(a,c){if(typeof a!="function")throw Error(o(191,a));a.call(c)}function zE(a,c){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;a<f.length;a++)BE(f[a],c)}var _c=z(null),qp=z(0);function IE(a,c){a=qi,J(qp,a),J(_c,c),qi=a|c.baseLanes}function ix(){J(qp,qi),J(_c,_c.current)}function rx(){qi=qp.current,U(_c),U(qp)}var Ko=z(null),bs=null;function Fr(a){var c=a.alternate;J(yn,yn.current&1),J(Ko,a),bs===null&&(c===null||_c.current!==null||c.memoizedState!==null)&&(bs=a)}function ax(a){J(yn,yn.current),J(Ko,a),bs===null&&(bs=a)}function LE(a){a.tag===22?(J(yn,yn.current),J(Ko,a),bs===null&&(bs=a)):Hr()}function Hr(){J(yn,yn.current),J(Ko,Ko.current)}function Wo(a){U(Ko),bs===a&&(bs=null),U(yn)}var yn=z(0);function Up(a){for(var c=a;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||h0(f)||p0(f)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Pi=0,at=null,Vt=null,jn=null,Vp=!1,Mc=!1,ul=!1,Kp=0,Td=0,Oc=null,K8=0;function fn(){throw Error(o(321))}function lx(a,c){if(c===null)return!1;for(var f=0;f<c.length&&f<a.length;f++)if(!Uo(a[f],c[f]))return!1;return!0}function cx(a,c,f,m,x,v){return Pi=v,at=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,F.H=a===null||a.memoizedState===null?k_:jx,ul=!1,v=f(m,x),ul=!1,Mc&&(v=FE(c,f,m,x)),$E(a),v}function $E(a){F.H=Md;var c=Vt!==null&&Vt.next!==null;if(Pi=0,jn=Vt=at=null,Vp=!1,Td=0,Oc=null,c)throw Error(o(300));a===null||Cn||(a=a.dependencies,a!==null&&Bp(a)&&(Cn=!0))}function FE(a,c,f,m){at=a;var x=0;do{if(Mc&&(Oc=null),Td=0,Mc=!1,25<=x)throw Error(o(301));if(x+=1,jn=Vt=null,a.updateQueue!=null){var v=a.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}F.H=S_,v=c(f,m)}while(Mc);return v}function W8(){var a=F.H,c=a.useState()[0];return c=typeof c.then=="function"?Ed(c):c,a=a.useState()[0],(Vt!==null?Vt.memoizedState:null)!==a&&(at.flags|=1024),c}function ux(){var a=Kp!==0;return Kp=0,a}function dx(a,c,f){c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~f}function fx(a){if(Vp){for(a=a.memoizedState;a!==null;){var c=a.queue;c!==null&&(c.pending=null),a=a.next}Vp=!1}Pi=0,jn=Vt=at=null,Mc=!1,Td=Kp=0,Oc=null}function po(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jn===null?at.memoizedState=jn=a:jn=jn.next=a,jn}function bn(){if(Vt===null){var a=at.alternate;a=a!==null?a.memoizedState:null}else a=Vt.next;var c=jn===null?at.memoizedState:jn.next;if(c!==null)jn=c,Vt=a;else{if(a===null)throw at.alternate===null?Error(o(467)):Error(o(310));Vt=a,a={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},jn===null?at.memoizedState=jn=a:jn=jn.next=a}return jn}function Wp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ed(a){var c=Td;return Td+=1,Oc===null&&(Oc=[]),a=AE(Oc,a,c),c=at,(jn===null?c.memoizedState:jn.next)===null&&(c=c.alternate,F.H=c===null||c.memoizedState===null?k_:jx),a}function Yp(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Ed(a);if(a.$$typeof===T)return Wn(a)}throw Error(o(438,String(a)))}function hx(a){var c=null,f=at.updateQueue;if(f!==null&&(c=f.memoCache),c==null){var m=at.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(c={data:m.data.map(function(x){return x.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),f===null&&(f=Wp(),at.updateQueue=f),f.memoCache=c,f=c.data[c.index],f===void 0)for(f=c.data[c.index]=Array(a),m=0;m<a;m++)f[m]=B;return c.index++,f}function Bi(a,c){return typeof c=="function"?c(a):c}function Gp(a){var c=bn();return px(c,Vt,a)}function px(a,c,f){var m=a.queue;if(m===null)throw Error(o(311));m.lastRenderedReducer=f;var x=a.baseQueue,v=m.pending;if(v!==null){if(x!==null){var A=x.next;x.next=v.next,v.next=A}c.baseQueue=x=v,m.pending=null}if(v=a.baseState,x===null)a.memoizedState=v;else{c=x.next;var L=A=null,V=null,ee=c,ae=!1;do{var ue=ee.lane&-536870913;if(ue!==ee.lane?(jt&ue)===ue:(Pi&ue)===ue){var te=ee.revertLane;if(te===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),ue===jc&&(ae=!0);else if((Pi&te)===te){ee=ee.next,te===jc&&(ae=!0);continue}else ue={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},V===null?(L=V=ue,A=v):V=V.next=ue,at.lanes|=te,Vr|=te;ue=ee.action,ul&&f(v,ue),v=ee.hasEagerState?ee.eagerState:f(v,ue)}else te={lane:ue,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},V===null?(L=V=te,A=v):V=V.next=te,at.lanes|=ue,Vr|=ue;ee=ee.next}while(ee!==null&&ee!==c);if(V===null?A=v:V.next=L,!Uo(v,a.memoizedState)&&(Cn=!0,ae&&(f=Cc,f!==null)))throw f;a.memoizedState=v,a.baseState=A,a.baseQueue=V,m.lastRenderedState=v}return x===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function mx(a){var c=bn(),f=c.queue;if(f===null)throw Error(o(311));f.lastRenderedReducer=a;var m=f.dispatch,x=f.pending,v=c.memoizedState;if(x!==null){f.pending=null;var A=x=x.next;do v=a(v,A.action),A=A.next;while(A!==x);Uo(v,c.memoizedState)||(Cn=!0),c.memoizedState=v,c.baseQueue===null&&(c.baseState=v),f.lastRenderedState=v}return[v,m]}function HE(a,c,f){var m=at,x=bn(),v=Tt;if(v){if(f===void 0)throw Error(o(407));f=f()}else f=c();var A=!Uo((Vt||x).memoizedState,f);if(A&&(x.memoizedState=f,Cn=!0),x=x.queue,bx(VE.bind(null,m,x,a),[a]),x.getSnapshot!==c||A||jn!==null&&jn.memoizedState.tag&1){if(m.flags|=2048,Ac(9,{destroy:void 0},UE.bind(null,m,x,f,c),null),Qt===null)throw Error(o(349));v||(Pi&127)!==0||qE(m,c,f)}return f}function qE(a,c,f){a.flags|=16384,a={getSnapshot:c,value:f},c=at.updateQueue,c===null?(c=Wp(),at.updateQueue=c,c.stores=[a]):(f=c.stores,f===null?c.stores=[a]:f.push(a))}function UE(a,c,f,m){c.value=f,c.getSnapshot=m,KE(c)&&WE(a)}function VE(a,c,f){return f(function(){KE(c)&&WE(a)})}function KE(a){var c=a.getSnapshot;a=a.value;try{var f=c();return!Uo(a,f)}catch{return!0}}function WE(a){var c=tl(a,2);c!==null&&Ao(c,a,2)}function gx(a){var c=po();if(typeof a=="function"){var f=a;if(a=f(),ul){_t(!0);try{f()}finally{_t(!1)}}}return c.memoizedState=c.baseState=a,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:a},c}function YE(a,c,f,m){return a.baseState=f,px(a,Vt,typeof m=="function"?m:Bi)}function Y8(a,c,f,m,x){if(Qp(a))throw Error(o(485));if(a=c.action,a!==null){var v={payload:x,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){v.listeners.push(A)}};F.T!==null?f(!0):v.isTransition=!1,m(v),f=c.pending,f===null?(v.next=c.pending=v,GE(c,v)):(v.next=f.next,c.pending=f.next=v)}}function GE(a,c){var f=c.action,m=c.payload,x=a.state;if(c.isTransition){var v=F.T,A={};F.T=A;try{var L=f(x,m),V=F.S;V!==null&&V(A,L),XE(a,c,L)}catch(ee){yx(a,c,ee)}finally{v!==null&&A.types!==null&&(v.types=A.types),F.T=v}}else try{v=f(x,m),XE(a,c,v)}catch(ee){yx(a,c,ee)}}function XE(a,c,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(m){JE(a,c,m)},function(m){return yx(a,c,m)}):JE(a,c,f)}function JE(a,c,f){c.status="fulfilled",c.value=f,QE(c),a.state=f,c=a.pending,c!==null&&(f=c.next,f===c?a.pending=null:(f=f.next,c.next=f,GE(a,f)))}function yx(a,c,f){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do c.status="rejected",c.reason=f,QE(c),c=c.next;while(c!==m)}a.action=null}function QE(a){a=a.listeners;for(var c=0;c<a.length;c++)(0,a[c])()}function ZE(a,c){return c}function e_(a,c){if(Tt){var f=Qt.formState;if(f!==null){e:{var m=at;if(Tt){if(en){t:{for(var x=en,v=ys;x.nodeType!==8;){if(!v){x=null;break t}if(x=ws(x.nextSibling),x===null){x=null;break t}}v=x.data,x=v==="F!"||v==="F"?x:null}if(x){en=ws(x.nextSibling),m=x.data==="F!";break e}}Br(m)}m=!1}m&&(c=f[0])}}return f=po(),f.memoizedState=f.baseState=c,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ZE,lastRenderedState:c},f.queue=m,f=w_.bind(null,at,m),m.dispatch=f,m=gx(!1),v=Sx.bind(null,at,!1,m.queue),m=po(),x={state:c,dispatch:null,action:a,pending:null},m.queue=x,f=Y8.bind(null,at,x,v,f),x.dispatch=f,m.memoizedState=a,[c,f,!1]}function t_(a){var c=bn();return n_(c,Vt,a)}function n_(a,c,f){if(c=px(a,c,ZE)[0],a=Gp(Bi)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var m=Ed(c)}catch(A){throw A===Tc?Lp:A}else m=c;c=bn();var x=c.queue,v=x.dispatch;return f!==c.memoizedState&&(at.flags|=2048,Ac(9,{destroy:void 0},G8.bind(null,x,f),null)),[m,v,a]}function G8(a,c){a.action=c}function o_(a){var c=bn(),f=Vt;if(f!==null)return n_(c,f,a);bn(),c=c.memoizedState,f=bn();var m=f.queue.dispatch;return f.memoizedState=a,[c,m,!1]}function Ac(a,c,f,m){return a={tag:a,create:f,deps:m,inst:c,next:null},c=at.updateQueue,c===null&&(c=Wp(),at.updateQueue=c),f=c.lastEffect,f===null?c.lastEffect=a.next=a:(m=f.next,f.next=a,a.next=m,c.lastEffect=a),a}function s_(){return bn().memoizedState}function Xp(a,c,f,m){var x=po();at.flags|=a,x.memoizedState=Ac(1|c,{destroy:void 0},f,m===void 0?null:m)}function Jp(a,c,f,m){var x=bn();m=m===void 0?null:m;var v=x.memoizedState.inst;Vt!==null&&m!==null&&lx(m,Vt.memoizedState.deps)?x.memoizedState=Ac(c,v,f,m):(at.flags|=a,x.memoizedState=Ac(1|c,v,f,m))}function i_(a,c){Xp(8390656,8,a,c)}function bx(a,c){Jp(2048,8,a,c)}function X8(a){at.flags|=4;var c=at.updateQueue;if(c===null)c=Wp(),at.updateQueue=c,c.events=[a];else{var f=c.events;f===null?c.events=[a]:f.push(a)}}function r_(a){var c=bn().memoizedState;return X8({ref:c,nextImpl:a}),function(){if((Nt&2)!==0)throw Error(o(440));return c.impl.apply(void 0,arguments)}}function a_(a,c){return Jp(4,2,a,c)}function l_(a,c){return Jp(4,4,a,c)}function c_(a,c){if(typeof c=="function"){a=a();var f=c(a);return function(){typeof f=="function"?f():c(null)}}if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function u_(a,c,f){f=f!=null?f.concat([a]):null,Jp(4,4,c_.bind(null,c,a),f)}function wx(){}function d_(a,c){var f=bn();c=c===void 0?null:c;var m=f.memoizedState;return c!==null&&lx(c,m[1])?m[0]:(f.memoizedState=[a,c],a)}function f_(a,c){var f=bn();c=c===void 0?null:c;var m=f.memoizedState;if(c!==null&&lx(c,m[1]))return m[0];if(m=a(),ul){_t(!0);try{a()}finally{_t(!1)}}return f.memoizedState=[m,c],m}function xx(a,c,f){return f===void 0||(Pi&1073741824)!==0&&(jt&261930)===0?a.memoizedState=c:(a.memoizedState=f,a=hM(),at.lanes|=a,Vr|=a,f)}function h_(a,c,f,m){return Uo(f,c)?f:_c.current!==null?(a=xx(a,f,m),Uo(a,c)||(Cn=!0),a):(Pi&42)===0||(Pi&1073741824)!==0&&(jt&261930)===0?(Cn=!0,a.memoizedState=f):(a=hM(),at.lanes|=a,Vr|=a,c)}function p_(a,c,f,m,x){var v=q.p;q.p=v!==0&&8>v?v:8;var A=F.T,L={};F.T=L,Sx(a,!1,c,f);try{var V=x(),ee=F.S;if(ee!==null&&ee(L,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var ae=V8(V,m);_d(a,c,ae,Xo(a))}else _d(a,c,m,Xo(a))}catch(ue){_d(a,c,{then:function(){},status:"rejected",reason:ue},Xo())}finally{q.p=v,A!==null&&L.types!==null&&(A.types=L.types),F.T=A}}function J8(){}function vx(a,c,f,m){if(a.tag!==5)throw Error(o(476));var x=m_(a).queue;p_(a,x,c,H,f===null?J8:function(){return g_(a),f(m)})}function m_(a){var c=a.memoizedState;if(c!==null)return c;c={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:H},next:null};var f={};return c.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Bi,lastRenderedState:f},next:null},a.memoizedState=c,a=a.alternate,a!==null&&(a.memoizedState=c),c}function g_(a){var c=m_(a);c.next===null&&(c=a.alternate.memoizedState),_d(a,c.next.queue,{},Xo())}function kx(){return Wn(Vd)}function y_(){return bn().memoizedState}function b_(){return bn().memoizedState}function Q8(a){for(var c=a.return;c!==null;){switch(c.tag){case 24:case 3:var f=Xo();a=Lr(f);var m=$r(c,a,f);m!==null&&(Ao(m,c,f),Sd(m,c,f)),c={cache:Jw()},a.payload=c;return}c=c.return}}function Z8(a,c,f){var m=Xo();f={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Qp(a)?x_(c,f):(f=$w(a,c,f,m),f!==null&&(Ao(f,a,m),v_(f,c,m)))}function w_(a,c,f){var m=Xo();_d(a,c,f,m)}function _d(a,c,f,m){var x={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Qp(a))x_(c,x);else{var v=a.alternate;if(a.lanes===0&&(v===null||v.lanes===0)&&(v=c.lastRenderedReducer,v!==null))try{var A=c.lastRenderedState,L=v(A,f);if(x.hasEagerState=!0,x.eagerState=L,Uo(L,A))return Rp(a,c,x,0),Qt===null&&Ap(),!1}catch{}if(f=$w(a,c,x,m),f!==null)return Ao(f,a,m),v_(f,c,m),!0}return!1}function Sx(a,c,f,m){if(m={lane:2,revertLane:t0(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},Qp(a)){if(c)throw Error(o(479))}else c=$w(a,f,m,2),c!==null&&Ao(c,a,2)}function Qp(a){var c=a.alternate;return a===at||c!==null&&c===at}function x_(a,c){Mc=Vp=!0;var f=a.pending;f===null?c.next=c:(c.next=f.next,f.next=c),a.pending=c}function v_(a,c,f){if((f&4194048)!==0){var m=c.lanes;m&=a.pendingLanes,f|=m,c.lanes=f,Mr(a,f)}}var Md={readContext:Wn,use:Yp,useCallback:fn,useContext:fn,useEffect:fn,useImperativeHandle:fn,useLayoutEffect:fn,useInsertionEffect:fn,useMemo:fn,useReducer:fn,useRef:fn,useState:fn,useDebugValue:fn,useDeferredValue:fn,useTransition:fn,useSyncExternalStore:fn,useId:fn,useHostTransitionStatus:fn,useFormState:fn,useActionState:fn,useOptimistic:fn,useMemoCache:fn,useCacheRefresh:fn};Md.useEffectEvent=fn;var k_={readContext:Wn,use:Yp,useCallback:function(a,c){return po().memoizedState=[a,c===void 0?null:c],a},useContext:Wn,useEffect:i_,useImperativeHandle:function(a,c,f){f=f!=null?f.concat([a]):null,Xp(4194308,4,c_.bind(null,c,a),f)},useLayoutEffect:function(a,c){return Xp(4194308,4,a,c)},useInsertionEffect:function(a,c){Xp(4,2,a,c)},useMemo:function(a,c){var f=po();c=c===void 0?null:c;var m=a();if(ul){_t(!0);try{a()}finally{_t(!1)}}return f.memoizedState=[m,c],m},useReducer:function(a,c,f){var m=po();if(f!==void 0){var x=f(c);if(ul){_t(!0);try{f(c)}finally{_t(!1)}}}else x=c;return m.memoizedState=m.baseState=x,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:x},m.queue=a,a=a.dispatch=Z8.bind(null,at,a),[m.memoizedState,a]},useRef:function(a){var c=po();return a={current:a},c.memoizedState=a},useState:function(a){a=gx(a);var c=a.queue,f=w_.bind(null,at,c);return c.dispatch=f,[a.memoizedState,f]},useDebugValue:wx,useDeferredValue:function(a,c){var f=po();return xx(f,a,c)},useTransition:function(){var a=gx(!1);return a=p_.bind(null,at,a.queue,!0,!1),po().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,c,f){var m=at,x=po();if(Tt){if(f===void 0)throw Error(o(407));f=f()}else{if(f=c(),Qt===null)throw Error(o(349));(jt&127)!==0||qE(m,c,f)}x.memoizedState=f;var v={value:f,getSnapshot:c};return x.queue=v,i_(VE.bind(null,m,v,a),[a]),m.flags|=2048,Ac(9,{destroy:void 0},UE.bind(null,m,v,f,c),null),f},useId:function(){var a=po(),c=Qt.identifierPrefix;if(Tt){var f=si,m=oi;f=(m&~(1<<32-Jt(m)-1)).toString(32)+f,c="_"+c+"R_"+f,f=Kp++,0<f&&(c+="H"+f.toString(32)),c+="_"}else f=K8++,c="_"+c+"r_"+f.toString(32)+"_";return a.memoizedState=c},useHostTransitionStatus:kx,useFormState:e_,useActionState:e_,useOptimistic:function(a){var c=po();c.memoizedState=c.baseState=a;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=f,c=Sx.bind(null,at,!0,f),f.dispatch=c,[a,c]},useMemoCache:hx,useCacheRefresh:function(){return po().memoizedState=Q8.bind(null,at)},useEffectEvent:function(a){var c=po(),f={impl:a};return c.memoizedState=f,function(){if((Nt&2)!==0)throw Error(o(440));return f.impl.apply(void 0,arguments)}}},jx={readContext:Wn,use:Yp,useCallback:d_,useContext:Wn,useEffect:bx,useImperativeHandle:u_,useInsertionEffect:a_,useLayoutEffect:l_,useMemo:f_,useReducer:Gp,useRef:s_,useState:function(){return Gp(Bi)},useDebugValue:wx,useDeferredValue:function(a,c){var f=bn();return h_(f,Vt.memoizedState,a,c)},useTransition:function(){var a=Gp(Bi)[0],c=bn().memoizedState;return[typeof a=="boolean"?a:Ed(a),c]},useSyncExternalStore:HE,useId:y_,useHostTransitionStatus:kx,useFormState:t_,useActionState:t_,useOptimistic:function(a,c){var f=bn();return YE(f,Vt,a,c)},useMemoCache:hx,useCacheRefresh:b_};jx.useEffectEvent=r_;var S_={readContext:Wn,use:Yp,useCallback:d_,useContext:Wn,useEffect:bx,useImperativeHandle:u_,useInsertionEffect:a_,useLayoutEffect:l_,useMemo:f_,useReducer:mx,useRef:s_,useState:function(){return mx(Bi)},useDebugValue:wx,useDeferredValue:function(a,c){var f=bn();return Vt===null?xx(f,a,c):h_(f,Vt.memoizedState,a,c)},useTransition:function(){var a=mx(Bi)[0],c=bn().memoizedState;return[typeof a=="boolean"?a:Ed(a),c]},useSyncExternalStore:HE,useId:y_,useHostTransitionStatus:kx,useFormState:o_,useActionState:o_,useOptimistic:function(a,c){var f=bn();return Vt!==null?YE(f,Vt,a,c):(f.baseState=a,[a,f.queue.dispatch])},useMemoCache:hx,useCacheRefresh:b_};S_.useEffectEvent=r_;function Cx(a,c,f,m){c=a.memoizedState,f=f(m,c),f=f==null?c:p({},c,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Tx={enqueueSetState:function(a,c,f){a=a._reactInternals;var m=Xo(),x=Lr(m);x.payload=c,f!=null&&(x.callback=f),c=$r(a,x,m),c!==null&&(Ao(c,a,m),Sd(c,a,m))},enqueueReplaceState:function(a,c,f){a=a._reactInternals;var m=Xo(),x=Lr(m);x.tag=1,x.payload=c,f!=null&&(x.callback=f),c=$r(a,x,m),c!==null&&(Ao(c,a,m),Sd(c,a,m))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var f=Xo(),m=Lr(f);m.tag=2,c!=null&&(m.callback=c),c=$r(a,m,f),c!==null&&(Ao(c,a,f),Sd(c,a,f))}};function j_(a,c,f,m,x,v,A){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,v,A):c.prototype&&c.prototype.isPureReactComponent?!md(f,m)||!md(x,v):!0}function C_(a,c,f,m){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(f,m),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(f,m),c.state!==a&&Tx.enqueueReplaceState(c,c.state,null)}function dl(a,c){var f=c;if("ref"in c){f={};for(var m in c)m!=="ref"&&(f[m]=c[m])}if(a=a.defaultProps){f===c&&(f=p({},f));for(var x in a)f[x]===void 0&&(f[x]=a[x])}return f}function T_(a){Op(a)}function E_(a){console.error(a)}function __(a){Op(a)}function Zp(a,c){try{var f=a.onUncaughtError;f(c.value,{componentStack:c.stack})}catch(m){setTimeout(function(){throw m})}}function M_(a,c,f){try{var m=a.onCaughtError;m(f.value,{componentStack:f.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function Ex(a,c,f){return f=Lr(f),f.tag=3,f.payload={element:null},f.callback=function(){Zp(a,c)},f}function O_(a){return a=Lr(a),a.tag=3,a}function A_(a,c,f,m){var x=f.type.getDerivedStateFromError;if(typeof x=="function"){var v=m.value;a.payload=function(){return x(v)},a.callback=function(){M_(c,f,m)}}var A=f.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(a.callback=function(){M_(c,f,m),typeof x!="function"&&(Kr===null?Kr=new Set([this]):Kr.add(this));var L=m.stack;this.componentDidCatch(m.value,{componentStack:L!==null?L:""})})}function eH(a,c,f,m,x){if(f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(c=f.alternate,c!==null&&Sc(c,f,x,!0),f=Ko.current,f!==null){switch(f.tag){case 31:case 13:return bs===null?dm():f.alternate===null&&hn===0&&(hn=3),f.flags&=-257,f.flags|=65536,f.lanes=x,m===$p?f.flags|=16384:(c=f.updateQueue,c===null?f.updateQueue=new Set([m]):c.add(m),Qx(a,m,x)),!1;case 22:return f.flags|=65536,m===$p?f.flags|=16384:(c=f.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([m])},f.updateQueue=c):(f=c.retryQueue,f===null?c.retryQueue=new Set([m]):f.add(m)),Qx(a,m,x)),!1}throw Error(o(435,f.tag))}return Qx(a,m,x),dm(),!1}if(Tt)return c=Ko.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=x,m!==Kw&&(a=Error(o(422),{cause:m}),bd(ps(a,f)))):(m!==Kw&&(c=Error(o(423),{cause:m}),bd(ps(c,f))),a=a.current.alternate,a.flags|=65536,x&=-x,a.lanes|=x,m=ps(m,f),x=Ex(a.stateNode,m,x),ox(a,x),hn!==4&&(hn=2)),!1;var v=Error(o(520),{cause:m});if(v=ps(v,f),zd===null?zd=[v]:zd.push(v),hn!==4&&(hn=2),c===null)return!0;m=ps(m,f),f=c;do{switch(f.tag){case 3:return f.flags|=65536,a=x&-x,f.lanes|=a,a=Ex(f.stateNode,m,a),ox(f,a),!1;case 1:if(c=f.type,v=f.stateNode,(f.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Kr===null||!Kr.has(v))))return f.flags|=65536,x&=-x,f.lanes|=x,x=O_(x),A_(x,a,f,m),ox(f,x),!1}f=f.return}while(f!==null);return!1}var _x=Error(o(461)),Cn=!1;function Yn(a,c,f,m){c.child=a===null?PE(c,null,f,m):cl(c,a.child,f,m)}function R_(a,c,f,m,x){f=f.render;var v=c.ref;if("ref"in m){var A={};for(var L in m)L!=="ref"&&(A[L]=m[L])}else A=m;return il(c),m=cx(a,c,f,A,v,x),L=ux(),a!==null&&!Cn?(dx(a,c,x),zi(a,c,x)):(Tt&&L&&Uw(c),c.flags|=1,Yn(a,c,m,x),c.child)}function N_(a,c,f,m,x){if(a===null){var v=f.type;return typeof v=="function"&&!Fw(v)&&v.defaultProps===void 0&&f.compare===null?(c.tag=15,c.type=v,D_(a,c,v,m,x)):(a=Dp(f.type,null,m,c,c.mode,x),a.ref=c.ref,a.return=c,c.child=a)}if(v=a.child,!Bx(a,x)){var A=v.memoizedProps;if(f=f.compare,f=f!==null?f:md,f(A,m)&&a.ref===c.ref)return zi(a,c,x)}return c.flags|=1,a=Ai(v,m),a.ref=c.ref,a.return=c,c.child=a}function D_(a,c,f,m,x){if(a!==null){var v=a.memoizedProps;if(md(v,m)&&a.ref===c.ref)if(Cn=!1,c.pendingProps=m=v,Bx(a,x))(a.flags&131072)!==0&&(Cn=!0);else return c.lanes=a.lanes,zi(a,c,x)}return Mx(a,c,f,m,x)}function P_(a,c,f,m){var x=m.children,v=a!==null?a.memoizedState:null;if(a===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((c.flags&128)!==0){if(v=v!==null?v.baseLanes|f:f,a!==null){for(m=c.child=a.child,x=0;m!==null;)x=x|m.lanes|m.childLanes,m=m.sibling;m=x&~v}else m=0,c.child=null;return B_(a,c,v,f,m)}if((f&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},a!==null&&Ip(c,v!==null?v.cachePool:null),v!==null?IE(c,v):ix(),LE(c);else return m=c.lanes=536870912,B_(a,c,v!==null?v.baseLanes|f:f,f,m)}else v!==null?(Ip(c,v.cachePool),IE(c,v),Hr(),c.memoizedState=null):(a!==null&&Ip(c,null),ix(),Hr());return Yn(a,c,x,f),c.child}function Od(a,c){return a!==null&&a.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function B_(a,c,f,m,x){var v=Zw();return v=v===null?null:{parent:Sn._currentValue,pool:v},c.memoizedState={baseLanes:f,cachePool:v},a!==null&&Ip(c,null),ix(),LE(c),a!==null&&Sc(a,c,m,!0),c.childLanes=x,null}function em(a,c){return c=nm({mode:c.mode,children:c.children},a.mode),c.ref=a.ref,a.child=c,c.return=a,c}function z_(a,c,f){return cl(c,a.child,null,f),a=em(c,c.pendingProps),a.flags|=2,Wo(c),c.memoizedState=null,a}function tH(a,c,f){var m=c.pendingProps,x=(c.flags&128)!==0;if(c.flags&=-129,a===null){if(Tt){if(m.mode==="hidden")return a=em(c,m),c.lanes=536870912,Od(null,a);if(ax(c),(a=en)?(a=GM(a,ys),a=a!==null&&a.data==="&"?a:null,a!==null&&(c.memoizedState={dehydrated:a,treeContext:Dr!==null?{id:oi,overflow:si}:null,retryLane:536870912,hydrationErrors:null},f=xE(a),f.return=c,c.child=f,Kn=c,en=null)):a=null,a===null)throw Br(c);return c.lanes=536870912,null}return em(c,m)}var v=a.memoizedState;if(v!==null){var A=v.dehydrated;if(ax(c),x)if(c.flags&256)c.flags&=-257,c=z_(a,c,f);else if(c.memoizedState!==null)c.child=a.child,c.flags|=128,c=null;else throw Error(o(558));else if(Cn||Sc(a,c,f,!1),x=(f&a.childLanes)!==0,Cn||x){if(m=Qt,m!==null&&(A=Or(m,f),A!==0&&A!==v.retryLane))throw v.retryLane=A,tl(a,A),Ao(m,a,A),_x;dm(),c=z_(a,c,f)}else a=v.treeContext,en=ws(A.nextSibling),Kn=c,Tt=!0,Pr=null,ys=!1,a!==null&&SE(c,a),c=em(c,m),c.flags|=4096;return c}return a=Ai(a.child,{mode:m.mode,children:m.children}),a.ref=c.ref,c.child=a,a.return=c,a}function tm(a,c){var f=c.ref;if(f===null)a!==null&&a.ref!==null&&(c.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(o(284));(a===null||a.ref!==f)&&(c.flags|=4194816)}}function Mx(a,c,f,m,x){return il(c),f=cx(a,c,f,m,void 0,x),m=ux(),a!==null&&!Cn?(dx(a,c,x),zi(a,c,x)):(Tt&&m&&Uw(c),c.flags|=1,Yn(a,c,f,x),c.child)}function I_(a,c,f,m,x,v){return il(c),c.updateQueue=null,f=FE(c,m,f,x),$E(a),m=ux(),a!==null&&!Cn?(dx(a,c,v),zi(a,c,v)):(Tt&&m&&Uw(c),c.flags|=1,Yn(a,c,f,v),c.child)}function L_(a,c,f,m,x){if(il(c),c.stateNode===null){var v=wc,A=f.contextType;typeof A=="object"&&A!==null&&(v=Wn(A)),v=new f(m,v),c.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Tx,c.stateNode=v,v._reactInternals=c,v=c.stateNode,v.props=m,v.state=c.memoizedState,v.refs={},tx(c),A=f.contextType,v.context=typeof A=="object"&&A!==null?Wn(A):wc,v.state=c.memoizedState,A=f.getDerivedStateFromProps,typeof A=="function"&&(Cx(c,f,A,m),v.state=c.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(A=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),A!==v.state&&Tx.enqueueReplaceState(v,v.state,null),Cd(c,m,v,x),jd(),v.state=c.memoizedState),typeof v.componentDidMount=="function"&&(c.flags|=4194308),m=!0}else if(a===null){v=c.stateNode;var L=c.memoizedProps,V=dl(f,L);v.props=V;var ee=v.context,ae=f.contextType;A=wc,typeof ae=="object"&&ae!==null&&(A=Wn(ae));var ue=f.getDerivedStateFromProps;ae=typeof ue=="function"||typeof v.getSnapshotBeforeUpdate=="function",L=c.pendingProps!==L,ae||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(L||ee!==A)&&C_(c,v,m,A),Ir=!1;var te=c.memoizedState;v.state=te,Cd(c,m,v,x),jd(),ee=c.memoizedState,L||te!==ee||Ir?(typeof ue=="function"&&(Cx(c,f,ue,m),ee=c.memoizedState),(V=Ir||j_(c,f,V,m,te,ee,A))?(ae||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(c.flags|=4194308)):(typeof v.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=m,c.memoizedState=ee),v.props=m,v.state=ee,v.context=A,m=V):(typeof v.componentDidMount=="function"&&(c.flags|=4194308),m=!1)}else{v=c.stateNode,nx(a,c),A=c.memoizedProps,ae=dl(f,A),v.props=ae,ue=c.pendingProps,te=v.context,ee=f.contextType,V=wc,typeof ee=="object"&&ee!==null&&(V=Wn(ee)),L=f.getDerivedStateFromProps,(ee=typeof L=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(A!==ue||te!==V)&&C_(c,v,m,V),Ir=!1,te=c.memoizedState,v.state=te,Cd(c,m,v,x),jd();var se=c.memoizedState;A!==ue||te!==se||Ir||a!==null&&a.dependencies!==null&&Bp(a.dependencies)?(typeof L=="function"&&(Cx(c,f,L,m),se=c.memoizedState),(ae=Ir||j_(c,f,ae,m,te,se,V)||a!==null&&a.dependencies!==null&&Bp(a.dependencies))?(ee||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(m,se,V),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(m,se,V)),typeof v.componentDidUpdate=="function"&&(c.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof v.componentDidUpdate!="function"||A===a.memoizedProps&&te===a.memoizedState||(c.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||A===a.memoizedProps&&te===a.memoizedState||(c.flags|=1024),c.memoizedProps=m,c.memoizedState=se),v.props=m,v.state=se,v.context=V,m=ae):(typeof v.componentDidUpdate!="function"||A===a.memoizedProps&&te===a.memoizedState||(c.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||A===a.memoizedProps&&te===a.memoizedState||(c.flags|=1024),m=!1)}return v=m,tm(a,c),m=(c.flags&128)!==0,v||m?(v=c.stateNode,f=m&&typeof f.getDerivedStateFromError!="function"?null:v.render(),c.flags|=1,a!==null&&m?(c.child=cl(c,a.child,null,x),c.child=cl(c,null,f,x)):Yn(a,c,f,x),c.memoizedState=v.state,a=c.child):a=zi(a,c,x),a}function $_(a,c,f,m){return ol(),c.flags|=256,Yn(a,c,f,m),c.child}var Ox={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ax(a){return{baseLanes:a,cachePool:ME()}}function Rx(a,c,f){return a=a!==null?a.childLanes&~f:0,c&&(a|=Go),a}function F_(a,c,f){var m=c.pendingProps,x=!1,v=(c.flags&128)!==0,A;if((A=v)||(A=a!==null&&a.memoizedState===null?!1:(yn.current&2)!==0),A&&(x=!0,c.flags&=-129),A=(c.flags&32)!==0,c.flags&=-33,a===null){if(Tt){if(x?Fr(c):Hr(),(a=en)?(a=GM(a,ys),a=a!==null&&a.data!=="&"?a:null,a!==null&&(c.memoizedState={dehydrated:a,treeContext:Dr!==null?{id:oi,overflow:si}:null,retryLane:536870912,hydrationErrors:null},f=xE(a),f.return=c,c.child=f,Kn=c,en=null)):a=null,a===null)throw Br(c);return p0(a)?c.lanes=32:c.lanes=536870912,null}var L=m.children;return m=m.fallback,x?(Hr(),x=c.mode,L=nm({mode:"hidden",children:L},x),m=nl(m,x,f,null),L.return=c,m.return=c,L.sibling=m,c.child=L,m=c.child,m.memoizedState=Ax(f),m.childLanes=Rx(a,A,f),c.memoizedState=Ox,Od(null,m)):(Fr(c),Nx(c,L))}var V=a.memoizedState;if(V!==null&&(L=V.dehydrated,L!==null)){if(v)c.flags&256?(Fr(c),c.flags&=-257,c=Dx(a,c,f)):c.memoizedState!==null?(Hr(),c.child=a.child,c.flags|=128,c=null):(Hr(),L=m.fallback,x=c.mode,m=nm({mode:"visible",children:m.children},x),L=nl(L,x,f,null),L.flags|=2,m.return=c,L.return=c,m.sibling=L,c.child=m,cl(c,a.child,null,f),m=c.child,m.memoizedState=Ax(f),m.childLanes=Rx(a,A,f),c.memoizedState=Ox,c=Od(null,m));else if(Fr(c),p0(L)){if(A=L.nextSibling&&L.nextSibling.dataset,A)var ee=A.dgst;A=ee,m=Error(o(419)),m.stack="",m.digest=A,bd({value:m,source:null,stack:null}),c=Dx(a,c,f)}else if(Cn||Sc(a,c,f,!1),A=(f&a.childLanes)!==0,Cn||A){if(A=Qt,A!==null&&(m=Or(A,f),m!==0&&m!==V.retryLane))throw V.retryLane=m,tl(a,m),Ao(A,a,m),_x;h0(L)||dm(),c=Dx(a,c,f)}else h0(L)?(c.flags|=192,c.child=a.child,c=null):(a=V.treeContext,en=ws(L.nextSibling),Kn=c,Tt=!0,Pr=null,ys=!1,a!==null&&SE(c,a),c=Nx(c,m.children),c.flags|=4096);return c}return x?(Hr(),L=m.fallback,x=c.mode,V=a.child,ee=V.sibling,m=Ai(V,{mode:"hidden",children:m.children}),m.subtreeFlags=V.subtreeFlags&65011712,ee!==null?L=Ai(ee,L):(L=nl(L,x,f,null),L.flags|=2),L.return=c,m.return=c,m.sibling=L,c.child=m,Od(null,m),m=c.child,L=a.child.memoizedState,L===null?L=Ax(f):(x=L.cachePool,x!==null?(V=Sn._currentValue,x=x.parent!==V?{parent:V,pool:V}:x):x=ME(),L={baseLanes:L.baseLanes|f,cachePool:x}),m.memoizedState=L,m.childLanes=Rx(a,A,f),c.memoizedState=Ox,Od(a.child,m)):(Fr(c),f=a.child,a=f.sibling,f=Ai(f,{mode:"visible",children:m.children}),f.return=c,f.sibling=null,a!==null&&(A=c.deletions,A===null?(c.deletions=[a],c.flags|=16):A.push(a)),c.child=f,c.memoizedState=null,f)}function Nx(a,c){return c=nm({mode:"visible",children:c},a.mode),c.return=a,a.child=c}function nm(a,c){return a=Vo(22,a,null,c),a.lanes=0,a}function Dx(a,c,f){return cl(c,a.child,null,f),a=Nx(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function H_(a,c,f){a.lanes|=c;var m=a.alternate;m!==null&&(m.lanes|=c),Gw(a.return,c,f)}function Px(a,c,f,m,x,v){var A=a.memoizedState;A===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:x,treeForkCount:v}:(A.isBackwards=c,A.rendering=null,A.renderingStartTime=0,A.last=m,A.tail=f,A.tailMode=x,A.treeForkCount=v)}function q_(a,c,f){var m=c.pendingProps,x=m.revealOrder,v=m.tail;m=m.children;var A=yn.current,L=(A&2)!==0;if(L?(A=A&1|2,c.flags|=128):A&=1,J(yn,A),Yn(a,c,m,f),m=Tt?yd:0,!L&&a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&H_(a,f,c);else if(a.tag===19)H_(a,f,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(x){case"forwards":for(f=c.child,x=null;f!==null;)a=f.alternate,a!==null&&Up(a)===null&&(x=f),f=f.sibling;f=x,f===null?(x=c.child,c.child=null):(x=f.sibling,f.sibling=null),Px(c,!1,x,f,v,m);break;case"backwards":case"unstable_legacy-backwards":for(f=null,x=c.child,c.child=null;x!==null;){if(a=x.alternate,a!==null&&Up(a)===null){c.child=x;break}a=x.sibling,x.sibling=f,f=x,x=a}Px(c,!0,f,null,v,m);break;case"together":Px(c,!1,null,null,void 0,m);break;default:c.memoizedState=null}return c.child}function zi(a,c,f){if(a!==null&&(c.dependencies=a.dependencies),Vr|=c.lanes,(f&c.childLanes)===0)if(a!==null){if(Sc(a,c,f,!1),(f&c.childLanes)===0)return null}else return null;if(a!==null&&c.child!==a.child)throw Error(o(153));if(c.child!==null){for(a=c.child,f=Ai(a,a.pendingProps),c.child=f,f.return=c;a.sibling!==null;)a=a.sibling,f=f.sibling=Ai(a,a.pendingProps),f.return=c;f.sibling=null}return c.child}function Bx(a,c){return(a.lanes&c)!==0?!0:(a=a.dependencies,!!(a!==null&&Bp(a)))}function nH(a,c,f){switch(c.tag){case 3:ce(c,c.stateNode.containerInfo),zr(c,Sn,a.memoizedState.cache),ol();break;case 27:case 5:Ce(c);break;case 4:ce(c,c.stateNode.containerInfo);break;case 10:zr(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,ax(c),null;break;case 13:var m=c.memoizedState;if(m!==null)return m.dehydrated!==null?(Fr(c),c.flags|=128,null):(f&c.child.childLanes)!==0?F_(a,c,f):(Fr(c),a=zi(a,c,f),a!==null?a.sibling:null);Fr(c);break;case 19:var x=(a.flags&128)!==0;if(m=(f&c.childLanes)!==0,m||(Sc(a,c,f,!1),m=(f&c.childLanes)!==0),x){if(m)return q_(a,c,f);c.flags|=128}if(x=c.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),J(yn,yn.current),m)break;return null;case 22:return c.lanes=0,P_(a,c,f,c.pendingProps);case 24:zr(c,Sn,a.memoizedState.cache)}return zi(a,c,f)}function U_(a,c,f){if(a!==null)if(a.memoizedProps!==c.pendingProps)Cn=!0;else{if(!Bx(a,f)&&(c.flags&128)===0)return Cn=!1,nH(a,c,f);Cn=(a.flags&131072)!==0}else Cn=!1,Tt&&(c.flags&1048576)!==0&&kE(c,yd,c.index);switch(c.lanes=0,c.tag){case 16:e:{var m=c.pendingProps;if(a=al(c.elementType),c.type=a,typeof a=="function")Fw(a)?(m=dl(a,m),c.tag=1,c=L_(null,c,a,m,f)):(c.tag=0,c=Mx(null,c,a,m,f));else{if(a!=null){var x=a.$$typeof;if(x===M){c.tag=11,c=R_(null,c,a,m,f);break e}else if(x===D){c.tag=14,c=N_(null,c,a,m,f);break e}}throw c=W(a)||a,Error(o(306,c,""))}}return c;case 0:return Mx(a,c,c.type,c.pendingProps,f);case 1:return m=c.type,x=dl(m,c.pendingProps),L_(a,c,m,x,f);case 3:e:{if(ce(c,c.stateNode.containerInfo),a===null)throw Error(o(387));m=c.pendingProps;var v=c.memoizedState;x=v.element,nx(a,c),Cd(c,m,null,f);var A=c.memoizedState;if(m=A.cache,zr(c,Sn,m),m!==v.cache&&Xw(c,[Sn],f,!0),jd(),m=A.element,v.isDehydrated)if(v={element:m,isDehydrated:!1,cache:A.cache},c.updateQueue.baseState=v,c.memoizedState=v,c.flags&256){c=$_(a,c,m,f);break e}else if(m!==x){x=ps(Error(o(424)),c),bd(x),c=$_(a,c,m,f);break e}else for(a=c.stateNode.containerInfo,a.nodeType===9?a=a.body:a=a.nodeName==="HTML"?a.ownerDocument.body:a,en=ws(a.firstChild),Kn=c,Tt=!0,Pr=null,ys=!0,f=PE(c,null,m,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(ol(),m===x){c=zi(a,c,f);break e}Yn(a,c,m,f)}c=c.child}return c;case 26:return tm(a,c),a===null?(f=tO(c.type,null,c.pendingProps,null))?c.memoizedState=f:Tt||(f=c.type,a=c.pendingProps,m=bm(ie.current).createElement(f),m[Vn]=c,m[Co]=a,Gn(m,f,a),$n(m),c.stateNode=m):c.memoizedState=tO(c.type,a.memoizedProps,c.pendingProps,a.memoizedState),null;case 27:return Ce(c),a===null&&Tt&&(m=c.stateNode=QM(c.type,c.pendingProps,ie.current),Kn=c,ys=!0,x=en,Xr(c.type)?(m0=x,en=ws(m.firstChild)):en=x),Yn(a,c,c.pendingProps.children,f),tm(a,c),a===null&&(c.flags|=4194304),c.child;case 5:return a===null&&Tt&&((x=m=en)&&(m=RH(m,c.type,c.pendingProps,ys),m!==null?(c.stateNode=m,Kn=c,en=ws(m.firstChild),ys=!1,x=!0):x=!1),x||Br(c)),Ce(c),x=c.type,v=c.pendingProps,A=a!==null?a.memoizedProps:null,m=v.children,u0(x,v)?m=null:A!==null&&u0(x,A)&&(c.flags|=32),c.memoizedState!==null&&(x=cx(a,c,W8,null,null,f),Vd._currentValue=x),tm(a,c),Yn(a,c,m,f),c.child;case 6:return a===null&&Tt&&((a=f=en)&&(f=NH(f,c.pendingProps,ys),f!==null?(c.stateNode=f,Kn=c,en=null,a=!0):a=!1),a||Br(c)),null;case 13:return F_(a,c,f);case 4:return ce(c,c.stateNode.containerInfo),m=c.pendingProps,a===null?c.child=cl(c,null,m,f):Yn(a,c,m,f),c.child;case 11:return R_(a,c,c.type,c.pendingProps,f);case 7:return Yn(a,c,c.pendingProps,f),c.child;case 8:return Yn(a,c,c.pendingProps.children,f),c.child;case 12:return Yn(a,c,c.pendingProps.children,f),c.child;case 10:return m=c.pendingProps,zr(c,c.type,m.value),Yn(a,c,m.children,f),c.child;case 9:return x=c.type._context,m=c.pendingProps.children,il(c),x=Wn(x),m=m(x),c.flags|=1,Yn(a,c,m,f),c.child;case 14:return N_(a,c,c.type,c.pendingProps,f);case 15:return D_(a,c,c.type,c.pendingProps,f);case 19:return q_(a,c,f);case 31:return tH(a,c,f);case 22:return P_(a,c,f,c.pendingProps);case 24:return il(c),m=Wn(Sn),a===null?(x=Zw(),x===null&&(x=Qt,v=Jw(),x.pooledCache=v,v.refCount++,v!==null&&(x.pooledCacheLanes|=f),x=v),c.memoizedState={parent:m,cache:x},tx(c),zr(c,Sn,x)):((a.lanes&f)!==0&&(nx(a,c),Cd(c,null,null,f),jd()),x=a.memoizedState,v=c.memoizedState,x.parent!==m?(x={parent:m,cache:m},c.memoizedState=x,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=x),zr(c,Sn,m)):(m=v.cache,zr(c,Sn,m),m!==x.cache&&Xw(c,[Sn],f,!0))),Yn(a,c,c.pendingProps.children,f),c.child;case 29:throw c.pendingProps}throw Error(o(156,c.tag))}function Ii(a){a.flags|=4}function zx(a,c,f,m,x){if((c=(a.mode&32)!==0)&&(c=!1),c){if(a.flags|=16777216,(x&335544128)===x)if(a.stateNode.complete)a.flags|=8192;else if(yM())a.flags|=8192;else throw ll=$p,ex}else a.flags&=-16777217}function V_(a,c){if(c.type!=="stylesheet"||(c.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!rO(c))if(yM())a.flags|=8192;else throw ll=$p,ex}function om(a,c){c!==null&&(a.flags|=4),a.flags&16384&&(c=a.tag!==22?jo():536870912,a.lanes|=c,Pc|=c)}function Ad(a,c){if(!Tt)switch(a.tailMode){case"hidden":c=a.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function tn(a){var c=a.alternate!==null&&a.alternate.child===a.child,f=0,m=0;if(c)for(var x=a.child;x!==null;)f|=x.lanes|x.childLanes,m|=x.subtreeFlags&65011712,m|=x.flags&65011712,x.return=a,x=x.sibling;else for(x=a.child;x!==null;)f|=x.lanes|x.childLanes,m|=x.subtreeFlags,m|=x.flags,x.return=a,x=x.sibling;return a.subtreeFlags|=m,a.childLanes=f,c}function oH(a,c,f){var m=c.pendingProps;switch(Vw(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tn(c),null;case 1:return tn(c),null;case 3:return f=c.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),c.memoizedState.cache!==m&&(c.flags|=2048),Di(Sn),ye(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(a===null||a.child===null)&&(kc(c)?Ii(c):a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,Ww())),tn(c),null;case 26:var x=c.type,v=c.memoizedState;return a===null?(Ii(c),v!==null?(tn(c),V_(c,v)):(tn(c),zx(c,x,null,m,f))):v?v!==a.memoizedState?(Ii(c),tn(c),V_(c,v)):(tn(c),c.flags&=-16777217):(a=a.memoizedProps,a!==m&&Ii(c),tn(c),zx(c,x,a,m,f)),null;case 27:if(Ve(c),f=ie.current,x=c.type,a!==null&&c.stateNode!=null)a.memoizedProps!==m&&Ii(c);else{if(!m){if(c.stateNode===null)throw Error(o(166));return tn(c),null}a=X.current,kc(c)?jE(c):(a=QM(x,m,f),c.stateNode=a,Ii(c))}return tn(c),null;case 5:if(Ve(c),x=c.type,a!==null&&c.stateNode!=null)a.memoizedProps!==m&&Ii(c);else{if(!m){if(c.stateNode===null)throw Error(o(166));return tn(c),null}if(v=X.current,kc(c))jE(c);else{var A=bm(ie.current);switch(v){case 1:v=A.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:v=A.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":v=A.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":v=A.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":v=A.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof m.is=="string"?A.createElement("select",{is:m.is}):A.createElement("select"),m.multiple?v.multiple=!0:m.size&&(v.size=m.size);break;default:v=typeof m.is=="string"?A.createElement(x,{is:m.is}):A.createElement(x)}}v[Vn]=c,v[Co]=m;e:for(A=c.child;A!==null;){if(A.tag===5||A.tag===6)v.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===c)break e;for(;A.sibling===null;){if(A.return===null||A.return===c)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}c.stateNode=v;e:switch(Gn(v,x,m),x){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Ii(c)}}return tn(c),zx(c,c.type,a===null?null:a.memoizedProps,c.pendingProps,f),null;case 6:if(a&&c.stateNode!=null)a.memoizedProps!==m&&Ii(c);else{if(typeof m!="string"&&c.stateNode===null)throw Error(o(166));if(a=ie.current,kc(c)){if(a=c.stateNode,f=c.memoizedProps,m=null,x=Kn,x!==null)switch(x.tag){case 27:case 5:m=x.memoizedProps}a[Vn]=c,a=!!(a.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||FM(a.nodeValue,f)),a||Br(c,!0)}else a=bm(a).createTextNode(m),a[Vn]=c,c.stateNode=a}return tn(c),null;case 31:if(f=c.memoizedState,a===null||a.memoizedState!==null){if(m=kc(c),f!==null){if(a===null){if(!m)throw Error(o(318));if(a=c.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(o(557));a[Vn]=c}else ol(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;tn(c),a=!1}else f=Ww(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return c.flags&256?(Wo(c),c):(Wo(c),null);if((c.flags&128)!==0)throw Error(o(558))}return tn(c),null;case 13:if(m=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(x=kc(c),m!==null&&m.dehydrated!==null){if(a===null){if(!x)throw Error(o(318));if(x=c.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(o(317));x[Vn]=c}else ol(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;tn(c),x=!1}else x=Ww(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=x),x=!0;if(!x)return c.flags&256?(Wo(c),c):(Wo(c),null)}return Wo(c),(c.flags&128)!==0?(c.lanes=f,c):(f=m!==null,a=a!==null&&a.memoizedState!==null,f&&(m=c.child,x=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(x=m.alternate.memoizedState.cachePool.pool),v=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(v=m.memoizedState.cachePool.pool),v!==x&&(m.flags|=2048)),f!==a&&f&&(c.child.flags|=8192),om(c,c.updateQueue),tn(c),null);case 4:return ye(),a===null&&i0(c.stateNode.containerInfo),tn(c),null;case 10:return Di(c.type),tn(c),null;case 19:if(U(yn),m=c.memoizedState,m===null)return tn(c),null;if(x=(c.flags&128)!==0,v=m.rendering,v===null)if(x)Ad(m,!1);else{if(hn!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(v=Up(a),v!==null){for(c.flags|=128,Ad(m,!1),a=v.updateQueue,c.updateQueue=a,om(c,a),c.subtreeFlags=0,a=f,f=c.child;f!==null;)wE(f,a),f=f.sibling;return J(yn,yn.current&1|2),Tt&&Ri(c,m.treeForkCount),c.child}a=a.sibling}m.tail!==null&&fe()>lm&&(c.flags|=128,x=!0,Ad(m,!1),c.lanes=4194304)}else{if(!x)if(a=Up(v),a!==null){if(c.flags|=128,x=!0,a=a.updateQueue,c.updateQueue=a,om(c,a),Ad(m,!0),m.tail===null&&m.tailMode==="hidden"&&!v.alternate&&!Tt)return tn(c),null}else 2*fe()-m.renderingStartTime>lm&&f!==536870912&&(c.flags|=128,x=!0,Ad(m,!1),c.lanes=4194304);m.isBackwards?(v.sibling=c.child,c.child=v):(a=m.last,a!==null?a.sibling=v:c.child=v,m.last=v)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=fe(),a.sibling=null,f=yn.current,J(yn,x?f&1|2:f&1),Tt&&Ri(c,m.treeForkCount),a):(tn(c),null);case 22:case 23:return Wo(c),rx(),m=c.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(c.flags|=8192):m&&(c.flags|=8192),m?(f&536870912)!==0&&(c.flags&128)===0&&(tn(c),c.subtreeFlags&6&&(c.flags|=8192)):tn(c),f=c.updateQueue,f!==null&&om(c,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),m=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(m=c.memoizedState.cachePool.pool),m!==f&&(c.flags|=2048),a!==null&&U(rl),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),c.memoizedState.cache!==f&&(c.flags|=2048),Di(Sn),tn(c),null;case 25:return null;case 30:return null}throw Error(o(156,c.tag))}function sH(a,c){switch(Vw(c),c.tag){case 1:return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Di(Sn),ye(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 26:case 27:case 5:return Ve(c),null;case 31:if(c.memoizedState!==null){if(Wo(c),c.alternate===null)throw Error(o(340));ol()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 13:if(Wo(c),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(o(340));ol()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return U(yn),null;case 4:return ye(),null;case 10:return Di(c.type),null;case 22:case 23:return Wo(c),rx(),a!==null&&U(rl),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 24:return Di(Sn),null;case 25:return null;default:return null}}function K_(a,c){switch(Vw(c),c.tag){case 3:Di(Sn),ye();break;case 26:case 27:case 5:Ve(c);break;case 4:ye();break;case 31:c.memoizedState!==null&&Wo(c);break;case 13:Wo(c);break;case 19:U(yn);break;case 10:Di(c.type);break;case 22:case 23:Wo(c),rx(),a!==null&&U(rl);break;case 24:Di(Sn)}}function Rd(a,c){try{var f=c.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var x=m.next;f=x;do{if((f.tag&a)===a){m=void 0;var v=f.create,A=f.inst;m=v(),A.destroy=m}f=f.next}while(f!==x)}}catch(L){$t(c,c.return,L)}}function qr(a,c,f){try{var m=c.updateQueue,x=m!==null?m.lastEffect:null;if(x!==null){var v=x.next;m=v;do{if((m.tag&a)===a){var A=m.inst,L=A.destroy;if(L!==void 0){A.destroy=void 0,x=c;var V=f,ee=L;try{ee()}catch(ae){$t(x,V,ae)}}}m=m.next}while(m!==v)}}catch(ae){$t(c,c.return,ae)}}function W_(a){var c=a.updateQueue;if(c!==null){var f=a.stateNode;try{zE(c,f)}catch(m){$t(a,a.return,m)}}}function Y_(a,c,f){f.props=dl(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(m){$t(a,c,m)}}function Nd(a,c){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof f=="function"?a.refCleanup=f(m):f.current=m}}catch(x){$t(a,c,x)}}function ii(a,c){var f=a.ref,m=a.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(x){$t(a,c,x)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(x){$t(a,c,x)}else f.current=null}function G_(a){var c=a.type,f=a.memoizedProps,m=a.stateNode;try{e:switch(c){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(x){$t(a,a.return,x)}}function Ix(a,c,f){try{var m=a.stateNode;TH(m,a.type,f,c),m[Co]=c}catch(x){$t(a,a.return,x)}}function X_(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Xr(a.type)||a.tag===4}function Lx(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||X_(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Xr(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function $x(a,c,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,c?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,c):(c=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,c.appendChild(a),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=Mi));else if(m!==4&&(m===27&&Xr(a.type)&&(f=a.stateNode,c=null),a=a.child,a!==null))for($x(a,c,f),a=a.sibling;a!==null;)$x(a,c,f),a=a.sibling}function sm(a,c,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,c?f.insertBefore(a,c):f.appendChild(a);else if(m!==4&&(m===27&&Xr(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(sm(a,c,f),a=a.sibling;a!==null;)sm(a,c,f),a=a.sibling}function J_(a){var c=a.stateNode,f=a.memoizedProps;try{for(var m=a.type,x=c.attributes;x.length;)c.removeAttributeNode(x[0]);Gn(c,m,f),c[Vn]=a,c[Co]=f}catch(v){$t(a,a.return,v)}}var Li=!1,Tn=!1,Fx=!1,Q_=typeof WeakSet=="function"?WeakSet:Set,Fn=null;function iH(a,c){if(a=a.containerInfo,l0=Cm,a=uE(a),Dw(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var x=m.anchorOffset,v=m.focusNode;m=m.focusOffset;try{f.nodeType,v.nodeType}catch{f=null;break e}var A=0,L=-1,V=-1,ee=0,ae=0,ue=a,te=null;t:for(;;){for(var se;ue!==f||x!==0&&ue.nodeType!==3||(L=A+x),ue!==v||m!==0&&ue.nodeType!==3||(V=A+m),ue.nodeType===3&&(A+=ue.nodeValue.length),(se=ue.firstChild)!==null;)te=ue,ue=se;for(;;){if(ue===a)break t;if(te===f&&++ee===x&&(L=A),te===v&&++ae===m&&(V=A),(se=ue.nextSibling)!==null)break;ue=te,te=ue.parentNode}ue=se}f=L===-1||V===-1?null:{start:L,end:V}}else f=null}f=f||{start:0,end:0}}else f=null;for(c0={focusedElem:a,selectionRange:f},Cm=!1,Fn=c;Fn!==null;)if(c=Fn,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,Fn=a;else for(;Fn!==null;){switch(c=Fn,v=c.alternate,a=c.flags,c.tag){case 0:if((a&4)!==0&&(a=c.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f<a.length;f++)x=a[f],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&v!==null){a=void 0,f=c,x=v.memoizedProps,v=v.memoizedState,m=f.stateNode;try{var Ne=dl(f.type,x);a=m.getSnapshotBeforeUpdate(Ne,v),m.__reactInternalSnapshotBeforeUpdate=a}catch(Xe){$t(f,f.return,Xe)}}break;case 3:if((a&1024)!==0){if(a=c.stateNode.containerInfo,f=a.nodeType,f===9)f0(a);else if(f===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":f0(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(o(163))}if(a=c.sibling,a!==null){a.return=c.return,Fn=a;break}Fn=c.return}}function Z_(a,c,f){var m=f.flags;switch(f.tag){case 0:case 11:case 15:Fi(a,f),m&4&&Rd(5,f);break;case 1:if(Fi(a,f),m&4)if(a=f.stateNode,c===null)try{a.componentDidMount()}catch(A){$t(f,f.return,A)}else{var x=dl(f.type,c.memoizedProps);c=c.memoizedState;try{a.componentDidUpdate(x,c,a.__reactInternalSnapshotBeforeUpdate)}catch(A){$t(f,f.return,A)}}m&64&&W_(f),m&512&&Nd(f,f.return);break;case 3:if(Fi(a,f),m&64&&(a=f.updateQueue,a!==null)){if(c=null,f.child!==null)switch(f.child.tag){case 27:case 5:c=f.child.stateNode;break;case 1:c=f.child.stateNode}try{zE(a,c)}catch(A){$t(f,f.return,A)}}break;case 27:c===null&&m&4&&J_(f);case 26:case 5:Fi(a,f),c===null&&m&4&&G_(f),m&512&&Nd(f,f.return);break;case 12:Fi(a,f);break;case 31:Fi(a,f),m&4&&nM(a,f);break;case 13:Fi(a,f),m&4&&oM(a,f),m&64&&(a=f.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(f=pH.bind(null,f),DH(a,f))));break;case 22:if(m=f.memoizedState!==null||Li,!m){c=c!==null&&c.memoizedState!==null||Tn,x=Li;var v=Tn;Li=m,(Tn=c)&&!v?Hi(a,f,(f.subtreeFlags&8772)!==0):Fi(a,f),Li=x,Tn=v}break;case 30:break;default:Fi(a,f)}}function eM(a){var c=a.alternate;c!==null&&(a.alternate=null,eM(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&yw(c)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var rn=null,Eo=!1;function $i(a,c,f){for(f=f.child;f!==null;)tM(a,c,f),f=f.sibling}function tM(a,c,f){if(rt&&typeof rt.onCommitFiberUnmount=="function")try{rt.onCommitFiberUnmount(Te,f)}catch{}switch(f.tag){case 26:Tn||ii(f,c),$i(a,c,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:Tn||ii(f,c);var m=rn,x=Eo;Xr(f.type)&&(rn=f.stateNode,Eo=!1),$i(a,c,f),Hd(f.stateNode),rn=m,Eo=x;break;case 5:Tn||ii(f,c);case 6:if(m=rn,x=Eo,rn=null,$i(a,c,f),rn=m,Eo=x,rn!==null)if(Eo)try{(rn.nodeType===9?rn.body:rn.nodeName==="HTML"?rn.ownerDocument.body:rn).removeChild(f.stateNode)}catch(v){$t(f,c,v)}else try{rn.removeChild(f.stateNode)}catch(v){$t(f,c,v)}break;case 18:rn!==null&&(Eo?(a=rn,WM(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,f.stateNode),qc(a)):WM(rn,f.stateNode));break;case 4:m=rn,x=Eo,rn=f.stateNode.containerInfo,Eo=!0,$i(a,c,f),rn=m,Eo=x;break;case 0:case 11:case 14:case 15:qr(2,f,c),Tn||qr(4,f,c),$i(a,c,f);break;case 1:Tn||(ii(f,c),m=f.stateNode,typeof m.componentWillUnmount=="function"&&Y_(f,c,m)),$i(a,c,f);break;case 21:$i(a,c,f);break;case 22:Tn=(m=Tn)||f.memoizedState!==null,$i(a,c,f),Tn=m;break;default:$i(a,c,f)}}function nM(a,c){if(c.memoizedState===null&&(a=c.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{qc(a)}catch(f){$t(c,c.return,f)}}}function oM(a,c){if(c.memoizedState===null&&(a=c.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{qc(a)}catch(f){$t(c,c.return,f)}}function rH(a){switch(a.tag){case 31:case 13:case 19:var c=a.stateNode;return c===null&&(c=a.stateNode=new Q_),c;case 22:return a=a.stateNode,c=a._retryCache,c===null&&(c=a._retryCache=new Q_),c;default:throw Error(o(435,a.tag))}}function im(a,c){var f=rH(a);c.forEach(function(m){if(!f.has(m)){f.add(m);var x=mH.bind(null,a,m);m.then(x,x)}})}function _o(a,c){var f=c.deletions;if(f!==null)for(var m=0;m<f.length;m++){var x=f[m],v=a,A=c,L=A;e:for(;L!==null;){switch(L.tag){case 27:if(Xr(L.type)){rn=L.stateNode,Eo=!1;break e}break;case 5:rn=L.stateNode,Eo=!1;break e;case 3:case 4:rn=L.stateNode.containerInfo,Eo=!0;break e}L=L.return}if(rn===null)throw Error(o(160));tM(v,A,x),rn=null,Eo=!1,v=x.alternate,v!==null&&(v.return=null),x.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)sM(c,a),c=c.sibling}var $s=null;function sM(a,c){var f=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:_o(c,a),Mo(a),m&4&&(qr(3,a,a.return),Rd(3,a),qr(5,a,a.return));break;case 1:_o(c,a),Mo(a),m&512&&(Tn||f===null||ii(f,f.return)),m&64&&Li&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(f=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=f===null?m:f.concat(m))));break;case 26:var x=$s;if(_o(c,a),Mo(a),m&512&&(Tn||f===null||ii(f,f.return)),m&4){var v=f!==null?f.memoizedState:null;if(m=a.memoizedState,f===null)if(m===null)if(a.stateNode===null){e:{m=a.type,f=a.memoizedProps,x=x.ownerDocument||x;t:switch(m){case"title":v=x.getElementsByTagName("title")[0],(!v||v[rd]||v[Vn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=x.createElement(m),x.head.insertBefore(v,x.querySelector("head > title"))),Gn(v,m,f),v[Vn]=a,$n(v),m=v;break e;case"link":var A=sO("link","href",x).get(m+(f.href||""));if(A){for(var L=0;L<A.length;L++)if(v=A[L],v.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&v.getAttribute("rel")===(f.rel==null?null:f.rel)&&v.getAttribute("title")===(f.title==null?null:f.title)&&v.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){A.splice(L,1);break t}}v=x.createElement(m),Gn(v,m,f),x.head.appendChild(v);break;case"meta":if(A=sO("meta","content",x).get(m+(f.content||""))){for(L=0;L<A.length;L++)if(v=A[L],v.getAttribute("content")===(f.content==null?null:""+f.content)&&v.getAttribute("name")===(f.name==null?null:f.name)&&v.getAttribute("property")===(f.property==null?null:f.property)&&v.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&v.getAttribute("charset")===(f.charSet==null?null:f.charSet)){A.splice(L,1);break t}}v=x.createElement(m),Gn(v,m,f),x.head.appendChild(v);break;default:throw Error(o(468,m))}v[Vn]=a,$n(v),m=v}a.stateNode=m}else iO(x,a.type,a.stateNode);else a.stateNode=oO(x,m,a.memoizedProps);else v!==m?(v===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):v.count--,m===null?iO(x,a.type,a.stateNode):oO(x,m,a.memoizedProps)):m===null&&a.stateNode!==null&&Ix(a,a.memoizedProps,f.memoizedProps)}break;case 27:_o(c,a),Mo(a),m&512&&(Tn||f===null||ii(f,f.return)),f!==null&&m&4&&Ix(a,a.memoizedProps,f.memoizedProps);break;case 5:if(_o(c,a),Mo(a),m&512&&(Tn||f===null||ii(f,f.return)),a.flags&32){x=a.stateNode;try{fc(x,"")}catch(Ne){$t(a,a.return,Ne)}}m&4&&a.stateNode!=null&&(x=a.memoizedProps,Ix(a,x,f!==null?f.memoizedProps:x)),m&1024&&(Fx=!0);break;case 6:if(_o(c,a),Mo(a),m&4){if(a.stateNode===null)throw Error(o(162));m=a.memoizedProps,f=a.stateNode;try{f.nodeValue=m}catch(Ne){$t(a,a.return,Ne)}}break;case 3:if(vm=null,x=$s,$s=wm(c.containerInfo),_o(c,a),$s=x,Mo(a),m&4&&f!==null&&f.memoizedState.isDehydrated)try{qc(c.containerInfo)}catch(Ne){$t(a,a.return,Ne)}Fx&&(Fx=!1,iM(a));break;case 4:m=$s,$s=wm(a.stateNode.containerInfo),_o(c,a),Mo(a),$s=m;break;case 12:_o(c,a),Mo(a);break;case 31:_o(c,a),Mo(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,im(a,m)));break;case 13:_o(c,a),Mo(a),a.child.flags&8192&&a.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(am=fe()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,im(a,m)));break;case 22:x=a.memoizedState!==null;var V=f!==null&&f.memoizedState!==null,ee=Li,ae=Tn;if(Li=ee||x,Tn=ae||V,_o(c,a),Tn=ae,Li=ee,Mo(a),m&8192)e:for(c=a.stateNode,c._visibility=x?c._visibility&-2:c._visibility|1,x&&(f===null||V||Li||Tn||fl(a)),f=null,c=a;;){if(c.tag===5||c.tag===26){if(f===null){V=f=c;try{if(v=V.stateNode,x)A=v.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{L=V.stateNode;var ue=V.memoizedProps.style,te=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;L.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(Ne){$t(V,V.return,Ne)}}}else if(c.tag===6){if(f===null){V=c;try{V.stateNode.nodeValue=x?"":V.memoizedProps}catch(Ne){$t(V,V.return,Ne)}}}else if(c.tag===18){if(f===null){V=c;try{var se=V.stateNode;x?YM(se,!0):YM(V.stateNode,!1)}catch(Ne){$t(V,V.return,Ne)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===a)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break e;for(;c.sibling===null;){if(c.return===null||c.return===a)break e;f===c&&(f=null),c=c.return}f===c&&(f=null),c.sibling.return=c.return,c=c.sibling}m&4&&(m=a.updateQueue,m!==null&&(f=m.retryQueue,f!==null&&(m.retryQueue=null,im(a,f))));break;case 19:_o(c,a),Mo(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,im(a,m)));break;case 30:break;case 21:break;default:_o(c,a),Mo(a)}}function Mo(a){var c=a.flags;if(c&2){try{for(var f,m=a.return;m!==null;){if(X_(m)){f=m;break}m=m.return}if(f==null)throw Error(o(160));switch(f.tag){case 27:var x=f.stateNode,v=Lx(a);sm(a,v,x);break;case 5:var A=f.stateNode;f.flags&32&&(fc(A,""),f.flags&=-33);var L=Lx(a);sm(a,L,A);break;case 3:case 4:var V=f.stateNode.containerInfo,ee=Lx(a);$x(a,ee,V);break;default:throw Error(o(161))}}catch(ae){$t(a,a.return,ae)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function iM(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var c=a;iM(c),c.tag===5&&c.flags&1024&&c.stateNode.reset(),a=a.sibling}}function Fi(a,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)Z_(a,c.alternate,c),c=c.sibling}function fl(a){for(a=a.child;a!==null;){var c=a;switch(c.tag){case 0:case 11:case 14:case 15:qr(4,c,c.return),fl(c);break;case 1:ii(c,c.return);var f=c.stateNode;typeof f.componentWillUnmount=="function"&&Y_(c,c.return,f),fl(c);break;case 27:Hd(c.stateNode);case 26:case 5:ii(c,c.return),fl(c);break;case 22:c.memoizedState===null&&fl(c);break;case 30:fl(c);break;default:fl(c)}a=a.sibling}}function Hi(a,c,f){for(f=f&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var m=c.alternate,x=a,v=c,A=v.flags;switch(v.tag){case 0:case 11:case 15:Hi(x,v,f),Rd(4,v);break;case 1:if(Hi(x,v,f),m=v,x=m.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ee){$t(m,m.return,ee)}if(m=v,x=m.updateQueue,x!==null){var L=m.stateNode;try{var V=x.shared.hiddenCallbacks;if(V!==null)for(x.shared.hiddenCallbacks=null,x=0;x<V.length;x++)BE(V[x],L)}catch(ee){$t(m,m.return,ee)}}f&&A&64&&W_(v),Nd(v,v.return);break;case 27:J_(v);case 26:case 5:Hi(x,v,f),f&&m===null&&A&4&&G_(v),Nd(v,v.return);break;case 12:Hi(x,v,f);break;case 31:Hi(x,v,f),f&&A&4&&nM(x,v);break;case 13:Hi(x,v,f),f&&A&4&&oM(x,v);break;case 22:v.memoizedState===null&&Hi(x,v,f),Nd(v,v.return);break;case 30:break;default:Hi(x,v,f)}c=c.sibling}}function Hx(a,c){var f=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),a=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(a=c.memoizedState.cachePool.pool),a!==f&&(a!=null&&a.refCount++,f!=null&&wd(f))}function qx(a,c){a=null,c.alternate!==null&&(a=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==a&&(c.refCount++,a!=null&&wd(a))}function Fs(a,c,f,m){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)rM(a,c,f,m),c=c.sibling}function rM(a,c,f,m){var x=c.flags;switch(c.tag){case 0:case 11:case 15:Fs(a,c,f,m),x&2048&&Rd(9,c);break;case 1:Fs(a,c,f,m);break;case 3:Fs(a,c,f,m),x&2048&&(a=null,c.alternate!==null&&(a=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==a&&(c.refCount++,a!=null&&wd(a)));break;case 12:if(x&2048){Fs(a,c,f,m),a=c.stateNode;try{var v=c.memoizedProps,A=v.id,L=v.onPostCommit;typeof L=="function"&&L(A,c.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(V){$t(c,c.return,V)}}else Fs(a,c,f,m);break;case 31:Fs(a,c,f,m);break;case 13:Fs(a,c,f,m);break;case 23:break;case 22:v=c.stateNode,A=c.alternate,c.memoizedState!==null?v._visibility&2?Fs(a,c,f,m):Dd(a,c):v._visibility&2?Fs(a,c,f,m):(v._visibility|=2,Rc(a,c,f,m,(c.subtreeFlags&10256)!==0||!1)),x&2048&&Hx(A,c);break;case 24:Fs(a,c,f,m),x&2048&&qx(c.alternate,c);break;default:Fs(a,c,f,m)}}function Rc(a,c,f,m,x){for(x=x&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var v=a,A=c,L=f,V=m,ee=A.flags;switch(A.tag){case 0:case 11:case 15:Rc(v,A,L,V,x),Rd(8,A);break;case 23:break;case 22:var ae=A.stateNode;A.memoizedState!==null?ae._visibility&2?Rc(v,A,L,V,x):Dd(v,A):(ae._visibility|=2,Rc(v,A,L,V,x)),x&&ee&2048&&Hx(A.alternate,A);break;case 24:Rc(v,A,L,V,x),x&&ee&2048&&qx(A.alternate,A);break;default:Rc(v,A,L,V,x)}c=c.sibling}}function Dd(a,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var f=a,m=c,x=m.flags;switch(m.tag){case 22:Dd(f,m),x&2048&&Hx(m.alternate,m);break;case 24:Dd(f,m),x&2048&&qx(m.alternate,m);break;default:Dd(f,m)}c=c.sibling}}var Pd=8192;function Nc(a,c,f){if(a.subtreeFlags&Pd)for(a=a.child;a!==null;)aM(a,c,f),a=a.sibling}function aM(a,c,f){switch(a.tag){case 26:Nc(a,c,f),a.flags&Pd&&a.memoizedState!==null&&KH(f,$s,a.memoizedState,a.memoizedProps);break;case 5:Nc(a,c,f);break;case 3:case 4:var m=$s;$s=wm(a.stateNode.containerInfo),Nc(a,c,f),$s=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Pd,Pd=16777216,Nc(a,c,f),Pd=m):Nc(a,c,f));break;default:Nc(a,c,f)}}function lM(a){var c=a.alternate;if(c!==null&&(a=c.child,a!==null)){c.child=null;do c=a.sibling,a.sibling=null,a=c;while(a!==null)}}function Bd(a){var c=a.deletions;if((a.flags&16)!==0){if(c!==null)for(var f=0;f<c.length;f++){var m=c[f];Fn=m,uM(m,a)}lM(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)cM(a),a=a.sibling}function cM(a){switch(a.tag){case 0:case 11:case 15:Bd(a),a.flags&2048&&qr(9,a,a.return);break;case 3:Bd(a);break;case 12:Bd(a);break;case 22:var c=a.stateNode;a.memoizedState!==null&&c._visibility&2&&(a.return===null||a.return.tag!==13)?(c._visibility&=-3,rm(a)):Bd(a);break;default:Bd(a)}}function rm(a){var c=a.deletions;if((a.flags&16)!==0){if(c!==null)for(var f=0;f<c.length;f++){var m=c[f];Fn=m,uM(m,a)}lM(a)}for(a=a.child;a!==null;){switch(c=a,c.tag){case 0:case 11:case 15:qr(8,c,c.return),rm(c);break;case 22:f=c.stateNode,f._visibility&2&&(f._visibility&=-3,rm(c));break;default:rm(c)}a=a.sibling}}function uM(a,c){for(;Fn!==null;){var f=Fn;switch(f.tag){case 0:case 11:case 15:qr(8,f,c);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var m=f.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:wd(f.memoizedState.cache)}if(m=f.child,m!==null)m.return=f,Fn=m;else e:for(f=a;Fn!==null;){m=Fn;var x=m.sibling,v=m.return;if(eM(m),m===f){Fn=null;break e}if(x!==null){x.return=v,Fn=x;break e}Fn=v}}}var aH={getCacheForType:function(a){var c=Wn(Sn),f=c.data.get(a);return f===void 0&&(f=a(),c.data.set(a,f)),f},cacheSignal:function(){return Wn(Sn).controller.signal}},lH=typeof WeakMap=="function"?WeakMap:Map,Nt=0,Qt=null,wt=null,jt=0,Lt=0,Yo=null,Ur=!1,Dc=!1,Ux=!1,qi=0,hn=0,Vr=0,hl=0,Vx=0,Go=0,Pc=0,zd=null,Oo=null,Kx=!1,am=0,dM=0,lm=1/0,cm=null,Kr=null,An=0,Wr=null,Bc=null,Ui=0,Wx=0,Yx=null,fM=null,Id=0,Gx=null;function Xo(){return(Nt&2)!==0&&jt!==0?jt&-jt:F.T!==null?t0():bp()}function hM(){if(Go===0)if((jt&536870912)===0||Tt){var a=zs;zs<<=1,(zs&3932160)===0&&(zs=262144),Go=a}else Go=536870912;return a=Ko.current,a!==null&&(a.flags|=32),Go}function Ao(a,c,f){(a===Qt&&(Lt===2||Lt===9)||a.cancelPendingCommit!==null)&&(zc(a,0),Yr(a,jt,Go,!1)),us(a,f),((Nt&2)===0||a!==Qt)&&(a===Qt&&((Nt&2)===0&&(hl|=f),hn===4&&Yr(a,jt,Go,!1)),ri(a))}function pM(a,c,f){if((Nt&6)!==0)throw Error(o(327));var m=!f&&(c&127)===0&&(c&a.expiredLanes)===0||kn(a,c),x=m?dH(a,c):Jx(a,c,!0),v=m;do{if(x===0){Dc&&!m&&Yr(a,c,0,!1);break}else{if(f=a.current.alternate,v&&!cH(f)){x=Jx(a,c,!1),v=!1;continue}if(x===2){if(v=c,a.errorRecoveryDisabledLanes&v)var A=0;else A=a.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){c=A;e:{var L=a;x=zd;var V=L.current.memoizedState.isDehydrated;if(V&&(zc(L,A).flags|=256),A=Jx(L,A,!1),A!==2){if(Ux&&!V){L.errorRecoveryDisabledLanes|=v,hl|=v,x=4;break e}v=Oo,Oo=x,v!==null&&(Oo===null?Oo=v:Oo.push.apply(Oo,v))}x=A}if(v=!1,x!==2)continue}}if(x===1){zc(a,0),Yr(a,c,0,!0);break}e:{switch(m=a,v=x,v){case 0:case 1:throw Error(o(345));case 4:if((c&4194048)!==c)break;case 6:Yr(m,c,Go,!Ur);break e;case 2:Oo=null;break;case 3:case 5:break;default:throw Error(o(329))}if((c&62914560)===c&&(x=am+300-fe(),10<x)){if(Yr(m,c,Go,!Ur),Un(m,0,!0)!==0)break e;Ui=c,m.timeoutHandle=VM(mM.bind(null,m,f,Oo,cm,Kx,c,Go,hl,Pc,Ur,v,"Throttled",-0,0),x);break e}mM(m,f,Oo,cm,Kx,c,Go,hl,Pc,Ur,v,null,-0,0)}}break}while(!0);ri(a)}function mM(a,c,f,m,x,v,A,L,V,ee,ae,ue,te,se){if(a.timeoutHandle=-1,ue=c.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Mi},aM(c,v,ue);var Ne=(v&62914560)===v?am-fe():(v&4194048)===v?dM-fe():0;if(Ne=WH(ue,Ne),Ne!==null){Ui=v,a.cancelPendingCommit=Ne(SM.bind(null,a,c,v,f,m,x,A,L,V,ae,ue,null,te,se)),Yr(a,v,A,!ee);return}}SM(a,c,v,f,m,x,A,L,V)}function cH(a){for(var c=a;;){var f=c.tag;if((f===0||f===11||f===15)&&c.flags&16384&&(f=c.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var m=0;m<f.length;m++){var x=f[m],v=x.getSnapshot;x=x.value;try{if(!Uo(v(),x))return!1}catch{return!1}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Yr(a,c,f,m){c&=~Vx,c&=~hl,a.suspendedLanes|=c,a.pingedLanes&=~c,m&&(a.warmLanes|=c),m=a.expirationTimes;for(var x=c;0<x;){var v=31-Jt(x),A=1<<v;m[v]=-1,x&=~A}f!==0&&Is(a,f,c)}function um(){return(Nt&6)===0?(Ld(0),!1):!0}function Xx(){if(wt!==null){if(Lt===0)var a=wt.return;else a=wt,Ni=sl=null,fx(a),Ec=null,vd=0,a=wt;for(;a!==null;)K_(a.alternate,a),a=a.return;wt=null}}function zc(a,c){var f=a.timeoutHandle;f!==-1&&(a.timeoutHandle=-1,MH(f)),f=a.cancelPendingCommit,f!==null&&(a.cancelPendingCommit=null,f()),Ui=0,Xx(),Qt=a,wt=f=Ai(a.current,null),jt=c,Lt=0,Yo=null,Ur=!1,Dc=kn(a,c),Ux=!1,Pc=Go=Vx=hl=Vr=hn=0,Oo=zd=null,Kx=!1,(c&8)!==0&&(c|=c&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=c;0<m;){var x=31-Jt(m),v=1<<x;c|=a[x],m&=~v}return qi=c,Ap(),f}function gM(a,c){at=null,F.H=Md,c===Tc||c===Lp?(c=RE(),Lt=3):c===ex?(c=RE(),Lt=4):Lt=c===_x?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,Yo=c,wt===null&&(hn=1,Zp(a,ps(c,a.current)))}function yM(){var a=Ko.current;return a===null?!0:(jt&4194048)===jt?bs===null:(jt&62914560)===jt||(jt&536870912)!==0?a===bs:!1}function bM(){var a=F.H;return F.H=Md,a===null?Md:a}function wM(){var a=F.A;return F.A=aH,a}function dm(){hn=4,Ur||(jt&4194048)!==jt&&Ko.current!==null||(Dc=!0),(Vr&134217727)===0&&(hl&134217727)===0||Qt===null||Yr(Qt,jt,Go,!1)}function Jx(a,c,f){var m=Nt;Nt|=2;var x=bM(),v=wM();(Qt!==a||jt!==c)&&(cm=null,zc(a,c)),c=!1;var A=hn;e:do try{if(Lt!==0&&wt!==null){var L=wt,V=Yo;switch(Lt){case 8:Xx(),A=6;break e;case 3:case 2:case 9:case 6:Ko.current===null&&(c=!0);var ee=Lt;if(Lt=0,Yo=null,Ic(a,L,V,ee),f&&Dc){A=0;break e}break;default:ee=Lt,Lt=0,Yo=null,Ic(a,L,V,ee)}}uH(),A=hn;break}catch(ae){gM(a,ae)}while(!0);return c&&a.shellSuspendCounter++,Ni=sl=null,Nt=m,F.H=x,F.A=v,wt===null&&(Qt=null,jt=0,Ap()),A}function uH(){for(;wt!==null;)xM(wt)}function dH(a,c){var f=Nt;Nt|=2;var m=bM(),x=wM();Qt!==a||jt!==c?(cm=null,lm=fe()+500,zc(a,c)):Dc=kn(a,c);e:do try{if(Lt!==0&&wt!==null){c=wt;var v=Yo;t:switch(Lt){case 1:Lt=0,Yo=null,Ic(a,c,v,1);break;case 2:case 9:if(OE(v)){Lt=0,Yo=null,vM(c);break}c=function(){Lt!==2&&Lt!==9||Qt!==a||(Lt=7),ri(a)},v.then(c,c);break e;case 3:Lt=7;break e;case 4:Lt=5;break e;case 7:OE(v)?(Lt=0,Yo=null,vM(c)):(Lt=0,Yo=null,Ic(a,c,v,7));break;case 5:var A=null;switch(wt.tag){case 26:A=wt.memoizedState;case 5:case 27:var L=wt;if(A?rO(A):L.stateNode.complete){Lt=0,Yo=null;var V=L.sibling;if(V!==null)wt=V;else{var ee=L.return;ee!==null?(wt=ee,fm(ee)):wt=null}break t}}Lt=0,Yo=null,Ic(a,c,v,5);break;case 6:Lt=0,Yo=null,Ic(a,c,v,6);break;case 8:Xx(),hn=6;break e;default:throw Error(o(462))}}fH();break}catch(ae){gM(a,ae)}while(!0);return Ni=sl=null,F.H=m,F.A=x,Nt=f,wt!==null?0:(Qt=null,jt=0,Ap(),hn)}function fH(){for(;wt!==null&&!bt();)xM(wt)}function xM(a){var c=U_(a.alternate,a,qi);a.memoizedProps=a.pendingProps,c===null?fm(a):wt=c}function vM(a){var c=a,f=c.alternate;switch(c.tag){case 15:case 0:c=I_(f,c,c.pendingProps,c.type,void 0,jt);break;case 11:c=I_(f,c,c.pendingProps,c.type.render,c.ref,jt);break;case 5:fx(c);default:K_(f,c),c=wt=wE(c,qi),c=U_(f,c,qi)}a.memoizedProps=a.pendingProps,c===null?fm(a):wt=c}function Ic(a,c,f,m){Ni=sl=null,fx(c),Ec=null,vd=0;var x=c.return;try{if(eH(a,x,c,f,jt)){hn=1,Zp(a,ps(f,a.current)),wt=null;return}}catch(v){if(x!==null)throw wt=x,v;hn=1,Zp(a,ps(f,a.current)),wt=null;return}c.flags&32768?(Tt||m===1?a=!0:Dc||(jt&536870912)!==0?a=!1:(Ur=a=!0,(m===2||m===9||m===3||m===6)&&(m=Ko.current,m!==null&&m.tag===13&&(m.flags|=16384))),kM(c,a)):fm(c)}function fm(a){var c=a;do{if((c.flags&32768)!==0){kM(c,Ur);return}a=c.return;var f=oH(c.alternate,c,qi);if(f!==null){wt=f;return}if(c=c.sibling,c!==null){wt=c;return}wt=c=a}while(c!==null);hn===0&&(hn=5)}function kM(a,c){do{var f=sH(a.alternate,a);if(f!==null){f.flags&=32767,wt=f;return}if(f=a.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!c&&(a=a.sibling,a!==null)){wt=a;return}wt=a=f}while(a!==null);hn=6,wt=null}function SM(a,c,f,m,x,v,A,L,V){a.cancelPendingCommit=null;do hm();while(An!==0);if((Nt&6)!==0)throw Error(o(327));if(c!==null){if(c===a.current)throw Error(o(177));if(v=c.lanes|c.childLanes,v|=Lw,ic(a,f,v,A,L,V),a===Qt&&(wt=Qt=null,jt=0),Bc=c,Wr=a,Ui=f,Wx=v,Yx=x,fM=m,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,gH(ve,function(){return _M(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||m){m=F.T,F.T=null,x=q.p,q.p=2,A=Nt,Nt|=4;try{iH(a,c,f)}finally{Nt=A,q.p=x,F.T=m}}An=1,jM(),CM(),TM()}}function jM(){if(An===1){An=0;var a=Wr,c=Bc,f=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||f){f=F.T,F.T=null;var m=q.p;q.p=2;var x=Nt;Nt|=4;try{sM(c,a);var v=c0,A=uE(a.containerInfo),L=v.focusedElem,V=v.selectionRange;if(A!==L&&L&&L.ownerDocument&&cE(L.ownerDocument.documentElement,L)){if(V!==null&&Dw(L)){var ee=V.start,ae=V.end;if(ae===void 0&&(ae=ee),"selectionStart"in L)L.selectionStart=ee,L.selectionEnd=Math.min(ae,L.value.length);else{var ue=L.ownerDocument||document,te=ue&&ue.defaultView||window;if(te.getSelection){var se=te.getSelection(),Ne=L.textContent.length,Xe=Math.min(V.start,Ne),Wt=V.end===void 0?Xe:Math.min(V.end,Ne);!se.extend&&Xe>Wt&&(A=Wt,Wt=Xe,Xe=A);var Q=lE(L,Xe),G=lE(L,Wt);if(Q&&G&&(se.rangeCount!==1||se.anchorNode!==Q.node||se.anchorOffset!==Q.offset||se.focusNode!==G.node||se.focusOffset!==G.offset)){var Z=ue.createRange();Z.setStart(Q.node,Q.offset),se.removeAllRanges(),Xe>Wt?(se.addRange(Z),se.extend(G.node,G.offset)):(Z.setEnd(G.node,G.offset),se.addRange(Z))}}}}for(ue=[],se=L;se=se.parentNode;)se.nodeType===1&&ue.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<ue.length;L++){var le=ue[L];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Cm=!!l0,c0=l0=null}finally{Nt=x,q.p=m,F.T=f}}a.current=c,An=2}}function CM(){if(An===2){An=0;var a=Wr,c=Bc,f=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||f){f=F.T,F.T=null;var m=q.p;q.p=2;var x=Nt;Nt|=4;try{Z_(a,c.alternate,c)}finally{Nt=x,q.p=m,F.T=f}}An=3}}function TM(){if(An===4||An===3){An=0,Be();var a=Wr,c=Bc,f=Ui,m=fM;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?An=5:(An=0,Bc=Wr=null,EM(a,a.pendingLanes));var x=a.pendingLanes;if(x===0&&(Kr=null),Xa(f),c=c.stateNode,rt&&typeof rt.onCommitFiberRoot=="function")try{rt.onCommitFiberRoot(Te,c,void 0,(c.current.flags&128)===128)}catch{}if(m!==null){c=F.T,x=q.p,q.p=2,F.T=null;try{for(var v=a.onRecoverableError,A=0;A<m.length;A++){var L=m[A];v(L.value,{componentStack:L.stack})}}finally{F.T=c,q.p=x}}(Ui&3)!==0&&hm(),ri(a),x=a.pendingLanes,(f&261930)!==0&&(x&42)!==0?a===Gx?Id++:(Id=0,Gx=a):Id=0,Ld(0)}}function EM(a,c){(a.pooledCacheLanes&=c)===0&&(c=a.pooledCache,c!=null&&(a.pooledCache=null,wd(c)))}function hm(){return jM(),CM(),TM(),_M()}function _M(){if(An!==5)return!1;var a=Wr,c=Wx;Wx=0;var f=Xa(Ui),m=F.T,x=q.p;try{q.p=32>f?32:f,F.T=null,f=Yx,Yx=null;var v=Wr,A=Ui;if(An=0,Bc=Wr=null,Ui=0,(Nt&6)!==0)throw Error(o(331));var L=Nt;if(Nt|=4,cM(v.current),rM(v,v.current,A,f),Nt=L,Ld(0,!1),rt&&typeof rt.onPostCommitFiberRoot=="function")try{rt.onPostCommitFiberRoot(Te,v)}catch{}return!0}finally{q.p=x,F.T=m,EM(a,c)}}function MM(a,c,f){c=ps(f,c),c=Ex(a.stateNode,c,2),a=$r(a,c,2),a!==null&&(us(a,2),ri(a))}function $t(a,c,f){if(a.tag===3)MM(a,a,f);else for(;c!==null;){if(c.tag===3){MM(c,a,f);break}else if(c.tag===1){var m=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Kr===null||!Kr.has(m))){a=ps(f,a),f=O_(2),m=$r(c,f,2),m!==null&&(A_(f,m,c,a),us(m,2),ri(m));break}}c=c.return}}function Qx(a,c,f){var m=a.pingCache;if(m===null){m=a.pingCache=new lH;var x=new Set;m.set(c,x)}else x=m.get(c),x===void 0&&(x=new Set,m.set(c,x));x.has(f)||(Ux=!0,x.add(f),a=hH.bind(null,a,c,f),c.then(a,a))}function hH(a,c,f){var m=a.pingCache;m!==null&&m.delete(c),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,Qt===a&&(jt&f)===f&&(hn===4||hn===3&&(jt&62914560)===jt&&300>fe()-am?(Nt&2)===0&&zc(a,0):Vx|=f,Pc===jt&&(Pc=0)),ri(a)}function OM(a,c){c===0&&(c=jo()),a=tl(a,c),a!==null&&(us(a,c),ri(a))}function pH(a){var c=a.memoizedState,f=0;c!==null&&(f=c.retryLane),OM(a,f)}function mH(a,c){var f=0;switch(a.tag){case 31:case 13:var m=a.stateNode,x=a.memoizedState;x!==null&&(f=x.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(o(314))}m!==null&&m.delete(c),OM(a,f)}function gH(a,c){return Ae(a,c)}var pm=null,Lc=null,Zx=!1,mm=!1,e0=!1,Gr=0;function ri(a){a!==Lc&&a.next===null&&(Lc===null?pm=Lc=a:Lc=Lc.next=a),mm=!0,Zx||(Zx=!0,bH())}function Ld(a,c){if(!e0&&mm){e0=!0;do for(var f=!1,m=pm;m!==null;){if(a!==0){var x=m.pendingLanes;if(x===0)var v=0;else{var A=m.suspendedLanes,L=m.pingedLanes;v=(1<<31-Jt(42|a)+1)-1,v&=x&~(A&~L),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(f=!0,DM(m,v))}else v=jt,v=Un(m,m===Qt?v:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(v&3)===0||kn(m,v)||(f=!0,DM(m,v));m=m.next}while(f);e0=!1}}function yH(){AM()}function AM(){mm=Zx=!1;var a=0;Gr!==0&&_H()&&(a=Gr);for(var c=fe(),f=null,m=pm;m!==null;){var x=m.next,v=RM(m,c);v===0?(m.next=null,f===null?pm=x:f.next=x,x===null&&(Lc=f)):(f=m,(a!==0||(v&3)!==0)&&(mm=!0)),m=x}An!==0&&An!==5||Ld(a),Gr!==0&&(Gr=0)}function RM(a,c){for(var f=a.suspendedLanes,m=a.pingedLanes,x=a.expirationTimes,v=a.pendingLanes&-62914561;0<v;){var A=31-Jt(v),L=1<<A,V=x[A];V===-1?((L&f)===0||(L&m)!==0)&&(x[A]=ni(L,c)):V<=c&&(a.expiredLanes|=L),v&=~L}if(c=Qt,f=jt,f=Un(a,a===c?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,f===0||a===c&&(Lt===2||Lt===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Pe(m),a.callbackNode=null,a.callbackPriority=0;if((f&3)===0||kn(a,f)){if(c=f&-f,c===a.callbackPriority)return c;switch(m!==null&&Pe(m),Xa(f)){case 2:case 8:f=re;break;case 32:f=ve;break;case 268435456:f=Ln;break;default:f=ve}return m=NM.bind(null,a),f=Ae(f,m),a.callbackPriority=c,a.callbackNode=f,c}return m!==null&&m!==null&&Pe(m),a.callbackPriority=2,a.callbackNode=null,2}function NM(a,c){if(An!==0&&An!==5)return a.callbackNode=null,a.callbackPriority=0,null;var f=a.callbackNode;if(hm()&&a.callbackNode!==f)return null;var m=jt;return m=Un(a,a===Qt?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(pM(a,m,c),RM(a,fe()),a.callbackNode!=null&&a.callbackNode===f?NM.bind(null,a):null)}function DM(a,c){if(hm())return null;pM(a,c,!0)}function bH(){OH(function(){(Nt&6)!==0?Ae(pe,yH):AM()})}function t0(){if(Gr===0){var a=jc;a===0&&(a=vn,vn<<=1,(vn&261888)===0&&(vn=256)),Gr=a}return Gr}function PM(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Sp(""+a)}function BM(a,c){var f=c.ownerDocument.createElement("input");return f.name=c.name,f.value=c.value,a.id&&f.setAttribute("form",a.id),c.parentNode.insertBefore(f,c),a=new FormData(a),f.parentNode.removeChild(f),a}function wH(a,c,f,m,x){if(c==="submit"&&f&&f.stateNode===x){var v=PM((x[Co]||null).action),A=m.submitter;A&&(c=(c=A[Co]||null)?PM(c.formAction):A.getAttribute("formAction"),c!==null&&(v=c,A=null));var L=new Ep("action","action",null,m,x);a.push({event:L,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Gr!==0){var V=A?BM(x,A):new FormData(x);vx(f,{pending:!0,data:V,method:x.method,action:v},null,V)}}else typeof v=="function"&&(L.preventDefault(),V=A?BM(x,A):new FormData(x),vx(f,{pending:!0,data:V,method:x.method,action:v},v,V))},currentTarget:x}]})}}for(var n0=0;n0<Iw.length;n0++){var o0=Iw[n0],xH=o0.toLowerCase(),vH=o0[0].toUpperCase()+o0.slice(1);Ls(xH,"on"+vH)}Ls(hE,"onAnimationEnd"),Ls(pE,"onAnimationIteration"),Ls(mE,"onAnimationStart"),Ls("dblclick","onDoubleClick"),Ls("focusin","onFocus"),Ls("focusout","onBlur"),Ls(z8,"onTransitionRun"),Ls(I8,"onTransitionStart"),Ls(L8,"onTransitionCancel"),Ls(gE,"onTransitionEnd"),uc("onMouseEnter",["mouseout","mouseover"]),uc("onMouseLeave",["mouseout","mouseover"]),uc("onPointerEnter",["pointerout","pointerover"]),uc("onPointerLeave",["pointerout","pointerover"]),Ja("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ja("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ja("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ja("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ja("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ja("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var $d="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),kH=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($d));function zM(a,c){c=(c&4)!==0;for(var f=0;f<a.length;f++){var m=a[f],x=m.event;m=m.listeners;e:{var v=void 0;if(c)for(var A=m.length-1;0<=A;A--){var L=m[A],V=L.instance,ee=L.currentTarget;if(L=L.listener,V!==v&&x.isPropagationStopped())break e;v=L,x.currentTarget=ee;try{v(x)}catch(ae){Op(ae)}x.currentTarget=null,v=V}else for(A=0;A<m.length;A++){if(L=m[A],V=L.instance,ee=L.currentTarget,L=L.listener,V!==v&&x.isPropagationStopped())break e;v=L,x.currentTarget=ee;try{v(x)}catch(ae){Op(ae)}x.currentTarget=null,v=V}}}}function xt(a,c){var f=c[gw];f===void 0&&(f=c[gw]=new Set);var m=a+"__bubble";f.has(m)||(IM(c,a,2,!1),f.add(m))}function s0(a,c,f){var m=0;c&&(m|=4),IM(f,a,m,c)}var gm="_reactListening"+Math.random().toString(36).slice(2);function i0(a){if(!a[gm]){a[gm]=!0,AT.forEach(function(f){f!=="selectionchange"&&(kH.has(f)||s0(f,!1,a),s0(f,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[gm]||(c[gm]=!0,s0("selectionchange",!1,c))}}function IM(a,c,f,m){switch(hO(c)){case 2:var x=XH;break;case 8:x=JH;break;default:x=x0}f=x.bind(null,c,f,a),x=void 0,!Cw||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(x=!0),m?x!==void 0?a.addEventListener(c,f,{capture:!0,passive:x}):a.addEventListener(c,f,!0):x!==void 0?a.addEventListener(c,f,{passive:x}):a.addEventListener(c,f,!1)}function r0(a,c,f,m,x){var v=m;if((c&1)===0&&(c&2)===0&&m!==null)e:for(;;){if(m===null)return;var A=m.tag;if(A===3||A===4){var L=m.stateNode.containerInfo;if(L===x)break;if(A===4)for(A=m.return;A!==null;){var V=A.tag;if((V===3||V===4)&&A.stateNode.containerInfo===x)return;A=A.return}for(;L!==null;){if(A=ac(L),A===null)return;if(V=A.tag,V===5||V===6||V===26||V===27){m=v=A;continue e}L=L.parentNode}}m=m.return}qT(function(){var ee=v,ae=Sw(f),ue=[];e:{var te=yE.get(a);if(te!==void 0){var se=Ep,Ne=a;switch(a){case"keypress":if(Cp(f)===0)break e;case"keydown":case"keyup":se=m8;break;case"focusin":Ne="focus",se=Mw;break;case"focusout":Ne="blur",se=Mw;break;case"beforeblur":case"afterblur":se=Mw;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=KT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=o8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=b8;break;case hE:case pE:case mE:se=r8;break;case gE:se=x8;break;case"scroll":case"scrollend":se=t8;break;case"wheel":se=k8;break;case"copy":case"cut":case"paste":se=l8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=YT;break;case"toggle":case"beforetoggle":se=j8}var Xe=(c&4)!==0,Wt=!Xe&&(a==="scroll"||a==="scrollend"),Q=Xe?te!==null?te+"Capture":null:te;Xe=[];for(var G=ee,Z;G!==null;){var le=G;if(Z=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||Z===null||Q===null||(le=ld(G,Q),le!=null&&Xe.push(Fd(G,le,Z))),Wt)break;G=G.return}0<Xe.length&&(te=new se(te,Ne,null,f,ae),ue.push({event:te,listeners:Xe}))}}if((c&7)===0){e:{if(te=a==="mouseover"||a==="pointerover",se=a==="mouseout"||a==="pointerout",te&&f!==kw&&(Ne=f.relatedTarget||f.fromElement)&&(ac(Ne)||Ne[rc]))break e;if((se||te)&&(te=ae.window===ae?ae:(te=ae.ownerDocument)?te.defaultView||te.parentWindow:window,se?(Ne=f.relatedTarget||f.toElement,se=ee,Ne=Ne?ac(Ne):null,Ne!==null&&(Wt=i(Ne),Xe=Ne.tag,Ne!==Wt||Xe!==5&&Xe!==27&&Xe!==6)&&(Ne=null)):(se=null,Ne=ee),se!==Ne)){if(Xe=KT,le="onMouseLeave",Q="onMouseEnter",G="mouse",(a==="pointerout"||a==="pointerover")&&(Xe=YT,le="onPointerLeave",Q="onPointerEnter",G="pointer"),Wt=se==null?te:ad(se),Z=Ne==null?te:ad(Ne),te=new Xe(le,G+"leave",se,f,ae),te.target=Wt,te.relatedTarget=Z,le=null,ac(ae)===ee&&(Xe=new Xe(Q,G+"enter",Ne,f,ae),Xe.target=Z,Xe.relatedTarget=Wt,le=Xe),Wt=le,se&&Ne)t:{for(Xe=SH,Q=se,G=Ne,Z=0,le=Q;le;le=Xe(le))Z++;le=0;for(var Ue=G;Ue;Ue=Xe(Ue))le++;for(;0<Z-le;)Q=Xe(Q),Z--;for(;0<le-Z;)G=Xe(G),le--;for(;Z--;){if(Q===G||G!==null&&Q===G.alternate){Xe=Q;break t}Q=Xe(Q),G=Xe(G)}Xe=null}else Xe=null;se!==null&&LM(ue,te,se,Xe,!1),Ne!==null&&Wt!==null&&LM(ue,Wt,Ne,Xe,!0)}}e:{if(te=ee?ad(ee):window,se=te.nodeName&&te.nodeName.toLowerCase(),se==="select"||se==="input"&&te.type==="file")var Ot=nE;else if(eE(te))if(oE)Ot=D8;else{Ot=R8;var ze=A8}else se=te.nodeName,!se||se.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ee&&vw(ee.elementType)&&(Ot=nE):Ot=N8;if(Ot&&(Ot=Ot(a,ee))){tE(ue,Ot,f,ae);break e}ze&&ze(a,te,ee),a==="focusout"&&ee&&te.type==="number"&&ee.memoizedProps.value!=null&&xw(te,"number",te.value)}switch(ze=ee?ad(ee):window,a){case"focusin":(eE(ze)||ze.contentEditable==="true")&&(gc=ze,Pw=ee,gd=null);break;case"focusout":gd=Pw=gc=null;break;case"mousedown":Bw=!0;break;case"contextmenu":case"mouseup":case"dragend":Bw=!1,dE(ue,f,ae);break;case"selectionchange":if(B8)break;case"keydown":case"keyup":dE(ue,f,ae)}var ct;if(Aw)e:{switch(a){case"compositionstart":var Ct="onCompositionStart";break e;case"compositionend":Ct="onCompositionEnd";break e;case"compositionupdate":Ct="onCompositionUpdate";break e}Ct=void 0}else mc?QT(a,f)&&(Ct="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(Ct="onCompositionStart");Ct&&(GT&&f.locale!=="ko"&&(mc||Ct!=="onCompositionStart"?Ct==="onCompositionEnd"&&mc&&(ct=UT()):(Nr=ae,Tw="value"in Nr?Nr.value:Nr.textContent,mc=!0)),ze=ym(ee,Ct),0<ze.length&&(Ct=new WT(Ct,a,null,f,ae),ue.push({event:Ct,listeners:ze}),ct?Ct.data=ct:(ct=ZT(f),ct!==null&&(Ct.data=ct)))),(ct=T8?E8(a,f):_8(a,f))&&(Ct=ym(ee,"onBeforeInput"),0<Ct.length&&(ze=new WT("onBeforeInput","beforeinput",null,f,ae),ue.push({event:ze,listeners:Ct}),ze.data=ct)),wH(ue,a,ee,f,ae)}zM(ue,c)})}function Fd(a,c,f){return{instance:a,listener:c,currentTarget:f}}function ym(a,c){for(var f=c+"Capture",m=[];a!==null;){var x=a,v=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||v===null||(x=ld(a,f),x!=null&&m.unshift(Fd(a,x,v)),x=ld(a,c),x!=null&&m.push(Fd(a,x,v))),a.tag===3)return m;a=a.return}return[]}function SH(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function LM(a,c,f,m,x){for(var v=c._reactName,A=[];f!==null&&f!==m;){var L=f,V=L.alternate,ee=L.stateNode;if(L=L.tag,V!==null&&V===m)break;L!==5&&L!==26&&L!==27||ee===null||(V=ee,x?(ee=ld(f,v),ee!=null&&A.unshift(Fd(f,ee,V))):x||(ee=ld(f,v),ee!=null&&A.push(Fd(f,ee,V)))),f=f.return}A.length!==0&&a.push({event:c,listeners:A})}var jH=/\r\n?/g,CH=/\u0000|\uFFFD/g;function $M(a){return(typeof a=="string"?a:""+a).replace(jH,`
|
|
10
|
-
`).replace(CH,"")}function FM(a,c){return c=$M(c),$M(a)===c}function Kt(a,c,f,m,x,v){switch(f){case"children":typeof m=="string"?c==="body"||c==="textarea"&&m===""||fc(a,m):(typeof m=="number"||typeof m=="bigint")&&c!=="body"&&fc(a,""+m);break;case"className":vp(a,"class",m);break;case"tabIndex":vp(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":vp(a,f,m);break;case"style":FT(a,m,v);break;case"data":if(c!=="object"){vp(a,"data",m);break}case"src":case"href":if(m===""&&(c!=="a"||f!=="href")){a.removeAttribute(f);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Sp(""+m),a.setAttribute(f,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(f==="formAction"?(c!=="input"&&Kt(a,c,"name",x.name,x,null),Kt(a,c,"formEncType",x.formEncType,x,null),Kt(a,c,"formMethod",x.formMethod,x,null),Kt(a,c,"formTarget",x.formTarget,x,null)):(Kt(a,c,"encType",x.encType,x,null),Kt(a,c,"method",x.method,x,null),Kt(a,c,"target",x.target,x,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Sp(""+m),a.setAttribute(f,m);break;case"onClick":m!=null&&(a.onclick=Mi);break;case"onScroll":m!=null&&xt("scroll",a);break;case"onScrollEnd":m!=null&&xt("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(o(61));if(f=m.__html,f!=null){if(x.children!=null)throw Error(o(60));a.innerHTML=f}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}f=Sp(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""+m):a.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""):a.removeAttribute(f);break;case"capture":case"download":m===!0?a.setAttribute(f,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,m):a.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(f,m):a.removeAttribute(f);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(f):a.setAttribute(f,m);break;case"popover":xt("beforetoggle",a),xt("toggle",a),xp(a,"popover",m);break;case"xlinkActuate":_i(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":_i(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":_i(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":_i(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":_i(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":_i(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":_i(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":_i(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":_i(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":xp(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=Z6.get(f)||f,xp(a,f,m))}}function a0(a,c,f,m,x,v){switch(f){case"style":FT(a,m,v);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(o(61));if(f=m.__html,f!=null){if(x.children!=null)throw Error(o(60));a.innerHTML=f}}break;case"children":typeof m=="string"?fc(a,m):(typeof m=="number"||typeof m=="bigint")&&fc(a,""+m);break;case"onScroll":m!=null&&xt("scroll",a);break;case"onScrollEnd":m!=null&&xt("scrollend",a);break;case"onClick":m!=null&&(a.onclick=Mi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!RT.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(x=f.endsWith("Capture"),c=f.slice(2,x?f.length-7:void 0),v=a[Co]||null,v=v!=null?v[f]:null,typeof v=="function"&&a.removeEventListener(c,v,x),typeof m=="function")){typeof v!="function"&&v!==null&&(f in a?a[f]=null:a.hasAttribute(f)&&a.removeAttribute(f)),a.addEventListener(c,m,x);break e}f in a?a[f]=m:m===!0?a.setAttribute(f,""):xp(a,f,m)}}}function Gn(a,c,f){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xt("error",a),xt("load",a);var m=!1,x=!1,v;for(v in f)if(f.hasOwnProperty(v)){var A=f[v];if(A!=null)switch(v){case"src":m=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,c));default:Kt(a,c,v,A,f,null)}}x&&Kt(a,c,"srcSet",f.srcSet,f,null),m&&Kt(a,c,"src",f.src,f,null);return;case"input":xt("invalid",a);var L=v=A=x=null,V=null,ee=null;for(m in f)if(f.hasOwnProperty(m)){var ae=f[m];if(ae!=null)switch(m){case"name":x=ae;break;case"type":A=ae;break;case"checked":V=ae;break;case"defaultChecked":ee=ae;break;case"value":v=ae;break;case"defaultValue":L=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,c));break;default:Kt(a,c,m,ae,f,null)}}zT(a,v,L,V,ee,A,x,!1);return;case"select":xt("invalid",a),m=A=v=null;for(x in f)if(f.hasOwnProperty(x)&&(L=f[x],L!=null))switch(x){case"value":v=L;break;case"defaultValue":A=L;break;case"multiple":m=L;default:Kt(a,c,x,L,f,null)}c=v,f=A,a.multiple=!!m,c!=null?dc(a,!!m,c,!1):f!=null&&dc(a,!!m,f,!0);return;case"textarea":xt("invalid",a),v=x=m=null;for(A in f)if(f.hasOwnProperty(A)&&(L=f[A],L!=null))switch(A){case"value":m=L;break;case"defaultValue":x=L;break;case"children":v=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(o(91));break;default:Kt(a,c,A,L,f,null)}LT(a,m,x,v);return;case"option":for(V in f)f.hasOwnProperty(V)&&(m=f[V],m!=null)&&(V==="selected"?a.selected=m&&typeof m!="function"&&typeof m!="symbol":Kt(a,c,V,m,f,null));return;case"dialog":xt("beforetoggle",a),xt("toggle",a),xt("cancel",a),xt("close",a);break;case"iframe":case"object":xt("load",a);break;case"video":case"audio":for(m=0;m<$d.length;m++)xt($d[m],a);break;case"image":xt("error",a),xt("load",a);break;case"details":xt("toggle",a);break;case"embed":case"source":case"link":xt("error",a),xt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in f)if(f.hasOwnProperty(ee)&&(m=f[ee],m!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,c));default:Kt(a,c,ee,m,f,null)}return;default:if(vw(c)){for(ae in f)f.hasOwnProperty(ae)&&(m=f[ae],m!==void 0&&a0(a,c,ae,m,f,void 0));return}}for(L in f)f.hasOwnProperty(L)&&(m=f[L],m!=null&&Kt(a,c,L,m,f,null))}function TH(a,c,f,m){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,v=null,A=null,L=null,V=null,ee=null,ae=null;for(se in f){var ue=f[se];if(f.hasOwnProperty(se)&&ue!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":V=ue;default:m.hasOwnProperty(se)||Kt(a,c,se,null,m,ue)}}for(var te in m){var se=m[te];if(ue=f[te],m.hasOwnProperty(te)&&(se!=null||ue!=null))switch(te){case"type":v=se;break;case"name":x=se;break;case"checked":ee=se;break;case"defaultChecked":ae=se;break;case"value":A=se;break;case"defaultValue":L=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(o(137,c));break;default:se!==ue&&Kt(a,c,te,se,m,ue)}}ww(a,A,L,V,ee,ae,v,x);return;case"select":se=A=L=te=null;for(v in f)if(V=f[v],f.hasOwnProperty(v)&&V!=null)switch(v){case"value":break;case"multiple":se=V;default:m.hasOwnProperty(v)||Kt(a,c,v,null,m,V)}for(x in m)if(v=m[x],V=f[x],m.hasOwnProperty(x)&&(v!=null||V!=null))switch(x){case"value":te=v;break;case"defaultValue":L=v;break;case"multiple":A=v;default:v!==V&&Kt(a,c,x,v,m,V)}c=L,f=A,m=se,te!=null?dc(a,!!f,te,!1):!!m!=!!f&&(c!=null?dc(a,!!f,c,!0):dc(a,!!f,f?[]:"",!1));return;case"textarea":se=te=null;for(L in f)if(x=f[L],f.hasOwnProperty(L)&&x!=null&&!m.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Kt(a,c,L,null,m,x)}for(A in m)if(x=m[A],v=f[A],m.hasOwnProperty(A)&&(x!=null||v!=null))switch(A){case"value":te=x;break;case"defaultValue":se=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(o(91));break;default:x!==v&&Kt(a,c,A,x,m,v)}IT(a,te,se);return;case"option":for(var Ne in f)te=f[Ne],f.hasOwnProperty(Ne)&&te!=null&&!m.hasOwnProperty(Ne)&&(Ne==="selected"?a.selected=!1:Kt(a,c,Ne,null,m,te));for(V in m)te=m[V],se=f[V],m.hasOwnProperty(V)&&te!==se&&(te!=null||se!=null)&&(V==="selected"?a.selected=te&&typeof te!="function"&&typeof te!="symbol":Kt(a,c,V,te,m,se));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Xe in f)te=f[Xe],f.hasOwnProperty(Xe)&&te!=null&&!m.hasOwnProperty(Xe)&&Kt(a,c,Xe,null,m,te);for(ee in m)if(te=m[ee],se=f[ee],m.hasOwnProperty(ee)&&te!==se&&(te!=null||se!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(o(137,c));break;default:Kt(a,c,ee,te,m,se)}return;default:if(vw(c)){for(var Wt in f)te=f[Wt],f.hasOwnProperty(Wt)&&te!==void 0&&!m.hasOwnProperty(Wt)&&a0(a,c,Wt,void 0,m,te);for(ae in m)te=m[ae],se=f[ae],!m.hasOwnProperty(ae)||te===se||te===void 0&&se===void 0||a0(a,c,ae,te,m,se);return}}for(var Q in f)te=f[Q],f.hasOwnProperty(Q)&&te!=null&&!m.hasOwnProperty(Q)&&Kt(a,c,Q,null,m,te);for(ue in m)te=m[ue],se=f[ue],!m.hasOwnProperty(ue)||te===se||te==null&&se==null||Kt(a,c,ue,te,m,se)}function HM(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function EH(){if(typeof performance.getEntriesByType=="function"){for(var a=0,c=0,f=performance.getEntriesByType("resource"),m=0;m<f.length;m++){var x=f[m],v=x.transferSize,A=x.initiatorType,L=x.duration;if(v&&L&&HM(A)){for(A=0,L=x.responseEnd,m+=1;m<f.length;m++){var V=f[m],ee=V.startTime;if(ee>L)break;var ae=V.transferSize,ue=V.initiatorType;ae&&HM(ue)&&(V=V.responseEnd,A+=ae*(V<L?1:(L-ee)/(V-ee)))}if(--m,c+=8*(v+A)/(x.duration/1e3),a++,10<a)break}}if(0<a)return c/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var l0=null,c0=null;function bm(a){return a.nodeType===9?a:a.ownerDocument}function qM(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function UM(a,c){if(a===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&c==="foreignObject"?0:a}function u0(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var d0=null;function _H(){var a=window.event;return a&&a.type==="popstate"?a===d0?!1:(d0=a,!0):(d0=null,!1)}var VM=typeof setTimeout=="function"?setTimeout:void 0,MH=typeof clearTimeout=="function"?clearTimeout:void 0,KM=typeof Promise=="function"?Promise:void 0,OH=typeof queueMicrotask=="function"?queueMicrotask:typeof KM<"u"?function(a){return KM.resolve(null).then(a).catch(AH)}:VM;function AH(a){setTimeout(function(){throw a})}function Xr(a){return a==="head"}function WM(a,c){var f=c,m=0;do{var x=f.nextSibling;if(a.removeChild(f),x&&x.nodeType===8)if(f=x.data,f==="/$"||f==="/&"){if(m===0){a.removeChild(x),qc(c);return}m--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")m++;else if(f==="html")Hd(a.ownerDocument.documentElement);else if(f==="head"){f=a.ownerDocument.head,Hd(f);for(var v=f.firstChild;v;){var A=v.nextSibling,L=v.nodeName;v[rd]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&v.rel.toLowerCase()==="stylesheet"||f.removeChild(v),v=A}}else f==="body"&&Hd(a.ownerDocument.body);f=x}while(f);qc(c)}function YM(a,c){var f=a;a=0;do{var m=f.nextSibling;if(f.nodeType===1?c?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(c?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),m&&m.nodeType===8)if(f=m.data,f==="/$"){if(a===0)break;a--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||a++;f=m}while(f)}function f0(a){var c=a.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var f=c;switch(c=c.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":f0(f),yw(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}a.removeChild(f)}}function RH(a,c,f,m){for(;a.nodeType===1;){var x=f;if(a.nodeName.toLowerCase()!==c.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[rd])switch(c){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(v=a.getAttribute("rel"),v==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(v!==x.rel||a.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||a.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||a.getAttribute("title")!==(x.title==null?null:x.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(v=a.getAttribute("src"),(v!==(x.src==null?null:x.src)||a.getAttribute("type")!==(x.type==null?null:x.type)||a.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&v&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(c==="input"&&a.type==="hidden"){var v=x.name==null?null:""+x.name;if(x.type==="hidden"&&a.getAttribute("name")===v)return a}else return a;if(a=ws(a.nextSibling),a===null)break}return null}function NH(a,c,f){if(c==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!f||(a=ws(a.nextSibling),a===null))return null;return a}function GM(a,c){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=ws(a.nextSibling),a===null))return null;return a}function h0(a){return a.data==="$?"||a.data==="$~"}function p0(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function DH(a,c){var f=a.ownerDocument;if(a.data==="$~")a._reactRetry=c;else if(a.data!=="$?"||f.readyState!=="loading")c();else{var m=function(){c(),f.removeEventListener("DOMContentLoaded",m)};f.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function ws(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return a}var m0=null;function XM(a){a=a.nextSibling;for(var c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"||f==="/&"){if(c===0)return ws(a.nextSibling);c--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||c++}a=a.nextSibling}return null}function JM(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(c===0)return a;c--}else f!=="/$"&&f!=="/&"||c++}a=a.previousSibling}return null}function QM(a,c,f){switch(c=bm(f),a){case"html":if(a=c.documentElement,!a)throw Error(o(452));return a;case"head":if(a=c.head,!a)throw Error(o(453));return a;case"body":if(a=c.body,!a)throw Error(o(454));return a;default:throw Error(o(451))}}function Hd(a){for(var c=a.attributes;c.length;)a.removeAttributeNode(c[0]);yw(a)}var xs=new Map,ZM=new Set;function wm(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Vi=q.d;q.d={f:PH,r:BH,D:zH,C:IH,L:LH,m:$H,X:HH,S:FH,M:qH};function PH(){var a=Vi.f(),c=um();return a||c}function BH(a){var c=lc(a);c!==null&&c.tag===5&&c.type==="form"?g_(c):Vi.r(a)}var $c=typeof document>"u"?null:document;function eO(a,c,f){var m=$c;if(m&&typeof c=="string"&&c){var x=fs(c);x='link[rel="'+a+'"][href="'+x+'"]',typeof f=="string"&&(x+='[crossorigin="'+f+'"]'),ZM.has(x)||(ZM.add(x),a={rel:a,crossOrigin:f,href:c},m.querySelector(x)===null&&(c=m.createElement("link"),Gn(c,"link",a),$n(c),m.head.appendChild(c)))}}function zH(a){Vi.D(a),eO("dns-prefetch",a,null)}function IH(a,c){Vi.C(a,c),eO("preconnect",a,c)}function LH(a,c,f){Vi.L(a,c,f);var m=$c;if(m&&a&&c){var x='link[rel="preload"][as="'+fs(c)+'"]';c==="image"&&f&&f.imageSrcSet?(x+='[imagesrcset="'+fs(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(x+='[imagesizes="'+fs(f.imageSizes)+'"]')):x+='[href="'+fs(a)+'"]';var v=x;switch(c){case"style":v=Fc(a);break;case"script":v=Hc(a)}xs.has(v)||(a=p({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:a,as:c},f),xs.set(v,a),m.querySelector(x)!==null||c==="style"&&m.querySelector(qd(v))||c==="script"&&m.querySelector(Ud(v))||(c=m.createElement("link"),Gn(c,"link",a),$n(c),m.head.appendChild(c)))}}function $H(a,c){Vi.m(a,c);var f=$c;if(f&&a){var m=c&&typeof c.as=="string"?c.as:"script",x='link[rel="modulepreload"][as="'+fs(m)+'"][href="'+fs(a)+'"]',v=x;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Hc(a)}if(!xs.has(v)&&(a=p({rel:"modulepreload",href:a},c),xs.set(v,a),f.querySelector(x)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Ud(v)))return}m=f.createElement("link"),Gn(m,"link",a),$n(m),f.head.appendChild(m)}}}function FH(a,c,f){Vi.S(a,c,f);var m=$c;if(m&&a){var x=cc(m).hoistableStyles,v=Fc(a);c=c||"default";var A=x.get(v);if(!A){var L={loading:0,preload:null};if(A=m.querySelector(qd(v)))L.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":c},f),(f=xs.get(v))&&g0(a,f);var V=A=m.createElement("link");$n(V),Gn(V,"link",a),V._p=new Promise(function(ee,ae){V.onload=ee,V.onerror=ae}),V.addEventListener("load",function(){L.loading|=1}),V.addEventListener("error",function(){L.loading|=2}),L.loading|=4,xm(A,c,m)}A={type:"stylesheet",instance:A,count:1,state:L},x.set(v,A)}}}function HH(a,c){Vi.X(a,c);var f=$c;if(f&&a){var m=cc(f).hoistableScripts,x=Hc(a),v=m.get(x);v||(v=f.querySelector(Ud(x)),v||(a=p({src:a,async:!0},c),(c=xs.get(x))&&y0(a,c),v=f.createElement("script"),$n(v),Gn(v,"link",a),f.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},m.set(x,v))}}function qH(a,c){Vi.M(a,c);var f=$c;if(f&&a){var m=cc(f).hoistableScripts,x=Hc(a),v=m.get(x);v||(v=f.querySelector(Ud(x)),v||(a=p({src:a,async:!0,type:"module"},c),(c=xs.get(x))&&y0(a,c),v=f.createElement("script"),$n(v),Gn(v,"link",a),f.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},m.set(x,v))}}function tO(a,c,f,m){var x=(x=ie.current)?wm(x):null;if(!x)throw Error(o(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=Fc(f.href),f=cc(x).hoistableStyles,m=f.get(c),m||(m={type:"style",instance:null,count:0,state:null},f.set(c,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=Fc(f.href);var v=cc(x).hoistableStyles,A=v.get(a);if(A||(x=x.ownerDocument||x,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(a,A),(v=x.querySelector(qd(a)))&&!v._p&&(A.instance=v,A.state.loading=5),xs.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},xs.set(a,f),v||UH(x,a,f,A.state))),c&&m===null)throw Error(o(528,""));return A}if(c&&m!==null)throw Error(o(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Hc(f),f=cc(x).hoistableScripts,m=f.get(c),m||(m={type:"script",instance:null,count:0,state:null},f.set(c,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,a))}}function Fc(a){return'href="'+fs(a)+'"'}function qd(a){return'link[rel="stylesheet"]['+a+"]"}function nO(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function UH(a,c,f,m){a.querySelector('link[rel="preload"][as="style"]['+c+"]")?m.loading=1:(c=a.createElement("link"),m.preload=c,c.addEventListener("load",function(){return m.loading|=1}),c.addEventListener("error",function(){return m.loading|=2}),Gn(c,"link",f),$n(c),a.head.appendChild(c))}function Hc(a){return'[src="'+fs(a)+'"]'}function Ud(a){return"script[async]"+a}function oO(a,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var m=a.querySelector('style[data-href~="'+fs(f.href)+'"]');if(m)return c.instance=m,$n(m),m;var x=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),$n(m),Gn(m,"style",x),xm(m,f.precedence,a),c.instance=m;case"stylesheet":x=Fc(f.href);var v=a.querySelector(qd(x));if(v)return c.state.loading|=4,c.instance=v,$n(v),v;m=nO(f),(x=xs.get(x))&&g0(m,x),v=(a.ownerDocument||a).createElement("link"),$n(v);var A=v;return A._p=new Promise(function(L,V){A.onload=L,A.onerror=V}),Gn(v,"link",m),c.state.loading|=4,xm(v,f.precedence,a),c.instance=v;case"script":return v=Hc(f.src),(x=a.querySelector(Ud(v)))?(c.instance=x,$n(x),x):(m=f,(x=xs.get(v))&&(m=p({},f),y0(m,x)),a=a.ownerDocument||a,x=a.createElement("script"),$n(x),Gn(x,"link",m),a.head.appendChild(x),c.instance=x);case"void":return null;default:throw Error(o(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(m=c.instance,c.state.loading|=4,xm(m,f.precedence,a));return c.instance}function xm(a,c,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=m.length?m[m.length-1]:null,v=x,A=0;A<m.length;A++){var L=m[A];if(L.dataset.precedence===c)v=L;else if(v!==x)break}v?v.parentNode.insertBefore(a,v.nextSibling):(c=f.nodeType===9?f.head:f,c.insertBefore(a,c.firstChild))}function g0(a,c){a.crossOrigin==null&&(a.crossOrigin=c.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=c.referrerPolicy),a.title==null&&(a.title=c.title)}function y0(a,c){a.crossOrigin==null&&(a.crossOrigin=c.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=c.referrerPolicy),a.integrity==null&&(a.integrity=c.integrity)}var vm=null;function sO(a,c,f){if(vm===null){var m=new Map,x=vm=new Map;x.set(f,m)}else x=vm,m=x.get(f),m||(m=new Map,x.set(f,m));if(m.has(a))return m;for(m.set(a,null),f=f.getElementsByTagName(a),x=0;x<f.length;x++){var v=f[x];if(!(v[rd]||v[Vn]||a==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var A=v.getAttribute(c)||"";A=a+A;var L=m.get(A);L?L.push(v):m.set(A,[v])}}return m}function iO(a,c,f){a=a.ownerDocument||a,a.head.insertBefore(f,c==="title"?a.querySelector("head > title"):null)}function VH(a,c,f){if(f===1||c.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(a=c.disabled,typeof c.precedence=="string"&&a==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function rO(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function KH(a,c,f,m){if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var x=Fc(m.href),v=c.querySelector(qd(x));if(v){c=v._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(a.count++,a=km.bind(a),c.then(a,a)),f.state.loading|=4,f.instance=v,$n(v);return}v=c.ownerDocument||c,m=nO(m),(x=xs.get(x))&&g0(m,x),v=v.createElement("link"),$n(v);var A=v;A._p=new Promise(function(L,V){A.onload=L,A.onerror=V}),Gn(v,"link",m),f.instance=v}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,c),(c=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=km.bind(a),c.addEventListener("load",f),c.addEventListener("error",f))}}var b0=0;function WH(a,c){return a.stylesheets&&a.count===0&&jm(a,a.stylesheets),0<a.count||0<a.imgCount?function(f){var m=setTimeout(function(){if(a.stylesheets&&jm(a,a.stylesheets),a.unsuspend){var v=a.unsuspend;a.unsuspend=null,v()}},6e4+c);0<a.imgBytes&&b0===0&&(b0=62500*EH());var x=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&jm(a,a.stylesheets),a.unsuspend)){var v=a.unsuspend;a.unsuspend=null,v()}},(a.imgBytes>b0?50:800)+c);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(x)}}:null}function km(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jm(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Sm=null;function jm(a,c){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Sm=new Map,c.forEach(YH,a),Sm=null,km.call(a))}function YH(a,c){if(!(c.state.loading&4)){var f=Sm.get(a);if(f)var m=f.get(null);else{f=new Map,Sm.set(a,f);for(var x=a.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<x.length;v++){var A=x[v];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(f.set(A.dataset.precedence,A),m=A)}m&&f.set(null,m)}x=c.instance,A=x.getAttribute("data-precedence"),v=f.get(A)||m,v===m&&f.set(null,x),f.set(A,x),this.count++,m=km.bind(this),x.addEventListener("load",m),x.addEventListener("error",m),v?v.parentNode.insertBefore(x,v.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(x,a.firstChild)),c.state.loading|=4}}var Vd={$$typeof:T,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function GH(a,c,f,m,x,v,A,L,V){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_r(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_r(0),this.hiddenUpdates=_r(null),this.identifierPrefix=m,this.onUncaughtError=x,this.onCaughtError=v,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function aO(a,c,f,m,x,v,A,L,V,ee,ae,ue){return a=new GH(a,c,f,A,V,ee,ae,ue,L),c=1,v===!0&&(c|=24),v=Vo(3,null,null,c),a.current=v,v.stateNode=a,c=Jw(),c.refCount++,a.pooledCache=c,c.refCount++,v.memoizedState={element:m,isDehydrated:f,cache:c},tx(v),a}function lO(a){return a?(a=wc,a):wc}function cO(a,c,f,m,x,v){x=lO(x),m.context===null?m.context=x:m.pendingContext=x,m=Lr(c),m.payload={element:f},v=v===void 0?null:v,v!==null&&(m.callback=v),f=$r(a,m,c),f!==null&&(Ao(f,a,c),Sd(f,a,c))}function uO(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<c?f:c}}function w0(a,c){uO(a,c),(a=a.alternate)&&uO(a,c)}function dO(a){if(a.tag===13||a.tag===31){var c=tl(a,67108864);c!==null&&Ao(c,a,67108864),w0(a,67108864)}}function fO(a){if(a.tag===13||a.tag===31){var c=Xo();c=Ar(c);var f=tl(a,c);f!==null&&Ao(f,a,c),w0(a,c)}}var Cm=!0;function XH(a,c,f,m){var x=F.T;F.T=null;var v=q.p;try{q.p=2,x0(a,c,f,m)}finally{q.p=v,F.T=x}}function JH(a,c,f,m){var x=F.T;F.T=null;var v=q.p;try{q.p=8,x0(a,c,f,m)}finally{q.p=v,F.T=x}}function x0(a,c,f,m){if(Cm){var x=v0(m);if(x===null)r0(a,c,m,Tm,f),pO(a,m);else if(ZH(x,a,c,f,m))m.stopPropagation();else if(pO(a,m),c&4&&-1<QH.indexOf(a)){for(;x!==null;){var v=lc(x);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var A=un(v.pendingLanes);if(A!==0){var L=v;for(L.pendingLanes|=2,L.entangledLanes|=2;A;){var V=1<<31-Jt(A);L.entanglements[1]|=V,A&=~V}ri(v),(Nt&6)===0&&(lm=fe()+500,Ld(0))}}break;case 31:case 13:L=tl(v,2),L!==null&&Ao(L,v,2),um(),w0(v,2)}if(v=v0(m),v===null&&r0(a,c,m,Tm,f),v===x)break;x=v}x!==null&&m.stopPropagation()}else r0(a,c,m,null,f)}}function v0(a){return a=Sw(a),k0(a)}var Tm=null;function k0(a){if(Tm=null,a=ac(a),a!==null){var c=i(a);if(c===null)a=null;else{var f=c.tag;if(f===13){if(a=r(c),a!==null)return a;a=null}else if(f===31){if(a=l(c),a!==null)return a;a=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null)}}return Tm=a,null}function hO(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(xe()){case pe:return 2;case re:return 8;case ve:case Ze:return 32;case Ln:return 268435456;default:return 32}default:return 32}}var S0=!1,Jr=null,Qr=null,Zr=null,Kd=new Map,Wd=new Map,ea=[],QH="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function pO(a,c){switch(a){case"focusin":case"focusout":Jr=null;break;case"dragenter":case"dragleave":Qr=null;break;case"mouseover":case"mouseout":Zr=null;break;case"pointerover":case"pointerout":Kd.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wd.delete(c.pointerId)}}function Yd(a,c,f,m,x,v){return a===null||a.nativeEvent!==v?(a={blockedOn:c,domEventName:f,eventSystemFlags:m,nativeEvent:v,targetContainers:[x]},c!==null&&(c=lc(c),c!==null&&dO(c)),a):(a.eventSystemFlags|=m,c=a.targetContainers,x!==null&&c.indexOf(x)===-1&&c.push(x),a)}function ZH(a,c,f,m,x){switch(c){case"focusin":return Jr=Yd(Jr,a,c,f,m,x),!0;case"dragenter":return Qr=Yd(Qr,a,c,f,m,x),!0;case"mouseover":return Zr=Yd(Zr,a,c,f,m,x),!0;case"pointerover":var v=x.pointerId;return Kd.set(v,Yd(Kd.get(v)||null,a,c,f,m,x)),!0;case"gotpointercapture":return v=x.pointerId,Wd.set(v,Yd(Wd.get(v)||null,a,c,f,m,x)),!0}return!1}function mO(a){var c=ac(a.target);if(c!==null){var f=i(c);if(f!==null){if(c=f.tag,c===13){if(c=r(f),c!==null){a.blockedOn=c,wp(a.priority,function(){fO(f)});return}}else if(c===31){if(c=l(f),c!==null){a.blockedOn=c,wp(a.priority,function(){fO(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Em(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var f=v0(a.nativeEvent);if(f===null){f=a.nativeEvent;var m=new f.constructor(f.type,f);kw=m,f.target.dispatchEvent(m),kw=null}else return c=lc(f),c!==null&&dO(c),a.blockedOn=f,!1;c.shift()}return!0}function gO(a,c,f){Em(a)&&f.delete(c)}function eq(){S0=!1,Jr!==null&&Em(Jr)&&(Jr=null),Qr!==null&&Em(Qr)&&(Qr=null),Zr!==null&&Em(Zr)&&(Zr=null),Kd.forEach(gO),Wd.forEach(gO)}function _m(a,c){a.blockedOn===c&&(a.blockedOn=null,S0||(S0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,eq)))}var Mm=null;function yO(a){Mm!==a&&(Mm=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mm===a&&(Mm=null);for(var c=0;c<a.length;c+=3){var f=a[c],m=a[c+1],x=a[c+2];if(typeof m!="function"){if(k0(m||f)===null)continue;break}var v=lc(f);v!==null&&(a.splice(c,3),c-=3,vx(v,{pending:!0,data:x,method:f.method,action:m},m,x))}}))}function qc(a){function c(V){return _m(V,a)}Jr!==null&&_m(Jr,a),Qr!==null&&_m(Qr,a),Zr!==null&&_m(Zr,a),Kd.forEach(c),Wd.forEach(c);for(var f=0;f<ea.length;f++){var m=ea[f];m.blockedOn===a&&(m.blockedOn=null)}for(;0<ea.length&&(f=ea[0],f.blockedOn===null);)mO(f),f.blockedOn===null&&ea.shift();if(f=(a.ownerDocument||a).$$reactFormReplay,f!=null)for(m=0;m<f.length;m+=3){var x=f[m],v=f[m+1],A=x[Co]||null;if(typeof v=="function")A||yO(f);else if(A){var L=null;if(v&&v.hasAttribute("formAction")){if(x=v,A=v[Co]||null)L=A.formAction;else if(k0(x)!==null)continue}else L=A.action;typeof L=="function"?f[m+1]=L:(f.splice(m,3),m-=3),yO(f)}}}function bO(){function a(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(A){return x=A})},focusReset:"manual",scroll:"manual"})}function c(){x!==null&&(x(),x=null),m||setTimeout(f,20)}function f(){if(!m&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,x=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(f,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),x!==null&&(x(),x=null)}}}function j0(a){this._internalRoot=a}Om.prototype.render=j0.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(o(409));var f=c.current,m=Xo();cO(f,m,a,c,null,null)},Om.prototype.unmount=j0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;cO(a.current,2,null,a,null,null),um(),c[rc]=null}};function Om(a){this._internalRoot=a}Om.prototype.unstable_scheduleHydration=function(a){if(a){var c=bp();a={blockedOn:null,target:a,priority:c};for(var f=0;f<ea.length&&c!==0&&c<ea[f].priority;f++);ea.splice(f,0,a),f===0&&mO(a)}};var wO=e.version;if(wO!=="19.2.4")throw Error(o(527,wO,"19.2.4"));q.findDOMNode=function(a){var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(o(188)):(a=Object.keys(a).join(","),Error(o(268,a)));return a=d(c),a=a!==null?h(a):null,a=a===null?null:a.stateNode,a};var tq={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Am=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Am.isDisabled&&Am.supportsFiber)try{Te=Am.inject(tq),rt=Am}catch{}}return Xd.createRoot=function(a,c){if(!s(a))throw Error(o(299));var f=!1,m="",x=T_,v=E_,A=__;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(x=c.onUncaughtError),c.onCaughtError!==void 0&&(v=c.onCaughtError),c.onRecoverableError!==void 0&&(A=c.onRecoverableError)),c=aO(a,1,!1,null,null,f,m,null,x,v,A,bO),a[rc]=c.current,i0(a),new j0(c)},Xd.hydrateRoot=function(a,c,f){if(!s(a))throw Error(o(299));var m=!1,x="",v=T_,A=E_,L=__,V=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(x=f.identifierPrefix),f.onUncaughtError!==void 0&&(v=f.onUncaughtError),f.onCaughtError!==void 0&&(A=f.onCaughtError),f.onRecoverableError!==void 0&&(L=f.onRecoverableError),f.formState!==void 0&&(V=f.formState)),c=aO(a,1,!0,c,f??null,m,x,V,v,A,L,bO),c.context=lO(null),f=c.current,m=Xo(),m=Ar(m),x=Lr(m),x.callback=null,$r(f,x,m),f=m,c.current.lanes=f,us(c,f),ri(c),a[rc]=c.current,i0(a),new Om(c)},Xd.version="19.2.4",Xd}var MO;function hq(){if(MO)return E0.exports;MO=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),E0.exports=fq(),E0.exports}var tP=hq();function Rn(){}const br=Object.freeze([]),nn=Object.freeze({});function lS({controlled:t,default:e,name:n,state:o="value"}){const{current:s}=S.useRef(t!==void 0),[i,r]=S.useState(e),l=s&&t!==void 0?t:i,u=S.useCallback(d=>{s||r(d)},[]);return[l,u]}const pq=()=>{},Se=typeof document<"u"?S.useLayoutEffect:pq,OO={};function qn(t,e){const n=S.useRef(OO);return n.current===OO&&(n.current=t(e)),n}function Ra(t,e,n,o){const s=qn(nP).current;return gq(s,t,e,n,o)&&oP(s,[t,e,n,o]),s.callback}function mq(t){const e=qn(nP).current;return yq(e,t)&&oP(e,t),e.callback}function nP(){return{callback:null,cleanup:null,refs:[]}}function gq(t,e,n,o,s){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==o||t.refs[3]!==s}function yq(t,e){return t.refs.length!==e.length||t.refs.some((n,o)=>n!==e[o])}function oP(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const o=Array(e.length).fill(null);for(let s=0;s<e.length;s+=1){const i=e[s];if(i!=null)switch(typeof i){case"function":{const r=i(n);typeof r=="function"&&(o[s]=r);break}case"object":{i.current=n;break}}}t.cleanup=()=>{for(let s=0;s<e.length;s+=1){const i=e[s];if(i!=null)switch(typeof i){case"function":{const r=o[s];typeof r=="function"?r():i(null);break}case"object":{i.current=null;break}}}}}}}const sP={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},cS={...sP,position:"fixed",top:0,left:0},bq={...sP,position:"absolute"};function Uy(){return typeof window<"u"}function oo(t){return uS(t)?(t.nodeName||"").toLowerCase():"#document"}function on(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Er(t){var e;return(e=(uS(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function uS(t){return Uy()?t instanceof Node||t instanceof on(t).Node:!1}function vt(t){return Uy()?t instanceof Element||t instanceof on(t).Element:!1}function Ft(t){return Uy()?t instanceof HTMLElement||t instanceof on(t).HTMLElement:!1}function ku(t){return!Uy()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof on(t).ShadowRoot}function Ih(t){const{overflow:e,overflowX:n,overflowY:o,display:s}=is(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&s!=="inline"&&s!=="contents"}function wq(t){return/^(table|td|th)$/.test(oo(t))}function Vy(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const xq=/transform|translate|scale|rotate|perspective|filter/,vq=/paint|layout|strict|content/,pl=t=>!!t&&t!=="none";let A0;function dS(t){const e=vt(t)?is(t):t;return pl(e.transform)||pl(e.translate)||pl(e.scale)||pl(e.rotate)||pl(e.perspective)||!fS()&&(pl(e.backdropFilter)||pl(e.filter))||xq.test(e.willChange||"")||vq.test(e.contain||"")}function kq(t){let e=wr(t);for(;Ft(e)&&!ur(e);){if(dS(e))return e;if(Vy(e))return null;e=wr(e)}return null}function fS(){return A0==null&&(A0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),A0}function ur(t){return/^(html|body|#document)$/.test(oo(t))}function is(t){return on(t).getComputedStyle(t)}function Ky(t){return vt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function wr(t){if(oo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ku(t)&&t.host||Er(t);return ku(e)?e.host:e}function iP(t){const e=wr(t);return ur(e)?(t.ownerDocument||t).body:Ft(e)&&Ih(e)?e:iP(e)}function Kf(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=iP(t),i=s===((o=t.ownerDocument)==null?void 0:o.body),r=on(s);if(i){const l=hk(r);return e.concat(r,r.visualViewport||[],Ih(s)?s:[],l&&n?Kf(l):[])}else return e.concat(s,Kf(s,[],n))}function hk(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yt(t){return t?.ownerDocument||document}const Sq="data-valid",jq="data-invalid",Cq={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Tq={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Eq={disabled:!1,...Tq},_q={valid(t){return t===null?null:t?{[Sq]:""}:{[jq]:""}}};function Tf(t,e,{detail:n=0}={}){t.dispatchEvent(new(on(t)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}function Mq(t,e){return function(o,...s){const i=new URL(t);return i.searchParams.set("code",o.toString()),s.forEach(r=>i.searchParams.append("args[]",r)),`${e} error #${o}; visit ${i} for the full message.`}}const gn=Mq("https://base-ui.com/production-error","Base UI"),Oq=parseInt(S.version,10);function hS(t){return Oq>=t}function AO(t){if(!S.isValidElement(t))return null;const e=t,n=e.props;return(hS(19)?n?.ref:e.ref)??null}function pk(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function Aq(t,e){const n={};for(const o in t){const s=t[o];if(e?.hasOwnProperty(o)){const i=e[o](s);i!=null&&Object.assign(n,i);continue}s===!0?n[`data-${o.toLowerCase()}`]="":s&&(n[`data-${o.toLowerCase()}`]=s.toString())}return n}function Rq(t,e){return typeof t=="function"?t(e):t}function Nq(t,e){return typeof t=="function"?t(e):t}const pS={};function dr(t,e,n,o,s){if(!n&&!o&&!s&&!t)return Fg(e);let i=Fg(t);return e&&(i=hf(i,e)),n&&(i=hf(i,n)),o&&(i=hf(i,o)),s&&(i=hf(i,s)),i}function Dq(t){if(t.length===0)return pS;if(t.length===1)return Fg(t[0]);let e=Fg(t[0]);for(let n=1;n<t.length;n+=1)e=hf(e,t[n]);return e}function Fg(t){return mS(t)?{...aP(t,pS)}:Pq(t)}function hf(t,e){return mS(e)?aP(e,t):Bq(t,e)}function Pq(t){const e={...t};for(const n in e){const o=e[n];rP(n,o)&&(e[n]=lP(o))}return e}function Bq(t,e){if(!e)return t;for(const n in e){const o=e[n];switch(n){case"style":{t[n]=pk(t.style,o);break}case"className":{t[n]=cP(t.className,o);break}default:rP(n,o)?t[n]=zq(t[n],o):t[n]=o}}return t}function rP(t,e){const n=t.charCodeAt(0),o=t.charCodeAt(1),s=t.charCodeAt(2);return n===111&&o===110&&s>=65&&s<=90&&(typeof e=="function"||typeof e>"u")}function mS(t){return typeof t=="function"}function aP(t,e){return mS(t)?t(e):t??pS}function zq(t,e){return e?t?(...n)=>{const o=n[0];if(uP(o)){const i=o;Hg(i);const r=e(...n);return i.baseUIHandlerPrevented||t?.(...n),r}const s=e(...n);return t?.(...n),s}:lP(e):t}function lP(t){return t&&((...e)=>{const n=e[0];return uP(n)&&Hg(n),t(...e)})}function Hg(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function cP(t,e){return e?t?e+" "+t:e:t}function uP(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function Ht(t,e,n={}){let o=e.render;n.enabled!==!1&&(o=Fq(o));const s=Iq(e,n,o);if(n.enabled===!1)return null;const i=n.state??nn;return Hq(t,o,s,i)}function Iq(t,e,n){const{className:o,style:s}=t,{state:i=nn,ref:r,props:l,stateAttributesMapping:u,enabled:d=!0}=e,h=d?Rq(o,i):void 0,p=d?Nq(s,i):void 0,g=d?Aq(i,u):nn,b=d&&l?Lq(l):void 0,w=d?pk(g,b)??{}:nn;return typeof document<"u"&&(d?Array.isArray(r)?w.ref=mq([w.ref,AO(n),...r]):w.ref=Ra(w.ref,AO(n),r):Ra(null,null)),d?(h!==void 0&&(w.className=cP(w.className,h)),p!==void 0&&(w.style=pk(w.style,p)),w):nn}function Lq(t){return Array.isArray(t)?Dq(t):dr(void 0,t)}const $q=Symbol.for("react.lazy");function Fq(t){if(t?.$$typeof!==$q)return t;const e=S.Children.toArray(t)[0];return S.isValidElement(e)?e:t}function Hq(t,e,n,o){if(e){if(typeof e=="function")return e(n,o);const s=dr(n,e.props);return s.ref=n.ref,S.cloneElement(e,s)}if(t&&typeof t=="string")return qq(t,n);throw new Error(gn(8))}function qq(t,e){return t==="button"?S.createElement("button",{type:"button",...e,key:e.key}):t==="img"?S.createElement("img",{alt:"",...e,key:e.key}):S.createElement(t,e)}const gS={...lq};let RO=0;function Uq(t,e="mui"){const[n,o]=S.useState(t),s=t||n;return S.useEffect(()=>{n==null&&(RO+=1,o(`${e}-${RO}`))},[n,e]),s}const NO=gS.useId;function Ul(t,e){if(NO!==void 0){const n=NO();return t??(e?`${e}-${n}`:n)}return Uq(t,e)}function ei(t){return Ul(t,"base-ui")}const R0=gS.useInsertionEffect,Vq=R0&&R0!==gS.useLayoutEffect?R0:t=>t();function De(t){const e=qn(Kq).current;return e.next=t,Vq(e.effect),e.trampoline}function Kq(){const t={next:void 0,callback:Wq,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function Wq(){}const dP=S.createContext(void 0);function yS(t=!1){const e=S.useContext(dP);if(e===void 0&&!t)throw new Error(gn(16));return e}function Yq(t){const{focusableWhenDisabled:e,disabled:n,composite:o=!1,tabIndex:s=0,isNativeButton:i}=t,r=o&&e!==!1,l=o&&e===!1;return{props:S.useMemo(()=>{const d={onKeyDown(h){n&&e&&h.key!=="Tab"&&h.preventDefault()}};return o||(d.tabIndex=s,!i&&n&&(d.tabIndex=e?s:-1)),(i&&(e||r)||!i&&n)&&(d["aria-disabled"]=n),i&&(!e||l)&&(d.disabled=n),d},[o,n,e,r,l,i,s])}}function Fa(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:o=0,native:s=!0,composite:i}=t,r=S.useRef(null),l=yS(!0),u=i??l!==void 0,{props:d}=Yq({focusableWhenDisabled:n,disabled:e,composite:u,tabIndex:o,isNativeButton:s}),h=S.useCallback(()=>{const b=r.current;N0(b)&&u&&e&&d.disabled===void 0&&b.disabled&&(b.disabled=!1)},[e,d.disabled,u]);Se(h,[h]);const p=S.useCallback((b={})=>{const{onClick:w,onMouseDown:k,onKeyUp:j,onKeyDown:C,onPointerDown:_,...T}=b;return dr({onClick(M){if(e){M.preventDefault();return}w?.(M)},onMouseDown(M){e||k?.(M)},onKeyDown(M){if(e||(Hg(M),C?.(M),M.baseUIHandlerPrevented))return;const O=M.target===M.currentTarget,N=M.currentTarget,D=N0(N),E=!s&&Gq(N),R=O&&(s?D:!E),B=M.key==="Enter",I=M.key===" ",P=N.getAttribute("role"),$=P?.startsWith("menuitem")||P==="option"||P==="gridcell";if(O&&u&&I){if(M.defaultPrevented&&$)return;M.preventDefault(),(!s||D)&&(M.preventBaseUIHandler(),Tf(N,M));return}if(!R||s||!I&&!B){O&&E&&I&&M.preventDefault();return}M.defaultPrevented||(M.preventDefault(),B&&(M.preventBaseUIHandler(),Tf(N,M)))},onKeyUp(M){if(!e){if(Hg(M),j?.(M),M.target===M.currentTarget&&s&&u&&N0(M.currentTarget)&&M.key===" "){M.preventDefault();return}M.baseUIHandlerPrevented||M.target===M.currentTarget&&!s&&!u&&!M.defaultPrevented&&M.key===" "&&(M.preventBaseUIHandler(),Tf(M.currentTarget,M))}},onPointerDown(M){if(e){M.preventDefault();return}_?.(M)}},s?{type:"button"}:{role:"button"},d,T)},[e,d,u,s]),g=De(b=>{r.current=b,h()});return{getButtonProps:p,buttonRef:g}}function N0(t){return Ft(t)&&t.tagName==="BUTTON"}function Gq(t){return Ft(t)&&t.tagName==="A"&&!!t.href}const Xq={invalid:void 0,name:void 0,validityData:{state:Cq,errors:[],error:"",value:"",initialValue:null},setValidityData:Rn,disabled:void 0,setTouched:Rn,setDirty:Rn,setFilled:Rn,setFocused:Rn,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:Eq,registerFieldControl:Rn,validation:{getValidationProps:(t,e=nn)=>e,inputRef:{current:null},registeredInputs:new Map,registerInput:Rn,getInputControl:()=>null,commit:async()=>{},change:Rn}},Jq=S.createContext(Xq);function fP(t=!0){const e=S.useContext(Jq);if(e.setValidityData===Rn&&!t)throw new Error(gn(28));return e}function Qq(t,e,n,o,s=!0,i){const{registerFieldControl:r}=fP(),l=qn(()=>Symbol());Se(()=>{const u=l.current;if(!s){r(u,void 0);return}r(u,{controlRef:t,getValue:o,id:e,name:i,value:n})},[t,s,o,e,i,r,l,n]),Se(()=>{const u=l.current;return()=>{r(u,void 0)}},[r,l])}const Zq=S.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Rn,validationMode:"onSubmit",submitCountRef:{current:0}});function e7(){return S.useContext(Zq)}const t7=S.createContext({controlId:void 0,registerControlId:Rn,resetControlId:Rn,labelId:void 0,setLabelId:Rn,messageIds:[],setMessageIds:Rn,getDescriptionProps:t=>t});function hP(){return S.useContext(t7)}function n7(t,e,n,o=!0,s){const[i,r]=S.useState(),l=ei(s?`${s}-label`:void 0),u=t??e??i;return Se(()=>{const d=t||e||!o?void 0:o7(n.current,l);i!==d&&r(d)}),u}function o7(t,e){const n=s7(t);if(n)return!n.id&&e&&(n.id=e),n.id||void 0}function s7(t){if(!t)return;const e=t.parentElement;if(e&&e.tagName==="LABEL")return e;const n=t.id;if(n){const s=t.nextElementSibling;if(s&&s.htmlFor===n)return s}const o=t.labels;return o&&o[0]}function i7(t={}){const{id:e,enabled:n=!0}=t,{controlId:o,registerControlId:s,resetControlId:i}=hP(),r=ei(),l=qn(()=>Symbol()),u=S.useRef(!1),d=S.useRef(!1),h=De(()=>{!u.current||s===Rn||(u.current=!1,s(l.current,void 0))});return Se(()=>{if(!n||s===Rn){h();return}let p;if(e!==void 0)d.current=!0,p=e;else if(d.current)p=r;else{i();return}if(p===void 0){h();return}u.current=!0,s(l.current,p)},[e,n,s,i,r,l,h]),Se(()=>h,[h]),(n?o:void 0)??e??r}const Lh="none",xr="trigger-press",pn="trigger-hover",iu="trigger-focus",bS="outside-press",pP="item-press",mP="close-press",Vl="focus-out",$h="escape-key",qg="list-navigation",r7="cancel-open",pf="sibling-open",a7="disabled",Wy="imperative-action";function ft(t,e,n,o){let s=!1,i=!1;const r=nn;return{reason:t,event:e??new Event("base-ui"),cancel(){s=!0},allowPropagation(){i=!0},get isCanceled(){return s},get isPropagationAllowed(){return i},trigger:n,...r}}function gP(t,e){const n=S.useRef(t),o=De(e);Se(()=>{n.current!==t&&o(n.current),n.current=t},[t,o])}var Os=eP();function Yy(t){S.useEffect(t,br)}const Rm=null;class l7{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let s=0;s<n.length;s+=1)n[s]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}}let Nm=new l7;class di{static create(){return new di}static request(e){return Nm.request(e)}static cancel(e){return Nm.cancel(e)}currentId=Rm;request(e){this.cancel(),this.currentId=Nm.request(()=>{this.currentId=Rm,e()})}cancel=()=>{this.currentId!==Rm&&(Nm.cancel(this.currentId),this.currentId=Rm)};disposeEffect=()=>this.cancel}function Wf(){const t=qn(di.create).current;return Yy(t.disposeEffect),t}function Yi(t){return t==null?t:"current"in t?t.current:t}const yP="data-starting-style",c7="data-ending-style";let Dm=null;function u7(t){if(!Dm){const e=[];Dm=e,queueMicrotask(()=>{Dm=null,Os.flushSync(()=>{for(const n of e)n()})})}Dm.push(t)}function Gy(t,e=!1,n=!1){const o=Wf();return De((s,i=null)=>{o.cancel();const r=Yi(t);if(r==null)return;const l=r,u=()=>{if(!n){Os.flushSync(s);return}u7(()=>{i?.aborted||s()})};if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function d(){Promise.all(l.getAnimations().map(h=>h.finished)).then(()=>{i?.aborted||u()},()=>{if(i?.aborted)return;if(l.getAnimations().some(p=>p.pending||p.playState!=="finished")){d();return}u()})}if(e){const h=yP;if(!l.hasAttribute(h)){o.request(d);return}const p=new MutationObserver(()=>{l.hasAttribute(h)||(p.disconnect(),d())});p.observe(l,{attributes:!0,attributeFilter:[h]}),i?.addEventListener("abort",()=>p.disconnect(),{once:!0});return}o.request(d)})}function Yu(t){const{enabled:e=!0,open:n,ref:o,batch:s=!1,onComplete:i}=t,r=De(i),l=Gy(o,n,s);S.useEffect(()=>{if(!e)return;const u=new AbortController;return l(r,u.signal),()=>{u.abort()}},[e,n,r,l])}function d7(t,e=!1,n=!1,o=!1){const[s,i]=S.useState(t&&e?"idle":void 0),[r,l]=S.useState(t&&!o);return t&&!r&&(l(!0),i("starting")),!t&&r&&s!=="ending"&&!n&&i("ending"),!t&&!r&&s==="ending"&&i(void 0),Se(()=>{if(!t&&r&&s!=="ending"&&n){const u=di.request(()=>{i("ending")});return()=>{di.cancel(u)}}},[t,r,s,n]),Se(()=>{if(!t||e)return;const u=di.request(()=>{i(void 0)});return()=>{di.cancel(u)}},[e,t]),Se(()=>{if(!t||!e)return;t&&r&&s!=="idle"&&i("starting");const u=di.request(()=>{i("idle")});return()=>{di.cancel(u)}},[e,t,r,s]),{mounted:r,setMounted:l,transitionStatus:s}}const f7={[yP]:""},h7={[c7]:""},wS={transitionStatus(t){return t==="starting"?f7:t==="ending"?h7:null}},bP=S.createContext(void 0);function xS(t){const e=S.useContext(bP);if(e===void 0&&!t)throw new Error(gn(33));return e}const wP=S.createContext(void 0);function Ha(t){const e=S.useContext(wP);if(e===void 0&&!t)throw new Error(gn(36));return e}const p7="data-open",m7="data-closed",g7="data-anchor-hidden",xP="data-popup-open",y7="data-pressed",b7={[xP]:""},w7={[xP]:"",[y7]:""},x7={[p7]:""},v7={[m7]:""},k7={[g7]:""},vS={open(t){return t?b7:null}},mk={open(t){return t?w7:null}},kS={open(t){return t?x7:v7},anchorHidden(t){return t?k7:null}},Xy={...kS,...wS},S7=S.createContext(void 0);function SS(t=!0){const e=S.useContext(S7);if(e===void 0&&!t)throw new Error(gn(25));return e}function j7(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:C7,platform:T7,maxTouchPoints:E7}=j7(),Jy=C7.toLowerCase(),Yf=T7.toLowerCase(),Qy=/^i(os$|p)/.test(Yf)||Yf==="macintel"&&E7>1,DO="android",gk=Yf===DO||Jy.includes(DO),jS=!Qy&&Yf.startsWith("mac");Yf.startsWith("win");const _7=jS||Qy,qa=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!qa&&Jy.includes("firefox");!qa&&Jy.includes("chrom");const vP=_7,CS=/jsdom|happydom/.test(Jy);function M7(t){const{closeOnClick:e,highlighted:n,id:o,nodeId:s,store:i,typingRef:r,itemRef:l,itemMetadata:u}=t,{events:d}=i.useState("floatingTreeRoot"),h=i.useState("open"),p=SS(!0),g=p!==void 0;return S.useMemo(()=>({id:o,role:"menuitem",tabIndex:h&&n?0:-1,onKeyDown(b){b.key===" "&&r?.current&&b.preventDefault()},onMouseMove(b){s&&d.emit("itemhover",{nodeId:s,target:b.currentTarget})},onClick(b){e&&d.emit("close",{domEvent:b,reason:pP})},onMouseUp(b){if(p){const w=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,g&&w&&Math.abs(b.clientX-w.x)<=1&&Math.abs(b.clientY-w.y)<=1||g&&!jS&&b.button===2)return}l.current&&i.context.allowMouseUpTriggerRef.current&&(!g||b.button===2)&&u.type==="regular-item"&&Tf(l.current,b,{detail:1})}}),[e,n,o,d,s,h,i,r,l,p,g,u])}const O7={type:"regular-item"};function kP(t){const{closeOnClick:e,disabled:n,highlighted:o,id:s,store:i,typingRef:r=i.context.typingRef,nativeButton:l,itemMetadata:u,nodeId:d}=t,h=S.useRef(null),{getButtonProps:p,buttonRef:g}=Fa({disabled:n,focusableWhenDisabled:!0,native:l,composite:!0}),b=M7({closeOnClick:e,highlighted:o,id:s,nodeId:d,store:i,typingRef:r,itemRef:h,itemMetadata:u}),w=S.useCallback(j=>dr(b,{onMouseEnter(){u.type==="submenu-trigger"&&u.setActive()}},j,p),[b,p,u]),k=Ra(h,g);return S.useMemo(()=>({getItemProps:w,itemRef:k}),[w,k])}const SP=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function A7(){return S.useContext(SP)}function TS(t={}){const{guess:e,label:n,metadata:o,textRef:s,index:i}=t,{register:r,unregister:l,subscribeMapChange:u,nextIndexRef:d}=A7(),h=S.useRef(-1),[p,g]=S.useState(i==null&&e?()=>{if(h.current===-1){const j=d.current;d.current+=1,h.current=j}return h.current}:-1),b=i??p,w=S.useRef(null),k=S.useCallback(j=>{const C=w.current;C&&l(C),w.current=j,j&&r(j,{metadata:o??null,index:i??null,label:n,textRef:s})},[i,r,l,o,n,s]);return Se(()=>{if(i==null)return u(j=>{const C=w.current?j.get(w.current)?.index:null;C!=null&&g(C)})},[i,u]),{ref:k,index:b}}const R7=S.forwardRef(function(e,n){const{render:o,className:s,id:i,label:r,nativeButton:l=!1,disabled:u=!1,closeOnClick:d=!0,style:h,...p}=e,g=TS({guess:!0,label:r}),b=xS(!0),w=ei(i),{store:k}=Ha(),j=k.useState("disabled"),C=u||j,_=k.useState("isActive",g.index),T=k.useState("itemProps"),{getItemProps:M,itemRef:O}=kP({closeOnClick:d,disabled:C,highlighted:_,id:w,store:k,nativeButton:l,nodeId:b?.context.nodeId,itemMetadata:O7});return Ht("div",e,{state:{disabled:C,highlighted:_},props:[T,p,M],ref:[O,n,g.ref]})}),Jd=0;class Lo{static create(){return new Lo}currentId=Jd;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Jd,n()},e)}isStarted(){return this.currentId!==Jd}clear=()=>{this.currentId!==Jd&&(clearTimeout(this.currentId),this.currentId=Jd)};disposeEffect=()=>this.clear}function co(){const t=qn(Lo.create).current;return Yy(t.disposeEffect),t}function ci(t){t.preventDefault(),t.stopPropagation()}function N7(t){return"nativeEvent"in t}function ES(t){return t.pointerType===""&&t.isTrusted?!0:gk&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function _S(t){return CS?!1:!gk&&t.width===0&&t.height===0||gk&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function Sa(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function D7(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}function Nn(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Ie(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&ku(n)){let o=e;for(;o;){if(t===o)return!0;o=o.parentNode||o.host}}return!1}function ln(t){return"composedPath"in t?t.composedPath()[0]??t.target:t.target}const yk="data-base-ui-focusable",jP="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Zy="ArrowLeft",eb="ArrowRight",CP="ArrowUp",MS="ArrowDown",bk="data-trigger-disabled";function Ug(t,e){if(!vt(t))return!1;const n=t;if(e.hasElement(n))return!n.hasAttribute(bk);for(const[,o]of e.entries())if(Ie(o,n))return!o.hasAttribute(bk);return!1}function D0(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function P7(t){return t.matches("html,body")}function tb(t){return Ft(t)&&t.matches(jP)}function B7(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${jP}`)!=null}function wk(t){return t?t.getAttribute("role")==="combobox"&&tb(t):!1}function Vg(t){if(!t||CS)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function xk(t){return t?t.hasAttribute(yk)?t:t.querySelector(`[${yk}]`)||t:null}function z7(t,e){return e!=null&&!Sa(e)?0:typeof t=="function"?t():t}function Kl(t,e,n){const o=z7(t,n);return typeof o=="number"?o:o?.[e]}function PO(t){return typeof t=="function"?t():t}function TP(t,e){return e||t==="click"||t==="mousedown"}function I7(t){return t?.includes("mouse")&&t!=="mousedown"}const EP=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Lo,currentIdRef:{current:null},currentContextRef:{current:null}});function L7(t,e){t.current=e.current}function $7(t){const{children:e,delay:n,timeoutMs:o=0}=t,s=S.useRef(n),i=S.useRef(n),r=S.useRef(null),l=S.useRef(null),u=co();return Se(()=>{if(i.current=n,!r.current){s.current=n;return}s.current={open:Kl(s.current,"open"),close:Kl(n,"close")}},[n,r,s,i]),y.jsx(EP.Provider,{value:S.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:i,currentIdRef:r,timeoutMs:o,currentContextRef:l,timeout:u}),[o,u]),children:e})}function F7(t,e={open:!1}){const{open:n}=e,o="rootStore"in t?t.rootStore:t,s=o.useState("floatingId"),i=S.useContext(EP),{currentIdRef:r,delayRef:l,timeoutMs:u,initialDelayRef:d,currentContextRef:h,hasProvider:p,timeout:g}=i,[b,w]=S.useState(!1),k=S.useRef(n);return Se(()=>{k.current=n},[n]),Se(()=>{function j(){h.current?.setIsInstantPhase(!1),r.current=null,h.current=null,l.current=d.current,g.clear()}if(r.current&&!n&&r.current===s){if(w(!1),u){const C=s;return g.start(u,()=>{o.select("open")||r.current&&r.current!==C||j()}),()=>{(k.current||r.current!==C)&&g.clear()}}j()}},[n,s,r,l,u,d,h,g,o]),Se(()=>{if(!n)return;const j=h.current,C=r.current;g.clear(),h.current={onOpenChange:o.setOpen,setIsInstantPhase:w},r.current=s,l.current={open:0,close:Kl(d.current,"close")},C!==null&&C!==s?(w(!0),j?.setIsInstantPhase(!0),j?.onOpenChange(!1,ft(Lh))):(w(!1),j?.setIsInstantPhase(!1))},[n,s,o,r,l,d,h,g]),Se(()=>()=>{if(r.current===s){if(h.current=null,!k.current)return;r.current=null,L7(l,d),g.clear()}},[h,r,l,s,d,g]),S.useMemo(()=>({activeIdRef:r,hasProvider:p,delayRef:l,isInstantPhase:b}),[r,p,l,b])}function st(t,e,n,o){return t.addEventListener(e,n,o),()=>{t.removeEventListener(e,n,o)}}function Ys(...t){return()=>{for(let e=0;e<t.length;e+=1){const n=t[e];n&&n()}}}function Mn(t){const e=qn(H7,t).current;return e.next=t,Se(e.effect),e}function H7(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}const vr=S.forwardRef(function(e,n){const[o,s]=S.useState();Se(()=>{vP&&qa&&s("button")},[]);const i={tabIndex:0,role:o};return y.jsx("span",{...e,ref:n,style:cS,"aria-hidden":o?void 0:!0,...i,"data-base-ui-focus-guard":""})}),Su=Math.min,fr=Math.max,Kg=Math.round,Pm=Math.floor,hr=t=>({x:t,y:t}),q7={left:"right",right:"left",bottom:"top",top:"bottom"};function _P(t,e,n){return fr(t,Su(e,n))}function Na(t,e){return typeof t=="function"?t(e):t}function _s(t){return t.split("-")[0]}function kr(t){return t.split("-")[1]}function OS(t){return t==="x"?"y":"x"}function AS(t){return t==="y"?"height":"width"}function Es(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function RS(t){return OS(Es(t))}function U7(t,e,n){n===void 0&&(n=!1);const o=kr(t),s=RS(t),i=AS(s);let r=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(r=Wg(r)),[r,Wg(r)]}function V7(t){const e=Wg(t);return[vk(t),e,vk(e)]}function vk(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const BO=["left","right"],zO=["right","left"],K7=["top","bottom"],W7=["bottom","top"];function Y7(t,e,n){switch(t){case"top":case"bottom":return n?e?zO:BO:e?BO:zO;case"left":case"right":return e?K7:W7;default:return[]}}function G7(t,e,n,o){const s=kr(t);let i=Y7(_s(t),n==="start",o);return s&&(i=i.map(r=>r+"-"+s),e&&(i=i.concat(i.map(vk)))),i}function Wg(t){const e=_s(t);return q7[e]+t.slice(e.length)}function X7(t){var e,n,o,s;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(o=t.bottom)!=null?o:0,left:(s=t.left)!=null?s:0}}function MP(t){return typeof t!="number"?X7(t):{top:t,right:t,bottom:t,left:t}}function Yg(t){const{x:e,y:n,width:o,height:s}=t;return{width:o,height:s,top:n,left:e,right:e+o,bottom:n+s,x:e,y:n}}function Ef(t,e){return e<0||e>=t.length}function bg(t,e){return ir(t.current,{disabledIndices:e})}function kk(t,e){return ir(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function ir(t,{startingIndex:e=-1,decrement:n=!1,disabledIndices:o,amount:s=1}={}){let i=e;do i+=n?-s:s;while(i>=0&&i<=t.length-1&&ru(t,i,o));return i}function ru(t,e,n){if(typeof n=="function"?n(e):n?.includes(e)??!1)return!0;const s=t[e];return s?!nb(s)||s.matches(":disabled")?!0:!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!1}function J7(t){return t.visibility==="hidden"||t.visibility==="collapse"}function nb(t,e=t?is(t):null){return!t||!t.isConnected||!e||J7(e)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():e.display!=="none"&&e.display!=="contents"}const Q7='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Z7(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const n=t.getRootNode();return ku(n)?n.host:null}function Sk(t){for(const e of Array.from(t.children))if(oo(e)==="summary")return e;return null}function eU(t,e){const n=Sk(e);return!!n&&(t===n||Ie(n,t))}function OP(t){const e=t?oo(t):"";return t!=null&&t.matches(Q7)&&(e!=="summary"||t.parentElement!=null&&oo(t.parentElement)==="details"&&Sk(t.parentElement)===t)&&(e!=="details"||Sk(t)==null)&&(e!=="input"||t.type!=="hidden")}function AP(t){if(!OP(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=Z7(e)){const n=e!==t,o=oo(e)==="slot";if(e.hasAttribute("inert")||n&&oo(e)==="details"&&!e.open&&!eU(t,e)||e.hasAttribute("hidden")||!o&&!tU(e,n))return!1}return!0}function tU(t,e){const n=is(t);return e?n.display!=="none":nb(t,n)}function RP(t){const e=t.tabIndex;if(e<0){const n=oo(t);if(n==="details"||n==="audio"||n==="video"||Ft(t)&&t.isContentEditable)return 0}return e}function P0(t){if(oo(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function nU(t,e){const n=P0(t);if(!n)return!0;const o=e.find(s=>{const i=P0(s);return i?.name===n.name&&i.form===n.form&&i.checked});return o?o===n:e.find(s=>{const i=P0(s);return i?.name===n.name&&i.form===n.form})===n}function NP(t){if(Ft(t)&&oo(t)==="slot"){const e=t.assignedElements({flatten:!0});if(e.length>0)return e}return Ft(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function DP(t,e){NP(t).forEach(n=>{OP(n)&&e.push(n),DP(n,e)})}function PP(t,e,n){NP(t).forEach(o=>{Ft(o)&&o.matches(e)&&n.push(o),PP(o,e,n)})}function NS(t){return AP(t)&&RP(t)>=0}function BP(t){const e=[];return DP(t,e),e.filter(AP)}function Fh(t){const e=BP(t);return e.filter(n=>RP(n)>=0&&nU(n,e))}function zP(t,e){const n=Fh(t),o=n.length;if(o===0)return;const s=Nn(yt(t)),i=n.indexOf(s),r=i===-1?e===1?0:o-1:i+e;return n[r]}function DS(t){return zP(yt(t).body,1)||t}function IP(t){return zP(yt(t).body,-1)||t}function LP(t,e){if(!t)return null;const n=Fh(yt(t).body),o=n.length;if(o===0)return null;const s=n.indexOf(t);if(s===-1)return null;const i=(s+e+o)%o;return n[i]}function oU(t){return LP(t,1)}function sU(t){return LP(t,-1)}function au(t,e){const n=e||t.currentTarget,o=t.relatedTarget;return!o||!Ie(n,o)}function iU(t){Fh(t).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function IO(t){const e=[];PP(t,"[data-tabindex]",e),e.forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function Da(t,e,n=!0){return t.filter(s=>s.parentId===e).flatMap(s=>[...!n||s.context?.open?[s]:[],...Da(t,s.id,n)])}function LO(t,e){let n=[],o=t.find(s=>s.id===e)?.parentId;for(;o;){const s=t.find(i=>i.id===o);o=s?.parentId,s&&(n=n.concat(s))}return n}function Gf(t){return`data-base-ui-${t}`}let Bm=0;function wg(t,e={}){const{preventScroll:n=!1,sync:o=!1,shouldFocus:s}=e;cancelAnimationFrame(Bm);function i(){s&&!s()||t?.focus({preventScroll:n})}if(o)return i(),Rn;const r=requestAnimationFrame(i);return Bm=r,()=>{Bm===r&&(cancelAnimationFrame(r),Bm=0)}}const B0={inert:new WeakMap,"aria-hidden":new WeakMap},$O="data-base-ui-inert",jk={inert:new WeakSet,"aria-hidden":new WeakSet};let Qd=new WeakMap,z0=0;function rU(t){return jk[t]}function $P(t){return t?ku(t)?t.host:$P(t.parentNode):null}const FO=(t,e)=>e.map(n=>{if(t.contains(n))return n;const o=$P(n);return t.contains(o)?o:null}).filter(n=>n!=null),HO=t=>{const e=new Set;return t.forEach(n=>{let o=n;for(;o&&!e.has(o);)e.add(o),o=o.parentNode}),e},qO=(t,e,n)=>{const o=[],s=i=>{!i||n.has(i)||Array.from(i.children).forEach(r=>{oo(r)!=="script"&&(e.has(r)?s(r):o.push(r))})};return s(t),o};function aU(t,e,n,o,{mark:s=!0}){let i=null;o?i="inert":n&&(i="aria-hidden");let r=null,l=null;const u=FO(e,t),d=s?qO(e,HO(u),new Set(u)):[],h=[],p=[];if(i){const g=B0[i],b=rU(i);l=b,r=g;const w=FO(e,Array.from(e.querySelectorAll("[aria-live]"))),k=u.concat(w);qO(e,HO(k),new Set(k)).forEach(C=>{const _=C.getAttribute(i),T=_!==null&&_!=="false",M=(g.get(C)||0)+1;g.set(C,M),h.push(C),M===1&&T&&b.add(C),T||C.setAttribute(i,i==="inert"?"":"true")})}return s&&d.forEach(g=>{const b=(Qd.get(g)||0)+1;Qd.set(g,b),p.push(g),b===1&&g.setAttribute($O,"")}),z0+=1,()=>{r&&h.forEach(g=>{const w=(r.get(g)||0)-1;r.set(g,w),w||(!l?.has(g)&&i&&g.removeAttribute(i),l?.delete(g))}),s&&p.forEach(g=>{const b=(Qd.get(g)||0)-1;Qd.set(g,b),b||g.removeAttribute($O)}),z0-=1,z0||(B0.inert=new WeakMap,B0["aria-hidden"]=new WeakMap,jk.inert=new WeakSet,jk["aria-hidden"]=new WeakSet,Qd=new WeakMap)}}function UO(t,e={}){const{ariaHidden:n=!1,inert:o=!1,mark:s=!0}=e,i=yt(t[0]).body;return aU(t,i,n,o,{mark:s})}const lU=500,FP=500,cU={style:{transition:"none"}},HP="data-base-ui-click-trigger",uU="data-base-ui-swipe-ignore",dU="data-swipe-ignore",fU=`[${uU}]`,hU=`[${dU}]`,pU={fallbackAxisSide:"none"},PS={fallbackAxisSide:"end"},mU={clipPath:"inset(50%)",position:"fixed",top:0,left:0},qP=S.createContext(null),UP=()=>S.useContext(qP),gU=Gf("portal");function VP(t={}){const{ref:e,container:n,componentProps:o=nn,elementProps:s}=t,i=Ul(),l=UP()?.portalNode,[u,d]=S.useState(null),[h,p]=S.useState(null),g=De(j=>{j!==null&&p(j)}),b=S.useRef(null);Se(()=>{if(n===null){b.current&&(b.current=null,p(null),d(null));return}const j=(n&&(uS(n)?n:n.current))??l??document.body;if(j==null){b.current&&(b.current=null,p(null),d(null));return}b.current!==j&&(b.current=j,p(null),d(j))},[n,l]);const w=Ht("div",o,{ref:[e,g],props:[{id:i,[gU]:""},s]}),k=u&&w?Os.createPortal(w,u):null;return{node:h,nodeId:S.isValidElement(w)?w.props.id:void 0,subtree:k}}const BS=S.forwardRef(function(e,n){const{render:o,className:s,style:i,children:r,container:l,portalOwnerRole:u,...d}=e,{node:h,nodeId:p,subtree:g}=VP({container:l,ref:n,componentProps:e,elementProps:d}),b=S.useRef(null),w=S.useRef(null),k=S.useRef(null),j=S.useRef(null),[C,_]=S.useState(null),T=S.useRef(!1),M=C?.modal,O=C?.open,N=!!C&&!C.modal&&C.open&&!!h;S.useEffect(()=>{if(!h||M)return;function E(R){h&&R.relatedTarget&&au(R)&&(R.type==="focusin"?T.current&&(IO(h),T.current=!1):(iU(h),T.current=!0))}return Ys(st(h,"focusin",E,!0),st(h,"focusout",E,!0))},[h,M]),Se(()=>{!h||O!==!0||!T.current||(IO(h),T.current=!1)},[O,h]);const D=S.useMemo(()=>({beforeOutsideRef:b,afterOutsideRef:w,beforeInsideRef:k,afterInsideRef:j,portalNode:h,setFocusManagerState:_}),[h]);return y.jsxs(S.Fragment,{children:[g,y.jsxs(qP.Provider,{value:D,children:[N&&h&&y.jsx(vr,{"data-type":"outside",ref:b,onFocus:E=>{if(au(E,h))k.current?.focus();else{const R=C?C.domReference:null;IP(R)?.focus()}}}),N&&h&&y.jsx("span",{role:u,"aria-owns":p,style:mU}),h&&Os.createPortal(r,h),N&&h&&y.jsx(vr,{"data-type":"outside",ref:w,onFocus:E=>{if(au(E,h))j.current?.focus();else{const R=C?C.domReference:null;DS(R)?.focus(),C?.closeOnFocusOut&&C?.onOpenChange(!1,ft(Vl,E.nativeEvent))}}})]})]})});function KP(){const t=new Map;return{emit(e,n){t.get(e)?.forEach(o=>o(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){t.get(e)?.delete(n)}}}class zS{nodesRef={current:[]};events=KP();addNode(e){this.nodesRef.current.push(e)}removeNode(e){const n=this.nodesRef.current.findIndex(o=>o===e);n!==-1&&this.nodesRef.current.splice(n,1)}}const WP=S.createContext(null),YP=S.createContext(null),Zl=()=>S.useContext(WP)?.id||null,Ua=t=>{const e=S.useContext(YP);return t??e};function IS(t){const e=Ul(),n=Ua(t),o=Zl();return Se(()=>{if(!e)return;const s={id:e,parentId:o};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,e,o]),e}function GP(t){const{children:e,id:n}=t,o=Zl();return y.jsx(WP.Provider,{value:S.useMemo(()=>({id:n,parentId:o}),[n,o]),children:e})}function XP(t){const{children:e,externalTree:n}=t,o=qn(()=>n??new zS).current;return y.jsx(YP.Provider,{value:o,children:e})}function yU(t,e){const n=on(ln(t));return t instanceof n.KeyboardEvent?"keyboard":t instanceof n.FocusEvent?e||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof n.MouseEvent?e||(t.detail===0?"keyboard":"mouse"):""}const VO=20;let ma=[];function LS(){ma=ma.filter(t=>t.deref()?.isConnected)}function KO(t){LS(),t&&oo(t)!=="body"&&(ma.push(new WeakRef(t)),ma.length>VO&&(ma=ma.slice(-VO)))}function WO(){return LS(),ma[ma.length-1]?.deref()}function bU(t){return t?NS(t)?t:Fh(t)[0]||t:null}function YO(t){if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!t.getAttribute("role")?.includes("dialog"))return;const n=BP(t).filter(s=>{const i=s.getAttribute("data-tabindex")||"";return NS(s)||s.hasAttribute("data-tabindex")&&!i.startsWith("-")}),o=t.getAttribute("tabindex");n.length===0?o!=="0"&&(t.setAttribute("tabindex","0"),t.setAttribute("data-tabindex","0")):(o!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function $S(t){const{context:e,children:n,disabled:o=!1,initialFocus:s=!0,returnFocus:i=!0,restoreFocus:r=!1,modal:l=!0,closeOnFocusOut:u=!0,openInteractionType:d="",nextFocusableElement:h,previousFocusableElement:p,beforeContentFocusGuardRef:g,externalTree:b,getInsideElements:w}=t,k="rootStore"in e?e.rootStore:e,j=k.useState("open"),C=k.useState("domReferenceElement"),_=k.useState("floatingElement"),{events:T,dataRef:M}=k.context,O=De(()=>M.current.floatingContext?.nodeId),N=s===!1,D=wk(C)&&N,E=Mn(s),R=Mn(i),B=Mn(d),I=Mn(j),P=Ua(b),$=UP(),W=S.useRef(!1),K=S.useRef(!1),F=S.useRef(!1),q=S.useRef(null),H=S.useRef(""),Y=S.useRef(""),ne=S.useRef(null),z=S.useRef(null),U=Ra(ne,g,$?.beforeInsideRef),J=Ra(z,$?.afterInsideRef),X=co(),oe=co(),ie=Wf(),be=$!=null,ce=xk(_),ye=De((Me=ce)=>Me?Fh(Me):[]),Ce=De(()=>w?.().filter(Me=>Me!=null)??[]);S.useEffect(()=>{if(o||!l)return;function Me(Oe){Oe.key==="Tab"&&Ie(ce,Nn(yt(ce)))&&ye().length===0&&!D&&ci(Oe)}const je=yt(ce);return st(je,"keydown",Me)},[o,ce,l,D,ye]),S.useEffect(()=>{if(o||!j)return;const Me=yt(ce);function je(){F.current=!1}function Oe(nt){const Ee=ln(nt),Je=Ce(),_e=Ie(_,Ee)||Ie(C,Ee)||Ie($?.portalNode,Ee)||Je.some(Ae=>Ae===Ee||Ie(Ae,Ee));F.current=!_e,Y.current=nt.pointerType||"keyboard",Ee?.closest(`[${HP}]`)&&(K.current=!0,oe.start(0,()=>{K.current=!1}))}function Fe(){Y.current="keyboard"}return Ys(st(Me,"pointerdown",Oe,!0),st(Me,"pointerup",je,!0),st(Me,"pointercancel",je,!0),st(Me,"keydown",Fe,!0),je)},[o,_,C,ce,j,$,oe,Ce]),S.useEffect(()=>{if(o||!u)return;const Me=yt(ce);function je(){K.current=!0,oe.start(0,()=>{K.current=!1})}function Oe(Je){const _e=ln(Je);NS(_e)&&(q.current=_e)}function Fe(Je){const _e=Je.relatedTarget,Ae=Je.currentTarget,Pe=ln(Je);l&&_e==null&&Pe!=null&&Ie(_,Pe)&&KO(Pe),queueMicrotask(()=>{const bt=O(),Be=k.context.triggerElements,fe=Ce(),xe=_e?.hasAttribute(Gf("focus-guard"))&&[ne.current,z.current,$?.beforeInsideRef.current,$?.afterInsideRef.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,Yi(p),Yi(h)].includes(_e),pe=!(Ie(C,_e)||Ie(_,_e)||Ie(_e,_)||Ie($?.portalNode,_e)||fe.some(re=>re===_e||Ie(re,_e))||Be.hasMatchingElement(re=>Ie(re,_e))||xe||P&&(Da(P.nodesRef.current,bt).find(re=>Ie(re.context?.elements.floating,_e)||Ie(re.context?.elements.domReference,_e))||LO(P.nodesRef.current,bt).find(re=>[re.context?.elements.floating,xk(re.context?.elements.floating)].includes(_e)||re.context?.elements.domReference===_e)));if(Ae===C&&ce&&YO(ce),r&&Ae!==C&&!nb(Pe)&&Nn(Me)===Me.body){if(Ft(ce)&&(ce.focus(),r==="popup")){ie.request(()=>{ce.focus()});return}const re=ye(),ve=q.current,Ze=(ve&&re.includes(ve)?ve:null)||re[re.length-1]||ce;Ft(Ze)&&Ze.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}(D||!l)&&_e&&pe&&!K.current&&(D||_e!==WO())&&(W.current=!0,k.setOpen(!1,ft(Vl,Je)))})}function nt(){F.current||(M.current.insideReactTree=!0,X.start(0,()=>{M.current.insideReactTree=!1}))}const Ee=Ft(C)?C:null;if(!(!_&&!Ee))return Ys(Ee&&st(Ee,"focusout",Fe),Ee&&st(Ee,"pointerdown",je),_&&st(_,"focusin",Oe),_&&st(_,"focusout",Fe),_&&$&&st(_,"focusout",nt,!0))},[o,C,_,ce,l,P,$,k,u,r,ye,D,O,M,X,oe,ie,h,p,Ce]),S.useEffect(()=>{if(o||!_||!j)return;const Me=Array.from($?.portalNode?.querySelectorAll(`[${Gf("portal")}]`)||[]),Oe=(P?LO(P.nodesRef.current,O()):[]).find(Ae=>wk(Ae.context?.elements.domReference||null))?.context?.elements.domReference,nt=[...[_,...Me,ne.current,z.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,...Ce()],Oe,Yi(p),Yi(h),D?C:null].filter(Ae=>Ae!=null),Ee=UO(nt,{ariaHidden:l||D,mark:!1}),Je=[_,...Me].filter(Ae=>Ae!=null),_e=UO(Je);return()=>{_e(),Ee()}},[j,o,C,_,l,$,D,P,O,h,p,Ce]),Se(()=>{if(!j||o||!Ft(ce))return;H.current="",Y.current="";const Me=yt(ce),je=Nn(Me);queueMicrotask(()=>{const Oe=E.current,Fe=typeof Oe=="function"?Oe(B.current||""):Oe;if(Fe===void 0||Fe===!1||Ie(ce,je))return;let Ee=null;const Je=()=>(Ee==null&&(Ee=ye(ce)),Ee[0]||ce);let _e;Fe===!0||Fe===null?_e=Je():_e=Yi(Fe),_e=_e||Je();const Ae=Ie(ce,Nn(Me));wg(_e,{preventScroll:_e===ce,shouldFocus(){if(!I.current)return!1;if(Ae)return!0;const Pe=Nn(Me);return!(Pe!==_e&&Ie(ce,Pe))}})})},[o,j,ce,ye,E,B,I]),Se(()=>{if(o||!ce)return;const Me=yt(ce),je=Nn(Me),Oe=B.current==null;KO(je);function Fe(Ee){if(Ee.open||(H.current=yU(Ee.nativeEvent,Y.current)),Ee.reason===pn&&Ee.nativeEvent.type==="mouseleave"&&(W.current=!0),Ee.reason===bS)if(Ee.nested)W.current=!1;else if(ES(Ee.nativeEvent)||_S(Ee.nativeEvent))W.current=!1;else{let Je=!1;yt(ce).createElement("div").focus({get preventScroll(){return Je=!0,!1}}),Je?W.current=!1:W.current=!0}}T.on("openchange",Fe);function nt(Ee){const Je=R.current;let _e=typeof Je=="function"?Je(Ee):Je;if(_e===void 0||_e===!1)return null;_e===null&&(_e=!0);const Ae=C?.isConnected?C:null,Pe=je?.isConnected&&oo(je)!=="body"?je:null;let bt=Oe?Pe||Ae:Ae||Pe;return bt||(bt=WO()||null),typeof _e=="boolean"?bt:Yi(_e)||bt||null}return()=>{T.off("openchange",Fe);const Ee=Nn(Me),Je=Ce(),_e=Ie(_,Ee)||Je.some(Be=>Be===Ee||Ie(Be,Ee))||P&&Da(P.nodesRef.current,O(),!1).some(Be=>Ie(Be.context?.elements.floating,Ee)),Ae=R.current,Pe=H.current,bt=nt(Pe);queueMicrotask(()=>{const Be=bU(bt),fe=typeof Ae!="boolean";if(Ae&&!W.current&&Ft(Be)&&(!(!fe&&Be!==Ee&&Ee!==Me.body)||_e)){const xe={preventScroll:!0};Pe==="keyboard"&&(xe.focusVisible=!0),Be.focus(xe)}W.current=!1})}},[o,_,ce,R,B,T,P,C,O,Ce]),Se(()=>{if(!qa||j||!_)return;const Me=Nn(yt(_));!Ft(Me)||!tb(Me)||Ie(_,Me)&&Me.blur()},[j,_]),Se(()=>{if(!(o||!$))return $.setFocusManagerState({modal:l,closeOnFocusOut:u,open:j,onOpenChange:k.setOpen,domReference:C}),()=>{$.setFocusManagerState(null)}},[o,$,l,j,k,u,C]),Se(()=>{if(!(o||!ce))return YO(ce),()=>{queueMicrotask(LS)}},[o,ce]);const Ve=!o&&(l?!D:!0)&&(be||l);return y.jsxs(S.Fragment,{children:[Ve&&y.jsx(vr,{"data-type":"inside",ref:U,onFocus:Me=>{if(l){const je=ye();wg(je[je.length-1])}else $?.portalNode&&(W.current=!1,au(Me,$.portalNode)?DS(C)?.focus():Yi(p??$.beforeOutsideRef)?.focus())}}),n,Ve&&y.jsx(vr,{"data-type":"inside",ref:J,onFocus:Me=>{l?wg(ye()[0]):$?.portalNode&&(u&&(W.current=!0),au(Me,$.portalNode)?IP(C)?.focus():Yi(h??$.afterOutsideRef)?.focus())}})]})}function FS(t,e={}){const{enabled:n=!0,event:o="click",toggle:s=!0,ignoreMouse:i=!1,stickIfOpen:r=!0,touchOpenDelay:l=0,reason:u=xr}=e,d="rootStore"in t?t.rootStore:t,h=d.context.dataRef,p=S.useRef(void 0),g=Wf(),b=co(),w=S.useMemo(()=>{function k(C,_,T,M){const O=ft(u,_,T);C&&M==="touch"&&l>0?b.start(l,()=>{d.setOpen(!0,O)}):d.setOpen(C,O)}function j(C,_,T){const M=h.current.openEvent,O=d.select("domReferenceElement")!==_;return C&&O||!C||!s?!0:M&&r?!T(M.type):!1}return{onPointerDown(C){p.current=Sa(C.pointerType,!0)&&_S(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const _=p.current,T=C.nativeEvent,M=d.select("open");if(C.button!==0||o==="click"||Sa(_,!0)&&i)return;const O=j(M,C.currentTarget,E=>E==="click"||E==="mousedown"),N=ln(T);if(tb(N)){k(O,T,N,_);return}const D=C.currentTarget;g.request(()=>{k(O,T,D,_)})},onClick(C){if(o==="mousedown-only")return;const _=p.current;if(o==="mousedown"&&_){p.current=void 0;return}if(Sa(_,!0)&&i)return;const T=d.select("open"),M=j(T,C.currentTarget,O=>O==="click"||O==="mousedown"||O==="keydown"||O==="keyup");k(M,C.nativeEvent,C.currentTarget,_)},onKeyDown(){p.current=void 0}}},[h,o,i,u,d,r,s,g,b,l]);return S.useMemo(()=>n?{reference:w}:nn,[n,w])}function wU(t,e){let n=null,o=null,s=!1;return{contextElement:t||void 0,getBoundingClientRect(){const i=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},r=e.axis==="x"||e.axis==="both",l=e.axis==="y"||e.axis==="both",u=["mouseenter","mousemove"].includes(e.dataRef.current.openEvent?.type||"")&&e.pointerType!=="touch";let d=i.width,h=i.height,p=i.x,g=i.y;return n==null&&e.x&&r&&(n=i.x-e.x),o==null&&e.y&&l&&(o=i.y-e.y),p-=n||0,g-=o||0,d=0,h=0,!s||u?(d=e.axis==="y"?i.width:0,h=e.axis==="x"?i.height:0,p=r&&e.x!=null?e.x:p,g=l&&e.y!=null?e.y:g):s&&!u&&(h=e.axis==="x"?i.height:h,d=e.axis==="y"?i.width:d),s=!0,{width:d,height:h,x:p,y:g,top:g,right:p+d,bottom:g+h,left:p}}}}function GO(t){return t!=null&&t.clientX!=null}function xU(t,e={}){const{enabled:n=!0,axis:o="both"}=e,s="rootStore"in t?t.rootStore:t,i=s.useState("open"),r=s.useState("floatingElement"),l=s.useState("domReferenceElement"),u=s.context.dataRef,d=S.useRef(!1),h=S.useRef(null),[p,g]=S.useState(),[b,w]=S.useState([]),k=De(M=>{s.set("positionReference",M)}),j=De((M,O,N)=>{d.current||u.current.openEvent&&!GO(u.current.openEvent)||s.set("positionReference",wU(N??l,{x:M,y:O,axis:o,dataRef:u,pointerType:p}))}),C=De(M=>{i?h.current||(j(M.clientX,M.clientY,M.currentTarget),w([])):j(M.clientX,M.clientY,M.currentTarget)}),_=Sa(p)?r:i;S.useEffect(()=>{if(!n){k(l);return}if(!_)return;function M(){h.current?.(),h.current=null}const O=on(r);function N(D){const E=ln(D);Ie(r,E)?M():j(D.clientX,D.clientY)}return!u.current.openEvent||GO(u.current.openEvent)?h.current=st(O,"mousemove",N):k(l),M},[_,n,r,u,l,s,j,k,b]),S.useEffect(()=>()=>{s.set("positionReference",null)},[s]),S.useEffect(()=>{n&&!r&&(d.current=!1)},[n,r]),S.useEffect(()=>{!n&&i&&(d.current=!0)},[n,i]);const T=S.useMemo(()=>{function M(O){g(O.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:C,onMouseEnter:C}},[C]);return S.useMemo(()=>n?{reference:T,trigger:T}:{},[n,T])}function vU(){return!1}function kU(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function ob(t,e={}){const{enabled:n=!0,escapeKey:o=!0,outsidePress:s=!0,outsidePressEvent:i="sloppy",referencePress:r=vU,bubbles:l,externalTree:u}=e,d="rootStore"in t?t.rootStore:t,h=d.useState("open"),p=d.useState("floatingElement"),{dataRef:g,events:b}=d.context,w=Ua(u),k=De(typeof s=="function"?s:()=>!1),j=typeof s=="function"?k:s,C=j!==!1,_=De(()=>i),{escapeKey:T,outsidePress:M}=kU(l),O=S.useRef(!1),N=S.useRef(!1),D=S.useRef(!1),E=S.useRef(!1),R=S.useRef(!1),B=S.useRef(""),I=S.useRef(null),P=co(),$=co(),W=De(()=>{$.clear(),g.current.insideReactTree=!1}),K=De(X=>{const oe=g.current.floatingContext?.nodeId;return(w?Da(w.nodesRef.current,oe):[]).some(be=>be.context?.open&&!be.context.dataRef.current[X])}),F=De(X=>D0(X,d.select("floatingElement"))||D0(X,d.select("domReferenceElement"))),q=De(X=>{r()&&d.setOpen(!1,ft(xr,X.nativeEvent))}),H=De(X=>{if(!h||!n||!o||X.key!=="Escape"||R.current||!T&&K("__escapeKeyBubbles"))return;const oe=N7(X)?X.nativeEvent:X,ie=ft($h,oe);d.setOpen(!1,ie),ie.isCanceled||X.preventDefault(),!T&&!ie.isPropagationAllowed&&X.stopPropagation()}),Y=De(()=>{g.current.insideReactTree=!0,$.start(0,W)}),ne=De(X=>{if(!h||!n||X.button!==0)return;const oe=ln(X.nativeEvent);Ie(d.select("floatingElement"),oe)&&(O.current||(O.current=!0,N.current=!1))}),z=De(X=>{!h||!n||(X.defaultPrevented||X.nativeEvent.defaultPrevented)&&O.current&&(N.current=!0)});S.useEffect(()=>{function X(oe){oe.open||(E.current=!1)}return b.on("openchange",X),()=>{b.off("openchange",X)}},[b]),S.useEffect(()=>{if(!h||!n)return h||(E.current=!1),W;g.current.__escapeKeyBubbles=T,g.current.__outsidePressBubbles=M;const X=new Lo,oe=new Lo,ie=yt(p);function be(){X.clear(),R.current=!0}function ce(){X.start(qa?5:0,()=>{R.current=!1})}function ye(){D.current=!0,oe.start(0,()=>{D.current=!1})}function Ce(){O.current=!1,N.current=!1}function Ve(){const pe=B.current,re=pe==="pen"||!pe?"mouse":pe,ve=_(),Ze=typeof ve=="function"?ve():ve;return typeof Ze=="string"?Ze:Ze[re]}function Me(pe){const re=Ve();return re==="intentional"&&pe.type!=="click"||re==="sloppy"&&pe.type==="click"}function je(pe){const re=g.current.floatingContext?.nodeId,ve=w&&Da(w.nodesRef.current,re).some(Ze=>D0(pe,Ze.context?.elements.floating));return F(pe)||ve}function Oe(pe){if(Me(pe)){pe.type!=="click"&&!F(pe)&&(oe.clear(),D.current=!1),W();return}if(g.current.insideReactTree){W();return}const re=ln(pe),ve=`[${Gf("inert")}]`,Ze=vt(re)?re.getRootNode():null,Ln=Array.from((ku(Ze)?Ze:yt(d.select("floatingElement"))).querySelectorAll(ve)),So=d.context.triggerElements;if(re&&(So.hasElement(re)||So.hasMatchingElement(Te=>Ie(Te,re))))return;let dn=vt(re)?re:null;for(;dn&&!ur(dn);){const Te=wr(dn);if(ur(Te)||!vt(Te))break;dn=Te}if(!(Ln.length&&vt(re)&&!P7(re)&&!Ie(re,d.select("floatingElement"))&&Ln.every(Te=>!Ie(dn,Te)))){if(Ft(re)&&!("touches"in pe)){const Te=ur(re),rt=is(re),_t=/auto|scroll/,Jt=Te||_t.test(rt.overflowX),ls=Te||_t.test(rt.overflowY),Bs=Jt&&re.clientWidth>0&&re.scrollWidth>re.clientWidth,cs=ls&&re.clientHeight>0&&re.scrollHeight>re.clientHeight,vn=rt.direction==="rtl",zs=cs&&(vn?pe.offsetX<=re.offsetWidth-re.clientWidth:pe.offsetX>re.clientWidth),dt=Bs&&pe.offsetY>re.clientHeight;if(zs||dt)return}if(!je(pe)){if(Ve()==="intentional"){if(pe.detail!==0&&!ES(pe)&&!E.current)return;if(D.current){oe.clear(),D.current=!1;return}}typeof j=="function"&&!j(pe)||K("__outsidePressBubbles")||(d.setOpen(!1,ft(bS,pe)),W())}}}function Fe(pe){Ve()!=="sloppy"||pe.pointerType==="touch"||!d.select("open")||!n||F(pe)||Oe(pe)}function nt(pe){if(Ve()!=="sloppy"||!d.select("open")||!n||F(pe))return;const re=pe.touches[0];re&&(I.current={startTime:Date.now(),startX:re.clientX,startY:re.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function Ee(pe,re){const ve=ln(pe);if(!ve)return;const Ze=st(ve,pe.type,()=>{re(pe),Ze()})}function Je(pe){B.current="touch",Ee(pe,nt)}function _e(pe){P.clear(),pe.type==="pointerdown"&&(pe.button===0&&(E.current=!0),B.current=pe.pointerType),!(pe.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)&&Ee(pe,re=>{re.type==="pointerdown"?Fe(re):Oe(re)})}function Ae(pe){if(pe.type==="pointercancel"&&(E.current=!1),!O.current)return;const re=N.current;if(Ce(),Ve()==="intentional"){if(pe.type==="pointercancel"){re&&ye();return}if(!je(pe)){if(re){ye();return}typeof j=="function"&&!j(pe)||(oe.clear(),D.current=!0,W())}}}function Pe(pe){if(Ve()!=="sloppy"||!I.current||F(pe))return;const re=pe.touches[0];if(!re)return;const ve=Math.abs(re.clientX-I.current.startX),Ze=Math.abs(re.clientY-I.current.startY),Ln=Math.sqrt(ve*ve+Ze*Ze);Ln>5&&(I.current.dismissOnTouchEnd=!0),Ln>10&&(Oe(pe),P.clear(),I.current=null)}function bt(pe){Ee(pe,Pe)}function Be(pe){Ve()!=="sloppy"||!I.current||F(pe)||(I.current.dismissOnTouchEnd&&Oe(pe),P.clear(),I.current=null)}function fe(pe){Ee(pe,Be)}const xe=Ys(o&&Ys(st(ie,"keydown",H),st(ie,"compositionstart",be),st(ie,"compositionend",ce)),C&&Ys(st(ie,"click",_e,!0),st(ie,"pointerdown",_e,!0),st(ie,"pointerup",Ae,!0),st(ie,"pointercancel",Ae,!0),st(ie,"mousedown",_e,!0),st(ie,"mouseup",Ae,!0),st(ie,"touchstart",Je,{capture:!0,passive:!0}),st(ie,"touchmove",bt,{capture:!0,passive:!0}),st(ie,"touchend",fe,{capture:!0,passive:!0})));return()=>{xe(),X.clear(),oe.clear(),Ce(),D.current=!1,W()}},[g,p,o,C,j,h,n,T,M,H,W,_,K,F,w,d,P]);const U=S.useMemo(()=>({onKeyDown:H,onPointerDown:q,onClick:q}),[H,q]),J=S.useMemo(()=>({onKeyDown:H,onPointerDown:z,onMouseDown:z,onClickCapture:Y,onMouseDownCapture(X){Y(),ne(X)},onPointerDownCapture(X){Y(),ne(X)},onMouseUpCapture:Y,onTouchEndCapture:Y,onTouchMoveCapture:Y}),[H,Y,ne,z]);return S.useMemo(()=>n?{reference:U,floating:J,trigger:U}:{},[n,U,J])}function XO(t,e,n){let{reference:o,floating:s}=t;const i=Es(e),r=RS(e),l=AS(r),u=_s(e),d=i==="y",h=o.x+o.width/2-s.width/2,p=o.y+o.height/2-s.height/2,g=o[l]/2-s[l]/2;let b;switch(u){case"top":b={x:h,y:o.y-s.height};break;case"bottom":b={x:h,y:o.y+o.height};break;case"right":b={x:o.x+o.width,y:p};break;case"left":b={x:o.x-s.width,y:p};break;default:b={x:o.x,y:o.y}}const w=kr(e);return w&&(b[r]+=g*(w==="end"?1:-1)*(n&&d?-1:1)),b}async function SU(t,e){var n;e===void 0&&(e={});const{x:o,y:s,platform:i,rects:r,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:g=!1,padding:b=0}=Na(e,t),w=MP(b),j=l[g?p==="floating"?"reference":"floating":p],C=Yg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(j)))==null||n?j:j.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:u})),_=p==="floating"?{x:o,y:s,width:r.floating.width,height:r.floating.height}:r.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),M=await(i.isElement==null?void 0:i.isElement(T))&&await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1},O=Yg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:T,strategy:u}):_);return{top:(C.top-O.top+w.top)/M.y,bottom:(O.bottom-C.bottom+w.bottom)/M.y,left:(C.left-O.left+w.left)/M.x,right:(O.right-C.right+w.right)/M.x}}const jU=50,CU=async(t,e,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:i=[],platform:r}=n,l=r.detectOverflow?r:{...r,detectOverflow:SU},u=await(r.isRTL==null?void 0:r.isRTL(e));let d=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:p}=XO(d,o,u),g=o,b=0;const w={};for(let k=0;k<i.length;k++){const j=i[k];if(!j)continue;const{name:C,fn:_}=j,{x:T,y:M,data:O,reset:N}=await _({x:h,y:p,initialPlacement:o,placement:g,strategy:s,middlewareData:w,rects:d,platform:l,elements:{reference:t,floating:e}});h=T??h,p=M??p,w[C]={...w[C],...O},N&&b<jU&&(b++,typeof N=="object"&&(N.placement&&(g=N.placement),N.rects&&(d=N.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:s}):N.rects),{x:h,y:p}=XO(d,g,u)),k=-1)}return{x:h,y:p,placement:g,strategy:s,middlewareData:w}},TU=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:s,middlewareData:i,rects:r,initialPlacement:l,platform:u,elements:d}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:k=!0,...j}=Na(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const C=_s(s),_=Es(l),T=_s(l)===l,M=await(u.isRTL==null?void 0:u.isRTL(d.floating)),O=g||(T||!k?[Wg(l)]:V7(l)),N=w!=="none";!g&&N&&O.push(...G7(l,k,w,M));const D=[l,...O],E=await u.detectOverflow(e,j),R=[];let B=((o=i.flip)==null?void 0:o.overflows)||[];if(h&&R.push(E[C]),p){const W=U7(s,r,M);R.push(E[W[0]],E[W[1]])}if(B=[...B,{placement:s,overflows:R}],!R.every(W=>W<=0)){var I,P;const W=(((I=i.flip)==null?void 0:I.index)||0)+1,K=D[W];if(K&&(!(p==="alignment"?_!==Es(K):!1)||B.every(H=>Es(H.placement)===_?H.overflows[0]>0:!0)))return{data:{index:W,overflows:B},reset:{placement:K}};let F=(P=B.filter(q=>q.overflows[0]<=0).sort((q,H)=>q.overflows[1]-H.overflows[1])[0])==null?void 0:P.placement;if(!F)switch(b){case"bestFit":{var $;const q=($=B.filter(H=>{if(N){const Y=Es(H.placement);return Y===_||Y==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Y=>Y>0).reduce((Y,ne)=>Y+ne,0)]).sort((H,Y)=>H[1]-Y[1])[0])==null?void 0:$[0];q&&(F=q);break}case"initialPlacement":F=l;break}if(s!==F)return{reset:{placement:F}}}return{}}}},JP=new Set(["left","top"]);async function EU(t,e){const{placement:n,platform:o,elements:s}=t,i=await(o.isRTL==null?void 0:o.isRTL(s.floating)),r=_s(n),l=kr(n),u=Es(n)==="y",d=JP.has(r)?-1:1,h=i&&u?-1:1,p=Na(e,t);let{mainAxis:g,crossAxis:b,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof w=="number"&&(b=l==="end"?w*-1:w),u?{x:b*h,y:g*d}:{x:g*d,y:b*h}}const _U=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:s,y:i,placement:r,middlewareData:l}=e,u=await EU(e,t);return r===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:r}}}}},MU=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:s,platform:i}=e,{mainAxis:r=!0,crossAxis:l=!1,limiter:u={fn:_=>{let{x:T,y:M}=_;return{x:T,y:M}}},...d}=Na(t,e),h={x:n,y:o},p=await i.detectOverflow(e,d),g=Es(s),b=OS(g);let w=h[b],k=h[g];const j=(_,T)=>_P(T+p[_==="y"?"top":"left"],T,T-p[_==="y"?"bottom":"right"]);r&&(w=j(b,w)),l&&(k=j(g,k));const C=u.fn({...e,[b]:w,[g]:k});return{...C,data:{x:C.x-n,y:C.y-o,enabled:{[b]:r,[g]:l}}}}}},OU=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,o;const{x:s,y:i,placement:r,rects:l,middlewareData:u}=e,{offset:d=0,mainAxis:h=!0,crossAxis:p=!0}=Na(t,e),g={x:s,y:i},b=Es(r),w=OS(b);let k=g[w],j=g[b];const C=Na(d,e),_=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(n=C.mainAxis)!=null?n:0,crossAxis:(o=C.crossAxis)!=null?o:0};if(h){const O=w==="y"?"height":"width",N=l.reference[w]-l.floating[O]+_.mainAxis,D=l.reference[w]+l.reference[O]-_.mainAxis;k<N?k=N:k>D&&(k=D)}if(p){var T,M;const O=w==="y"?"width":"height",N=JP.has(_s(r)),D=l.reference[b]-l.floating[O]+(N&&((T=u.offset)==null?void 0:T[b])||0)+(N?0:_.crossAxis),E=l.reference[b]+l.reference[O]+(N?0:((M=u.offset)==null?void 0:M[b])||0)-(N?_.crossAxis:0);j<D?j=D:j>E&&(j=E)}return{[w]:k,[b]:j}}}},AU=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:s,elements:i}=e,{apply:r=()=>{},...l}=Na(t,e),u=await s.detectOverflow(e,l),d=_s(n),h=kr(n),p=Es(n)==="y",{width:g,height:b}=o.floating;let w,k;d==="top"||d==="bottom"?(w=d,k=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(k=d,w=h==="end"?"top":"bottom");const j=b-u.top-u.bottom,C=g-u.left-u.right,_=Su(b-u[w],j),T=Su(g-u[k],C),M=e.middlewareData.shift,O=!M;let N=_,D=T;M!=null&&M.enabled.x&&(D=C),M!=null&&M.enabled.y&&(N=j),O&&!h&&(p?D=g-2*fr(u.left,u.right):N=b-2*fr(u.top,u.bottom)),await r({...e,availableWidth:D,availableHeight:N});const E=await s.getDimensions(i.floating);return g!==E.width||b!==E.height?{reset:{rects:!0}}:{}}}};function QP(t){const e=is(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const s=Ft(t),i=s?t.offsetWidth:n,r=s?t.offsetHeight:o,l=Kg(n)!==i||Kg(o)!==r;return l&&(n=i,o=r),{width:n,height:o,$:l}}function HS(t){return vt(t)?t:t.contextElement}function lu(t){const e=HS(t);if(!Ft(e))return hr(1);const n=e.getBoundingClientRect(),{width:o,height:s,$:i}=QP(e);let r=(i?Kg(n.width):n.width)/o,l=(i?Kg(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const RU=hr(0);function ZP(t){const e=on(t);return!fS()||!e.visualViewport?RU:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function NU(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===on(t)}function Wl(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=HS(t);let r=hr(1);e&&(o?vt(o)&&(r=lu(o)):r=lu(t));const l=NU(i,n,o)?ZP(i):hr(0);let u=(s.left+l.x)/r.x,d=(s.top+l.y)/r.y,h=s.width/r.x,p=s.height/r.y;if(i&&o){const g=on(i),b=vt(o)?on(o):o;let w=g,k=hk(w);for(;k&&b!==w;){const j=lu(k),C=k.getBoundingClientRect(),_=is(k),T=C.left+(k.clientLeft+parseFloat(_.paddingLeft))*j.x,M=C.top+(k.clientTop+parseFloat(_.paddingTop))*j.y;u*=j.x,d*=j.y,h*=j.x,p*=j.y,u+=T,d+=M,w=on(k),k=hk(w)}}return Yg({width:h,height:p,x:u,y:d})}function sb(t,e){const n=Ky(t).scrollLeft;return e?e.left+n:Wl(Er(t)).left+n}function eB(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-sb(t,n),s=n.top+e.scrollTop;return{x:o,y:s}}function DU(t){let{elements:e,rect:n,offsetParent:o,strategy:s}=t;const i=s==="fixed",r=Er(o),l=e?Vy(e.floating):!1;if(o===r||l&&i)return n;let u={scrollLeft:0,scrollTop:0},d=hr(1);const h=hr(0),p=Ft(o);if((p||!i)&&((oo(o)!=="body"||Ih(r))&&(u=Ky(o)),p)){const b=Wl(o);d=lu(o),h.x=b.x+o.clientLeft,h.y=b.y+o.clientTop}const g=r&&!p&&!i?eB(r,u):hr(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-u.scrollTop*d.y+h.y+g.y}}function PU(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function BU(t){const e=Ky(t),n=t.ownerDocument.body,o=fr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=fr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+sb(t);const r=-e.scrollTop;return is(n).direction==="rtl"&&(i+=fr(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:r}}const zU=25;function IU(t,e,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",s=on(t),i=Er(t),r=s.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,h=0;if(r){const g=!fS()||e==="fixed";o?g||(d=-r.offsetLeft,h=-r.offsetTop):(l=r.width,u=r.height,g&&(d=r.offsetLeft,h=r.offsetTop))}if(sb(i)<=0){const g=i.ownerDocument,b=g.body,w=getComputedStyle(b),k=g.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,j=Math.abs(i.clientWidth-b.clientWidth-k),C=getComputedStyle(i).scrollbarGutter==="stable both-edges"?j/2:j;C<=zU&&(l-=C)}return{width:l,height:u,x:d,y:h}}function LU(t,e){const n=Wl(t,!0,e==="fixed"),o=n.top+t.clientTop,s=n.left+t.clientLeft,i=lu(t),r=t.clientWidth*i.x,l=t.clientHeight*i.y,u=s*i.x,d=o*i.y;return{width:r,height:l,x:u,y:d}}function JO(t,e,n){let o;if(e==="viewport"||e==="layoutViewport")o=IU(t,n,e);else if(e==="document")o=BU(Er(t));else if(vt(e))o=LU(e,n);else{const s=ZP(t);o={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Yg(o)}function $U(t,e){const n=e.get(t);if(n)return n;let o=Kf(t,[],!1).filter(l=>vt(l)&&oo(l)!=="body"),s=null;const i=is(t).position==="fixed";let r=i?wr(t):t;for(;vt(r)&&!ur(r);){const l=is(r),u=dS(r),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?o=o.filter(p=>p!==r):s=l,r=wr(r)}return e.set(t,o),o}function FU(t){let{element:e,boundary:n,rootBoundary:o,strategy:s}=t;const r=[...n==="clippingAncestors"?Vy(e)?[]:$U(e,this._c):[].concat(n),o],l=JO(e,r[0],s);let u=l.top,d=l.right,h=l.bottom,p=l.left;for(let g=1;g<r.length;g++){const b=JO(e,r[g],s);u=fr(b.top,u),d=Su(b.right,d),h=Su(b.bottom,h),p=fr(b.left,p)}return{width:d-p,height:h-u,x:p,y:u}}function HU(t){const{width:e,height:n}=QP(t);return{width:e,height:n}}function qU(t,e,n){const o=Ft(e),s=Er(e),i=n==="fixed",r=Wl(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const u=hr(0);if((o||!i)&&((oo(e)!=="body"||Ih(s))&&(l=Ky(e)),o)){const g=Wl(e,!0,i,e);u.x=g.x+e.clientLeft,u.y=g.y+e.clientTop}!o&&s&&(u.x=sb(s));const d=s&&!o&&!i?eB(s,l):hr(0),h=r.left+l.scrollLeft-u.x-d.x,p=r.top+l.scrollTop-u.y-d.y;return{x:h,y:p,width:r.width,height:r.height}}function I0(t){return is(t).position==="static"}function QO(t,e){if(!Ft(t)||is(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Er(t)===n&&(n=n.ownerDocument.body),n}function tB(t,e){const n=on(t);if(Vy(t))return n;if(!Ft(t)){let s=wr(t);for(;s&&!ur(s);){if(vt(s)&&!I0(s))return s;s=wr(s)}return n}let o=QO(t,e);for(;o&&wq(o)&&I0(o);)o=QO(o,e);return o&&ur(o)&&I0(o)&&!dS(o)?n:o||kq(t)||n}const UU=async function(t){const e=this.getOffsetParent||tB,n=this.getDimensions,o=await n(t.floating);return{reference:qU(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function VU(t){return is(t).direction==="rtl"}const KU={convertOffsetParentRelativeRectToViewportRelativeRect:DU,getDocumentElement:Er,getClippingRect:FU,getOffsetParent:tB,getElementRects:UU,getClientRects:PU,getDimensions:HU,getScale:lu,isElement:vt,isRTL:VU};function nB(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function WU(t,e,n){let o=null,s;const i=Er(t);function r(){var h;clearTimeout(s),(h=o)==null||h.disconnect(),o=null}function l(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),r();const g=t.getBoundingClientRect(),{left:b,top:w,width:k,height:j}=g;if(h||e(),!k||!j)return;const C=Pm(w),_=Pm(i.clientWidth-(b+k)),T=Pm(i.clientHeight-(w+j)),M=Pm(b),N={rootMargin:-C+"px "+-_+"px "+-T+"px "+-M+"px",threshold:fr(0,Su(1,p))||1};let D=!0;function E(R){const B=R[0].intersectionRatio;if(!nB(g,t.getBoundingClientRect()))return l();if(B!==p){if(!D)return l();B?l(!1,B):s=setTimeout(()=>{l(!1,1e-7)},1e3)}D=!1}try{o=new IntersectionObserver(E,{...N,root:i.ownerDocument})}catch{o=new IntersectionObserver(E,N)}o.observe(t)}const u=on(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),r()}}function ZO(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,d=HS(t),h=s||i?[...d?Kf(d):[],...e?Kf(e):[]]:[];h.forEach(C=>{s&&C.addEventListener("scroll",n),i&&C.addEventListener("resize",n)});const p=d&&l?WU(d,n,i):null;let g=-1,b=null;r&&(b=new ResizeObserver(C=>{let[_]=C;_&&_.target===d&&b&&e&&(b.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(e)})),n()}),d&&!u&&b.observe(d),e&&b.observe(e));let w,k=u?Wl(t):null;u&&j();function j(){const C=Wl(t);k&&!nB(k,C)&&n(),k=C,w=requestAnimationFrame(j)}return n(),()=>{var C;h.forEach(_=>{s&&_.removeEventListener("scroll",n),i&&_.removeEventListener("resize",n)}),p?.(),(C=b)==null||C.disconnect(),b=null,u&&cancelAnimationFrame(w)}}const YU=_U,GU=MU,XU=TU,JU=AU,QU=OU,ZU=(t,e,n)=>{const o=new Map,s=n??{},i={...KU,...s.platform,_c:o};return CU(t,e,{...s,platform:i})};var e9=typeof document<"u",t9=function(){},xg=e9?S.useLayoutEffect:t9;function Gg(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!Gg(t[o],e[o]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,s[o]))return!1;for(o=n;o--!==0;){const i=s[o];if(!(i==="_owner"&&t.$$typeof)&&!Gg(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function oB(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function eA(t,e){const n=oB(t);return Math.round(e*n)/n}function L0(t){const e=S.useRef(t);return xg(()=>{e.current=t}),e}function n9(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:s,elements:{reference:i,floating:r}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[h,p]=S.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,b]=S.useState(o);Gg(g,o)||b(o);const[w,k]=S.useState(null),[j,C]=S.useState(null),_=S.useCallback(H=>{H!==N.current&&(N.current=H,k(H))},[]),T=S.useCallback(H=>{H!==D.current&&(D.current=H,C(H))},[]),M=i||w,O=r||j,N=S.useRef(null),D=S.useRef(null),E=S.useRef(h),R=u!=null,B=L0(u),I=L0(s),P=L0(d),$=S.useCallback(()=>{if(!N.current||!D.current)return;const H={placement:e,strategy:n,middleware:g};I.current&&(H.platform=I.current),ZU(N.current,D.current,H).then(Y=>{const ne={...Y,isPositioned:P.current!==!1};W.current&&!Gg(E.current,ne)&&(E.current=ne,Os.flushSync(()=>{p(ne)}))})},[g,e,n,I,P]);xg(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(H=>({...H,isPositioned:!1})))},[d]);const W=S.useRef(!1);xg(()=>(W.current=!0,()=>{W.current=!1}),[]),xg(()=>{if(M&&(N.current=M),O&&(D.current=O),M&&O){if(B.current)return B.current(M,O,$);$()}},[M,O,$,B,R]);const K=S.useMemo(()=>({reference:N,floating:D,setReference:_,setFloating:T}),[_,T]),F=S.useMemo(()=>({reference:M,floating:O}),[M,O]),q=S.useMemo(()=>{const H={position:n,left:0,top:0};if(!F.floating)return H;const Y=eA(F.floating,h.x),ne=eA(F.floating,h.y);return l?{...H,transform:"translate("+Y+"px, "+ne+"px)",...oB(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:ne}},[n,l,F.floating,h.x,h.y]);return S.useMemo(()=>({...h,update:$,refs:K,elements:F,floatingStyles:q}),[h,$,K,F,q])}const o9=(t,e)=>{const n=YU(t);return{name:n.name,fn:n.fn,options:[t,e]}},s9=(t,e)=>{const n=GU(t);return{name:n.name,fn:n.fn,options:[t,e]}},i9=(t,e)=>({fn:QU(t).fn,options:[t,e]}),r9=(t,e)=>{const n=XU(t);return{name:n.name,fn:n.fn,options:[t,e]}},a9=(t,e)=>{const n=JU(t);return{name:n.name,fn:n.fn,options:[t,e]}};var $0={exports:{}},F0={};var tA;function l9(){if(tA)return F0;tA=1;var t=zh();function e(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:e,o=t.useState,s=t.useEffect,i=t.useLayoutEffect,r=t.useDebugValue;function l(p,g){var b=g(),w=o({inst:{value:b,getSnapshot:g}}),k=w[0].inst,j=w[1];return i(function(){k.value=b,k.getSnapshot=g,u(k)&&j({inst:k})},[p,b,g]),s(function(){return u(k)&&j({inst:k}),p(function(){u(k)&&j({inst:k})})},[p]),r(b),b}function u(p){var g=p.getSnapshot;p=p.value;try{var b=g();return!n(p,b)}catch{return!0}}function d(p,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return F0.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,F0}var nA;function sB(){return nA||(nA=1,$0.exports=l9()),$0.exports}var qS=sB(),H0={exports:{}},q0={};var oA;function c9(){if(oA)return q0;oA=1;var t=zh(),e=sB();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var o=typeof Object.is=="function"?Object.is:n,s=e.useSyncExternalStore,i=t.useRef,r=t.useEffect,l=t.useMemo,u=t.useDebugValue;return q0.useSyncExternalStoreWithSelector=function(d,h,p,g,b){var w=i(null);if(w.current===null){var k={hasValue:!1,value:null};w.current=k}else k=w.current;w=l(function(){function C(N){if(!_){if(_=!0,T=N,N=g(N),b!==void 0&&k.hasValue){var D=k.value;if(b(D,N))return M=D}return M=N}if(D=M,o(T,N))return D;var E=g(N);return b!==void 0&&b(D,E)?(T=N,D):(T=N,M=E)}var _=!1,T,M,O=p===void 0?null:p;return[function(){return C(h())},O===null?void 0:function(){return C(O())}]},[h,p,g,b]);var j=s(d,w[0],w[1]);return r(function(){k.hasValue=!0,k.value=j},[j]),u(j),j},q0}var sA;function u9(){return sA||(sA=1,H0.exports=c9()),H0.exports}var d9=u9();const Ck=[];let Tk;function f9(){return Tk}function h9(t){Ck.push(t)}function Hh(t){const e=(n,o)=>{const s=qn(p9).current;let i;try{Tk=s;for(const r of Ck)r.before(s);i=t(n,o);for(const r of Ck)r.after(s);s.didInitialize=!0}finally{Tk=void 0}return i};return e.displayName=t.displayName||t.name,e}function US(t){return S.forwardRef(Hh(t))}function p9(){return{didInitialize:!1}}const m9=hS(19),g9=m9?b9:w9;function iB(t,e,n,o,s){return g9(t,e,n,o,s)}function y9(t,e,n,o,s){const i=S.useCallback(()=>e(t.getSnapshot(),n,o,s),[t,e,n,o,s]);return qS.useSyncExternalStore(t.subscribe,i,i)}h9({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let e=!1;for(let n=0;n<t.syncHooks.length;n+=1){const o=t.syncHooks[n],s=o.selector(o.store.state,o.a1,o.a2,o.a3);Object.is(o.value,s)||(e=!0,o.value=s)}return e&&(t.syncTick+=1),t.syncTick})},after(t){t.syncHooks.length>0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=e=>{const n=new Set;for(const s of t.syncHooks)n.add(s.store);const o=[];for(const s of n)o.push(s.subscribe(e));return()=>{for(const s of o)s()}}),qS.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function b9(t,e,n,o,s){const i=f9();if(!i)return y9(t,e,n,o,s);const r=i.syncIndex;i.syncIndex+=1;let l;return i.didInitialize?(l=i.syncHooks[r],(l.store!==t||l.selector!==e||!Object.is(l.a1,n)||!Object.is(l.a2,o)||!Object.is(l.a3,s))&&(l.store!==t&&(i.didChangeStore=!0),l.store=t,l.selector=e,l.a1=n,l.a2=o,l.a3=s,l.value=e(t.getSnapshot(),n,o,s))):(l={store:t,selector:e,a1:n,a2:o,a3:s,value:e(t.getSnapshot(),n,o,s)},i.syncHooks.push(l)),l.value}function w9(t,e,n,o,s){return d9.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,i=>e(i,n,o,s))}class x9{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){this.setState({...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||this.setState({...this.state,[e]:n})}notifyAll(){const e={...this.state};this.setState(e)}use(e,n,o,s){return iB(this,e,n,o,s)}}class Gu extends x9{constructor(e,n={},o){super(e),this.context=n,this.selectors=o}useSyncedValue(e,n){S.useDebugValue(e);const o=this;Se(()=>{o.state[e]!==n&&o.set(e,n)},[o,e,n])}useSyncedValueWithCleanup(e,n){const o=this;Se(()=>(o.state[e]!==n&&o.set(e,n),()=>{o.set(e,void 0)}),[o,e,n])}useSyncedValues(e){const n=this,o=Object.values(e);Se(()=>{n.update(e)},[n,...o])}useControlledProp(e,n){S.useDebugValue(e);const o=this,s=n!==void 0;Se(()=>{s&&!Object.is(o.state[e],n)&&o.setState({...o.state,[e]:n})},[o,e,n,s])}select(e,n,o,s){const i=this.selectors[e];return i(this.state,n,o,s)}useState(e,n,o,s){return S.useDebugValue(e),iB(this,this.selectors[e],n,o,s)}useContextCallback(e,n){S.useDebugValue(e);const o=De(n??Rn);this.context[e]=o}useStateSetter(e){const n=S.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(e,o)}),n.current}observe(e,n){let o;typeof e=="function"?o=e:o=this.selectors[e];let s=o(this.state);return n(s,s,this),this.subscribe(i=>{const r=o(i);if(!Object.is(s,r)){const l=s;s=r,n(r,l,this)}})}}const v9={open:t=>t.open,transitionStatus:t=>t.transitionStatus,domReferenceElement:t=>t.domReferenceElement,referenceElement:t=>t.positionReference??t.referenceElement,floatingElement:t=>t.floatingElement,floatingId:t=>t.floatingId};class rB extends Gu{constructor(e){const{syncOnly:n,nested:o,onOpenChange:s,triggerElements:i,...r}=e;super({...r,positionReference:r.referenceElement,domReferenceElement:r.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:KP(),nested:o,triggerElements:i},v9),this.syncOnly=n}syncOpenEvent=(e,n)=>{(!e||!this.state.open||n!=null&&D7(n))&&(this.context.dataRef.current.openEvent=e?n:void 0)};dispatchOpenChange=(e,n)=>{this.syncOpenEvent(e,n.event);const o={open:e,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",o)};setOpen=(e,n)=>{if(this.syncOnly){this.context.onOpenChange?.(e,n);return}this.dispatchOpenChange(e,n),this.context.onOpenChange?.(e,n)}}function aB(t){const{popupStore:e,treatPopupAsFloatingElement:n=!1,floatingRootContext:o,floatingId:s,nested:i,onOpenChange:r}=t,l=e.useState("open"),u=e.useState("activeTriggerElement"),d=e.useState(n?"popupElement":"positionerElement"),h=e.context.triggerElements,p=r,g=S.useRef(null);o===void 0&&g.current===null&&(g.current=new rB({open:l,transitionStatus:void 0,referenceElement:u,floatingElement:d,triggerElements:h,onOpenChange:p,floatingId:s,syncOnly:!0,nested:i}));const b=o??g.current;return e.useSyncedValue("floatingId",s),Se(()=>{const w={open:l,floatingId:s,referenceElement:u,floatingElement:d};vt(u)&&(w.domReferenceElement=u),b.state.positionReference===b.state.referenceElement&&(w.positionReference=u),b.update(w)},[l,s,u,d,b]),b.context.onOpenChange=p,b.context.nested=i,b}const ib={tabIndex:-1,[yk]:""};function lB(t){return e=>e==="touch"?t.current:!0}function VS(t,e=!1){const n=Ul(),o=Zl()!=null,s=qn(()=>t(n,o)).current;return aB({popupStore:s,treatPopupAsFloatingElement:e,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:o,onOpenChange:s.setOpen}),s}function rb({handle:t,store:e}){return Se(()=>t.attachStore(e),[t,e]),null}function iA(t){const e=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==e&&t.set("triggerCount",e)}function cB(t,e){const n=S.useRef(null);return De(o=>{const s=n.current;if(s!==null){if(s.element===o&&s.store===e&&s.id===t)return;n.current=null;const i=s.store;i.context.triggerElements.getById(s.id)===s.element&&(i.context.triggerElements.delete(s.id),iA(i))}o!==null&&t!==void 0&&(n.current={store:e,id:t,element:o},e.context.triggerElements.add(t,o),iA(e))})}function ab(t,e,n,o=!1){let s=t.preventUnmountingOnClose;e?s=!1:o&&(s=!0);const i=n?.id??null;let r=t.activeTriggerId,l=t.activeTriggerElement;return(i||e)&&(r=i,l=n??null),{open:e,preventUnmountingOnClose:s,activeTriggerId:r,activeTriggerElement:l}}function KS(t){let e=!1;return t.preventUnmountOnClose=()=>{e=!0},()=>e}function k9(t,e,n,o={}){const s=n.reason,i=s===pn,r=e&&s===iu,l=!e&&(s===xr||s===$h),u=KS(n);if(t.context.onOpenChange?.(e,n),n.isCanceled)return;o.onBeforeDispatch?.(),t.state.floatingRootContext.dispatchOpenChange(e,n);const d=()=>{const h=ab(t.state,e,n.trigger,u()),p={...o.extraState,...h};r?p.instantType="focus":l?p.instantType="dismiss":i&&(p.instantType=void 0),t.update(p)};i?Os.flushSync(d):d()}function WS(t,e,n,o){const s=n.useState("isMountedByTrigger",t),i=cB(t,n),r=De(u=>{const d=n.select("open"),h=n.select("activeTriggerId");if(h===t){const p={activeTriggerElement:u,...d?o:null};n.update(p);return}if(h==null&&d){const p={activeTriggerId:t??null,activeTriggerElement:u,...o};n.update(p)}}),l=De(u=>{i(u),u&&r(u)});return Se(()=>(l(e.current),()=>l(null)),[l,e,n,t]),Se(()=>{if(s){const u={activeTriggerElement:e.current,...o};n.update(u)}},[s,n,e,...Object.values(o)]),{registerTrigger:l,isMountedByThisTrigger:s}}function lb(t,e={}){const{closeOnActiveTriggerUnmount:n=!1}=e,o=S.useRef(null),s=t.useState("open"),i=t.useState("triggerCount"),r=t.useState("activeTriggerId"),l=t.useState("activeTriggerElement");Se(()=>{if(!s){o.current=null,t.state.triggerCount!==0&&t.set("triggerCount",0);return}const u=t.context.triggerElements.size,d={};t.state.triggerCount!==u&&(d.triggerCount=u);const h=t.select("activeTriggerId");let p=null;if(h){const g=t.context.triggerElements.getById(h);if(g)o.current=h,g!==t.state.activeTriggerElement&&(d.activeTriggerElement=g);else{for(const[b,w]of t.context.triggerElements.entries())if(w===t.state.activeTriggerElement){d.activeTriggerId=b,d.activeTriggerElement=w,o.current=b;break}d.activeTriggerId===void 0&&(o.current===h?p=h:o.current=null)}}else o.current=null;if(!p&&!h&&u===1){const g=t.context.triggerElements.entries().next();if(!g.done){const[b,w]=g.value;d.activeTriggerId=b,d.activeTriggerElement=w,o.current=b}}(d.triggerCount!==void 0||d.activeTriggerId!==void 0||d.activeTriggerElement!==void 0)&&t.update(d),p&&n&&queueMicrotask(()=>{if(t.select("open")&&t.select("activeTriggerId")===p&&!t.context.triggerElements.getById(p)){const g=ft(Lh);t.setOpen(!1,g),g.isCanceled||t.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,t,i,r,l,n])}function cb(t,e,n,o){const{mounted:s,setMounted:i,transitionStatus:r}=d7(t,!1,!1,o),l=e.useState("preventUnmountingOnClose"),u=t?!1:l;e.useSyncedValues({mounted:s,transitionStatus:r,preventUnmountingOnClose:u});const d=De(()=>{i(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),e.context.onOpenChangeComplete?.(!1)});return Yu({enabled:s&&!t&&!u,open:t,ref:e.context.popupRef,onComplete(){t||d()}}),{forceUnmount:d,transitionStatus:r}}function ub(t,e){t.useSyncedValues(e),Se(()=>()=>{t.update({activeTriggerProps:nn,inactiveTriggerProps:nn,popupProps:nn})},[t])}function uB(t,e){Se(()=>{!e&&t.state.openMethod!==null&&t.set("openMethod",null)},[e,t]),Se(()=>()=>{t.state.openMethod!==null&&t.set("openMethod",null)},[t])}class db{constructor(){this.idMap=new Map}add(e,n){this.idMap.set(e,n)}delete(e){this.idMap.delete(e)}hasElement(e){for(const n of this.idMap.values())if(n===e)return!0;return!1}hasMatchingElement(e){for(const n of this.idMap.values())if(e(n))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function fb(t,e,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new rB({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:t,floatingId:e,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:e,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:nn,inactiveTriggerProps:nn,popupProps:nn}}const _f=t=>t.triggerIdProp??t.activeTriggerId,YS=t=>t.openProp??t.open,rA=t=>(t.popupElement?.id??t.floatingId)||void 0;function dB(t,e){return e!==void 0&&YS(t)&&_f(t)===e}function S9(t,e){return dB(t,e)?!0:e!==void 0&&YS(t)&&_f(t)==null&&t.triggerCount===1}const hb={open:YS,mounted:t=>t.mounted,transitionStatus:t=>t.transitionStatus,floatingRootContext:t=>t.floatingRootContext,triggerCount:t=>t.triggerCount,preventUnmountingOnClose:t=>t.preventUnmountingOnClose,payload:t=>t.payload,activeTriggerId:_f,activeTriggerElement:t=>t.mounted?t.activeTriggerElement:null,popupId:rA,isTriggerActive:(t,e)=>e!==void 0&&_f(t)===e,isOpenedByTrigger:(t,e)=>dB(t,e),isMountedByTrigger:(t,e)=>e!==void 0&&_f(t)===e&&t.mounted,triggerProps:(t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps,triggerPopupId:(t,e)=>S9(t,e)?rA(t):void 0,popupProps:t=>t.popupProps,popupElement:t=>t.popupElement,positionerElement:t=>t.positionerElement};function GS(t){const e=S.useCallback(o=>t===void 0?Rn:t.subscribeStore(o),[t]),n=S.useCallback(()=>t===void 0?void 0:t.store,[t]);return qS.useSyncExternalStore(e,n,()=>t?.serverStore)}function j9(t){return C9(t,t.rootContext)}function C9(t,e){const{nodeId:n,externalTree:o}=t,s=e.useState("referenceElement"),i=e.useState("floatingElement"),r=e.useState("domReferenceElement"),l=e.useState("open"),u=e.useState("floatingId"),[d,h]=S.useState(null),[p,g]=S.useState(void 0),[b,w]=S.useState(void 0),k=S.useRef(null),j=Ua(o),C=S.useMemo(()=>({reference:s,floating:i,domReference:r}),[s,i,r]),_=n9({...t,elements:{...C,...d&&{reference:d}}}),T=vt(p)?p:null,M=b===void 0?e.state.floatingElement:b;e.useSyncedValue("referenceElement",p??null),e.useSyncedValue("domReferenceElement",p===void 0?r:T),e.useSyncedValue("floatingElement",M);const O=S.useCallback(I=>{const P=vt(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),getClientRects:()=>I.getClientRects(),contextElement:I}:I;h(P),_.refs.setReference(P)},[_.refs]),N=S.useCallback(I=>{(vt(I)||I===null)&&(k.current=I,g(I)),(vt(_.refs.reference.current)||_.refs.reference.current===null||I!==null&&!vt(I))&&_.refs.setReference(I)},[_.refs,g]),D=S.useCallback(I=>{w(I),_.refs.setFloating(I)},[_.refs]),E=S.useMemo(()=>({..._.refs,setReference:N,setFloating:D,setPositionReference:O,domReference:k}),[_.refs,N,D,O]),R=S.useMemo(()=>({..._.elements,domReference:r}),[_.elements,r]),B=S.useMemo(()=>({..._,dataRef:e.context.dataRef,open:l,onOpenChange:e.setOpen,events:e.context.events,floatingId:u,refs:E,elements:R,nodeId:n,rootStore:e}),[_,E,R,n,e,l,u]);return Se(()=>{r&&(k.current=r)},[r]),Se(()=>{e.context.dataRef.current.floatingContext=B;const I=j?.nodesRef.current.find(P=>P.id===n);I&&(I.context=B)}),S.useMemo(()=>({..._,context:B,refs:E,elements:R,rootStore:e}),[_,E,R,B,e])}const U0=jS&&qa;function fB(t,e={}){const{enabled:n=!0,delay:o}=e,s="rootStore"in t?t.rootStore:t,{events:i,dataRef:r}=s.context,l=S.useRef(!1),u=S.useRef(null),d=S.useRef(!0),h=co();S.useEffect(()=>{const g=s.select("domReferenceElement");if(!n)return;const b=on(g);function w(){const C=s.select("domReferenceElement");!s.select("open")&&Ft(C)&&C===Nn(yt(C))&&(l.current=!0,u.current=C)}function k(){d.current=!0}function j(){d.current=!1}return Ys(st(b,"blur",w),U0&&st(b,"keydown",k,!0),U0&&st(b,"pointerdown",j,!0))},[s,n]),S.useEffect(()=>{if(!n)return;function g(b){if(b.reason===xr||b.reason===$h){const w=s.select("domReferenceElement");vt(w)&&(u.current=w,l.current=!0)}}return i.on("openchange",g),()=>{i.off("openchange",g)}},[i,n,s]);const p=S.useMemo(()=>{function g(){l.current=!1,u.current=null}return{onMouseLeave(){g()},onFocus(b){const w=b.currentTarget;if(l.current){if(u.current===w)return;g()}const k=ln(b.nativeEvent);if(vt(k)){if(U0&&!b.relatedTarget){if(!d.current&&!tb(k))return}else if(!Vg(k))return}const j=Ug(b.relatedTarget,s.context.triggerElements),{nativeEvent:C,currentTarget:_}=b,T=typeof o=="function"?o():o;if(s.select("open")&&j||T===0||T===void 0){s.setOpen(!0,ft(iu,C,_));return}h.start(T,()=>{l.current||s.setOpen(!0,ft(iu,C,_))})},onBlur(b){g();const w=b.relatedTarget,k=b.nativeEvent,j=vt(w)&&w.hasAttribute(Gf("focus-guard"))&&w.getAttribute("data-type")==="outside";h.start(0,()=>{const C=s.select("domReferenceElement"),_=Nn(yt(C));!w&&_===C||Ie(r.current.floatingContext?.refs.floating.current,_)||Ie(C,_)||j||Ug(w??_,s.context.triggerElements)||s.setOpen(!1,ft(iu,k))})}}},[r,o,s,h]);return S.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}class XS{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Lo,this.restTimeout=new Lo,this.handleCloseOptions=void 0}static create(){return new XS}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Xg=new WeakMap;function Jg(t){if(!t.performedPointerEventsMutation)return;const e=t.pointerEventsScopeElement;e&&Xg.get(e)===t&&(t.pointerEventsScopeElement?.style.removeProperty("pointer-events"),t.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),t.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Xg.delete(e)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function hB(t,e){const{scopeElement:n,referenceElement:o,floatingElement:s}=e,i=Xg.get(n);i&&i!==t&&Jg(i),Jg(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=n,t.pointerEventsReferenceElement=o,t.pointerEventsFloatingElement=s,Xg.set(n,t),n.style.pointerEvents="none",o.style.pointerEvents="auto",s.style.pointerEvents="auto"}function JS(t){const e=t.context.dataRef.current,n=qn(()=>e.hoverInteractionState??XS.create()).current;return e.hoverInteractionState||(e.hoverInteractionState=n),Yy(e.hoverInteractionState.disposeEffect),e.hoverInteractionState}function QS(t,e={}){const{enabled:n=!0,closeDelay:o=0,nodeId:s}=e,i="rootStore"in t?t.rootStore:t,r=i.useState("open"),l=i.useState("floatingElement"),u=i.useState("domReferenceElement"),{dataRef:d}=i.context,h=Ua(),p=Zl(),g=JS(i),b=co(),w=De(()=>TP(d.current.openEvent?.type,g.interactedInside)),k=De(()=>I7(d.current.openEvent?.type)),j=De(()=>{Jg(g)});Se(()=>{r||(g.pointerType=void 0,g.restTimeoutPending=!1,g.interactedInside=!1,j())},[r,g,j]),S.useEffect(()=>j,[j]),Se(()=>{if(n&&r&&g.handleCloseOptions?.blockPointerEvents&&k()&&vt(u)&&l){const C=u,_=l,T=yt(l),M=h?.nodesRef.current.find(E=>E.id===p)?.context?.elements.floating;M&&(M.style.pointerEvents="");const O=g.pointerEventsScopeElement!==_?g.pointerEventsScopeElement:null,N=M!==_?M:null,D=g.handleCloseOptions?.getScope?.()??O??N??C.closest("[data-rootownerid]")??T.body;return hB(g,{scopeElement:D,referenceElement:C,floatingElement:_}),()=>{j()}}},[n,r,u,l,g,k,h,p,j]),S.useEffect(()=>{if(!n)return;function C(){return!!(h&&p&&Da(h.nodesRef.current,p).length>0)}function _(E){const R=Kl(o,"close",g.pointerType),B=()=>{i.setOpen(!1,ft(pn,E)),h?.events.emit("floating.closed",E)};R?g.openChangeTimeout.start(R,B):(g.openChangeTimeout.clear(),B())}function T(E){const R=ln(E);if(!B7(R)){g.interactedInside=!1;return}g.interactedInside=R?.closest("[aria-haspopup]")!=null}function M(){g.openChangeTimeout.clear(),b.clear(),h?.events.off("floating.closed",N),j()}function O(E){if(C()&&h){h.events.on("floating.closed",N);return}if(Ug(E.relatedTarget,i.context.triggerElements))return;const R=d.current.floatingContext?.nodeId??s,B=E.relatedTarget;if(!(h&&R&&vt(B)&&Da(h.nodesRef.current,R,!1).some(P=>Ie(P.context?.elements.floating,B)))){if(g.handler){g.handler(E);return}j(),k()&&!w()&&_(E)}}function N(E){!h||!p||C()||b.start(0,()=>{h.events.off("floating.closed",N),i.setOpen(!1,ft(pn,E)),h.events.emit("floating.closed",E)})}const D=l;return Ys(D&&st(D,"mouseenter",M),D&&st(D,"mouseleave",O),D&&st(D,"pointerdown",T,!0),()=>{h?.events.off("floating.closed",N)})},[n,l,i,d,o,s,k,w,j,g,h,p,b])}const T9={current:null};function pb(t,e={}){const{enabled:n=!0,delay:o=0,handleClose:s=null,mouseOnly:i=!1,restMs:r=0,move:l=!0,triggerElementRef:u=T9,externalTree:d,isActiveTrigger:h=!0,getHandleCloseContext:p,isClosing:g,shouldOpen:b,guardStaleOpen:w=!1}=e,k="rootStore"in t?t.rootStore:t,{dataRef:j,events:C}=k.context,_=Ua(d),T=JS(k),M=S.useRef(!1),O=Mn(s),N=Mn(o),D=Mn(r),E=Mn(n),R=Mn(b),B=Mn(g),I=De(()=>TP(j.current.openEvent?.type,T.interactedInside)),P=De(()=>R.current?.()!==!1),$=De((F,q,H)=>{const Y=k.context.triggerElements;if(Y.hasElement(q))return!F||!Ie(F,q);if(!vt(H))return!1;const ne=H;return Y.hasMatchingElement(z=>Ie(z,ne))&&(!F||!Ie(F,ne))}),W=De(()=>{if(!T.handler)return;yt(k.select("domReferenceElement")).removeEventListener("mousemove",T.handler),T.handler=void 0}),K=De(()=>{Jg(T)});return h&&(T.handleCloseOptions=s?.__options),S.useEffect(()=>W,[W]),S.useEffect(()=>{if(!n)return;function F(q){q.open?M.current=!1:(M.current=q.reason===pn,W(),T.openChangeTimeout.clear(),T.restTimeout.clear(),T.blockMouseMove=!0,T.restTimeoutPending=!1)}return C.on("openchange",F),()=>{C.off("openchange",F)}},[n,C,T,W]),S.useEffect(()=>{if(!n)return;function F(U,J=!0){const X=Kl(N.current,"close",T.pointerType);X?T.openChangeTimeout.start(X,()=>{k.setOpen(!1,ft(pn,U)),_?.events.emit("floating.closed",U)}):J&&(T.openChangeTimeout.clear(),k.setOpen(!1,ft(pn,U)),_?.events.emit("floating.closed",U))}const q=u.current??(h?k.select("domReferenceElement"):null);if(!vt(q))return;function H(U){if(T.openChangeTimeout.clear(),T.blockMouseMove=!1,i&&!Sa(T.pointerType))return;const J=PO(D.current),X=Kl(N.current,"open",T.pointerType),oe=ln(U),ie=U.currentTarget??null,be=k.select("domReferenceElement");let ce=ie;if(vt(oe)&&!k.context.triggerElements.hasElement(oe)){for(const Ee of k.context.triggerElements.elements())if(Ie(Ee,oe)){ce=Ee;break}}vt(ie)&&vt(be)&&!k.context.triggerElements.hasElement(ie)&&Ie(ie,be)&&(ce=be);const ye=ce==null?!1:$(be,ce,oe),Ce=k.select("open"),Ve=B.current?.()??k.select("transitionStatus")==="ending",Me=!Ce&&Ve&&M.current,je=!ye&&vt(ce)&&vt(be)&&Ie(be,ce)&&Me,Oe=J>0&&!X,Fe=ye&&(Ce||Me)||je,nt=!Ce||ye;if(Fe){P()&&k.setOpen(!0,ft(pn,U,ce));return}Oe||(X?T.openChangeTimeout.start(X,()=>{nt&&P()&&k.setOpen(!0,ft(pn,U,ce))}):nt&&P()&&k.setOpen(!0,ft(pn,U,ce)))}function Y(U){if(I()){K();return}W();const J=k.select("domReferenceElement"),X=yt(J);T.restTimeout.clear(),T.restTimeoutPending=!1;const oe=j.current.floatingContext??p?.();if(Ug(U.relatedTarget,k.context.triggerElements))return;if(O.current&&oe){k.select("open")||T.openChangeTimeout.clear();const be=u.current;T.handler=O.current({...oe,tree:_,x:U.clientX,y:U.clientY,onClose(){K(),W(),E.current&&!I()&&be===k.select("domReferenceElement")&&F(U,!0)}}),X.addEventListener("mousemove",T.handler),T.handler(U);return}(T.pointerType!=="touch"||!Ie(k.select("floatingElement"),U.relatedTarget))&&F(U)}function ne(U){Ie(q,U.relatedTarget)||(T.openChangeTimeout.clear(),T.restTimeout.clear(),T.restTimeoutPending=!1)}const z=w?st(q,"mouseout",ne):void 0;return l?Ys(st(q,"mousemove",H,{once:!0}),st(q,"mouseenter",H),st(q,"mouseleave",Y),z):Ys(st(q,"mouseenter",H),st(q,"mouseleave",Y),z)},[W,K,j,N,k,n,O,T,h,$,I,i,l,D,u,_,E,p,B,P,w]),S.useMemo(()=>{if(!n)return;function F(q){T.pointerType=q.pointerType}return{onPointerDown:F,onPointerEnter:F,onMouseMove(q){const{nativeEvent:H}=q,Y=q.currentTarget,ne=k.select("domReferenceElement"),z=k.select("open"),U=$(ne,Y,q.target);if(i&&!Sa(T.pointerType))return;if(z&&U&&T.handleCloseOptions?.blockPointerEvents){const oe=k.select("floatingElement");if(oe){const ie=T.handleCloseOptions?.getScope?.()??Y.ownerDocument.body;hB(T,{scopeElement:ie,referenceElement:Y,floatingElement:oe})}}const J=PO(D.current);if(z&&!U||J===0||!U&&T.restTimeoutPending&&q.movementX**2+q.movementY**2<2)return;T.restTimeout.clear();function X(){if(T.restTimeoutPending=!1,I())return;const oe=k.select("open");!T.blockMouseMove&&(!oe||U)&&P()&&k.setOpen(!0,ft(pn,H,Y))}T.pointerType==="touch"?Os.flushSync(()=>{X()}):U&&z?X():(T.restTimeoutPending=!0,T.restTimeout.start(J,X))}}},[n,T,I,$,i,k,D,P])}const E9="Escape";function aA(t){return qa&&t.movementX===0&&t.movementY===0}function mb(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}function zm(t,e){return mb(e,t===CP||t===MS,t===Zy||t===eb)}function V0(t,e,n){return mb(e,t===MS,n?t===Zy:t===eb)||t==="Enter"||t===" "||t===""}function _9(t,e,n){return mb(e,n?t===Zy:t===eb,t===MS)}function M9(t,e,n,o){const s=n?t===eb:t===Zy,i=t===CP;return e==="both"||e==="horizontal"&&o?t===E9:mb(e,s,i)}function O9(t,e){const{listRef:n,activeIndex:o,onNavigate:s=()=>{},enabled:i=!0,selectedIndex:r=null,allowEscape:l=!1,loopFocus:u=!1,nested:d=!1,rtl:h=!1,virtual:p=!1,focusItemOnOpen:g="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:w=!0,disabledIndices:k=void 0,orientation:j="vertical",parentOrientation:C,id:_,resetOnPointerLeave:T=!0,externalTree:M,grid:O}=e,N=O!=null,D="rootStore"in t?t.rootStore:t,E=D.useState("open"),R=D.useState("floatingElement"),B=D.useState("domReferenceElement"),I=D.context.dataRef,P=xk(R),$=wk(B),W=Mn(P),K=Zl(),F=Ua(M),q=S.useRef(g),H=S.useRef(r??-1),Y=S.useRef(null),ne=S.useRef(!0),z=De(fe=>{s(H.current===-1?null:H.current,fe)}),U=S.useRef(!!R),J=S.useRef(E),X=S.useRef(!1),oe=S.useRef(!1),ie=S.useRef(null),be=Mn(k),ce=Mn(E),ye=Mn(r),Ce=Mn(T),Ve=Wf(),Me=Wf(),je=De(()=>{function fe(ve){p?F?.events.emit("virtualfocus",ve):ie.current=wg(ve,{sync:X.current,preventScroll:!0})}const xe=n.current[H.current],pe=oe.current;xe&&fe(xe),(X.current?ve=>ve():ve=>Ve.request(ve))(()=>{const ve=n.current[H.current]||xe;if(!ve)return;xe||fe(ve),_e&&(pe||!ne.current)&&ve.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Se(()=>{I.current.orientation=j},[I,j]),Se(()=>{i&&(E&&R?(H.current=r??-1,q.current&&r!=null&&(oe.current=!0,z())):U.current&&(H.current=-1,z()))},[i,E,R,r,z]),Se(()=>{if(i){if(!E){X.current=!1;return}if(R)if(o==null){if(X.current=!1,ye.current!=null)return;if(U.current&&(H.current=-1,je()),(!J.current||!U.current)&&q.current&&(Y.current!=null||q.current===!0&&Y.current==null)){let fe=0;const xe=()=>{n.current[0]==null?(fe<2&&(fe?re=>Me.request(re):queueMicrotask)(xe),fe+=1):(H.current=Y.current==null||V0(Y.current,j,h)||d?bg(n):kk(n),Y.current=null,z())};xe()}}else Ef(n.current,o)||(H.current=o,je(),oe.current=!1)}},[i,E,R,o,ye,d,n,j,h,z,je,Me]),Se(()=>{if(!i||R||!F||p||!U.current)return;const fe=F.nodesRef.current,xe=fe.find(ve=>ve.id===K)?.context?.elements.floating,pe=Nn(yt(B??xe??null)),re=fe.some(ve=>ve.context&&Ie(ve.context.elements.floating,pe));xe&&!re&&ne.current&&xe.focus({preventScroll:!0})},[i,R,B,F,K,p]),Se(()=>{J.current=E,U.current=!!R}),Se(()=>{E||(Y.current=null,q.current=g)},[E,g]);const Oe=o!=null,Fe=De(fe=>{if(!ce.current)return;const xe=n.current.indexOf(fe.currentTarget);xe!==-1&&(H.current!==xe||o!==xe)&&(H.current=xe,z(fe))}),nt=De(()=>C??F?.nodesRef.current.find(fe=>fe.id===K)?.context?.dataRef?.current.orientation),Ee=De(()=>bg(n,be.current)),Je=De(fe=>{if(ne.current=!1,X.current=!0,fe.which===229||!ce.current&&fe.currentTarget===W.current)return;if(d&&M9(fe.key,j,h,N)){zm(fe.key,nt())||ci(fe),D.setOpen(!1,ft(qg,fe.nativeEvent)),Ft(B)&&(p?F?.events.emit("virtualfocus",B):B.focus());return}const xe=H.current,pe=bg(n,k),re=kk(n,k);if($||(fe.key==="Home"&&(ci(fe),H.current=pe,z(fe)),fe.key==="End"&&(ci(fe),H.current=re,z(fe))),O!=null){const ve=O(fe,H.current,n,j,u,h,k,pe,re);if(ve!=null&&(H.current=ve,z(fe)),j==="both")return}if(zm(fe.key,j)){if(ci(fe),E&&!p&&Nn(fe.currentTarget.ownerDocument)===fe.currentTarget){H.current=V0(fe.key,j,h)?pe:re,z(fe);return}V0(fe.key,j,h)?u?xe>=re?l&&xe!==n.current.length?H.current=-1:(X.current=!1,H.current=pe):H.current=ir(n.current,{startingIndex:xe,disabledIndices:k}):H.current=Math.min(re,ir(n.current,{startingIndex:xe,disabledIndices:k})):u?xe<=pe?l&&xe!==-1?H.current=n.current.length:(X.current=!1,H.current=re):H.current=ir(n.current,{startingIndex:xe,decrement:!0,disabledIndices:k}):H.current=Math.max(pe,ir(n.current,{startingIndex:xe,decrement:!0,disabledIndices:k})),Ef(n.current,H.current)&&(H.current=-1),z(fe)}}),_e=S.useMemo(()=>({onFocus(xe){X.current=!0,Fe(xe)},onClick:({currentTarget:xe})=>xe.focus({preventScroll:!0}),onMouseMove(xe){aA(xe)||(X.current=!0,oe.current=!1,b&&Fe(xe))},onPointerLeave(xe){if(!ce.current||!ne.current||xe.pointerType==="touch")return;X.current=!0;const pe=xe.relatedTarget;if(!(!b||n.current.includes(pe))&&Ce.current&&(ie.current?.(),ie.current=null,H.current=-1,z(xe),!p)){const re=W.current,ve=Nn(yt(re));re&&Ie(re,ve)&&re.focus({preventScroll:!0})}}}),[Fe,ce,W,b,n,z,Ce,p]),Ae=S.useMemo(()=>p&&E&&Oe&&{"aria-activedescendant":`${_}-${o}`},[p,E,Oe,_,o]),Pe=S.useMemo(()=>({...$?{}:Ae,onKeyDown(fe){if(fe.key==="Tab"&&fe.shiftKey&&E&&!p){const xe=ln(fe.nativeEvent);if(xe&&!Ie(W.current,xe))return;ci(fe),D.setOpen(!1,ft(Vl,fe.nativeEvent)),Ft(B)&&B.focus();return}Je(fe)},onPointerMove(fe){aA(fe)||(ne.current=!0)}}),[Ae,Je,W,$,D,E,p,B]),bt=S.useMemo(()=>{function fe(re){D.setOpen(!0,ft(qg,re.nativeEvent,re.currentTarget))}function xe(re){g==="auto"&&ES(re.nativeEvent)&&(q.current=!p)}function pe(re){q.current=g,g==="auto"&&_S(re.nativeEvent)&&(q.current=!0)}return{onKeyDown(re){const ve=D.select("open");ne.current=!1;const Ze=re.key.startsWith("Arrow"),Ln=_9(re.key,nt(),h),So=zm(re.key,j),dn=(d?Ln:So)||re.key==="Enter"||re.key.trim()==="";if(p&&ve)return Je(re);if(!(!ve&&!w&&Ze)){if(dn){const Te=zm(re.key,nt());Y.current=d&&Te?null:re.key}if(d){Ln&&(ci(re),ve?(H.current=Ee(),z(re)):fe(re));return}So&&(ye.current!=null&&(H.current=ye.current),ci(re),!ve&&w?fe(re):Je(re),ve&&z(re))}},onFocus(re){D.select("open")&&!p&&(H.current=-1,z(re))},onPointerDown:pe,onPointerEnter:pe,onMouseDown:xe,onClick:xe}},[Je,g,Ee,d,z,D,w,j,nt,h,ye,p]),Be=S.useMemo(()=>({...Ae,...bt}),[Ae,bt]);return S.useMemo(()=>i?{reference:Be,floating:Pe,item:_e,trigger:bt}:{},[i,Be,Pe,bt,_e])}function A9(t,e){const{listRef:n,elementsRef:o,activeIndex:s,onMatch:i,disabledIndices:r,onTyping:l,enabled:u=!0,resetMs:d=750,selectedIndex:h=null}=e,p="rootStore"in t?t.rootStore:t,g=p.useState("open"),b=co(),w=S.useRef(""),k=S.useRef(h??s??-1),j=S.useRef(null),C=De(M=>{function O(W){return o?.current[W]}function N(W){const K=O(W);return K&&!nb(K)||K?.matches(":disabled")?!1:r==null||!ru(br,W,r)}function D(W,K,F=0){if(W.length===0)return-1;const q=(F%W.length+W.length)%W.length,H=K.toLowerCase();for(let Y=0;Y<W.length;Y+=1){const ne=(q+Y)%W.length;if(!(!W[ne]?.toLowerCase().startsWith(H)||!N(ne)))return ne}return-1}const E=n.current;if(w.current.length>0&&M.key===" "&&(ci(M),l?.(!0)),w.current.length>0&&w.current[0]!==" "&&D(E,w.current)===-1&&M.key!==" "&&l?.(!1),E==null||M.key.length!==1||M.ctrlKey||M.metaKey||M.altKey)return;g&&M.key!==" "&&(ci(M),l?.(!0));const R=w.current==="";R&&(k.current=h??s??-1),E.every((W,K)=>W&&N(K)?W[0]?.toLowerCase()!==W[1]?.toLowerCase():!0)&&w.current===M.key&&(w.current="",k.current=j.current),w.current+=M.key,b.start(d,()=>{w.current="",k.current=j.current,l?.(!1)});const P=((R?h??s??-1:k.current)??0)+1,$=D(E,w.current,P);$!==-1?(i?.($),j.current=$):M.key!==" "&&(w.current="",l?.(!1))}),_=De(M=>{const O=M.relatedTarget,N=p.select("domReferenceElement"),D=p.select("floatingElement");Ie(N,O)||Ie(D,O)||(b.clear(),w.current="",k.current=j.current,l?.(!1))});Se(()=>{!g&&h!==null||(b.clear(),j.current=null,w.current!==""&&(w.current=""))},[g,h,b]);const T=S.useMemo(()=>({onKeyDown:C,onBlur:_}),[C,_]);return S.useMemo(()=>u?{reference:T,floating:T}:{},[u,T])}const lA=.1,R9=lA*lA,Yt=.5;function Im(t,e,n,o,s,i){return o>=e!=i>=e&&t<=(s-n)*(e-o)/(i-o)+n}function Lm(t,e,n,o,s,i,r,l,u,d){let h=!1;return Im(t,e,n,o,s,i)&&(h=!h),Im(t,e,s,i,r,l)&&(h=!h),Im(t,e,r,l,u,d)&&(h=!h),Im(t,e,u,d,n,o)&&(h=!h),h}function N9(t,e,n){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function $m(t,e,n,o,s,i){const r=Math.min(n,s),l=Math.max(n,s),u=Math.min(o,i),d=Math.max(o,i);return t>=r&&t<=l&&e>=u&&e<=d}function gb(t={}){const{blockPointerEvents:e=!1}=t,n=new Lo,o=({x:s,y:i,placement:r,elements:l,onClose:u,nodeId:d,tree:h})=>{const p=r?.split("-")[0];let g=!1,b=null,w=null,k=typeof performance<"u"?performance.now():0;function j(_,T){const M=performance.now(),O=M-k;if(b===null||w===null||O===0)return b=_,w=T,k=M,!1;const N=_-b,D=T-w,E=N*N+D*D,R=O*O*R9;return b=_,w=T,k=M,E<R}function C(){n.clear(),u()}return function(T){n.clear();const M=l.domReference,O=l.floating;if(!M||!O||p==null||s==null||i==null)return;const{clientX:N,clientY:D}=T,E=ln(T),R=T.type==="mouseleave",B=Ie(O,E),I=Ie(M,E);if(B&&(g=!0,!R))return;if(I&&(g=!1,!R)){g=!0;return}if(R&&vt(T.relatedTarget)&&Ie(O,T.relatedTarget))return;function P(){return!!(h&&Da(h.nodesRef.current,d).length>0)}function $(){P()||C()}if(P())return;const W=M.getBoundingClientRect(),K=O.getBoundingClientRect(),F=s>K.right-K.width/2,q=i>K.bottom-K.height/2,H=K.width>W.width,Y=K.height>W.height,ne=(H?W:K).left,z=(H?W:K).right,U=(Y?W:K).top,J=(Y?W:K).bottom;if(p==="top"&&i>=W.bottom-1||p==="bottom"&&i<=W.top+1||p==="left"&&s>=W.right-1||p==="right"&&s<=W.left+1){$();return}let X=!1;switch(p){case"top":X=$m(N,D,ne,W.top+1,z,K.bottom-1);break;case"bottom":X=$m(N,D,ne,K.top+1,z,W.bottom-1);break;case"left":X=$m(N,D,K.right-1,J,W.left+1,U);break;case"right":X=$m(N,D,W.right-1,J,K.left+1,U);break}if(X)return;if(g&&!N9(N,D,W)){$();return}if(!R&&j(N,D)){$();return}let oe=!1;switch(p){case"top":{const ie=H?Yt/2:Yt*4,be=H||F?s+ie:s-ie,ce=H?s-ie:F?s+ie:s-ie,ye=i+Yt+1,Ce=F||H?K.bottom-Yt:K.top,Ve=F?H?K.bottom-Yt:K.top:K.bottom-Yt;oe=Lm(N,D,be,ye,ce,ye,K.left,Ce,K.right,Ve);break}case"bottom":{const ie=H?Yt/2:Yt*4,be=H||F?s+ie:s-ie,ce=H?s-ie:F?s+ie:s-ie,ye=i-Yt,Ce=F||H?K.top+Yt:K.bottom,Ve=F?H?K.top+Yt:K.bottom:K.top+Yt;oe=Lm(N,D,be,ye,ce,ye,K.left,Ce,K.right,Ve);break}case"left":{const ie=Y?Yt/2:Yt*4,be=Y||q?i+ie:i-ie,ce=Y?i-ie:q?i+ie:i-ie,ye=s+Yt+1,Ce=q||Y?K.right-Yt:K.left,Ve=q?Y?K.right-Yt:K.left:K.right-Yt;oe=Lm(N,D,Ce,K.top,Ve,K.bottom,ye,be,ye,ce);break}case"right":{const ie=Y?Yt/2:Yt*4,be=Y||q?i+ie:i-ie,ce=Y?i-ie:q?i+ie:i-ie,ye=s-Yt,Ce=q||Y?K.left+Yt:K.right,Ve=q?Y?K.left+Yt:K.right:K.left+Yt;oe=Lm(N,D,ye,be,ye,ce,Ce,K.top,Ve,K.bottom);break}}oe?g||n.start(40,$):$()}};return o.__options={...t,blockPointerEvents:e},o}const D9=S.createContext(void 0);function ZS(t){return S.useContext(D9)}const Ek="ArrowUp",_k="ArrowDown",Mk="ArrowLeft",Ok="ArrowRight",Ak="Home",Rk="End",yb=new Set([Ek,_k,Mk,Ok,Ak,Rk]),P9="Shift",B9=[P9,"Control","Alt","Meta"];function z9(t){return Ft(t)&&t.tagName==="INPUT"}function cA(t){return!!(z9(t)&&t.selectionStart!=null||Ft(t)&&t.tagName==="TEXTAREA")}function uA(t,e,n,o){if(!t||!e||!e.scrollTo)return;let s=t.scrollLeft,i=t.scrollTop;const r=t.clientWidth<t.scrollWidth,l=t.clientHeight<t.scrollHeight;if(r&&o!=="vertical"){const u=dA(t,e,"left"),d=Fm(t),h=Fm(e);n==="ltr"&&(u+e.offsetWidth+h.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight?s=u+e.offsetWidth+h.scrollMarginRight-t.clientWidth+d.scrollPaddingRight:u-h.scrollMarginLeft<t.scrollLeft+d.scrollPaddingLeft&&(s=u-h.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(u-h.scrollMarginLeft<t.scrollLeft+d.scrollPaddingLeft?s=u-h.scrollMarginLeft-d.scrollPaddingLeft:u+e.offsetWidth+h.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight&&(s=u+e.offsetWidth+h.scrollMarginRight-t.clientWidth+d.scrollPaddingRight))}if(l&&o!=="horizontal"){const u=dA(t,e,"top"),d=Fm(t),h=Fm(e);u-h.scrollMarginTop<t.scrollTop+d.scrollPaddingTop?i=u-h.scrollMarginTop-d.scrollPaddingTop:u+e.offsetHeight+h.scrollMarginBottom>t.scrollTop+t.clientHeight-d.scrollPaddingBottom&&(i=u+e.offsetHeight+h.scrollMarginBottom-t.clientHeight+d.scrollPaddingBottom)}t.scrollTo({left:s,top:i,behavior:"auto"})}function dA(t,e,n){const o=n==="left"?"offsetLeft":"offsetTop";let s=0;for(;e.offsetParent&&(s+=e[o],e.offsetParent!==t);)e=e.offsetParent;return s}function Fm(t){const e=getComputedStyle(t);return{scrollMarginTop:parseFloat(e.scrollMarginTop)||0,scrollMarginRight:parseFloat(e.scrollMarginRight)||0,scrollMarginBottom:parseFloat(e.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(e.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(e.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(e.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(e.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(e.scrollPaddingLeft)||0}}function bb(t){return t==="starting"?cU:nn}const pB=S.forwardRef(function(e,n){const{render:o,className:s,style:i,finalFocus:r,...l}=e,{store:u}=Ha(),{side:d,align:h}=xS(),p=ZS()!=null,g=u.useState("open"),b=u.useState("transitionStatus"),w=u.useState("popupProps"),k=u.useState("mounted"),j=u.useState("instantType"),C=u.useState("activeTriggerElement"),_=u.useState("parent"),T=u.useState("lastOpenChangeReason"),M=u.useState("rootId"),O=u.useState("floatingRootContext"),N=u.useState("floatingTreeRoot"),D=u.useState("closeDelay"),E=u.useState("hoverEnabled"),R=u.useState("disabled"),B=u.useState("openMethod"),I=_.type==="context-menu";Yu({open:g,ref:u.context.popupRef,onComplete(){g&&u.context.onOpenChangeComplete?.(!0)}}),S.useEffect(()=>{function F(q){u.setOpen(!1,ft(q.reason,q.domEvent))}return N.events.on("close",F),()=>{N.events.off("close",F)}},[N.events,u]),QS(O,{enabled:E&&!R&&!I&&_.type!=="menubar",closeDelay:D});const P=u.useStateSetter("popupElement"),$={transitionStatus:b,side:d,align:h,open:g,nested:_.type==="menu",instant:j},W=Ht("div",e,{state:$,ref:[n,u.context.popupRef,P],stateAttributesMapping:Xy,props:[w,{onKeyDown(F){p&&yb.has(F.key)&&F.stopPropagation()}},bb(b),l,{"data-rootownerid":M}]});let K=_.type===void 0||I;return(C||_.type==="menubar"&&T!==bS)&&(K=!0),y.jsx($S,{context:O,openInteractionType:B,modal:I,disabled:!k,returnFocus:r===void 0?K:r,initialFocus:_.type!=="menu",restoreFocus:!0,externalTree:_.type!=="menubar"?N:void 0,previousFocusableElement:C,nextFocusableElement:_.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?u.context.beforeContentFocusGuardRef:void 0,children:W})}),mB=S.createContext(void 0);function I9(){const t=S.useContext(mB);if(t===void 0)throw new Error(gn(32));return t}const gB=S.forwardRef(function(e,n){const{keepMounted:o=!1,...s}=e,{store:i,parent:r}=Ha();if(!(i.useState("mounted")||o))return null;const d=r.type==="menu"||r.type==="menubar"?"group":void 0;return y.jsx(mB.Provider,{value:o,children:y.jsx(BS,{ref:n,...s,portalOwnerRole:d})})});function wb(t){return hS(19)?t:t?"true":void 0}const L9=S.createContext(void 0);function ej(){return S.useContext(L9)?.direction??"ltr"}const $9=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:s,rects:i,platform:r,elements:l,middlewareData:u}=e,{element:d,padding:h=0,offsetParent:p="real"}=Na(t,e)||{};if(d==null)return{};const g=MP(h),b={x:n,y:o},w=RS(s),k=AS(w),j=await r.getDimensions(d),C=w==="y",_=C?"top":"left",T=C?"bottom":"right",M=C?"clientHeight":"clientWidth",O=i.reference[k]+i.reference[w]-b[w]-i.floating[k],N=b[w]-i.reference[w],D=p==="real"?await r.getOffsetParent?.(d):l.floating;let E=l.floating[M]||i.floating[k];(!E||!await r.isElement?.(D))&&(E=l.floating[M]||i.floating[k]);const R=O/2-N/2,B=E/2-j[k]/2-1,I=Math.min(g[_],B),P=Math.min(g[T],B),$=I,W=E-j[k]-P,K=E/2-j[k]/2+R,F=_P($,K,W),q=!u.arrow&&kr(s)!=null&&K!==F&&i.reference[k]/2-(K<$?I:P)-j[k]/2<0,H=q?K<$?K-$:K-W:0;return{[w]:b[w]+H,data:{[w]:F,centerOffset:K-F-H,...q&&{alignmentOffset:H}},reset:q}}}),F9=(t,e)=>{const{name:n,fn:o}=$9(t);return{name:n,fn:o,options:[t,e]}},H9={name:"hide",async fn(t){const{width:e,height:n,x:o,y:s}=t.rects.reference,i=e===0&&n===0&&o===0&&s===0,r=await t.platform.detectOverflow(t,{elementContext:"reference"});return{data:{referenceHidden:r.top-n>=0||r.right-e>=0||r.bottom-n>=0||r.left-e>=0||i}}}},q9={sideX:"left",sideY:"top"},U9="--available-width",V9="--available-height",K9="--anchor-width",W9="--anchor-height",Y9="--transform-origin",fA=U9,hA=V9;function yB(t,e,n){const o=t==="inline-start"||t==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[e]}function pA(t,e,n){const{rects:o,placement:s}=t;return{side:yB(e,_s(s),n),align:kr(s)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function tj(t){return G9(t,j9)}function G9(t,e){const{anchor:n,positionMethod:o="absolute",side:s="bottom",sideOffset:i=0,align:r="center",alignOffset:l=0,collisionBoundary:u,collisionPadding:d=5,sticky:h=!1,arrowPadding:p=5,disableAnchorTracking:g=!1,inline:b,keepMounted:w=!1,floatingRootContext:k,mounted:j,collisionAvoidance:C,shift:_,nodeId:T,adaptiveOrigin:M,lazyFlip:O=!1,externalTree:N}=t,[D,E]=S.useState(null);!j&&D!==null&&E(null);const R=C.side||"flip",B=C.align||"flip",I=C.fallbackAxisSide||"end",P=_?.crossAxis??!1,$=_?.rootBoundary,W=typeof n=="function"?n:void 0,K=De(W),F=W?K:n,q=Mn(n),H=Mn(j),ne=ej()==="rtl",z=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":ne?"left":"right","inline-start":ne?"right":"left"}[s],U=r==="center"?z:`${z}-${r}`;let J=d;typeof J=="number"?J={top:J,right:J,bottom:J,left:J}:J&&(J={top:J.top||0,right:J.right||0,bottom:J.bottom||0,left:J.left||0});const X=1,oe=s==="bottom"?X:0,ie=s==="top"?X:0,be=s==="right"?X:0,ce=s==="left"?X:0,ye={boundary:u==="clipping-ancestors"?"clippingAncestors":u,padding:J},Ce=S.useRef(null),Ve=Mn(i),Me=Mn(l),je=typeof i!="function"?i:0,Oe=typeof l!="function"?l:0,Fe=[];b&&Fe.push(b),Fe.push(o9(dt=>{const un=pA(dt,s,ne),Un=typeof Ve.current=="function"?Ve.current(un):Ve.current,kn=typeof Me.current=="function"?Me.current(un):Me.current;return{mainAxis:Un,crossAxis:kn,alignmentAxis:kn}},[je,Oe,ne,s]));const nt=B==="none"&&R!=="shift",Ee=!nt&&(h||P||R==="shift"),Je=R==="none"?null:r9({...ye,padding:{top:J.top+X+oe,right:J.right+X+ce,bottom:J.bottom+X+ie,left:J.left+X+be},mainAxis:!P&&R==="flip",crossAxis:B==="flip"?"alignment":!1,fallbackAxisSideDirection:I}),_e=nt?null:s9({...ye,rootBoundary:$,mainAxis:B!=="none",crossAxis:Ee,limiter:h||P?void 0:i9(dt=>{if(!Ce.current)return{};const{width:un,height:Un}=Ce.current.getBoundingClientRect(),kn=Es(_s(dt.placement)),ni=kn==="y"?un:Un,jo=kn==="y"?J.left+J.right:J.top+J.bottom;return{offset:ni/2+jo/2}})},[ye,h,P,$,J,B]);R==="shift"||B==="shift"||r==="center"?Fe.push(_e,Je):Fe.push(Je,_e),Fe.push(a9({...ye,apply({elements:{floating:dt},availableWidth:un,availableHeight:Un,rects:kn}){if(!H.current)return;const ni=dt.style;ni.setProperty(fA,`${un}px`),ni.setProperty(hA,`${Un}px`);const jo=on(dt).devicePixelRatio||1,{x:_r,y:us,width:ic,height:Is}=kn.reference,Mr=(Math.round((_r+ic)*jo)-Math.round(_r*jo))/jo,Or=(Math.round((us+Is)*jo)-Math.round(us*jo))/jo;ni.setProperty(K9,`${Mr}px`),ni.setProperty(W9,`${Or}px`)}}),F9(dt=>({element:Ce.current||yt(dt.elements.floating).createElement("div"),padding:Ce.current?p:0,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(dt){const{elements:{floating:un},middlewareData:Un,placement:kn,platform:ni,rects:jo,y:_r}=dt,us=_s(kn),ic=kr(kn),Is=Es(us)==="y",Mr=Ce.current,Or=typeof i=="function"?i(pA(dt,s,ne)):i;let Ar;if(!Mr&&ic&&Math.abs(Is?Un.shift?.x||0:Un.shift?.y||0)<=1)Ar=ic==="start"===(Is&&ni.isRTL?.(un)===!0)?"100%":"0%";else{const bp=Is?Un.arrow?.x||0:Un.arrow?.y||0,wp=Is?Mr?.clientWidth||0:Mr?.clientHeight||0;Ar=`${bp+wp/2}px`}let Xa=us==="top"||us==="left"?`calc(100% + ${Or}px)`:`${-Or}px`;return Ee&&Is&&Math.abs(Un.shift?.y||0)>Or&&(Xa=`${jo.reference.y+jo.reference.height/2-_r}px`),un.style.setProperty(Y9,Is?`${Ar} ${Xa}`:`${Xa} ${Ar}`),{}}},H9,M),Se(()=>{!j&&k&&k.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[j,k]);const Ae=S.useMemo(()=>({ancestorScroll:!g,elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:Pe,elements:bt,x:Be,y:fe,middlewareData:xe,update:pe,placement:re,context:ve,isPositioned:Ze,floatingStyles:Ln}=e({rootContext:k,open:w?j:void 0,placement:U,middleware:Fe,strategy:o,whileElementsMounted:w?void 0:(...dt)=>ZO(...dt,Ae),nodeId:T,externalTree:N}),{sideX:So,sideY:dn}=xe.adaptiveOrigin||q9,Te=Ze?o:"fixed",rt=S.useMemo(()=>{let dt;return Ze?M?dt={position:Te,[So]:Be,[dn]:fe}:dt={...Ln,position:Te}:dt={position:Te,top:0,left:0},dt[fA]="100vw",dt[hA]="100vh",Ze||(dt.opacity=0),dt},[M,Te,So,Be,dn,fe,Ln,Ze]),_t=S.useRef(null);Se(()=>{if(!j)return;const dt=q.current,un=typeof dt=="function"?dt():dt,kn=(mA(un)?un.current:un)||null||null;kn!==_t.current&&(Pe.setPositionReference(kn),_t.current=kn)},[j,Pe,F,q]),S.useEffect(()=>{if(!j)return;const dt=q.current;typeof dt!="function"&&mA(dt)&&dt.current!==_t.current&&(Pe.setPositionReference(dt.current),_t.current=dt.current)},[j,Pe,F,q]),S.useEffect(()=>{if(w&&j&&bt.reference&&bt.floating)return ZO(bt.reference,bt.floating,pe,Ae)},[w,j,bt,pe,Ae]);const Jt=_s(re),ls=yB(s,Jt,ne),Bs=kr(re)||"center",cs=!!xe.hide?.referenceHidden;Se(()=>{O&&j&&Ze&&Jt!==z&&E(Jt)},[O,j,Ze,Jt,z]);const vn=S.useMemo(()=>({position:"absolute",top:xe.arrow?.y,left:xe.arrow?.x}),[xe.arrow]),zs=xe.arrow?.centerOffset!==0;return S.useMemo(()=>({positionerStyles:rt,arrowStyles:vn,arrowRef:Ce,arrowUncentered:zs,side:ls,align:Bs,physicalSide:Jt,anchorHidden:cs,refs:Pe,context:ve,isPositioned:Ze,update:pe}),[rt,vn,Ce,zs,ls,Bs,Jt,cs,Pe,ve,Ze,pe])}function mA(t){return t!=null&&"current"in t}function bB(t){const{children:e,elementsRef:n,labelsRef:o,onMapChange:s}=t,i=De(s),[,r]=S.useState(!1),l=qn(J9).current,u=qn(X9).current,d=S.useRef(0),h=S.useRef(!0),p=S.useRef(null),g=S.useRef(null),b=De(()=>{h.current||(h.current=!0,r(O=>!O))}),w=De((O,N)=>{u.set(O,N),b()}),k=De(O=>{u.delete(O),b()}),j=De(O=>{const N=new Map;return n.current.length=0,o&&(o.current.length=0),O.forEach(D=>{N.set(D.element,{...D.registration.metadata??{},index:D.index}),n.current[D.index]=D.element,o&&(o.current[D.index]=D.registration.label!==void 0?D.registration.label:D.registration.textRef?.current?.textContent??D.element.textContent)}),d.current=n.current.length,N});function C(O){if(g.current?.disconnect(),g.current=null,typeof MutationObserver!="function"||O.length<2)return;const N=new MutationObserver(E=>{if(!eV(E))return;let R=null;for(const B of O)if(B.isConnected){if(R&&wB(R,B)>0){N.disconnect(),b();return}R=B}});g.current=N;const D=new Set;for(let E=1;E<O.length;E+=1){const R=Z9(O[E-1],O[E]);R&&D.add(R)}D.forEach(E=>N.observe(E,{childList:!0}))}const _=De(()=>{const[O,N]=Q9(u),D=j(O),E=p.current,R=!E||E.length!==O.length||O.some((B,I)=>{const P=E[I];return B.index!==P.index||B.element!==P.element||B.registration.index!==P.registration.index||B.registration.metadata!==P.registration.metadata});C(N),p.current=O,h.current=!1,R&&(l.forEach(B=>B(D)),i(D))});Se(()=>(!h.current&&p.current&&j(p.current),()=>{n.current=[],o&&(o.current=[])}),[n,o,j]),Se(()=>{h.current&&_()}),Se(()=>()=>{g.current?.disconnect(),h.current=!0},[]);const T=De(O=>(l.add(O),()=>{l.delete(O)})),M=S.useMemo(()=>({register:w,unregister:k,subscribeMapChange:T,nextIndexRef:d}),[w,k,T,d]);return y.jsx(SP.Provider,{value:M,children:e})}function X9(){return new Map}function J9(){return new Set}function Q9(t){const e=new Set,n=[],o=[];t.forEach((i,r)=>{if(!r.isConnected)return;const l=i.index,u={index:l??-1,element:r,registration:i};l===null?o.push(u):l>=0&&(e.add(l),n.push(u))});let s=0;return o.sort((i,r)=>wB(i.element,r.element)),o.forEach(i=>{for(;e.has(s);)s+=1;i.index=s,n.push(i),s+=1}),e.size>0&&n.sort((i,r)=>i.index-r.index),[n,o.map(i=>i.element)]}function Z9(t,e){let n=t.parentElement;for(;n&&!n.contains(e);)n=n.parentElement;return n}function eV(t){for(const e of t)for(let n=0;n<e.removedNodes.length;n+=1)if(e.removedNodes[n].isConnected)return!0;return!1}function wB(t,e){return t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const nj=S.forwardRef(function(e,n){const{cutout:o,...s}=e;let i;if(o){const r=o.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${r.left}px ${r.top}px,${r.left}px ${r.bottom}px,${r.right}px ${r.bottom}px,${r.right}px ${r.top}px,${r.left}px ${r.top}px)`}return y.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})});function oj(t,e,{styles:n,transitionStatus:o,props:s,refs:i,hidden:r,inert:l=!1}){const u={...n};return l&&(u.pointerEvents="none"),Ht("div",t,{state:e,ref:i,props:[{role:"presentation",hidden:r,style:u},bb(o),s],stateAttributesMapping:kS})}let gA={},yA={},bA="";function xb(t,e){return Ih(t)?t:e}function wA(t,e,n){return/hidden|clip/.test(t.getComputedStyle(xb(e,n)).overflowY)}function tV(t){if(typeof document>"u")return!1;const e=yt(t);return on(e).innerWidth-e.documentElement.clientWidth>0}function nV(t){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=yt(t),o=n.documentElement,s=n.body,i=xb(o,s),r=i.style.overflowY,l=o.style.scrollbarGutter;o.style.scrollbarGutter="stable",i.style.overflowY="scroll";const u=i.offsetWidth;i.style.overflowY="hidden";const d=i.offsetWidth;return i.style.overflowY=r,o.style.scrollbarGutter=l,u===d}function oV(t){const e=yt(t),n=e.documentElement,o=e.body,s=xb(n,o),i={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,i)}}function sV(t){const e=yt(t),n=e.documentElement,o=e.body,s=on(n);let i=0,r=0,l=!1;const u=di.create();if(qa&&(s.visualViewport?.scale??1)!==1)return()=>{};function d(){const b=s.getComputedStyle(n),w=s.getComputedStyle(o),C=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=n.scrollTop,r=n.scrollLeft,gA={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},bA=n.style.scrollBehavior,yA={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const _=n.scrollHeight>n.clientHeight,T=n.scrollWidth>n.clientWidth,M=b.overflowY==="scroll"||w.overflowY==="scroll",O=b.overflowX==="scroll"||w.overflowX==="scroll",N=Math.max(0,s.innerWidth-o.clientWidth),D=Math.max(0,s.innerHeight-o.clientHeight),E=parseFloat(w.marginTop)+parseFloat(w.marginBottom),R=parseFloat(w.marginLeft)+parseFloat(w.marginRight),B=xb(n,o);if(l=nV(t),l){n.style.scrollbarGutter=C,B.style.overflowY="hidden",B.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:C,overflowY:"hidden",overflowX:"hidden"}),(_||M)&&(n.style.overflowY="scroll"),(T||O)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:E||D?`calc(100dvh - ${E+D}px)`:"100dvh",width:R||N?`calc(100vw - ${R+N}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),o.scrollTop=i,o.scrollLeft=r,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function h(){Object.assign(n.style,gA),Object.assign(o.style,yA),l||(n.scrollTop=i,n.scrollLeft=r,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=bA)}function p(){h(),u.request(d)}d();const g=st(s,"resize",p);return()=>{u.cancel(),h(),typeof s.removeEventListener=="function"&&g()}}class iV{lockCount=0;restore=null;timeoutLock=Lo.create();timeoutUnlock=Lo.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;const n=yt(e),o=n.documentElement,s=n.body,i=on(o);if(wA(i,o,s)){const l=new i.MutationObserver(()=>{wA(i,o,s)||(l.disconnect(),this.restore=null,this.lock(e))}),u={attributes:!0};l.observe(o,u),l.observe(s,u),this.restore=()=>l.disconnect();return}const r=Qy||!tV(e);this.restore=r?oV(e):sV(e)}}const rV=new iV;function xB(t=!0,e=null){Se(()=>{if(t)return rV.acquire(e)},[t,e])}const aV=20;function vB(t,e,n,o){const[s,i]=S.useState(!1);Se(()=>{if(!t||!e||n==null){i(!1);return}const r=yt(n).documentElement.clientWidth,l=n.offsetWidth;i(r>0&&l>0&&l>=r-aV)},[t,e,n]),xB(t&&(!e||s),o)}const kB=S.forwardRef(function(e,n){const{anchor:o,positionMethod:s="absolute",className:i,render:r,side:l,align:u,sideOffset:d=0,alignOffset:h=0,collisionBoundary:p="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:w=!1,disableAnchorTracking:k=!1,collisionAvoidance:j=pU,style:C,..._}=e,{store:T}=Ha(),M=I9(),O=SS(!0),N=T.useState("parent"),D=T.useState("floatingRootContext"),E=T.useState("floatingTreeRoot"),R=T.useState("mounted"),B=T.useState("open"),I=T.useState("modal"),P=T.useState("openMethod"),$=T.useState("activeTriggerElement"),W=T.useState("transitionStatus"),K=T.useState("positionerElement"),F=T.useState("instantType"),q=T.useState("adaptiveOrigin"),H=T.useState("lastOpenChangeReason"),Y=T.useState("floatingNodeId"),ne=T.useState("floatingParentNodeId"),z=D.useState("domReferenceElement"),U=S.useRef(null),J=Gy(K);let X=o,oe=d,ie=h,be=u,ce=j;N.type==="context-menu"&&(X=o??N.context?.anchor,be=be??"start",!l&&be!=="center"&&(ie=e.alignOffset??2,oe=e.sideOffset??-5));let ye=l,Ce=be;N.type==="menu"?(ye=ye??"inline-end",Ce=Ce??"start",ce=e.collisionAvoidance??PS):N.type==="menubar"&&(ye=ye??(N.context.orientation==="vertical"?"inline-end":"bottom"),Ce=Ce??"start");const Ve=N.type==="context-menu",Me=tj({anchor:X,floatingRootContext:D,positionMethod:O?"fixed":s,mounted:R,side:ye,sideOffset:oe,align:Ce,alignOffset:ie,arrowPadding:Ve?0:b,collisionBoundary:p,collisionPadding:g,sticky:w,nodeId:Y,keepMounted:M,disableAnchorTracking:k,collisionAvoidance:ce,shift:Ve?{crossAxis:!("side"in ce&&ce.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:E,adaptiveOrigin:q});S.useEffect(()=>{function Ae(Pe){Pe.open&&(Pe.parentNodeId===Y&&T.set("hoverEnabled",!1),Pe.nodeId!==Y&&Pe.parentNodeId===T.select("floatingParentNodeId")&&T.setOpen(!1,ft(pf)))}return E.events.on("menuopenchange",Ae),()=>{E.events.off("menuopenchange",Ae)}},[T,E.events,Y]),S.useEffect(()=>{if(T.select("floatingParentNodeId")==null)return;function Ae(Pe){if(Pe.open||Pe.nodeId!==T.select("floatingParentNodeId"))return;const bt=Pe.reason??pf;T.setOpen(!1,ft(bt))}return E.events.on("menuopenchange",Ae),()=>{E.events.off("menuopenchange",Ae)}},[E.events,T]);const je=co();S.useEffect(()=>{B||je.clear()},[B,je]),S.useEffect(()=>{function Ae(Pe){if(!(!B||Pe.nodeId!==T.select("floatingParentNodeId")))if(Pe.target&&$&&$!==Pe.target){const bt=T.select("closeDelay");bt>0?je.isStarted()||je.start(bt,()=>{T.setOpen(!1,ft(pf))}):T.setOpen(!1,ft(pf))}else je.clear()}return E.events.on("itemhover",Ae),()=>{E.events.off("itemhover",Ae)}},[E.events,B,$,T,je]),S.useEffect(()=>{const Ae={open:B,nodeId:Y,parentNodeId:ne,reason:T.select("lastOpenChangeReason")};E.events.emit("menuopenchange",Ae)},[E.events,B,T,Y,ne]),Se(()=>{const Ae=z,Pe=U.current;if(Ae&&(U.current=Ae),Pe&&Ae&&Ae!==Pe){T.set("instantType",void 0);const bt=new AbortController;return J(()=>{T.set("instantType","trigger-change")},bt.signal),()=>{bt.abort()}}},[z,J,T]);const Oe={open:B,side:Me.side,align:Me.align,anchorHidden:Me.anchorHidden,nested:N.type==="menu",instant:F},Fe=N.type==="menubar"&&N.context.modal;vB(B&&(Fe||I&&H!==pn),P==="touch",K,$);const Ee=oj(e,Oe,{styles:Me.positionerStyles,transitionStatus:W,props:_,refs:[n,T.useStateSetter("positionerElement")],hidden:!R,inert:!B}),Je=R&&N.type!=="menu"&&(N.type!=="menubar"&&I&&H!==pn||N.type==="menubar"&&N.context.modal);let _e=null;return N.type==="menubar"?_e=N.context.contentElement:N.type===void 0&&(_e=$),y.jsxs(bP.Provider,{value:Me,children:[Je&&y.jsx(nj,{ref:N.type==="context-menu"||N.type==="nested-context-menu"?N.context.internalBackdropRef:null,inert:wb(!B),cutout:_e}),y.jsx(GP,{id:Y,children:y.jsx(bB,{elementsRef:T.context.itemDomElements,labelsRef:T.context.itemLabels,children:Ee})})]})}),lV=S.createContext(null);function SB(t){return S.useContext(lV)}function cV(t){const e=S.useRef(""),n=S.useCallback(s=>{s.defaultPrevented||(e.current=s.pointerType,t(s,s.pointerType))},[t]);return{onClick:S.useCallback(s=>{if(s.detail===0){t(s,"keyboard");return}"pointerType"in s?t(s,s.pointerType):t(s,e.current),e.current=""},[t]),onPointerDown:n}}function jB(t,e){const n=De((i,r)=>{(typeof t=="function"?t():t)||e(r||(Qy?"touch":""))}),{onClick:o,onPointerDown:s}=cV(n);return S.useMemo(()=>({onClick:o,onPointerDown:s}),[o,s])}function uV(t){const[e,n]=S.useState(null),o=jB(t,n);return gP(t,s=>{s&&!t&&n(null)}),S.useMemo(()=>({openMethod:e,triggerProps:o}),[e,o])}const dV={...hb,disabled:t=>t.parent.type==="menubar"&&t.parent.context.disabled||t.disabled,modal:t=>(t.parent.type===void 0||t.parent.type==="context-menu")&&(t.modal??!0),openMethod:t=>t.openMethod,allowMouseEnter:t=>t.allowMouseEnter,highlightItemOnHover:t=>t.highlightItemOnHover,parent:t=>t.parent,rootId:t=>t.parent.type==="menu"?t.parent.store.select("rootId"):t.parent.type!==void 0?t.parent.context.rootId:t.rootId,activeIndex:t=>t.activeIndex,isActive:(t,e)=>t.activeIndex===e,hoverEnabled:t=>t.hoverEnabled,instantType:t=>t.instantType,lastOpenChangeReason:t=>t.openChangeReason,floatingTreeRoot:t=>t.parent.type==="menu"?t.parent.store.select("floatingTreeRoot"):t.floatingTreeRoot,floatingNodeId:t=>t.floatingNodeId,floatingParentNodeId:t=>t.floatingParentNodeId,itemProps:t=>t.itemProps,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin,keyboardEventRelay:t=>{if(t.keyboardEventRelay)return t.keyboardEventRelay;if(t.parent.type==="menu")return t.parent.store.select("keyboardEventRelay")}};class fV extends Gu{constructor(e,n,o=!1){const s=new db,i=pV(s,n,o,e);super(i,hV(s),dV),this.unsubscribeParentListener=this.observe("parent",r=>{if(this.unsubscribeParentListener?.(),r.type==="menu"){let l=r.store.select("rootId"),u=r.store.select("floatingTreeRoot"),d=r.store.select("keyboardEventRelay");this.unsubscribeParentListener=r.store.subscribe(()=>{const h=r.store.select("rootId"),p=r.store.select("floatingTreeRoot"),g=r.store.select("keyboardEventRelay");l===h&&u===p&&d===g||(l=h,u=p,d=g,this.notifyAll())}),this.context.allowMouseUpTriggerRef=r.store.context.allowMouseUpTriggerRef;return}r.type!==void 0&&(this.context.allowMouseUpTriggerRef=r.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:n})}unsubscribeParentListener=null}function hV(t){return{positionerRef:S.createRef(),popupRef:S.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),onOpenChangeComplete:void 0,triggerElements:t}}function pV(t,e,n=!1,o){return{...fb(t,e,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new zS,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:nn,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...o}}const CB=S.createContext(void 0);function TB(){return S.useContext(CB)}const EB=Hh(function(e){const{children:n,open:o,onOpenChange:s,onOpenChangeComplete:i,defaultOpen:r=!1,disabled:l=!1,modal:u,loopFocus:d=!0,orientation:h="vertical",actionsRef:p,closeParentOnEsc:g=!1,handle:b,triggerId:w,defaultTriggerId:k=null,highlightItemOnHover:j=!0}=e,C=SS(!0),_=Ha(!0),T=SB(!0),M=TB(),O=S.useMemo(()=>M&&_?{type:"menu",store:_.store}:T?{type:"menubar",context:T}:C&&!_?{type:"context-menu",context:C}:{type:void 0},[C,_,T,M]),N=Ul(),D=Ul(),E=Zl(),R=O.type==="menu"?O.store:void 0,B=(o??r)&&R?.state.transitionStatus==="starting",I=qn(()=>B?R?.state.instantType:void 0).current,P=mV({open:r,openProp:o,activeTriggerId:k,triggerIdProp:w,parent:O,disabled:l,highlightItemOnHover:j,modal:O.type===void 0?u:void 0,rootId:N,instantType:I},D,E!=null);P.useControlledProp("openProp",o),P.useControlledProp("triggerIdProp",w),P.useContextCallback("onOpenChangeComplete",i);const $=P.useState("floatingTreeRoot"),W=IS($),K=P.useState("open"),F=P.useState("activeTriggerElement"),q=P.useState("positionerElement"),H=P.useState("hoverEnabled"),Y=P.useState("disabled"),ne=P.useState("lastOpenChangeReason"),z=P.useState("parent"),U=P.useState("activeIndex"),J=P.useState("payload"),X=P.useState("floatingParentNodeId"),oe=S.useRef(null),ie=S.useRef(z.type!=="context-menu"),be=co(),ce=S.useRef(!0),ye=co(),Ce=X!=null,{openMethod:Ve,triggerProps:Me}=uV(K);P.useSyncedValues({disabled:l,highlightItemOnHover:j,modal:z.type===void 0?u:void 0,openMethod:Ve,rootId:N}),lb(P);const{forceUnmount:je,transitionStatus:Oe}=cb(K,P,()=>{P.set("allowMouseEnter",!1)},B),Fe=Gy(P.context.popupRef);S.useEffect(()=>{if(I===void 0)return;const Te=()=>{P.state.instantType===I&&P.set("instantType",void 0)};if(!K){Te();return}if(Oe!==void 0)return;if(P.context.popupRef.current==null){Te();return}const rt=new AbortController;return Fe(Te,rt.signal),()=>{rt.abort()}},[I,K,Oe,Fe,P]),Se(()=>{C&&!_?P.update({parent:{type:"context-menu",context:C},floatingNodeId:W,floatingParentNodeId:E}):_&&P.update({floatingNodeId:W,floatingParentNodeId:E})},[C,_,W,E,P]),S.useEffect(()=>{if(K||(oe.current=null),z.type==="context-menu"){if(!K){be.clear(),ie.current=!1;return}be.start(500,()=>{ie.current=!0})}},[be,K,z.type]),Se(()=>{!K&&!H&&P.set("hoverEnabled",!0)},[K,H,P]);const nt=De((Te,rt)=>{const _t=rt.reason;if(!Te&&!P.select("open")||K===Te&&rt.trigger===F&&ne===_t)return;const Jt=KS(rt);if(!Te&&rt.trigger==null&&(rt.trigger=F??void 0),s?.(Te,rt),rt.isCanceled)return;P.state.floatingRootContext.dispatchOpenChange(Te,rt);const ls=rt.event;if(Te===!1&&ls?.type==="click"&&ls.pointerType==="touch"&&!ce.current)return;Te&&_t===iu?(ce.current=!1,ye.start(300,()=>{ce.current=!0})):(ce.current=!0,ye.clear());const Bs=(_t===xr||_t===pP)&&ls.detail===0,cs=!Te&&(_t===$h||_t==null);oe.current=rt.event;const vn=ab(P.state,Te,rt.trigger,Jt());vn.openChangeReason=_t,z.type==="menubar"&&(_t===iu||_t===Vl||_t===pn||_t===qg||_t===pf)?vn.instantType="group":Bs||cs?vn.instantType=Bs?"click":"dismiss":vn.instantType=void 0,P.update(vn)}),Ee=aB({popupStore:P,floatingRootContext:P.state.floatingRootContext,floatingId:D,nested:E!=null,onOpenChange:nt}),Je=Ee.context.events;Se(()=>{const Te=({open:rt,eventDetails:_t})=>nt(rt,_t);return Je.on("setOpen",Te),()=>{Je?.off("setOpen",Te)}},[Je,nt]);const _e=S.useCallback(()=>{P.setOpen(!1,ft(Wy))},[P]);S.useImperativeHandle(p,()=>({unmount:je,close:_e}),[je,_e]);let Ae;z.type==="context-menu"&&(Ae=z.context),S.useImperativeHandle(Ae?.positionerRef,()=>q,[q]),S.useImperativeHandle(Ae?.actionsRef,()=>({setOpen:nt}),[nt]);const Pe=ob(Ee,{enabled:!Y,bubbles:{escapeKey:g&&z.type==="menu"},outsidePress(){return z.type!=="context-menu"||oe.current?.type==="contextmenu"?!0:ie.current},externalTree:Ce?$:void 0}),bt=ej(),Be=S.useCallback(Te=>{P.select("activeIndex")!==Te&&P.set("activeIndex",Te)},[P]),fe=O9(Ee,{enabled:!Y,listRef:P.context.itemDomElements,activeIndex:U,nested:z.type!==void 0,loopFocus:d,orientation:h,parentOrientation:z.type==="menubar"?z.context.orientation:void 0,rtl:bt==="rtl",disabledIndices:br,onNavigate:Be,openOnArrowKeyDown:z.type!=="context-menu",externalTree:Ce?$:void 0,focusItemOnHover:j}),xe=S.useCallback(Te=>{P.context.typingRef.current=Te},[P]),pe=A9(Ee,{enabled:!Y,listRef:P.context.itemLabels,elementsRef:P.context.itemDomElements,activeIndex:U,resetMs:lU,onMatch:Te=>{K&&Te!==U&&P.set("activeIndex",Te)},onTyping:xe}),re=S.useMemo(()=>{const Te=dr(pe.reference,fe.reference,Pe.reference,{onMouseMove(){P.set("allowMouseEnter",!0)}},Me);return Te["aria-haspopup"]="menu",Te["aria-expanded"]=K,Te},[P,pe.reference,fe.reference,Pe.reference,Me,K]),ve=S.useMemo(()=>{const Te=dr(fe.trigger,Pe.trigger,Me);return Te["aria-haspopup"]="menu",Te["aria-expanded"]=!1,Te},[fe.trigger,Pe.trigger,Me]);qn(()=>(P.update({inactiveTriggerProps:ve}),null));const Ze=S.useMemo(()=>dr(ib,{id:D,role:"menu","aria-orientation":h==="horizontal"?"horizontal":void 0,"aria-labelledby":F?.id,onMouseMove(){P.set("allowMouseEnter",!0),z.type==="menu"&&P.set("hoverEnabled",!1)},onClick(){P.select("hoverEnabled")&&P.set("hoverEnabled",!1)},onKeyDown(Te){const rt=P.select("keyboardEventRelay");rt&&!Te.isPropagationStopped()&&rt(Te)}},pe.floating,fe.floating,Pe.floating),[F,D,h,z.type,P,pe.floating,fe.floating,Pe.floating]),Ln=fe.item??nn;ub(P,{floatingRootContext:Ee,activeTriggerProps:re,inactiveTriggerProps:ve,popupProps:Ze,itemProps:Ln});const So=S.useMemo(()=>({store:P,parent:O}),[P,O]),dn=y.jsxs(wP.Provider,{value:So,children:[b&&y.jsx(rb,{handle:b,store:P}),typeof n=="function"?n({payload:J}):n]});return z.type===void 0||z.type==="context-menu"?y.jsx(XP,{externalTree:$,children:dn}):dn});function mV(t,e,n){return qn(()=>new fV(t,e,n)).current}function gV(t){const e=Ha().store,n=S.useMemo(()=>({parentMenu:e}),[e]);return y.jsx(CB.Provider,{value:n,children:y.jsx(EB,{...t})})}const Hm=5;function yV(t,e){const n=bV(e);return t.clientX>=n.left-Hm&&t.clientX<=n.right+Hm&&t.clientY>=n.top-Hm&&t.clientY<=n.bottom+Hm}function bV(t){const e=t.getBoundingClientRect(),n=on(t);if(CS)return e;const o=n.getComputedStyle(t,"::before"),s=n.getComputedStyle(t,"::after");if(!(o.content!=="none"||s.content!=="none"))return e;const r=parseFloat(o.width)||0,l=parseFloat(o.height)||0,u=parseFloat(s.width)||0,d=parseFloat(s.height)||0,h=Math.max(e.width,r,u),p=Math.max(e.height,l,d),g=h-e.width,b=p-e.height;return{left:e.left-g/2,right:e.right+g/2,top:e.top-b/2,bottom:e.bottom+b/2}}function wV(t={}){const{highlightItemOnHover:e,highlightedIndex:n,onHighlightedIndexChange:o}=yS(),{ref:s,index:i}=TS(t),r=n===i,l=S.useRef(null),u=Ra(s,l);return{compositeProps:{tabIndex:r?0:-1,onFocus(){o(i)},onMouseMove(){const h=l.current;if(!e||!h)return;const p=h.hasAttribute("disabled")||h.ariaDisabled==="true";!r&&!p&&h.focus()}},compositeRef:u,index:i}}function _B(t){const{render:e,className:n,style:o,state:s=nn,props:i=br,refs:r=br,metadata:l,stateAttributesMapping:u,tag:d="div",...h}=t,{compositeProps:p,compositeRef:g}=wV({metadata:l});return Ht(d,t,{state:s,ref:[g,...r],props:[p,...i,h],stateAttributesMapping:u})}function MB(t){if(Ft(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid");if(!ur(t))return MB(wr(t))}function OB(t,e){const n=S.useRef(null);function o(i){Os.flushSync(()=>{t.setOpen(!1,ft(Vl,i.nativeEvent,i.currentTarget))}),sU(n.current)?.focus()}function s(i){const r=t.select("positionerElement");if(r&&au(i,r))t.context.beforeContentFocusGuardRef.current?.focus();else{Os.flushSync(()=>{t.setOpen(!1,ft(Vl,i.nativeEvent,i.currentTarget))});let l=oU(t.context.triggerFocusTargetRef.current||e.current);for(;l!==null&&Ie(r,l);){const u=l;if(l=DS(l),l===u)break}l?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:o,handleFocusTargetFocus:s}}function xV(t){const{enabled:e=!0,mouseDownAction:n,open:o}=t,s=S.useRef(!1);return S.useMemo(()=>e?{onMouseDown:i=>{(n==="open"&&!o||n==="close"&&o)&&(s.current=!0,yt(i.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:i=>{s.current&&(s.current=!1,i.preventBaseUIHandler())}}:nn,[e,n,o])}const vV=US(function(e,n){const{render:o,className:s,style:i,disabled:r=!1,nativeButton:l=!0,id:u,openOnHover:d,delay:h=100,closeDelay:p=0,handle:g,payload:b,...w}=e,k=Ha(!0),C=GS(g)??k?.store;if(!C)throw new Error(gn(85));const _=ei(u),T=C.useState("isTriggerActive",_),M=C.useState("floatingRootContext"),O=C.useState("isOpenedByTrigger",_),N=C.useState("triggerPopupId",_),D=S.useRef(null),E=SV(),R=yS(!0),B=Ua(),I=S.useMemo(()=>B??new zS,[B]),P=IS(I),$=Zl(),{registerTrigger:W,isMountedByThisTrigger:K}=WS(_,D,C,{payload:b,closeDelay:p,parent:E,floatingTreeRoot:I,floatingNodeId:P,floatingParentNodeId:$,keyboardEventRelay:R?.relayKeyboardEvent}),F=E.type==="menubar",q=C.useState("disabled"),H=r||q||F&&E.context.disabled,{getButtonProps:Y,buttonRef:ne}=Fa({disabled:H,native:l});S.useEffect(()=>{!O&&E.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,O,E.type]);const z=S.useRef(null),U=co(),J=De(Ae=>{if(!z.current)return;U.clear(),C.context.allowMouseUpTriggerRef.current=!1;const Pe=Ae.target;Ie(z.current,Pe)||Ie(C.select("positionerElement"),Pe)||Pe===z.current||Pe!=null&&MB(Pe)===C.select("rootId")||yV(Ae,z.current)||I.events.emit("close",{domEvent:Ae,reason:r7})});S.useEffect(()=>{O&&C.select("lastOpenChangeReason")===pn&&yt(z.current).addEventListener("mouseup",J,{once:!0})},[O,J,C]);const X=F&&E.context.hasSubmenuOpen,ie=pb(M,{enabled:(d??X)&&!H&&(!F||X&&!K),handleClose:gb({blockPointerEvents:!F}),mouseOnly:!0,move:!1,restMs:E.type===void 0?h:void 0,delay:{close:p},triggerElementRef:D,externalTree:I,isActiveTrigger:T,isClosing:()=>C.select("transitionStatus")==="ending"}),be=kV(O,C.select("lastOpenChangeReason")),ce=FS(M,{enabled:!H,event:O&&F?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:E.type===void 0?be:!1}),ye=fB(M,{enabled:!H&&X}),Ce=xV({open:O,enabled:F,mouseDownAction:"open"}),Ve=S.useMemo(()=>dr(ye.reference,ce.reference),[ye.reference,ce.reference]),Me=C.useState("triggerProps",K),{preFocusGuardRef:je,handlePreFocusGuardFocus:Oe,handleFocusTargetFocus:Fe}=OB(C,D),nt={disabled:H,open:O},Ee=[z,n,ne,W,D],Je=[Ve,ie??nn,Me,{"aria-haspopup":"menu","aria-controls":N,id:_,onMouseDown:Ae=>{if(C.select("open"))return;U.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),yt(Ae.currentTarget).addEventListener("mouseup",J,{once:!0})}},F?{role:"menuitem"}:{},Ce,w,Y],_e=Ht("button",e,{enabled:!F,stateAttributesMapping:mk,state:nt,ref:Ee,props:Je});return F?y.jsx(_B,{tag:"button",render:o,className:s,style:i,state:nt,refs:Ee,props:Je,stateAttributesMapping:mk}):O?y.jsxs(S.Fragment,{children:[y.jsx(vr,{ref:je,onFocus:Oe},`${_}-pre-focus-guard`),y.jsx(S.Fragment,{children:_e},_),y.jsx(vr,{ref:C.context.triggerFocusTargetRef,onFocus:Fe},`${_}-post-focus-guard`)]}):y.jsx(S.Fragment,{children:_e},_)});function kV(t,e){const n=co(),[o,s]=S.useState(!1);return Se(()=>{t&&e===pn?(s(!0),n.start(FP,()=>{s(!1)})):t||(n.clear(),s(!1))},[t,e,n]),o}function SV(){const t=SB();return S.useMemo(()=>t?{type:"menubar",context:t}:{type:void 0},[t])}const jV=S.forwardRef(function(e,n){const{className:o,render:s,orientation:i="horizontal",style:r,...l}=e;return Ht("div",e,{state:{orientation:i},ref:n,props:[{role:"separator","aria-orientation":i},l]})});function CV(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}const TV={"aria-expanded":void 0},EV=S.forwardRef(function(e,n){const{render:o,className:s,style:i,label:r,id:l,nativeButton:u=!1,openOnHover:d=!0,delay:h=100,closeDelay:p=0,disabled:g=!1,...b}=e,w=TB();if(!w?.parentMenu)throw new Error(gn(37));const k=TS({guess:!0,label:r}),j=xS(),{store:C}=Ha(),_=ei(l),T=C.useState("open"),M=C.useState("floatingRootContext"),O=C.useState("floatingTreeRoot"),N=C.useState("triggerPopupId",_),D=cB(_,C),E=De(Ve=>{D(Ve),Ve!==null&&C.select("open")&&C.select("activeTriggerId")==null&&C.update({activeTriggerId:_??null,activeTriggerElement:Ve,closeDelay:p})}),R=S.useRef(null),B=S.useCallback(Ve=>{R.current=Ve,C.set("activeTriggerElement",Ve)},[C]);Se(()=>(E(R.current),()=>E(null)),[E,_,C]),C.useSyncedValue("closeDelay",p);const I=w.parentMenu,P=C.useState("disabled"),$=I.useState("disabled"),W=g||P||$,K=I.useState("itemProps"),F=I.useState("isActive",k.index),q=S.useMemo(()=>({type:"submenu-trigger",setActive(){I.select("highlightItemOnHover")&&I.set("activeIndex",k.index)}}),[I,k.index]),{getItemProps:H,itemRef:Y}=kP({closeOnClick:!1,disabled:W,highlighted:F,id:_,store:C,typingRef:I.context.typingRef,nativeButton:u,itemMetadata:q,nodeId:j?.context.nodeId}),ne=C.useState("hoverEnabled"),z=pb(M,{enabled:ne&&d&&!W,handleClose:gb({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:h,delay:{open:h,close:p},shouldOpen:h>0?()=>I.select("allowMouseEnter"):void 0,triggerElementRef:R,externalTree:O,isClosing:()=>C.select("transitionStatus")==="ending",guardStaleOpen:!0}),J=FS(M,{enabled:!W,event:"mousedown",toggle:!d,ignoreMouse:d,stickIfOpen:!1}).reference??nn,X=C.useState("triggerProps",!0);delete X.id;const oe={disabled:W,highlighted:F,open:T},ie=C.useState("openMethod"),ce=C.useState("lastOpenChangeReason")===qg||ie==="keyboard";return Ht("div",e,{state:oe,stateAttributesMapping:vS,props:[J,z,X,K,T&&ce&&vP?TV:void 0,{"aria-controls":N,tabIndex:T||F?0:-1,onBlur(){F&&I.set("activeIndex",null)}},b,H],ref:[n,k.ref,Y,E,B]})}),AB=S.createContext(void 0);function vb(t){const e=S.useContext(AB);if(e===void 0&&!t)throw new Error(gn(72));return e}const _V={...hb,disabled:t=>t.disabled,instantType:t=>t.instantType,isInstantPhase:t=>t.isInstantPhase,trackCursorAxis:t=>t.trackCursorAxis,disableHoverablePopup:t=>t.disableHoverablePopup,lastOpenChangeReason:t=>t.openChangeReason,closeOnClick:t=>t.closeOnClick,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class MV extends Gu{constructor(e,n,o){const s=new db;super(OV(e,s,n,o),AV(s),_V)}setOpen=(e,n)=>{k9(this,e,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,ft(xr,e))}}function OV(t,e,n,o=!1){return{...fb(e,n,o),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t}}function AV(t){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const RB=Hh(function(e){const{disabled:n=!1,defaultOpen:o=!1,open:s,disableHoverablePopup:i=!1,trackCursorAxis:r="none",actionsRef:l,onOpenChange:u,onOpenChangeComplete:d,handle:h,triggerId:p,defaultTriggerId:g=null,children:b}=e,w=VS((I,P)=>new MV({open:o,openProp:s,activeTriggerId:g,triggerIdProp:p},I,P));w.useControlledProp("openProp",s),w.useControlledProp("triggerIdProp",p),w.useContextCallback("onOpenChange",u),w.useContextCallback("onOpenChangeComplete",d);const k=w.useState("open"),j=!n&&k,C=w.useState("activeTriggerId"),_=w.useState("mounted"),T=w.useState("payload");w.useSyncedValues({trackCursorAxis:r,disableHoverablePopup:i,disabled:n}),lb(w,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:M,transitionStatus:O}=cb(j,w),N=w.useState("isInstantPhase"),D=w.useState("instantType"),E=w.useState("lastOpenChangeReason"),R=S.useRef(null);Se(()=>{k&&n&&w.setOpen(!1,ft(a7))},[k,n,w]),Se(()=>{O==="ending"&&E===Lh||O!=="ending"&&N?(D!=="delay"&&(R.current=D),w.set("instantType","delay")):R.current!==null&&(w.set("instantType",R.current),R.current=null)},[O,N,E,D,w]),Se(()=>{j&&C==null&&w.set("payload",void 0)},[w,C,j]),S.useImperativeHandle(l,()=>({unmount:M,close:()=>w.setOpen(!1,ft(Wy))}),[M,w]);const B=j||_||!n&&r!=="none";return y.jsxs(AB.Provider,{value:w,children:[h&&y.jsx(rb,{handle:h,store:w}),B&&y.jsx(RV,{store:w,disabled:n,trackCursorAxis:r}),typeof b=="function"?b({payload:T}):b]})});function RV({store:t,disabled:e,trackCursorAxis:n}){const o=t.useState("floatingRootContext"),s=ob(o,{enabled:!e,referencePress:()=>t.select("closeOnClick")}),i=xU(o,{enabled:!e&&n!=="none",axis:n==="none"?void 0:n}),r=S.useMemo(()=>dr(i.reference,s.reference),[i.reference,s.reference]);return ub(t,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s.floating??nn}),null}const NB=S.createContext(void 0);function NV(){return S.useContext(NB)}const DV=600,DB="data-base-ui-tooltip-trigger";function xA(t){if("composedPath"in t){const n=t.composedPath();for(let o=0;o<n.length;o+=1){const s=n[o];if(vt(s))return s}}const e=t.target;return vt(e)?e:null}function PV(t){let e=t;for(;e;){const n=e.closest(`[${DB}]`);if(n)return n;const o=e.getRootNode();e="host"in o&&vt(o.host)?o.host:null}return null}const PB=US(function(e,n){const{render:o,className:s,style:i,handle:r,payload:l,disabled:u,delay:d,closeOnClick:h=!0,closeDelay:p,id:g,...b}=e,w=vb(!0),j=GS(r)??w;if(!j)throw new Error(gn(82));const C=ei(g),_=j.useState("isTriggerActive",C),T=j.useState("isOpenedByTrigger",C),M=j.useState("floatingRootContext"),O=S.useRef(null),N=p??0,{registerTrigger:D,isMountedByThisTrigger:E}=WS(C,O,j,{payload:l,closeOnClick:h,closeDelay:N}),R=NV(),{activeIdRef:B,delayRef:I,isInstantPhase:P,hasProvider:$}=F7(M,{open:T}),W=JS(M);j.useSyncedValue("isInstantPhase",P);const K=j.useState("disabled"),F=u??K,q=Mn(F),H=j.useState("trackCursorAxis"),Y=j.useState("disableHoverablePopup"),ne=S.useRef(!1),z=co(),U=S.useRef(void 0);function J(){return $&&B.current!=null?0:d??R??DV}function X(je){const Oe=O.current;if(!Oe||!je)return!1;const Fe=PV(je);return Fe!==null&&Fe!==Oe&&Ie(Oe,Fe)}function oe(je){const Oe=X(je);return ne.current=Oe,Oe&&(W.openChangeTimeout.clear(),W.restTimeout.clear(),W.restTimeoutPending=!1,z.clear()),Oe}const ie=pb(M,{enabled:!F,mouseOnly:!0,move:!1,handleClose:!Y&&H!=="both"?gb():null,restMs:J,delay(){return p==null&&$?{close:Kl(I.current,"close")}:{close:N}},triggerElementRef:O,isActiveTrigger:_,isClosing:()=>j.select("transitionStatus")==="ending",shouldOpen(){return!ne.current}}),be=fB(M,{enabled:!F}).reference,ce=je=>{const Oe=ne.current,Fe=xA(je),nt=oe(Fe),Ee=O.current,Je=Ee&&Fe&&Ie(Ee,Fe);if(nt&&j.select("open")&&j.select("lastOpenChangeReason")===pn){j.setOpen(!1,ft(pn,je));return}if(Oe&&!nt&&Je&&!q.current&&!j.select("open")&&Ee&&Sa(U.current)){const _e=()=>{!ne.current&&!q.current&&!j.select("open")&&j.setOpen(!0,ft(pn,je,Ee))},Ae=J();Ae===0?(z.clear(),_e()):z.start(Ae,_e)}},ye=j.useState("triggerProps",E);return Ht("button",e,{state:{open:T},ref:[n,D,O],props:[ie,be,E||H!=="none"?ye:void 0,{onMouseOver(je){ce(je.nativeEvent)},onFocus(je){X(xA(je.nativeEvent))&&je.preventBaseUIHandler()},onMouseLeave(){ne.current=!1,z.clear(),U.current=void 0},onPointerEnter(je){U.current=je.pointerType},onPointerDown(je){U.current=je.pointerType,j.set("closeOnClick",h),h&&!j.select("open")&&j.cancelPendingOpen(je.nativeEvent)},onClick(je){h&&!j.select("open")&&j.cancelPendingOpen(je.nativeEvent)},id:C,[bk]:F?"":void 0,[DB]:F?void 0:""},b],stateAttributesMapping:vS})}),BB=S.createContext(void 0);function BV(){const t=S.useContext(BB);if(t===void 0)throw new Error(gn(70));return t}const zB=S.forwardRef(function(e,n){const{children:o,container:s,className:i,render:r,style:l,...u}=e,{node:d,subtree:h}=VP({container:s,ref:n,componentProps:e,elementProps:u});return!h&&!d?null:y.jsxs(S.Fragment,{children:[h,d&&Os.createPortal(o,d)]})}),IB=S.forwardRef(function(e,n){const{keepMounted:o=!1,...s}=e;return vb().useState("mounted")||o?y.jsx(BB.Provider,{value:o,children:y.jsx(zB,{ref:n,...s})}):null}),LB=S.createContext(void 0);function zV(){const t=S.useContext(LB);if(t===void 0)throw new Error(gn(71));return t}const $B=S.forwardRef(function(e,n){const{render:o,className:s,anchor:i,positionMethod:r="absolute",side:l="top",align:u="center",sideOffset:d=0,alignOffset:h=0,collisionBoundary:p="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:w=!1,disableAnchorTracking:k=!1,collisionAvoidance:j=PS,style:C,..._}=e,T=vb(),M=BV(),O=T.useState("open"),N=T.useState("mounted"),D=T.useState("trackCursorAxis"),E=T.useState("disableHoverablePopup"),R=T.useState("floatingRootContext"),B=T.useState("instantType"),I=T.useState("transitionStatus"),P=T.useState("adaptiveOrigin"),$=tj({anchor:i,positionMethod:r,floatingRootContext:R,mounted:N,side:l,sideOffset:d,align:u,alignOffset:h,collisionBoundary:p,collisionPadding:g,sticky:w,arrowPadding:b,disableAnchorTracking:k,keepMounted:M,collisionAvoidance:j,adaptiveOrigin:P}),W=S.useMemo(()=>({open:O,side:$.side,align:$.align,anchorHidden:$.anchorHidden,instant:D!=="none"?"tracking-cursor":B}),[O,$.side,$.align,$.anchorHidden,D,B]),K=oj(e,W,{styles:$.positionerStyles,transitionStatus:I,props:_,refs:[n,T.useStateSetter("positionerElement")],hidden:!N,inert:!O||D==="both"||E});return y.jsx(LB.Provider,{value:$,children:K})}),FB=S.forwardRef(function(e,n){const{render:o,className:s,style:i,...r}=e,l=vb(),{side:u,align:d}=zV(),h=l.useState("open"),p=l.useState("instantType"),g=l.useState("transitionStatus"),b=l.useState("popupProps"),w=l.useState("floatingRootContext"),k=l.useState("disabled"),j=l.useState("closeDelay");Yu({open:h,ref:l.context.popupRef,onComplete(){h&&l.context.onOpenChangeComplete?.(!0)}}),QS(w,{enabled:!k,closeDelay:j});const C=l.useStateSetter("popupElement");return Ht("div",e,{state:{open:h,side:u,align:d,instant:p,transitionStatus:g},ref:[n,l.context.popupRef,C],props:[ib,b,bb(g),r],stateAttributesMapping:Xy})}),HB=function(e){const{delay:n,closeDelay:o,timeout:s=400}=e,i=S.useMemo(()=>({open:n,close:o}),[n,o]);return y.jsx(NB.Provider,{value:n,children:y.jsx($7,{delay:i,timeoutMs:s,children:e.children})})};function qB(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=qB(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function IV(){for(var t,e,n=0,o="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=qB(t))&&(o&&(o+=" "),o+=e);return o}const LV=t=>t?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function $V(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:LV(t),size:24,node:e,...n.length>0?{aliases:n}:{}}}const FV=t=>{let e="",n=!1;for(const o of t){if(o==="-"||o==="_"||o<=" "){n=e.length>0;continue}e.length===0?e+=o.toLowerCase():e+=n?o.toUpperCase():o,n=!1}return e};const HV=t=>{const e=FV(t);return e.charAt(0).toUpperCase()+e.slice(1)};const Nk=(...t)=>t.filter((e,n,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===n).join(" ").trim();const ml={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function K0(t){return t!=null}function qV(t,e={}){const n=e.attributeNames??{},o=g=>n[g]??g,s=t.size??t.width??ml.width,i=t.size??t.height??ml.height,r=t.aliases?.filter(g=>typeof g=="string"&&g.trim()!=="").map(g=>`lucide-${g}`)??[],l=[...t.name?[`lucide-${t.name}`]:[],...r],u=e.className?.split(" ").filter(Boolean)??[],d=e.includeDefaultClasses===!1?Nk(...u):Nk("lucide",...l,...u),h=e.absoluteStrokeWidth?Number(e.strokeWidth??ml["stroke-width"])*Number(t.size??t.width??ml.width)/Number(e.size??e.width??ml.width):e.strokeWidth??ml["stroke-width"];return["svg",{...Object.entries(ml).reduce((g,[b,w])=>(g[o(b)]=w,g),{}),..."color"in e&&e.color&&{[o("stroke")]:e.color},..."size"in e&&K0(e.size)&&{[o("width")]:e.size,[o("height")]:e.size},..."width"in e&&K0(e.width)&&{[o("width")]:e.width},..."height"in e&&K0(e.height)&&{[o("height")]:e.height},[o("stroke-width")]:h,...d&&{[o("class")]:d},[o("viewBox")]:`0 0 ${s} ${i}`,...e.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in e&&e.attributes},t.node.map(g=>{const[b,w,k]=g,j=e.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...w}:w;return k?[b,j,k]:[b,j]})]}function UV(t,e={}){return qV(t,{...e,attributeNames:{...e.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const VV=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},KV=S.createContext({}),WV=()=>S.useContext(KV),YV=S.forwardRef(({color:t,size:e,width:n,height:o,strokeWidth:s,absoluteStrokeWidth:i,nonScalingStroke:r,className:l="",children:u,iconNode:d=[],icon:h={node:d,aliases:[],size:24},...p},g)=>{const{size:b=24,strokeWidth:w=2,absoluteStrokeWidth:k=!1,nonScalingStroke:j=!1,color:C="currentColor",className:_=""}=WV()??{},T=!!u||VV(p),[M,O,N=[]]=UV(h,{color:t??C,width:n??e??b,height:o??e??b,strokeWidth:s??w,absoluteStrokeWidth:i??k,nonScalingStroke:r??j,className:Nk(_,l),hasA11yProp:T,attributes:p});return S.createElement(M,{ref:g,...O},[...N.map(([D,E])=>S.createElement(D,E)),...Array.isArray(u)?u:[u]])});function ge(t,e=[],n=[]){const o=typeof t=="string"?$V(t,e,n):t,s=S.forwardRef(({className:i,...r},l)=>S.createElement(YV,{ref:l,icon:o,className:i,...r}));return o.name&&(s.displayName=HV(o.name)),s}const UB={name:"archive-arrow-up",size:24,node:[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],aliases:["archive-restore"]};UB.node;const GV=ge(UB);const VB={name:"arrow-down-wide-narrow",size:24,node:[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],aliases:["sort-desc"]};VB.node;const XV=ge(VB);const KB={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};KB.node;const JV=ge(KB);const WB={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};WB.node;const YB=ge(WB);const GB={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};GB.node;const XB=ge(GB);const JB={name:"arrow-up-down",size:24,node:[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]};JB.node;const QB=ge(JB);const ZB={name:"arrow-up-narrow-wide",size:24,node:[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h4",key:"q8tih4"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h10",key:"jvxblo"}]],aliases:["sort-asc"]};ZB.node;const QV=ge(ZB);const ez={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};ez.node;const sj=ge(ez);const tz={name:"between-horizontal-end",size:24,node:[["rect",{width:"13",height:"7",x:"3",y:"3",rx:"1",key:"11xb64"}],["path",{d:"m22 15-3-3 3-3",key:"26chmm"}],["rect",{width:"13",height:"7",x:"3",y:"14",rx:"1",key:"k6ky7n"}]],aliases:["between-horizonal-end"]};tz.node;const ZV=ge(tz);const nz={name:"between-horizontal-start",size:24,node:[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]],aliases:["between-horizonal-start"]};nz.node;const eK=ge(nz);const oz={name:"between-vertical-end",size:24,node:[["rect",{width:"7",height:"13",x:"3",y:"3",rx:"1",key:"1fdu0f"}],["path",{d:"m9 22 3-3 3 3",key:"17z65a"}],["rect",{width:"7",height:"13",x:"14",y:"3",rx:"1",key:"1squn4"}]]};oz.node;const tK=ge(oz);const sz={name:"between-vertical-start",size:24,node:[["rect",{width:"7",height:"13",x:"3",y:"8",rx:"1",key:"1fjrkv"}],["path",{d:"m15 2-3 3-3-3",key:"1uh6eb"}],["rect",{width:"7",height:"13",x:"14",y:"8",rx:"1",key:"w3fjg8"}]]};sz.node;const nK=ge(sz);const iz={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};iz.node;const kb=ge(iz);const rz={name:"calendar-days",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M12 13h.01",key:"y0uutt"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M8 17h.01",key:"p3bg7i"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M16 17h.01",key:"ql8jdd"}]]};rz.node;const oK=ge(rz);const az={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};az.node;const Va=ge(az);const lz={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};lz.node;const Ps=ge(lz);const cz={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};cz.node;const sK=ge(cz);const uz={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};uz.node;const qh=ge(uz);const dz={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};dz.node;const ij=ge(dz);const fz={name:"chevrons-down-up",size:24,node:[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]};fz.node;const iK=ge(fz);const hz={name:"chevrons-up-down",size:24,node:[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]};hz.node;const rK=ge(hz);const pz={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};pz.node;const mz=ge(pz);const gz={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};gz.node;const aK=ge(gz);const yz={name:"code",size:24,node:[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]};yz.node;const lK=ge(yz);const bz={name:"copy-plus",size:24,node:[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};bz.node;const cK=ge(bz);const wz={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};wz.node;const Sb=ge(wz);const xz={name:"crop",size:24,node:[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]]};xz.node;const uK=ge(xz);const vz={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};vz.node;const dK=ge(vz);const kz={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};kz.node;const Xu=ge(kz);const Sz={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};Sz.node;const fK=ge(Sz);const jz={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};jz.node;const hK=ge(jz);const Cz={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};Cz.node;const Tz=ge(Cz);const Ez={name:"face-slightly-smiling-plus",size:24,node:[["path",{d:"M13.267 2.08a10 10 0 108.653 8.653",key:"1wbpyh"}],["path",{d:"M15 10V9",key:"4dkmfx"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M16.472 15a6 6 0 01-8.943 0",key:"7qomzy"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M9 10V9",key:"1lazqi"}]],aliases:["smile-plus"]};Ez.node;const _z=ge(Ez);const Mz={name:"file-text",size:24,node:[["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",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};Mz.node;const pK=ge(Mz);const Oz={name:"file-up",size:24,node:[["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",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]};Oz.node;const mK=ge(Oz);const Az={name:"fold-horizontal",size:24,node:[["path",{d:"M2 12h6",key:"1wqiqv"}],["path",{d:"M22 12h-6",key:"1eg9hc"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 9-3 3 3 3",key:"12ol22"}],["path",{d:"m5 15 3-3-3-3",key:"1kdhjc"}]]};Az.node;const gK=ge(Az);const Rz={name:"grip-horizontal",size:24,node:[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]};Rz.node;const yK=ge(Rz);const Nz={name:"grip-vertical",size:24,node:[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]};Nz.node;const rj=ge(Nz);const Dz={name:"hash",size:24,node:[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]};Dz.node;const bK=ge(Dz);const Pz={name:"heading-1",size:24,node:[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]};Pz.node;const wK=ge(Pz);const Bz={name:"heading-2",size:24,node:[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]};Bz.node;const xK=ge(Bz);const zz={name:"heading-3",size:24,node:[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]};zz.node;const vK=ge(zz);const Iz={name:"highlighter",size:24,node:[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]]};Iz.node;const kK=ge(Iz);const Lz={name:"image-plus",size:24,node:[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]};Lz.node;const SK=ge(Lz);const $z={name:"image-up",size:24,node:[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19.5 3-3 3 3",key:"9vmjn0"}],["path",{d:"M17 22v-5.5",key:"1aa6fl"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]};$z.node;const jK=ge($z);const Fz={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};Fz.node;const CK=ge(Fz);const Hz={name:"italic",size:24,node:[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]};Hz.node;const TK=ge(Hz);const qz={name:"keyboard",size:24,node:[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]};qz.node;const EK=ge(qz);const Uz={name:"letter-b",size:24,node:[["path",{d:"M6 12h9a4 4 0 010 8H7a1 1 0 01-1-1V5a1 1 0 011-1h7a4 4 0 010 8",key:"n8tvfh"}]],aliases:["bold"]};Uz.node;const _K=ge(Uz);const Vz={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};Vz.node;const MK=ge(Vz);const Kz={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};Kz.node;const OK=ge(Kz);const Wz={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};Wz.node;const Uh=ge(Wz);const Yz={name:"list-indent-decrease",size:24,node:[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m7 8-4 4 4 4",key:"o5hrat"}]],aliases:["outdent","indent-decrease"]};Yz.node;const AK=ge(Yz);const Gz={name:"list-indent-increase",size:24,node:[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m3 8 4 4-4 4",key:"1a3j6y"}]],aliases:["indent","indent-increase"]};Gz.node;const RK=ge(Gz);const Xz={name:"list-ordered",size:24,node:[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]};Xz.node;const Jz=ge(Xz);const Qz={name:"list-todo",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]};Qz.node;const NK=ge(Qz);const Zz={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};Zz.node;const aj=ge(Zz);const eI={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};eI.node;const tI=ge(eI);const nI={name:"lock-open",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],aliases:["unlock"]};nI.node;const DK=ge(nI);const oI={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};oI.node;const lj=ge(oI);const sI={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};sI.node;const PK=ge(sI);const iI={name:"message-square-off",size:24,node:[["path",{d:"M19 19H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.7.7 0 0 1 2 21.286V5a2 2 0 0 1 1.184-1.826",key:"1wyg69"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.656 3H20a2 2 0 0 1 2 2v11.344",key:"mhl4k6"}]]};iI.node;const BK=ge(iI);const rI={name:"message-square-plus",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]]};rI.node;const zK=ge(rI);const aI={name:"message-square-reply",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"m10 8-3 3 3 3",key:"fp6dz7"}],["path",{d:"M17 14v-1a2 2 0 0 0-2-2H7",key:"1tkjnz"}]]};aI.node;const IK=ge(aI);const lI={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};lI.node;const cj=ge(lI);const cI={name:"messages-square",size:24,node:[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]};cI.node;const LK=ge(cI);const uI={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};uI.node;const dI=ge(uI);const fI={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};fI.node;const $K=ge(fI);const hI={name:"panel-top",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]]};hI.node;const FK=ge(hI);const pI={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};pI.node;const vA=ge(pI);const mI={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};mI.node;const Xf=ge(mI);const gI={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};gI.node;const Ju=ge(gI);const yI={name:"rotate-ccw-clock",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],aliases:["history"]};yI.node;const uj=ge(yI);const bI={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};bI.node;const HK=ge(bI);const wI={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};wI.node;const qK=ge(wI);const xI={name:"separator-horizontal",size:24,node:[["path",{d:"m16 16-4 4-4-4",key:"3dv8je"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"m8 8 4-4 4 4",key:"2bscm2"}]]};xI.node;const UK=ge(xI);const vI={name:"sparkles",size:24,node:[["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",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};vI.node;const VK=ge(vI);const kI={name:"square-chevron-down",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]],aliases:["chevron-down-square"]};kI.node;const KK=ge(kI);const SI={name:"square-code",size:24,node:[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],aliases:["code-square"]};SI.node;const WK=ge(SI);const jI={name:"strikethrough",size:24,node:[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]};jI.node;const YK=ge(jI);const CI={name:"table-2",size:24,node:[["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]};CI.node;const TI=ge(CI);const EI={name:"table-cells-merge",size:24,node:[["path",{d:"M12 21v-6",key:"lihzve"}],["path",{d:"M12 9V3",key:"da5inc"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M3 9h18",key:"1pudct"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};EI.node;const GK=ge(EI);const _I={name:"table-cells-split",size:24,node:[["path",{d:"M12 15V9",key:"8c7uyn"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M3 9h18",key:"1pudct"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};_I.node;const XK=ge(_I);const MI={name:"text-align-center",size:24,node:[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],aliases:["align-center"]};MI.node;const JK=ge(MI);const OI={name:"text-align-end",size:24,node:[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],aliases:["align-right"]};OI.node;const QK=ge(OI);const AI={name:"text-align-start",size:24,node:[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],aliases:["text","align-left"]};AI.node;const ZK=ge(AI);const RI={name:"text-quote",size:24,node:[["path",{d:"M17 5H3",key:"1cn7zz"}],["path",{d:"M21 12H8",key:"scolzb"}],["path",{d:"M21 19H8",key:"13qgcb"}],["path",{d:"M3 12v7",key:"1ri8j3"}]]};RI.node;const eW=ge(RI);const NI={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};NI.node;const dj=ge(NI);const DI={name:"type",size:24,node:[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]};DI.node;const PI=ge(DI);const BI={name:"underline",size:24,node:[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]};BI.node;const tW=ge(BI);const zI={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};zI.node;const nW=ge(zI);const II={name:"unfold-horizontal",size:24,node:[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]]};II.node;const fj=ge(II);const LI={name:"unlink",size:24,node:[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]};LI.node;const oW=ge(LI);const $I={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};$I.node;const FI=ge($I);const HI={name:"wifi-off",size:24,node:[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};HI.node;const sW=ge(HI);const qI={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};qI.node;const As=ge(qI);S.createContext({container:null,dark:!1});S.createContext({expanded:!1});S.createContext(!1);S.createContext(null);S.createContext("float");S.createContext(!1);const kA=new Set;function SA(){const t=kA.size>0;for(const e of[...kA])e();return t}const iW=["keydown","keyup","keypress","pointerdown","pointerup","pointermove","mousedown","mousemove","touchstart","touchend","touchmove","wheel","paste","copy","cut","contextmenu","dblclick","compositionstart","compositionupdate","compositionend"],jA=["click","auxclick","input","change","beforeinput","focusin","focusout"],W0=["clientX","clientY","screenX","screenY","button","buttons","ctrlKey","shiftKey","altKey","metaKey","movementX","movementY","detail"],rW=["pointerId","pointerType","isPrimary","width","height","pressure","tangentialPressure","tiltX","tiltY","twist"],aW=["key","code","location","repeat","isComposing","ctrlKey","shiftKey","altKey","metaKey","keyCode","charCode","which"],lW=["deltaX","deltaY","deltaZ","deltaMode"],cW=["ctrlKey","shiftKey","altKey","metaKey"];function gl(t,e){const n={};for(const o of e)n[o]=t[o];return n}function uW(t,e){const n={bubbles:!0,cancelable:t.cancelable,composed:!1,view:e};return e.PointerEvent&&t instanceof e.PointerEvent?new e.PointerEvent(t.type,{...n,...gl(t,W0),...gl(t,rW)}):e.WheelEvent&&t instanceof e.WheelEvent?new e.WheelEvent(t.type,{...n,...gl(t,W0),...gl(t,lW)}):t instanceof e.MouseEvent?new e.MouseEvent(t.type,{...n,...gl(t,W0)}):t instanceof e.KeyboardEvent?new e.KeyboardEvent(t.type,{...n,...gl(t,aW)}):e.TouchEvent&&t instanceof e.TouchEvent?new e.TouchEvent(t.type,{...n,...gl(t,cW),touches:[...t.touches],targetTouches:[...t.targetTouches],changedTouches:[...t.changedTouches]}):e.ClipboardEvent&&t instanceof e.ClipboardEvent?new e.ClipboardEvent(t.type,{...n,clipboardData:t.clipboardData}):t instanceof e.CompositionEvent?new e.CompositionEvent(t.type,{...n,data:t.data}):null}function dW(t,e={}){const n=new Set,o=s=>s.stopPropagation();for(const s of iW)t.addEventListener(s,i=>{const r=i.composedPath(),l=r.some(h=>n.has(h));if(s==="pointerdown"&&e.onPointerDown?.(l,i),!l)return;i.stopImmediatePropagation();const u=r[0],d=uW(i,t);!d||!u||(u.dispatchEvent(d),d.defaultPrevented&&i.cancelable&&i.preventDefault())},{capture:!0,passive:!1});return{addHost(s){n.add(s);for(const i of jA)s.addEventListener(i,o);return()=>{n.delete(s);for(const i of jA)s.removeEventListener(i,o)}}}}S.createContext(!1);let CA=null;function fW(t){return CA??=dW(t,{onPointerDown(e,n){if(!e){SA();return}const o=n.composedPath()[0];(!(o instanceof t.Element)||!o.closest("[data-cds=Menu], [data-popup-open]"))&&SA()}}),CA}typeof window<"u"&&typeof document<"u"&&fW(window);const TA=t=>{let e;const n=new Set,o=(d,h)=>{const p=typeof d=="function"?d(e):d;if(!Object.is(p,e)){const g=e;e=h??(typeof p!="object"||p===null)?p:Object.assign({},e,p),n.forEach(b=>b(e,g))}},s=()=>e,l={setState:o,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=e=t(o,s,l);return l},hW=(t=>t?TA(t):TA),pW=t=>t;function mW(t,e=pW){const n=ou.useSyncExternalStore(t.subscribe,ou.useCallback(()=>e(t.getState()),[t,e]),ou.useCallback(()=>e(t.getInitialState()),[t,e]));return ou.useDebugValue(n),n}const EA=t=>{const e=hW(t),n=o=>mW(e,o);return Object.assign(n,e),n},qt=(t=>t?EA(t):EA),cu=4e3;function gW(t,e){return e?t.map(n=>n.id===e.id?UI(n,e.status):n):t}function UI(t,e,n){if(t.status===e&&t.resolvedBy===n)return t;const{resolvedBy:o,...s}=t;return e==="resolved"&&n?{...s,status:e,resolvedBy:n}:{...s,status:e}}function yW(t){return t.wakesIdle===!1?`${t.name} gets this on its next turn: send it a message to start one`:"Waiting for the agent"}function _A(t,e){return e===!1?{title:`Sent to ${t}`,description:`${t} gets it on its next turn. If it is idle, send it a message there to start one.`}:{title:`Sent to ${t}`}}function VI(t){return t.filter(e=>e.status==="open").length}function bW(t){return t==="detached"?"What this was on is gone; shown on what held it.":t==="orphaned"?"What this was on has been deleted.":null}function wW(t){const e=t.maxThreads??500,n=t.noun??"document",o=T=>t.notify?.(T);let s=null,i,r=0;const l=qt()(T=>({available:!1,threads:[],on:!1,listOpen:!1,active:null,draft:null,showResolved:!1,sendNew:!1,draftText:"",replies:{},statusChange:null,setOn(M){T({on:M,draft:null}),t.onModeChange?.(M)},setListOpen(M){T({listOpen:M})},setActive(M){T({active:M,draft:null})},setDraft(M){T(M===null?{draft:M,active:null,draftText:"",sendNew:!1}:{draft:M,active:null})},setShowResolved(M){T({showResolved:M})},setSendNew(M){T({sendNew:M})},setDraftText(M){T({draftText:M})},setReply(M,O){T(N=>({replies:{...N.replies,[M]:O}}))}})),u=new Map,d=T=>{let M=u.get(T.anchor);return M===void 0&&(M=t.parse(T.anchor),u.size>2e3&&u.clear(),u.set(T.anchor,M)),M};let h=[];const p=(T,M)=>{h=T;const O=M&&"statusChange"in M?M.statusChange??null:l.getState().statusChange;l.setState({...M,threads:gW(T,O)})},g=T=>{o({title:"The comment could not be saved",description:T instanceof Error?T.message:String(T)})},b=T=>{p(h.map(M=>M.id===T.id?T:M)),t.heard?.([T])},w=T=>t.checkText?t.checkText(T):T.trim().slice(0,cu)||void 0,k=()=>!!s&&t.canComment(),j=()=>!!s&&t.canSendToAgent(),_={store:l,adapter:t,async start(T,M){if(!T)return;s=T;const O=r;l.setState({available:!0});try{const D=await T.list();if(O!==r)return;p(D),t.heard?.(D)}catch{}if(O!==r)return;i=T.onChange(D=>{const E=l.getState().active;p(D,{active:E&&D.some(R=>R.id===E)?E:null}),t.heard?.(D)});const N=M?l.getState().threads.find(D=>D.id===M):void 0;N&&_.reveal(N)},stop(){r+=1,i?.(),i=void 0},capability:()=>s,canComment:k,canSendToAgent:j,canRemove:()=>!!s&&(t.canRemove?t.canRemove():t.canComment()),anchorOf:d,labelOf:T=>t.label(T),stateOf:T=>t.state?.(T)??"ok",stateNote:T=>t.stateNote?t.stateNote(T??"ok"):bW(T),async create(T,M,O){if(!s)return!1;const N=w(M);if(!N)return!1;if(l.getState().threads.length>=e)return o({title:`This ${n} already has ${e} comments`}),!1;try{const D=t.detail?.(T),E=await s.create({anchor:t.serialize(T),label:t.label(T),...D!==void 0?{detail:D}:{},location:t.location?.(T)??{},text:N}),R=!!O?.send&&j();return p(h.some(B=>B.id===E.id)?h:[...h,E],{draft:null,draftText:"",sendNew:!1,active:t.opensCreated?.(R)===!1?null:E.id}),t.heard?.([E]),R&&await _.sendToAgent(E.id),!0}catch(D){return g(D),!1}},async reply(T,M,O){if(!s)return!1;const N=w(M);if(!N)return!1;try{let D=await s.reply(T,N);return D.status==="resolved"&&(D=await s.setResolved(T,!1)),b(D),l.setState(E=>{const{[T]:R,...B}=E.replies;return{replies:B}}),O?.send&&j()&&await _.sendToAgent(T),!0}catch(D){return g(D),!1}},async resolve(T,M){if(!s)return;const O=l.getState(),N=M?"resolved":"open",D=O.threads.find(R=>R.id===T);if(!D||O.statusChange||D.status===N)return;const E=M&&O.active===T&&!O.showResolved;p(h,{statusChange:{id:T,status:N},...E?{active:null}:{}});try{const R=await s.setResolved(T,M);p(h.map(B=>B.id===T?UI(B,R.status,R.resolvedBy):B),{statusChange:null}),t.heard?.([R])}catch(R){p(h,{statusChange:null}),g(R);const B=l.getState();E&&B.active===null&&B.draft===null&&h.some(I=>I.id===T)&&l.setState({active:T})}},async remove(T,M){if(!(!s||t.canRemove&&!t.canRemove()))try{await s.remove(T,M),M||p(h.filter(O=>O.id!==T),{active:l.getState().active===T?null:l.getState().active})}catch(O){g(O)}},async move(T,M){if(s)try{b(await s.move(T,t.serialize(M),t.location?.(M)))}catch(O){g(O)}},async sendToAgent(T){if(!s||!j())return!1;const M=t.sendToAgent?l.getState().threads.find(O=>O.id===T):void 0;if(t.sendToAgent)return M?t.sendToAgent(M,d(M)):!1;try{return b(await s.sendToAgent(T)),o(_A(t.agentName?.()||"the agent",t.agentWakesIdle?.())),!0}catch(O){return g(O),!1}},async sendAllToAgent(){if(!s||!j())return;const T=l.getState().threads.filter(E=>_.canSendThread(E));if(!T.length)return;if(t.sendToAgent){await Promise.all(T.map(E=>t.sendToAgent(E,d(E))));return}const M=s,O=await Promise.allSettled(T.map(E=>M.sendToAgent(E.id)));let N=0;for(const E of O)E.status==="fulfilled"&&(b(E.value),N++);N&&o(_A(t.agentName?.()||"the agent",t.agentWakesIdle?.()));const D=O.find(E=>E.status==="rejected");D&&g(D.reason)},canSendThread(T){if(T.status!=="open")return!1;const M=T.messages.at(-1);return!M||M.author.kind!=="person"?!1:!T.agent||T.agent.status==="replied"},reveal(T){t.reveal?.(d(T)),l.getState().setActive(T.id)},show(T){const M=l.getState();M.on||M.setOn(!0),T.status==="resolved"&&!l.getState().showResolved&&l.getState().setShowResolved(!0),_.reveal(T)},viewerName:()=>t.viewerName?.()||"You"};return _}function xW(){try{return/^zh\b/i.test(globalThis.navigator?.language??"")}catch{return!1}}function vW(t,e=xW()){const n=String(t??"").trim();return e?{sent:`已放进 ${n||"智能体"} 的对话:到那里发出去。`,via:"在对话里,等你发出",label:"在对话里,等你发出"}:{sent:`It is in the ${n||"agent"} conversation now: send it there.`,via:"in the conversation, for you to send",label:"In the conversation, for you to send"}}function kW(t,e,n){if(!t)return()=>{};let o=!1,s=!1;t.status().then(r=>{!o&&!s&&e(r)},()=>{});const i=t.onStatus(r=>{o||(s=!0,e(r))});return()=>{o=!0,i()}}const SW="<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><path d='M 2 26 L 2 14 A 12 12 0 1 1 14 26 Z' fill='#000' stroke='#fff' stroke-width='2'/></svg>";`${SW.replace(/[ '<>#]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())}`;function jW(t,e=Date.now()){const n=Math.max(0,(e-Date.parse(t))/1e3);return Number.isFinite(n)?n<60?"just now":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:new Date(t).toLocaleDateString():""}function He(...t){return IV(t)}function CW({label:t,shortcut:e,side:n="bottom",children:o}){return y.jsxs(RB,{children:[y.jsx(PB,{render:o}),y.jsx(IB,{children:y.jsx($B,{side:n,sideOffset:6,className:"z-[1000]",children:y.jsxs(FB,{className:"rounded-md bg-fg px-2 py-1 text-xs text-surface shadow-popup data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 transition-opacity",children:[t,e?y.jsx("span",{className:"ml-2 opacity-60",children:e}):null]})})})]})}function TW({children:t}){return y.jsx(HB,{delay:500,closeDelay:0,children:t})}function EW(t){return!!t.isComposing||t.keyCode===229}function _W(t){return t.repeat&&(t.key==="Enter"||t.key===" ")}function Dk(t){_W(t)&&t.target===t.currentTarget&&t.preventDefault()}function KI(t){return t?e=>{Dk(e),t(e)}:Dk}const MW=200,OW=2e3;function AW(t,e,n){let o=null,s=!1;const i=()=>{s||(s=!0,t.removeEventListener("keydown",r,!0),t.removeEventListener("keyup",r,!0),t.clearTimeout(l),o!==null&&t.clearTimeout(o))},r=u=>{const d=u.key==="Enter"||u.key===" ";if(u.type==="keyup"){u.key===" "&&!n(u.target)&&u.preventDefault(),u.key===e&&o===null&&(o=t.setTimeout(i,MW));return}d&&!n(u.target)&&(u.preventDefault(),u.stopImmediatePropagation())},l=t.setTimeout(i,OW);return t.addEventListener("keydown",r,!0),t.addEventListener("keyup",r,!0),i}const RW={primary:"bg-accent text-accent-fg hover:brightness-110 active:brightness-95",secondary:"bg-surface text-fg border border-line hover:bg-hover",ghost:"bg-transparent text-fg hover:bg-hover",danger:"bg-danger text-white hover:brightness-110"},NW={sm:"h-6 px-2 text-xs gap-1",md:"h-7 px-2.5 text-[13px] gap-1.5",lg:"h-8 px-3 text-[13px] gap-2"},Mt=S.forwardRef(function({variant:e="secondary",size:n="md",icon:o,className:s,children:i,type:r="button",onKeyDown:l,...u},d){return y.jsxs("button",{ref:d,type:r,className:He("inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-control font-medium transition-[background,filter]","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent","disabled:pointer-events-none disabled:opacity-45",RW[e],NW[n],s),...u,onKeyDown:KI(l),children:[o,i]})}),DW={sm:"size-6",md:"size-7",lg:"size-8"},PW=S.forwardRef(function({label:e,icon:n,shortcut:o,active:s,size:i="md",noTooltip:r,className:l,type:u="button",onKeyDown:d,...h},p){const g=y.jsx("button",{ref:p,type:u,"aria-label":e,"aria-pressed":s===void 0?void 0:s,className:He("inline-flex shrink-0 items-center justify-center rounded-control text-fg-muted transition-colors","hover:bg-hover hover:text-fg focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent","disabled:pointer-events-none disabled:opacity-40",s&&"bg-accent-soft text-accent hover:bg-accent-soft hover:text-accent",DW[i],l),...h,onKeyDown:KI(d),children:n});return r?g:y.jsx(CW,{label:e,shortcut:o,children:g})}),Pk=500,BW=8;function zW(t,e,n){return n<t.at||n-t.at>Pk?!1:Math.hypot(e.clientX-t.x,e.clientY-t.y)<=BW}const MA=["pointerdown","mousedown","pointerup","mouseup","click","dblclick"];function IW(t,e,n=Date.now){let o=!1,s=!1,i=0;const r=()=>{if(!s){s=!0,t.clearTimeout(i);for(const d of MA)t.removeEventListener(d,u,!0)}},l=()=>{o?i=t.setTimeout(l,Pk):r()},u=d=>{const h=d.type==="pointerdown"||d.type==="mousedown";!(o&&!h)&&!zW(e,d,n())||(d.preventDefault(),d.stopImmediatePropagation(),h?o=!0:(d.type==="click"||d.type==="dblclick")&&(o=!1))};for(const d of MA)t.addEventListener(d,u,!0);return i=t.setTimeout(l,Math.max(0,Pk-(n()-e.at))),r}function WI(t){t.detail<1||!t.view||IW(t.view,{x:t.clientX,y:t.clientY,at:Date.now()})}const YI=S.createContext(void 0);function ec(t){const e=S.useContext(YI);if(!t&&e===void 0)throw new Error(gn(27));return e}const LW=S.forwardRef(function(e,n){const{render:o,className:s,style:i,forceRender:r=!1,...l}=e,u=ec(),d=u.useState("open"),h=u.useState("nested"),p=u.useState("mounted"),g=u.useState("transitionStatus");return Ht("div",e,{state:{open:d,transitionStatus:g},ref:[u.context.backdropRef,n],stateAttributesMapping:Xy,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:r||!h})}),$W=S.forwardRef(function(e,n){const{render:o,className:s,style:i,disabled:r=!1,nativeButton:l=!0,...u}=e,d=ec(),h=d.useState("open"),{getButtonProps:p,buttonRef:g}=Fa({disabled:r,native:l}),b={disabled:r};function w(k){h&&d.setOpen(!1,ft(mP,k.nativeEvent))}return Ht("button",e,{state:b,ref:[n,g],props:[{onClick:w},u,p]})}),FW=S.forwardRef(function(e,n){const{render:o,className:s,style:i,id:r,...l}=e,u=ec(),d=ei(r);return u.useSyncedValueWithCleanup("descriptionElementId",d),Ht("p",e,{ref:n,props:[{id:d},l]})}),GI=S.createContext(void 0);function HW(){const t=S.useContext(GI);if(t===void 0)throw new Error(gn(26));return t}const qW="--nested-dialogs",UW="data-nested-dialog-open",VW={...kS,...wS,nestedDialogOpen(t){return t?{[UW]:""}:null}},KW=S.forwardRef(function(e,n){const{render:o,className:s,style:i,finalFocus:r,initialFocus:l,...u}=e,d=ec(),h=d.useState("descriptionElementId"),p=d.useState("disablePointerDismissal"),g=d.useState("floatingRootContext"),b=d.useState("popupProps"),w=d.useState("modal"),k=d.useState("mounted"),j=d.useState("nested"),C=d.useState("nestedOpenDialogCount"),_=d.useState("open"),T=d.useState("openMethod"),M=d.useState("titleElementId"),O=d.useState("transitionStatus"),N=d.useState("role"),D=g.useState("floatingId");HW(),Yu({open:_,ref:d.context.popupRef,onComplete(){_&&d.context.onOpenChangeComplete?.(!0)}});const E=l===void 0?lB(d.context.popupRef):l,R=C>0,B=d.useStateSetter("popupElement"),P=Ht("div",e,{state:{open:_,nested:j,transitionStatus:O,nestedDialogOpen:R},props:[b,{id:D,"aria-labelledby":M,"aria-describedby":h,role:N,...ib,hidden:!k,onKeyDown($){yb.has($.key)&&$.stopPropagation()},style:{[qW]:C}},u],ref:[n,d.context.popupRef,B],stateAttributesMapping:VW});return y.jsx($S,{context:g,openInteractionType:T,disabled:!k,closeOnFocusOut:!p,initialFocus:E,returnFocus:r,modal:w!==!1,restoreFocus:"popup",children:P})}),WW=S.forwardRef(function(e,n){const{keepMounted:o=!1,...s}=e,i=ec(),r=i.useState("mounted"),l=i.useState("modal"),u=i.useState("open");return r||o?y.jsx(GI.Provider,{value:o,children:y.jsxs(BS,{ref:n,...s,children:[r&&l===!0&&y.jsx(nj,{ref:i.context.internalBackdropRef,inert:wb(!u)}),e.children]})}):null});function YW({store:t,parentContext:e,isDrawer:n}){const o=t.useState("open"),s=t.useState("disablePointerDismissal"),i=t.useState("modal"),r=t.useState("popupElement"),l=t.useState("floatingRootContext"),[u,d]=S.useState(0),[h,p]=S.useState(0),g=u===0,b=ob(l,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(w){if(!t.context.outsidePressEnabledRef.current||"button"in w&&w.button!==0)return!1;if("touches"in w){if(w.type==="touchend"){if(w.changedTouches.length!==1||w.touches.length!==0)return!1}else if(w.touches.length!==1)return!1}const k=ln(w);if(g&&!s){if(i){const j=t.context.internalBackdropRef.current,C=t.context.backdropRef.current;return j||C?j===k||C===k||Ie(k,r)&&!k?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:g});return xB(o&&i===!0,r),t.useContextCallback("onNestedDialogOpen",(w,k)=>{d(w),p(k)}),Se(()=>(e?.onNestedDialogOpen&&(o?e.onNestedDialogOpen(u+1,h+(n?1:0)):e.onNestedDialogOpen(0,0)),()=>{e?.onNestedDialogOpen&&o&&e.onNestedDialogOpen(0,0)}),[n,o,u,h,e]),ub(t,{activeTriggerProps:b.reference,inactiveTriggerProps:b.trigger,popupProps:b.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:h}),null}const GW={...hb,modal:t=>t.modal,nested:t=>t.nested,nestedOpenDialogCount:t=>t.nestedOpenDialogCount,nestedOpenDrawerCount:t=>t.nestedOpenDrawerCount,disablePointerDismissal:t=>t.disablePointerDismissal,openMethod:t=>t.openMethod,descriptionElementId:t=>t.descriptionElementId,titleElementId:t=>t.titleElementId,viewportElement:t=>t.viewportElement,role:t=>t.role};class XW extends Gu{constructor(e,n,o){const s=new db,i=JW(e,s,n,o);super(i,QW(s),GW)}setOpen=(e,n)=>{n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,n),!n.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,n),this.update(ab(this.state,e,n.trigger)))}}function JW(t,e,n,o=!1){return{...fb(e,n,o),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t}}function QW(t){return{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:t,onOpenChange:void 0,onOpenChangeComplete:void 0}}function ZW(t,e){const{children:n,open:o,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:r,disablePointerDismissal:l=!1,modal:u=!0,actionsRef:d,handle:h,triggerId:p,defaultTriggerId:g=null}=e,b=t==="drawer",w=u,k=l,j="dialog",C=ec(!0),_=C!=null,T={modal:w,disablePointerDismissal:k,nested:_,role:j},M=VS((B,I)=>new XW({open:s,openProp:o,activeTriggerId:g,triggerIdProp:p,...T},B,I),!0);M.useControlledProp("openProp",o),M.useControlledProp("triggerIdProp",p),M.useSyncedValues(T),M.useContextCallback("onOpenChange",i),M.useContextCallback("onOpenChangeComplete",r);const O=M.useState("open"),N=M.useState("mounted"),D=M.useState("payload");uB(M,O),lb(M);const{forceUnmount:E}=cb(O,M);S.useImperativeHandle(d,()=>({unmount:E,close:()=>M.setOpen(!1,ft(Wy))}),[E,M]);const R=O||N;return y.jsxs(YI.Provider,{value:M,children:[h&&y.jsx(rb,{handle:h,store:M}),R&&y.jsx(YW,{store:M,parentContext:C?.context,isDrawer:b}),typeof n=="function"?n({payload:D}):n]})}const eY=Hh(function(e){return ZW("dialog",e)}),tY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,id:r,...l}=e,u=ec(),d=ei(r);return u.useSyncedValueWithCleanup("titleElementId",d),Ht("h2",e,{ref:n,props:[{id:d},l]})}),XI=S.createContext(void 0);function Vh(t){const e=S.useContext(XI);if(e===void 0&&!t)throw new Error(gn(47));return e}const nY={...hb,disabled:t=>t.disabled,instantType:t=>t.instantType,openMethod:t=>t.openMethod,openChangeReason:t=>t.openChangeReason,modal:t=>t.modal,focusManagerModal:t=>t.focusManagerModal,stickIfOpen:t=>t.stickIfOpen,titleElementId:t=>t.titleElementId,descriptionElementId:t=>t.descriptionElementId,openOnHover:t=>t.openOnHover,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class oY extends Gu{constructor(e,n,o){const s=new db;super(sY(e,s,n,o),iY(s),nY)}setOpen=(e,n)=>{const o=n.reason===pn,s=n.reason===xr&&n.event.detail===0,i=!e&&(n.reason===$h||n.reason==null),r=KS(n),l=this.select("activeTriggerId");if(!e&&n.reason===mP&&n.trigger==null&&l!=null&&(n.trigger=this.context.triggerElements.getById(l)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(e,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,n);const u=()=>{const h=ab(this.state,e,n.trigger,r());h.openChangeReason=n.reason,this.update(h)};o?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(FP,()=>{this.set("stickIfOpen",!1)}),Os.flushSync(u)):u();let d;s?d="click":i?d="dismiss":n.reason===Vl&&(d="focus"),this.set("instantType",d)}}function sY(t,e,n,o=!1){const s={...fb(e,n,o),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...t};return s.open&&t?.mounted===void 0&&(s.mounted=!0),s}function iY(t){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),stickIfOpenTimeout:new Lo,triggerElements:t}}const OA=Hh(function({props:e}){const{children:n,open:o,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:r,modal:l=!1,handle:u,triggerId:d,defaultTriggerId:h=null}=e,p=aY(u,{modal:l,open:s,openProp:o,activeTriggerId:h,triggerIdProp:d});p.useControlledProp("openProp",o),p.useControlledProp("triggerIdProp",d);const g=p.useState("open"),b=p.useState("mounted"),w=p.useState("payload");p.useContextCallback("onOpenChange",i),p.useContextCallback("onOpenChangeComplete",r),uB(p,g),lb(p);const{forceUnmount:k}=cb(g,p,()=>{p.update({stickIfOpen:!0,openChangeReason:null})});p.useSyncedValues({modal:l}),S.useEffect(()=>{g||p.context.stickIfOpenTimeout.clear()},[p,g]),S.useImperativeHandle(e.actionsRef,()=>({unmount:k,close:()=>p.setOpen(!1,ft(Wy))}),[k,p]);const j=g||b;return y.jsxs(XI.Provider,{value:p,children:[u&&y.jsx(rb,{handle:u,store:p}),j&&y.jsx(lY,{store:p,modal:l}),typeof n=="function"?n({payload:w}):n]})});function rY(t){return Vh(!0)?y.jsx(OA,{props:t}):y.jsx(XP,{children:y.jsx(OA,{props:t})})}function aY(t,e){const n=VS((o,s)=>new oY(e,o,s));return S.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function lY({store:t,modal:e}){const n=t.useState("floatingRootContext"),o=ob(n,{outsidePressEvent:{mouse:e==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),s=o.reference,i=o.floating;return ub(t,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:i}),null}const cY=300,uY=US(function(e,n){const{render:o,className:s,style:i,disabled:r=!1,nativeButton:l=!0,handle:u,payload:d,openOnHover:h=!1,delay:p=cY,closeDelay:g=0,id:b,...w}=e,k=Vh(!0),C=GS(u)??k;if(!C)throw new Error(gn(74));const _=ei(b),T=C.useState("isTriggerActive",_),M=C.useState("floatingRootContext"),O=C.useState("isOpenedByTrigger",_),N=C.useState("triggerPopupId",_),D=S.useRef(null),{registerTrigger:E,isMountedByThisTrigger:R}=WS(_,D,C,{payload:d,disabled:r,openOnHover:h,closeDelay:g}),B=C.useState("openChangeReason"),I=C.useState("stickIfOpen"),P=C.useState("openMethod"),$=C.useState("focusManagerModal"),W=pb(M,{enabled:!r&&h&&(P!=="touch"||B!==xr),mouseOnly:!0,move:!1,handleClose:gb(),restMs:p,delay:{close:g},triggerElementRef:D,isActiveTrigger:T,isClosing:()=>C.select("transitionStatus")==="ending"}),K=FS(M,{stickIfOpen:I}),F=jB(()=>C.select("open"),be=>{C.set("openMethod",be)}),q=C.useState("triggerProps",R),{getButtonProps:H,buttonRef:Y}=Fa({disabled:r,native:l}),ne={open(be){return be&&B===xr?mk.open(be):vS.open(be)}},{preFocusGuardRef:z,handlePreFocusGuardFocus:U,handleFocusTargetFocus:J}=OB(C,D),oe=Ht("button",e,{state:{disabled:r,open:O},ref:[Y,n,E,D],props:[K.reference,W,q,F,{[HP]:"",id:_,"aria-haspopup":"dialog","aria-expanded":O,"aria-controls":N},w,H],stateAttributesMapping:ne}),ie=y.jsx(S.Fragment,{children:oe},_);return R&&!$?y.jsxs(S.Fragment,{children:[y.jsx(vr,{ref:z,onFocus:U}),ie,y.jsx(vr,{ref:C.context.triggerFocusTargetRef,onFocus:J})]}):ie}),JI=S.createContext(void 0);function dY(){const t=S.useContext(JI);if(t===void 0)throw new Error(gn(45));return t}const fY=S.forwardRef(function(e,n){const{keepMounted:o=!1,...s}=e;return Vh().useState("mounted")||o?y.jsx(JI.Provider,{value:o,children:y.jsx(BS,{ref:n,...s})}):null}),QI=S.createContext(void 0);function hY(){const t=S.useContext(QI);if(!t)throw new Error(gn(46));return t}const pY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,anchor:r,positionMethod:l,side:u,align:d,sideOffset:h,alignOffset:p,collisionBoundary:g="clipping-ancestors",collisionPadding:b,arrowPadding:w,sticky:k,disableAnchorTracking:j=!1,collisionAvoidance:C=PS,..._}=e,T=Vh(),M=dY(),O=IS(),N=T.useState("floatingRootContext"),D=T.useState("mounted"),E=T.useState("open"),R=T.useState("openChangeReason"),B=T.useState("activeTriggerElement"),I=T.useState("modal"),P=T.useState("openMethod"),$=T.useState("positionerElement"),W=T.useState("instantType"),K=T.useState("transitionStatus"),F=T.useState("adaptiveOrigin"),q=S.useRef(null),H=Gy($),Y=tj({anchor:r,floatingRootContext:N,positionMethod:l,mounted:D,side:u,sideOffset:h,align:d,alignOffset:p,arrowPadding:w,collisionBoundary:g,collisionPadding:b,sticky:k,disableAnchorTracking:j,keepMounted:M,nodeId:O,collisionAvoidance:C,adaptiveOrigin:F}),ne=N.useState("domReferenceElement");Se(()=>{const oe=ne,ie=q.current;if(oe&&(q.current=oe),ie&&oe&&oe!==ie){T.set("instantType",void 0);const be=new AbortController;return H(()=>{T.set("instantType","trigger-change")},be.signal),()=>{be.abort()}}},[ne,H,T]);const z=I===!0&&R!==pn;vB(E&&z,P==="touch",$,B);const U=T.useStateSetter("positionerElement"),J={open:E,side:Y.side,align:Y.align,anchorHidden:Y.anchorHidden,instant:W},X=oj(e,J,{styles:Y.positionerStyles,transitionStatus:K,props:_,refs:[n,U],hidden:!D,inert:!E});return y.jsxs(QI.Provider,{value:Y,children:[D&&z&&y.jsx(nj,{inert:wb(!E),cutout:B}),y.jsx(GP,{id:O,children:X})]})}),mY=S.createContext(void 0);function gY(){const[t,e]=S.useState(0),n=De(()=>(e(s=>s+1),()=>{e(s=>Math.max(0,s-1))}));return{context:S.useMemo(()=>({register:n}),[n]),hasClosePart:t>0}}const yY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,initialFocus:r,finalFocus:l,...u}=e,d=Vh(),h=hY(),p=ZS()!=null,{context:g,hasClosePart:b}=gY(),w=d.useState("open"),k=d.useState("openMethod"),j=d.useState("instantType"),C=d.useState("transitionStatus"),_=d.useState("popupProps"),T=d.useState("titleElementId"),M=d.useState("descriptionElementId"),O=d.useState("modal"),N=d.useState("mounted"),D=d.useState("openChangeReason"),E=d.useState("activeTriggerElement"),R=d.useState("floatingRootContext"),B=R.useState("floatingId"),I=d.useState("disabled"),P=d.useState("openOnHover"),$=d.useState("closeDelay");Yu({open:w,ref:d.context.popupRef,onComplete(){w&&d.context.onOpenChangeComplete?.(!0)}}),QS(R,{enabled:P&&!I,closeDelay:$});const W=r===void 0?lB(d.context.popupRef):r,K=O!==!1&&b;d.useSyncedValue("focusManagerModal",K);const F=d.useStateSetter("popupElement"),q={open:w,side:h.side,align:h.align,instant:j,transitionStatus:C},H=Ht("div",e,{state:q,ref:[n,d.context.popupRef,F],props:[_,{id:B,role:"dialog",...ib,"aria-labelledby":T,"aria-describedby":M,onKeyDown(Y){p&&yb.has(Y.key)&&Y.stopPropagation()}},bb(C),u],stateAttributesMapping:Xy});return y.jsx($S,{context:R,openInteractionType:k,modal:K,disabled:!N||D===pn,initialFocus:W,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Ft(E)?E:void 0,nextFocusableElement:d.context.triggerFocusTargetRef,beforeContentFocusGuardRef:d.context.beforeContentFocusGuardRef,children:y.jsx(mY.Provider,{value:g,children:H})})});function Ka({open:t,onOpenChange:e,title:n,description:o,children:s,footer:i,className:r}){return y.jsx(eY,{open:t,onOpenChange:l=>e(l),children:y.jsxs(WW,{children:[y.jsx(LW,{className:"fixed inset-0 z-[900] bg-black/30 transition-opacity data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"}),y.jsxs(KW,{className:He("fixed left-1/2 top-1/2 z-[901] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-xl bg-surface p-5 text-fg shadow-popup outline-none","transition-[opacity,transform] data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",r),children:[y.jsxs("div",{className:"mb-3 flex items-start gap-3",children:[y.jsxs("div",{className:"flex-1",children:[y.jsx(tY,{className:"text-[15px] font-semibold",children:n}),o?y.jsx(FW,{className:"mt-1 text-fg-muted",children:o}):null]}),y.jsx($W,{"aria-label":"Close",className:"rounded-md p-1 text-fg-muted hover:bg-hover",children:y.jsx(As,{className:"size-4"})})]}),s,i?y.jsx("div",{className:"mt-4 flex justify-end gap-2",children:i}):null]})]})})}function Jf({open:t,onOpenChange:e,title:n,description:o,confirmLabel:s="Confirm",danger:i,onConfirm:r}){return y.jsx(Ka,{open:t,onOpenChange:e,title:n,description:o,footer:y.jsxs(y.Fragment,{children:[y.jsx(Mt,{onClick:()=>e(!1),children:"Cancel"}),y.jsx(Mt,{variant:i?"danger":"primary",onClick:()=>{r(),e(!1)},children:s})]})})}const ZI=S.createContext(void 0);function bY(){const t=S.useContext(ZI);if(t===void 0)throw new Error(gn(63));return t}const wY="data-checked",xY="data-unchecked",eL={..._q,checked(t){return t?{[wY]:""}:{[xY]:""}}},vY=S.forwardRef(function(e,n){const{checked:o,className:s,defaultChecked:i,"aria-labelledby":r,form:l,id:u,inputRef:d,name:h,nativeButton:p=!1,onCheckedChange:g,readOnly:b=!1,required:w=!1,disabled:k=!1,render:j,uncheckedValue:C,value:_,style:T,...M}=e,{clearErrors:O}=e7(),{state:N,setTouched:D,setDirty:E,validityData:R,setFilled:B,setFocused:I,validationMode:P,disabled:$,name:W,validation:K}=fP(),{labelId:F}=hP(),q=$||k,H=W??h,Y=S.useRef(null),ne=Ra(Y,d,K.inputRef),z=S.useRef(null),U=ei(),J=i7({id:u}),X=p?void 0:J,[oe,ie]=lS({controlled:o,default:!!i,name:"Switch",state:"checked"});Qq(z,U,oe,void 0,!q,h),Se(()=>{B(oe)},[oe,B]),gP(oe,()=>{O(H),E(oe!==R.initialValue),K.change(oe)});const{getButtonProps:be,buttonRef:ce}=Fa({disabled:q,native:p}),ye=n7(r,F,Y,!p,X),Ce={id:p?J:U,role:"switch","aria-checked":oe,"aria-readonly":b||void 0,"aria-required":w||void 0,"aria-labelledby":ye,onFocus(){q||I(!0)},onBlur(){const Oe=Y.current;!Oe||q||(D(!0),I(!1),P==="onBlur"&&K.commit(Oe.checked))},onClick(Oe){if(b||q)return;Oe.preventDefault();const Fe=Y.current;Fe&&Tf(Fe,Oe)}},Ve={...K.getValidationProps(q),checked:oe,disabled:q,form:l,id:X,name:H,required:w,style:H?bq:cS,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:ne,onChange(Oe){if(Oe.nativeEvent.defaultPrevented)return;if(b){Oe.preventDefault();return}const Fe=Oe.currentTarget.checked,nt=ft(Lh,Oe.nativeEvent);g?.(Fe,nt),!nt.isCanceled&&ie(Fe)},onClick(Oe){Oe.stopPropagation()},onFocus(){z.current?.focus()},..._!==void 0?{value:_}:nn},Me=S.useMemo(()=>({...N,checked:oe,disabled:q,readOnly:b,required:w}),[N,oe,q,b,w]),je=Ht("span",e,{state:Me,ref:[n,z,ce],props:[Ce,M,be,Oe=>K.getValidationProps(q,Oe)],stateAttributesMapping:eL});return y.jsxs(ZI.Provider,{value:Me,children:[je,!oe&&H&&C!==void 0&&y.jsx("input",{type:"hidden",form:l,name:H,value:C,disabled:q}),y.jsx("input",{...Ve,suppressHydrationWarning:!0})]})}),kY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,...r}=e,l=bY();return Ht("span",e,{state:l,ref:n,stateAttributesMapping:eL,props:r})}),tL="data-composite-item-active";function SY(t){const{loopFocus:e=!0,orientation:n="both",grid:o,onLoop:s,direction:i,highlightedIndex:r,onHighlightedIndexChange:l,rootRef:u,enableHomeAndEndKeys:d=!1,stopEventPropagation:h,disabledIndices:p,modifierKeys:g=br}=t,[b,w]=S.useState(0),k=o!=null,j=S.useRef(null),C=Ra(j,u),_=S.useRef([]),T=S.useRef(!1),M=S.useRef(null),O=r??b,N=De((I,P=!1)=>{if(M.current=_.current[I]??null,(l??w)(I),P){const $=_.current[I];uA(j.current,$,i,n)}}),D=De(I=>{if(I.size===0)return;if(T.current){const K=_.current,F=K.indexOf(M.current);if(F===-1){const q=K[O];!q||ru(K,O,p)?N(jY(K,p)):M.current=q}else F!==O&&N(F);return}T.current=!0;const P=Array.from(I.keys()),$=P.find(K=>K?.hasAttribute(tL))??null,W=$?I.get($)?.index??-1:-1;if(W!==-1)N(W);else if(ru(P,O,p)){const K=ir(P,{disabledIndices:p});Ef(P,K)||N(K)}uA(j.current,$,i,n)});Se(()=>{if(p==null||r!=null||!T.current)return;const I=_.current;if(ru(I,O,p)){const P=ir(I,{disabledIndices:p});Ef(I,P)||N(P)}},[p,r,O,_,N]);const E=De((I,P,$)=>s?s(I,P,$,_):$),R=De(I=>{const P=I.key===Ak||I.key===Rk;if(!yb.has(I.key)||!d&&P||CY(I,g)||!j.current)return;const W=i==="rtl",K=W?Mk:Ok,F=W?Ok:Mk,q=n==="vertical"?_k:K,H=n==="vertical"?Ek:F,Y=ln(I.nativeEvent);if(Y!=null&&cA(Y)&&!CV(Y)){const oe=Y.selectionStart,ie=Y.selectionEnd,be=Y.value;if(oe==null||I.shiftKey||oe!==ie||I.key!==H&&oe<be.length||I.key!==q&&oe>0)return}let ne=O;const z=bg(_,p),U=kk(_,p);o!=null&&(ne=o({disabledIndices:p,elementsRef:_,event:I,highlightedIndex:O,loopFocus:e,maxIndex:U,minIndex:z,onLoop:E,orientation:n,rtl:W}));const J=n!=="vertical"&&I.key===K||n!=="horizontal"&&I.key===_k,X=n!=="vertical"&&I.key===F||n!=="horizontal"&&I.key===Ek;d&&(I.key===Ak?ne=z:I.key===Rk&&(ne=U)),ne===O&&(J||X)&&(e&&ne===U&&J?(ne=z,s&&(ne=s(I,O,ne,_))):e&&ne===z&&X?(ne=U,s&&(ne=s(I,O,ne,_))):ne=ir(_.current,{startingIndex:ne,decrement:X,disabledIndices:p})),ne!==O&&!Ef(_.current,ne)&&(h&&I.stopPropagation(),(k||P||J||X)&&I.preventDefault(),N(ne,!0),queueMicrotask(()=>{_.current[ne]?.focus()}))});return{props:{ref:C,onFocus(I){const P=j.current,$=ln(I.nativeEvent);!P||$==null||!cA($)||$.setSelectionRange(0,$.value.length)},onKeyDown:R},highlightedIndex:O,onHighlightedIndexChange:N,elementsRef:_,onMapChange:D,relayKeyboardEvent:R}}function jY(t,e){let n=-1;for(let o=0;o<t.length;o+=1){const s=t[o];if(!(!s||ru(t,o,e))){if(s.hasAttribute(tL))return o;n===-1&&(n=o)}}return Math.max(n,0)}function CY(t,e){for(const n of B9)if(!e.includes(n)&&t.getModifierState(n))return!0;return!1}function TY(t){const{render:e,className:n,style:o,refs:s=br,props:i=br,state:r=nn,stateAttributesMapping:l,highlightedIndex:u,onHighlightedIndexChange:d,orientation:h,grid:p,loopFocus:g,onLoop:b,enableHomeAndEndKeys:w,onMapChange:k,stopEventPropagation:j=!0,rootRef:C,disabledIndices:_,modifierKeys:T,highlightItemOnHover:M=!1,tag:O="div",...N}=t,D=ej(),{props:E,highlightedIndex:R,onHighlightedIndexChange:B,elementsRef:I,onMapChange:P,relayKeyboardEvent:$}=SY({grid:p,loopFocus:g,onLoop:b,orientation:h,highlightedIndex:u,onHighlightedIndexChange:d,rootRef:C,stopEventPropagation:j,enableHomeAndEndKeys:w,direction:D,disabledIndices:_,modifierKeys:T}),W=Ht(O,t,{state:r,ref:s,props:[E,...i,N],stateAttributesMapping:l}),K=S.useMemo(()=>({highlightedIndex:R,onHighlightedIndexChange:B,highlightItemOnHover:M,relayKeyboardEvent:$}),[R,B,M,$]);return y.jsx(dP.Provider,{value:K,children:y.jsx(bB,{elementsRef:I,onMapChange:F=>{k?.(F),P(F)},children:W})})}const EY=S.createContext(void 0);function _Y(){return S.useContext(EY)}const nL=S.createContext(void 0);function MY(){return S.useContext(nL)}const OY=S.forwardRef(function(e,n){const{defaultValue:o,disabled:s=!1,loopFocus:i=!0,onValueChange:r,orientation:l="horizontal",multiple:u=!1,value:d,className:h,render:p,style:g,...b}=e,w=ZS(),k=_Y(),j=o??br,C=d!==void 0||o!==void 0,_=(w?.disabled??!1)||(k?.disabled??!1)||s,[T,M]=lS({controlled:d,default:j,name:"ToggleGroup",state:"value"}),O=De((B,I,P)=>{let $;u?($=T.slice(),I?$.push(B):$.splice(T.indexOf(B),1)):$=I?[B]:[],r?.($,P),!P.isCanceled&&M($)}),N={disabled:_,multiple:u,orientation:l},D=S.useMemo(()=>({disabled:_,setGroupValue:O,value:T,isValueInitialized:C}),[_,O,T,C]),E={role:"group"},R=Ht("div",e,{enabled:!!w,state:N,ref:n,props:[E,b]});return y.jsx(nL.Provider,{value:D,children:w?R:y.jsx(TY,{render:p,className:h,style:g,state:N,refs:[n],props:[E,b],loopFocus:i,enableHomeAndEndKeys:!0,orientation:l})})}),AY=S.forwardRef(function(e,n){const{className:o,defaultPressed:s=!1,disabled:i=!1,form:r,onPressedChange:l,pressed:u,render:d,type:h,value:p,nativeButton:g=!0,style:b,...w}=e,k=ei(p||void 0),j=MY(),C=j?.value??[],_=(i||j?.disabled)??!1,[T,M]=lS({controlled:j?k!==void 0&&C.indexOf(k)>-1:u,default:s,name:"Toggle",state:"pressed"}),{getButtonProps:O,buttonRef:N}=Fa({disabled:_,native:g}),D={disabled:_,pressed:T},E=[N,n],R=[{"aria-pressed":T,onClick(P){const $=!T,W=ft(Lh,P.nativeEvent);l?.($,W),!W.isCanceled&&(k&&j?.setGroupValue?.(k,$,W),!W.isCanceled&&M($))}},w,O],B=Ht("button",e,{enabled:!j,state:D,ref:E,props:R}),I=S.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return j?y.jsx(_B,{tag:"button",render:d,className:o,style:b,metadata:I,state:D,refs:E,props:R}):B}),RY="h-7 w-full min-w-0 rounded-control border border-line bg-surface-2 px-2 text-[13px] text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:bg-surface",AA=S.forwardRef(function({className:e,...n},o){return y.jsx("input",{ref:o,"data-ui-field":"",className:He(RY,e),...n})});function NY({value:t,options:e,onChange:n,onRepick:o,className:s,...i}){return y.jsx(OY,{value:t===null?[]:[t],onValueChange:r=>{const l=r[0];l!==void 0?n(l):t!==null&&o?.(t)},"aria-label":i["aria-label"],"data-ui-field":"",className:He("flex h-7 items-center gap-0.5 rounded-control bg-surface-2 p-0.5",s),children:e.map(r=>y.jsx(AY,{value:r.value,"aria-label":r.title,title:r.title,className:"flex h-full flex-1 items-center justify-center whitespace-nowrap rounded-[4px] px-1.5 text-fg-muted outline-none hover:text-fg data-[pressed]:bg-surface data-[pressed]:text-fg data-[pressed]:shadow-sm focus-visible:outline-2 focus-visible:outline-accent",children:r.label},r.value))})}function oL({checked:t,onChange:e,disabled:n,...o}){return y.jsx(vY,{checked:t,disabled:n,onCheckedChange:s=>e(s),onKeyDown:Dk,"aria-label":o["aria-label"],className:"relative inline-flex h-4 w-7 shrink-0 items-center rounded-full bg-line-strong p-0.5 transition-colors data-[checked]:bg-accent disabled:opacity-40",children:y.jsx(kY,{className:"size-3 rounded-full bg-white shadow transition-transform data-[checked]:translate-x-3"})})}function DY(t,e){const n=on(t).getComputedStyle(t).transform;let o=0,s=0,i=1;if(n&&n!=="none"){const r=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(r){const l=r[1].split(", ").map(parseFloat);l.length===6?(o=l[4],s=l[5],i=Math.sqrt(l[0]*l[0]+l[1]*l[1])):l.length===16&&(o=l[12],s=l[13],i=l[0])}}return{x:o,y:s,scale:i}}const sL=S.createContext(void 0);function jb(){const t=S.useContext(sL);if(!t)throw new Error(gn(73));return t}let RA=0;function iL(t){return RA+=1,`${t}-${Math.random().toString(36).slice(2,6)}-${RA}`}function Y0(t,e){if(typeof t=="string")return{description:t};if(typeof t=="function"){const n=t(e);return typeof n=="string"?{description:n}:n}return t}function G0(t){const e=new Map;let n=0,o=0;return t.forEach((s,i)=>{const r=s.transitionStatus==="ending";e.set(s.id,{value:s,domIndex:i,visibleIndex:r?-1:n,offsetY:o}),o+=s.height||0,r||(n+=1)}),e}function X0(t,e){let n=0;return t.map(o=>{if(o.transitionStatus==="ending")return o;const s=n>=e;return n+=1,o.limited===s?o:{...o,limited:s}})}const Hs={toasts:t=>t.toasts,isEmpty:t=>t.toasts.length===0,toast:(t,e)=>t.toastMetadata.get(e)?.value,toastIndex:(t,e)=>t.toastMetadata.get(e)?.domIndex??-1,toastOffsetY:(t,e)=>t.toastMetadata.get(e)?.offsetY??0,toastVisibleIndex:(t,e)=>t.toastMetadata.get(e)?.visibleIndex??-1,focused:t=>t.focused,expanded:t=>t.hovering||t.focused,expandedOrOutOfFocus:t=>t.hovering||t.focused||!t.isWindowFocused,prevFocusElement:t=>t.prevFocusElement};class PY extends Gu{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:G0(e.toasts)},{},Hs)}setViewport=e=>{this.set("viewport",e)};syncProviderProps(e,n){const o=this.state.limit!==n;if(this.state.timeout===e&&!o)return;const s={timeout:e,limit:n};if(o){const i=X0(this.state.toasts,n);s.toasts=i,s.toastMetadata=G0(i)}this.update(s)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,n=!1){const o=Hs.toastIndex(this.state,e);if(o===-1)return;const s=this.state.toasts[o];n||s?.onRemove?.();const i=[...this.state.toasts];i.splice(o,1),this.setToasts(i)}addToast=e=>{const{timeout:n,limit:o}=this.state,s=e.id||iL("toast");if(e.id){const u=Hs.toast(this.state,e.id);if(u)if(u.transitionStatus==="ending")this.removeToast(e.id,!0);else{const{id:d,transitionStatus:h,...p}=e;return this.updateToastInternal(e.id,p,!0,!0),e.id}}const i={...e,id:s,updateKey:0,transitionStatus:"starting"},r=[i,...this.state.toasts];this.setToasts(X0(r,o));const l=i.timeout??n;return i.type!=="loading"&&l>0&&this.scheduleTimer(s,l,()=>this.closeToast(s)),Hs.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),s};updateToast=(e,n)=>{const o=Hs.toast(this.state,e);!o||o.transitionStatus==="ending"||this.updateToastInternal(e,typeof n=="function"?n(o):n,!1,!0)};updateToastInternal=(e,n,o=!1,s=!1)=>{const{timeout:i,toasts:r}=this.state,l=Hs.toast(this.state,e);if(!l||l.transitionStatus==="ending")return;const u={...l,...n,...s&&{updateKey:l.updateKey+1}};this.setToasts(r.map(j=>j.id===e?u:j));const d=u.timeout??i,h=l.timeout??i,p=Object.hasOwn(n,"timeout"),g=u.transitionStatus!=="ending"&&u.type!=="loading"&&d>0,b=this.timers.has(e),w=h!==d,k=l.type==="loading";if(!g&&b){this.clearTimer(e);return}g&&(!b||w||p||k||o)&&(this.clearTimer(e),this.scheduleTimer(e,d,()=>this.closeToast(e)),Hs.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{const n=e===void 0,{limit:o,toasts:s}=this.state;let i;if(n)i=s,this.clearTimers();else{const u=Hs.toast(this.state,e);if(!u)return;i=[u],this.clearTimer(e)}const r=s.map(u=>n||u.id===e?{...u,transitionStatus:"ending",height:0}:u),l=X0(r,o);this.setToasts(l,!l.some(u=>u.transitionStatus!=="ending")),i.forEach(u=>{u.transitionStatus!=="ending"&&u.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,n)=>{const o=Y0(n.loading),s=this.addToast({...o,type:"loading"}),i=e.then(r=>{const l=Y0(n.success,r);return this.updateToast(s,{...l,type:"success",timeout:l.timeout}),r}).catch(r=>{const l=Y0(n.error,r);return this.updateToast(s,{...l,type:"error",timeout:l.timeout}),Promise.reject(r)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{e.timeout&&(e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,n)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=Lo.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(n),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!=="touch")return;const n=ln(e);Ie(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,n,o){const s=Date.now(),r=!Hs.expandedOrOutOfFocus(this.state)?Lo.create():void 0;r?.start(n,()=>{this.handleTimerFired(e),o()}),this.timers.set(e,{timeout:r,start:s,delay:n,remaining:n,callback:o})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e,n=e.length===0){const o={toasts:e,toastMetadata:G0(e)};n&&(o.hovering=!1,o.focused=!1),this.update(o)}handleFocusManagement(e){const n=Nn(yt(this.state.viewport));if(!this.state.viewport||!Ie(this.state.viewport,n)||!Vg(n))return;if(e===void 0){this.restoreFocusToPrevElement();return}const o=Hs.toasts(this.state),s=Hs.toastIndex(this.state,e),i=(l,u)=>{for(let d=l;d>=0&&d<o.length;d+=u)if(o[d].transitionStatus!=="ending")return o[d];return null},r=i(s+1,1)??i(s-1,-1);r?r.ref?.current?.focus():this.restoreFocusToPrevElement()}}const BY=function(e){const{children:n,timeout:o=5e3,limit:s=3,toastManager:i}=e,r=qn(()=>new PY({timeout:o,limit:s,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Yy(r.disposeEffect),S.useEffect(function(){return i?i[" subscribe"](({action:d,options:h})=>{const p=h.id;d==="promise"&&h.promise?r.promiseToast(h.promise,h):d==="update"&&p?r.updateToast(p,h.updates):d==="close"?r.closeToast(p):r.addToast(h)}):void 0},[r,i]),y.jsxs(sL.Provider,{value:r,children:[y.jsx(zY,{store:r,timeout:o,limit:s}),n]})};function zY(t){const{store:e,timeout:n,limit:o}=t;return Se(()=>{e.syncProviderProps(n,o)},[e,n,o]),null}const IY="--toast-frontmost-height",LY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,children:r,...l}=e,u=jb(),d=co(),h=S.useRef(!1),p=S.useRef(!1),g=S.useRef(!1),b=u.useState("isEmpty"),w=u.useState("toasts"),k=u.useState("focused"),j=u.useState("expanded"),C=u.useState("prevFocusElement"),_=w[0]?.height,T=w.some(Y=>Y.transitionStatus==="ending"),M=w.filter(Y=>Y.priority==="high");S.useEffect(()=>{const Y=u.state.viewport;if(!Y||b)return;const ne=on(Y),z=yt(Y);function U(oe){oe.key==="F6"&&ln(oe)!==Y&&(oe.preventDefault(),u.set("prevFocusElement",Nn(z)),Y?.focus({preventScroll:!0}),u.pauseTimers(),u.set("focused",!0))}function J(oe){ln(oe)===ne&&(u.set("isWindowFocused",!1),u.pauseTimers())}function X(oe){if(oe.relatedTarget)return;const ie=ln(oe),be=Nn(yt(Y));(ie===ne||!Ie(Y,ie)||!Vg(be))&&u.resumeTimers(),d.start(0,()=>u.set("isWindowFocused",!0))}return Ys(st(ne,"keydown",U),st(ne,"blur",J,!0),st(ne,"focus",X,!0),st(z,"pointerdown",u.handleDocumentPointerDown,!0))},[u,d,b]);function O(Y){h.current=!0;const ne=Y.relatedTarget===u.state.viewport?w.find(z=>z.transitionStatus!=="ending"&&!z.limited):void 0;ne?ne.ref?.current?.focus():u.restoreFocusToPrevElement()}function N(Y){Y.key==="Tab"&&Y.shiftKey&&ln(Y.nativeEvent)===u.state.viewport&&(Y.preventDefault(),u.restoreFocusToPrevElement())}function D(){u.state.toasts.some(ne=>ne.transitionStatus==="ending")||g.current||!p.current||(u.state.isWindowFocused&&u.resumeTimers(),u.set("hovering",!1),p.current=!1)}S.useEffect(D,[T,u]);function E(){u.pauseTimers(),u.set("hovering",!0),p.current=!1}function R(){u.state.isWindowFocused&&u.resumeTimers()}function B(){p.current=!0,D()}function I(Y){Y.pointerType==="touch"&&(g.current=!0)}function P(Y){Y.pointerType==="touch"&&(g.current=!1,D())}function $(){if(h.current){h.current=!1;return}k||Vg(Nn(yt(u.state.viewport)))&&(u.set("focused",!0),u.pauseTimers())}function W(Y){!k||Ie(u.state.viewport,Y.relatedTarget)||(u.set("focused",!1),R())}const K={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:E,onMouseMove:E,onMouseLeave:B,onFocus:$,onBlur:W,onKeyDown:N,onClick:$,onPointerDown:I,onPointerUp:P,onPointerCancel:P,style:{[IY]:_?`${_}px`:void 0}},F={expanded:j},q=!b&&C&&y.jsx(vr,{onFocus:O}),H=Ht("div",e,{ref:[n,u.setViewport],state:F,props:[K,l,{children:y.jsxs(S.Fragment,{children:[q,r,q]})}]});return y.jsxs(S.Fragment,{children:[q,H,!k&&M.length>0&&y.jsx("div",{style:cS,children:M.map(Y=>y.jsxs("div",{role:"alert","aria-atomic":!0,children:[y.jsx("div",{children:Y.title}),y.jsx("div",{children:Y.description})]},Y.id))})]})}),rL=S.createContext(void 0);function Cb(){const t=S.useContext(rL);if(!t)throw new Error(gn(66));return t}function J0(t,e,n){switch(t){case"up":return-n;case"down":return n;case"left":return-e;case"right":return e;default:return 0}}const $Y="--toast-index",FY="--toast-offset-y",HY="--toast-height",qY="--toast-swipe-movement-x",UY="--toast-swipe-movement-y",VY="data-swipe-direction",KY={...wS,swipeDirection(t){return t?{[VY]:t}:null}},NA=40,WY=10,DA=.5,YY=1,GY=`${fU},${hU}`,XY=S.forwardRef(function(e,n){const{toast:o,render:s,className:i,swipeDirection:r=["down","right"],style:l,...u}=e,d=o.positionerProps?.anchor!==void 0;let h=[];d||(h=Array.isArray(r)?r:[r]);const p=h.length>0,g=jb(),[b,w]=S.useState(void 0),[k,j]=S.useState(!1),[C,_]=S.useState(!1),[T,M]=S.useState({x:0,y:0}),[O,N]=S.useState({x:0,y:0,scale:1}),[D,E]=S.useState(),[R,B]=S.useState(),[I,P]=S.useState(null),$=S.useRef(null),W=S.useRef(void 0),K=S.useRef({x:0,y:0}),F=S.useRef({x:0,y:0,scale:1}),q=S.useRef(void 0),H=S.useRef(0),Y=S.useRef(!1),ne=S.useRef({x:0,y:0}),z=S.useRef(!1),U=S.useRef({x:0,y:0}),J=S.useRef(null),X=S.useRef(null),oe=g.useState("toastIndex",o.id),ie=g.useState("toastVisibleIndex",o.id),be=g.useState("toastOffsetY",o.id),ce=g.useState("focused"),ye=g.useState("expanded");Yu({open:o.transitionStatus!=="ending",ref:$,onComplete(){o.transitionStatus==="ending"&&g.removeToast(o.id)}});const Ce=De((Be=!1)=>{const fe=$.current;if(!fe)return;const xe=fe.style.height;fe.style.height="auto";const pe=fe.offsetHeight;fe.style.height=xe;function re(){g.updateToastInternal(o.id,{ref:$,height:pe,transitionStatus:void 0})}Be?Os.flushSync(re):re()});Se(()=>{const Be=W.current;o.transitionStatus!=="starting"&&Be===o.id||(Be!==void 0&&(w(void 0),N({x:0,y:0,scale:1}),Ve({x:0,y:0})),W.current=o.id,Ce())},[Ce,o.id,o.transitionStatus]);function Ve(Be){U.current=Be,M(Be)}Se(()=>()=>{X.current?.abort()},[]);function Me(Be,fe){const xe=ve=>ve>0?ve**DA:-(Math.abs(ve)**DA),pe=Be>0&&!h.includes("right")||Be<0&&!h.includes("left"),re=fe>0&&!h.includes("down")||fe<0&&!h.includes("up");return{x:pe?xe(Be):Be,y:re?xe(fe):fe}}const je=De(Be=>{if(Be.pointerId!==J.current)return;J.current=null,X.current?.abort(),X.current=null,j(!1),_(!1),P(null);const fe=F.current;if(Be.type==="pointercancel"||Y.current){Ve({x:fe.x,y:fe.y}),w(void 0);return}const xe=U.current,pe=xe.x-fe.x,re=xe.y-fe.y;let ve;for(const Ze of h)if(J0(Ze,pe,re)>NA){ve=Ze;break}ve?(w(ve),g.closeToast(o.id)):(Ve({x:fe.x,y:fe.y}),w(void 0))});function Oe(Be){if(Be.button!==0||(Be.pointerType==="touch"&&g.pauseTimers(),ln(Be.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${GY}`)))return;Y.current=!1,q.current=void 0,H.current=0,J.current=Be.pointerId,K.current={x:Be.clientX,y:Be.clientY},ne.current=K.current;const pe=Be.currentTarget,re=DY(pe);F.current=re,N(re),Ve({x:re.x,y:re.y}),g.set("hovering",!0),j(!0),_(!1),P(null),z.current=!0,X.current?.abort();const ve=new AbortController;X.current=ve;const Ze=yt(pe);Ze.addEventListener("pointerup",je,{signal:ve.signal}),Ze.addEventListener("pointercancel",je,{signal:ve.signal}),pe.setPointerCapture?.(Be.pointerId)}function Fe(Be){if(Be.pointerId!==J.current)return;Be.preventDefault(),z.current&&(K.current={x:Be.clientX,y:Be.clientY},z.current=!1);const{clientY:fe,clientX:xe,movementX:pe,movementY:re}=Be;(re<0&&fe>ne.current.y||re>0&&fe<ne.current.y)&&(ne.current={x:ne.current.x,y:fe}),(pe<0&&xe>ne.current.x||pe>0&&xe<ne.current.x)&&(ne.current={x:xe,y:ne.current.y});const ve=xe-K.current.x,Ze=fe-K.current.y,Ln=fe-ne.current.y,So=xe-ne.current.x;let dn=I;if(!C&&Math.sqrt(ve*ve+Ze*Ze)>=YY){_(!0);const vn=h.includes("left")||h.includes("right"),zs=h.includes("up")||h.includes("down");if(vn&&zs){const dt=Math.abs(ve),un=Math.abs(Ze);dn=dt>un?"horizontal":"vertical",P(dn)}}let Te;if(!q.current)dn==="vertical"?Ze>0?Te="down":Ze<0&&(Te="up"):dn==="horizontal"?ve>0?Te="right":ve<0&&(Te="left"):Math.abs(ve)>=Math.abs(Ze)?Te=ve>0?"right":"left":Te=Ze>0?"down":"up",Te&&h.includes(Te)&&(q.current=Te,H.current=J0(Te,ve,Ze),w(Te));else{const cs=q.current,vn=J0(cs,So,Ln);vn>NA?(Y.current=!1,w(cs)):!(h.includes("left")&&h.includes("right"))&&!(h.includes("up")&&h.includes("down"))&&H.current-vn>=WY&&(Y.current=!0)}const rt=Me(ve,Ze);let _t=F.current.x,Jt=F.current.y;const ls=h.includes("left")||h.includes("right"),Bs=h.includes("up")||h.includes("down");dn!=="vertical"&&ls&&(_t+=rt.x),dn!=="horizontal"&&Bs&&(Jt+=rt.y),Ve({x:_t,y:Jt})}function nt(Be){if(Be.key==="Escape"){if(!$.current||!Ie($.current,Nn(yt($.current))))return;g.closeToast(o.id)}}S.useEffect(()=>{const Be=$.current;if(!p||!Be)return;function fe(xe){J.current===null||!Ie(Be,ln(xe))||xe.preventDefault()}return st(Be,"touchmove",fe,{passive:!1})},[p]);function Ee(){const Be=T.x-O.x,fe=T.y-O.y;return{transition:k?"none":void 0,transform:k?`translateX(${T.x}px) translateY(${T.y}px) scale(${O.scale})`:void 0,[qY]:`${Be}px`,[UY]:`${fe}px`}}const Je=o.priority==="high",_e={role:Je?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":D,"aria-describedby":R,"aria-hidden":Je&&!ce?!0:void 0,onPointerDown:p?Oe:void 0,onPointerMove:p?Fe:void 0,onPointerUp:p?je:void 0,onPointerCancel:p?je:void 0,onKeyDown:nt,inert:wb(o.limited),style:{...Ee(),[$Y]:o.transitionStatus==="ending"?oe:ie,[FY]:`${be}px`,[HY]:o.height?`${o.height}px`:void 0}},Ae=S.useMemo(()=>({toast:o,setTitleId:E,setDescriptionId:B,recalculateHeight:Ce,visibleIndex:ie,expanded:ye}),[o,E,B,Ce,ie,ye]),Pe={transitionStatus:o.transitionStatus,expanded:ye,limited:o.limited||!1,type:o.type,swiping:k,swipeDirection:b},bt=Ht("div",e,{ref:[n,$],state:Pe,stateAttributesMapping:KY,props:[_e,u]});return y.jsx(rL.Provider,{value:Ae,children:bt})}),JY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,...r}=e,{visibleIndex:l,expanded:u,recalculateHeight:d}=Cb(),h=S.useRef(null);Se(()=>{d();const b=h.current;if(!b||typeof ResizeObserver!="function"||typeof MutationObserver!="function")return;const w=new ResizeObserver(()=>d(!0)),k=new MutationObserver(()=>d(!0));return w.observe(b),k.observe(b,{childList:!0,subtree:!0,characterData:!0}),()=>{w.disconnect(),k.disconnect()}},[d]);const p=l>0;return Ht("div",e,{ref:[n,h],state:{expanded:u,behind:p},props:r})});function aL(t){return t==null||typeof t=="boolean"||t===""?!1:Array.isArray(t)?t.some(aL):!0}function lL(t){return S.isValidElement(t)&&aL(t.props.children)}function cL(t,e,n){const{toast:o,setTitleId:s,setDescriptionId:i}=Cb(),r=n==="title"?s:i,l=e??(n==="title"?o.title:o.description);return{id:Ul(t),children:l,type:o.type,setId:r}}function uL(t,e,n){const o=lL(t);return Se(()=>{if(o)return n(e),()=>{n(s=>s===e?void 0:s)}},[o,e,n]),o?t:null}const QY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,id:r,children:l,...u}=e,{id:d,children:h,type:p,setId:g}=cL(r,l,"description"),w=Ht("p",e,{ref:n,state:{type:p},props:{...u,id:d,children:h}});return uL(w,d,g)}),ZY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,id:r,children:l,...u}=e,{id:d,children:h,type:p,setId:g}=cL(r,l,"title"),w=Ht("h2",e,{ref:n,state:{type:p},props:{...u,id:d,children:h}});return uL(w,d,g)}),eG=S.forwardRef(function(e,n){const{render:o,className:s,style:i,disabled:r,nativeButton:l=!0,...u}=e,d=jb(),{toast:h,expanded:p}=Cb(),[g,b]=S.useState(!1),{getButtonProps:w,buttonRef:k}=Fa({disabled:r,native:l}),j={type:h.type};return Ht("button",e,{ref:[n,k],state:j,props:[{"aria-hidden":!p&&!g,onClick(){d.closeToast(h.id)},onFocus(){b(!0)},onBlur(){b(!1)}},u,w]})}),tG=S.forwardRef(function(e,n){const{render:o,className:s,style:i,disabled:r,nativeButton:l=!0,...u}=e,{toast:d}=Cb(),h=d.actionProps?.children??u.children,{getButtonProps:p,buttonRef:g}=Fa({disabled:r,native:l}),b={type:d.type},w=Ht("button",e,{ref:[n,g],state:b,props:[u,d.actionProps,p,{children:h}]});return lL(w)?w:null}),nG=S.forwardRef(function(e,n){return y.jsx(zB,{ref:n,...e})});function oG(){const t=jb(),e=t.useState("toasts");return S.useMemo(()=>({toasts:e,add:t.addToast,close:t.closeToast,update:t.updateToast,promise:t.promiseToast}),[e,t])}function sG(){const t=new Set;function e(n){t.forEach(o=>o(n))}return{" subscribe":function(o){return t.add(o),()=>{t.delete(o)}},add(n){const o=n.id||iL("toast"),s={...n,id:o,transitionStatus:"starting"};return e({action:"add",options:s}),o},close(n){e({action:"close",options:{id:n}})},update(n,o){e({action:"update",options:{id:n,updates:o}})},promise(n,o){let s=n;return e({action:"promise",options:{...o,promise:n,setPromise(i){s=i}}}),s}}}const qe=sG();function iG(t){if(t.repeat||t.key!=="Enter"&&t.key!==" ")return;const e=t.currentTarget.closest("[data-toast]")??t.currentTarget,n=e.ownerDocument.defaultView;n&&AW(n,t.key,o=>o instanceof n.Node&&e.contains(o))}function rG(){const{toasts:t}=oG();return t.map(e=>y.jsxs(XY,{toast:e,"data-toast":"",className:"pointer-events-auto flex w-80 items-start gap-3 rounded-lg bg-surface p-3 text-fg shadow-popup transition-[opacity,transform] data-[starting-style]:translate-y-2 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",children:[y.jsxs(JY,{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[y.jsx(ZY,{className:"text-[13px] font-semibold"}),y.jsx(QY,{className:"text-xs text-fg-muted"}),e.actionProps?y.jsx(tG,{className:"mt-1 self-start rounded px-2 py-0.5 text-xs font-medium text-accent hover:bg-hover"}):null]}),y.jsx(eG,{"aria-label":"Dismiss",onKeyDown:iG,className:"rounded p-0.5 text-fg-muted hover:bg-hover",children:y.jsx(As,{className:"size-3.5"})})]},e.id))}function aG({children:t}){return y.jsxs(BY,{toastManager:qe,timeout:4e3,children:[t,y.jsx(nG,{children:y.jsx(LY,{className:"pointer-events-none fixed bottom-4 right-4 z-[1100] flex flex-col gap-2",children:y.jsx(rG,{})})})]})}const lG=["a[href]","button","iframe","input","select","textarea","summary","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])","[tabindex]"].join(", "),cG="audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function uG(t){return!(t.tabIndex>=0||!t.hasAttribute("tabindex")&&t.matches(cG))||t.getAttribute("aria-hidden")==="true"||t.matches(":disabled")?!1:typeof t.checkVisibility!="function"||t.checkVisibility({visibilityProperty:!0})}function dG(t){return Array.from(t.querySelectorAll(lG)).filter(uG)}function fG(t){const e=n=>!/visible|hidden|clip/.test(n);return t.scrollWidth>t.clientWidth+1&&e(t.overflowX)||t.scrollHeight>t.clientHeight+1&&e(t.overflowY)}function hG(t){const[e,n]=S.useState(!1);return S.useLayoutEffect(()=>{const o=t.current,s=o?.ownerDocument.defaultView;if(!o||!s)return;const i=()=>{const h=s.getComputedStyle(o);n(fG({scrollWidth:o.scrollWidth,clientWidth:o.clientWidth,scrollHeight:o.scrollHeight,clientHeight:o.clientHeight,overflowX:h.overflowX,overflowY:h.overflowY}))};if(i(),typeof s.ResizeObserver!="function")return;const r=new s.ResizeObserver(i),l=new Set,u=h=>{if(h.nodeType!==1)return;const p=h;if(s.getComputedStyle(p).display==="contents"){p.childNodes.forEach(u);return}l.has(p)||(l.add(p),r.observe(p))};r.observe(o),o.childNodes.forEach(u);const d=new s.MutationObserver(h=>{for(const p of h)p.addedNodes.forEach(u);for(const p of l)o.contains(p)||(r.unobserve(p),l.delete(p));i()});return d.observe(o,{childList:!0,subtree:!0,characterData:!0}),()=>{r.disconnect(),d.disconnect()}},[t]),e}S.forwardRef(function({label:e,className:n,...o},s){const i=S.useRef(null),r=S.useCallback(b=>{i.current=b,typeof s=="function"?s(b):s&&(s.current=b)},[s]),l=hG(i),[u,d]=S.useState(!1),[h,p]=S.useState(null);S.useLayoutEffect(()=>{const b=i.current,w=b?.ownerDocument.defaultView;if(!l||!b||!w)return;const k=()=>{d(dG(b).length===0),p(b.closest('[role="dialog"], [role="alertdialog"]')?.getAttribute("aria-labelledby")??null)};k();const j=new w.MutationObserver(k);return j.observe(b,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex","disabled","hidden","href","contenteditable"]}),()=>j.disconnect()},[l]);const g=l&&u;return y.jsx("div",{ref:r,...g?{role:"group",tabIndex:0,"aria-labelledby":e===void 0?h??void 0:void 0,"aria-label":e??(h===null?"Panel content":void 0)}:{},className:He(g&&"focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent",n),...o})});const pG={blur:{label:"Blur",unit:"px",min:0,max:200,step:1,identity:0,initial:4},brightness:{label:"Brightness",unit:"%",min:0,max:500,step:1,identity:100,initial:120},contrast:{label:"Contrast",unit:"%",min:0,max:500,step:1,identity:100,initial:120},grayscale:{label:"Grayscale",unit:"%",min:0,max:100,step:1,identity:0,initial:100},saturate:{label:"Saturate",unit:"%",min:0,max:500,step:1,identity:100,initial:150},"hue-rotate":{label:"Hue rotate",unit:"deg",min:-360,max:360,step:1,identity:0,initial:90},invert:{label:"Invert",unit:"%",min:0,max:100,step:1,identity:0,initial:100},sepia:{label:"Sepia",unit:"%",min:0,max:100,step:1,identity:0,initial:100},opacity:{label:"Opacity",unit:"%",min:0,max:100,step:1,identity:100,initial:50}};[...Object.keys(pG)];const mG="modulepreload",gG=function(t,e){return new URL(t,e).href},PA={},mo=function(e,n,o){let s=Promise.resolve();if(n&&n.length>0){let d=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};const r=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=l?.nonce||l?.getAttribute("nonce");s=d(n.map(h=>{if(h=gG(h,o),h in PA)return;PA[h]=!0;const p=h.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(o)for(let w=r.length-1;w>=0;w--){const k=r[w];if(k.href===h&&(!p||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${g}`))return;const b=document.createElement("link");if(b.rel=p?"stylesheet":mG,p||(b.as="script"),b.crossOrigin="",b.href=h,u&&b.setAttribute("nonce",u),document.head.appendChild(b),p)return new Promise((w,k)=>{b.addEventListener("load",w),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})},BA=["#e5484d","#0091ff","#30a46c","#f76b15","#8e4ec6","#d6409f","#12a594","#ad7f58"],Qf="#6e56cf",Bk=8e3,yG=80,dL=50;function bG(t){let e=0;for(let n=0;n<t.length;n++)e=e*31+t.charCodeAt(n)|0;return BA[Math.abs(e)%BA.length]}const hi={str:(t,e=512)=>typeof t=="string"&&t.length<=e?t:null,num:t=>typeof t=="number"&&Number.isFinite(t)?t:null,strList:(t,e=dL)=>Array.isArray(t)?t.map(n=>hi.str(n)).filter(n=>n!==null).slice(0,e):[],point:t=>{if(!t||typeof t!="object")return null;const e=t,n=hi.num(e.x),o=hi.num(e.y);return n!==null&&o!==null?{x:n,y:o}:null}};function wG(t,e,n,o){return t.filter(s=>s.id!==e).map(s=>{const i=s.state?.[n],r=i&&typeof i=="object"&&!Array.isArray(i)?i:null;return{id:s.id,name:(s.name||(s.kind==="agent"?"Agent":"Guest")).slice(0,60),kind:s.kind,color:s.kind==="agent"?Qf:bG(s.id),cursor:r?hi.point(r.cursor):null,state:r?o(r):null}}).sort((s,i)=>s.kind===i.kind?s.name.localeCompare(i.name):s.kind==="person"?-1:1)}function xG(t){const e=qt()(()=>({available:!1,peers:[],agentWrote:null}));async function n({room:o,artifact:s}){const i=[];let r=null;if(s&&(i.push(s.onChange(T=>{if(T.author!=="agent")return;const M=Object.keys(T.changes).map(D=>t.wrotePath?t.wrotePath(D):D).filter(D=>D!==null),O=e.getState().agentWrote,N=O&&Date.now()-O.at<Bk?O.paths:[];e.setState({agentWrote:{at:Date.now(),paths:[...new Set([...N,...M])].slice(0,dL)}}),r&&clearTimeout(r),r=setTimeout(()=>e.setState({agentWrote:null}),Bk)})),i.push(()=>{r&&clearTimeout(r)})),!o)return()=>i.forEach(T=>T());e.setState({available:!0});const l=await o.self().catch(()=>null),u=t.pointer?.bind(t),d=t.sendMs??yG;let h=null,p="",g=null;const b=()=>{g=null;const T=u?{...t.snapshot(),cursor:h}:t.snapshot(),M=JSON.stringify(T);M!==p&&(p=M,o.presence({[t.key]:T}).catch(()=>{}))},w=()=>{g||(g=setTimeout(b,d))};b(),i.push(t.watch(w));const k=T=>{const M=u?.(T)??null;if(!M){h&&(h=null,w());return}h={x:Math.round(M.x),y:Math.round(M.y)},w()},j=()=>{h=null,w()},C=()=>{document.visibilityState==="hidden"&&j()};u&&(window.addEventListener("pointermove",k,{passive:!0}),document.addEventListener("pointerleave",j),document.addEventListener("visibilitychange",C)),i.push(()=>{u&&(window.removeEventListener("pointermove",k),document.removeEventListener("pointerleave",j),document.removeEventListener("visibilitychange",C)),g&&clearTimeout(g),o.presence({[t.key]:null}).catch(()=>{})});const _=T=>{e.setState({peers:wG(T,l,t.key,t.parse)}),t.onPeers?.(T,l)};return o.peers().then(_,()=>{}),i.push(o.onPeers(_)),()=>i.forEach(T=>T())}return{store:e,start:n}}function vG(t){const e=t.trim().split(/\s+/).filter(Boolean);return((e[0]?.[0]??"?")+(e.length>1?e[e.length-1][0]??"":"")).toUpperCase()}const Q0=200,kG=119,zk=qt()(()=>({message:"",serial:0}));function SG(t){const e=t.replace(/\s+/g," ").trim();if(e.length<=Q0)return e;const n=e.slice(0,Q0).search(/\s+\S*$/);return`${n>=kG?e.slice(0,n):e.slice(0,Q0-1).replace(/[\uD800-\uDBFF]$/,"")}…`}function sn(t){const e=SG(t);e&&zk.setState(n=>({message:e,serial:n.serial+1}))}function jG(){const t=zk(n=>n.message),e=zk(n=>n.serial);return y.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"},children:y.jsx("span",{children:t},e)})}function fL(t){return t&&/(^|\s)max-h-/.test(t)?void 0:{maxHeight:"var(--available-height)",overflowY:"auto"}}const Qu=S.forwardRef(function({className:e,...n},o){return y.jsx("div",{ref:o,className:He("pointer-events-auto flex items-center gap-1 rounded-[12px] bg-chrome text-chrome-fg shadow-chrome",e),...n})});function yi({className:t,vertical:e=!0}){return y.jsx("div",{"aria-hidden":"true",className:He(e?"mx-0.5 h-[18px] w-px":"my-1 h-px w-full","shrink-0 bg-chrome-line",t)})}const hj=t=>t?{[t]:""}:{};function wn({label:t,shortcut:e,side:n="bottom",children:o,disabled:s}){return y.jsxs(RB,{disabled:s,children:[y.jsx(PB,{render:o}),y.jsx(IB,{children:y.jsx($B,{side:n,sideOffset:8,className:"z-[1000]",children:y.jsxs(FB,{className:"flex max-w-80 items-center gap-1.5 rounded-[6px] bg-tip px-2 py-[5px] text-[13px] leading-[18px] text-tip-fg shadow-[0_1px_2px_rgb(11_11_11/0.06),0_2px_8px_rgb(11_11_11/0.08)] transition-opacity data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",children:[y.jsx("span",{children:t}),e?y.jsx("kbd",{className:"rounded-[4px] bg-white/15 px-1 font-sans text-[12px] leading-4 text-tip-fg/80",children:e}):null]})})})]})}function pj({children:t}){return y.jsx(HB,{delay:400,closeDelay:0,children:t})}const CG={md:"h-7",lg:"h-8",xl:"h-9"},TG={md:"w-7",lg:"w-8",xl:"w-9"},it=S.forwardRef(function({pressed:e,square:n,size:o="md",className:s,type:i="button",...r},l){return y.jsx("button",{ref:l,type:i,"aria-pressed":e,className:He("inline-flex shrink-0 select-none items-center justify-center gap-1 whitespace-nowrap rounded-[8px] text-[14px] font-control leading-5 text-chrome-fg outline-none transition-colors duration-100 ease-out","hover:bg-chrome-hover focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-chrome-focus","disabled:pointer-events-none disabled:opacity-40",CG[o],n?TG[o]:"px-[9px]",e&&"bg-chrome-pressed text-chrome-pressed-fg hover:bg-chrome-pressed",s),...r})}),No=S.forwardRef(function({tip:e,shortcut:n,side:o,disabled:s,...i},r){const l=y.jsx(it,{ref:r,disabled:s,...i});return y.jsx(wn,{label:e,shortcut:n,side:o,children:s?y.jsx("span",{className:"inline-flex",children:l}):l})}),eo=S.forwardRef(function({label:e,tip:n,icon:o,shortcut:s,tipSide:i="top",size:r="xl",className:l,...u},d){return y.jsx(wn,{label:n??e,shortcut:s,side:i,children:y.jsx(it,{ref:d,square:!0,size:r,"aria-label":e,className:He("[&_svg]:size-[18px] [&_svg]:shrink-0",l),...u,children:o})})}),mj="min-w-[128px] max-w-[320px] rounded-[14px] bg-chrome p-1.5 text-[14px] leading-5 font-control text-chrome-fg shadow-chrome-popup outline-none origin-[var(--transform-origin)] transition-[opacity,transform] duration-100 data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",hL="flex h-7 cursor-default select-none items-center gap-2 rounded-[8px] px-2.5 outline-none data-[highlighted]:bg-chrome-hover data-[popup-open]:bg-chrome-hover data-[disabled]:opacity-40";function zn({trigger:t,children:e,side:n="bottom",align:o="start",className:s,tip:i,open:r,onOpenChange:l,sideOffset:u=6,mark:d,popupBase:h=mj}){const p=y.jsx(vV,{render:t});return y.jsxs(EB,{open:r,onOpenChange:l?g=>l(g):void 0,children:[i?y.jsx(wn,{label:i.label,shortcut:i.shortcut,side:i.side??(n==="top"?"top":"bottom"),children:p}):p,y.jsx(gB,{children:y.jsx(kB,{side:n,align:o,sideOffset:u,className:"z-[1000]",children:y.jsx(pB,{...hj(d),className:He(h,s),style:fL(s),children:e})})})]})}function Qe({children:t,onSelect:e,shortcut:n,checked:o,disabled:s,danger:i,icon:r,title:l,description:u,closeOnClick:d}){return y.jsxs(R7,{className:He(hL,u!==void 0&&"h-auto min-h-7 items-start py-1.5",i&&"text-danger data-[highlighted]:bg-danger data-[highlighted]:text-white"),disabled:s,onClick:h=>{d!==!1&&WI(h.nativeEvent),e?.()},closeOnClick:d,title:l,children:[o!==void 0?y.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:o?y.jsx(Va,{className:"size-4 text-chrome-accent",strokeWidth:2.25}):null}):null,r?y.jsx("span",{"data-chrome-icon":"",className:"flex size-4 shrink-0 items-center justify-center text-chrome-muted",children:r}):null,u!==void 0?y.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[y.jsx("span",{className:"truncate",children:t}),y.jsx("span",{className:"truncate text-[12px] leading-4 text-chrome-muted",children:u})]}):y.jsx("span",{className:"min-w-0 flex-1 truncate",children:t}),n?y.jsx("span",{className:"ml-6 max-w-40 shrink-0 truncate text-[13px] text-chrome-muted",children:n}):null]})}function uu({label:t,icon:e,children:n,disabled:o,className:s,mark:i,popupBase:r=mj}){return y.jsxs(gV,{children:[y.jsxs(EV,{className:hL,disabled:o,children:[e?y.jsx("span",{"data-chrome-icon":"",className:"flex size-4 shrink-0 items-center justify-center text-chrome-muted",children:e}):null,y.jsx("span",{className:"min-w-0 flex-1 truncate",children:t}),y.jsx(qh,{className:"size-4 shrink-0 text-chrome-muted",strokeWidth:1.5})]}),y.jsx(gB,{children:y.jsx(kB,{sideOffset:4,className:"z-[1000]",children:y.jsx(pB,{...hj(i),className:He(r,s),style:fL(s),children:n})})})]})}function ts(){return y.jsx(jV,{className:"mx-2.5 my-1 h-px bg-chrome-line"})}function ju({children:t}){return y.jsx("div",{className:"px-2.5 py-1 text-[13px] font-medium text-chrome-muted",children:t})}function EG(t){return!(t instanceof HTMLElement)||!t.matches('input, textarea, [contenteditable="true"]')?!0:t.matches('[type="search"], [role="searchbox"], [role="combobox"]')}function Tb({trigger:t,children:e,side:n="top",align:o="center",open:s,onOpenChange:i,className:r,label:l,anchor:u,gap:d=8,initialFocus:h=!0,mark:p,popupBase:g=mj,style:b,holdWhileTyped:w=!1}){const k=S.useRef(!1),j=(C,_)=>{if(!C&&_.reason==="outside-press"){if(w&&k.current){_.cancel();return}_.event instanceof MouseEvent&&WI(_.event)}i?.(C,_)};return y.jsxs(rY,{open:s,onOpenChange:j,onOpenChangeComplete:C=>{C||(k.current=!1)},children:[y.jsx(uY,{render:t}),y.jsx(fY,{children:y.jsx(pY,{side:n,align:o,sideOffset:d,anchor:u??void 0,className:"z-[1000]",children:y.jsx(yY,{...hj(p),"aria-label":l,initialFocus:h?void 0:!1,className:He(g,r),style:b,onInput:C=>{EG(C.target)||(k.current=!0)},children:e})})})]})}function _G({label:t,swatches:e,current:n,onPick:o,size:s=20,className:i}){return y.jsx("div",{role:"radiogroup","aria-label":t,className:He("flex items-center gap-1",i),children:e.map(r=>{const l=r.name===n;return y.jsx(wn,{label:r.label,side:"top",children:y.jsx("button",{type:"button",role:"radio","aria-checked":l,"aria-label":r.label,onClick:()=>o(r.name),className:"grid shrink-0 place-items-center rounded-full outline-none transition-shadow focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-chrome-focus",style:{width:s+8,height:s+8},children:y.jsx("span",{className:He("block rounded-full ring-1 ring-inset ring-black/10 dark:ring-white/15",l&&"ring-2 ring-chrome-accent ring-offset-2 ring-offset-chrome"),style:{width:s,height:s,background:r.value}})})},r.name)})})}const MG=8,OG=32;function pL({label:t,width:e,min:n,max:o,side:s,onResize:i,onReset:r,className:l}){const u=S.useRef(null),d=s==="left"?-1:1,h=w=>{w.button===0&&(w.preventDefault(),w.currentTarget.setPointerCapture(w.pointerId),u.current={x:w.clientX,width:e})},p=w=>{u.current&&i(u.current.width+(w.clientX-u.current.x)*d)},g=()=>{u.current=null},b=w=>{if(u.current||w.metaKey||w.ctrlKey||w.altKey)return;const k=w.key==="ArrowRight"?1:w.key==="ArrowLeft"?-1:0;k&&(w.preventDefault(),w.stopPropagation(),i(e+k*d*(w.shiftKey?OG:MG)))};return y.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":t,"aria-valuemin":n,"aria-valuemax":o,"aria-valuenow":Math.round(e),tabIndex:0,className:He("absolute inset-y-0 z-10 w-2 cursor-col-resize outline-none pointer-coarse:hidden","hover:bg-[linear-gradient(to_right,transparent_3px,var(--color-chrome-accent)_3px,var(--color-chrome-accent)_5px,transparent_5px)]","focus-visible:bg-[linear-gradient(to_right,transparent_3px,var(--color-chrome-accent)_3px,var(--color-chrome-accent)_5px,transparent_5px)]",s==="left"?"-left-1":"-right-1",l),onPointerDown:h,onPointerMove:p,onPointerUp:g,onPointerCancel:g,onKeyDown:b,onDoubleClick:r})}function AG(t){try{const e=Number(localStorage.getItem(t));return Number.isFinite(e)&&e>0?e:null}catch{return null}}function zA(t,e){try{e===null?localStorage.removeItem(t):localStorage.setItem(t,String(Math.round(e)))}catch{}}function mL(t,e,n,o,s=1/0){const i=S.useCallback(h=>Math.round(Math.max(n,Math.min(o,s,h))),[n,o,s]),[r,l]=S.useState(()=>AG(t)??e),u=S.useCallback(h=>{const p=i(h);l(p),zA(t,p)},[i,t]),d=S.useCallback(()=>{l(e),zA(t,null)},[e,t]);return{width:i(r),resize:u,reset:d}}function tc(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}const gj=tc()?"⌘":"Ctrl+",RG=gj==="⌘"?"⌥":"Alt+";function NG(t){const e=t;return!!(e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)))}const Ss={find:()=>!1,link:()=>!1,openLink:()=>!1,openReference:()=>!1,comment:()=>!1,toggleComments:()=>!1,shortcuts:()=>!1,slash:()=>!1},Ik={find:t=>Ss.find(t),link:()=>Ss.link(),openLink:()=>Ss.openLink(),openReference:()=>Ss.openReference(),comment:()=>Ss.comment(),toggleComments:()=>Ss.toggleComments(),shortcuts:()=>Ss.shortcuts(),slash:()=>Ss.slash()};function Wa(t,e){const n=Ss[t];return Ss[t]=e,()=>{Ss[t]===e&&(Ss[t]=n)}}const DG={headingFont:"serif",textFont:"sans",pageWidth:"default",tabsLocation:"menu"},he=qt(()=>({phase:{kind:"opening"},project:null,me:null,writable:!1,commentable:!1,activeTab:null,saving:{},suggestions:{},comments:"margin",history:!1,find:"closed",shortcuts:!1,focusedSuggestion:null})),lt=he.setState,ke=he.getState;function Zu(t){const e=(l,u)=>l.order<u.order?-1:l.order>u.order?1:l.id<u.id?-1:1,n=new Set(t.map(l=>l.id)),o=new Map;for(const l of t){const u=l.subtabOf&&n.has(l.subtabOf)&&l.subtabOf!==l.id?l.subtabOf:void 0,d=o.get(u)??[];d.push(l),o.set(u,d)}const s=[],i=new Set,r=(l,u)=>{for(const d of(o.get(l)??[]).sort(e))i.has(d.id)||(i.add(d.id),s.push({...d,depth:u}),r(d.id,u+1))};r(void 0,0);for(const l of t)i.has(l.id)||s.push({...l,depth:0});return s}function Lk(t){const e=t??{},n=(o,s)=>s.includes(e[o])?e[o]:DG[o];return{headingFont:n("headingFont",["serif","sans"]),textFont:n("textFont",["serif","sans"]),pageWidth:n("pageWidth",["default","wide"]),tabsLocation:n("tabsLocation",["menu","left"])}}function Kh(){const t=he(e=>e.project?.display);return S.useMemo(()=>Lk(t),[t])}const PG=(t,e)=>t?.find(n=>n.id===e)??null,ga=["#785ee8","#dc3c3d","#019c7f","#fbb315","#ce447d","#10a122","#257de0","#d25f25"],yj=["#785ee8"],BG=1500,zG=2e3,IA=8e3,IG=1e4,LG=6e4,$G=6e4;function Qg(t,e=yj){const n=Math.max(0,ga.indexOf(t));return ga.map((o,s)=>ga[(n+s)%ga.length]).filter(o=>!e.includes(o))}function Eb(t){const e=typeof t=="string"?t.toLowerCase():"";return ga.includes(e)?e:void 0}function gL(t){let e=0;for(let n=0;n<t.length;n+=1)e=e*31+t.charCodeAt(n)>>>0;return Qg(ga[e%ga.length])[0]??ga[1]}function FG(t,e){return Eb(t)??gL(e)}function bj(t){const[e=0,n=0,o=0]=[1,3,5].map(s=>{const i=parseInt(t.slice(s,s+2),16)/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4});return 1.05/(.2126*e+.7152*n+.0722*o+.05)<3?"#0b0b0b":"#ffffff"}function LA(t,e,n=yj){if(!n.includes(t)&&!e.includes(t))return t;const o=s=>e.filter(i=>i===s).length;return Qg(t,n).reduce((s,i)=>o(i)<o(s)?i:s)}function mf(t,e,n,o){return t.t<n.t||t.t===n.t&&e<o}function HG(t){const e=[];for(const n of t){const o=e.findIndex(s=>mf(n,n.key,s,s.key));e.splice(o<0?e.length:o,0,n)}return e}function $A(t){return t.filter(e=>!e.own).map(e=>e.c)}function qG(t,e=()=>{}){const{now:n}=t,o=t.neverGiven??yj,s=Eb(t.kept.read());let i=LA(s!==void 0&&!o.includes(s)?s:gL(t.id),[],o),r=null,l=0,u=-1/0,d,h,p=n(),g=-1/0,b;const w=()=>{const D=n(),E=D-p>IG;return E&&(g=D),p=D,E},k=(D,E)=>{const R=D!==i;[i,r]=[D,E],E!==null&&t.kept.write(i);const B=`${i} ${String(r)}`;B!==b&&(b=B,t.publish({c:i,t:r})),R&&e()},j=()=>{h?.cancel(),h=void 0,k(i,null)},C=D=>{const E=D.filter(R=>!o.includes(R.c));return E.filter(R=>!E.some(B=>B!==R&&B.key===R.key&&B.own===R.own&&mf(B,B.peer,R,R.peer)))},_=(D,E,R)=>D.some(B=>!B.own&&B.c===E&&mf(B,B.key,R,t.id)),T=(D,E,R,B)=>{const I={key:t.id,peer:t.peer,own:!0,c:R,t:B.t},P=HG([...E.filter(K=>!K.own),I]),$=P.filter(K=>K===I||P.some(F=>F!==K&&F.c===K.c&&mf(F,F.key,K,K.key))),W=new Set([R,...$A(D)]);for(const K of $){const F=Qg(K.c,o).find(q=>!W.has(q));if(F===void 0||K===I)return F;W.add(F)}},M=()=>{d=void 0;const D=t.claims(),E=C(D),R=E.find(B=>B.own);R===void 0?k(LA(i,$A(D),o),n()):k((_(E,R.c,R)?T(D,E,R.c,R):void 0)??R.c,R.t)},O=()=>{if(h!==void 0)return;const D=t.claims(),E=C(D),R=E.find(P=>P.own);if(r===null){R!==void 0&&R.c!==i&&k(R.c,null);return}const B={t:r};if(R!==void 0&&mf(R,R.peer,B,t.peer)&&!(_(E,R.c,R)&&T(D,E,R.c,R)!==void 0)){(R.c!==i||R.t!==r)&&k(R.c,R.t);return}n()-u>$G&&(l=0);const I=_(E,i,B)&&l<Qg(i,o).length?T(D,E,i,B):void 0;I!==void 0&&([l,u]=[l+1,n()],k(I,r))},N=t.every(()=>{w()&&h!==void 0&&j(),O()},zG);return b=`${i} null`,t.publish({c:i,t:null}),{worn:()=>i,heard:O,here(){const D=h;h=void 0,D?.cancel();const E=D!==void 0&&n()-D.at>=IA;if(E&&k(i,null),D!==void 0&&!E)return O();d!==void 0||r!==null||(l=0,k(i,null),d=t.after(M,BG))},away(){if(d?.(),d=void 0,!(r===null||h!==void 0)){if(w(),n()-g<LG)return k(i,null);h={at:n(),cancel:t.after(j,IA)}}},dispose(){h!==void 0&&j(),d?.(),d=void 0,N()}}}function UG(t){return{read(){try{return globalThis.localStorage?.getItem(t)??null}catch{return null}},write(e){try{globalThis.localStorage?.setItem(t,e)}catch{}}}}const VG={now:()=>Date.now(),after(t,e){const n=setTimeout(t,e);return()=>clearTimeout(n)},every(t,e){const n=setInterval(t,e);return()=>clearInterval(n)}},KG="1.4.0";class du extends Error{code;paths;retryable;constructor(e,n,o,s){super(n),this.name="ArtifactError",this.code=e,o&&(this.paths=o),s&&(this.retryable=!0)}}function WG(t){return t==="owner"||t==="editor"}const FA={defaultMs:12e4,maxMs:6e5};function YG(t,e={}){const n=e.timeoutMs??1e4,o=new Map;return Object.freeze({version:KG,use:i=>{const r=o.get(i);if(r)return r;const l=new Promise(u=>{const d=setTimeout(()=>u(null),n);Promise.resolve().then(()=>t.get(i)).then(h=>{clearTimeout(d),u(h?Object.freeze(h):null)},()=>{clearTimeout(d),u(null)})});return o.set(i,l),l}})}function GG(t,e){const n=globalThis.window?.openartifact;if(n)return n;const o=YG(t,e);return Object.defineProperty(window,"openartifact",{value:o,configurable:!1,enumerable:!0,writable:!1}),o}const gt={session:"_api/session",files:"_api/files",file:"_api/file",publish:"_api/publish",assets:"_api/assets",events:"_api/events",agentSend:"_api/agent/send",presence:"_api/presence",peers:"_api/peers",downloads:"_api/downloads",roomEmit:"_api/room/emit",dbGet:"_api/db/get",dbList:"_api/db/list",dbWrite:"_api/db/write",comments:"_api/comments",commentsCreate:"_api/comments/create",commentsReply:"_api/comments/reply",commentsEdit:"_api/comments/edit",commentsReact:"_api/comments/react",commentsResolve:"_api/comments/resolve",commentsMove:"_api/comments/move",commentsRemove:"_api/comments/remove",commentsSend:"_api/comments/send",history:"_api/history",historyFiles:"_api/history/files",historyFile:"_api/history/file",historyDiff:"_api/history/diff",historyRestore:"_api/history/restore",historyDismiss:"_api/history/dismiss",systemCopy:"_api/design/system-copy",mcpTools:"_api/mcp/tools",mcpCall:"_api/mcp/call",dataRefresh:"_api/data/refresh"},qm={read:"_api/sheet/read",send:"_api/sheet/send",widget:"_api/sheet/widget",importFile:"_api/sheet/import"},XG="sheet",JG="sheetWalkthrough",na={session:"_api/doc/session",read:"_api/doc/read",call:"_api/doc/call",history:"_api/doc/history",version:"_api/doc/version",restore:"_api/doc/restore",importFile:"_api/doc/import",exportFile:"_api/doc/export"};function QG(t,e,n){return e===401||e===403?"removed":e<200||e>=300||!n||n.id===t.id&&n.role===t.role?null:"changed"}async function Z0(t){let e={};try{e=await t.json()}catch{}const n=t.status===409?"conflict":t.status===403?"not_writer":t.status===404?"not_found":"unavailable";return new du(e.code??n,e.message??`HTTP ${t.status}`,e.paths,e.retryable===!0)}function ZG(){const t=new Uint8Array(8);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}function yL(t={}){const e=new URL(t.base??"./",location.href),n=ZG(),o=(R,B)=>{const I=new URL(R,e);for(const[P,$]of Object.entries(B??{}))I.searchParams.set(P,$);return I.toString()},s=async(R,B,I)=>{let P;try{P=await fetch(o(R,I),B)}catch($){throw new du("unavailable",$ instanceof Error?$.message:String($))}if(!P.ok)throw await Z0(P);return await P.json()},i=(R,B)=>s(R,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(B)}),r=new Map,l=(R,B)=>{for(const I of r.get(R)??[])I(B)},u=(R,B)=>{let I=r.get(R);return I||(I=new Set,r.set(R,I),p?.addEventListener(R,b)),I.add(B),T(),()=>I.delete(B)};let d=null,h=!1,p=null,g=null;const b=R=>{l(R.type,JSON.parse(R.data))},w=()=>{const R=new EventSource(o(gt.events,{client:n}));p=R;for(const B of r.keys())R.addEventListener(B,b);R.onerror=()=>{_().then(B=>{B||R.readyState!==EventSource.CLOSED||p!==R||(p=null,g=setTimeout(()=>{g=null,T()},2e3))})}};let k=!1,j=!1;const C=R=>{k||(k=!0,g&&clearTimeout(g),g=null,p?.close(),p=null,d?.close(),d=null,t.onAccessChange?t.onAccessChange(R):location.reload())},_=async()=>{if(k)return!0;if(!M||j)return!1;j=!0;try{const R=(await M.catch(()=>null))?.viewer;if(!R)return!1;let B;try{B=await fetch(o(gt.session),{cache:"no-store"})}catch{return!1}const I=B.ok?(await B.json().catch(()=>null))?.viewer:null,P=QG(R,B.status,I);return P&&C(P),P!==null}finally{j=!1}};function T(){if(d||p||g||k)return;if(typeof WebSocket>"u")return w();const R=new URL(o(gt.events,{client:n}));R.protocol=R.protocol==="https:"?"wss:":"ws:";const B=new WebSocket(R);d=B,B.onopen=()=>{h=!0},B.onmessage=I=>{let P;try{P=JSON.parse(String(I.data))}catch{return}P.event&&l(P.event,P.data)},B.onclose=()=>{if(d===B&&(d=null),!k){if(!h)return w();_().then(I=>{I||d||p||g||(g=setTimeout(()=>{g=null,T()},2e3))})}}}let M=null;const O=()=>M??=s(gt.session),N={async artifact(){const{artifact:R,stores:B}=await O();return{id:R.id,...B?.systemCopy?{systemCopy:(P,$)=>s(gt.systemCopy,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({namespace:P,action:$})})}:{},title:async()=>(await s(gt.session)).artifact.title,list:async()=>(await s(gt.files)).files,readText:async P=>new TextDecoder().decode(await D(P)),readBytes:P=>D(P),publish:async P=>{const $={files:P,client:n};return s(gt.publish,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify($)})},onChange:P=>u("files",P)}},async assets(){const{viewer:R}=await O();return WG(R.role)?{upload:async(I,P)=>s(gt.assets,{method:"POST",headers:{"content-type":I.type||"application/octet-stream"},body:I},P?.name?{name:P.name}:void 0)}:null},async user(){const{viewer:R}=await O();return{me:async()=>R}},async agent(){return{send:async(B,I)=>{const P={request:B,deliver:I?.deliver??"send"};return s(gt.agentSend,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(P)})},status:async()=>(await s(gt.session)).agent,onStatus:B=>u("agent",B)}},async room(){return{self:async()=>n,presence:async B=>{const I={client:n,patch:B};await s(gt.presence,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(I)})},peers:async()=>(await s(gt.peers)).peers,onPeers:B=>u("peers",B),emit:async(B,I)=>{const P={client:n,topic:B,data:I};await i(gt.roomEmit,P)},onMessage:B=>u("room",B)}},async db(){const{stores:R}=await O();return R?.db?{get:async I=>(await s(gt.dbGet,{cache:"no-store"},{path:I})).data,list:async I=>(await s(gt.dbList,{cache:"no-store"},{collection:I})).documents,listing:async I=>{const{documents:P,epoch:$,seq:W}=await s(gt.dbList,{cache:"no-store"},{collection:I});return typeof $=="string"&&typeof W=="number"?{documents:P,epoch:$,seq:W}:{documents:P}},write:async I=>{const P={writes:I,client:n},{epoch:$,seq:W,documents:K}=await i(gt.dbWrite,P);return typeof $=="string"&&typeof W=="number"&&K!==void 0?{epoch:$,seq:W,documents:K}:void 0},onChange:I=>u("db",I)}:null},async comments(){const{stores:R}=await O();if(!R?.comments)return null;const B=async(P,$)=>(await i(P,$)).thread;return{list:async()=>(await s(gt.comments,{cache:"no-store"})).threads,create:P=>B(gt.commentsCreate,{input:P}),reply:(P,$,W)=>B(gt.commentsReply,{threadId:P,text:$,...W?.to?.length?{to:W.to}:{}}),edit:(P,$,W,K)=>B(gt.commentsEdit,{threadId:P,messageId:$,text:W,...K?.to?{to:K.to}:{}}),react:(P,$,W,K)=>B(gt.commentsReact,{threadId:P,messageId:$,emoji:W,on:K}),setResolved:(P,$)=>B(gt.commentsResolve,{threadId:P,resolved:$}),move:(P,$,W)=>B(gt.commentsMove,{threadId:P,anchor:$,...W?{location:W}:{}}),remove:async(P,$)=>{await i(gt.commentsRemove,{threadId:P,...$?{messageId:$}:{}})},sendToAgent:(P,$)=>B(gt.commentsSend,{threadId:P,...$?.unasked?{unasked:!0}:{}}),onChange:P=>u("comments",P)}},async doc(){const{stores:R}=await O();return R?.doc?{session:()=>i(na.session,{client:n}),read:I=>i(na.read,{tab:I}),call:I=>i(na.call,{...I,client:n}),history:I=>i(na.history,{tab:I}),version:(I,P)=>i(na.version,{tab:I,rev:P}),restore:I=>i(na.restore,I),importFile:(I,P,$)=>s(na.importFile,{method:"POST",headers:{"content-type":"application/octet-stream"},body:P},{name:I,...$?{tabName:$}:{}}),exportFile:async I=>{let P;try{P=await fetch(o(na.exportFile,{format:I.format,...I.tab?{tab:I.tab}:{},...I.paper?{paper:I.paper}:{}}),{cache:"no-store"})}catch(F){throw new du("unavailable",F instanceof Error?F.message:String(F))}if(!P.ok)throw await Z0(P);const $=P.headers.get("content-disposition")??"",W=decodeURIComponent(/filename\*=UTF-8''([^;]+)/.exec($)?.[1]??"")||`doc.${I.format==="markdown"?"md":I.format}`;let K=[];try{K=JSON.parse(decodeURIComponent(P.headers.get("x-doc-export-notes")??"%5B%5D"))}catch{}return{name:W,mime:P.headers.get("content-type")??"application/octet-stream",bytes:new Uint8Array(await P.arrayBuffer()),notes:K}},onFrame:I=>u("doc",I)}:null},async history(){const{stores:R}=await O();if(!R?.history)return null;const B=(P,$)=>({n:String(P),...$===void 0?{}:{path:$}});return{list:()=>s(gt.history,{cache:"no-store"}),files:async P=>(await s(gt.historyFiles,{cache:"no-store"},B(P))).files,read:async(P,$)=>new TextDecoder().decode(await E(gt.historyFile,B(P,$))),readBytes:(P,$)=>E(gt.historyFile,B(P,$)),diff:(P,$)=>s(gt.historyDiff,{cache:"no-store"},B(P,$)),restore:(P,$)=>i(gt.historyRestore,{n:P,...$?{paths:$}:{},client:n}),dismissNotice:async P=>{await i(gt.historyDismiss,{id:P})},onChange:P=>u("history",P)}},async mcp(){const{viewer:R}=await O();return R.role!=="owner"?null:{callTool:async(I,P,$,W)=>{const K=W?.signal;K?.throwIfAborted();const F={server:I,tool:P,args:$,...W?.timeoutMs===void 0?{}:{timeoutMs:W.timeoutMs}};try{return await s(gt.mcpCall,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(F),...K?{signal:K}:{}})}catch(q){throw K?.aborted?K.reason:q}},listTools:I=>s(gt.mcpTools,{cache:"no-store"},I===void 0?void 0:{server:I})}},async sheet(){const{stores:R}=await O();if(!R?.sheet)return null;let B=Promise.resolve();return{read:P=>i(qm.read,P),send:P=>{const $=B.then(()=>i(qm.send,P));return B=$.catch(()=>{}),$},widget:P=>i(qm.widget,P),importFile:(P,$)=>s(qm.importFile,{method:"POST",headers:{"content-type":P.type||"application/octet-stream"},body:P},{name:$}),onFrame:P=>u(XG,P),onWalkthrough:P=>u(JG,P)}},async downloads(){return{save:async({name:B,data:I})=>s(gt.downloads,{method:"POST",headers:{"content-type":I.type||"application/octet-stream"},body:I},{name:B})}}};function D(R){return E(gt.file,{path:R})}async function E(R,B){let I;try{I=await fetch(o(R,B),{cache:"no-store"})}catch(P){throw new du("unavailable",P instanceof Error?P.message:String(P))}if(!I.ok)throw await Z0(I);return new Uint8Array(await I.arrayBuffer())}return{get(R){const B=N[R];return B?B():null}}}const eX="[Artifact comment sent to agent]",tX="[Artifact edit request sent to agent]",nX="[Artifact task finished]",oX="[Open Artifact] ",sX={id:"open_artifact_id"},iX=1,rX=1,aX=/^[a-z][a-z0-9]{0,23}$/,lX="may not have run: the artifact was updated before this call was answered",cX=["quickstart","list","publish","read","open","call","adopt","delete","share"],uX=["get","list","query","set","update","delete","str_replace","batch"],dX=["read","reply","resolve","reopen","wait"],fX=["share","export"],hX={type:"object",properties:{action:{type:"string",enum:cX,description:"What to do: quickstart, list, publish, read, open, call, adopt, delete or share. Omitted: publish."},intent:{type:"string",description:"quickstart: what is being made (design, design-system, slides, whiteboard, document, data, sheets, motion, page, other), or a few words about it."},scope:{type:"string",enum:["types","mine","all"],description:"list: types (the installed types), mine (this session's and this workspace's artifacts; the default) or all (every artifact)."},type:{type:"string",description:"list: only artifacts of this type (an id, or open-artifact://type/<id>). quickstart: the type already chosen (an id), to get its create call and steps without matching."},query:{type:"string",description:"list: only artifacts whose title contains this text."},limit:{type:"integer",description:"list: how many to return (default 50, at most 200)."},cursor:{type:"string",description:"list: the next_cursor of the previous page."},type_url:{type:"string",description:"publish without url: the type to create from (open-artifact://type/<id>, from quickstart). read without url: the type to describe."},title:{type:"string",description:"publish without url: the new artifact's name. quickstart: the name it will have, to find similar ones."},folder:{type:"string",description:"publish without url, or adopt: where the artifact's folder goes (absolute, or relative to the workspace). Default <workspace>/artifacts/<slug>."},url:{type:"string",description:"An artifact: open-artifact://artifact/<id>, as publish returned it."},files:{type:"object",additionalProperties:!0,description:'publish with url: files to write under the artifact root, as {"rel/path": "text"} or {"rel/path": {"content": "...", "encoding": "base64"}}; null deletes.'},if_match:{type:"object",additionalProperties:!0,description:'publish with url: {"rel/path": sha256 | null | "*"}. Write only while the file still has the sha256 you read, does not exist (null), or anyway ("*"). One mismatch writes nothing and returns the current versions.'},check:{type:"boolean",description:"publish with url: run the type's check action after writing; its result comes back as check."},capabilities:{type:"object",additionalProperties:!0,description:'publish, page artifacts only: the runtime capabilities the page may use, as {"db": true, "assets": true, ...}. Omitted: kept; {}: none; otherwise the whole set. With url it may be given without files.'},open:{type:"string",enum:["after_first_write","now","never"],description:"publish without url: after_first_write (the default) opens the page in your app once your first write lands; now opens it at once; never leaves it closed. Where your app cannot show pages by itself the result says so: open view_url in your app's built-in browser, if you have one."},related:{type:"boolean",description:"quickstart: list existing artifacts the recommended type can build on, such as design systems (default true)."},path:{type:"string",description:"read: one file or folder under the root (omitted: the record and the file list)."},paths:{type:"array",items:{type:"string"},description:"read: several files under the root at once."},name:{type:"string",description:"call: the action's name (check, upload, ...; read with url lists them)."},args:{type:"object",additionalProperties:!0,description:"call: the action's arguments. upload: {file: absolute path, name?, group?}."},panel:{type:"string",enum:fX,description:"open: also open the page's Share panel (share), for the person to share it on the network, or its Export tab (export), for them to download a file."},cloud:{type:"string",description:"share: publish the artifact to this cloud remote (its name, as `open-artifact remote list` shows it). It works only on a remote the person set up and let agents publish to (agentMayPublish); otherwise the person publishes it, from the Share panel or with `open-artifact publish <id> --remote <name>`."}}},pX={type:"object",properties:{action:{type:"string",enum:uX,description:"What to do: get, list, query, set, update, delete, str_replace or batch."},url:{type:"string",description:"The artifact (open-artifact://artifact/<id>)."},collection:{type:"string",description:"The collection: alone for list / query (query needs it), with doc_id for one document."},doc_id:{type:"string",description:"With collection: the document to get / set / update / delete / str_replace."},path:{type:"string",description:"collection/doc_id, instead of the two."},data:{type:"object",additionalProperties:!0,description:"set / update: the document's fields."},file_path:{type:"string",description:"set / update: a JSON file holding the fields, instead of data."},if_match:{description:'set / update / delete / str_replace: the sha256 get returned (write only if unchanged), null (only if it does not exist) or "*" (replace whatever is there).'},field:{type:"string",description:"str_replace: the text field, as a dot path (body, notes.text)."},old:{type:"string",description:"str_replace: the passage to replace; it must occur exactly once."},new:{type:"string",description:"str_replace: the passage that replaces it."},where:{type:"array",items:{type:"object",additionalProperties:!0},description:"query: [{field, op, value}], all must hold. op: ==, !=, <, <=, >, >=, in, not-in (up to 30 values), array-contains."},order_by:{type:"object",additionalProperties:!0,description:'query: {field, dir: "asc" | "desc"}.'},limit:{type:"integer",description:"list / query: how many documents (default 100, at most 1000)."},cursor:{type:"string",description:"list / query: the next_cursor of the previous page."},out_file:{type:"string",description:"get / list / query: write the result to this JSON file (absolute, or relative to the workspace) and return only its path and counts."},writes:{type:"array",items:{type:"object",additionalProperties:!0},description:"batch: [{op: set|update|delete|str_replace, path | collection+doc_id, data | file_path, if_match?, field?, old?, new?}], at most 500."}},required:["action","url"]},mX={type:"object",properties:{action:{type:"string",enum:dX,description:"What to do: read, reply, resolve, reopen or wait."},url:{type:"string",description:"The artifact (open-artifact://artifact/<id>). wait: optional."},thread_id:{type:"string",description:'reply / resolve / reopen: the thread (after ";thread=" in the message).'},text:{type:"string",description:"reply: the answer."},resolve:{type:"boolean",description:"reply: resolve the thread too."},all:{type:"boolean",description:"read: resolved threads too."},since:{type:"string",description:"read: only threads with a message at or after this time (ISO 8601)."},acknowledge_duplicate:{type:"boolean",description:"reply: send the same text as your last reply in this thread again, on purpose."},timeout_ms:{type:"number",description:"wait: how long (default 600000)."}},required:["action"]},HA={Artifact:hX,ArtifactData:pX,ArtifactComments:mX},gX={Artifact:["Make and change artifacts: typed folders of files that open as live pages the person can view, edit, comment on and export. Actions:","- quickstart {intent, type?}: call first for a new artifact; recommends a type (or takes the one given) and returns the call that creates it, the steps for this app and similar artifacts that already exist.",'- list {scope: "mine" | "all" | "types", type?, query?}: find existing artifacts, or the installed types.',"- publish {type_url, title, folder?, open?}: create an artifact; the result carries its root folder and the type's instructions. publish {url, files, if_match?, check?}: write files when you have no file tools of your own. A page artifact also takes capabilities (on create or write): the runtime capabilities its page may use.","- read {url, path? | paths?}: the artifact's record, files and actions, or some of its files with their sha256. read {type_url}: a type's instructions, before creating.",`- open {url, panel?}: show it to the person in the computer's browser (or the app, when it shows pages), once its content is written. When your app has a built-in browser, open view_url there instead. panel "share" or "export" opens its Share panel or Export tab for them.`,"- call {url, name, args?}: run one of the type's actions (check, upload, ...). A long one answers {task, pending: true}; its result comes later as a message.","- adopt {url | folder}: take over an artifact, or add an existing folder. Only when the person asks.","- share {url}: whether it is shared on the local network, and its links. Only the person changes that, in the page's Share panel.","- delete {url}: forget an artifact; its folder stays. Only when the person asks."].join(`
|
|
10
|
+
`).replace(CH,"")}function FM(a,c){return c=$M(c),$M(a)===c}function Kt(a,c,f,m,x,v){switch(f){case"children":typeof m=="string"?c==="body"||c==="textarea"&&m===""||fc(a,m):(typeof m=="number"||typeof m=="bigint")&&c!=="body"&&fc(a,""+m);break;case"className":vp(a,"class",m);break;case"tabIndex":vp(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":vp(a,f,m);break;case"style":FT(a,m,v);break;case"data":if(c!=="object"){vp(a,"data",m);break}case"src":case"href":if(m===""&&(c!=="a"||f!=="href")){a.removeAttribute(f);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Sp(""+m),a.setAttribute(f,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(f==="formAction"?(c!=="input"&&Kt(a,c,"name",x.name,x,null),Kt(a,c,"formEncType",x.formEncType,x,null),Kt(a,c,"formMethod",x.formMethod,x,null),Kt(a,c,"formTarget",x.formTarget,x,null)):(Kt(a,c,"encType",x.encType,x,null),Kt(a,c,"method",x.method,x,null),Kt(a,c,"target",x.target,x,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Sp(""+m),a.setAttribute(f,m);break;case"onClick":m!=null&&(a.onclick=Mi);break;case"onScroll":m!=null&&xt("scroll",a);break;case"onScrollEnd":m!=null&&xt("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(o(61));if(f=m.__html,f!=null){if(x.children!=null)throw Error(o(60));a.innerHTML=f}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}f=Sp(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""+m):a.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""):a.removeAttribute(f);break;case"capture":case"download":m===!0?a.setAttribute(f,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,m):a.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(f,m):a.removeAttribute(f);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(f):a.setAttribute(f,m);break;case"popover":xt("beforetoggle",a),xt("toggle",a),xp(a,"popover",m);break;case"xlinkActuate":_i(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":_i(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":_i(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":_i(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":_i(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":_i(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":_i(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":_i(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":_i(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":xp(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=Z6.get(f)||f,xp(a,f,m))}}function a0(a,c,f,m,x,v){switch(f){case"style":FT(a,m,v);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(o(61));if(f=m.__html,f!=null){if(x.children!=null)throw Error(o(60));a.innerHTML=f}}break;case"children":typeof m=="string"?fc(a,m):(typeof m=="number"||typeof m=="bigint")&&fc(a,""+m);break;case"onScroll":m!=null&&xt("scroll",a);break;case"onScrollEnd":m!=null&&xt("scrollend",a);break;case"onClick":m!=null&&(a.onclick=Mi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!RT.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(x=f.endsWith("Capture"),c=f.slice(2,x?f.length-7:void 0),v=a[Co]||null,v=v!=null?v[f]:null,typeof v=="function"&&a.removeEventListener(c,v,x),typeof m=="function")){typeof v!="function"&&v!==null&&(f in a?a[f]=null:a.hasAttribute(f)&&a.removeAttribute(f)),a.addEventListener(c,m,x);break e}f in a?a[f]=m:m===!0?a.setAttribute(f,""):xp(a,f,m)}}}function Gn(a,c,f){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xt("error",a),xt("load",a);var m=!1,x=!1,v;for(v in f)if(f.hasOwnProperty(v)){var A=f[v];if(A!=null)switch(v){case"src":m=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,c));default:Kt(a,c,v,A,f,null)}}x&&Kt(a,c,"srcSet",f.srcSet,f,null),m&&Kt(a,c,"src",f.src,f,null);return;case"input":xt("invalid",a);var L=v=A=x=null,V=null,ee=null;for(m in f)if(f.hasOwnProperty(m)){var ae=f[m];if(ae!=null)switch(m){case"name":x=ae;break;case"type":A=ae;break;case"checked":V=ae;break;case"defaultChecked":ee=ae;break;case"value":v=ae;break;case"defaultValue":L=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(o(137,c));break;default:Kt(a,c,m,ae,f,null)}}zT(a,v,L,V,ee,A,x,!1);return;case"select":xt("invalid",a),m=A=v=null;for(x in f)if(f.hasOwnProperty(x)&&(L=f[x],L!=null))switch(x){case"value":v=L;break;case"defaultValue":A=L;break;case"multiple":m=L;default:Kt(a,c,x,L,f,null)}c=v,f=A,a.multiple=!!m,c!=null?dc(a,!!m,c,!1):f!=null&&dc(a,!!m,f,!0);return;case"textarea":xt("invalid",a),v=x=m=null;for(A in f)if(f.hasOwnProperty(A)&&(L=f[A],L!=null))switch(A){case"value":m=L;break;case"defaultValue":x=L;break;case"children":v=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(o(91));break;default:Kt(a,c,A,L,f,null)}LT(a,m,x,v);return;case"option":for(V in f)f.hasOwnProperty(V)&&(m=f[V],m!=null)&&(V==="selected"?a.selected=m&&typeof m!="function"&&typeof m!="symbol":Kt(a,c,V,m,f,null));return;case"dialog":xt("beforetoggle",a),xt("toggle",a),xt("cancel",a),xt("close",a);break;case"iframe":case"object":xt("load",a);break;case"video":case"audio":for(m=0;m<$d.length;m++)xt($d[m],a);break;case"image":xt("error",a),xt("load",a);break;case"details":xt("toggle",a);break;case"embed":case"source":case"link":xt("error",a),xt("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in f)if(f.hasOwnProperty(ee)&&(m=f[ee],m!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,c));default:Kt(a,c,ee,m,f,null)}return;default:if(vw(c)){for(ae in f)f.hasOwnProperty(ae)&&(m=f[ae],m!==void 0&&a0(a,c,ae,m,f,void 0));return}}for(L in f)f.hasOwnProperty(L)&&(m=f[L],m!=null&&Kt(a,c,L,m,f,null))}function TH(a,c,f,m){switch(c){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,v=null,A=null,L=null,V=null,ee=null,ae=null;for(se in f){var ue=f[se];if(f.hasOwnProperty(se)&&ue!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":V=ue;default:m.hasOwnProperty(se)||Kt(a,c,se,null,m,ue)}}for(var te in m){var se=m[te];if(ue=f[te],m.hasOwnProperty(te)&&(se!=null||ue!=null))switch(te){case"type":v=se;break;case"name":x=se;break;case"checked":ee=se;break;case"defaultChecked":ae=se;break;case"value":A=se;break;case"defaultValue":L=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(o(137,c));break;default:se!==ue&&Kt(a,c,te,se,m,ue)}}ww(a,A,L,V,ee,ae,v,x);return;case"select":se=A=L=te=null;for(v in f)if(V=f[v],f.hasOwnProperty(v)&&V!=null)switch(v){case"value":break;case"multiple":se=V;default:m.hasOwnProperty(v)||Kt(a,c,v,null,m,V)}for(x in m)if(v=m[x],V=f[x],m.hasOwnProperty(x)&&(v!=null||V!=null))switch(x){case"value":te=v;break;case"defaultValue":L=v;break;case"multiple":A=v;default:v!==V&&Kt(a,c,x,v,m,V)}c=L,f=A,m=se,te!=null?dc(a,!!f,te,!1):!!m!=!!f&&(c!=null?dc(a,!!f,c,!0):dc(a,!!f,f?[]:"",!1));return;case"textarea":se=te=null;for(L in f)if(x=f[L],f.hasOwnProperty(L)&&x!=null&&!m.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Kt(a,c,L,null,m,x)}for(A in m)if(x=m[A],v=f[A],m.hasOwnProperty(A)&&(x!=null||v!=null))switch(A){case"value":te=x;break;case"defaultValue":se=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(o(91));break;default:x!==v&&Kt(a,c,A,x,m,v)}IT(a,te,se);return;case"option":for(var Ne in f)te=f[Ne],f.hasOwnProperty(Ne)&&te!=null&&!m.hasOwnProperty(Ne)&&(Ne==="selected"?a.selected=!1:Kt(a,c,Ne,null,m,te));for(V in m)te=m[V],se=f[V],m.hasOwnProperty(V)&&te!==se&&(te!=null||se!=null)&&(V==="selected"?a.selected=te&&typeof te!="function"&&typeof te!="symbol":Kt(a,c,V,te,m,se));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Xe in f)te=f[Xe],f.hasOwnProperty(Xe)&&te!=null&&!m.hasOwnProperty(Xe)&&Kt(a,c,Xe,null,m,te);for(ee in m)if(te=m[ee],se=f[ee],m.hasOwnProperty(ee)&&te!==se&&(te!=null||se!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(o(137,c));break;default:Kt(a,c,ee,te,m,se)}return;default:if(vw(c)){for(var Wt in f)te=f[Wt],f.hasOwnProperty(Wt)&&te!==void 0&&!m.hasOwnProperty(Wt)&&a0(a,c,Wt,void 0,m,te);for(ae in m)te=m[ae],se=f[ae],!m.hasOwnProperty(ae)||te===se||te===void 0&&se===void 0||a0(a,c,ae,te,m,se);return}}for(var Q in f)te=f[Q],f.hasOwnProperty(Q)&&te!=null&&!m.hasOwnProperty(Q)&&Kt(a,c,Q,null,m,te);for(ue in m)te=m[ue],se=f[ue],!m.hasOwnProperty(ue)||te===se||te==null&&se==null||Kt(a,c,ue,te,m,se)}function HM(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function EH(){if(typeof performance.getEntriesByType=="function"){for(var a=0,c=0,f=performance.getEntriesByType("resource"),m=0;m<f.length;m++){var x=f[m],v=x.transferSize,A=x.initiatorType,L=x.duration;if(v&&L&&HM(A)){for(A=0,L=x.responseEnd,m+=1;m<f.length;m++){var V=f[m],ee=V.startTime;if(ee>L)break;var ae=V.transferSize,ue=V.initiatorType;ae&&HM(ue)&&(V=V.responseEnd,A+=ae*(V<L?1:(L-ee)/(V-ee)))}if(--m,c+=8*(v+A)/(x.duration/1e3),a++,10<a)break}}if(0<a)return c/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var l0=null,c0=null;function bm(a){return a.nodeType===9?a:a.ownerDocument}function qM(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function UM(a,c){if(a===0)switch(c){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&c==="foreignObject"?0:a}function u0(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.children=="bigint"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var d0=null;function _H(){var a=window.event;return a&&a.type==="popstate"?a===d0?!1:(d0=a,!0):(d0=null,!1)}var VM=typeof setTimeout=="function"?setTimeout:void 0,MH=typeof clearTimeout=="function"?clearTimeout:void 0,KM=typeof Promise=="function"?Promise:void 0,OH=typeof queueMicrotask=="function"?queueMicrotask:typeof KM<"u"?function(a){return KM.resolve(null).then(a).catch(AH)}:VM;function AH(a){setTimeout(function(){throw a})}function Xr(a){return a==="head"}function WM(a,c){var f=c,m=0;do{var x=f.nextSibling;if(a.removeChild(f),x&&x.nodeType===8)if(f=x.data,f==="/$"||f==="/&"){if(m===0){a.removeChild(x),qc(c);return}m--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")m++;else if(f==="html")Hd(a.ownerDocument.documentElement);else if(f==="head"){f=a.ownerDocument.head,Hd(f);for(var v=f.firstChild;v;){var A=v.nextSibling,L=v.nodeName;v[rd]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&v.rel.toLowerCase()==="stylesheet"||f.removeChild(v),v=A}}else f==="body"&&Hd(a.ownerDocument.body);f=x}while(f);qc(c)}function YM(a,c){var f=a;a=0;do{var m=f.nextSibling;if(f.nodeType===1?c?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(c?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),m&&m.nodeType===8)if(f=m.data,f==="/$"){if(a===0)break;a--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||a++;f=m}while(f)}function f0(a){var c=a.firstChild;for(c&&c.nodeType===10&&(c=c.nextSibling);c;){var f=c;switch(c=c.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":f0(f),yw(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}a.removeChild(f)}}function RH(a,c,f,m){for(;a.nodeType===1;){var x=f;if(a.nodeName.toLowerCase()!==c.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[rd])switch(c){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(v=a.getAttribute("rel"),v==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(v!==x.rel||a.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||a.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||a.getAttribute("title")!==(x.title==null?null:x.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(v=a.getAttribute("src"),(v!==(x.src==null?null:x.src)||a.getAttribute("type")!==(x.type==null?null:x.type)||a.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&v&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(c==="input"&&a.type==="hidden"){var v=x.name==null?null:""+x.name;if(x.type==="hidden"&&a.getAttribute("name")===v)return a}else return a;if(a=ws(a.nextSibling),a===null)break}return null}function NH(a,c,f){if(c==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!f||(a=ws(a.nextSibling),a===null))return null;return a}function GM(a,c){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=ws(a.nextSibling),a===null))return null;return a}function h0(a){return a.data==="$?"||a.data==="$~"}function p0(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function DH(a,c){var f=a.ownerDocument;if(a.data==="$~")a._reactRetry=c;else if(a.data!=="$?"||f.readyState!=="loading")c();else{var m=function(){c(),f.removeEventListener("DOMContentLoaded",m)};f.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function ws(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"||c==="F!"||c==="F")break;if(c==="/$"||c==="/&")return null}}return a}var m0=null;function XM(a){a=a.nextSibling;for(var c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"||f==="/&"){if(c===0)return ws(a.nextSibling);c--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||c++}a=a.nextSibling}return null}function JM(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(c===0)return a;c--}else f!=="/$"&&f!=="/&"||c++}a=a.previousSibling}return null}function QM(a,c,f){switch(c=bm(f),a){case"html":if(a=c.documentElement,!a)throw Error(o(452));return a;case"head":if(a=c.head,!a)throw Error(o(453));return a;case"body":if(a=c.body,!a)throw Error(o(454));return a;default:throw Error(o(451))}}function Hd(a){for(var c=a.attributes;c.length;)a.removeAttributeNode(c[0]);yw(a)}var xs=new Map,ZM=new Set;function wm(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Vi=q.d;q.d={f:PH,r:BH,D:zH,C:IH,L:LH,m:$H,X:HH,S:FH,M:qH};function PH(){var a=Vi.f(),c=um();return a||c}function BH(a){var c=lc(a);c!==null&&c.tag===5&&c.type==="form"?g_(c):Vi.r(a)}var $c=typeof document>"u"?null:document;function eO(a,c,f){var m=$c;if(m&&typeof c=="string"&&c){var x=fs(c);x='link[rel="'+a+'"][href="'+x+'"]',typeof f=="string"&&(x+='[crossorigin="'+f+'"]'),ZM.has(x)||(ZM.add(x),a={rel:a,crossOrigin:f,href:c},m.querySelector(x)===null&&(c=m.createElement("link"),Gn(c,"link",a),$n(c),m.head.appendChild(c)))}}function zH(a){Vi.D(a),eO("dns-prefetch",a,null)}function IH(a,c){Vi.C(a,c),eO("preconnect",a,c)}function LH(a,c,f){Vi.L(a,c,f);var m=$c;if(m&&a&&c){var x='link[rel="preload"][as="'+fs(c)+'"]';c==="image"&&f&&f.imageSrcSet?(x+='[imagesrcset="'+fs(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(x+='[imagesizes="'+fs(f.imageSizes)+'"]')):x+='[href="'+fs(a)+'"]';var v=x;switch(c){case"style":v=Fc(a);break;case"script":v=Hc(a)}xs.has(v)||(a=p({rel:"preload",href:c==="image"&&f&&f.imageSrcSet?void 0:a,as:c},f),xs.set(v,a),m.querySelector(x)!==null||c==="style"&&m.querySelector(qd(v))||c==="script"&&m.querySelector(Ud(v))||(c=m.createElement("link"),Gn(c,"link",a),$n(c),m.head.appendChild(c)))}}function $H(a,c){Vi.m(a,c);var f=$c;if(f&&a){var m=c&&typeof c.as=="string"?c.as:"script",x='link[rel="modulepreload"][as="'+fs(m)+'"][href="'+fs(a)+'"]',v=x;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Hc(a)}if(!xs.has(v)&&(a=p({rel:"modulepreload",href:a},c),xs.set(v,a),f.querySelector(x)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Ud(v)))return}m=f.createElement("link"),Gn(m,"link",a),$n(m),f.head.appendChild(m)}}}function FH(a,c,f){Vi.S(a,c,f);var m=$c;if(m&&a){var x=cc(m).hoistableStyles,v=Fc(a);c=c||"default";var A=x.get(v);if(!A){var L={loading:0,preload:null};if(A=m.querySelector(qd(v)))L.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":c},f),(f=xs.get(v))&&g0(a,f);var V=A=m.createElement("link");$n(V),Gn(V,"link",a),V._p=new Promise(function(ee,ae){V.onload=ee,V.onerror=ae}),V.addEventListener("load",function(){L.loading|=1}),V.addEventListener("error",function(){L.loading|=2}),L.loading|=4,xm(A,c,m)}A={type:"stylesheet",instance:A,count:1,state:L},x.set(v,A)}}}function HH(a,c){Vi.X(a,c);var f=$c;if(f&&a){var m=cc(f).hoistableScripts,x=Hc(a),v=m.get(x);v||(v=f.querySelector(Ud(x)),v||(a=p({src:a,async:!0},c),(c=xs.get(x))&&y0(a,c),v=f.createElement("script"),$n(v),Gn(v,"link",a),f.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},m.set(x,v))}}function qH(a,c){Vi.M(a,c);var f=$c;if(f&&a){var m=cc(f).hoistableScripts,x=Hc(a),v=m.get(x);v||(v=f.querySelector(Ud(x)),v||(a=p({src:a,async:!0,type:"module"},c),(c=xs.get(x))&&y0(a,c),v=f.createElement("script"),$n(v),Gn(v,"link",a),f.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},m.set(x,v))}}function tO(a,c,f,m){var x=(x=ie.current)?wm(x):null;if(!x)throw Error(o(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(c=Fc(f.href),f=cc(x).hoistableStyles,m=f.get(c),m||(m={type:"style",instance:null,count:0,state:null},f.set(c,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=Fc(f.href);var v=cc(x).hoistableStyles,A=v.get(a);if(A||(x=x.ownerDocument||x,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(a,A),(v=x.querySelector(qd(a)))&&!v._p&&(A.instance=v,A.state.loading=5),xs.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},xs.set(a,f),v||UH(x,a,f,A.state))),c&&m===null)throw Error(o(528,""));return A}if(c&&m!==null)throw Error(o(529,""));return null;case"script":return c=f.async,f=f.src,typeof f=="string"&&c&&typeof c!="function"&&typeof c!="symbol"?(c=Hc(f),f=cc(x).hoistableScripts,m=f.get(c),m||(m={type:"script",instance:null,count:0,state:null},f.set(c,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,a))}}function Fc(a){return'href="'+fs(a)+'"'}function qd(a){return'link[rel="stylesheet"]['+a+"]"}function nO(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function UH(a,c,f,m){a.querySelector('link[rel="preload"][as="style"]['+c+"]")?m.loading=1:(c=a.createElement("link"),m.preload=c,c.addEventListener("load",function(){return m.loading|=1}),c.addEventListener("error",function(){return m.loading|=2}),Gn(c,"link",f),$n(c),a.head.appendChild(c))}function Hc(a){return'[src="'+fs(a)+'"]'}function Ud(a){return"script[async]"+a}function oO(a,c,f){if(c.count++,c.instance===null)switch(c.type){case"style":var m=a.querySelector('style[data-href~="'+fs(f.href)+'"]');if(m)return c.instance=m,$n(m),m;var x=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),$n(m),Gn(m,"style",x),xm(m,f.precedence,a),c.instance=m;case"stylesheet":x=Fc(f.href);var v=a.querySelector(qd(x));if(v)return c.state.loading|=4,c.instance=v,$n(v),v;m=nO(f),(x=xs.get(x))&&g0(m,x),v=(a.ownerDocument||a).createElement("link"),$n(v);var A=v;return A._p=new Promise(function(L,V){A.onload=L,A.onerror=V}),Gn(v,"link",m),c.state.loading|=4,xm(v,f.precedence,a),c.instance=v;case"script":return v=Hc(f.src),(x=a.querySelector(Ud(v)))?(c.instance=x,$n(x),x):(m=f,(x=xs.get(v))&&(m=p({},f),y0(m,x)),a=a.ownerDocument||a,x=a.createElement("script"),$n(x),Gn(x,"link",m),a.head.appendChild(x),c.instance=x);case"void":return null;default:throw Error(o(443,c.type))}else c.type==="stylesheet"&&(c.state.loading&4)===0&&(m=c.instance,c.state.loading|=4,xm(m,f.precedence,a));return c.instance}function xm(a,c,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=m.length?m[m.length-1]:null,v=x,A=0;A<m.length;A++){var L=m[A];if(L.dataset.precedence===c)v=L;else if(v!==x)break}v?v.parentNode.insertBefore(a,v.nextSibling):(c=f.nodeType===9?f.head:f,c.insertBefore(a,c.firstChild))}function g0(a,c){a.crossOrigin==null&&(a.crossOrigin=c.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=c.referrerPolicy),a.title==null&&(a.title=c.title)}function y0(a,c){a.crossOrigin==null&&(a.crossOrigin=c.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=c.referrerPolicy),a.integrity==null&&(a.integrity=c.integrity)}var vm=null;function sO(a,c,f){if(vm===null){var m=new Map,x=vm=new Map;x.set(f,m)}else x=vm,m=x.get(f),m||(m=new Map,x.set(f,m));if(m.has(a))return m;for(m.set(a,null),f=f.getElementsByTagName(a),x=0;x<f.length;x++){var v=f[x];if(!(v[rd]||v[Vn]||a==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var A=v.getAttribute(c)||"";A=a+A;var L=m.get(A);L?L.push(v):m.set(A,[v])}}return m}function iO(a,c,f){a=a.ownerDocument||a,a.head.insertBefore(f,c==="title"?a.querySelector("head > title"):null)}function VH(a,c,f){if(f===1||c.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof c.precedence!="string"||typeof c.href!="string"||c.href==="")break;return!0;case"link":if(typeof c.rel!="string"||typeof c.href!="string"||c.href===""||c.onLoad||c.onError)break;return c.rel==="stylesheet"?(a=c.disabled,typeof c.precedence=="string"&&a==null):!0;case"script":if(c.async&&typeof c.async!="function"&&typeof c.async!="symbol"&&!c.onLoad&&!c.onError&&c.src&&typeof c.src=="string")return!0}return!1}function rO(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function KH(a,c,f,m){if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var x=Fc(m.href),v=c.querySelector(qd(x));if(v){c=v._p,c!==null&&typeof c=="object"&&typeof c.then=="function"&&(a.count++,a=km.bind(a),c.then(a,a)),f.state.loading|=4,f.instance=v,$n(v);return}v=c.ownerDocument||c,m=nO(m),(x=xs.get(x))&&g0(m,x),v=v.createElement("link"),$n(v);var A=v;A._p=new Promise(function(L,V){A.onload=L,A.onerror=V}),Gn(v,"link",m),f.instance=v}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,c),(c=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=km.bind(a),c.addEventListener("load",f),c.addEventListener("error",f))}}var b0=0;function WH(a,c){return a.stylesheets&&a.count===0&&jm(a,a.stylesheets),0<a.count||0<a.imgCount?function(f){var m=setTimeout(function(){if(a.stylesheets&&jm(a,a.stylesheets),a.unsuspend){var v=a.unsuspend;a.unsuspend=null,v()}},6e4+c);0<a.imgBytes&&b0===0&&(b0=62500*EH());var x=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&jm(a,a.stylesheets),a.unsuspend)){var v=a.unsuspend;a.unsuspend=null,v()}},(a.imgBytes>b0?50:800)+c);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(x)}}:null}function km(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)jm(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Sm=null;function jm(a,c){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Sm=new Map,c.forEach(YH,a),Sm=null,km.call(a))}function YH(a,c){if(!(c.state.loading&4)){var f=Sm.get(a);if(f)var m=f.get(null);else{f=new Map,Sm.set(a,f);for(var x=a.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<x.length;v++){var A=x[v];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(f.set(A.dataset.precedence,A),m=A)}m&&f.set(null,m)}x=c.instance,A=x.getAttribute("data-precedence"),v=f.get(A)||m,v===m&&f.set(null,x),f.set(A,x),this.count++,m=km.bind(this),x.addEventListener("load",m),x.addEventListener("error",m),v?v.parentNode.insertBefore(x,v.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(x,a.firstChild)),c.state.loading|=4}}var Vd={$$typeof:T,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function GH(a,c,f,m,x,v,A,L,V){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_r(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_r(0),this.hiddenUpdates=_r(null),this.identifierPrefix=m,this.onUncaughtError=x,this.onCaughtError=v,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function aO(a,c,f,m,x,v,A,L,V,ee,ae,ue){return a=new GH(a,c,f,A,V,ee,ae,ue,L),c=1,v===!0&&(c|=24),v=Vo(3,null,null,c),a.current=v,v.stateNode=a,c=Jw(),c.refCount++,a.pooledCache=c,c.refCount++,v.memoizedState={element:m,isDehydrated:f,cache:c},tx(v),a}function lO(a){return a?(a=wc,a):wc}function cO(a,c,f,m,x,v){x=lO(x),m.context===null?m.context=x:m.pendingContext=x,m=Lr(c),m.payload={element:f},v=v===void 0?null:v,v!==null&&(m.callback=v),f=$r(a,m,c),f!==null&&(Ao(f,a,c),Sd(f,a,c))}function uO(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<c?f:c}}function w0(a,c){uO(a,c),(a=a.alternate)&&uO(a,c)}function dO(a){if(a.tag===13||a.tag===31){var c=tl(a,67108864);c!==null&&Ao(c,a,67108864),w0(a,67108864)}}function fO(a){if(a.tag===13||a.tag===31){var c=Xo();c=Ar(c);var f=tl(a,c);f!==null&&Ao(f,a,c),w0(a,c)}}var Cm=!0;function XH(a,c,f,m){var x=F.T;F.T=null;var v=q.p;try{q.p=2,x0(a,c,f,m)}finally{q.p=v,F.T=x}}function JH(a,c,f,m){var x=F.T;F.T=null;var v=q.p;try{q.p=8,x0(a,c,f,m)}finally{q.p=v,F.T=x}}function x0(a,c,f,m){if(Cm){var x=v0(m);if(x===null)r0(a,c,m,Tm,f),pO(a,m);else if(ZH(x,a,c,f,m))m.stopPropagation();else if(pO(a,m),c&4&&-1<QH.indexOf(a)){for(;x!==null;){var v=lc(x);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var A=un(v.pendingLanes);if(A!==0){var L=v;for(L.pendingLanes|=2,L.entangledLanes|=2;A;){var V=1<<31-Jt(A);L.entanglements[1]|=V,A&=~V}ri(v),(Nt&6)===0&&(lm=fe()+500,Ld(0))}}break;case 31:case 13:L=tl(v,2),L!==null&&Ao(L,v,2),um(),w0(v,2)}if(v=v0(m),v===null&&r0(a,c,m,Tm,f),v===x)break;x=v}x!==null&&m.stopPropagation()}else r0(a,c,m,null,f)}}function v0(a){return a=Sw(a),k0(a)}var Tm=null;function k0(a){if(Tm=null,a=ac(a),a!==null){var c=i(a);if(c===null)a=null;else{var f=c.tag;if(f===13){if(a=r(c),a!==null)return a;a=null}else if(f===31){if(a=l(c),a!==null)return a;a=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null)}}return Tm=a,null}function hO(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(xe()){case pe:return 2;case re:return 8;case ve:case Ze:return 32;case Ln:return 268435456;default:return 32}default:return 32}}var S0=!1,Jr=null,Qr=null,Zr=null,Kd=new Map,Wd=new Map,ea=[],QH="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function pO(a,c){switch(a){case"focusin":case"focusout":Jr=null;break;case"dragenter":case"dragleave":Qr=null;break;case"mouseover":case"mouseout":Zr=null;break;case"pointerover":case"pointerout":Kd.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wd.delete(c.pointerId)}}function Yd(a,c,f,m,x,v){return a===null||a.nativeEvent!==v?(a={blockedOn:c,domEventName:f,eventSystemFlags:m,nativeEvent:v,targetContainers:[x]},c!==null&&(c=lc(c),c!==null&&dO(c)),a):(a.eventSystemFlags|=m,c=a.targetContainers,x!==null&&c.indexOf(x)===-1&&c.push(x),a)}function ZH(a,c,f,m,x){switch(c){case"focusin":return Jr=Yd(Jr,a,c,f,m,x),!0;case"dragenter":return Qr=Yd(Qr,a,c,f,m,x),!0;case"mouseover":return Zr=Yd(Zr,a,c,f,m,x),!0;case"pointerover":var v=x.pointerId;return Kd.set(v,Yd(Kd.get(v)||null,a,c,f,m,x)),!0;case"gotpointercapture":return v=x.pointerId,Wd.set(v,Yd(Wd.get(v)||null,a,c,f,m,x)),!0}return!1}function mO(a){var c=ac(a.target);if(c!==null){var f=i(c);if(f!==null){if(c=f.tag,c===13){if(c=r(f),c!==null){a.blockedOn=c,wp(a.priority,function(){fO(f)});return}}else if(c===31){if(c=l(f),c!==null){a.blockedOn=c,wp(a.priority,function(){fO(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Em(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var f=v0(a.nativeEvent);if(f===null){f=a.nativeEvent;var m=new f.constructor(f.type,f);kw=m,f.target.dispatchEvent(m),kw=null}else return c=lc(f),c!==null&&dO(c),a.blockedOn=f,!1;c.shift()}return!0}function gO(a,c,f){Em(a)&&f.delete(c)}function eq(){S0=!1,Jr!==null&&Em(Jr)&&(Jr=null),Qr!==null&&Em(Qr)&&(Qr=null),Zr!==null&&Em(Zr)&&(Zr=null),Kd.forEach(gO),Wd.forEach(gO)}function _m(a,c){a.blockedOn===c&&(a.blockedOn=null,S0||(S0=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,eq)))}var Mm=null;function yO(a){Mm!==a&&(Mm=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Mm===a&&(Mm=null);for(var c=0;c<a.length;c+=3){var f=a[c],m=a[c+1],x=a[c+2];if(typeof m!="function"){if(k0(m||f)===null)continue;break}var v=lc(f);v!==null&&(a.splice(c,3),c-=3,vx(v,{pending:!0,data:x,method:f.method,action:m},m,x))}}))}function qc(a){function c(V){return _m(V,a)}Jr!==null&&_m(Jr,a),Qr!==null&&_m(Qr,a),Zr!==null&&_m(Zr,a),Kd.forEach(c),Wd.forEach(c);for(var f=0;f<ea.length;f++){var m=ea[f];m.blockedOn===a&&(m.blockedOn=null)}for(;0<ea.length&&(f=ea[0],f.blockedOn===null);)mO(f),f.blockedOn===null&&ea.shift();if(f=(a.ownerDocument||a).$$reactFormReplay,f!=null)for(m=0;m<f.length;m+=3){var x=f[m],v=f[m+1],A=x[Co]||null;if(typeof v=="function")A||yO(f);else if(A){var L=null;if(v&&v.hasAttribute("formAction")){if(x=v,A=v[Co]||null)L=A.formAction;else if(k0(x)!==null)continue}else L=A.action;typeof L=="function"?f[m+1]=L:(f.splice(m,3),m-=3),yO(f)}}}function bO(){function a(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(A){return x=A})},focusReset:"manual",scroll:"manual"})}function c(){x!==null&&(x(),x=null),m||setTimeout(f,20)}function f(){if(!m&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,x=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",c),navigation.addEventListener("navigateerror",c),setTimeout(f,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",c),navigation.removeEventListener("navigateerror",c),x!==null&&(x(),x=null)}}}function j0(a){this._internalRoot=a}Om.prototype.render=j0.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(o(409));var f=c.current,m=Xo();cO(f,m,a,c,null,null)},Om.prototype.unmount=j0.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;cO(a.current,2,null,a,null,null),um(),c[rc]=null}};function Om(a){this._internalRoot=a}Om.prototype.unstable_scheduleHydration=function(a){if(a){var c=bp();a={blockedOn:null,target:a,priority:c};for(var f=0;f<ea.length&&c!==0&&c<ea[f].priority;f++);ea.splice(f,0,a),f===0&&mO(a)}};var wO=e.version;if(wO!=="19.2.4")throw Error(o(527,wO,"19.2.4"));q.findDOMNode=function(a){var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(o(188)):(a=Object.keys(a).join(","),Error(o(268,a)));return a=d(c),a=a!==null?h(a):null,a=a===null?null:a.stateNode,a};var tq={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Am=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Am.isDisabled&&Am.supportsFiber)try{Te=Am.inject(tq),rt=Am}catch{}}return Xd.createRoot=function(a,c){if(!s(a))throw Error(o(299));var f=!1,m="",x=T_,v=E_,A=__;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(m=c.identifierPrefix),c.onUncaughtError!==void 0&&(x=c.onUncaughtError),c.onCaughtError!==void 0&&(v=c.onCaughtError),c.onRecoverableError!==void 0&&(A=c.onRecoverableError)),c=aO(a,1,!1,null,null,f,m,null,x,v,A,bO),a[rc]=c.current,i0(a),new j0(c)},Xd.hydrateRoot=function(a,c,f){if(!s(a))throw Error(o(299));var m=!1,x="",v=T_,A=E_,L=__,V=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(x=f.identifierPrefix),f.onUncaughtError!==void 0&&(v=f.onUncaughtError),f.onCaughtError!==void 0&&(A=f.onCaughtError),f.onRecoverableError!==void 0&&(L=f.onRecoverableError),f.formState!==void 0&&(V=f.formState)),c=aO(a,1,!0,c,f??null,m,x,V,v,A,L,bO),c.context=lO(null),f=c.current,m=Xo(),m=Ar(m),x=Lr(m),x.callback=null,$r(f,x,m),f=m,c.current.lanes=f,us(c,f),ri(c),a[rc]=c.current,i0(a),new Om(c)},Xd.version="19.2.4",Xd}var MO;function hq(){if(MO)return E0.exports;MO=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),E0.exports=fq(),E0.exports}var tP=hq();function Rn(){}const br=Object.freeze([]),nn=Object.freeze({});function lS({controlled:t,default:e,name:n,state:o="value"}){const{current:s}=S.useRef(t!==void 0),[i,r]=S.useState(e),l=s&&t!==void 0?t:i,u=S.useCallback(d=>{s||r(d)},[]);return[l,u]}const pq=()=>{},Se=typeof document<"u"?S.useLayoutEffect:pq,OO={};function qn(t,e){const n=S.useRef(OO);return n.current===OO&&(n.current=t(e)),n}function Ra(t,e,n,o){const s=qn(nP).current;return gq(s,t,e,n,o)&&oP(s,[t,e,n,o]),s.callback}function mq(t){const e=qn(nP).current;return yq(e,t)&&oP(e,t),e.callback}function nP(){return{callback:null,cleanup:null,refs:[]}}function gq(t,e,n,o,s){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==o||t.refs[3]!==s}function yq(t,e){return t.refs.length!==e.length||t.refs.some((n,o)=>n!==e[o])}function oP(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const o=Array(e.length).fill(null);for(let s=0;s<e.length;s+=1){const i=e[s];if(i!=null)switch(typeof i){case"function":{const r=i(n);typeof r=="function"&&(o[s]=r);break}case"object":{i.current=n;break}}}t.cleanup=()=>{for(let s=0;s<e.length;s+=1){const i=e[s];if(i!=null)switch(typeof i){case"function":{const r=o[s];typeof r=="function"?r():i(null);break}case"object":{i.current=null;break}}}}}}}const sP={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},cS={...sP,position:"fixed",top:0,left:0},bq={...sP,position:"absolute"};function Uy(){return typeof window<"u"}function oo(t){return uS(t)?(t.nodeName||"").toLowerCase():"#document"}function on(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Er(t){var e;return(e=(uS(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function uS(t){return Uy()?t instanceof Node||t instanceof on(t).Node:!1}function vt(t){return Uy()?t instanceof Element||t instanceof on(t).Element:!1}function Ft(t){return Uy()?t instanceof HTMLElement||t instanceof on(t).HTMLElement:!1}function ku(t){return!Uy()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof on(t).ShadowRoot}function Ih(t){const{overflow:e,overflowX:n,overflowY:o,display:s}=is(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&s!=="inline"&&s!=="contents"}function wq(t){return/^(table|td|th)$/.test(oo(t))}function Vy(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const xq=/transform|translate|scale|rotate|perspective|filter/,vq=/paint|layout|strict|content/,pl=t=>!!t&&t!=="none";let A0;function dS(t){const e=vt(t)?is(t):t;return pl(e.transform)||pl(e.translate)||pl(e.scale)||pl(e.rotate)||pl(e.perspective)||!fS()&&(pl(e.backdropFilter)||pl(e.filter))||xq.test(e.willChange||"")||vq.test(e.contain||"")}function kq(t){let e=wr(t);for(;Ft(e)&&!ur(e);){if(dS(e))return e;if(Vy(e))return null;e=wr(e)}return null}function fS(){return A0==null&&(A0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),A0}function ur(t){return/^(html|body|#document)$/.test(oo(t))}function is(t){return on(t).getComputedStyle(t)}function Ky(t){return vt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function wr(t){if(oo(t)==="html")return t;const e=t.assignedSlot||t.parentNode||ku(t)&&t.host||Er(t);return ku(e)?e.host:e}function iP(t){const e=wr(t);return ur(e)?(t.ownerDocument||t).body:Ft(e)&&Ih(e)?e:iP(e)}function Kf(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=iP(t),i=s===((o=t.ownerDocument)==null?void 0:o.body),r=on(s);if(i){const l=hk(r);return e.concat(r,r.visualViewport||[],Ih(s)?s:[],l&&n?Kf(l):[])}else return e.concat(s,Kf(s,[],n))}function hk(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function yt(t){return t?.ownerDocument||document}const Sq="data-valid",jq="data-invalid",Cq={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Tq={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},Eq={disabled:!1,...Tq},_q={valid(t){return t===null?null:t?{[Sq]:""}:{[jq]:""}}};function Tf(t,e,{detail:n=0}={}){t.dispatchEvent(new(on(t)).PointerEvent("click",{bubbles:!0,cancelable:!0,composed:!0,detail:n,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey}))}function Mq(t,e){return function(o,...s){const i=new URL(t);return i.searchParams.set("code",o.toString()),s.forEach(r=>i.searchParams.append("args[]",r)),`${e} error #${o}; visit ${i} for the full message.`}}const gn=Mq("https://base-ui.com/production-error","Base UI"),Oq=parseInt(S.version,10);function hS(t){return Oq>=t}function AO(t){if(!S.isValidElement(t))return null;const e=t,n=e.props;return(hS(19)?n?.ref:e.ref)??null}function pk(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function Aq(t,e){const n={};for(const o in t){const s=t[o];if(e?.hasOwnProperty(o)){const i=e[o](s);i!=null&&Object.assign(n,i);continue}s===!0?n[`data-${o.toLowerCase()}`]="":s&&(n[`data-${o.toLowerCase()}`]=s.toString())}return n}function Rq(t,e){return typeof t=="function"?t(e):t}function Nq(t,e){return typeof t=="function"?t(e):t}const pS={};function dr(t,e,n,o,s){if(!n&&!o&&!s&&!t)return Fg(e);let i=Fg(t);return e&&(i=hf(i,e)),n&&(i=hf(i,n)),o&&(i=hf(i,o)),s&&(i=hf(i,s)),i}function Dq(t){if(t.length===0)return pS;if(t.length===1)return Fg(t[0]);let e=Fg(t[0]);for(let n=1;n<t.length;n+=1)e=hf(e,t[n]);return e}function Fg(t){return mS(t)?{...aP(t,pS)}:Pq(t)}function hf(t,e){return mS(e)?aP(e,t):Bq(t,e)}function Pq(t){const e={...t};for(const n in e){const o=e[n];rP(n,o)&&(e[n]=lP(o))}return e}function Bq(t,e){if(!e)return t;for(const n in e){const o=e[n];switch(n){case"style":{t[n]=pk(t.style,o);break}case"className":{t[n]=cP(t.className,o);break}default:rP(n,o)?t[n]=zq(t[n],o):t[n]=o}}return t}function rP(t,e){const n=t.charCodeAt(0),o=t.charCodeAt(1),s=t.charCodeAt(2);return n===111&&o===110&&s>=65&&s<=90&&(typeof e=="function"||typeof e>"u")}function mS(t){return typeof t=="function"}function aP(t,e){return mS(t)?t(e):t??pS}function zq(t,e){return e?t?(...n)=>{const o=n[0];if(uP(o)){const i=o;Hg(i);const r=e(...n);return i.baseUIHandlerPrevented||t?.(...n),r}const s=e(...n);return t?.(...n),s}:lP(e):t}function lP(t){return t&&((...e)=>{const n=e[0];return uP(n)&&Hg(n),t(...e)})}function Hg(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function cP(t,e){return e?t?e+" "+t:e:t}function uP(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function Ht(t,e,n={}){let o=e.render;n.enabled!==!1&&(o=Fq(o));const s=Iq(e,n,o);if(n.enabled===!1)return null;const i=n.state??nn;return Hq(t,o,s,i)}function Iq(t,e,n){const{className:o,style:s}=t,{state:i=nn,ref:r,props:l,stateAttributesMapping:u,enabled:d=!0}=e,h=d?Rq(o,i):void 0,p=d?Nq(s,i):void 0,g=d?Aq(i,u):nn,b=d&&l?Lq(l):void 0,w=d?pk(g,b)??{}:nn;return typeof document<"u"&&(d?Array.isArray(r)?w.ref=mq([w.ref,AO(n),...r]):w.ref=Ra(w.ref,AO(n),r):Ra(null,null)),d?(h!==void 0&&(w.className=cP(w.className,h)),p!==void 0&&(w.style=pk(w.style,p)),w):nn}function Lq(t){return Array.isArray(t)?Dq(t):dr(void 0,t)}const $q=Symbol.for("react.lazy");function Fq(t){if(t?.$$typeof!==$q)return t;const e=S.Children.toArray(t)[0];return S.isValidElement(e)?e:t}function Hq(t,e,n,o){if(e){if(typeof e=="function")return e(n,o);const s=dr(n,e.props);return s.ref=n.ref,S.cloneElement(e,s)}if(t&&typeof t=="string")return qq(t,n);throw new Error(gn(8))}function qq(t,e){return t==="button"?S.createElement("button",{type:"button",...e,key:e.key}):t==="img"?S.createElement("img",{alt:"",...e,key:e.key}):S.createElement(t,e)}const gS={...lq};let RO=0;function Uq(t,e="mui"){const[n,o]=S.useState(t),s=t||n;return S.useEffect(()=>{n==null&&(RO+=1,o(`${e}-${RO}`))},[n,e]),s}const NO=gS.useId;function Ul(t,e){if(NO!==void 0){const n=NO();return t??(e?`${e}-${n}`:n)}return Uq(t,e)}function ei(t){return Ul(t,"base-ui")}const R0=gS.useInsertionEffect,Vq=R0&&R0!==gS.useLayoutEffect?R0:t=>t();function De(t){const e=qn(Kq).current;return e.next=t,Vq(e.effect),e.trampoline}function Kq(){const t={next:void 0,callback:Wq,trampoline:(...e)=>t.callback?.(...e),effect:()=>{t.callback=t.next}};return t}function Wq(){}const dP=S.createContext(void 0);function yS(t=!1){const e=S.useContext(dP);if(e===void 0&&!t)throw new Error(gn(16));return e}function Yq(t){const{focusableWhenDisabled:e,disabled:n,composite:o=!1,tabIndex:s=0,isNativeButton:i}=t,r=o&&e!==!1,l=o&&e===!1;return{props:S.useMemo(()=>{const d={onKeyDown(h){n&&e&&h.key!=="Tab"&&h.preventDefault()}};return o||(d.tabIndex=s,!i&&n&&(d.tabIndex=e?s:-1)),(i&&(e||r)||!i&&n)&&(d["aria-disabled"]=n),i&&(!e||l)&&(d.disabled=n),d},[o,n,e,r,l,i,s])}}function Fa(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:o=0,native:s=!0,composite:i}=t,r=S.useRef(null),l=yS(!0),u=i??l!==void 0,{props:d}=Yq({focusableWhenDisabled:n,disabled:e,composite:u,tabIndex:o,isNativeButton:s}),h=S.useCallback(()=>{const b=r.current;N0(b)&&u&&e&&d.disabled===void 0&&b.disabled&&(b.disabled=!1)},[e,d.disabled,u]);Se(h,[h]);const p=S.useCallback((b={})=>{const{onClick:w,onMouseDown:k,onKeyUp:j,onKeyDown:C,onPointerDown:_,...T}=b;return dr({onClick(M){if(e){M.preventDefault();return}w?.(M)},onMouseDown(M){e||k?.(M)},onKeyDown(M){if(e||(Hg(M),C?.(M),M.baseUIHandlerPrevented))return;const O=M.target===M.currentTarget,N=M.currentTarget,D=N0(N),E=!s&&Gq(N),R=O&&(s?D:!E),B=M.key==="Enter",I=M.key===" ",P=N.getAttribute("role"),$=P?.startsWith("menuitem")||P==="option"||P==="gridcell";if(O&&u&&I){if(M.defaultPrevented&&$)return;M.preventDefault(),(!s||D)&&(M.preventBaseUIHandler(),Tf(N,M));return}if(!R||s||!I&&!B){O&&E&&I&&M.preventDefault();return}M.defaultPrevented||(M.preventDefault(),B&&(M.preventBaseUIHandler(),Tf(N,M)))},onKeyUp(M){if(!e){if(Hg(M),j?.(M),M.target===M.currentTarget&&s&&u&&N0(M.currentTarget)&&M.key===" "){M.preventDefault();return}M.baseUIHandlerPrevented||M.target===M.currentTarget&&!s&&!u&&!M.defaultPrevented&&M.key===" "&&(M.preventBaseUIHandler(),Tf(M.currentTarget,M))}},onPointerDown(M){if(e){M.preventDefault();return}_?.(M)}},s?{type:"button"}:{role:"button"},d,T)},[e,d,u,s]),g=De(b=>{r.current=b,h()});return{getButtonProps:p,buttonRef:g}}function N0(t){return Ft(t)&&t.tagName==="BUTTON"}function Gq(t){return Ft(t)&&t.tagName==="A"&&!!t.href}const Xq={invalid:void 0,name:void 0,validityData:{state:Cq,errors:[],error:"",value:"",initialValue:null},setValidityData:Rn,disabled:void 0,setTouched:Rn,setDirty:Rn,setFilled:Rn,setFocused:Rn,validationMode:"onSubmit",shouldValidateOnChange:()=>!1,state:Eq,registerFieldControl:Rn,validation:{getValidationProps:(t,e=nn)=>e,inputRef:{current:null},registeredInputs:new Map,registerInput:Rn,getInputControl:()=>null,commit:async()=>{},change:Rn}},Jq=S.createContext(Xq);function fP(t=!0){const e=S.useContext(Jq);if(e.setValidityData===Rn&&!t)throw new Error(gn(28));return e}function Qq(t,e,n,o,s=!0,i){const{registerFieldControl:r}=fP(),l=qn(()=>Symbol());Se(()=>{const u=l.current;if(!s){r(u,void 0);return}r(u,{controlRef:t,getValue:o,id:e,name:i,value:n})},[t,s,o,e,i,r,l,n]),Se(()=>{const u=l.current;return()=>{r(u,void 0)}},[r,l])}const Zq=S.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:Rn,validationMode:"onSubmit",submitCountRef:{current:0}});function e7(){return S.useContext(Zq)}const t7=S.createContext({controlId:void 0,registerControlId:Rn,resetControlId:Rn,labelId:void 0,setLabelId:Rn,messageIds:[],setMessageIds:Rn,getDescriptionProps:t=>t});function hP(){return S.useContext(t7)}function n7(t,e,n,o=!0,s){const[i,r]=S.useState(),l=ei(s?`${s}-label`:void 0),u=t??e??i;return Se(()=>{const d=t||e||!o?void 0:o7(n.current,l);i!==d&&r(d)}),u}function o7(t,e){const n=s7(t);if(n)return!n.id&&e&&(n.id=e),n.id||void 0}function s7(t){if(!t)return;const e=t.parentElement;if(e&&e.tagName==="LABEL")return e;const n=t.id;if(n){const s=t.nextElementSibling;if(s&&s.htmlFor===n)return s}const o=t.labels;return o&&o[0]}function i7(t={}){const{id:e,enabled:n=!0}=t,{controlId:o,registerControlId:s,resetControlId:i}=hP(),r=ei(),l=qn(()=>Symbol()),u=S.useRef(!1),d=S.useRef(!1),h=De(()=>{!u.current||s===Rn||(u.current=!1,s(l.current,void 0))});return Se(()=>{if(!n||s===Rn){h();return}let p;if(e!==void 0)d.current=!0,p=e;else if(d.current)p=r;else{i();return}if(p===void 0){h();return}u.current=!0,s(l.current,p)},[e,n,s,i,r,l,h]),Se(()=>h,[h]),(n?o:void 0)??e??r}const Lh="none",xr="trigger-press",pn="trigger-hover",iu="trigger-focus",bS="outside-press",pP="item-press",mP="close-press",Vl="focus-out",$h="escape-key",qg="list-navigation",r7="cancel-open",pf="sibling-open",a7="disabled",Wy="imperative-action";function ft(t,e,n,o){let s=!1,i=!1;const r=nn;return{reason:t,event:e??new Event("base-ui"),cancel(){s=!0},allowPropagation(){i=!0},get isCanceled(){return s},get isPropagationAllowed(){return i},trigger:n,...r}}function gP(t,e){const n=S.useRef(t),o=De(e);Se(()=>{n.current!==t&&o(n.current),n.current=t},[t,o])}var Os=eP();function Yy(t){S.useEffect(t,br)}const Rm=null;class l7{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let s=0;s<n.length;s+=1)n[s]?.(e)};request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||this.callbacks[n]!==null&&(this.callbacks[n]=null,this.callbacksCount-=1)}}let Nm=new l7;class di{static create(){return new di}static request(e){return Nm.request(e)}static cancel(e){return Nm.cancel(e)}currentId=Rm;request(e){this.cancel(),this.currentId=Nm.request(()=>{this.currentId=Rm,e()})}cancel=()=>{this.currentId!==Rm&&(Nm.cancel(this.currentId),this.currentId=Rm)};disposeEffect=()=>this.cancel}function Wf(){const t=qn(di.create).current;return Yy(t.disposeEffect),t}function Yi(t){return t==null?t:"current"in t?t.current:t}const yP="data-starting-style",c7="data-ending-style";let Dm=null;function u7(t){if(!Dm){const e=[];Dm=e,queueMicrotask(()=>{Dm=null,Os.flushSync(()=>{for(const n of e)n()})})}Dm.push(t)}function Gy(t,e=!1,n=!1){const o=Wf();return De((s,i=null)=>{o.cancel();const r=Yi(t);if(r==null)return;const l=r,u=()=>{if(!n){Os.flushSync(s);return}u7(()=>{i?.aborted||s()})};if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){s();return}function d(){Promise.all(l.getAnimations().map(h=>h.finished)).then(()=>{i?.aborted||u()},()=>{if(i?.aborted)return;if(l.getAnimations().some(p=>p.pending||p.playState!=="finished")){d();return}u()})}if(e){const h=yP;if(!l.hasAttribute(h)){o.request(d);return}const p=new MutationObserver(()=>{l.hasAttribute(h)||(p.disconnect(),d())});p.observe(l,{attributes:!0,attributeFilter:[h]}),i?.addEventListener("abort",()=>p.disconnect(),{once:!0});return}o.request(d)})}function Yu(t){const{enabled:e=!0,open:n,ref:o,batch:s=!1,onComplete:i}=t,r=De(i),l=Gy(o,n,s);S.useEffect(()=>{if(!e)return;const u=new AbortController;return l(r,u.signal),()=>{u.abort()}},[e,n,r,l])}function d7(t,e=!1,n=!1,o=!1){const[s,i]=S.useState(t&&e?"idle":void 0),[r,l]=S.useState(t&&!o);return t&&!r&&(l(!0),i("starting")),!t&&r&&s!=="ending"&&!n&&i("ending"),!t&&!r&&s==="ending"&&i(void 0),Se(()=>{if(!t&&r&&s!=="ending"&&n){const u=di.request(()=>{i("ending")});return()=>{di.cancel(u)}}},[t,r,s,n]),Se(()=>{if(!t||e)return;const u=di.request(()=>{i(void 0)});return()=>{di.cancel(u)}},[e,t]),Se(()=>{if(!t||!e)return;t&&r&&s!=="idle"&&i("starting");const u=di.request(()=>{i("idle")});return()=>{di.cancel(u)}},[e,t,r,s]),{mounted:r,setMounted:l,transitionStatus:s}}const f7={[yP]:""},h7={[c7]:""},wS={transitionStatus(t){return t==="starting"?f7:t==="ending"?h7:null}},bP=S.createContext(void 0);function xS(t){const e=S.useContext(bP);if(e===void 0&&!t)throw new Error(gn(33));return e}const wP=S.createContext(void 0);function Ha(t){const e=S.useContext(wP);if(e===void 0&&!t)throw new Error(gn(36));return e}const p7="data-open",m7="data-closed",g7="data-anchor-hidden",xP="data-popup-open",y7="data-pressed",b7={[xP]:""},w7={[xP]:"",[y7]:""},x7={[p7]:""},v7={[m7]:""},k7={[g7]:""},vS={open(t){return t?b7:null}},mk={open(t){return t?w7:null}},kS={open(t){return t?x7:v7},anchorHidden(t){return t?k7:null}},Xy={...kS,...wS},S7=S.createContext(void 0);function SS(t=!0){const e=S.useContext(S7);if(e===void 0&&!t)throw new Error(gn(25));return e}function j7(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:C7,platform:T7,maxTouchPoints:E7}=j7(),Jy=C7.toLowerCase(),Yf=T7.toLowerCase(),Qy=/^i(os$|p)/.test(Yf)||Yf==="macintel"&&E7>1,DO="android",gk=Yf===DO||Jy.includes(DO),jS=!Qy&&Yf.startsWith("mac");Yf.startsWith("win");const _7=jS||Qy,qa=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!qa&&Jy.includes("firefox");!qa&&Jy.includes("chrom");const vP=_7,CS=/jsdom|happydom/.test(Jy);function M7(t){const{closeOnClick:e,highlighted:n,id:o,nodeId:s,store:i,typingRef:r,itemRef:l,itemMetadata:u}=t,{events:d}=i.useState("floatingTreeRoot"),h=i.useState("open"),p=SS(!0),g=p!==void 0;return S.useMemo(()=>({id:o,role:"menuitem",tabIndex:h&&n?0:-1,onKeyDown(b){b.key===" "&&r?.current&&b.preventDefault()},onMouseMove(b){s&&d.emit("itemhover",{nodeId:s,target:b.currentTarget})},onClick(b){e&&d.emit("close",{domEvent:b,reason:pP})},onMouseUp(b){if(p){const w=p.initialCursorPointRef.current;if(p.initialCursorPointRef.current=null,g&&w&&Math.abs(b.clientX-w.x)<=1&&Math.abs(b.clientY-w.y)<=1||g&&!jS&&b.button===2)return}l.current&&i.context.allowMouseUpTriggerRef.current&&(!g||b.button===2)&&u.type==="regular-item"&&Tf(l.current,b,{detail:1})}}),[e,n,o,d,s,h,i,r,l,p,g,u])}const O7={type:"regular-item"};function kP(t){const{closeOnClick:e,disabled:n,highlighted:o,id:s,store:i,typingRef:r=i.context.typingRef,nativeButton:l,itemMetadata:u,nodeId:d}=t,h=S.useRef(null),{getButtonProps:p,buttonRef:g}=Fa({disabled:n,focusableWhenDisabled:!0,native:l,composite:!0}),b=M7({closeOnClick:e,highlighted:o,id:s,nodeId:d,store:i,typingRef:r,itemRef:h,itemMetadata:u}),w=S.useCallback(j=>dr(b,{onMouseEnter(){u.type==="submenu-trigger"&&u.setActive()}},j,p),[b,p,u]),k=Ra(h,g);return S.useMemo(()=>({getItemProps:w,itemRef:k}),[w,k])}const SP=S.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function A7(){return S.useContext(SP)}function TS(t={}){const{guess:e,label:n,metadata:o,textRef:s,index:i}=t,{register:r,unregister:l,subscribeMapChange:u,nextIndexRef:d}=A7(),h=S.useRef(-1),[p,g]=S.useState(i==null&&e?()=>{if(h.current===-1){const j=d.current;d.current+=1,h.current=j}return h.current}:-1),b=i??p,w=S.useRef(null),k=S.useCallback(j=>{const C=w.current;C&&l(C),w.current=j,j&&r(j,{metadata:o??null,index:i??null,label:n,textRef:s})},[i,r,l,o,n,s]);return Se(()=>{if(i==null)return u(j=>{const C=w.current?j.get(w.current)?.index:null;C!=null&&g(C)})},[i,u]),{ref:k,index:b}}const R7=S.forwardRef(function(e,n){const{render:o,className:s,id:i,label:r,nativeButton:l=!1,disabled:u=!1,closeOnClick:d=!0,style:h,...p}=e,g=TS({guess:!0,label:r}),b=xS(!0),w=ei(i),{store:k}=Ha(),j=k.useState("disabled"),C=u||j,_=k.useState("isActive",g.index),T=k.useState("itemProps"),{getItemProps:M,itemRef:O}=kP({closeOnClick:d,disabled:C,highlighted:_,id:w,store:k,nativeButton:l,nodeId:b?.context.nodeId,itemMetadata:O7});return Ht("div",e,{state:{disabled:C,highlighted:_},props:[T,p,M],ref:[O,n,g.ref]})}),Jd=0;class Lo{static create(){return new Lo}currentId=Jd;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Jd,n()},e)}isStarted(){return this.currentId!==Jd}clear=()=>{this.currentId!==Jd&&(clearTimeout(this.currentId),this.currentId=Jd)};disposeEffect=()=>this.clear}function co(){const t=qn(Lo.create).current;return Yy(t.disposeEffect),t}function ci(t){t.preventDefault(),t.stopPropagation()}function N7(t){return"nativeEvent"in t}function ES(t){return t.pointerType===""&&t.isTrusted?!0:gk&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function _S(t){return CS?!1:!gk&&t.width===0&&t.height===0||gk&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function Sa(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function D7(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}function Nn(t){let e=t.activeElement;for(;e?.shadowRoot?.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Ie(t,e){if(!t||!e)return!1;const n=e.getRootNode?.();if(t.contains(e))return!0;if(n&&ku(n)){let o=e;for(;o;){if(t===o)return!0;o=o.parentNode||o.host}}return!1}function ln(t){return"composedPath"in t?t.composedPath()[0]??t.target:t.target}const yk="data-base-ui-focusable",jP="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Zy="ArrowLeft",eb="ArrowRight",CP="ArrowUp",MS="ArrowDown",bk="data-trigger-disabled";function Ug(t,e){if(!vt(t))return!1;const n=t;if(e.hasElement(n))return!n.hasAttribute(bk);for(const[,o]of e.entries())if(Ie(o,n))return!o.hasAttribute(bk);return!1}function D0(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function P7(t){return t.matches("html,body")}function tb(t){return Ft(t)&&t.matches(jP)}function B7(t){return t?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${jP}`)!=null}function wk(t){return t?t.getAttribute("role")==="combobox"&&tb(t):!1}function Vg(t){if(!t||CS)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function xk(t){return t?t.hasAttribute(yk)?t:t.querySelector(`[${yk}]`)||t:null}function z7(t,e){return e!=null&&!Sa(e)?0:typeof t=="function"?t():t}function Kl(t,e,n){const o=z7(t,n);return typeof o=="number"?o:o?.[e]}function PO(t){return typeof t=="function"?t():t}function TP(t,e){return e||t==="click"||t==="mousedown"}function I7(t){return t?.includes("mouse")&&t!=="mousedown"}const EP=S.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Lo,currentIdRef:{current:null},currentContextRef:{current:null}});function L7(t,e){t.current=e.current}function $7(t){const{children:e,delay:n,timeoutMs:o=0}=t,s=S.useRef(n),i=S.useRef(n),r=S.useRef(null),l=S.useRef(null),u=co();return Se(()=>{if(i.current=n,!r.current){s.current=n;return}s.current={open:Kl(s.current,"open"),close:Kl(n,"close")}},[n,r,s,i]),y.jsx(EP.Provider,{value:S.useMemo(()=>({hasProvider:!0,delayRef:s,initialDelayRef:i,currentIdRef:r,timeoutMs:o,currentContextRef:l,timeout:u}),[o,u]),children:e})}function F7(t,e={open:!1}){const{open:n}=e,o="rootStore"in t?t.rootStore:t,s=o.useState("floatingId"),i=S.useContext(EP),{currentIdRef:r,delayRef:l,timeoutMs:u,initialDelayRef:d,currentContextRef:h,hasProvider:p,timeout:g}=i,[b,w]=S.useState(!1),k=S.useRef(n);return Se(()=>{k.current=n},[n]),Se(()=>{function j(){h.current?.setIsInstantPhase(!1),r.current=null,h.current=null,l.current=d.current,g.clear()}if(r.current&&!n&&r.current===s){if(w(!1),u){const C=s;return g.start(u,()=>{o.select("open")||r.current&&r.current!==C||j()}),()=>{(k.current||r.current!==C)&&g.clear()}}j()}},[n,s,r,l,u,d,h,g,o]),Se(()=>{if(!n)return;const j=h.current,C=r.current;g.clear(),h.current={onOpenChange:o.setOpen,setIsInstantPhase:w},r.current=s,l.current={open:0,close:Kl(d.current,"close")},C!==null&&C!==s?(w(!0),j?.setIsInstantPhase(!0),j?.onOpenChange(!1,ft(Lh))):(w(!1),j?.setIsInstantPhase(!1))},[n,s,o,r,l,d,h,g]),Se(()=>()=>{if(r.current===s){if(h.current=null,!k.current)return;r.current=null,L7(l,d),g.clear()}},[h,r,l,s,d,g]),S.useMemo(()=>({activeIdRef:r,hasProvider:p,delayRef:l,isInstantPhase:b}),[r,p,l,b])}function st(t,e,n,o){return t.addEventListener(e,n,o),()=>{t.removeEventListener(e,n,o)}}function Ys(...t){return()=>{for(let e=0;e<t.length;e+=1){const n=t[e];n&&n()}}}function Mn(t){const e=qn(H7,t).current;return e.next=t,Se(e.effect),e}function H7(t){const e={current:t,next:t,effect:()=>{e.current=e.next}};return e}const vr=S.forwardRef(function(e,n){const[o,s]=S.useState();Se(()=>{vP&&qa&&s("button")},[]);const i={tabIndex:0,role:o};return y.jsx("span",{...e,ref:n,style:cS,"aria-hidden":o?void 0:!0,...i,"data-base-ui-focus-guard":""})}),Su=Math.min,fr=Math.max,Kg=Math.round,Pm=Math.floor,hr=t=>({x:t,y:t}),q7={left:"right",right:"left",bottom:"top",top:"bottom"};function _P(t,e,n){return fr(t,Su(e,n))}function Na(t,e){return typeof t=="function"?t(e):t}function _s(t){return t.split("-")[0]}function kr(t){return t.split("-")[1]}function OS(t){return t==="x"?"y":"x"}function AS(t){return t==="y"?"height":"width"}function Es(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function RS(t){return OS(Es(t))}function U7(t,e,n){n===void 0&&(n=!1);const o=kr(t),s=RS(t),i=AS(s);let r=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(r=Wg(r)),[r,Wg(r)]}function V7(t){const e=Wg(t);return[vk(t),e,vk(e)]}function vk(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const BO=["left","right"],zO=["right","left"],K7=["top","bottom"],W7=["bottom","top"];function Y7(t,e,n){switch(t){case"top":case"bottom":return n?e?zO:BO:e?BO:zO;case"left":case"right":return e?K7:W7;default:return[]}}function G7(t,e,n,o){const s=kr(t);let i=Y7(_s(t),n==="start",o);return s&&(i=i.map(r=>r+"-"+s),e&&(i=i.concat(i.map(vk)))),i}function Wg(t){const e=_s(t);return q7[e]+t.slice(e.length)}function X7(t){var e,n,o,s;return{top:(e=t.top)!=null?e:0,right:(n=t.right)!=null?n:0,bottom:(o=t.bottom)!=null?o:0,left:(s=t.left)!=null?s:0}}function MP(t){return typeof t!="number"?X7(t):{top:t,right:t,bottom:t,left:t}}function Yg(t){const{x:e,y:n,width:o,height:s}=t;return{width:o,height:s,top:n,left:e,right:e+o,bottom:n+s,x:e,y:n}}function Ef(t,e){return e<0||e>=t.length}function bg(t,e){return ir(t.current,{disabledIndices:e})}function kk(t,e){return ir(t.current,{decrement:!0,startingIndex:t.current.length,disabledIndices:e})}function ir(t,{startingIndex:e=-1,decrement:n=!1,disabledIndices:o,amount:s=1}={}){let i=e;do i+=n?-s:s;while(i>=0&&i<=t.length-1&&ru(t,i,o));return i}function ru(t,e,n){if(typeof n=="function"?n(e):n?.includes(e)??!1)return!0;const s=t[e];return s?!nb(s)||s.matches(":disabled")?!0:!n&&(s.hasAttribute("disabled")||s.getAttribute("aria-disabled")==="true"):!1}function J7(t){return t.visibility==="hidden"||t.visibility==="collapse"}function nb(t,e=t?is(t):null){return!t||!t.isConnected||!e||J7(e)?!1:typeof t.checkVisibility=="function"?t.checkVisibility():e.display!=="none"&&e.display!=="contents"}const Q7='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Z7(t){const e=t.assignedSlot;if(e)return e;if(t.parentElement)return t.parentElement;const n=t.getRootNode();return ku(n)?n.host:null}function Sk(t){for(const e of Array.from(t.children))if(oo(e)==="summary")return e;return null}function eU(t,e){const n=Sk(e);return!!n&&(t===n||Ie(n,t))}function OP(t){const e=t?oo(t):"";return t!=null&&t.matches(Q7)&&(e!=="summary"||t.parentElement!=null&&oo(t.parentElement)==="details"&&Sk(t.parentElement)===t)&&(e!=="details"||Sk(t)==null)&&(e!=="input"||t.type!=="hidden")}function AP(t){if(!OP(t)||!t.isConnected||t.matches(":disabled"))return!1;for(let e=t;e;e=Z7(e)){const n=e!==t,o=oo(e)==="slot";if(e.hasAttribute("inert")||n&&oo(e)==="details"&&!e.open&&!eU(t,e)||e.hasAttribute("hidden")||!o&&!tU(e,n))return!1}return!0}function tU(t,e){const n=is(t);return e?n.display!=="none":nb(t,n)}function RP(t){const e=t.tabIndex;if(e<0){const n=oo(t);if(n==="details"||n==="audio"||n==="video"||Ft(t)&&t.isContentEditable)return 0}return e}function P0(t){if(oo(t)!=="input")return null;const e=t;return e.type==="radio"&&e.name!==""?e:null}function nU(t,e){const n=P0(t);if(!n)return!0;const o=e.find(s=>{const i=P0(s);return i?.name===n.name&&i.form===n.form&&i.checked});return o?o===n:e.find(s=>{const i=P0(s);return i?.name===n.name&&i.form===n.form})===n}function NP(t){if(Ft(t)&&oo(t)==="slot"){const e=t.assignedElements({flatten:!0});if(e.length>0)return e}return Ft(t)&&t.shadowRoot?Array.from(t.shadowRoot.children):Array.from(t.children)}function DP(t,e){NP(t).forEach(n=>{OP(n)&&e.push(n),DP(n,e)})}function PP(t,e,n){NP(t).forEach(o=>{Ft(o)&&o.matches(e)&&n.push(o),PP(o,e,n)})}function NS(t){return AP(t)&&RP(t)>=0}function BP(t){const e=[];return DP(t,e),e.filter(AP)}function Fh(t){const e=BP(t);return e.filter(n=>RP(n)>=0&&nU(n,e))}function zP(t,e){const n=Fh(t),o=n.length;if(o===0)return;const s=Nn(yt(t)),i=n.indexOf(s),r=i===-1?e===1?0:o-1:i+e;return n[r]}function DS(t){return zP(yt(t).body,1)||t}function IP(t){return zP(yt(t).body,-1)||t}function LP(t,e){if(!t)return null;const n=Fh(yt(t).body),o=n.length;if(o===0)return null;const s=n.indexOf(t);if(s===-1)return null;const i=(s+e+o)%o;return n[i]}function oU(t){return LP(t,1)}function sU(t){return LP(t,-1)}function au(t,e){const n=e||t.currentTarget,o=t.relatedTarget;return!o||!Ie(n,o)}function iU(t){Fh(t).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function IO(t){const e=[];PP(t,"[data-tabindex]",e),e.forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function Da(t,e,n=!0){return t.filter(s=>s.parentId===e).flatMap(s=>[...!n||s.context?.open?[s]:[],...Da(t,s.id,n)])}function LO(t,e){let n=[],o=t.find(s=>s.id===e)?.parentId;for(;o;){const s=t.find(i=>i.id===o);o=s?.parentId,s&&(n=n.concat(s))}return n}function Gf(t){return`data-base-ui-${t}`}let Bm=0;function wg(t,e={}){const{preventScroll:n=!1,sync:o=!1,shouldFocus:s}=e;cancelAnimationFrame(Bm);function i(){s&&!s()||t?.focus({preventScroll:n})}if(o)return i(),Rn;const r=requestAnimationFrame(i);return Bm=r,()=>{Bm===r&&(cancelAnimationFrame(r),Bm=0)}}const B0={inert:new WeakMap,"aria-hidden":new WeakMap},$O="data-base-ui-inert",jk={inert:new WeakSet,"aria-hidden":new WeakSet};let Qd=new WeakMap,z0=0;function rU(t){return jk[t]}function $P(t){return t?ku(t)?t.host:$P(t.parentNode):null}const FO=(t,e)=>e.map(n=>{if(t.contains(n))return n;const o=$P(n);return t.contains(o)?o:null}).filter(n=>n!=null),HO=t=>{const e=new Set;return t.forEach(n=>{let o=n;for(;o&&!e.has(o);)e.add(o),o=o.parentNode}),e},qO=(t,e,n)=>{const o=[],s=i=>{!i||n.has(i)||Array.from(i.children).forEach(r=>{oo(r)!=="script"&&(e.has(r)?s(r):o.push(r))})};return s(t),o};function aU(t,e,n,o,{mark:s=!0}){let i=null;o?i="inert":n&&(i="aria-hidden");let r=null,l=null;const u=FO(e,t),d=s?qO(e,HO(u),new Set(u)):[],h=[],p=[];if(i){const g=B0[i],b=rU(i);l=b,r=g;const w=FO(e,Array.from(e.querySelectorAll("[aria-live]"))),k=u.concat(w);qO(e,HO(k),new Set(k)).forEach(C=>{const _=C.getAttribute(i),T=_!==null&&_!=="false",M=(g.get(C)||0)+1;g.set(C,M),h.push(C),M===1&&T&&b.add(C),T||C.setAttribute(i,i==="inert"?"":"true")})}return s&&d.forEach(g=>{const b=(Qd.get(g)||0)+1;Qd.set(g,b),p.push(g),b===1&&g.setAttribute($O,"")}),z0+=1,()=>{r&&h.forEach(g=>{const w=(r.get(g)||0)-1;r.set(g,w),w||(!l?.has(g)&&i&&g.removeAttribute(i),l?.delete(g))}),s&&p.forEach(g=>{const b=(Qd.get(g)||0)-1;Qd.set(g,b),b||g.removeAttribute($O)}),z0-=1,z0||(B0.inert=new WeakMap,B0["aria-hidden"]=new WeakMap,jk.inert=new WeakSet,jk["aria-hidden"]=new WeakSet,Qd=new WeakMap)}}function UO(t,e={}){const{ariaHidden:n=!1,inert:o=!1,mark:s=!0}=e,i=yt(t[0]).body;return aU(t,i,n,o,{mark:s})}const lU=500,FP=500,cU={style:{transition:"none"}},HP="data-base-ui-click-trigger",uU="data-base-ui-swipe-ignore",dU="data-swipe-ignore",fU=`[${uU}]`,hU=`[${dU}]`,pU={fallbackAxisSide:"none"},PS={fallbackAxisSide:"end"},mU={clipPath:"inset(50%)",position:"fixed",top:0,left:0},qP=S.createContext(null),UP=()=>S.useContext(qP),gU=Gf("portal");function VP(t={}){const{ref:e,container:n,componentProps:o=nn,elementProps:s}=t,i=Ul(),l=UP()?.portalNode,[u,d]=S.useState(null),[h,p]=S.useState(null),g=De(j=>{j!==null&&p(j)}),b=S.useRef(null);Se(()=>{if(n===null){b.current&&(b.current=null,p(null),d(null));return}const j=(n&&(uS(n)?n:n.current))??l??document.body;if(j==null){b.current&&(b.current=null,p(null),d(null));return}b.current!==j&&(b.current=j,p(null),d(j))},[n,l]);const w=Ht("div",o,{ref:[e,g],props:[{id:i,[gU]:""},s]}),k=u&&w?Os.createPortal(w,u):null;return{node:h,nodeId:S.isValidElement(w)?w.props.id:void 0,subtree:k}}const BS=S.forwardRef(function(e,n){const{render:o,className:s,style:i,children:r,container:l,portalOwnerRole:u,...d}=e,{node:h,nodeId:p,subtree:g}=VP({container:l,ref:n,componentProps:e,elementProps:d}),b=S.useRef(null),w=S.useRef(null),k=S.useRef(null),j=S.useRef(null),[C,_]=S.useState(null),T=S.useRef(!1),M=C?.modal,O=C?.open,N=!!C&&!C.modal&&C.open&&!!h;S.useEffect(()=>{if(!h||M)return;function E(R){h&&R.relatedTarget&&au(R)&&(R.type==="focusin"?T.current&&(IO(h),T.current=!1):(iU(h),T.current=!0))}return Ys(st(h,"focusin",E,!0),st(h,"focusout",E,!0))},[h,M]),Se(()=>{!h||O!==!0||!T.current||(IO(h),T.current=!1)},[O,h]);const D=S.useMemo(()=>({beforeOutsideRef:b,afterOutsideRef:w,beforeInsideRef:k,afterInsideRef:j,portalNode:h,setFocusManagerState:_}),[h]);return y.jsxs(S.Fragment,{children:[g,y.jsxs(qP.Provider,{value:D,children:[N&&h&&y.jsx(vr,{"data-type":"outside",ref:b,onFocus:E=>{if(au(E,h))k.current?.focus();else{const R=C?C.domReference:null;IP(R)?.focus()}}}),N&&h&&y.jsx("span",{role:u,"aria-owns":p,style:mU}),h&&Os.createPortal(r,h),N&&h&&y.jsx(vr,{"data-type":"outside",ref:w,onFocus:E=>{if(au(E,h))j.current?.focus();else{const R=C?C.domReference:null;DS(R)?.focus(),C?.closeOnFocusOut&&C?.onOpenChange(!1,ft(Vl,E.nativeEvent))}}})]})]})});function KP(){const t=new Map;return{emit(e,n){t.get(e)?.forEach(o=>o(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){t.get(e)?.delete(n)}}}class zS{nodesRef={current:[]};events=KP();addNode(e){this.nodesRef.current.push(e)}removeNode(e){const n=this.nodesRef.current.findIndex(o=>o===e);n!==-1&&this.nodesRef.current.splice(n,1)}}const WP=S.createContext(null),YP=S.createContext(null),Zl=()=>S.useContext(WP)?.id||null,Ua=t=>{const e=S.useContext(YP);return t??e};function IS(t){const e=Ul(),n=Ua(t),o=Zl();return Se(()=>{if(!e)return;const s={id:e,parentId:o};return n?.addNode(s),()=>{n?.removeNode(s)}},[n,e,o]),e}function GP(t){const{children:e,id:n}=t,o=Zl();return y.jsx(WP.Provider,{value:S.useMemo(()=>({id:n,parentId:o}),[n,o]),children:e})}function XP(t){const{children:e,externalTree:n}=t,o=qn(()=>n??new zS).current;return y.jsx(YP.Provider,{value:o,children:e})}function yU(t,e){const n=on(ln(t));return t instanceof n.KeyboardEvent?"keyboard":t instanceof n.FocusEvent?e||"keyboard":"pointerType"in t?t.pointerType||"keyboard":"touches"in t?"touch":t instanceof n.MouseEvent?e||(t.detail===0?"keyboard":"mouse"):""}const VO=20;let ma=[];function LS(){ma=ma.filter(t=>t.deref()?.isConnected)}function KO(t){LS(),t&&oo(t)!=="body"&&(ma.push(new WeakRef(t)),ma.length>VO&&(ma=ma.slice(-VO)))}function WO(){return LS(),ma[ma.length-1]?.deref()}function bU(t){return t?NS(t)?t:Fh(t)[0]||t:null}function YO(t){if(t.hasAttribute("tabindex")&&!t.hasAttribute("data-tabindex")||!t.getAttribute("role")?.includes("dialog"))return;const n=BP(t).filter(s=>{const i=s.getAttribute("data-tabindex")||"";return NS(s)||s.hasAttribute("data-tabindex")&&!i.startsWith("-")}),o=t.getAttribute("tabindex");n.length===0?o!=="0"&&(t.setAttribute("tabindex","0"),t.setAttribute("data-tabindex","0")):(o!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}function $S(t){const{context:e,children:n,disabled:o=!1,initialFocus:s=!0,returnFocus:i=!0,restoreFocus:r=!1,modal:l=!0,closeOnFocusOut:u=!0,openInteractionType:d="",nextFocusableElement:h,previousFocusableElement:p,beforeContentFocusGuardRef:g,externalTree:b,getInsideElements:w}=t,k="rootStore"in e?e.rootStore:e,j=k.useState("open"),C=k.useState("domReferenceElement"),_=k.useState("floatingElement"),{events:T,dataRef:M}=k.context,O=De(()=>M.current.floatingContext?.nodeId),N=s===!1,D=wk(C)&&N,E=Mn(s),R=Mn(i),B=Mn(d),I=Mn(j),P=Ua(b),$=UP(),W=S.useRef(!1),K=S.useRef(!1),F=S.useRef(!1),q=S.useRef(null),H=S.useRef(""),Y=S.useRef(""),ne=S.useRef(null),z=S.useRef(null),U=Ra(ne,g,$?.beforeInsideRef),J=Ra(z,$?.afterInsideRef),X=co(),oe=co(),ie=Wf(),be=$!=null,ce=xk(_),ye=De((Me=ce)=>Me?Fh(Me):[]),Ce=De(()=>w?.().filter(Me=>Me!=null)??[]);S.useEffect(()=>{if(o||!l)return;function Me(Oe){Oe.key==="Tab"&&Ie(ce,Nn(yt(ce)))&&ye().length===0&&!D&&ci(Oe)}const je=yt(ce);return st(je,"keydown",Me)},[o,ce,l,D,ye]),S.useEffect(()=>{if(o||!j)return;const Me=yt(ce);function je(){F.current=!1}function Oe(nt){const Ee=ln(nt),Je=Ce(),_e=Ie(_,Ee)||Ie(C,Ee)||Ie($?.portalNode,Ee)||Je.some(Ae=>Ae===Ee||Ie(Ae,Ee));F.current=!_e,Y.current=nt.pointerType||"keyboard",Ee?.closest(`[${HP}]`)&&(K.current=!0,oe.start(0,()=>{K.current=!1}))}function Fe(){Y.current="keyboard"}return Ys(st(Me,"pointerdown",Oe,!0),st(Me,"pointerup",je,!0),st(Me,"pointercancel",je,!0),st(Me,"keydown",Fe,!0),je)},[o,_,C,ce,j,$,oe,Ce]),S.useEffect(()=>{if(o||!u)return;const Me=yt(ce);function je(){K.current=!0,oe.start(0,()=>{K.current=!1})}function Oe(Je){const _e=ln(Je);NS(_e)&&(q.current=_e)}function Fe(Je){const _e=Je.relatedTarget,Ae=Je.currentTarget,Pe=ln(Je);l&&_e==null&&Pe!=null&&Ie(_,Pe)&&KO(Pe),queueMicrotask(()=>{const bt=O(),Be=k.context.triggerElements,fe=Ce(),xe=_e?.hasAttribute(Gf("focus-guard"))&&[ne.current,z.current,$?.beforeInsideRef.current,$?.afterInsideRef.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,Yi(p),Yi(h)].includes(_e),pe=!(Ie(C,_e)||Ie(_,_e)||Ie(_e,_)||Ie($?.portalNode,_e)||fe.some(re=>re===_e||Ie(re,_e))||Be.hasMatchingElement(re=>Ie(re,_e))||xe||P&&(Da(P.nodesRef.current,bt).find(re=>Ie(re.context?.elements.floating,_e)||Ie(re.context?.elements.domReference,_e))||LO(P.nodesRef.current,bt).find(re=>[re.context?.elements.floating,xk(re.context?.elements.floating)].includes(_e)||re.context?.elements.domReference===_e)));if(Ae===C&&ce&&YO(ce),r&&Ae!==C&&!nb(Pe)&&Nn(Me)===Me.body){if(Ft(ce)&&(ce.focus(),r==="popup")){ie.request(()=>{ce.focus()});return}const re=ye(),ve=q.current,Ze=(ve&&re.includes(ve)?ve:null)||re[re.length-1]||ce;Ft(Ze)&&Ze.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}(D||!l)&&_e&&pe&&!K.current&&(D||_e!==WO())&&(W.current=!0,k.setOpen(!1,ft(Vl,Je)))})}function nt(){F.current||(M.current.insideReactTree=!0,X.start(0,()=>{M.current.insideReactTree=!1}))}const Ee=Ft(C)?C:null;if(!(!_&&!Ee))return Ys(Ee&&st(Ee,"focusout",Fe),Ee&&st(Ee,"pointerdown",je),_&&st(_,"focusin",Oe),_&&st(_,"focusout",Fe),_&&$&&st(_,"focusout",nt,!0))},[o,C,_,ce,l,P,$,k,u,r,ye,D,O,M,X,oe,ie,h,p,Ce]),S.useEffect(()=>{if(o||!_||!j)return;const Me=Array.from($?.portalNode?.querySelectorAll(`[${Gf("portal")}]`)||[]),Oe=(P?LO(P.nodesRef.current,O()):[]).find(Ae=>wk(Ae.context?.elements.domReference||null))?.context?.elements.domReference,nt=[...[_,...Me,ne.current,z.current,$?.beforeOutsideRef.current,$?.afterOutsideRef.current,...Ce()],Oe,Yi(p),Yi(h),D?C:null].filter(Ae=>Ae!=null),Ee=UO(nt,{ariaHidden:l||D,mark:!1}),Je=[_,...Me].filter(Ae=>Ae!=null),_e=UO(Je);return()=>{_e(),Ee()}},[j,o,C,_,l,$,D,P,O,h,p,Ce]),Se(()=>{if(!j||o||!Ft(ce))return;H.current="",Y.current="";const Me=yt(ce),je=Nn(Me);queueMicrotask(()=>{const Oe=E.current,Fe=typeof Oe=="function"?Oe(B.current||""):Oe;if(Fe===void 0||Fe===!1||Ie(ce,je))return;let Ee=null;const Je=()=>(Ee==null&&(Ee=ye(ce)),Ee[0]||ce);let _e;Fe===!0||Fe===null?_e=Je():_e=Yi(Fe),_e=_e||Je();const Ae=Ie(ce,Nn(Me));wg(_e,{preventScroll:_e===ce,shouldFocus(){if(!I.current)return!1;if(Ae)return!0;const Pe=Nn(Me);return!(Pe!==_e&&Ie(ce,Pe))}})})},[o,j,ce,ye,E,B,I]),Se(()=>{if(o||!ce)return;const Me=yt(ce),je=Nn(Me),Oe=B.current==null;KO(je);function Fe(Ee){if(Ee.open||(H.current=yU(Ee.nativeEvent,Y.current)),Ee.reason===pn&&Ee.nativeEvent.type==="mouseleave"&&(W.current=!0),Ee.reason===bS)if(Ee.nested)W.current=!1;else if(ES(Ee.nativeEvent)||_S(Ee.nativeEvent))W.current=!1;else{let Je=!1;yt(ce).createElement("div").focus({get preventScroll(){return Je=!0,!1}}),Je?W.current=!1:W.current=!0}}T.on("openchange",Fe);function nt(Ee){const Je=R.current;let _e=typeof Je=="function"?Je(Ee):Je;if(_e===void 0||_e===!1)return null;_e===null&&(_e=!0);const Ae=C?.isConnected?C:null,Pe=je?.isConnected&&oo(je)!=="body"?je:null;let bt=Oe?Pe||Ae:Ae||Pe;return bt||(bt=WO()||null),typeof _e=="boolean"?bt:Yi(_e)||bt||null}return()=>{T.off("openchange",Fe);const Ee=Nn(Me),Je=Ce(),_e=Ie(_,Ee)||Je.some(Be=>Be===Ee||Ie(Be,Ee))||P&&Da(P.nodesRef.current,O(),!1).some(Be=>Ie(Be.context?.elements.floating,Ee)),Ae=R.current,Pe=H.current,bt=nt(Pe);queueMicrotask(()=>{const Be=bU(bt),fe=typeof Ae!="boolean";if(Ae&&!W.current&&Ft(Be)&&(!(!fe&&Be!==Ee&&Ee!==Me.body)||_e)){const xe={preventScroll:!0};Pe==="keyboard"&&(xe.focusVisible=!0),Be.focus(xe)}W.current=!1})}},[o,_,ce,R,B,T,P,C,O,Ce]),Se(()=>{if(!qa||j||!_)return;const Me=Nn(yt(_));!Ft(Me)||!tb(Me)||Ie(_,Me)&&Me.blur()},[j,_]),Se(()=>{if(!(o||!$))return $.setFocusManagerState({modal:l,closeOnFocusOut:u,open:j,onOpenChange:k.setOpen,domReference:C}),()=>{$.setFocusManagerState(null)}},[o,$,l,j,k,u,C]),Se(()=>{if(!(o||!ce))return YO(ce),()=>{queueMicrotask(LS)}},[o,ce]);const Ve=!o&&(l?!D:!0)&&(be||l);return y.jsxs(S.Fragment,{children:[Ve&&y.jsx(vr,{"data-type":"inside",ref:U,onFocus:Me=>{if(l){const je=ye();wg(je[je.length-1])}else $?.portalNode&&(W.current=!1,au(Me,$.portalNode)?DS(C)?.focus():Yi(p??$.beforeOutsideRef)?.focus())}}),n,Ve&&y.jsx(vr,{"data-type":"inside",ref:J,onFocus:Me=>{l?wg(ye()[0]):$?.portalNode&&(u&&(W.current=!0),au(Me,$.portalNode)?IP(C)?.focus():Yi(h??$.afterOutsideRef)?.focus())}})]})}function FS(t,e={}){const{enabled:n=!0,event:o="click",toggle:s=!0,ignoreMouse:i=!1,stickIfOpen:r=!0,touchOpenDelay:l=0,reason:u=xr}=e,d="rootStore"in t?t.rootStore:t,h=d.context.dataRef,p=S.useRef(void 0),g=Wf(),b=co(),w=S.useMemo(()=>{function k(C,_,T,M){const O=ft(u,_,T);C&&M==="touch"&&l>0?b.start(l,()=>{d.setOpen(!0,O)}):d.setOpen(C,O)}function j(C,_,T){const M=h.current.openEvent,O=d.select("domReferenceElement")!==_;return C&&O||!C||!s?!0:M&&r?!T(M.type):!1}return{onPointerDown(C){p.current=Sa(C.pointerType,!0)&&_S(C.nativeEvent)?"virtual":C.pointerType},onMouseDown(C){const _=p.current,T=C.nativeEvent,M=d.select("open");if(C.button!==0||o==="click"||Sa(_,!0)&&i)return;const O=j(M,C.currentTarget,E=>E==="click"||E==="mousedown"),N=ln(T);if(tb(N)){k(O,T,N,_);return}const D=C.currentTarget;g.request(()=>{k(O,T,D,_)})},onClick(C){if(o==="mousedown-only")return;const _=p.current;if(o==="mousedown"&&_){p.current=void 0;return}if(Sa(_,!0)&&i)return;const T=d.select("open"),M=j(T,C.currentTarget,O=>O==="click"||O==="mousedown"||O==="keydown"||O==="keyup");k(M,C.nativeEvent,C.currentTarget,_)},onKeyDown(){p.current=void 0}}},[h,o,i,u,d,r,s,g,b,l]);return S.useMemo(()=>n?{reference:w}:nn,[n,w])}function wU(t,e){let n=null,o=null,s=!1;return{contextElement:t||void 0,getBoundingClientRect(){const i=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},r=e.axis==="x"||e.axis==="both",l=e.axis==="y"||e.axis==="both",u=["mouseenter","mousemove"].includes(e.dataRef.current.openEvent?.type||"")&&e.pointerType!=="touch";let d=i.width,h=i.height,p=i.x,g=i.y;return n==null&&e.x&&r&&(n=i.x-e.x),o==null&&e.y&&l&&(o=i.y-e.y),p-=n||0,g-=o||0,d=0,h=0,!s||u?(d=e.axis==="y"?i.width:0,h=e.axis==="x"?i.height:0,p=r&&e.x!=null?e.x:p,g=l&&e.y!=null?e.y:g):s&&!u&&(h=e.axis==="x"?i.height:h,d=e.axis==="y"?i.width:d),s=!0,{width:d,height:h,x:p,y:g,top:g,right:p+d,bottom:g+h,left:p}}}}function GO(t){return t!=null&&t.clientX!=null}function xU(t,e={}){const{enabled:n=!0,axis:o="both"}=e,s="rootStore"in t?t.rootStore:t,i=s.useState("open"),r=s.useState("floatingElement"),l=s.useState("domReferenceElement"),u=s.context.dataRef,d=S.useRef(!1),h=S.useRef(null),[p,g]=S.useState(),[b,w]=S.useState([]),k=De(M=>{s.set("positionReference",M)}),j=De((M,O,N)=>{d.current||u.current.openEvent&&!GO(u.current.openEvent)||s.set("positionReference",wU(N??l,{x:M,y:O,axis:o,dataRef:u,pointerType:p}))}),C=De(M=>{i?h.current||(j(M.clientX,M.clientY,M.currentTarget),w([])):j(M.clientX,M.clientY,M.currentTarget)}),_=Sa(p)?r:i;S.useEffect(()=>{if(!n){k(l);return}if(!_)return;function M(){h.current?.(),h.current=null}const O=on(r);function N(D){const E=ln(D);Ie(r,E)?M():j(D.clientX,D.clientY)}return!u.current.openEvent||GO(u.current.openEvent)?h.current=st(O,"mousemove",N):k(l),M},[_,n,r,u,l,s,j,k,b]),S.useEffect(()=>()=>{s.set("positionReference",null)},[s]),S.useEffect(()=>{n&&!r&&(d.current=!1)},[n,r]),S.useEffect(()=>{!n&&i&&(d.current=!0)},[n,i]);const T=S.useMemo(()=>{function M(O){g(O.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:C,onMouseEnter:C}},[C]);return S.useMemo(()=>n?{reference:T,trigger:T}:{},[n,T])}function vU(){return!1}function kU(t){return{escapeKey:typeof t=="boolean"?t:t?.escapeKey??!1,outsidePress:typeof t=="boolean"?t:t?.outsidePress??!0}}function ob(t,e={}){const{enabled:n=!0,escapeKey:o=!0,outsidePress:s=!0,outsidePressEvent:i="sloppy",referencePress:r=vU,bubbles:l,externalTree:u}=e,d="rootStore"in t?t.rootStore:t,h=d.useState("open"),p=d.useState("floatingElement"),{dataRef:g,events:b}=d.context,w=Ua(u),k=De(typeof s=="function"?s:()=>!1),j=typeof s=="function"?k:s,C=j!==!1,_=De(()=>i),{escapeKey:T,outsidePress:M}=kU(l),O=S.useRef(!1),N=S.useRef(!1),D=S.useRef(!1),E=S.useRef(!1),R=S.useRef(!1),B=S.useRef(""),I=S.useRef(null),P=co(),$=co(),W=De(()=>{$.clear(),g.current.insideReactTree=!1}),K=De(X=>{const oe=g.current.floatingContext?.nodeId;return(w?Da(w.nodesRef.current,oe):[]).some(be=>be.context?.open&&!be.context.dataRef.current[X])}),F=De(X=>D0(X,d.select("floatingElement"))||D0(X,d.select("domReferenceElement"))),q=De(X=>{r()&&d.setOpen(!1,ft(xr,X.nativeEvent))}),H=De(X=>{if(!h||!n||!o||X.key!=="Escape"||R.current||!T&&K("__escapeKeyBubbles"))return;const oe=N7(X)?X.nativeEvent:X,ie=ft($h,oe);d.setOpen(!1,ie),ie.isCanceled||X.preventDefault(),!T&&!ie.isPropagationAllowed&&X.stopPropagation()}),Y=De(()=>{g.current.insideReactTree=!0,$.start(0,W)}),ne=De(X=>{if(!h||!n||X.button!==0)return;const oe=ln(X.nativeEvent);Ie(d.select("floatingElement"),oe)&&(O.current||(O.current=!0,N.current=!1))}),z=De(X=>{!h||!n||(X.defaultPrevented||X.nativeEvent.defaultPrevented)&&O.current&&(N.current=!0)});S.useEffect(()=>{function X(oe){oe.open||(E.current=!1)}return b.on("openchange",X),()=>{b.off("openchange",X)}},[b]),S.useEffect(()=>{if(!h||!n)return h||(E.current=!1),W;g.current.__escapeKeyBubbles=T,g.current.__outsidePressBubbles=M;const X=new Lo,oe=new Lo,ie=yt(p);function be(){X.clear(),R.current=!0}function ce(){X.start(qa?5:0,()=>{R.current=!1})}function ye(){D.current=!0,oe.start(0,()=>{D.current=!1})}function Ce(){O.current=!1,N.current=!1}function Ve(){const pe=B.current,re=pe==="pen"||!pe?"mouse":pe,ve=_(),Ze=typeof ve=="function"?ve():ve;return typeof Ze=="string"?Ze:Ze[re]}function Me(pe){const re=Ve();return re==="intentional"&&pe.type!=="click"||re==="sloppy"&&pe.type==="click"}function je(pe){const re=g.current.floatingContext?.nodeId,ve=w&&Da(w.nodesRef.current,re).some(Ze=>D0(pe,Ze.context?.elements.floating));return F(pe)||ve}function Oe(pe){if(Me(pe)){pe.type!=="click"&&!F(pe)&&(oe.clear(),D.current=!1),W();return}if(g.current.insideReactTree){W();return}const re=ln(pe),ve=`[${Gf("inert")}]`,Ze=vt(re)?re.getRootNode():null,Ln=Array.from((ku(Ze)?Ze:yt(d.select("floatingElement"))).querySelectorAll(ve)),So=d.context.triggerElements;if(re&&(So.hasElement(re)||So.hasMatchingElement(Te=>Ie(Te,re))))return;let dn=vt(re)?re:null;for(;dn&&!ur(dn);){const Te=wr(dn);if(ur(Te)||!vt(Te))break;dn=Te}if(!(Ln.length&&vt(re)&&!P7(re)&&!Ie(re,d.select("floatingElement"))&&Ln.every(Te=>!Ie(dn,Te)))){if(Ft(re)&&!("touches"in pe)){const Te=ur(re),rt=is(re),_t=/auto|scroll/,Jt=Te||_t.test(rt.overflowX),ls=Te||_t.test(rt.overflowY),Bs=Jt&&re.clientWidth>0&&re.scrollWidth>re.clientWidth,cs=ls&&re.clientHeight>0&&re.scrollHeight>re.clientHeight,vn=rt.direction==="rtl",zs=cs&&(vn?pe.offsetX<=re.offsetWidth-re.clientWidth:pe.offsetX>re.clientWidth),dt=Bs&&pe.offsetY>re.clientHeight;if(zs||dt)return}if(!je(pe)){if(Ve()==="intentional"){if(pe.detail!==0&&!ES(pe)&&!E.current)return;if(D.current){oe.clear(),D.current=!1;return}}typeof j=="function"&&!j(pe)||K("__outsidePressBubbles")||(d.setOpen(!1,ft(bS,pe)),W())}}}function Fe(pe){Ve()!=="sloppy"||pe.pointerType==="touch"||!d.select("open")||!n||F(pe)||Oe(pe)}function nt(pe){if(Ve()!=="sloppy"||!d.select("open")||!n||F(pe))return;const re=pe.touches[0];re&&(I.current={startTime:Date.now(),startX:re.clientX,startY:re.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},P.start(1e3,()=>{I.current&&(I.current.dismissOnTouchEnd=!1,I.current.dismissOnMouseDown=!1)}))}function Ee(pe,re){const ve=ln(pe);if(!ve)return;const Ze=st(ve,pe.type,()=>{re(pe),Ze()})}function Je(pe){B.current="touch",Ee(pe,nt)}function _e(pe){P.clear(),pe.type==="pointerdown"&&(pe.button===0&&(E.current=!0),B.current=pe.pointerType),!(pe.type==="mousedown"&&I.current&&!I.current.dismissOnMouseDown)&&Ee(pe,re=>{re.type==="pointerdown"?Fe(re):Oe(re)})}function Ae(pe){if(pe.type==="pointercancel"&&(E.current=!1),!O.current)return;const re=N.current;if(Ce(),Ve()==="intentional"){if(pe.type==="pointercancel"){re&&ye();return}if(!je(pe)){if(re){ye();return}typeof j=="function"&&!j(pe)||(oe.clear(),D.current=!0,W())}}}function Pe(pe){if(Ve()!=="sloppy"||!I.current||F(pe))return;const re=pe.touches[0];if(!re)return;const ve=Math.abs(re.clientX-I.current.startX),Ze=Math.abs(re.clientY-I.current.startY),Ln=Math.sqrt(ve*ve+Ze*Ze);Ln>5&&(I.current.dismissOnTouchEnd=!0),Ln>10&&(Oe(pe),P.clear(),I.current=null)}function bt(pe){Ee(pe,Pe)}function Be(pe){Ve()!=="sloppy"||!I.current||F(pe)||(I.current.dismissOnTouchEnd&&Oe(pe),P.clear(),I.current=null)}function fe(pe){Ee(pe,Be)}const xe=Ys(o&&Ys(st(ie,"keydown",H),st(ie,"compositionstart",be),st(ie,"compositionend",ce)),C&&Ys(st(ie,"click",_e,!0),st(ie,"pointerdown",_e,!0),st(ie,"pointerup",Ae,!0),st(ie,"pointercancel",Ae,!0),st(ie,"mousedown",_e,!0),st(ie,"mouseup",Ae,!0),st(ie,"touchstart",Je,{capture:!0,passive:!0}),st(ie,"touchmove",bt,{capture:!0,passive:!0}),st(ie,"touchend",fe,{capture:!0,passive:!0})));return()=>{xe(),X.clear(),oe.clear(),Ce(),D.current=!1,W()}},[g,p,o,C,j,h,n,T,M,H,W,_,K,F,w,d,P]);const U=S.useMemo(()=>({onKeyDown:H,onPointerDown:q,onClick:q}),[H,q]),J=S.useMemo(()=>({onKeyDown:H,onPointerDown:z,onMouseDown:z,onClickCapture:Y,onMouseDownCapture(X){Y(),ne(X)},onPointerDownCapture(X){Y(),ne(X)},onMouseUpCapture:Y,onTouchEndCapture:Y,onTouchMoveCapture:Y}),[H,Y,ne,z]);return S.useMemo(()=>n?{reference:U,floating:J,trigger:U}:{},[n,U,J])}function XO(t,e,n){let{reference:o,floating:s}=t;const i=Es(e),r=RS(e),l=AS(r),u=_s(e),d=i==="y",h=o.x+o.width/2-s.width/2,p=o.y+o.height/2-s.height/2,g=o[l]/2-s[l]/2;let b;switch(u){case"top":b={x:h,y:o.y-s.height};break;case"bottom":b={x:h,y:o.y+o.height};break;case"right":b={x:o.x+o.width,y:p};break;case"left":b={x:o.x-s.width,y:p};break;default:b={x:o.x,y:o.y}}const w=kr(e);return w&&(b[r]+=g*(w==="end"?1:-1)*(n&&d?-1:1)),b}async function SU(t,e){var n;e===void 0&&(e={});const{x:o,y:s,platform:i,rects:r,elements:l,strategy:u}=t,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:g=!1,padding:b=0}=Na(e,t),w=MP(b),j=l[g?p==="floating"?"reference":"floating":p],C=Yg(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(j)))==null||n?j:j.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:h,strategy:u})),_=p==="floating"?{x:o,y:s,width:r.floating.width,height:r.floating.height}:r.reference,T=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),M=await(i.isElement==null?void 0:i.isElement(T))&&await(i.getScale==null?void 0:i.getScale(T))||{x:1,y:1},O=Yg(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:_,offsetParent:T,strategy:u}):_);return{top:(C.top-O.top+w.top)/M.y,bottom:(O.bottom-C.bottom+w.bottom)/M.y,left:(C.left-O.left+w.left)/M.x,right:(O.right-C.right+w.right)/M.x}}const jU=50,CU=async(t,e,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:i=[],platform:r}=n,l=r.detectOverflow?r:{...r,detectOverflow:SU},u=await(r.isRTL==null?void 0:r.isRTL(e));let d=await r.getElementRects({reference:t,floating:e,strategy:s}),{x:h,y:p}=XO(d,o,u),g=o,b=0;const w={};for(let k=0;k<i.length;k++){const j=i[k];if(!j)continue;const{name:C,fn:_}=j,{x:T,y:M,data:O,reset:N}=await _({x:h,y:p,initialPlacement:o,placement:g,strategy:s,middlewareData:w,rects:d,platform:l,elements:{reference:t,floating:e}});h=T??h,p=M??p,w[C]={...w[C],...O},N&&b<jU&&(b++,typeof N=="object"&&(N.placement&&(g=N.placement),N.rects&&(d=N.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:s}):N.rects),{x:h,y:p}=XO(d,g,u)),k=-1)}return{x:h,y:p,placement:g,strategy:s,middlewareData:w}},TU=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:s,middlewareData:i,rects:r,initialPlacement:l,platform:u,elements:d}=e,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:g,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:k=!0,...j}=Na(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const C=_s(s),_=Es(l),T=_s(l)===l,M=await(u.isRTL==null?void 0:u.isRTL(d.floating)),O=g||(T||!k?[Wg(l)]:V7(l)),N=w!=="none";!g&&N&&O.push(...G7(l,k,w,M));const D=[l,...O],E=await u.detectOverflow(e,j),R=[];let B=((o=i.flip)==null?void 0:o.overflows)||[];if(h&&R.push(E[C]),p){const W=U7(s,r,M);R.push(E[W[0]],E[W[1]])}if(B=[...B,{placement:s,overflows:R}],!R.every(W=>W<=0)){var I,P;const W=(((I=i.flip)==null?void 0:I.index)||0)+1,K=D[W];if(K&&(!(p==="alignment"?_!==Es(K):!1)||B.every(H=>Es(H.placement)===_?H.overflows[0]>0:!0)))return{data:{index:W,overflows:B},reset:{placement:K}};let F=(P=B.filter(q=>q.overflows[0]<=0).sort((q,H)=>q.overflows[1]-H.overflows[1])[0])==null?void 0:P.placement;if(!F)switch(b){case"bestFit":{var $;const q=($=B.filter(H=>{if(N){const Y=Es(H.placement);return Y===_||Y==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(Y=>Y>0).reduce((Y,ne)=>Y+ne,0)]).sort((H,Y)=>H[1]-Y[1])[0])==null?void 0:$[0];q&&(F=q);break}case"initialPlacement":F=l;break}if(s!==F)return{reset:{placement:F}}}return{}}}},JP=new Set(["left","top"]);async function EU(t,e){const{placement:n,platform:o,elements:s}=t,i=await(o.isRTL==null?void 0:o.isRTL(s.floating)),r=_s(n),l=kr(n),u=Es(n)==="y",d=JP.has(r)?-1:1,h=i&&u?-1:1,p=Na(e,t);let{mainAxis:g,crossAxis:b,alignmentAxis:w}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return l&&typeof w=="number"&&(b=l==="end"?w*-1:w),u?{x:b*h,y:g*d}:{x:g*d,y:b*h}}const _U=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:s,y:i,placement:r,middlewareData:l}=e,u=await EU(e,t);return r===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:s+u.x,y:i+u.y,data:{...u,placement:r}}}}},MU=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:s,platform:i}=e,{mainAxis:r=!0,crossAxis:l=!1,limiter:u={fn:_=>{let{x:T,y:M}=_;return{x:T,y:M}}},...d}=Na(t,e),h={x:n,y:o},p=await i.detectOverflow(e,d),g=Es(s),b=OS(g);let w=h[b],k=h[g];const j=(_,T)=>_P(T+p[_==="y"?"top":"left"],T,T-p[_==="y"?"bottom":"right"]);r&&(w=j(b,w)),l&&(k=j(g,k));const C=u.fn({...e,[b]:w,[g]:k});return{...C,data:{x:C.x-n,y:C.y-o,enabled:{[b]:r,[g]:l}}}}}},OU=function(t){return t===void 0&&(t={}),{options:t,fn(e){var n,o;const{x:s,y:i,placement:r,rects:l,middlewareData:u}=e,{offset:d=0,mainAxis:h=!0,crossAxis:p=!0}=Na(t,e),g={x:s,y:i},b=Es(r),w=OS(b);let k=g[w],j=g[b];const C=Na(d,e),_=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:(n=C.mainAxis)!=null?n:0,crossAxis:(o=C.crossAxis)!=null?o:0};if(h){const O=w==="y"?"height":"width",N=l.reference[w]-l.floating[O]+_.mainAxis,D=l.reference[w]+l.reference[O]-_.mainAxis;k<N?k=N:k>D&&(k=D)}if(p){var T,M;const O=w==="y"?"width":"height",N=JP.has(_s(r)),D=l.reference[b]-l.floating[O]+(N&&((T=u.offset)==null?void 0:T[b])||0)+(N?0:_.crossAxis),E=l.reference[b]+l.reference[O]+(N?0:((M=u.offset)==null?void 0:M[b])||0)-(N?_.crossAxis:0);j<D?j=D:j>E&&(j=E)}return{[w]:k,[b]:j}}}},AU=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){const{placement:n,rects:o,platform:s,elements:i}=e,{apply:r=()=>{},...l}=Na(t,e),u=await s.detectOverflow(e,l),d=_s(n),h=kr(n),p=Es(n)==="y",{width:g,height:b}=o.floating;let w,k;d==="top"||d==="bottom"?(w=d,k=h===(await(s.isRTL==null?void 0:s.isRTL(i.floating))?"start":"end")?"left":"right"):(k=d,w=h==="end"?"top":"bottom");const j=b-u.top-u.bottom,C=g-u.left-u.right,_=Su(b-u[w],j),T=Su(g-u[k],C),M=e.middlewareData.shift,O=!M;let N=_,D=T;M!=null&&M.enabled.x&&(D=C),M!=null&&M.enabled.y&&(N=j),O&&!h&&(p?D=g-2*fr(u.left,u.right):N=b-2*fr(u.top,u.bottom)),await r({...e,availableWidth:D,availableHeight:N});const E=await s.getDimensions(i.floating);return g!==E.width||b!==E.height?{reset:{rects:!0}}:{}}}};function QP(t){const e=is(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const s=Ft(t),i=s?t.offsetWidth:n,r=s?t.offsetHeight:o,l=Kg(n)!==i||Kg(o)!==r;return l&&(n=i,o=r),{width:n,height:o,$:l}}function HS(t){return vt(t)?t:t.contextElement}function lu(t){const e=HS(t);if(!Ft(e))return hr(1);const n=e.getBoundingClientRect(),{width:o,height:s,$:i}=QP(e);let r=(i?Kg(n.width):n.width)/o,l=(i?Kg(n.height):n.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const RU=hr(0);function ZP(t){const e=on(t);return!fS()||!e.visualViewport?RU:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function NU(t,e,n){return e===void 0&&(e=!1),!!n&&e&&n===on(t)}function Wl(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=HS(t);let r=hr(1);e&&(o?vt(o)&&(r=lu(o)):r=lu(t));const l=NU(i,n,o)?ZP(i):hr(0);let u=(s.left+l.x)/r.x,d=(s.top+l.y)/r.y,h=s.width/r.x,p=s.height/r.y;if(i&&o){const g=on(i),b=vt(o)?on(o):o;let w=g,k=hk(w);for(;k&&b!==w;){const j=lu(k),C=k.getBoundingClientRect(),_=is(k),T=C.left+(k.clientLeft+parseFloat(_.paddingLeft))*j.x,M=C.top+(k.clientTop+parseFloat(_.paddingTop))*j.y;u*=j.x,d*=j.y,h*=j.x,p*=j.y,u+=T,d+=M,w=on(k),k=hk(w)}}return Yg({width:h,height:p,x:u,y:d})}function sb(t,e){const n=Ky(t).scrollLeft;return e?e.left+n:Wl(Er(t)).left+n}function eB(t,e){const n=t.getBoundingClientRect(),o=n.left+e.scrollLeft-sb(t,n),s=n.top+e.scrollTop;return{x:o,y:s}}function DU(t){let{elements:e,rect:n,offsetParent:o,strategy:s}=t;const i=s==="fixed",r=Er(o),l=e?Vy(e.floating):!1;if(o===r||l&&i)return n;let u={scrollLeft:0,scrollTop:0},d=hr(1);const h=hr(0),p=Ft(o);if((p||!i)&&((oo(o)!=="body"||Ih(r))&&(u=Ky(o)),p)){const b=Wl(o);d=lu(o),h.x=b.x+o.clientLeft,h.y=b.y+o.clientTop}const g=r&&!p&&!i?eB(r,u):hr(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x+g.x,y:n.y*d.y-u.scrollTop*d.y+h.y+g.y}}function PU(t){return t.getClientRects?Array.from(t.getClientRects()):[]}function BU(t){const e=Ky(t),n=t.ownerDocument.body,o=fr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=fr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-e.scrollLeft+sb(t);const r=-e.scrollTop;return is(n).direction==="rtl"&&(i+=fr(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:i,y:r}}const zU=25;function IU(t,e,n){n===void 0&&(n="viewport");const o=n==="layoutViewport",s=on(t),i=Er(t),r=s.visualViewport;let l=i.clientWidth,u=i.clientHeight,d=0,h=0;if(r){const g=!fS()||e==="fixed";o?g||(d=-r.offsetLeft,h=-r.offsetTop):(l=r.width,u=r.height,g&&(d=r.offsetLeft,h=r.offsetTop))}if(sb(i)<=0){const g=i.ownerDocument,b=g.body,w=getComputedStyle(b),k=g.compatMode==="CSS1Compat"&&parseFloat(w.marginLeft)+parseFloat(w.marginRight)||0,j=Math.abs(i.clientWidth-b.clientWidth-k),C=getComputedStyle(i).scrollbarGutter==="stable both-edges"?j/2:j;C<=zU&&(l-=C)}return{width:l,height:u,x:d,y:h}}function LU(t,e){const n=Wl(t,!0,e==="fixed"),o=n.top+t.clientTop,s=n.left+t.clientLeft,i=lu(t),r=t.clientWidth*i.x,l=t.clientHeight*i.y,u=s*i.x,d=o*i.y;return{width:r,height:l,x:u,y:d}}function JO(t,e,n){let o;if(e==="viewport"||e==="layoutViewport")o=IU(t,n,e);else if(e==="document")o=BU(Er(t));else if(vt(e))o=LU(e,n);else{const s=ZP(t);o={x:e.x-s.x,y:e.y-s.y,width:e.width,height:e.height}}return Yg(o)}function $U(t,e){const n=e.get(t);if(n)return n;let o=Kf(t,[],!1).filter(l=>vt(l)&&oo(l)!=="body"),s=null;const i=is(t).position==="fixed";let r=i?wr(t):t;for(;vt(r)&&!ur(r);){const l=is(r),u=dS(r),d=s?s.position:i?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&l.position==="static")?o=o.filter(p=>p!==r):s=l,r=wr(r)}return e.set(t,o),o}function FU(t){let{element:e,boundary:n,rootBoundary:o,strategy:s}=t;const r=[...n==="clippingAncestors"?Vy(e)?[]:$U(e,this._c):[].concat(n),o],l=JO(e,r[0],s);let u=l.top,d=l.right,h=l.bottom,p=l.left;for(let g=1;g<r.length;g++){const b=JO(e,r[g],s);u=fr(b.top,u),d=Su(b.right,d),h=Su(b.bottom,h),p=fr(b.left,p)}return{width:d-p,height:h-u,x:p,y:u}}function HU(t){const{width:e,height:n}=QP(t);return{width:e,height:n}}function qU(t,e,n){const o=Ft(e),s=Er(e),i=n==="fixed",r=Wl(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const u=hr(0);if((o||!i)&&((oo(e)!=="body"||Ih(s))&&(l=Ky(e)),o)){const g=Wl(e,!0,i,e);u.x=g.x+e.clientLeft,u.y=g.y+e.clientTop}!o&&s&&(u.x=sb(s));const d=s&&!o&&!i?eB(s,l):hr(0),h=r.left+l.scrollLeft-u.x-d.x,p=r.top+l.scrollTop-u.y-d.y;return{x:h,y:p,width:r.width,height:r.height}}function I0(t){return is(t).position==="static"}function QO(t,e){if(!Ft(t)||is(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Er(t)===n&&(n=n.ownerDocument.body),n}function tB(t,e){const n=on(t);if(Vy(t))return n;if(!Ft(t)){let s=wr(t);for(;s&&!ur(s);){if(vt(s)&&!I0(s))return s;s=wr(s)}return n}let o=QO(t,e);for(;o&&wq(o)&&I0(o);)o=QO(o,e);return o&&ur(o)&&I0(o)&&!dS(o)?n:o||kq(t)||n}const UU=async function(t){const e=this.getOffsetParent||tB,n=this.getDimensions,o=await n(t.floating);return{reference:qU(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function VU(t){return is(t).direction==="rtl"}const KU={convertOffsetParentRelativeRectToViewportRelativeRect:DU,getDocumentElement:Er,getClippingRect:FU,getOffsetParent:tB,getElementRects:UU,getClientRects:PU,getDimensions:HU,getScale:lu,isElement:vt,isRTL:VU};function nB(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function WU(t,e,n){let o=null,s;const i=Er(t);function r(){var h;clearTimeout(s),(h=o)==null||h.disconnect(),o=null}function l(h,p){h===void 0&&(h=!1),p===void 0&&(p=1),r();const g=t.getBoundingClientRect(),{left:b,top:w,width:k,height:j}=g;if(h||e(),!k||!j)return;const C=Pm(w),_=Pm(i.clientWidth-(b+k)),T=Pm(i.clientHeight-(w+j)),M=Pm(b),N={rootMargin:-C+"px "+-_+"px "+-T+"px "+-M+"px",threshold:fr(0,Su(1,p))||1};let D=!0;function E(R){const B=R[0].intersectionRatio;if(!nB(g,t.getBoundingClientRect()))return l();if(B!==p){if(!D)return l();B?l(!1,B):s=setTimeout(()=>{l(!1,1e-7)},1e3)}D=!1}try{o=new IntersectionObserver(E,{...N,root:i.ownerDocument})}catch{o=new IntersectionObserver(E,N)}o.observe(t)}const u=on(t),d=()=>l(n);return u.addEventListener("resize",d),l(!0),()=>{u.removeEventListener("resize",d),r()}}function ZO(t,e,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,d=HS(t),h=s||i?[...d?Kf(d):[],...e?Kf(e):[]]:[];h.forEach(C=>{s&&C.addEventListener("scroll",n),i&&C.addEventListener("resize",n)});const p=d&&l?WU(d,n,i):null;let g=-1,b=null;r&&(b=new ResizeObserver(C=>{let[_]=C;_&&_.target===d&&b&&e&&(b.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(e)})),n()}),d&&!u&&b.observe(d),e&&b.observe(e));let w,k=u?Wl(t):null;u&&j();function j(){const C=Wl(t);k&&!nB(k,C)&&n(),k=C,w=requestAnimationFrame(j)}return n(),()=>{var C;h.forEach(_=>{s&&_.removeEventListener("scroll",n),i&&_.removeEventListener("resize",n)}),p?.(),(C=b)==null||C.disconnect(),b=null,u&&cancelAnimationFrame(w)}}const YU=_U,GU=MU,XU=TU,JU=AU,QU=OU,ZU=(t,e,n)=>{const o=new Map,s=n??{},i={...KU,...s.platform,_c:o};return CU(t,e,{...s,platform:i})};var e9=typeof document<"u",t9=function(){},xg=e9?S.useLayoutEffect:t9;function Gg(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,o,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(o=n;o--!==0;)if(!Gg(t[o],e[o]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(e,s[o]))return!1;for(o=n;o--!==0;){const i=s[o];if(!(i==="_owner"&&t.$$typeof)&&!Gg(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function oB(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function eA(t,e){const n=oB(t);return Math.round(e*n)/n}function L0(t){const e=S.useRef(t);return xg(()=>{e.current=t}),e}function n9(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:o=[],platform:s,elements:{reference:i,floating:r}={},transform:l=!0,whileElementsMounted:u,open:d}=t,[h,p]=S.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[g,b]=S.useState(o);Gg(g,o)||b(o);const[w,k]=S.useState(null),[j,C]=S.useState(null),_=S.useCallback(H=>{H!==N.current&&(N.current=H,k(H))},[]),T=S.useCallback(H=>{H!==D.current&&(D.current=H,C(H))},[]),M=i||w,O=r||j,N=S.useRef(null),D=S.useRef(null),E=S.useRef(h),R=u!=null,B=L0(u),I=L0(s),P=L0(d),$=S.useCallback(()=>{if(!N.current||!D.current)return;const H={placement:e,strategy:n,middleware:g};I.current&&(H.platform=I.current),ZU(N.current,D.current,H).then(Y=>{const ne={...Y,isPositioned:P.current!==!1};W.current&&!Gg(E.current,ne)&&(E.current=ne,Os.flushSync(()=>{p(ne)}))})},[g,e,n,I,P]);xg(()=>{d===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(H=>({...H,isPositioned:!1})))},[d]);const W=S.useRef(!1);xg(()=>(W.current=!0,()=>{W.current=!1}),[]),xg(()=>{if(M&&(N.current=M),O&&(D.current=O),M&&O){if(B.current)return B.current(M,O,$);$()}},[M,O,$,B,R]);const K=S.useMemo(()=>({reference:N,floating:D,setReference:_,setFloating:T}),[_,T]),F=S.useMemo(()=>({reference:M,floating:O}),[M,O]),q=S.useMemo(()=>{const H={position:n,left:0,top:0};if(!F.floating)return H;const Y=eA(F.floating,h.x),ne=eA(F.floating,h.y);return l?{...H,transform:"translate("+Y+"px, "+ne+"px)",...oB(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Y,top:ne}},[n,l,F.floating,h.x,h.y]);return S.useMemo(()=>({...h,update:$,refs:K,elements:F,floatingStyles:q}),[h,$,K,F,q])}const o9=(t,e)=>{const n=YU(t);return{name:n.name,fn:n.fn,options:[t,e]}},s9=(t,e)=>{const n=GU(t);return{name:n.name,fn:n.fn,options:[t,e]}},i9=(t,e)=>({fn:QU(t).fn,options:[t,e]}),r9=(t,e)=>{const n=XU(t);return{name:n.name,fn:n.fn,options:[t,e]}},a9=(t,e)=>{const n=JU(t);return{name:n.name,fn:n.fn,options:[t,e]}};var $0={exports:{}},F0={};var tA;function l9(){if(tA)return F0;tA=1;var t=zh();function e(p,g){return p===g&&(p!==0||1/p===1/g)||p!==p&&g!==g}var n=typeof Object.is=="function"?Object.is:e,o=t.useState,s=t.useEffect,i=t.useLayoutEffect,r=t.useDebugValue;function l(p,g){var b=g(),w=o({inst:{value:b,getSnapshot:g}}),k=w[0].inst,j=w[1];return i(function(){k.value=b,k.getSnapshot=g,u(k)&&j({inst:k})},[p,b,g]),s(function(){return u(k)&&j({inst:k}),p(function(){u(k)&&j({inst:k})})},[p]),r(b),b}function u(p){var g=p.getSnapshot;p=p.value;try{var b=g();return!n(p,b)}catch{return!0}}function d(p,g){return g()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return F0.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,F0}var nA;function sB(){return nA||(nA=1,$0.exports=l9()),$0.exports}var qS=sB(),H0={exports:{}},q0={};var oA;function c9(){if(oA)return q0;oA=1;var t=zh(),e=sB();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var o=typeof Object.is=="function"?Object.is:n,s=e.useSyncExternalStore,i=t.useRef,r=t.useEffect,l=t.useMemo,u=t.useDebugValue;return q0.useSyncExternalStoreWithSelector=function(d,h,p,g,b){var w=i(null);if(w.current===null){var k={hasValue:!1,value:null};w.current=k}else k=w.current;w=l(function(){function C(N){if(!_){if(_=!0,T=N,N=g(N),b!==void 0&&k.hasValue){var D=k.value;if(b(D,N))return M=D}return M=N}if(D=M,o(T,N))return D;var E=g(N);return b!==void 0&&b(D,E)?(T=N,D):(T=N,M=E)}var _=!1,T,M,O=p===void 0?null:p;return[function(){return C(h())},O===null?void 0:function(){return C(O())}]},[h,p,g,b]);var j=s(d,w[0],w[1]);return r(function(){k.hasValue=!0,k.value=j},[j]),u(j),j},q0}var sA;function u9(){return sA||(sA=1,H0.exports=c9()),H0.exports}var d9=u9();const Ck=[];let Tk;function f9(){return Tk}function h9(t){Ck.push(t)}function Hh(t){const e=(n,o)=>{const s=qn(p9).current;let i;try{Tk=s;for(const r of Ck)r.before(s);i=t(n,o);for(const r of Ck)r.after(s);s.didInitialize=!0}finally{Tk=void 0}return i};return e.displayName=t.displayName||t.name,e}function US(t){return S.forwardRef(Hh(t))}function p9(){return{didInitialize:!1}}const m9=hS(19),g9=m9?b9:w9;function iB(t,e,n,o,s){return g9(t,e,n,o,s)}function y9(t,e,n,o,s){const i=S.useCallback(()=>e(t.getSnapshot(),n,o,s),[t,e,n,o,s]);return qS.useSyncExternalStore(t.subscribe,i,i)}h9({before(t){t.syncIndex=0,t.didInitialize||(t.syncTick=1,t.syncHooks=[],t.didChangeStore=!0,t.getSnapshot=()=>{let e=!1;for(let n=0;n<t.syncHooks.length;n+=1){const o=t.syncHooks[n],s=o.selector(o.store.state,o.a1,o.a2,o.a3);Object.is(o.value,s)||(e=!0,o.value=s)}return e&&(t.syncTick+=1),t.syncTick})},after(t){t.syncHooks.length>0&&(t.didChangeStore&&(t.didChangeStore=!1,t.subscribe=e=>{const n=new Set;for(const s of t.syncHooks)n.add(s.store);const o=[];for(const s of n)o.push(s.subscribe(e));return()=>{for(const s of o)s()}}),qS.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getSnapshot))}});function b9(t,e,n,o,s){const i=f9();if(!i)return y9(t,e,n,o,s);const r=i.syncIndex;i.syncIndex+=1;let l;return i.didInitialize?(l=i.syncHooks[r],(l.store!==t||l.selector!==e||!Object.is(l.a1,n)||!Object.is(l.a2,o)||!Object.is(l.a3,s))&&(l.store!==t&&(i.didChangeStore=!0),l.store=t,l.selector=e,l.a1=n,l.a2=o,l.a3=s,l.value=e(t.getSnapshot(),n,o,s))):(l={store:t,selector:e,a1:n,a2:o,a3:s,value:e(t.getSnapshot(),n,o,s)},i.syncHooks.push(l)),l.value}function w9(t,e,n,o,s){return d9.useSyncExternalStoreWithSelector(t.subscribe,t.getSnapshot,t.getSnapshot,i=>e(i,n,o,s))}class x9{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(e)}}update(e){for(const n in e)if(!Object.is(this.state[n],e[n])){this.setState({...this.state,...e});return}}set(e,n){Object.is(this.state[e],n)||this.setState({...this.state,[e]:n})}notifyAll(){const e={...this.state};this.setState(e)}use(e,n,o,s){return iB(this,e,n,o,s)}}class Gu extends x9{constructor(e,n={},o){super(e),this.context=n,this.selectors=o}useSyncedValue(e,n){S.useDebugValue(e);const o=this;Se(()=>{o.state[e]!==n&&o.set(e,n)},[o,e,n])}useSyncedValueWithCleanup(e,n){const o=this;Se(()=>(o.state[e]!==n&&o.set(e,n),()=>{o.set(e,void 0)}),[o,e,n])}useSyncedValues(e){const n=this,o=Object.values(e);Se(()=>{n.update(e)},[n,...o])}useControlledProp(e,n){S.useDebugValue(e);const o=this,s=n!==void 0;Se(()=>{s&&!Object.is(o.state[e],n)&&o.setState({...o.state,[e]:n})},[o,e,n,s])}select(e,n,o,s){const i=this.selectors[e];return i(this.state,n,o,s)}useState(e,n,o,s){return S.useDebugValue(e),iB(this,this.selectors[e],n,o,s)}useContextCallback(e,n){S.useDebugValue(e);const o=De(n??Rn);this.context[e]=o}useStateSetter(e){const n=S.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(e,o)}),n.current}observe(e,n){let o;typeof e=="function"?o=e:o=this.selectors[e];let s=o(this.state);return n(s,s,this),this.subscribe(i=>{const r=o(i);if(!Object.is(s,r)){const l=s;s=r,n(r,l,this)}})}}const v9={open:t=>t.open,transitionStatus:t=>t.transitionStatus,domReferenceElement:t=>t.domReferenceElement,referenceElement:t=>t.positionReference??t.referenceElement,floatingElement:t=>t.floatingElement,floatingId:t=>t.floatingId};class rB extends Gu{constructor(e){const{syncOnly:n,nested:o,onOpenChange:s,triggerElements:i,...r}=e;super({...r,positionReference:r.referenceElement,domReferenceElement:r.referenceElement},{onOpenChange:s,dataRef:{current:{}},events:KP(),nested:o,triggerElements:i},v9),this.syncOnly=n}syncOpenEvent=(e,n)=>{(!e||!this.state.open||n!=null&&D7(n))&&(this.context.dataRef.current.openEvent=e?n:void 0)};dispatchOpenChange=(e,n)=>{this.syncOpenEvent(e,n.event);const o={open:e,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",o)};setOpen=(e,n)=>{if(this.syncOnly){this.context.onOpenChange?.(e,n);return}this.dispatchOpenChange(e,n),this.context.onOpenChange?.(e,n)}}function aB(t){const{popupStore:e,treatPopupAsFloatingElement:n=!1,floatingRootContext:o,floatingId:s,nested:i,onOpenChange:r}=t,l=e.useState("open"),u=e.useState("activeTriggerElement"),d=e.useState(n?"popupElement":"positionerElement"),h=e.context.triggerElements,p=r,g=S.useRef(null);o===void 0&&g.current===null&&(g.current=new rB({open:l,transitionStatus:void 0,referenceElement:u,floatingElement:d,triggerElements:h,onOpenChange:p,floatingId:s,syncOnly:!0,nested:i}));const b=o??g.current;return e.useSyncedValue("floatingId",s),Se(()=>{const w={open:l,floatingId:s,referenceElement:u,floatingElement:d};vt(u)&&(w.domReferenceElement=u),b.state.positionReference===b.state.referenceElement&&(w.positionReference=u),b.update(w)},[l,s,u,d,b]),b.context.onOpenChange=p,b.context.nested=i,b}const ib={tabIndex:-1,[yk]:""};function lB(t){return e=>e==="touch"?t.current:!0}function VS(t,e=!1){const n=Ul(),o=Zl()!=null,s=qn(()=>t(n,o)).current;return aB({popupStore:s,treatPopupAsFloatingElement:e,floatingRootContext:s.state.floatingRootContext,floatingId:n,nested:o,onOpenChange:s.setOpen}),s}function rb({handle:t,store:e}){return Se(()=>t.attachStore(e),[t,e]),null}function iA(t){const e=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==e&&t.set("triggerCount",e)}function cB(t,e){const n=S.useRef(null);return De(o=>{const s=n.current;if(s!==null){if(s.element===o&&s.store===e&&s.id===t)return;n.current=null;const i=s.store;i.context.triggerElements.getById(s.id)===s.element&&(i.context.triggerElements.delete(s.id),iA(i))}o!==null&&t!==void 0&&(n.current={store:e,id:t,element:o},e.context.triggerElements.add(t,o),iA(e))})}function ab(t,e,n,o=!1){let s=t.preventUnmountingOnClose;e?s=!1:o&&(s=!0);const i=n?.id??null;let r=t.activeTriggerId,l=t.activeTriggerElement;return(i||e)&&(r=i,l=n??null),{open:e,preventUnmountingOnClose:s,activeTriggerId:r,activeTriggerElement:l}}function KS(t){let e=!1;return t.preventUnmountOnClose=()=>{e=!0},()=>e}function k9(t,e,n,o={}){const s=n.reason,i=s===pn,r=e&&s===iu,l=!e&&(s===xr||s===$h),u=KS(n);if(t.context.onOpenChange?.(e,n),n.isCanceled)return;o.onBeforeDispatch?.(),t.state.floatingRootContext.dispatchOpenChange(e,n);const d=()=>{const h=ab(t.state,e,n.trigger,u()),p={...o.extraState,...h};r?p.instantType="focus":l?p.instantType="dismiss":i&&(p.instantType=void 0),t.update(p)};i?Os.flushSync(d):d()}function WS(t,e,n,o){const s=n.useState("isMountedByTrigger",t),i=cB(t,n),r=De(u=>{const d=n.select("open"),h=n.select("activeTriggerId");if(h===t){const p={activeTriggerElement:u,...d?o:null};n.update(p);return}if(h==null&&d){const p={activeTriggerId:t??null,activeTriggerElement:u,...o};n.update(p)}}),l=De(u=>{i(u),u&&r(u)});return Se(()=>(l(e.current),()=>l(null)),[l,e,n,t]),Se(()=>{if(s){const u={activeTriggerElement:e.current,...o};n.update(u)}},[s,n,e,...Object.values(o)]),{registerTrigger:l,isMountedByThisTrigger:s}}function lb(t,e={}){const{closeOnActiveTriggerUnmount:n=!1}=e,o=S.useRef(null),s=t.useState("open"),i=t.useState("triggerCount"),r=t.useState("activeTriggerId"),l=t.useState("activeTriggerElement");Se(()=>{if(!s){o.current=null,t.state.triggerCount!==0&&t.set("triggerCount",0);return}const u=t.context.triggerElements.size,d={};t.state.triggerCount!==u&&(d.triggerCount=u);const h=t.select("activeTriggerId");let p=null;if(h){const g=t.context.triggerElements.getById(h);if(g)o.current=h,g!==t.state.activeTriggerElement&&(d.activeTriggerElement=g);else{for(const[b,w]of t.context.triggerElements.entries())if(w===t.state.activeTriggerElement){d.activeTriggerId=b,d.activeTriggerElement=w,o.current=b;break}d.activeTriggerId===void 0&&(o.current===h?p=h:o.current=null)}}else o.current=null;if(!p&&!h&&u===1){const g=t.context.triggerElements.entries().next();if(!g.done){const[b,w]=g.value;d.activeTriggerId=b,d.activeTriggerElement=w,o.current=b}}(d.triggerCount!==void 0||d.activeTriggerId!==void 0||d.activeTriggerElement!==void 0)&&t.update(d),p&&n&&queueMicrotask(()=>{if(t.select("open")&&t.select("activeTriggerId")===p&&!t.context.triggerElements.getById(p)){const g=ft(Lh);t.setOpen(!1,g),g.isCanceled||t.update({activeTriggerId:null,activeTriggerElement:null})}})},[s,t,i,r,l,n])}function cb(t,e,n,o){const{mounted:s,setMounted:i,transitionStatus:r}=d7(t,!1,!1,o),l=e.useState("preventUnmountingOnClose"),u=t?!1:l;e.useSyncedValues({mounted:s,transitionStatus:r,preventUnmountingOnClose:u});const d=De(()=>{i(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),e.context.onOpenChangeComplete?.(!1)});return Yu({enabled:s&&!t&&!u,open:t,ref:e.context.popupRef,onComplete(){t||d()}}),{forceUnmount:d,transitionStatus:r}}function ub(t,e){t.useSyncedValues(e),Se(()=>()=>{t.update({activeTriggerProps:nn,inactiveTriggerProps:nn,popupProps:nn})},[t])}function uB(t,e){Se(()=>{!e&&t.state.openMethod!==null&&t.set("openMethod",null)},[e,t]),Se(()=>()=>{t.state.openMethod!==null&&t.set("openMethod",null)},[t])}class db{constructor(){this.idMap=new Map}add(e,n){this.idMap.set(e,n)}delete(e){this.idMap.delete(e)}hasElement(e){for(const n of this.idMap.values())if(n===e)return!0;return!1}hasMatchingElement(e){for(const n of this.idMap.values())if(e(n))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function fb(t,e,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new rB({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:t,floatingId:e,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:e,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:nn,inactiveTriggerProps:nn,popupProps:nn}}const _f=t=>t.triggerIdProp??t.activeTriggerId,YS=t=>t.openProp??t.open,rA=t=>(t.popupElement?.id??t.floatingId)||void 0;function dB(t,e){return e!==void 0&&YS(t)&&_f(t)===e}function S9(t,e){return dB(t,e)?!0:e!==void 0&&YS(t)&&_f(t)==null&&t.triggerCount===1}const hb={open:YS,mounted:t=>t.mounted,transitionStatus:t=>t.transitionStatus,floatingRootContext:t=>t.floatingRootContext,triggerCount:t=>t.triggerCount,preventUnmountingOnClose:t=>t.preventUnmountingOnClose,payload:t=>t.payload,activeTriggerId:_f,activeTriggerElement:t=>t.mounted?t.activeTriggerElement:null,popupId:rA,isTriggerActive:(t,e)=>e!==void 0&&_f(t)===e,isOpenedByTrigger:(t,e)=>dB(t,e),isMountedByTrigger:(t,e)=>e!==void 0&&_f(t)===e&&t.mounted,triggerProps:(t,e)=>e?t.activeTriggerProps:t.inactiveTriggerProps,triggerPopupId:(t,e)=>S9(t,e)?rA(t):void 0,popupProps:t=>t.popupProps,popupElement:t=>t.popupElement,positionerElement:t=>t.positionerElement};function GS(t){const e=S.useCallback(o=>t===void 0?Rn:t.subscribeStore(o),[t]),n=S.useCallback(()=>t===void 0?void 0:t.store,[t]);return qS.useSyncExternalStore(e,n,()=>t?.serverStore)}function j9(t){return C9(t,t.rootContext)}function C9(t,e){const{nodeId:n,externalTree:o}=t,s=e.useState("referenceElement"),i=e.useState("floatingElement"),r=e.useState("domReferenceElement"),l=e.useState("open"),u=e.useState("floatingId"),[d,h]=S.useState(null),[p,g]=S.useState(void 0),[b,w]=S.useState(void 0),k=S.useRef(null),j=Ua(o),C=S.useMemo(()=>({reference:s,floating:i,domReference:r}),[s,i,r]),_=n9({...t,elements:{...C,...d&&{reference:d}}}),T=vt(p)?p:null,M=b===void 0?e.state.floatingElement:b;e.useSyncedValue("referenceElement",p??null),e.useSyncedValue("domReferenceElement",p===void 0?r:T),e.useSyncedValue("floatingElement",M);const O=S.useCallback(I=>{const P=vt(I)?{getBoundingClientRect:()=>I.getBoundingClientRect(),getClientRects:()=>I.getClientRects(),contextElement:I}:I;h(P),_.refs.setReference(P)},[_.refs]),N=S.useCallback(I=>{(vt(I)||I===null)&&(k.current=I,g(I)),(vt(_.refs.reference.current)||_.refs.reference.current===null||I!==null&&!vt(I))&&_.refs.setReference(I)},[_.refs,g]),D=S.useCallback(I=>{w(I),_.refs.setFloating(I)},[_.refs]),E=S.useMemo(()=>({..._.refs,setReference:N,setFloating:D,setPositionReference:O,domReference:k}),[_.refs,N,D,O]),R=S.useMemo(()=>({..._.elements,domReference:r}),[_.elements,r]),B=S.useMemo(()=>({..._,dataRef:e.context.dataRef,open:l,onOpenChange:e.setOpen,events:e.context.events,floatingId:u,refs:E,elements:R,nodeId:n,rootStore:e}),[_,E,R,n,e,l,u]);return Se(()=>{r&&(k.current=r)},[r]),Se(()=>{e.context.dataRef.current.floatingContext=B;const I=j?.nodesRef.current.find(P=>P.id===n);I&&(I.context=B)}),S.useMemo(()=>({..._,context:B,refs:E,elements:R,rootStore:e}),[_,E,R,B,e])}const U0=jS&&qa;function fB(t,e={}){const{enabled:n=!0,delay:o}=e,s="rootStore"in t?t.rootStore:t,{events:i,dataRef:r}=s.context,l=S.useRef(!1),u=S.useRef(null),d=S.useRef(!0),h=co();S.useEffect(()=>{const g=s.select("domReferenceElement");if(!n)return;const b=on(g);function w(){const C=s.select("domReferenceElement");!s.select("open")&&Ft(C)&&C===Nn(yt(C))&&(l.current=!0,u.current=C)}function k(){d.current=!0}function j(){d.current=!1}return Ys(st(b,"blur",w),U0&&st(b,"keydown",k,!0),U0&&st(b,"pointerdown",j,!0))},[s,n]),S.useEffect(()=>{if(!n)return;function g(b){if(b.reason===xr||b.reason===$h){const w=s.select("domReferenceElement");vt(w)&&(u.current=w,l.current=!0)}}return i.on("openchange",g),()=>{i.off("openchange",g)}},[i,n,s]);const p=S.useMemo(()=>{function g(){l.current=!1,u.current=null}return{onMouseLeave(){g()},onFocus(b){const w=b.currentTarget;if(l.current){if(u.current===w)return;g()}const k=ln(b.nativeEvent);if(vt(k)){if(U0&&!b.relatedTarget){if(!d.current&&!tb(k))return}else if(!Vg(k))return}const j=Ug(b.relatedTarget,s.context.triggerElements),{nativeEvent:C,currentTarget:_}=b,T=typeof o=="function"?o():o;if(s.select("open")&&j||T===0||T===void 0){s.setOpen(!0,ft(iu,C,_));return}h.start(T,()=>{l.current||s.setOpen(!0,ft(iu,C,_))})},onBlur(b){g();const w=b.relatedTarget,k=b.nativeEvent,j=vt(w)&&w.hasAttribute(Gf("focus-guard"))&&w.getAttribute("data-type")==="outside";h.start(0,()=>{const C=s.select("domReferenceElement"),_=Nn(yt(C));!w&&_===C||Ie(r.current.floatingContext?.refs.floating.current,_)||Ie(C,_)||j||Ug(w??_,s.context.triggerElements)||s.setOpen(!1,ft(iu,k))})}}},[r,o,s,h]);return S.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}class XS{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.pointerEventsScopeElement=null,this.pointerEventsReferenceElement=null,this.pointerEventsFloatingElement=null,this.restTimeoutPending=!1,this.openChangeTimeout=new Lo,this.restTimeout=new Lo,this.handleCloseOptions=void 0}static create(){return new XS}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}const Xg=new WeakMap;function Jg(t){if(!t.performedPointerEventsMutation)return;const e=t.pointerEventsScopeElement;e&&Xg.get(e)===t&&(t.pointerEventsScopeElement?.style.removeProperty("pointer-events"),t.pointerEventsReferenceElement?.style.removeProperty("pointer-events"),t.pointerEventsFloatingElement?.style.removeProperty("pointer-events"),Xg.delete(e)),t.performedPointerEventsMutation=!1,t.pointerEventsScopeElement=null,t.pointerEventsReferenceElement=null,t.pointerEventsFloatingElement=null}function hB(t,e){const{scopeElement:n,referenceElement:o,floatingElement:s}=e,i=Xg.get(n);i&&i!==t&&Jg(i),Jg(t),t.performedPointerEventsMutation=!0,t.pointerEventsScopeElement=n,t.pointerEventsReferenceElement=o,t.pointerEventsFloatingElement=s,Xg.set(n,t),n.style.pointerEvents="none",o.style.pointerEvents="auto",s.style.pointerEvents="auto"}function JS(t){const e=t.context.dataRef.current,n=qn(()=>e.hoverInteractionState??XS.create()).current;return e.hoverInteractionState||(e.hoverInteractionState=n),Yy(e.hoverInteractionState.disposeEffect),e.hoverInteractionState}function QS(t,e={}){const{enabled:n=!0,closeDelay:o=0,nodeId:s}=e,i="rootStore"in t?t.rootStore:t,r=i.useState("open"),l=i.useState("floatingElement"),u=i.useState("domReferenceElement"),{dataRef:d}=i.context,h=Ua(),p=Zl(),g=JS(i),b=co(),w=De(()=>TP(d.current.openEvent?.type,g.interactedInside)),k=De(()=>I7(d.current.openEvent?.type)),j=De(()=>{Jg(g)});Se(()=>{r||(g.pointerType=void 0,g.restTimeoutPending=!1,g.interactedInside=!1,j())},[r,g,j]),S.useEffect(()=>j,[j]),Se(()=>{if(n&&r&&g.handleCloseOptions?.blockPointerEvents&&k()&&vt(u)&&l){const C=u,_=l,T=yt(l),M=h?.nodesRef.current.find(E=>E.id===p)?.context?.elements.floating;M&&(M.style.pointerEvents="");const O=g.pointerEventsScopeElement!==_?g.pointerEventsScopeElement:null,N=M!==_?M:null,D=g.handleCloseOptions?.getScope?.()??O??N??C.closest("[data-rootownerid]")??T.body;return hB(g,{scopeElement:D,referenceElement:C,floatingElement:_}),()=>{j()}}},[n,r,u,l,g,k,h,p,j]),S.useEffect(()=>{if(!n)return;function C(){return!!(h&&p&&Da(h.nodesRef.current,p).length>0)}function _(E){const R=Kl(o,"close",g.pointerType),B=()=>{i.setOpen(!1,ft(pn,E)),h?.events.emit("floating.closed",E)};R?g.openChangeTimeout.start(R,B):(g.openChangeTimeout.clear(),B())}function T(E){const R=ln(E);if(!B7(R)){g.interactedInside=!1;return}g.interactedInside=R?.closest("[aria-haspopup]")!=null}function M(){g.openChangeTimeout.clear(),b.clear(),h?.events.off("floating.closed",N),j()}function O(E){if(C()&&h){h.events.on("floating.closed",N);return}if(Ug(E.relatedTarget,i.context.triggerElements))return;const R=d.current.floatingContext?.nodeId??s,B=E.relatedTarget;if(!(h&&R&&vt(B)&&Da(h.nodesRef.current,R,!1).some(P=>Ie(P.context?.elements.floating,B)))){if(g.handler){g.handler(E);return}j(),k()&&!w()&&_(E)}}function N(E){!h||!p||C()||b.start(0,()=>{h.events.off("floating.closed",N),i.setOpen(!1,ft(pn,E)),h.events.emit("floating.closed",E)})}const D=l;return Ys(D&&st(D,"mouseenter",M),D&&st(D,"mouseleave",O),D&&st(D,"pointerdown",T,!0),()=>{h?.events.off("floating.closed",N)})},[n,l,i,d,o,s,k,w,j,g,h,p,b])}const T9={current:null};function pb(t,e={}){const{enabled:n=!0,delay:o=0,handleClose:s=null,mouseOnly:i=!1,restMs:r=0,move:l=!0,triggerElementRef:u=T9,externalTree:d,isActiveTrigger:h=!0,getHandleCloseContext:p,isClosing:g,shouldOpen:b,guardStaleOpen:w=!1}=e,k="rootStore"in t?t.rootStore:t,{dataRef:j,events:C}=k.context,_=Ua(d),T=JS(k),M=S.useRef(!1),O=Mn(s),N=Mn(o),D=Mn(r),E=Mn(n),R=Mn(b),B=Mn(g),I=De(()=>TP(j.current.openEvent?.type,T.interactedInside)),P=De(()=>R.current?.()!==!1),$=De((F,q,H)=>{const Y=k.context.triggerElements;if(Y.hasElement(q))return!F||!Ie(F,q);if(!vt(H))return!1;const ne=H;return Y.hasMatchingElement(z=>Ie(z,ne))&&(!F||!Ie(F,ne))}),W=De(()=>{if(!T.handler)return;yt(k.select("domReferenceElement")).removeEventListener("mousemove",T.handler),T.handler=void 0}),K=De(()=>{Jg(T)});return h&&(T.handleCloseOptions=s?.__options),S.useEffect(()=>W,[W]),S.useEffect(()=>{if(!n)return;function F(q){q.open?M.current=!1:(M.current=q.reason===pn,W(),T.openChangeTimeout.clear(),T.restTimeout.clear(),T.blockMouseMove=!0,T.restTimeoutPending=!1)}return C.on("openchange",F),()=>{C.off("openchange",F)}},[n,C,T,W]),S.useEffect(()=>{if(!n)return;function F(U,J=!0){const X=Kl(N.current,"close",T.pointerType);X?T.openChangeTimeout.start(X,()=>{k.setOpen(!1,ft(pn,U)),_?.events.emit("floating.closed",U)}):J&&(T.openChangeTimeout.clear(),k.setOpen(!1,ft(pn,U)),_?.events.emit("floating.closed",U))}const q=u.current??(h?k.select("domReferenceElement"):null);if(!vt(q))return;function H(U){if(T.openChangeTimeout.clear(),T.blockMouseMove=!1,i&&!Sa(T.pointerType))return;const J=PO(D.current),X=Kl(N.current,"open",T.pointerType),oe=ln(U),ie=U.currentTarget??null,be=k.select("domReferenceElement");let ce=ie;if(vt(oe)&&!k.context.triggerElements.hasElement(oe)){for(const Ee of k.context.triggerElements.elements())if(Ie(Ee,oe)){ce=Ee;break}}vt(ie)&&vt(be)&&!k.context.triggerElements.hasElement(ie)&&Ie(ie,be)&&(ce=be);const ye=ce==null?!1:$(be,ce,oe),Ce=k.select("open"),Ve=B.current?.()??k.select("transitionStatus")==="ending",Me=!Ce&&Ve&&M.current,je=!ye&&vt(ce)&&vt(be)&&Ie(be,ce)&&Me,Oe=J>0&&!X,Fe=ye&&(Ce||Me)||je,nt=!Ce||ye;if(Fe){P()&&k.setOpen(!0,ft(pn,U,ce));return}Oe||(X?T.openChangeTimeout.start(X,()=>{nt&&P()&&k.setOpen(!0,ft(pn,U,ce))}):nt&&P()&&k.setOpen(!0,ft(pn,U,ce)))}function Y(U){if(I()){K();return}W();const J=k.select("domReferenceElement"),X=yt(J);T.restTimeout.clear(),T.restTimeoutPending=!1;const oe=j.current.floatingContext??p?.();if(Ug(U.relatedTarget,k.context.triggerElements))return;if(O.current&&oe){k.select("open")||T.openChangeTimeout.clear();const be=u.current;T.handler=O.current({...oe,tree:_,x:U.clientX,y:U.clientY,onClose(){K(),W(),E.current&&!I()&&be===k.select("domReferenceElement")&&F(U,!0)}}),X.addEventListener("mousemove",T.handler),T.handler(U);return}(T.pointerType!=="touch"||!Ie(k.select("floatingElement"),U.relatedTarget))&&F(U)}function ne(U){Ie(q,U.relatedTarget)||(T.openChangeTimeout.clear(),T.restTimeout.clear(),T.restTimeoutPending=!1)}const z=w?st(q,"mouseout",ne):void 0;return l?Ys(st(q,"mousemove",H,{once:!0}),st(q,"mouseenter",H),st(q,"mouseleave",Y),z):Ys(st(q,"mouseenter",H),st(q,"mouseleave",Y),z)},[W,K,j,N,k,n,O,T,h,$,I,i,l,D,u,_,E,p,B,P,w]),S.useMemo(()=>{if(!n)return;function F(q){T.pointerType=q.pointerType}return{onPointerDown:F,onPointerEnter:F,onMouseMove(q){const{nativeEvent:H}=q,Y=q.currentTarget,ne=k.select("domReferenceElement"),z=k.select("open"),U=$(ne,Y,q.target);if(i&&!Sa(T.pointerType))return;if(z&&U&&T.handleCloseOptions?.blockPointerEvents){const oe=k.select("floatingElement");if(oe){const ie=T.handleCloseOptions?.getScope?.()??Y.ownerDocument.body;hB(T,{scopeElement:ie,referenceElement:Y,floatingElement:oe})}}const J=PO(D.current);if(z&&!U||J===0||!U&&T.restTimeoutPending&&q.movementX**2+q.movementY**2<2)return;T.restTimeout.clear();function X(){if(T.restTimeoutPending=!1,I())return;const oe=k.select("open");!T.blockMouseMove&&(!oe||U)&&P()&&k.setOpen(!0,ft(pn,H,Y))}T.pointerType==="touch"?Os.flushSync(()=>{X()}):U&&z?X():(T.restTimeoutPending=!0,T.restTimeout.start(J,X))}}},[n,T,I,$,i,k,D,P])}const E9="Escape";function aA(t){return qa&&t.movementX===0&&t.movementY===0}function mb(t,e,n){switch(t){case"vertical":return e;case"horizontal":return n;default:return e||n}}function zm(t,e){return mb(e,t===CP||t===MS,t===Zy||t===eb)}function V0(t,e,n){return mb(e,t===MS,n?t===Zy:t===eb)||t==="Enter"||t===" "||t===""}function _9(t,e,n){return mb(e,n?t===Zy:t===eb,t===MS)}function M9(t,e,n,o){const s=n?t===eb:t===Zy,i=t===CP;return e==="both"||e==="horizontal"&&o?t===E9:mb(e,s,i)}function O9(t,e){const{listRef:n,activeIndex:o,onNavigate:s=()=>{},enabled:i=!0,selectedIndex:r=null,allowEscape:l=!1,loopFocus:u=!1,nested:d=!1,rtl:h=!1,virtual:p=!1,focusItemOnOpen:g="auto",focusItemOnHover:b=!0,openOnArrowKeyDown:w=!0,disabledIndices:k=void 0,orientation:j="vertical",parentOrientation:C,id:_,resetOnPointerLeave:T=!0,externalTree:M,grid:O}=e,N=O!=null,D="rootStore"in t?t.rootStore:t,E=D.useState("open"),R=D.useState("floatingElement"),B=D.useState("domReferenceElement"),I=D.context.dataRef,P=xk(R),$=wk(B),W=Mn(P),K=Zl(),F=Ua(M),q=S.useRef(g),H=S.useRef(r??-1),Y=S.useRef(null),ne=S.useRef(!0),z=De(fe=>{s(H.current===-1?null:H.current,fe)}),U=S.useRef(!!R),J=S.useRef(E),X=S.useRef(!1),oe=S.useRef(!1),ie=S.useRef(null),be=Mn(k),ce=Mn(E),ye=Mn(r),Ce=Mn(T),Ve=Wf(),Me=Wf(),je=De(()=>{function fe(ve){p?F?.events.emit("virtualfocus",ve):ie.current=wg(ve,{sync:X.current,preventScroll:!0})}const xe=n.current[H.current],pe=oe.current;xe&&fe(xe),(X.current?ve=>ve():ve=>Ve.request(ve))(()=>{const ve=n.current[H.current]||xe;if(!ve)return;xe||fe(ve),_e&&(pe||!ne.current)&&ve.scrollIntoView?.({block:"nearest",inline:"nearest"})})});Se(()=>{I.current.orientation=j},[I,j]),Se(()=>{i&&(E&&R?(H.current=r??-1,q.current&&r!=null&&(oe.current=!0,z())):U.current&&(H.current=-1,z()))},[i,E,R,r,z]),Se(()=>{if(i){if(!E){X.current=!1;return}if(R)if(o==null){if(X.current=!1,ye.current!=null)return;if(U.current&&(H.current=-1,je()),(!J.current||!U.current)&&q.current&&(Y.current!=null||q.current===!0&&Y.current==null)){let fe=0;const xe=()=>{n.current[0]==null?(fe<2&&(fe?re=>Me.request(re):queueMicrotask)(xe),fe+=1):(H.current=Y.current==null||V0(Y.current,j,h)||d?bg(n):kk(n),Y.current=null,z())};xe()}}else Ef(n.current,o)||(H.current=o,je(),oe.current=!1)}},[i,E,R,o,ye,d,n,j,h,z,je,Me]),Se(()=>{if(!i||R||!F||p||!U.current)return;const fe=F.nodesRef.current,xe=fe.find(ve=>ve.id===K)?.context?.elements.floating,pe=Nn(yt(B??xe??null)),re=fe.some(ve=>ve.context&&Ie(ve.context.elements.floating,pe));xe&&!re&&ne.current&&xe.focus({preventScroll:!0})},[i,R,B,F,K,p]),Se(()=>{J.current=E,U.current=!!R}),Se(()=>{E||(Y.current=null,q.current=g)},[E,g]);const Oe=o!=null,Fe=De(fe=>{if(!ce.current)return;const xe=n.current.indexOf(fe.currentTarget);xe!==-1&&(H.current!==xe||o!==xe)&&(H.current=xe,z(fe))}),nt=De(()=>C??F?.nodesRef.current.find(fe=>fe.id===K)?.context?.dataRef?.current.orientation),Ee=De(()=>bg(n,be.current)),Je=De(fe=>{if(ne.current=!1,X.current=!0,fe.which===229||!ce.current&&fe.currentTarget===W.current)return;if(d&&M9(fe.key,j,h,N)){zm(fe.key,nt())||ci(fe),D.setOpen(!1,ft(qg,fe.nativeEvent)),Ft(B)&&(p?F?.events.emit("virtualfocus",B):B.focus());return}const xe=H.current,pe=bg(n,k),re=kk(n,k);if($||(fe.key==="Home"&&(ci(fe),H.current=pe,z(fe)),fe.key==="End"&&(ci(fe),H.current=re,z(fe))),O!=null){const ve=O(fe,H.current,n,j,u,h,k,pe,re);if(ve!=null&&(H.current=ve,z(fe)),j==="both")return}if(zm(fe.key,j)){if(ci(fe),E&&!p&&Nn(fe.currentTarget.ownerDocument)===fe.currentTarget){H.current=V0(fe.key,j,h)?pe:re,z(fe);return}V0(fe.key,j,h)?u?xe>=re?l&&xe!==n.current.length?H.current=-1:(X.current=!1,H.current=pe):H.current=ir(n.current,{startingIndex:xe,disabledIndices:k}):H.current=Math.min(re,ir(n.current,{startingIndex:xe,disabledIndices:k})):u?xe<=pe?l&&xe!==-1?H.current=n.current.length:(X.current=!1,H.current=re):H.current=ir(n.current,{startingIndex:xe,decrement:!0,disabledIndices:k}):H.current=Math.max(pe,ir(n.current,{startingIndex:xe,decrement:!0,disabledIndices:k})),Ef(n.current,H.current)&&(H.current=-1),z(fe)}}),_e=S.useMemo(()=>({onFocus(xe){X.current=!0,Fe(xe)},onClick:({currentTarget:xe})=>xe.focus({preventScroll:!0}),onMouseMove(xe){aA(xe)||(X.current=!0,oe.current=!1,b&&Fe(xe))},onPointerLeave(xe){if(!ce.current||!ne.current||xe.pointerType==="touch")return;X.current=!0;const pe=xe.relatedTarget;if(!(!b||n.current.includes(pe))&&Ce.current&&(ie.current?.(),ie.current=null,H.current=-1,z(xe),!p)){const re=W.current,ve=Nn(yt(re));re&&Ie(re,ve)&&re.focus({preventScroll:!0})}}}),[Fe,ce,W,b,n,z,Ce,p]),Ae=S.useMemo(()=>p&&E&&Oe&&{"aria-activedescendant":`${_}-${o}`},[p,E,Oe,_,o]),Pe=S.useMemo(()=>({...$?{}:Ae,onKeyDown(fe){if(fe.key==="Tab"&&fe.shiftKey&&E&&!p){const xe=ln(fe.nativeEvent);if(xe&&!Ie(W.current,xe))return;ci(fe),D.setOpen(!1,ft(Vl,fe.nativeEvent)),Ft(B)&&B.focus();return}Je(fe)},onPointerMove(fe){aA(fe)||(ne.current=!0)}}),[Ae,Je,W,$,D,E,p,B]),bt=S.useMemo(()=>{function fe(re){D.setOpen(!0,ft(qg,re.nativeEvent,re.currentTarget))}function xe(re){g==="auto"&&ES(re.nativeEvent)&&(q.current=!p)}function pe(re){q.current=g,g==="auto"&&_S(re.nativeEvent)&&(q.current=!0)}return{onKeyDown(re){const ve=D.select("open");ne.current=!1;const Ze=re.key.startsWith("Arrow"),Ln=_9(re.key,nt(),h),So=zm(re.key,j),dn=(d?Ln:So)||re.key==="Enter"||re.key.trim()==="";if(p&&ve)return Je(re);if(!(!ve&&!w&&Ze)){if(dn){const Te=zm(re.key,nt());Y.current=d&&Te?null:re.key}if(d){Ln&&(ci(re),ve?(H.current=Ee(),z(re)):fe(re));return}So&&(ye.current!=null&&(H.current=ye.current),ci(re),!ve&&w?fe(re):Je(re),ve&&z(re))}},onFocus(re){D.select("open")&&!p&&(H.current=-1,z(re))},onPointerDown:pe,onPointerEnter:pe,onMouseDown:xe,onClick:xe}},[Je,g,Ee,d,z,D,w,j,nt,h,ye,p]),Be=S.useMemo(()=>({...Ae,...bt}),[Ae,bt]);return S.useMemo(()=>i?{reference:Be,floating:Pe,item:_e,trigger:bt}:{},[i,Be,Pe,bt,_e])}function A9(t,e){const{listRef:n,elementsRef:o,activeIndex:s,onMatch:i,disabledIndices:r,onTyping:l,enabled:u=!0,resetMs:d=750,selectedIndex:h=null}=e,p="rootStore"in t?t.rootStore:t,g=p.useState("open"),b=co(),w=S.useRef(""),k=S.useRef(h??s??-1),j=S.useRef(null),C=De(M=>{function O(W){return o?.current[W]}function N(W){const K=O(W);return K&&!nb(K)||K?.matches(":disabled")?!1:r==null||!ru(br,W,r)}function D(W,K,F=0){if(W.length===0)return-1;const q=(F%W.length+W.length)%W.length,H=K.toLowerCase();for(let Y=0;Y<W.length;Y+=1){const ne=(q+Y)%W.length;if(!(!W[ne]?.toLowerCase().startsWith(H)||!N(ne)))return ne}return-1}const E=n.current;if(w.current.length>0&&M.key===" "&&(ci(M),l?.(!0)),w.current.length>0&&w.current[0]!==" "&&D(E,w.current)===-1&&M.key!==" "&&l?.(!1),E==null||M.key.length!==1||M.ctrlKey||M.metaKey||M.altKey)return;g&&M.key!==" "&&(ci(M),l?.(!0));const R=w.current==="";R&&(k.current=h??s??-1),E.every((W,K)=>W&&N(K)?W[0]?.toLowerCase()!==W[1]?.toLowerCase():!0)&&w.current===M.key&&(w.current="",k.current=j.current),w.current+=M.key,b.start(d,()=>{w.current="",k.current=j.current,l?.(!1)});const P=((R?h??s??-1:k.current)??0)+1,$=D(E,w.current,P);$!==-1?(i?.($),j.current=$):M.key!==" "&&(w.current="",l?.(!1))}),_=De(M=>{const O=M.relatedTarget,N=p.select("domReferenceElement"),D=p.select("floatingElement");Ie(N,O)||Ie(D,O)||(b.clear(),w.current="",k.current=j.current,l?.(!1))});Se(()=>{!g&&h!==null||(b.clear(),j.current=null,w.current!==""&&(w.current=""))},[g,h,b]);const T=S.useMemo(()=>({onKeyDown:C,onBlur:_}),[C,_]);return S.useMemo(()=>u?{reference:T,floating:T}:{},[u,T])}const lA=.1,R9=lA*lA,Yt=.5;function Im(t,e,n,o,s,i){return o>=e!=i>=e&&t<=(s-n)*(e-o)/(i-o)+n}function Lm(t,e,n,o,s,i,r,l,u,d){let h=!1;return Im(t,e,n,o,s,i)&&(h=!h),Im(t,e,s,i,r,l)&&(h=!h),Im(t,e,r,l,u,d)&&(h=!h),Im(t,e,u,d,n,o)&&(h=!h),h}function N9(t,e,n){return t>=n.x&&t<=n.x+n.width&&e>=n.y&&e<=n.y+n.height}function $m(t,e,n,o,s,i){const r=Math.min(n,s),l=Math.max(n,s),u=Math.min(o,i),d=Math.max(o,i);return t>=r&&t<=l&&e>=u&&e<=d}function gb(t={}){const{blockPointerEvents:e=!1}=t,n=new Lo,o=({x:s,y:i,placement:r,elements:l,onClose:u,nodeId:d,tree:h})=>{const p=r?.split("-")[0];let g=!1,b=null,w=null,k=typeof performance<"u"?performance.now():0;function j(_,T){const M=performance.now(),O=M-k;if(b===null||w===null||O===0)return b=_,w=T,k=M,!1;const N=_-b,D=T-w,E=N*N+D*D,R=O*O*R9;return b=_,w=T,k=M,E<R}function C(){n.clear(),u()}return function(T){n.clear();const M=l.domReference,O=l.floating;if(!M||!O||p==null||s==null||i==null)return;const{clientX:N,clientY:D}=T,E=ln(T),R=T.type==="mouseleave",B=Ie(O,E),I=Ie(M,E);if(B&&(g=!0,!R))return;if(I&&(g=!1,!R)){g=!0;return}if(R&&vt(T.relatedTarget)&&Ie(O,T.relatedTarget))return;function P(){return!!(h&&Da(h.nodesRef.current,d).length>0)}function $(){P()||C()}if(P())return;const W=M.getBoundingClientRect(),K=O.getBoundingClientRect(),F=s>K.right-K.width/2,q=i>K.bottom-K.height/2,H=K.width>W.width,Y=K.height>W.height,ne=(H?W:K).left,z=(H?W:K).right,U=(Y?W:K).top,J=(Y?W:K).bottom;if(p==="top"&&i>=W.bottom-1||p==="bottom"&&i<=W.top+1||p==="left"&&s>=W.right-1||p==="right"&&s<=W.left+1){$();return}let X=!1;switch(p){case"top":X=$m(N,D,ne,W.top+1,z,K.bottom-1);break;case"bottom":X=$m(N,D,ne,K.top+1,z,W.bottom-1);break;case"left":X=$m(N,D,K.right-1,J,W.left+1,U);break;case"right":X=$m(N,D,W.right-1,J,K.left+1,U);break}if(X)return;if(g&&!N9(N,D,W)){$();return}if(!R&&j(N,D)){$();return}let oe=!1;switch(p){case"top":{const ie=H?Yt/2:Yt*4,be=H||F?s+ie:s-ie,ce=H?s-ie:F?s+ie:s-ie,ye=i+Yt+1,Ce=F||H?K.bottom-Yt:K.top,Ve=F?H?K.bottom-Yt:K.top:K.bottom-Yt;oe=Lm(N,D,be,ye,ce,ye,K.left,Ce,K.right,Ve);break}case"bottom":{const ie=H?Yt/2:Yt*4,be=H||F?s+ie:s-ie,ce=H?s-ie:F?s+ie:s-ie,ye=i-Yt,Ce=F||H?K.top+Yt:K.bottom,Ve=F?H?K.top+Yt:K.bottom:K.top+Yt;oe=Lm(N,D,be,ye,ce,ye,K.left,Ce,K.right,Ve);break}case"left":{const ie=Y?Yt/2:Yt*4,be=Y||q?i+ie:i-ie,ce=Y?i-ie:q?i+ie:i-ie,ye=s+Yt+1,Ce=q||Y?K.right-Yt:K.left,Ve=q?Y?K.right-Yt:K.left:K.right-Yt;oe=Lm(N,D,Ce,K.top,Ve,K.bottom,ye,be,ye,ce);break}case"right":{const ie=Y?Yt/2:Yt*4,be=Y||q?i+ie:i-ie,ce=Y?i-ie:q?i+ie:i-ie,ye=s-Yt,Ce=q||Y?K.left+Yt:K.right,Ve=q?Y?K.left+Yt:K.right:K.left+Yt;oe=Lm(N,D,ye,be,ye,ce,Ce,K.top,Ve,K.bottom);break}}oe?g||n.start(40,$):$()}};return o.__options={...t,blockPointerEvents:e},o}const D9=S.createContext(void 0);function ZS(t){return S.useContext(D9)}const Ek="ArrowUp",_k="ArrowDown",Mk="ArrowLeft",Ok="ArrowRight",Ak="Home",Rk="End",yb=new Set([Ek,_k,Mk,Ok,Ak,Rk]),P9="Shift",B9=[P9,"Control","Alt","Meta"];function z9(t){return Ft(t)&&t.tagName==="INPUT"}function cA(t){return!!(z9(t)&&t.selectionStart!=null||Ft(t)&&t.tagName==="TEXTAREA")}function uA(t,e,n,o){if(!t||!e||!e.scrollTo)return;let s=t.scrollLeft,i=t.scrollTop;const r=t.clientWidth<t.scrollWidth,l=t.clientHeight<t.scrollHeight;if(r&&o!=="vertical"){const u=dA(t,e,"left"),d=Fm(t),h=Fm(e);n==="ltr"&&(u+e.offsetWidth+h.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight?s=u+e.offsetWidth+h.scrollMarginRight-t.clientWidth+d.scrollPaddingRight:u-h.scrollMarginLeft<t.scrollLeft+d.scrollPaddingLeft&&(s=u-h.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(u-h.scrollMarginLeft<t.scrollLeft+d.scrollPaddingLeft?s=u-h.scrollMarginLeft-d.scrollPaddingLeft:u+e.offsetWidth+h.scrollMarginRight>t.scrollLeft+t.clientWidth-d.scrollPaddingRight&&(s=u+e.offsetWidth+h.scrollMarginRight-t.clientWidth+d.scrollPaddingRight))}if(l&&o!=="horizontal"){const u=dA(t,e,"top"),d=Fm(t),h=Fm(e);u-h.scrollMarginTop<t.scrollTop+d.scrollPaddingTop?i=u-h.scrollMarginTop-d.scrollPaddingTop:u+e.offsetHeight+h.scrollMarginBottom>t.scrollTop+t.clientHeight-d.scrollPaddingBottom&&(i=u+e.offsetHeight+h.scrollMarginBottom-t.clientHeight+d.scrollPaddingBottom)}t.scrollTo({left:s,top:i,behavior:"auto"})}function dA(t,e,n){const o=n==="left"?"offsetLeft":"offsetTop";let s=0;for(;e.offsetParent&&(s+=e[o],e.offsetParent!==t);)e=e.offsetParent;return s}function Fm(t){const e=getComputedStyle(t);return{scrollMarginTop:parseFloat(e.scrollMarginTop)||0,scrollMarginRight:parseFloat(e.scrollMarginRight)||0,scrollMarginBottom:parseFloat(e.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(e.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(e.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(e.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(e.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(e.scrollPaddingLeft)||0}}function bb(t){return t==="starting"?cU:nn}const pB=S.forwardRef(function(e,n){const{render:o,className:s,style:i,finalFocus:r,...l}=e,{store:u}=Ha(),{side:d,align:h}=xS(),p=ZS()!=null,g=u.useState("open"),b=u.useState("transitionStatus"),w=u.useState("popupProps"),k=u.useState("mounted"),j=u.useState("instantType"),C=u.useState("activeTriggerElement"),_=u.useState("parent"),T=u.useState("lastOpenChangeReason"),M=u.useState("rootId"),O=u.useState("floatingRootContext"),N=u.useState("floatingTreeRoot"),D=u.useState("closeDelay"),E=u.useState("hoverEnabled"),R=u.useState("disabled"),B=u.useState("openMethod"),I=_.type==="context-menu";Yu({open:g,ref:u.context.popupRef,onComplete(){g&&u.context.onOpenChangeComplete?.(!0)}}),S.useEffect(()=>{function F(q){u.setOpen(!1,ft(q.reason,q.domEvent))}return N.events.on("close",F),()=>{N.events.off("close",F)}},[N.events,u]),QS(O,{enabled:E&&!R&&!I&&_.type!=="menubar",closeDelay:D});const P=u.useStateSetter("popupElement"),$={transitionStatus:b,side:d,align:h,open:g,nested:_.type==="menu",instant:j},W=Ht("div",e,{state:$,ref:[n,u.context.popupRef,P],stateAttributesMapping:Xy,props:[w,{onKeyDown(F){p&&yb.has(F.key)&&F.stopPropagation()}},bb(b),l,{"data-rootownerid":M}]});let K=_.type===void 0||I;return(C||_.type==="menubar"&&T!==bS)&&(K=!0),y.jsx($S,{context:O,openInteractionType:B,modal:I,disabled:!k,returnFocus:r===void 0?K:r,initialFocus:_.type!=="menu",restoreFocus:!0,externalTree:_.type!=="menubar"?N:void 0,previousFocusableElement:C,nextFocusableElement:_.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:_.type===void 0?u.context.beforeContentFocusGuardRef:void 0,children:W})}),mB=S.createContext(void 0);function I9(){const t=S.useContext(mB);if(t===void 0)throw new Error(gn(32));return t}const gB=S.forwardRef(function(e,n){const{keepMounted:o=!1,...s}=e,{store:i,parent:r}=Ha();if(!(i.useState("mounted")||o))return null;const d=r.type==="menu"||r.type==="menubar"?"group":void 0;return y.jsx(mB.Provider,{value:o,children:y.jsx(BS,{ref:n,...s,portalOwnerRole:d})})});function wb(t){return hS(19)?t:t?"true":void 0}const L9=S.createContext(void 0);function ej(){return S.useContext(L9)?.direction??"ltr"}const $9=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:o,placement:s,rects:i,platform:r,elements:l,middlewareData:u}=e,{element:d,padding:h=0,offsetParent:p="real"}=Na(t,e)||{};if(d==null)return{};const g=MP(h),b={x:n,y:o},w=RS(s),k=AS(w),j=await r.getDimensions(d),C=w==="y",_=C?"top":"left",T=C?"bottom":"right",M=C?"clientHeight":"clientWidth",O=i.reference[k]+i.reference[w]-b[w]-i.floating[k],N=b[w]-i.reference[w],D=p==="real"?await r.getOffsetParent?.(d):l.floating;let E=l.floating[M]||i.floating[k];(!E||!await r.isElement?.(D))&&(E=l.floating[M]||i.floating[k]);const R=O/2-N/2,B=E/2-j[k]/2-1,I=Math.min(g[_],B),P=Math.min(g[T],B),$=I,W=E-j[k]-P,K=E/2-j[k]/2+R,F=_P($,K,W),q=!u.arrow&&kr(s)!=null&&K!==F&&i.reference[k]/2-(K<$?I:P)-j[k]/2<0,H=q?K<$?K-$:K-W:0;return{[w]:b[w]+H,data:{[w]:F,centerOffset:K-F-H,...q&&{alignmentOffset:H}},reset:q}}}),F9=(t,e)=>{const{name:n,fn:o}=$9(t);return{name:n,fn:o,options:[t,e]}},H9={name:"hide",async fn(t){const{width:e,height:n,x:o,y:s}=t.rects.reference,i=e===0&&n===0&&o===0&&s===0,r=await t.platform.detectOverflow(t,{elementContext:"reference"});return{data:{referenceHidden:r.top-n>=0||r.right-e>=0||r.bottom-n>=0||r.left-e>=0||i}}}},q9={sideX:"left",sideY:"top"},U9="--available-width",V9="--available-height",K9="--anchor-width",W9="--anchor-height",Y9="--transform-origin",fA=U9,hA=V9;function yB(t,e,n){const o=t==="inline-start"||t==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[e]}function pA(t,e,n){const{rects:o,placement:s}=t;return{side:yB(e,_s(s),n),align:kr(s)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function tj(t){return G9(t,j9)}function G9(t,e){const{anchor:n,positionMethod:o="absolute",side:s="bottom",sideOffset:i=0,align:r="center",alignOffset:l=0,collisionBoundary:u,collisionPadding:d=5,sticky:h=!1,arrowPadding:p=5,disableAnchorTracking:g=!1,inline:b,keepMounted:w=!1,floatingRootContext:k,mounted:j,collisionAvoidance:C,shift:_,nodeId:T,adaptiveOrigin:M,lazyFlip:O=!1,externalTree:N}=t,[D,E]=S.useState(null);!j&&D!==null&&E(null);const R=C.side||"flip",B=C.align||"flip",I=C.fallbackAxisSide||"end",P=_?.crossAxis??!1,$=_?.rootBoundary,W=typeof n=="function"?n:void 0,K=De(W),F=W?K:n,q=Mn(n),H=Mn(j),ne=ej()==="rtl",z=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":ne?"left":"right","inline-start":ne?"right":"left"}[s],U=r==="center"?z:`${z}-${r}`;let J=d;typeof J=="number"?J={top:J,right:J,bottom:J,left:J}:J&&(J={top:J.top||0,right:J.right||0,bottom:J.bottom||0,left:J.left||0});const X=1,oe=s==="bottom"?X:0,ie=s==="top"?X:0,be=s==="right"?X:0,ce=s==="left"?X:0,ye={boundary:u==="clipping-ancestors"?"clippingAncestors":u,padding:J},Ce=S.useRef(null),Ve=Mn(i),Me=Mn(l),je=typeof i!="function"?i:0,Oe=typeof l!="function"?l:0,Fe=[];b&&Fe.push(b),Fe.push(o9(dt=>{const un=pA(dt,s,ne),Un=typeof Ve.current=="function"?Ve.current(un):Ve.current,kn=typeof Me.current=="function"?Me.current(un):Me.current;return{mainAxis:Un,crossAxis:kn,alignmentAxis:kn}},[je,Oe,ne,s]));const nt=B==="none"&&R!=="shift",Ee=!nt&&(h||P||R==="shift"),Je=R==="none"?null:r9({...ye,padding:{top:J.top+X+oe,right:J.right+X+ce,bottom:J.bottom+X+ie,left:J.left+X+be},mainAxis:!P&&R==="flip",crossAxis:B==="flip"?"alignment":!1,fallbackAxisSideDirection:I}),_e=nt?null:s9({...ye,rootBoundary:$,mainAxis:B!=="none",crossAxis:Ee,limiter:h||P?void 0:i9(dt=>{if(!Ce.current)return{};const{width:un,height:Un}=Ce.current.getBoundingClientRect(),kn=Es(_s(dt.placement)),ni=kn==="y"?un:Un,jo=kn==="y"?J.left+J.right:J.top+J.bottom;return{offset:ni/2+jo/2}})},[ye,h,P,$,J,B]);R==="shift"||B==="shift"||r==="center"?Fe.push(_e,Je):Fe.push(Je,_e),Fe.push(a9({...ye,apply({elements:{floating:dt},availableWidth:un,availableHeight:Un,rects:kn}){if(!H.current)return;const ni=dt.style;ni.setProperty(fA,`${un}px`),ni.setProperty(hA,`${Un}px`);const jo=on(dt).devicePixelRatio||1,{x:_r,y:us,width:ic,height:Is}=kn.reference,Mr=(Math.round((_r+ic)*jo)-Math.round(_r*jo))/jo,Or=(Math.round((us+Is)*jo)-Math.round(us*jo))/jo;ni.setProperty(K9,`${Mr}px`),ni.setProperty(W9,`${Or}px`)}}),F9(dt=>({element:Ce.current||yt(dt.elements.floating).createElement("div"),padding:Ce.current?p:0,offsetParent:"floating"}),[p]),{name:"transformOrigin",fn(dt){const{elements:{floating:un},middlewareData:Un,placement:kn,platform:ni,rects:jo,y:_r}=dt,us=_s(kn),ic=kr(kn),Is=Es(us)==="y",Mr=Ce.current,Or=typeof i=="function"?i(pA(dt,s,ne)):i;let Ar;if(!Mr&&ic&&Math.abs(Is?Un.shift?.x||0:Un.shift?.y||0)<=1)Ar=ic==="start"===(Is&&ni.isRTL?.(un)===!0)?"100%":"0%";else{const bp=Is?Un.arrow?.x||0:Un.arrow?.y||0,wp=Is?Mr?.clientWidth||0:Mr?.clientHeight||0;Ar=`${bp+wp/2}px`}let Xa=us==="top"||us==="left"?`calc(100% + ${Or}px)`:`${-Or}px`;return Ee&&Is&&Math.abs(Un.shift?.y||0)>Or&&(Xa=`${jo.reference.y+jo.reference.height/2-_r}px`),un.style.setProperty(Y9,Is?`${Ar} ${Xa}`:`${Xa} ${Ar}`),{}}},H9,M),Se(()=>{!j&&k&&k.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[j,k]);const Ae=S.useMemo(()=>({ancestorScroll:!g,elementResize:!g&&typeof ResizeObserver<"u",layoutShift:!g&&typeof IntersectionObserver<"u"}),[g]),{refs:Pe,elements:bt,x:Be,y:fe,middlewareData:xe,update:pe,placement:re,context:ve,isPositioned:Ze,floatingStyles:Ln}=e({rootContext:k,open:w?j:void 0,placement:U,middleware:Fe,strategy:o,whileElementsMounted:w?void 0:(...dt)=>ZO(...dt,Ae),nodeId:T,externalTree:N}),{sideX:So,sideY:dn}=xe.adaptiveOrigin||q9,Te=Ze?o:"fixed",rt=S.useMemo(()=>{let dt;return Ze?M?dt={position:Te,[So]:Be,[dn]:fe}:dt={...Ln,position:Te}:dt={position:Te,top:0,left:0},dt[fA]="100vw",dt[hA]="100vh",Ze||(dt.opacity=0),dt},[M,Te,So,Be,dn,fe,Ln,Ze]),_t=S.useRef(null);Se(()=>{if(!j)return;const dt=q.current,un=typeof dt=="function"?dt():dt,kn=(mA(un)?un.current:un)||null||null;kn!==_t.current&&(Pe.setPositionReference(kn),_t.current=kn)},[j,Pe,F,q]),S.useEffect(()=>{if(!j)return;const dt=q.current;typeof dt!="function"&&mA(dt)&&dt.current!==_t.current&&(Pe.setPositionReference(dt.current),_t.current=dt.current)},[j,Pe,F,q]),S.useEffect(()=>{if(w&&j&&bt.reference&&bt.floating)return ZO(bt.reference,bt.floating,pe,Ae)},[w,j,bt,pe,Ae]);const Jt=_s(re),ls=yB(s,Jt,ne),Bs=kr(re)||"center",cs=!!xe.hide?.referenceHidden;Se(()=>{O&&j&&Ze&&Jt!==z&&E(Jt)},[O,j,Ze,Jt,z]);const vn=S.useMemo(()=>({position:"absolute",top:xe.arrow?.y,left:xe.arrow?.x}),[xe.arrow]),zs=xe.arrow?.centerOffset!==0;return S.useMemo(()=>({positionerStyles:rt,arrowStyles:vn,arrowRef:Ce,arrowUncentered:zs,side:ls,align:Bs,physicalSide:Jt,anchorHidden:cs,refs:Pe,context:ve,isPositioned:Ze,update:pe}),[rt,vn,Ce,zs,ls,Bs,Jt,cs,Pe,ve,Ze,pe])}function mA(t){return t!=null&&"current"in t}function bB(t){const{children:e,elementsRef:n,labelsRef:o,onMapChange:s}=t,i=De(s),[,r]=S.useState(!1),l=qn(J9).current,u=qn(X9).current,d=S.useRef(0),h=S.useRef(!0),p=S.useRef(null),g=S.useRef(null),b=De(()=>{h.current||(h.current=!0,r(O=>!O))}),w=De((O,N)=>{u.set(O,N),b()}),k=De(O=>{u.delete(O),b()}),j=De(O=>{const N=new Map;return n.current.length=0,o&&(o.current.length=0),O.forEach(D=>{N.set(D.element,{...D.registration.metadata??{},index:D.index}),n.current[D.index]=D.element,o&&(o.current[D.index]=D.registration.label!==void 0?D.registration.label:D.registration.textRef?.current?.textContent??D.element.textContent)}),d.current=n.current.length,N});function C(O){if(g.current?.disconnect(),g.current=null,typeof MutationObserver!="function"||O.length<2)return;const N=new MutationObserver(E=>{if(!eV(E))return;let R=null;for(const B of O)if(B.isConnected){if(R&&wB(R,B)>0){N.disconnect(),b();return}R=B}});g.current=N;const D=new Set;for(let E=1;E<O.length;E+=1){const R=Z9(O[E-1],O[E]);R&&D.add(R)}D.forEach(E=>N.observe(E,{childList:!0}))}const _=De(()=>{const[O,N]=Q9(u),D=j(O),E=p.current,R=!E||E.length!==O.length||O.some((B,I)=>{const P=E[I];return B.index!==P.index||B.element!==P.element||B.registration.index!==P.registration.index||B.registration.metadata!==P.registration.metadata});C(N),p.current=O,h.current=!1,R&&(l.forEach(B=>B(D)),i(D))});Se(()=>(!h.current&&p.current&&j(p.current),()=>{n.current=[],o&&(o.current=[])}),[n,o,j]),Se(()=>{h.current&&_()}),Se(()=>()=>{g.current?.disconnect(),h.current=!0},[]);const T=De(O=>(l.add(O),()=>{l.delete(O)})),M=S.useMemo(()=>({register:w,unregister:k,subscribeMapChange:T,nextIndexRef:d}),[w,k,T,d]);return y.jsx(SP.Provider,{value:M,children:e})}function X9(){return new Map}function J9(){return new Set}function Q9(t){const e=new Set,n=[],o=[];t.forEach((i,r)=>{if(!r.isConnected)return;const l=i.index,u={index:l??-1,element:r,registration:i};l===null?o.push(u):l>=0&&(e.add(l),n.push(u))});let s=0;return o.sort((i,r)=>wB(i.element,r.element)),o.forEach(i=>{for(;e.has(s);)s+=1;i.index=s,n.push(i),s+=1}),e.size>0&&n.sort((i,r)=>i.index-r.index),[n,o.map(i=>i.element)]}function Z9(t,e){let n=t.parentElement;for(;n&&!n.contains(e);)n=n.parentElement;return n}function eV(t){for(const e of t)for(let n=0;n<e.removedNodes.length;n+=1)if(e.removedNodes[n].isConnected)return!0;return!1}function wB(t,e){return t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}const nj=S.forwardRef(function(e,n){const{cutout:o,...s}=e;let i;if(o){const r=o.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${r.left}px ${r.top}px,${r.left}px ${r.bottom}px,${r.right}px ${r.bottom}px,${r.right}px ${r.top}px,${r.left}px ${r.top}px)`}return y.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})});function oj(t,e,{styles:n,transitionStatus:o,props:s,refs:i,hidden:r,inert:l=!1}){const u={...n};return l&&(u.pointerEvents="none"),Ht("div",t,{state:e,ref:i,props:[{role:"presentation",hidden:r,style:u},bb(o),s],stateAttributesMapping:kS})}let gA={},yA={},bA="";function xb(t,e){return Ih(t)?t:e}function wA(t,e,n){return/hidden|clip/.test(t.getComputedStyle(xb(e,n)).overflowY)}function tV(t){if(typeof document>"u")return!1;const e=yt(t);return on(e).innerWidth-e.documentElement.clientWidth>0}function nV(t){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=yt(t),o=n.documentElement,s=n.body,i=xb(o,s),r=i.style.overflowY,l=o.style.scrollbarGutter;o.style.scrollbarGutter="stable",i.style.overflowY="scroll";const u=i.offsetWidth;i.style.overflowY="hidden";const d=i.offsetWidth;return i.style.overflowY=r,o.style.scrollbarGutter=l,u===d}function oV(t){const e=yt(t),n=e.documentElement,o=e.body,s=xb(n,o),i={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,i)}}function sV(t){const e=yt(t),n=e.documentElement,o=e.body,s=on(n);let i=0,r=0,l=!1;const u=di.create();if(qa&&(s.visualViewport?.scale??1)!==1)return()=>{};function d(){const b=s.getComputedStyle(n),w=s.getComputedStyle(o),C=(b.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=n.scrollTop,r=n.scrollLeft,gA={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},bA=n.style.scrollBehavior,yA={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const _=n.scrollHeight>n.clientHeight,T=n.scrollWidth>n.clientWidth,M=b.overflowY==="scroll"||w.overflowY==="scroll",O=b.overflowX==="scroll"||w.overflowX==="scroll",N=Math.max(0,s.innerWidth-o.clientWidth),D=Math.max(0,s.innerHeight-o.clientHeight),E=parseFloat(w.marginTop)+parseFloat(w.marginBottom),R=parseFloat(w.marginLeft)+parseFloat(w.marginRight),B=xb(n,o);if(l=nV(t),l){n.style.scrollbarGutter=C,B.style.overflowY="hidden",B.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:C,overflowY:"hidden",overflowX:"hidden"}),(_||M)&&(n.style.overflowY="scroll"),(T||O)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:E||D?`calc(100dvh - ${E+D}px)`:"100dvh",width:R||N?`calc(100vw - ${R+N}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),o.scrollTop=i,o.scrollLeft=r,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function h(){Object.assign(n.style,gA),Object.assign(o.style,yA),l||(n.scrollTop=i,n.scrollLeft=r,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=bA)}function p(){h(),u.request(d)}d();const g=st(s,"resize",p);return()=>{u.cancel(),h(),typeof s.removeEventListener=="function"&&g()}}class iV{lockCount=0;restore=null;timeoutLock=Lo.create();timeoutUnlock=Lo.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;const n=yt(e),o=n.documentElement,s=n.body,i=on(o);if(wA(i,o,s)){const l=new i.MutationObserver(()=>{wA(i,o,s)||(l.disconnect(),this.restore=null,this.lock(e))}),u={attributes:!0};l.observe(o,u),l.observe(s,u),this.restore=()=>l.disconnect();return}const r=Qy||!tV(e);this.restore=r?oV(e):sV(e)}}const rV=new iV;function xB(t=!0,e=null){Se(()=>{if(t)return rV.acquire(e)},[t,e])}const aV=20;function vB(t,e,n,o){const[s,i]=S.useState(!1);Se(()=>{if(!t||!e||n==null){i(!1);return}const r=yt(n).documentElement.clientWidth,l=n.offsetWidth;i(r>0&&l>0&&l>=r-aV)},[t,e,n]),xB(t&&(!e||s),o)}const kB=S.forwardRef(function(e,n){const{anchor:o,positionMethod:s="absolute",className:i,render:r,side:l,align:u,sideOffset:d=0,alignOffset:h=0,collisionBoundary:p="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:w=!1,disableAnchorTracking:k=!1,collisionAvoidance:j=pU,style:C,..._}=e,{store:T}=Ha(),M=I9(),O=SS(!0),N=T.useState("parent"),D=T.useState("floatingRootContext"),E=T.useState("floatingTreeRoot"),R=T.useState("mounted"),B=T.useState("open"),I=T.useState("modal"),P=T.useState("openMethod"),$=T.useState("activeTriggerElement"),W=T.useState("transitionStatus"),K=T.useState("positionerElement"),F=T.useState("instantType"),q=T.useState("adaptiveOrigin"),H=T.useState("lastOpenChangeReason"),Y=T.useState("floatingNodeId"),ne=T.useState("floatingParentNodeId"),z=D.useState("domReferenceElement"),U=S.useRef(null),J=Gy(K);let X=o,oe=d,ie=h,be=u,ce=j;N.type==="context-menu"&&(X=o??N.context?.anchor,be=be??"start",!l&&be!=="center"&&(ie=e.alignOffset??2,oe=e.sideOffset??-5));let ye=l,Ce=be;N.type==="menu"?(ye=ye??"inline-end",Ce=Ce??"start",ce=e.collisionAvoidance??PS):N.type==="menubar"&&(ye=ye??(N.context.orientation==="vertical"?"inline-end":"bottom"),Ce=Ce??"start");const Ve=N.type==="context-menu",Me=tj({anchor:X,floatingRootContext:D,positionMethod:O?"fixed":s,mounted:R,side:ye,sideOffset:oe,align:Ce,alignOffset:ie,arrowPadding:Ve?0:b,collisionBoundary:p,collisionPadding:g,sticky:w,nodeId:Y,keepMounted:M,disableAnchorTracking:k,collisionAvoidance:ce,shift:Ve?{crossAxis:!("side"in ce&&ce.side==="flip"),rootBoundary:"layoutViewport"}:void 0,externalTree:E,adaptiveOrigin:q});S.useEffect(()=>{function Ae(Pe){Pe.open&&(Pe.parentNodeId===Y&&T.set("hoverEnabled",!1),Pe.nodeId!==Y&&Pe.parentNodeId===T.select("floatingParentNodeId")&&T.setOpen(!1,ft(pf)))}return E.events.on("menuopenchange",Ae),()=>{E.events.off("menuopenchange",Ae)}},[T,E.events,Y]),S.useEffect(()=>{if(T.select("floatingParentNodeId")==null)return;function Ae(Pe){if(Pe.open||Pe.nodeId!==T.select("floatingParentNodeId"))return;const bt=Pe.reason??pf;T.setOpen(!1,ft(bt))}return E.events.on("menuopenchange",Ae),()=>{E.events.off("menuopenchange",Ae)}},[E.events,T]);const je=co();S.useEffect(()=>{B||je.clear()},[B,je]),S.useEffect(()=>{function Ae(Pe){if(!(!B||Pe.nodeId!==T.select("floatingParentNodeId")))if(Pe.target&&$&&$!==Pe.target){const bt=T.select("closeDelay");bt>0?je.isStarted()||je.start(bt,()=>{T.setOpen(!1,ft(pf))}):T.setOpen(!1,ft(pf))}else je.clear()}return E.events.on("itemhover",Ae),()=>{E.events.off("itemhover",Ae)}},[E.events,B,$,T,je]),S.useEffect(()=>{const Ae={open:B,nodeId:Y,parentNodeId:ne,reason:T.select("lastOpenChangeReason")};E.events.emit("menuopenchange",Ae)},[E.events,B,T,Y,ne]),Se(()=>{const Ae=z,Pe=U.current;if(Ae&&(U.current=Ae),Pe&&Ae&&Ae!==Pe){T.set("instantType",void 0);const bt=new AbortController;return J(()=>{T.set("instantType","trigger-change")},bt.signal),()=>{bt.abort()}}},[z,J,T]);const Oe={open:B,side:Me.side,align:Me.align,anchorHidden:Me.anchorHidden,nested:N.type==="menu",instant:F},Fe=N.type==="menubar"&&N.context.modal;vB(B&&(Fe||I&&H!==pn),P==="touch",K,$);const Ee=oj(e,Oe,{styles:Me.positionerStyles,transitionStatus:W,props:_,refs:[n,T.useStateSetter("positionerElement")],hidden:!R,inert:!B}),Je=R&&N.type!=="menu"&&(N.type!=="menubar"&&I&&H!==pn||N.type==="menubar"&&N.context.modal);let _e=null;return N.type==="menubar"?_e=N.context.contentElement:N.type===void 0&&(_e=$),y.jsxs(bP.Provider,{value:Me,children:[Je&&y.jsx(nj,{ref:N.type==="context-menu"||N.type==="nested-context-menu"?N.context.internalBackdropRef:null,inert:wb(!B),cutout:_e}),y.jsx(GP,{id:Y,children:y.jsx(bB,{elementsRef:T.context.itemDomElements,labelsRef:T.context.itemLabels,children:Ee})})]})}),lV=S.createContext(null);function SB(t){return S.useContext(lV)}function cV(t){const e=S.useRef(""),n=S.useCallback(s=>{s.defaultPrevented||(e.current=s.pointerType,t(s,s.pointerType))},[t]);return{onClick:S.useCallback(s=>{if(s.detail===0){t(s,"keyboard");return}"pointerType"in s?t(s,s.pointerType):t(s,e.current),e.current=""},[t]),onPointerDown:n}}function jB(t,e){const n=De((i,r)=>{(typeof t=="function"?t():t)||e(r||(Qy?"touch":""))}),{onClick:o,onPointerDown:s}=cV(n);return S.useMemo(()=>({onClick:o,onPointerDown:s}),[o,s])}function uV(t){const[e,n]=S.useState(null),o=jB(t,n);return gP(t,s=>{s&&!t&&n(null)}),S.useMemo(()=>({openMethod:e,triggerProps:o}),[e,o])}const dV={...hb,disabled:t=>t.parent.type==="menubar"&&t.parent.context.disabled||t.disabled,modal:t=>(t.parent.type===void 0||t.parent.type==="context-menu")&&(t.modal??!0),openMethod:t=>t.openMethod,allowMouseEnter:t=>t.allowMouseEnter,highlightItemOnHover:t=>t.highlightItemOnHover,parent:t=>t.parent,rootId:t=>t.parent.type==="menu"?t.parent.store.select("rootId"):t.parent.type!==void 0?t.parent.context.rootId:t.rootId,activeIndex:t=>t.activeIndex,isActive:(t,e)=>t.activeIndex===e,hoverEnabled:t=>t.hoverEnabled,instantType:t=>t.instantType,lastOpenChangeReason:t=>t.openChangeReason,floatingTreeRoot:t=>t.parent.type==="menu"?t.parent.store.select("floatingTreeRoot"):t.floatingTreeRoot,floatingNodeId:t=>t.floatingNodeId,floatingParentNodeId:t=>t.floatingParentNodeId,itemProps:t=>t.itemProps,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin,keyboardEventRelay:t=>{if(t.keyboardEventRelay)return t.keyboardEventRelay;if(t.parent.type==="menu")return t.parent.store.select("keyboardEventRelay")}};class fV extends Gu{constructor(e,n,o=!1){const s=new db,i=pV(s,n,o,e);super(i,hV(s),dV),this.unsubscribeParentListener=this.observe("parent",r=>{if(this.unsubscribeParentListener?.(),r.type==="menu"){let l=r.store.select("rootId"),u=r.store.select("floatingTreeRoot"),d=r.store.select("keyboardEventRelay");this.unsubscribeParentListener=r.store.subscribe(()=>{const h=r.store.select("rootId"),p=r.store.select("floatingTreeRoot"),g=r.store.select("keyboardEventRelay");l===h&&u===p&&d===g||(l=h,u=p,d=g,this.notifyAll())}),this.context.allowMouseUpTriggerRef=r.store.context.allowMouseUpTriggerRef;return}r.type!==void 0&&(this.context.allowMouseUpTriggerRef=r.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:e,eventDetails:n})}unsubscribeParentListener=null}function hV(t){return{positionerRef:S.createRef(),popupRef:S.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),onOpenChangeComplete:void 0,triggerElements:t}}function pV(t,e,n=!1,o){return{...fb(t,e,n),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new zS,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:nn,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...o}}const CB=S.createContext(void 0);function TB(){return S.useContext(CB)}const EB=Hh(function(e){const{children:n,open:o,onOpenChange:s,onOpenChangeComplete:i,defaultOpen:r=!1,disabled:l=!1,modal:u,loopFocus:d=!0,orientation:h="vertical",actionsRef:p,closeParentOnEsc:g=!1,handle:b,triggerId:w,defaultTriggerId:k=null,highlightItemOnHover:j=!0}=e,C=SS(!0),_=Ha(!0),T=SB(!0),M=TB(),O=S.useMemo(()=>M&&_?{type:"menu",store:_.store}:T?{type:"menubar",context:T}:C&&!_?{type:"context-menu",context:C}:{type:void 0},[C,_,T,M]),N=Ul(),D=Ul(),E=Zl(),R=O.type==="menu"?O.store:void 0,B=(o??r)&&R?.state.transitionStatus==="starting",I=qn(()=>B?R?.state.instantType:void 0).current,P=mV({open:r,openProp:o,activeTriggerId:k,triggerIdProp:w,parent:O,disabled:l,highlightItemOnHover:j,modal:O.type===void 0?u:void 0,rootId:N,instantType:I},D,E!=null);P.useControlledProp("openProp",o),P.useControlledProp("triggerIdProp",w),P.useContextCallback("onOpenChangeComplete",i);const $=P.useState("floatingTreeRoot"),W=IS($),K=P.useState("open"),F=P.useState("activeTriggerElement"),q=P.useState("positionerElement"),H=P.useState("hoverEnabled"),Y=P.useState("disabled"),ne=P.useState("lastOpenChangeReason"),z=P.useState("parent"),U=P.useState("activeIndex"),J=P.useState("payload"),X=P.useState("floatingParentNodeId"),oe=S.useRef(null),ie=S.useRef(z.type!=="context-menu"),be=co(),ce=S.useRef(!0),ye=co(),Ce=X!=null,{openMethod:Ve,triggerProps:Me}=uV(K);P.useSyncedValues({disabled:l,highlightItemOnHover:j,modal:z.type===void 0?u:void 0,openMethod:Ve,rootId:N}),lb(P);const{forceUnmount:je,transitionStatus:Oe}=cb(K,P,()=>{P.set("allowMouseEnter",!1)},B),Fe=Gy(P.context.popupRef);S.useEffect(()=>{if(I===void 0)return;const Te=()=>{P.state.instantType===I&&P.set("instantType",void 0)};if(!K){Te();return}if(Oe!==void 0)return;if(P.context.popupRef.current==null){Te();return}const rt=new AbortController;return Fe(Te,rt.signal),()=>{rt.abort()}},[I,K,Oe,Fe,P]),Se(()=>{C&&!_?P.update({parent:{type:"context-menu",context:C},floatingNodeId:W,floatingParentNodeId:E}):_&&P.update({floatingNodeId:W,floatingParentNodeId:E})},[C,_,W,E,P]),S.useEffect(()=>{if(K||(oe.current=null),z.type==="context-menu"){if(!K){be.clear(),ie.current=!1;return}be.start(500,()=>{ie.current=!0})}},[be,K,z.type]),Se(()=>{!K&&!H&&P.set("hoverEnabled",!0)},[K,H,P]);const nt=De((Te,rt)=>{const _t=rt.reason;if(!Te&&!P.select("open")||K===Te&&rt.trigger===F&&ne===_t)return;const Jt=KS(rt);if(!Te&&rt.trigger==null&&(rt.trigger=F??void 0),s?.(Te,rt),rt.isCanceled)return;P.state.floatingRootContext.dispatchOpenChange(Te,rt);const ls=rt.event;if(Te===!1&&ls?.type==="click"&&ls.pointerType==="touch"&&!ce.current)return;Te&&_t===iu?(ce.current=!1,ye.start(300,()=>{ce.current=!0})):(ce.current=!0,ye.clear());const Bs=(_t===xr||_t===pP)&&ls.detail===0,cs=!Te&&(_t===$h||_t==null);oe.current=rt.event;const vn=ab(P.state,Te,rt.trigger,Jt());vn.openChangeReason=_t,z.type==="menubar"&&(_t===iu||_t===Vl||_t===pn||_t===qg||_t===pf)?vn.instantType="group":Bs||cs?vn.instantType=Bs?"click":"dismiss":vn.instantType=void 0,P.update(vn)}),Ee=aB({popupStore:P,floatingRootContext:P.state.floatingRootContext,floatingId:D,nested:E!=null,onOpenChange:nt}),Je=Ee.context.events;Se(()=>{const Te=({open:rt,eventDetails:_t})=>nt(rt,_t);return Je.on("setOpen",Te),()=>{Je?.off("setOpen",Te)}},[Je,nt]);const _e=S.useCallback(()=>{P.setOpen(!1,ft(Wy))},[P]);S.useImperativeHandle(p,()=>({unmount:je,close:_e}),[je,_e]);let Ae;z.type==="context-menu"&&(Ae=z.context),S.useImperativeHandle(Ae?.positionerRef,()=>q,[q]),S.useImperativeHandle(Ae?.actionsRef,()=>({setOpen:nt}),[nt]);const Pe=ob(Ee,{enabled:!Y,bubbles:{escapeKey:g&&z.type==="menu"},outsidePress(){return z.type!=="context-menu"||oe.current?.type==="contextmenu"?!0:ie.current},externalTree:Ce?$:void 0}),bt=ej(),Be=S.useCallback(Te=>{P.select("activeIndex")!==Te&&P.set("activeIndex",Te)},[P]),fe=O9(Ee,{enabled:!Y,listRef:P.context.itemDomElements,activeIndex:U,nested:z.type!==void 0,loopFocus:d,orientation:h,parentOrientation:z.type==="menubar"?z.context.orientation:void 0,rtl:bt==="rtl",disabledIndices:br,onNavigate:Be,openOnArrowKeyDown:z.type!=="context-menu",externalTree:Ce?$:void 0,focusItemOnHover:j}),xe=S.useCallback(Te=>{P.context.typingRef.current=Te},[P]),pe=A9(Ee,{enabled:!Y,listRef:P.context.itemLabels,elementsRef:P.context.itemDomElements,activeIndex:U,resetMs:lU,onMatch:Te=>{K&&Te!==U&&P.set("activeIndex",Te)},onTyping:xe}),re=S.useMemo(()=>{const Te=dr(pe.reference,fe.reference,Pe.reference,{onMouseMove(){P.set("allowMouseEnter",!0)}},Me);return Te["aria-haspopup"]="menu",Te["aria-expanded"]=K,Te},[P,pe.reference,fe.reference,Pe.reference,Me,K]),ve=S.useMemo(()=>{const Te=dr(fe.trigger,Pe.trigger,Me);return Te["aria-haspopup"]="menu",Te["aria-expanded"]=!1,Te},[fe.trigger,Pe.trigger,Me]);qn(()=>(P.update({inactiveTriggerProps:ve}),null));const Ze=S.useMemo(()=>dr(ib,{id:D,role:"menu","aria-orientation":h==="horizontal"?"horizontal":void 0,"aria-labelledby":F?.id,onMouseMove(){P.set("allowMouseEnter",!0),z.type==="menu"&&P.set("hoverEnabled",!1)},onClick(){P.select("hoverEnabled")&&P.set("hoverEnabled",!1)},onKeyDown(Te){const rt=P.select("keyboardEventRelay");rt&&!Te.isPropagationStopped()&&rt(Te)}},pe.floating,fe.floating,Pe.floating),[F,D,h,z.type,P,pe.floating,fe.floating,Pe.floating]),Ln=fe.item??nn;ub(P,{floatingRootContext:Ee,activeTriggerProps:re,inactiveTriggerProps:ve,popupProps:Ze,itemProps:Ln});const So=S.useMemo(()=>({store:P,parent:O}),[P,O]),dn=y.jsxs(wP.Provider,{value:So,children:[b&&y.jsx(rb,{handle:b,store:P}),typeof n=="function"?n({payload:J}):n]});return z.type===void 0||z.type==="context-menu"?y.jsx(XP,{externalTree:$,children:dn}):dn});function mV(t,e,n){return qn(()=>new fV(t,e,n)).current}function gV(t){const e=Ha().store,n=S.useMemo(()=>({parentMenu:e}),[e]);return y.jsx(CB.Provider,{value:n,children:y.jsx(EB,{...t})})}const Hm=5;function yV(t,e){const n=bV(e);return t.clientX>=n.left-Hm&&t.clientX<=n.right+Hm&&t.clientY>=n.top-Hm&&t.clientY<=n.bottom+Hm}function bV(t){const e=t.getBoundingClientRect(),n=on(t);if(CS)return e;const o=n.getComputedStyle(t,"::before"),s=n.getComputedStyle(t,"::after");if(!(o.content!=="none"||s.content!=="none"))return e;const r=parseFloat(o.width)||0,l=parseFloat(o.height)||0,u=parseFloat(s.width)||0,d=parseFloat(s.height)||0,h=Math.max(e.width,r,u),p=Math.max(e.height,l,d),g=h-e.width,b=p-e.height;return{left:e.left-g/2,right:e.right+g/2,top:e.top-b/2,bottom:e.bottom+b/2}}function wV(t={}){const{highlightItemOnHover:e,highlightedIndex:n,onHighlightedIndexChange:o}=yS(),{ref:s,index:i}=TS(t),r=n===i,l=S.useRef(null),u=Ra(s,l);return{compositeProps:{tabIndex:r?0:-1,onFocus(){o(i)},onMouseMove(){const h=l.current;if(!e||!h)return;const p=h.hasAttribute("disabled")||h.ariaDisabled==="true";!r&&!p&&h.focus()}},compositeRef:u,index:i}}function _B(t){const{render:e,className:n,style:o,state:s=nn,props:i=br,refs:r=br,metadata:l,stateAttributesMapping:u,tag:d="div",...h}=t,{compositeProps:p,compositeRef:g}=wV({metadata:l});return Ht(d,t,{state:s,ref:[g,...r],props:[p,...i,h],stateAttributesMapping:u})}function MB(t){if(Ft(t)&&t.hasAttribute("data-rootownerid"))return t.getAttribute("data-rootownerid");if(!ur(t))return MB(wr(t))}function OB(t,e){const n=S.useRef(null);function o(i){Os.flushSync(()=>{t.setOpen(!1,ft(Vl,i.nativeEvent,i.currentTarget))}),sU(n.current)?.focus()}function s(i){const r=t.select("positionerElement");if(r&&au(i,r))t.context.beforeContentFocusGuardRef.current?.focus();else{Os.flushSync(()=>{t.setOpen(!1,ft(Vl,i.nativeEvent,i.currentTarget))});let l=oU(t.context.triggerFocusTargetRef.current||e.current);for(;l!==null&&Ie(r,l);){const u=l;if(l=DS(l),l===u)break}l?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:o,handleFocusTargetFocus:s}}function xV(t){const{enabled:e=!0,mouseDownAction:n,open:o}=t,s=S.useRef(!1);return S.useMemo(()=>e?{onMouseDown:i=>{(n==="open"&&!o||n==="close"&&o)&&(s.current=!0,yt(i.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:i=>{s.current&&(s.current=!1,i.preventBaseUIHandler())}}:nn,[e,n,o])}const vV=US(function(e,n){const{render:o,className:s,style:i,disabled:r=!1,nativeButton:l=!0,id:u,openOnHover:d,delay:h=100,closeDelay:p=0,handle:g,payload:b,...w}=e,k=Ha(!0),C=GS(g)??k?.store;if(!C)throw new Error(gn(85));const _=ei(u),T=C.useState("isTriggerActive",_),M=C.useState("floatingRootContext"),O=C.useState("isOpenedByTrigger",_),N=C.useState("triggerPopupId",_),D=S.useRef(null),E=SV(),R=yS(!0),B=Ua(),I=S.useMemo(()=>B??new zS,[B]),P=IS(I),$=Zl(),{registerTrigger:W,isMountedByThisTrigger:K}=WS(_,D,C,{payload:b,closeDelay:p,parent:E,floatingTreeRoot:I,floatingNodeId:P,floatingParentNodeId:$,keyboardEventRelay:R?.relayKeyboardEvent}),F=E.type==="menubar",q=C.useState("disabled"),H=r||q||F&&E.context.disabled,{getButtonProps:Y,buttonRef:ne}=Fa({disabled:H,native:l});S.useEffect(()=>{!O&&E.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,O,E.type]);const z=S.useRef(null),U=co(),J=De(Ae=>{if(!z.current)return;U.clear(),C.context.allowMouseUpTriggerRef.current=!1;const Pe=Ae.target;Ie(z.current,Pe)||Ie(C.select("positionerElement"),Pe)||Pe===z.current||Pe!=null&&MB(Pe)===C.select("rootId")||yV(Ae,z.current)||I.events.emit("close",{domEvent:Ae,reason:r7})});S.useEffect(()=>{O&&C.select("lastOpenChangeReason")===pn&&yt(z.current).addEventListener("mouseup",J,{once:!0})},[O,J,C]);const X=F&&E.context.hasSubmenuOpen,ie=pb(M,{enabled:(d??X)&&!H&&(!F||X&&!K),handleClose:gb({blockPointerEvents:!F}),mouseOnly:!0,move:!1,restMs:E.type===void 0?h:void 0,delay:{close:p},triggerElementRef:D,externalTree:I,isActiveTrigger:T,isClosing:()=>C.select("transitionStatus")==="ending"}),be=kV(O,C.select("lastOpenChangeReason")),ce=FS(M,{enabled:!H,event:O&&F?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:E.type===void 0?be:!1}),ye=fB(M,{enabled:!H&&X}),Ce=xV({open:O,enabled:F,mouseDownAction:"open"}),Ve=S.useMemo(()=>dr(ye.reference,ce.reference),[ye.reference,ce.reference]),Me=C.useState("triggerProps",K),{preFocusGuardRef:je,handlePreFocusGuardFocus:Oe,handleFocusTargetFocus:Fe}=OB(C,D),nt={disabled:H,open:O},Ee=[z,n,ne,W,D],Je=[Ve,ie??nn,Me,{"aria-haspopup":"menu","aria-controls":N,id:_,onMouseDown:Ae=>{if(C.select("open"))return;U.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),yt(Ae.currentTarget).addEventListener("mouseup",J,{once:!0})}},F?{role:"menuitem"}:{},Ce,w,Y],_e=Ht("button",e,{enabled:!F,stateAttributesMapping:mk,state:nt,ref:Ee,props:Je});return F?y.jsx(_B,{tag:"button",render:o,className:s,style:i,state:nt,refs:Ee,props:Je,stateAttributesMapping:mk}):O?y.jsxs(S.Fragment,{children:[y.jsx(vr,{ref:je,onFocus:Oe},`${_}-pre-focus-guard`),y.jsx(S.Fragment,{children:_e},_),y.jsx(vr,{ref:C.context.triggerFocusTargetRef,onFocus:Fe},`${_}-post-focus-guard`)]}):y.jsx(S.Fragment,{children:_e},_)});function kV(t,e){const n=co(),[o,s]=S.useState(!1);return Se(()=>{t&&e===pn?(s(!0),n.start(FP,()=>{s(!1)})):t||(n.clear(),s(!1))},[t,e,n]),o}function SV(){const t=SB();return S.useMemo(()=>t?{type:"menubar",context:t}:{type:void 0},[t])}const jV=S.forwardRef(function(e,n){const{className:o,render:s,orientation:i="horizontal",style:r,...l}=e;return Ht("div",e,{state:{orientation:i},ref:n,props:[{role:"separator","aria-orientation":i},l]})});function CV(t){return t==null||t.hasAttribute("disabled")||t.getAttribute("aria-disabled")==="true"}const TV={"aria-expanded":void 0},EV=S.forwardRef(function(e,n){const{render:o,className:s,style:i,label:r,id:l,nativeButton:u=!1,openOnHover:d=!0,delay:h=100,closeDelay:p=0,disabled:g=!1,...b}=e,w=TB();if(!w?.parentMenu)throw new Error(gn(37));const k=TS({guess:!0,label:r}),j=xS(),{store:C}=Ha(),_=ei(l),T=C.useState("open"),M=C.useState("floatingRootContext"),O=C.useState("floatingTreeRoot"),N=C.useState("triggerPopupId",_),D=cB(_,C),E=De(Ve=>{D(Ve),Ve!==null&&C.select("open")&&C.select("activeTriggerId")==null&&C.update({activeTriggerId:_??null,activeTriggerElement:Ve,closeDelay:p})}),R=S.useRef(null),B=S.useCallback(Ve=>{R.current=Ve,C.set("activeTriggerElement",Ve)},[C]);Se(()=>(E(R.current),()=>E(null)),[E,_,C]),C.useSyncedValue("closeDelay",p);const I=w.parentMenu,P=C.useState("disabled"),$=I.useState("disabled"),W=g||P||$,K=I.useState("itemProps"),F=I.useState("isActive",k.index),q=S.useMemo(()=>({type:"submenu-trigger",setActive(){I.select("highlightItemOnHover")&&I.set("activeIndex",k.index)}}),[I,k.index]),{getItemProps:H,itemRef:Y}=kP({closeOnClick:!1,disabled:W,highlighted:F,id:_,store:C,typingRef:I.context.typingRef,nativeButton:u,itemMetadata:q,nodeId:j?.context.nodeId}),ne=C.useState("hoverEnabled"),z=pb(M,{enabled:ne&&d&&!W,handleClose:gb({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:h,delay:{open:h,close:p},shouldOpen:h>0?()=>I.select("allowMouseEnter"):void 0,triggerElementRef:R,externalTree:O,isClosing:()=>C.select("transitionStatus")==="ending",guardStaleOpen:!0}),J=FS(M,{enabled:!W,event:"mousedown",toggle:!d,ignoreMouse:d,stickIfOpen:!1}).reference??nn,X=C.useState("triggerProps",!0);delete X.id;const oe={disabled:W,highlighted:F,open:T},ie=C.useState("openMethod"),ce=C.useState("lastOpenChangeReason")===qg||ie==="keyboard";return Ht("div",e,{state:oe,stateAttributesMapping:vS,props:[J,z,X,K,T&&ce&&vP?TV:void 0,{"aria-controls":N,tabIndex:T||F?0:-1,onBlur(){F&&I.set("activeIndex",null)}},b,H],ref:[n,k.ref,Y,E,B]})}),AB=S.createContext(void 0);function vb(t){const e=S.useContext(AB);if(e===void 0&&!t)throw new Error(gn(72));return e}const _V={...hb,disabled:t=>t.disabled,instantType:t=>t.instantType,isInstantPhase:t=>t.isInstantPhase,trackCursorAxis:t=>t.trackCursorAxis,disableHoverablePopup:t=>t.disableHoverablePopup,lastOpenChangeReason:t=>t.openChangeReason,closeOnClick:t=>t.closeOnClick,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class MV extends Gu{constructor(e,n,o){const s=new db;super(OV(e,s,n,o),AV(s),_V)}setOpen=(e,n)=>{k9(this,e,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(e){this.state.floatingRootContext.dispatchOpenChange(!1,ft(xr,e))}}function OV(t,e,n,o=!1){return{...fb(e,n,o),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t}}function AV(t){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const RB=Hh(function(e){const{disabled:n=!1,defaultOpen:o=!1,open:s,disableHoverablePopup:i=!1,trackCursorAxis:r="none",actionsRef:l,onOpenChange:u,onOpenChangeComplete:d,handle:h,triggerId:p,defaultTriggerId:g=null,children:b}=e,w=VS((I,P)=>new MV({open:o,openProp:s,activeTriggerId:g,triggerIdProp:p},I,P));w.useControlledProp("openProp",s),w.useControlledProp("triggerIdProp",p),w.useContextCallback("onOpenChange",u),w.useContextCallback("onOpenChangeComplete",d);const k=w.useState("open"),j=!n&&k,C=w.useState("activeTriggerId"),_=w.useState("mounted"),T=w.useState("payload");w.useSyncedValues({trackCursorAxis:r,disableHoverablePopup:i,disabled:n}),lb(w,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:M,transitionStatus:O}=cb(j,w),N=w.useState("isInstantPhase"),D=w.useState("instantType"),E=w.useState("lastOpenChangeReason"),R=S.useRef(null);Se(()=>{k&&n&&w.setOpen(!1,ft(a7))},[k,n,w]),Se(()=>{O==="ending"&&E===Lh||O!=="ending"&&N?(D!=="delay"&&(R.current=D),w.set("instantType","delay")):R.current!==null&&(w.set("instantType",R.current),R.current=null)},[O,N,E,D,w]),Se(()=>{j&&C==null&&w.set("payload",void 0)},[w,C,j]),S.useImperativeHandle(l,()=>({unmount:M,close:()=>w.setOpen(!1,ft(Wy))}),[M,w]);const B=j||_||!n&&r!=="none";return y.jsxs(AB.Provider,{value:w,children:[h&&y.jsx(rb,{handle:h,store:w}),B&&y.jsx(RV,{store:w,disabled:n,trackCursorAxis:r}),typeof b=="function"?b({payload:T}):b]})});function RV({store:t,disabled:e,trackCursorAxis:n}){const o=t.useState("floatingRootContext"),s=ob(o,{enabled:!e,referencePress:()=>t.select("closeOnClick")}),i=xU(o,{enabled:!e&&n!=="none",axis:n==="none"?void 0:n}),r=S.useMemo(()=>dr(i.reference,s.reference),[i.reference,s.reference]);return ub(t,{activeTriggerProps:r,inactiveTriggerProps:r,popupProps:s.floating??nn}),null}const NB=S.createContext(void 0);function NV(){return S.useContext(NB)}const DV=600,DB="data-base-ui-tooltip-trigger";function xA(t){if("composedPath"in t){const n=t.composedPath();for(let o=0;o<n.length;o+=1){const s=n[o];if(vt(s))return s}}const e=t.target;return vt(e)?e:null}function PV(t){let e=t;for(;e;){const n=e.closest(`[${DB}]`);if(n)return n;const o=e.getRootNode();e="host"in o&&vt(o.host)?o.host:null}return null}const PB=US(function(e,n){const{render:o,className:s,style:i,handle:r,payload:l,disabled:u,delay:d,closeOnClick:h=!0,closeDelay:p,id:g,...b}=e,w=vb(!0),j=GS(r)??w;if(!j)throw new Error(gn(82));const C=ei(g),_=j.useState("isTriggerActive",C),T=j.useState("isOpenedByTrigger",C),M=j.useState("floatingRootContext"),O=S.useRef(null),N=p??0,{registerTrigger:D,isMountedByThisTrigger:E}=WS(C,O,j,{payload:l,closeOnClick:h,closeDelay:N}),R=NV(),{activeIdRef:B,delayRef:I,isInstantPhase:P,hasProvider:$}=F7(M,{open:T}),W=JS(M);j.useSyncedValue("isInstantPhase",P);const K=j.useState("disabled"),F=u??K,q=Mn(F),H=j.useState("trackCursorAxis"),Y=j.useState("disableHoverablePopup"),ne=S.useRef(!1),z=co(),U=S.useRef(void 0);function J(){return $&&B.current!=null?0:d??R??DV}function X(je){const Oe=O.current;if(!Oe||!je)return!1;const Fe=PV(je);return Fe!==null&&Fe!==Oe&&Ie(Oe,Fe)}function oe(je){const Oe=X(je);return ne.current=Oe,Oe&&(W.openChangeTimeout.clear(),W.restTimeout.clear(),W.restTimeoutPending=!1,z.clear()),Oe}const ie=pb(M,{enabled:!F,mouseOnly:!0,move:!1,handleClose:!Y&&H!=="both"?gb():null,restMs:J,delay(){return p==null&&$?{close:Kl(I.current,"close")}:{close:N}},triggerElementRef:O,isActiveTrigger:_,isClosing:()=>j.select("transitionStatus")==="ending",shouldOpen(){return!ne.current}}),be=fB(M,{enabled:!F}).reference,ce=je=>{const Oe=ne.current,Fe=xA(je),nt=oe(Fe),Ee=O.current,Je=Ee&&Fe&&Ie(Ee,Fe);if(nt&&j.select("open")&&j.select("lastOpenChangeReason")===pn){j.setOpen(!1,ft(pn,je));return}if(Oe&&!nt&&Je&&!q.current&&!j.select("open")&&Ee&&Sa(U.current)){const _e=()=>{!ne.current&&!q.current&&!j.select("open")&&j.setOpen(!0,ft(pn,je,Ee))},Ae=J();Ae===0?(z.clear(),_e()):z.start(Ae,_e)}},ye=j.useState("triggerProps",E);return Ht("button",e,{state:{open:T},ref:[n,D,O],props:[ie,be,E||H!=="none"?ye:void 0,{onMouseOver(je){ce(je.nativeEvent)},onFocus(je){X(xA(je.nativeEvent))&&je.preventBaseUIHandler()},onMouseLeave(){ne.current=!1,z.clear(),U.current=void 0},onPointerEnter(je){U.current=je.pointerType},onPointerDown(je){U.current=je.pointerType,j.set("closeOnClick",h),h&&!j.select("open")&&j.cancelPendingOpen(je.nativeEvent)},onClick(je){h&&!j.select("open")&&j.cancelPendingOpen(je.nativeEvent)},id:C,[bk]:F?"":void 0,[DB]:F?void 0:""},b],stateAttributesMapping:vS})}),BB=S.createContext(void 0);function BV(){const t=S.useContext(BB);if(t===void 0)throw new Error(gn(70));return t}const zB=S.forwardRef(function(e,n){const{children:o,container:s,className:i,render:r,style:l,...u}=e,{node:d,subtree:h}=VP({container:s,ref:n,componentProps:e,elementProps:u});return!h&&!d?null:y.jsxs(S.Fragment,{children:[h,d&&Os.createPortal(o,d)]})}),IB=S.forwardRef(function(e,n){const{keepMounted:o=!1,...s}=e;return vb().useState("mounted")||o?y.jsx(BB.Provider,{value:o,children:y.jsx(zB,{ref:n,...s})}):null}),LB=S.createContext(void 0);function zV(){const t=S.useContext(LB);if(t===void 0)throw new Error(gn(71));return t}const $B=S.forwardRef(function(e,n){const{render:o,className:s,anchor:i,positionMethod:r="absolute",side:l="top",align:u="center",sideOffset:d=0,alignOffset:h=0,collisionBoundary:p="clipping-ancestors",collisionPadding:g=5,arrowPadding:b=5,sticky:w=!1,disableAnchorTracking:k=!1,collisionAvoidance:j=PS,style:C,..._}=e,T=vb(),M=BV(),O=T.useState("open"),N=T.useState("mounted"),D=T.useState("trackCursorAxis"),E=T.useState("disableHoverablePopup"),R=T.useState("floatingRootContext"),B=T.useState("instantType"),I=T.useState("transitionStatus"),P=T.useState("adaptiveOrigin"),$=tj({anchor:i,positionMethod:r,floatingRootContext:R,mounted:N,side:l,sideOffset:d,align:u,alignOffset:h,collisionBoundary:p,collisionPadding:g,sticky:w,arrowPadding:b,disableAnchorTracking:k,keepMounted:M,collisionAvoidance:j,adaptiveOrigin:P}),W=S.useMemo(()=>({open:O,side:$.side,align:$.align,anchorHidden:$.anchorHidden,instant:D!=="none"?"tracking-cursor":B}),[O,$.side,$.align,$.anchorHidden,D,B]),K=oj(e,W,{styles:$.positionerStyles,transitionStatus:I,props:_,refs:[n,T.useStateSetter("positionerElement")],hidden:!N,inert:!O||D==="both"||E});return y.jsx(LB.Provider,{value:$,children:K})}),FB=S.forwardRef(function(e,n){const{render:o,className:s,style:i,...r}=e,l=vb(),{side:u,align:d}=zV(),h=l.useState("open"),p=l.useState("instantType"),g=l.useState("transitionStatus"),b=l.useState("popupProps"),w=l.useState("floatingRootContext"),k=l.useState("disabled"),j=l.useState("closeDelay");Yu({open:h,ref:l.context.popupRef,onComplete(){h&&l.context.onOpenChangeComplete?.(!0)}}),QS(w,{enabled:!k,closeDelay:j});const C=l.useStateSetter("popupElement");return Ht("div",e,{state:{open:h,side:u,align:d,instant:p,transitionStatus:g},ref:[n,l.context.popupRef,C],props:[ib,b,bb(g),r],stateAttributesMapping:Xy})}),HB=function(e){const{delay:n,closeDelay:o,timeout:s=400}=e,i=S.useMemo(()=>({open:n,close:o}),[n,o]);return y.jsx(NB.Provider,{value:n,children:y.jsx($7,{delay:i,timeoutMs:s,children:e.children})})};function qB(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=qB(t[e]))&&(o&&(o+=" "),o+=n)}else for(n in t)t[n]&&(o&&(o+=" "),o+=n);return o}function IV(){for(var t,e,n=0,o="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=qB(t))&&(o&&(o+=" "),o+=e);return o}const LV=t=>t?.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();function $V(t,e,n=[]){if(e==null)throw new Error("[lucide]: iconNode is required when icon name is used");return{name:LV(t),size:24,node:e,...n.length>0?{aliases:n}:{}}}const FV=t=>{let e="",n=!1;for(const o of t){if(o==="-"||o==="_"||o<=" "){n=e.length>0;continue}e.length===0?e+=o.toLowerCase():e+=n?o.toUpperCase():o,n=!1}return e};const HV=t=>{const e=FV(t);return e.charAt(0).toUpperCase()+e.slice(1)};const Nk=(...t)=>t.filter((e,n,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===n).join(" ").trim();const ml={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};function K0(t){return t!=null}function qV(t,e={}){const n=e.attributeNames??{},o=g=>n[g]??g,s=t.size??t.width??ml.width,i=t.size??t.height??ml.height,r=t.aliases?.filter(g=>typeof g=="string"&&g.trim()!=="").map(g=>`lucide-${g}`)??[],l=[...t.name?[`lucide-${t.name}`]:[],...r],u=e.className?.split(" ").filter(Boolean)??[],d=e.includeDefaultClasses===!1?Nk(...u):Nk("lucide",...l,...u),h=e.absoluteStrokeWidth?Number(e.strokeWidth??ml["stroke-width"])*Number(t.size??t.width??ml.width)/Number(e.size??e.width??ml.width):e.strokeWidth??ml["stroke-width"];return["svg",{...Object.entries(ml).reduce((g,[b,w])=>(g[o(b)]=w,g),{}),..."color"in e&&e.color&&{[o("stroke")]:e.color},..."size"in e&&K0(e.size)&&{[o("width")]:e.size,[o("height")]:e.size},..."width"in e&&K0(e.width)&&{[o("width")]:e.width},..."height"in e&&K0(e.height)&&{[o("height")]:e.height},[o("stroke-width")]:h,...d&&{[o("class")]:d},[o("viewBox")]:`0 0 ${s} ${i}`,...e.hasA11yProp===!1?{[o("aria-hidden")]:"true"}:{},..."attributes"in e&&e.attributes},t.node.map(g=>{const[b,w,k]=g,j=e.nonScalingStroke?{[o("vector-effect")]:"non-scaling-stroke",...w}:w;return k?[b,j,k]:[b,j]})]}function UV(t,e={}){return qV(t,{...e,attributeNames:{...e.attributeNames,class:"className","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-linejoin":"strokeLinejoin","vector-effect":"vectorEffect"}})}const VV=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},KV=S.createContext({}),WV=()=>S.useContext(KV),YV=S.forwardRef(({color:t,size:e,width:n,height:o,strokeWidth:s,absoluteStrokeWidth:i,nonScalingStroke:r,className:l="",children:u,iconNode:d=[],icon:h={node:d,aliases:[],size:24},...p},g)=>{const{size:b=24,strokeWidth:w=2,absoluteStrokeWidth:k=!1,nonScalingStroke:j=!1,color:C="currentColor",className:_=""}=WV()??{},T=!!u||VV(p),[M,O,N=[]]=UV(h,{color:t??C,width:n??e??b,height:o??e??b,strokeWidth:s??w,absoluteStrokeWidth:i??k,nonScalingStroke:r??j,className:Nk(_,l),hasA11yProp:T,attributes:p});return S.createElement(M,{ref:g,...O},[...N.map(([D,E])=>S.createElement(D,E)),...Array.isArray(u)?u:[u]])});function ge(t,e=[],n=[]){const o=typeof t=="string"?$V(t,e,n):t,s=S.forwardRef(({className:i,...r},l)=>S.createElement(YV,{ref:l,icon:o,className:i,...r}));return o.name&&(s.displayName=HV(o.name)),s}const UB={name:"archive-arrow-up",size:24,node:[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],aliases:["archive-restore"]};UB.node;const GV=ge(UB);const VB={name:"arrow-down-wide-narrow",size:24,node:[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]],aliases:["sort-desc"]};VB.node;const XV=ge(VB);const KB={name:"arrow-down",size:24,node:[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]};KB.node;const JV=ge(KB);const WB={name:"arrow-left",size:24,node:[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]};WB.node;const YB=ge(WB);const GB={name:"arrow-right",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]};GB.node;const XB=ge(GB);const JB={name:"arrow-up-down",size:24,node:[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]};JB.node;const QB=ge(JB);const ZB={name:"arrow-up-narrow-wide",size:24,node:[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h4",key:"q8tih4"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h10",key:"jvxblo"}]],aliases:["sort-asc"]};ZB.node;const QV=ge(ZB);const ez={name:"arrow-up",size:24,node:[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]};ez.node;const sj=ge(ez);const tz={name:"between-horizontal-end",size:24,node:[["rect",{width:"13",height:"7",x:"3",y:"3",rx:"1",key:"11xb64"}],["path",{d:"m22 15-3-3 3-3",key:"26chmm"}],["rect",{width:"13",height:"7",x:"3",y:"14",rx:"1",key:"k6ky7n"}]],aliases:["between-horizonal-end"]};tz.node;const ZV=ge(tz);const nz={name:"between-horizontal-start",size:24,node:[["rect",{width:"13",height:"7",x:"8",y:"3",rx:"1",key:"pkso9a"}],["path",{d:"m2 9 3 3-3 3",key:"1agib5"}],["rect",{width:"13",height:"7",x:"8",y:"14",rx:"1",key:"1q5fc1"}]],aliases:["between-horizonal-start"]};nz.node;const eK=ge(nz);const oz={name:"between-vertical-end",size:24,node:[["rect",{width:"7",height:"13",x:"3",y:"3",rx:"1",key:"1fdu0f"}],["path",{d:"m9 22 3-3 3 3",key:"17z65a"}],["rect",{width:"7",height:"13",x:"14",y:"3",rx:"1",key:"1squn4"}]]};oz.node;const tK=ge(oz);const sz={name:"between-vertical-start",size:24,node:[["rect",{width:"7",height:"13",x:"3",y:"8",rx:"1",key:"1fjrkv"}],["path",{d:"m15 2-3 3-3-3",key:"1uh6eb"}],["rect",{width:"7",height:"13",x:"14",y:"8",rx:"1",key:"w3fjg8"}]]};sz.node;const nK=ge(sz);const iz={name:"bot",size:24,node:[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]};iz.node;const kb=ge(iz);const rz={name:"calendar-days",size:24,node:[["path",{d:"M8 2v3",key:"1ioesn"}],["path",{d:"M16 2v3",key:"otl347"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M8 13h.01",key:"1sbv64"}],["path",{d:"M12 13h.01",key:"y0uutt"}],["path",{d:"M16 13h.01",key:"wip0gl"}],["path",{d:"M8 17h.01",key:"p3bg7i"}],["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M16 17h.01",key:"ql8jdd"}]]};rz.node;const oK=ge(rz);const az={name:"check",size:24,node:[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]};az.node;const Va=ge(az);const lz={name:"chevron-down",size:24,node:[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]};lz.node;const Ps=ge(lz);const cz={name:"chevron-left",size:24,node:[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]};cz.node;const sK=ge(cz);const uz={name:"chevron-right",size:24,node:[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]};uz.node;const qh=ge(uz);const dz={name:"chevron-up",size:24,node:[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]};dz.node;const ij=ge(dz);const fz={name:"chevrons-down-up",size:24,node:[["path",{d:"m7 20 5-5 5 5",key:"13a0gw"}],["path",{d:"m7 4 5 5 5-5",key:"1kwcof"}]]};fz.node;const iK=ge(fz);const hz={name:"chevrons-up-down",size:24,node:[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]};hz.node;const rK=ge(hz);const pz={name:"circle-alert",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],aliases:["alert-circle"]};pz.node;const mz=ge(pz);const gz={name:"circle-check",size:24,node:[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 9-5.5 5.5L8 12",key:"xofnsj"}]],aliases:["check-circle-2"]};gz.node;const aK=ge(gz);const yz={name:"code",size:24,node:[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]]};yz.node;const lK=ge(yz);const bz={name:"copy-plus",size:24,node:[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};bz.node;const cK=ge(bz);const wz={name:"copy",size:24,node:[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]};wz.node;const Sb=ge(wz);const xz={name:"crop",size:24,node:[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]]};xz.node;const uK=ge(xz);const vz={name:"download",size:24,node:[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]};vz.node;const dK=ge(vz);const kz={name:"ellipsis",size:24,node:[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],aliases:["more-horizontal"]};kz.node;const Xu=ge(kz);const Sz={name:"external-link",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]};Sz.node;const fK=ge(Sz);const jz={name:"eye-off",size:24,node:[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};jz.node;const hK=ge(jz);const Cz={name:"eye",size:24,node:[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]};Cz.node;const Tz=ge(Cz);const Ez={name:"face-slightly-smiling-plus",size:24,node:[["path",{d:"M13.267 2.08a10 10 0 108.653 8.653",key:"1wbpyh"}],["path",{d:"M15 10V9",key:"4dkmfx"}],["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M16.472 15a6 6 0 01-8.943 0",key:"7qomzy"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M9 10V9",key:"1lazqi"}]],aliases:["smile-plus"]};Ez.node;const _z=ge(Ez);const Mz={name:"file-text",size:24,node:[["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",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]};Mz.node;const pK=ge(Mz);const Oz={name:"file-up",size:24,node:[["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",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]};Oz.node;const mK=ge(Oz);const Az={name:"fold-horizontal",size:24,node:[["path",{d:"M2 12h6",key:"1wqiqv"}],["path",{d:"M22 12h-6",key:"1eg9hc"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 9-3 3 3 3",key:"12ol22"}],["path",{d:"m5 15 3-3-3-3",key:"1kdhjc"}]]};Az.node;const gK=ge(Az);const Rz={name:"grip-horizontal",size:24,node:[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]};Rz.node;const yK=ge(Rz);const Nz={name:"grip-vertical",size:24,node:[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]};Nz.node;const rj=ge(Nz);const Dz={name:"hash",size:24,node:[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]};Dz.node;const bK=ge(Dz);const Pz={name:"heading-1",size:24,node:[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]};Pz.node;const wK=ge(Pz);const Bz={name:"heading-2",size:24,node:[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}]]};Bz.node;const xK=ge(Bz);const zz={name:"heading-3",size:24,node:[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]};zz.node;const vK=ge(zz);const Iz={name:"highlighter",size:24,node:[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]]};Iz.node;const kK=ge(Iz);const Lz={name:"image-plus",size:24,node:[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]};Lz.node;const SK=ge(Lz);const $z={name:"image-up",size:24,node:[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19.5 3-3 3 3",key:"9vmjn0"}],["path",{d:"M17 22v-5.5",key:"1aa6fl"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]]};$z.node;const jK=ge($z);const Fz={name:"image",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]};Fz.node;const CK=ge(Fz);const Hz={name:"italic",size:24,node:[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]};Hz.node;const TK=ge(Hz);const qz={name:"keyboard",size:24,node:[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]};qz.node;const EK=ge(qz);const Uz={name:"letter-b",size:24,node:[["path",{d:"M6 12h9a4 4 0 010 8H7a1 1 0 01-1-1V5a1 1 0 011-1h7a4 4 0 010 8",key:"n8tvfh"}]],aliases:["bold"]};Uz.node;const _K=ge(Uz);const Vz={name:"link-2",size:24,node:[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]};Vz.node;const MK=ge(Vz);const Kz={name:"link",size:24,node:[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]};Kz.node;const OK=ge(Kz);const Wz={name:"list-checks",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]]};Wz.node;const Uh=ge(Wz);const Yz={name:"list-indent-decrease",size:24,node:[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m7 8-4 4 4 4",key:"o5hrat"}]],aliases:["outdent","indent-decrease"]};Yz.node;const AK=ge(Yz);const Gz={name:"list-indent-increase",size:24,node:[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m3 8 4 4-4 4",key:"1a3j6y"}]],aliases:["indent","indent-increase"]};Gz.node;const RK=ge(Gz);const Xz={name:"list-ordered",size:24,node:[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]]};Xz.node;const Jz=ge(Xz);const Qz={name:"list-todo",size:24,node:[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]};Qz.node;const NK=ge(Qz);const Zz={name:"list",size:24,node:[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]]};Zz.node;const aj=ge(Zz);const eI={name:"loader-circle",size:24,node:[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],aliases:["loader-2"]};eI.node;const tI=ge(eI);const nI={name:"lock-open",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]],aliases:["unlock"]};nI.node;const DK=ge(nI);const oI={name:"lock",size:24,node:[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]};oI.node;const lj=ge(oI);const sI={name:"maximize-2",size:24,node:[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]};sI.node;const PK=ge(sI);const iI={name:"message-square-off",size:24,node:[["path",{d:"M19 19H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.7.7 0 0 1 2 21.286V5a2 2 0 0 1 1.184-1.826",key:"1wyg69"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.656 3H20a2 2 0 0 1 2 2v11.344",key:"mhl4k6"}]]};iI.node;const BK=ge(iI);const rI={name:"message-square-plus",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M12 8v6",key:"1ib9pf"}],["path",{d:"M9 11h6",key:"1fldmi"}]]};rI.node;const zK=ge(rI);const aI={name:"message-square-reply",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"m10 8-3 3 3 3",key:"fp6dz7"}],["path",{d:"M17 14v-1a2 2 0 0 0-2-2H7",key:"1tkjnz"}]]};aI.node;const IK=ge(aI);const lI={name:"message-square",size:24,node:[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]};lI.node;const cj=ge(lI);const cI={name:"messages-square",size:24,node:[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]};cI.node;const LK=ge(cI);const uI={name:"palette",size:24,node:[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]};uI.node;const dI=ge(uI);const fI={name:"panel-left",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],aliases:["sidebar"]};fI.node;const $K=ge(fI);const hI={name:"panel-top",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]]};hI.node;const FK=ge(hI);const pI={name:"pen-line",size:24,node:[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],aliases:["edit-3"]};pI.node;const vA=ge(pI);const mI={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};mI.node;const Xf=ge(mI);const gI={name:"plus",size:24,node:[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]};gI.node;const Ju=ge(gI);const yI={name:"rotate-ccw-clock",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],aliases:["history"]};yI.node;const uj=ge(yI);const bI={name:"rotate-ccw",size:24,node:[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]};bI.node;const HK=ge(bI);const wI={name:"search",size:24,node:[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]};wI.node;const qK=ge(wI);const xI={name:"separator-horizontal",size:24,node:[["path",{d:"m16 16-4 4-4-4",key:"3dv8je"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"m8 8 4-4 4 4",key:"2bscm2"}]]};xI.node;const UK=ge(xI);const vI={name:"sparkles",size:24,node:[["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",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],aliases:["stars"]};vI.node;const VK=ge(vI);const kI={name:"square-chevron-down",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"m16 10-4 4-4-4",key:"894hmk"}]],aliases:["chevron-down-square"]};kI.node;const KK=ge(kI);const SI={name:"square-code",size:24,node:[["path",{d:"m10 9-3 3 3 3",key:"1oro0q"}],["path",{d:"m14 15 3-3-3-3",key:"bz13h7"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]],aliases:["code-square"]};SI.node;const WK=ge(SI);const jI={name:"strikethrough",size:24,node:[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]]};jI.node;const YK=ge(jI);const CI={name:"table-2",size:24,node:[["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",key:"h1oib"}]]};CI.node;const TI=ge(CI);const EI={name:"table-cells-merge",size:24,node:[["path",{d:"M12 21v-6",key:"lihzve"}],["path",{d:"M12 9V3",key:"da5inc"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M3 9h18",key:"1pudct"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};EI.node;const GK=ge(EI);const _I={name:"table-cells-split",size:24,node:[["path",{d:"M12 15V9",key:"8c7uyn"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M3 9h18",key:"1pudct"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]};_I.node;const XK=ge(_I);const MI={name:"text-align-center",size:24,node:[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M17 12H7",key:"16if0g"}],["path",{d:"M19 19H5",key:"vjpgq2"}]],aliases:["align-center"]};MI.node;const JK=ge(MI);const OI={name:"text-align-end",size:24,node:[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M21 19H7",key:"4cu937"}]],aliases:["align-right"]};OI.node;const QK=ge(OI);const AI={name:"text-align-start",size:24,node:[["path",{d:"M21 5H3",key:"1fi0y6"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M17 19H3",key:"z6ezky"}]],aliases:["text","align-left"]};AI.node;const ZK=ge(AI);const RI={name:"text-quote",size:24,node:[["path",{d:"M17 5H3",key:"1cn7zz"}],["path",{d:"M21 12H8",key:"scolzb"}],["path",{d:"M21 19H8",key:"13qgcb"}],["path",{d:"M3 12v7",key:"1ri8j3"}]]};RI.node;const eW=ge(RI);const NI={name:"trash",size:24,node:[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],aliases:["trash-2"]};NI.node;const dj=ge(NI);const DI={name:"type",size:24,node:[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]};DI.node;const PI=ge(DI);const BI={name:"underline",size:24,node:[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]};BI.node;const tW=ge(BI);const zI={name:"undo-2",size:24,node:[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]};zI.node;const nW=ge(zI);const II={name:"unfold-horizontal",size:24,node:[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]]};II.node;const fj=ge(II);const LI={name:"unlink",size:24,node:[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]]};LI.node;const oW=ge(LI);const $I={name:"user",size:24,node:[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]};$I.node;const FI=ge($I);const HI={name:"wifi-off",size:24,node:[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]};HI.node;const sW=ge(HI);const qI={name:"x",size:24,node:[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]};qI.node;const As=ge(qI);S.createContext({container:null,dark:!1});S.createContext({expanded:!1});S.createContext(!1);S.createContext(null);S.createContext("float");S.createContext(!1);const kA=new Set;function SA(){const t=kA.size>0;for(const e of[...kA])e();return t}const iW=["keydown","keyup","keypress","pointerdown","pointerup","pointermove","mousedown","mousemove","touchstart","touchend","touchmove","wheel","paste","copy","cut","contextmenu","dblclick","compositionstart","compositionupdate","compositionend"],jA=["click","auxclick","input","change","beforeinput","focusin","focusout"],W0=["clientX","clientY","screenX","screenY","button","buttons","ctrlKey","shiftKey","altKey","metaKey","movementX","movementY","detail"],rW=["pointerId","pointerType","isPrimary","width","height","pressure","tangentialPressure","tiltX","tiltY","twist"],aW=["key","code","location","repeat","isComposing","ctrlKey","shiftKey","altKey","metaKey","keyCode","charCode","which"],lW=["deltaX","deltaY","deltaZ","deltaMode"],cW=["ctrlKey","shiftKey","altKey","metaKey"];function gl(t,e){const n={};for(const o of e)n[o]=t[o];return n}function uW(t,e){const n={bubbles:!0,cancelable:t.cancelable,composed:!1,view:e};return e.PointerEvent&&t instanceof e.PointerEvent?new e.PointerEvent(t.type,{...n,...gl(t,W0),...gl(t,rW)}):e.WheelEvent&&t instanceof e.WheelEvent?new e.WheelEvent(t.type,{...n,...gl(t,W0),...gl(t,lW)}):t instanceof e.MouseEvent?new e.MouseEvent(t.type,{...n,...gl(t,W0)}):t instanceof e.KeyboardEvent?new e.KeyboardEvent(t.type,{...n,...gl(t,aW)}):e.TouchEvent&&t instanceof e.TouchEvent?new e.TouchEvent(t.type,{...n,...gl(t,cW),touches:[...t.touches],targetTouches:[...t.targetTouches],changedTouches:[...t.changedTouches]}):e.ClipboardEvent&&t instanceof e.ClipboardEvent?new e.ClipboardEvent(t.type,{...n,clipboardData:t.clipboardData}):t instanceof e.CompositionEvent?new e.CompositionEvent(t.type,{...n,data:t.data}):null}function dW(t,e={}){const n=new Set,o=s=>s.stopPropagation();for(const s of iW)t.addEventListener(s,i=>{const r=i.composedPath(),l=r.some(h=>n.has(h));if(s==="pointerdown"&&e.onPointerDown?.(l,i),!l)return;i.stopImmediatePropagation();const u=r[0],d=uW(i,t);!d||!u||(u.dispatchEvent(d),d.defaultPrevented&&i.cancelable&&i.preventDefault())},{capture:!0,passive:!1});return{addHost(s){n.add(s);for(const i of jA)s.addEventListener(i,o);return()=>{n.delete(s);for(const i of jA)s.removeEventListener(i,o)}}}}S.createContext(!1);let CA=null;function fW(t){return CA??=dW(t,{onPointerDown(e,n){if(!e){SA();return}const o=n.composedPath()[0];(!(o instanceof t.Element)||!o.closest("[data-cds=Menu], [data-popup-open]"))&&SA()}}),CA}typeof window<"u"&&typeof document<"u"&&fW(window);const TA=t=>{let e;const n=new Set,o=(d,h)=>{const p=typeof d=="function"?d(e):d;if(!Object.is(p,e)){const g=e;e=h??(typeof p!="object"||p===null)?p:Object.assign({},e,p),n.forEach(b=>b(e,g))}},s=()=>e,l={setState:o,getState:s,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=e=t(o,s,l);return l},hW=(t=>t?TA(t):TA),pW=t=>t;function mW(t,e=pW){const n=ou.useSyncExternalStore(t.subscribe,ou.useCallback(()=>e(t.getState()),[t,e]),ou.useCallback(()=>e(t.getInitialState()),[t,e]));return ou.useDebugValue(n),n}const EA=t=>{const e=hW(t),n=o=>mW(e,o);return Object.assign(n,e),n},qt=(t=>t?EA(t):EA),cu=4e3;function gW(t,e){return e?t.map(n=>n.id===e.id?UI(n,e.status):n):t}function UI(t,e,n){if(t.status===e&&t.resolvedBy===n)return t;const{resolvedBy:o,...s}=t;return e==="resolved"&&n?{...s,status:e,resolvedBy:n}:{...s,status:e}}function yW(t){return t.wakesIdle===!1?`${t.name} gets this on its next turn: send it a message to start one`:"Waiting for the agent"}function _A(t,e){return e===!1?{title:`Sent to ${t}`,description:`${t} gets it on its next turn. If it is idle, send it a message there to start one.`}:{title:`Sent to ${t}`}}function VI(t){return t.filter(e=>e.status==="open").length}function bW(t){return t==="detached"?"What this was on is gone; shown on what held it.":t==="orphaned"?"What this was on has been deleted.":null}function wW(t){const e=t.maxThreads??500,n=t.noun??"document",o=T=>t.notify?.(T);let s=null,i,r=0;const l=qt()(T=>({available:!1,threads:[],on:!1,listOpen:!1,active:null,draft:null,showResolved:!1,sendNew:!1,draftText:"",replies:{},statusChange:null,setOn(M){T({on:M,draft:null}),t.onModeChange?.(M)},setListOpen(M){T({listOpen:M})},setActive(M){T({active:M,draft:null})},setDraft(M){T(M===null?{draft:M,active:null,draftText:"",sendNew:!1}:{draft:M,active:null})},setShowResolved(M){T({showResolved:M})},setSendNew(M){T({sendNew:M})},setDraftText(M){T({draftText:M})},setReply(M,O){T(N=>({replies:{...N.replies,[M]:O}}))}})),u=new Map,d=T=>{let M=u.get(T.anchor);return M===void 0&&(M=t.parse(T.anchor),u.size>2e3&&u.clear(),u.set(T.anchor,M)),M};let h=[];const p=(T,M)=>{h=T;const O=M&&"statusChange"in M?M.statusChange??null:l.getState().statusChange;l.setState({...M,threads:gW(T,O)})},g=T=>{o({title:"The comment could not be saved",description:T instanceof Error?T.message:String(T)})},b=T=>{p(h.map(M=>M.id===T.id?T:M)),t.heard?.([T])},w=T=>t.checkText?t.checkText(T):T.trim().slice(0,cu)||void 0,k=()=>!!s&&t.canComment(),j=()=>!!s&&t.canSendToAgent(),_={store:l,adapter:t,async start(T,M){if(!T)return;s=T;const O=r;l.setState({available:!0});try{const D=await T.list();if(O!==r)return;p(D),t.heard?.(D)}catch{}if(O!==r)return;i=T.onChange(D=>{const E=l.getState().active;p(D,{active:E&&D.some(R=>R.id===E)?E:null}),t.heard?.(D)});const N=M?l.getState().threads.find(D=>D.id===M):void 0;N&&_.reveal(N)},stop(){r+=1,i?.(),i=void 0},capability:()=>s,canComment:k,canSendToAgent:j,canRemove:()=>!!s&&(t.canRemove?t.canRemove():t.canComment()),anchorOf:d,labelOf:T=>t.label(T),stateOf:T=>t.state?.(T)??"ok",stateNote:T=>t.stateNote?t.stateNote(T??"ok"):bW(T),async create(T,M,O){if(!s)return!1;const N=w(M);if(!N)return!1;if(l.getState().threads.length>=e)return o({title:`This ${n} already has ${e} comments`}),!1;try{const D=t.detail?.(T),E=await s.create({anchor:t.serialize(T),label:t.label(T),...D!==void 0?{detail:D}:{},location:t.location?.(T)??{},text:N}),R=!!O?.send&&j();return p(h.some(B=>B.id===E.id)?h:[...h,E],{draft:null,draftText:"",sendNew:!1,active:t.opensCreated?.(R)===!1?null:E.id}),t.heard?.([E]),R&&await _.sendToAgent(E.id),!0}catch(D){return g(D),!1}},async reply(T,M,O){if(!s)return!1;const N=w(M);if(!N)return!1;try{let D=await s.reply(T,N);return D.status==="resolved"&&(D=await s.setResolved(T,!1)),b(D),l.setState(E=>{const{[T]:R,...B}=E.replies;return{replies:B}}),O?.send&&j()&&await _.sendToAgent(T),!0}catch(D){return g(D),!1}},async resolve(T,M){if(!s)return;const O=l.getState(),N=M?"resolved":"open",D=O.threads.find(R=>R.id===T);if(!D||O.statusChange||D.status===N)return;const E=M&&O.active===T&&!O.showResolved;p(h,{statusChange:{id:T,status:N},...E?{active:null}:{}});try{const R=await s.setResolved(T,M);p(h.map(B=>B.id===T?UI(B,R.status,R.resolvedBy):B),{statusChange:null}),t.heard?.([R])}catch(R){p(h,{statusChange:null}),g(R);const B=l.getState();E&&B.active===null&&B.draft===null&&h.some(I=>I.id===T)&&l.setState({active:T})}},async remove(T,M){if(!(!s||t.canRemove&&!t.canRemove()))try{await s.remove(T,M),M||p(h.filter(O=>O.id!==T),{active:l.getState().active===T?null:l.getState().active})}catch(O){g(O)}},async move(T,M){if(s)try{b(await s.move(T,t.serialize(M),t.location?.(M)))}catch(O){g(O)}},async sendToAgent(T){if(!s||!j())return!1;const M=t.sendToAgent?l.getState().threads.find(O=>O.id===T):void 0;if(t.sendToAgent)return M?t.sendToAgent(M,d(M)):!1;try{return b(await s.sendToAgent(T)),o(_A(t.agentName?.()||"the agent",t.agentWakesIdle?.())),!0}catch(O){return g(O),!1}},async sendAllToAgent(){if(!s||!j())return;const T=l.getState().threads.filter(E=>_.canSendThread(E));if(!T.length)return;if(t.sendToAgent){await Promise.all(T.map(E=>t.sendToAgent(E,d(E))));return}const M=s,O=await Promise.allSettled(T.map(E=>M.sendToAgent(E.id)));let N=0;for(const E of O)E.status==="fulfilled"&&(b(E.value),N++);N&&o(_A(t.agentName?.()||"the agent",t.agentWakesIdle?.()));const D=O.find(E=>E.status==="rejected");D&&g(D.reason)},canSendThread(T){if(T.status!=="open")return!1;const M=T.messages.at(-1);return!M||M.author.kind!=="person"?!1:!T.agent||T.agent.status==="replied"},reveal(T){t.reveal?.(d(T)),l.getState().setActive(T.id)},show(T){const M=l.getState();M.on||M.setOn(!0),T.status==="resolved"&&!l.getState().showResolved&&l.getState().setShowResolved(!0),_.reveal(T)},viewerName:()=>t.viewerName?.()||"You"};return _}function xW(){try{return/^zh\b/i.test(globalThis.navigator?.language??"")}catch{return!1}}function vW(t,e=xW()){const n=String(t??"").trim();return e?{sent:`已放进 ${n||"智能体"} 的对话:到那里发出去。`,via:"在对话里,等你发出",label:"在对话里,等你发出"}:{sent:`It is in the ${n||"agent"} conversation now: send it there.`,via:"in the conversation, for you to send",label:"In the conversation, for you to send"}}function kW(t,e,n){if(!t)return()=>{};let o=!1,s=!1;t.status().then(r=>{!o&&!s&&e(r)},()=>{});const i=t.onStatus(r=>{o||(s=!0,e(r))});return()=>{o=!0,i()}}const SW="<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><path d='M 2 26 L 2 14 A 12 12 0 1 1 14 26 Z' fill='#000' stroke='#fff' stroke-width='2'/></svg>";`${SW.replace(/[ '<>#]/g,t=>"%"+t.charCodeAt(0).toString(16).toUpperCase())}`;function jW(t,e=Date.now()){const n=Math.max(0,(e-Date.parse(t))/1e3);return Number.isFinite(n)?n<60?"just now":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:new Date(t).toLocaleDateString():""}function He(...t){return IV(t)}function CW({label:t,shortcut:e,side:n="bottom",children:o}){return y.jsxs(RB,{children:[y.jsx(PB,{render:o}),y.jsx(IB,{children:y.jsx($B,{side:n,sideOffset:6,className:"z-[1000]",children:y.jsxs(FB,{className:"rounded-md bg-fg px-2 py-1 text-xs text-surface shadow-popup data-[starting-style]:opacity-0 data-[ending-style]:opacity-0 transition-opacity",children:[t,e?y.jsx("span",{className:"ml-2 opacity-60",children:e}):null]})})})]})}function TW({children:t}){return y.jsx(HB,{delay:500,closeDelay:0,children:t})}function EW(t){return!!t.isComposing||t.keyCode===229}function _W(t){return t.repeat&&(t.key==="Enter"||t.key===" ")}function Dk(t){_W(t)&&t.target===t.currentTarget&&t.preventDefault()}function KI(t){return t?e=>{Dk(e),t(e)}:Dk}const MW=200,OW=2e3;function AW(t,e,n){let o=null,s=!1;const i=()=>{s||(s=!0,t.removeEventListener("keydown",r,!0),t.removeEventListener("keyup",r,!0),t.clearTimeout(l),o!==null&&t.clearTimeout(o))},r=u=>{const d=u.key==="Enter"||u.key===" ";if(u.type==="keyup"){u.key===" "&&!n(u.target)&&u.preventDefault(),u.key===e&&o===null&&(o=t.setTimeout(i,MW));return}d&&!n(u.target)&&(u.preventDefault(),u.stopImmediatePropagation())},l=t.setTimeout(i,OW);return t.addEventListener("keydown",r,!0),t.addEventListener("keyup",r,!0),i}const RW={primary:"bg-accent text-accent-fg hover:brightness-110 active:brightness-95",secondary:"bg-surface text-fg border border-line hover:bg-hover",ghost:"bg-transparent text-fg hover:bg-hover",danger:"bg-danger text-white hover:brightness-110"},NW={sm:"h-6 px-2 text-xs gap-1",md:"h-7 px-2.5 text-[13px] gap-1.5",lg:"h-8 px-3 text-[13px] gap-2"},Mt=S.forwardRef(function({variant:e="secondary",size:n="md",icon:o,className:s,children:i,type:r="button",onKeyDown:l,...u},d){return y.jsxs("button",{ref:d,type:r,className:He("inline-flex shrink-0 select-none items-center justify-center whitespace-nowrap rounded-control font-medium transition-[background,filter]","focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent","disabled:pointer-events-none disabled:opacity-45",RW[e],NW[n],s),...u,onKeyDown:KI(l),children:[o,i]})}),DW={sm:"size-6",md:"size-7",lg:"size-8"},PW=S.forwardRef(function({label:e,icon:n,shortcut:o,active:s,size:i="md",noTooltip:r,className:l,type:u="button",onKeyDown:d,...h},p){const g=y.jsx("button",{ref:p,type:u,"aria-label":e,"aria-pressed":s===void 0?void 0:s,className:He("inline-flex shrink-0 items-center justify-center rounded-control text-fg-muted transition-colors","hover:bg-hover hover:text-fg focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-accent","disabled:pointer-events-none disabled:opacity-40",s&&"bg-accent-soft text-accent hover:bg-accent-soft hover:text-accent",DW[i],l),...h,onKeyDown:KI(d),children:n});return r?g:y.jsx(CW,{label:e,shortcut:o,children:g})}),Pk=500,BW=8;function zW(t,e,n){return n<t.at||n-t.at>Pk?!1:Math.hypot(e.clientX-t.x,e.clientY-t.y)<=BW}const MA=["pointerdown","mousedown","pointerup","mouseup","click","dblclick"];function IW(t,e,n=Date.now){let o=!1,s=!1,i=0;const r=()=>{if(!s){s=!0,t.clearTimeout(i);for(const d of MA)t.removeEventListener(d,u,!0)}},l=()=>{o?i=t.setTimeout(l,Pk):r()},u=d=>{const h=d.type==="pointerdown"||d.type==="mousedown";!(o&&!h)&&!zW(e,d,n())||(d.preventDefault(),d.stopImmediatePropagation(),h?o=!0:(d.type==="click"||d.type==="dblclick")&&(o=!1))};for(const d of MA)t.addEventListener(d,u,!0);return i=t.setTimeout(l,Math.max(0,Pk-(n()-e.at))),r}function WI(t){t.detail<1||!t.view||IW(t.view,{x:t.clientX,y:t.clientY,at:Date.now()})}const YI=S.createContext(void 0);function ec(t){const e=S.useContext(YI);if(!t&&e===void 0)throw new Error(gn(27));return e}const LW=S.forwardRef(function(e,n){const{render:o,className:s,style:i,forceRender:r=!1,...l}=e,u=ec(),d=u.useState("open"),h=u.useState("nested"),p=u.useState("mounted"),g=u.useState("transitionStatus");return Ht("div",e,{state:{open:d,transitionStatus:g},ref:[u.context.backdropRef,n],stateAttributesMapping:Xy,props:[{role:"presentation",hidden:!p,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:r||!h})}),$W=S.forwardRef(function(e,n){const{render:o,className:s,style:i,disabled:r=!1,nativeButton:l=!0,...u}=e,d=ec(),h=d.useState("open"),{getButtonProps:p,buttonRef:g}=Fa({disabled:r,native:l}),b={disabled:r};function w(k){h&&d.setOpen(!1,ft(mP,k.nativeEvent))}return Ht("button",e,{state:b,ref:[n,g],props:[{onClick:w},u,p]})}),FW=S.forwardRef(function(e,n){const{render:o,className:s,style:i,id:r,...l}=e,u=ec(),d=ei(r);return u.useSyncedValueWithCleanup("descriptionElementId",d),Ht("p",e,{ref:n,props:[{id:d},l]})}),GI=S.createContext(void 0);function HW(){const t=S.useContext(GI);if(t===void 0)throw new Error(gn(26));return t}const qW="--nested-dialogs",UW="data-nested-dialog-open",VW={...kS,...wS,nestedDialogOpen(t){return t?{[UW]:""}:null}},KW=S.forwardRef(function(e,n){const{render:o,className:s,style:i,finalFocus:r,initialFocus:l,...u}=e,d=ec(),h=d.useState("descriptionElementId"),p=d.useState("disablePointerDismissal"),g=d.useState("floatingRootContext"),b=d.useState("popupProps"),w=d.useState("modal"),k=d.useState("mounted"),j=d.useState("nested"),C=d.useState("nestedOpenDialogCount"),_=d.useState("open"),T=d.useState("openMethod"),M=d.useState("titleElementId"),O=d.useState("transitionStatus"),N=d.useState("role"),D=g.useState("floatingId");HW(),Yu({open:_,ref:d.context.popupRef,onComplete(){_&&d.context.onOpenChangeComplete?.(!0)}});const E=l===void 0?lB(d.context.popupRef):l,R=C>0,B=d.useStateSetter("popupElement"),P=Ht("div",e,{state:{open:_,nested:j,transitionStatus:O,nestedDialogOpen:R},props:[b,{id:D,"aria-labelledby":M,"aria-describedby":h,role:N,...ib,hidden:!k,onKeyDown($){yb.has($.key)&&$.stopPropagation()},style:{[qW]:C}},u],ref:[n,d.context.popupRef,B],stateAttributesMapping:VW});return y.jsx($S,{context:g,openInteractionType:T,disabled:!k,closeOnFocusOut:!p,initialFocus:E,returnFocus:r,modal:w!==!1,restoreFocus:"popup",children:P})}),WW=S.forwardRef(function(e,n){const{keepMounted:o=!1,...s}=e,i=ec(),r=i.useState("mounted"),l=i.useState("modal"),u=i.useState("open");return r||o?y.jsx(GI.Provider,{value:o,children:y.jsxs(BS,{ref:n,...s,children:[r&&l===!0&&y.jsx(nj,{ref:i.context.internalBackdropRef,inert:wb(!u)}),e.children]})}):null});function YW({store:t,parentContext:e,isDrawer:n}){const o=t.useState("open"),s=t.useState("disablePointerDismissal"),i=t.useState("modal"),r=t.useState("popupElement"),l=t.useState("floatingRootContext"),[u,d]=S.useState(0),[h,p]=S.useState(0),g=u===0,b=ob(l,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(w){if(!t.context.outsidePressEnabledRef.current||"button"in w&&w.button!==0)return!1;if("touches"in w){if(w.type==="touchend"){if(w.changedTouches.length!==1||w.touches.length!==0)return!1}else if(w.touches.length!==1)return!1}const k=ln(w);if(g&&!s){if(i){const j=t.context.internalBackdropRef.current,C=t.context.backdropRef.current;return j||C?j===k||C===k||Ie(k,r)&&!k?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:g});return xB(o&&i===!0,r),t.useContextCallback("onNestedDialogOpen",(w,k)=>{d(w),p(k)}),Se(()=>(e?.onNestedDialogOpen&&(o?e.onNestedDialogOpen(u+1,h+(n?1:0)):e.onNestedDialogOpen(0,0)),()=>{e?.onNestedDialogOpen&&o&&e.onNestedDialogOpen(0,0)}),[n,o,u,h,e]),ub(t,{activeTriggerProps:b.reference,inactiveTriggerProps:b.trigger,popupProps:b.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:h}),null}const GW={...hb,modal:t=>t.modal,nested:t=>t.nested,nestedOpenDialogCount:t=>t.nestedOpenDialogCount,nestedOpenDrawerCount:t=>t.nestedOpenDrawerCount,disablePointerDismissal:t=>t.disablePointerDismissal,openMethod:t=>t.openMethod,descriptionElementId:t=>t.descriptionElementId,titleElementId:t=>t.titleElementId,viewportElement:t=>t.viewportElement,role:t=>t.role};class XW extends Gu{constructor(e,n,o){const s=new db,i=JW(e,s,n,o);super(i,QW(s),GW)}setOpen=(e,n)=>{n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!e&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,n),!n.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,n),this.update(ab(this.state,e,n.trigger)))}}function JW(t,e,n,o=!1){return{...fb(e,n,o),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...t}}function QW(t){return{popupRef:S.createRef(),backdropRef:S.createRef(),internalBackdropRef:S.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:t,onOpenChange:void 0,onOpenChangeComplete:void 0}}function ZW(t,e){const{children:n,open:o,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:r,disablePointerDismissal:l=!1,modal:u=!0,actionsRef:d,handle:h,triggerId:p,defaultTriggerId:g=null}=e,b=t==="drawer",w=u,k=l,j="dialog",C=ec(!0),_=C!=null,T={modal:w,disablePointerDismissal:k,nested:_,role:j},M=VS((B,I)=>new XW({open:s,openProp:o,activeTriggerId:g,triggerIdProp:p,...T},B,I),!0);M.useControlledProp("openProp",o),M.useControlledProp("triggerIdProp",p),M.useSyncedValues(T),M.useContextCallback("onOpenChange",i),M.useContextCallback("onOpenChangeComplete",r);const O=M.useState("open"),N=M.useState("mounted"),D=M.useState("payload");uB(M,O),lb(M);const{forceUnmount:E}=cb(O,M);S.useImperativeHandle(d,()=>({unmount:E,close:()=>M.setOpen(!1,ft(Wy))}),[E,M]);const R=O||N;return y.jsxs(YI.Provider,{value:M,children:[h&&y.jsx(rb,{handle:h,store:M}),R&&y.jsx(YW,{store:M,parentContext:C?.context,isDrawer:b}),typeof n=="function"?n({payload:D}):n]})}const eY=Hh(function(e){return ZW("dialog",e)}),tY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,id:r,...l}=e,u=ec(),d=ei(r);return u.useSyncedValueWithCleanup("titleElementId",d),Ht("h2",e,{ref:n,props:[{id:d},l]})}),XI=S.createContext(void 0);function Vh(t){const e=S.useContext(XI);if(e===void 0&&!t)throw new Error(gn(47));return e}const nY={...hb,disabled:t=>t.disabled,instantType:t=>t.instantType,openMethod:t=>t.openMethod,openChangeReason:t=>t.openChangeReason,modal:t=>t.modal,focusManagerModal:t=>t.focusManagerModal,stickIfOpen:t=>t.stickIfOpen,titleElementId:t=>t.titleElementId,descriptionElementId:t=>t.descriptionElementId,openOnHover:t=>t.openOnHover,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class oY extends Gu{constructor(e,n,o){const s=new db;super(sY(e,s,n,o),iY(s),nY)}setOpen=(e,n)=>{const o=n.reason===pn,s=n.reason===xr&&n.event.detail===0,i=!e&&(n.reason===$h||n.reason==null),r=KS(n),l=this.select("activeTriggerId");if(!e&&n.reason===mP&&n.trigger==null&&l!=null&&(n.trigger=this.context.triggerElements.getById(l)??this.select("activeTriggerElement")??void 0),this.context.onOpenChange?.(e,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,n);const u=()=>{const h=ab(this.state,e,n.trigger,r());h.openChangeReason=n.reason,this.update(h)};o?(this.set("stickIfOpen",!0),this.context.stickIfOpenTimeout.start(FP,()=>{this.set("stickIfOpen",!1)}),Os.flushSync(u)):u();let d;s?d="click":i?d="dismiss":n.reason===Vl&&(d="focus"),this.set("instantType",d)}}function sY(t,e,n,o=!1){const s={...fb(e,n,o),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,stickIfOpen:!0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...t};return s.open&&t?.mounted===void 0&&(s.mounted=!0),s}function iY(t){return{popupRef:S.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:S.createRef(),beforeContentFocusGuardRef:S.createRef(),stickIfOpenTimeout:new Lo,triggerElements:t}}const OA=Hh(function({props:e}){const{children:n,open:o,defaultOpen:s=!1,onOpenChange:i,onOpenChangeComplete:r,modal:l=!1,handle:u,triggerId:d,defaultTriggerId:h=null}=e,p=aY(u,{modal:l,open:s,openProp:o,activeTriggerId:h,triggerIdProp:d});p.useControlledProp("openProp",o),p.useControlledProp("triggerIdProp",d);const g=p.useState("open"),b=p.useState("mounted"),w=p.useState("payload");p.useContextCallback("onOpenChange",i),p.useContextCallback("onOpenChangeComplete",r),uB(p,g),lb(p);const{forceUnmount:k}=cb(g,p,()=>{p.update({stickIfOpen:!0,openChangeReason:null})});p.useSyncedValues({modal:l}),S.useEffect(()=>{g||p.context.stickIfOpenTimeout.clear()},[p,g]),S.useImperativeHandle(e.actionsRef,()=>({unmount:k,close:()=>p.setOpen(!1,ft(Wy))}),[k,p]);const j=g||b;return y.jsxs(XI.Provider,{value:p,children:[u&&y.jsx(rb,{handle:u,store:p}),j&&y.jsx(lY,{store:p,modal:l}),typeof n=="function"?n({payload:w}):n]})});function rY(t){return Vh(!0)?y.jsx(OA,{props:t}):y.jsx(XP,{children:y.jsx(OA,{props:t})})}function aY(t,e){const n=VS((o,s)=>new oY(e,o,s));return S.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function lY({store:t,modal:e}){const n=t.useState("floatingRootContext"),o=ob(n,{outsidePressEvent:{mouse:e==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}}),s=o.reference,i=o.floating;return ub(t,{activeTriggerProps:s,inactiveTriggerProps:s,popupProps:i}),null}const cY=300,uY=US(function(e,n){const{render:o,className:s,style:i,disabled:r=!1,nativeButton:l=!0,handle:u,payload:d,openOnHover:h=!1,delay:p=cY,closeDelay:g=0,id:b,...w}=e,k=Vh(!0),C=GS(u)??k;if(!C)throw new Error(gn(74));const _=ei(b),T=C.useState("isTriggerActive",_),M=C.useState("floatingRootContext"),O=C.useState("isOpenedByTrigger",_),N=C.useState("triggerPopupId",_),D=S.useRef(null),{registerTrigger:E,isMountedByThisTrigger:R}=WS(_,D,C,{payload:d,disabled:r,openOnHover:h,closeDelay:g}),B=C.useState("openChangeReason"),I=C.useState("stickIfOpen"),P=C.useState("openMethod"),$=C.useState("focusManagerModal"),W=pb(M,{enabled:!r&&h&&(P!=="touch"||B!==xr),mouseOnly:!0,move:!1,handleClose:gb(),restMs:p,delay:{close:g},triggerElementRef:D,isActiveTrigger:T,isClosing:()=>C.select("transitionStatus")==="ending"}),K=FS(M,{stickIfOpen:I}),F=jB(()=>C.select("open"),be=>{C.set("openMethod",be)}),q=C.useState("triggerProps",R),{getButtonProps:H,buttonRef:Y}=Fa({disabled:r,native:l}),ne={open(be){return be&&B===xr?mk.open(be):vS.open(be)}},{preFocusGuardRef:z,handlePreFocusGuardFocus:U,handleFocusTargetFocus:J}=OB(C,D),oe=Ht("button",e,{state:{disabled:r,open:O},ref:[Y,n,E,D],props:[K.reference,W,q,F,{[HP]:"",id:_,"aria-haspopup":"dialog","aria-expanded":O,"aria-controls":N},w,H],stateAttributesMapping:ne}),ie=y.jsx(S.Fragment,{children:oe},_);return R&&!$?y.jsxs(S.Fragment,{children:[y.jsx(vr,{ref:z,onFocus:U}),ie,y.jsx(vr,{ref:C.context.triggerFocusTargetRef,onFocus:J})]}):ie}),JI=S.createContext(void 0);function dY(){const t=S.useContext(JI);if(t===void 0)throw new Error(gn(45));return t}const fY=S.forwardRef(function(e,n){const{keepMounted:o=!1,...s}=e;return Vh().useState("mounted")||o?y.jsx(JI.Provider,{value:o,children:y.jsx(BS,{ref:n,...s})}):null}),QI=S.createContext(void 0);function hY(){const t=S.useContext(QI);if(!t)throw new Error(gn(46));return t}const pY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,anchor:r,positionMethod:l,side:u,align:d,sideOffset:h,alignOffset:p,collisionBoundary:g="clipping-ancestors",collisionPadding:b,arrowPadding:w,sticky:k,disableAnchorTracking:j=!1,collisionAvoidance:C=PS,..._}=e,T=Vh(),M=dY(),O=IS(),N=T.useState("floatingRootContext"),D=T.useState("mounted"),E=T.useState("open"),R=T.useState("openChangeReason"),B=T.useState("activeTriggerElement"),I=T.useState("modal"),P=T.useState("openMethod"),$=T.useState("positionerElement"),W=T.useState("instantType"),K=T.useState("transitionStatus"),F=T.useState("adaptiveOrigin"),q=S.useRef(null),H=Gy($),Y=tj({anchor:r,floatingRootContext:N,positionMethod:l,mounted:D,side:u,sideOffset:h,align:d,alignOffset:p,arrowPadding:w,collisionBoundary:g,collisionPadding:b,sticky:k,disableAnchorTracking:j,keepMounted:M,nodeId:O,collisionAvoidance:C,adaptiveOrigin:F}),ne=N.useState("domReferenceElement");Se(()=>{const oe=ne,ie=q.current;if(oe&&(q.current=oe),ie&&oe&&oe!==ie){T.set("instantType",void 0);const be=new AbortController;return H(()=>{T.set("instantType","trigger-change")},be.signal),()=>{be.abort()}}},[ne,H,T]);const z=I===!0&&R!==pn;vB(E&&z,P==="touch",$,B);const U=T.useStateSetter("positionerElement"),J={open:E,side:Y.side,align:Y.align,anchorHidden:Y.anchorHidden,instant:W},X=oj(e,J,{styles:Y.positionerStyles,transitionStatus:K,props:_,refs:[n,U],hidden:!D,inert:!E});return y.jsxs(QI.Provider,{value:Y,children:[D&&z&&y.jsx(nj,{inert:wb(!E),cutout:B}),y.jsx(GP,{id:O,children:X})]})}),mY=S.createContext(void 0);function gY(){const[t,e]=S.useState(0),n=De(()=>(e(s=>s+1),()=>{e(s=>Math.max(0,s-1))}));return{context:S.useMemo(()=>({register:n}),[n]),hasClosePart:t>0}}const yY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,initialFocus:r,finalFocus:l,...u}=e,d=Vh(),h=hY(),p=ZS()!=null,{context:g,hasClosePart:b}=gY(),w=d.useState("open"),k=d.useState("openMethod"),j=d.useState("instantType"),C=d.useState("transitionStatus"),_=d.useState("popupProps"),T=d.useState("titleElementId"),M=d.useState("descriptionElementId"),O=d.useState("modal"),N=d.useState("mounted"),D=d.useState("openChangeReason"),E=d.useState("activeTriggerElement"),R=d.useState("floatingRootContext"),B=R.useState("floatingId"),I=d.useState("disabled"),P=d.useState("openOnHover"),$=d.useState("closeDelay");Yu({open:w,ref:d.context.popupRef,onComplete(){w&&d.context.onOpenChangeComplete?.(!0)}}),QS(R,{enabled:P&&!I,closeDelay:$});const W=r===void 0?lB(d.context.popupRef):r,K=O!==!1&&b;d.useSyncedValue("focusManagerModal",K);const F=d.useStateSetter("popupElement"),q={open:w,side:h.side,align:h.align,instant:j,transitionStatus:C},H=Ht("div",e,{state:q,ref:[n,d.context.popupRef,F],props:[_,{id:B,role:"dialog",...ib,"aria-labelledby":T,"aria-describedby":M,onKeyDown(Y){p&&yb.has(Y.key)&&Y.stopPropagation()}},bb(C),u],stateAttributesMapping:Xy});return y.jsx($S,{context:R,openInteractionType:k,modal:K,disabled:!N||D===pn,initialFocus:W,returnFocus:l,restoreFocus:"popup",previousFocusableElement:Ft(E)?E:void 0,nextFocusableElement:d.context.triggerFocusTargetRef,beforeContentFocusGuardRef:d.context.beforeContentFocusGuardRef,children:y.jsx(mY.Provider,{value:g,children:H})})});function Ka({open:t,onOpenChange:e,title:n,description:o,children:s,footer:i,className:r}){return y.jsx(eY,{open:t,onOpenChange:l=>e(l),children:y.jsxs(WW,{children:[y.jsx(LW,{className:"fixed inset-0 z-[900] bg-black/30 transition-opacity data-[starting-style]:opacity-0 data-[ending-style]:opacity-0"}),y.jsxs(KW,{className:He("fixed left-1/2 top-1/2 z-[901] w-[min(28rem,calc(100vw-2rem))] -translate-x-1/2 -translate-y-1/2 rounded-xl bg-surface p-5 text-fg shadow-popup outline-none","transition-[opacity,transform] data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",r),children:[y.jsxs("div",{className:"mb-3 flex items-start gap-3",children:[y.jsxs("div",{className:"flex-1",children:[y.jsx(tY,{className:"text-[15px] font-semibold",children:n}),o?y.jsx(FW,{className:"mt-1 text-fg-muted",children:o}):null]}),y.jsx($W,{"aria-label":"Close",className:"rounded-md p-1 text-fg-muted hover:bg-hover",children:y.jsx(As,{className:"size-4"})})]}),s,i?y.jsx("div",{className:"mt-4 flex justify-end gap-2",children:i}):null]})]})})}function Jf({open:t,onOpenChange:e,title:n,description:o,confirmLabel:s="Confirm",danger:i,onConfirm:r}){return y.jsx(Ka,{open:t,onOpenChange:e,title:n,description:o,footer:y.jsxs(y.Fragment,{children:[y.jsx(Mt,{onClick:()=>e(!1),children:"Cancel"}),y.jsx(Mt,{variant:i?"danger":"primary",onClick:()=>{r(),e(!1)},children:s})]})})}const ZI=S.createContext(void 0);function bY(){const t=S.useContext(ZI);if(t===void 0)throw new Error(gn(63));return t}const wY="data-checked",xY="data-unchecked",eL={..._q,checked(t){return t?{[wY]:""}:{[xY]:""}}},vY=S.forwardRef(function(e,n){const{checked:o,className:s,defaultChecked:i,"aria-labelledby":r,form:l,id:u,inputRef:d,name:h,nativeButton:p=!1,onCheckedChange:g,readOnly:b=!1,required:w=!1,disabled:k=!1,render:j,uncheckedValue:C,value:_,style:T,...M}=e,{clearErrors:O}=e7(),{state:N,setTouched:D,setDirty:E,validityData:R,setFilled:B,setFocused:I,validationMode:P,disabled:$,name:W,validation:K}=fP(),{labelId:F}=hP(),q=$||k,H=W??h,Y=S.useRef(null),ne=Ra(Y,d,K.inputRef),z=S.useRef(null),U=ei(),J=i7({id:u}),X=p?void 0:J,[oe,ie]=lS({controlled:o,default:!!i,name:"Switch",state:"checked"});Qq(z,U,oe,void 0,!q,h),Se(()=>{B(oe)},[oe,B]),gP(oe,()=>{O(H),E(oe!==R.initialValue),K.change(oe)});const{getButtonProps:be,buttonRef:ce}=Fa({disabled:q,native:p}),ye=n7(r,F,Y,!p,X),Ce={id:p?J:U,role:"switch","aria-checked":oe,"aria-readonly":b||void 0,"aria-required":w||void 0,"aria-labelledby":ye,onFocus(){q||I(!0)},onBlur(){const Oe=Y.current;!Oe||q||(D(!0),I(!1),P==="onBlur"&&K.commit(Oe.checked))},onClick(Oe){if(b||q)return;Oe.preventDefault();const Fe=Y.current;Fe&&Tf(Fe,Oe)}},Ve={...K.getValidationProps(q),checked:oe,disabled:q,form:l,id:X,name:H,required:w,style:H?bq:cS,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:ne,onChange(Oe){if(Oe.nativeEvent.defaultPrevented)return;if(b){Oe.preventDefault();return}const Fe=Oe.currentTarget.checked,nt=ft(Lh,Oe.nativeEvent);g?.(Fe,nt),!nt.isCanceled&&ie(Fe)},onClick(Oe){Oe.stopPropagation()},onFocus(){z.current?.focus()},..._!==void 0?{value:_}:nn},Me=S.useMemo(()=>({...N,checked:oe,disabled:q,readOnly:b,required:w}),[N,oe,q,b,w]),je=Ht("span",e,{state:Me,ref:[n,z,ce],props:[Ce,M,be,Oe=>K.getValidationProps(q,Oe)],stateAttributesMapping:eL});return y.jsxs(ZI.Provider,{value:Me,children:[je,!oe&&H&&C!==void 0&&y.jsx("input",{type:"hidden",form:l,name:H,value:C,disabled:q}),y.jsx("input",{...Ve,suppressHydrationWarning:!0})]})}),kY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,...r}=e,l=bY();return Ht("span",e,{state:l,ref:n,stateAttributesMapping:eL,props:r})}),tL="data-composite-item-active";function SY(t){const{loopFocus:e=!0,orientation:n="both",grid:o,onLoop:s,direction:i,highlightedIndex:r,onHighlightedIndexChange:l,rootRef:u,enableHomeAndEndKeys:d=!1,stopEventPropagation:h,disabledIndices:p,modifierKeys:g=br}=t,[b,w]=S.useState(0),k=o!=null,j=S.useRef(null),C=Ra(j,u),_=S.useRef([]),T=S.useRef(!1),M=S.useRef(null),O=r??b,N=De((I,P=!1)=>{if(M.current=_.current[I]??null,(l??w)(I),P){const $=_.current[I];uA(j.current,$,i,n)}}),D=De(I=>{if(I.size===0)return;if(T.current){const K=_.current,F=K.indexOf(M.current);if(F===-1){const q=K[O];!q||ru(K,O,p)?N(jY(K,p)):M.current=q}else F!==O&&N(F);return}T.current=!0;const P=Array.from(I.keys()),$=P.find(K=>K?.hasAttribute(tL))??null,W=$?I.get($)?.index??-1:-1;if(W!==-1)N(W);else if(ru(P,O,p)){const K=ir(P,{disabledIndices:p});Ef(P,K)||N(K)}uA(j.current,$,i,n)});Se(()=>{if(p==null||r!=null||!T.current)return;const I=_.current;if(ru(I,O,p)){const P=ir(I,{disabledIndices:p});Ef(I,P)||N(P)}},[p,r,O,_,N]);const E=De((I,P,$)=>s?s(I,P,$,_):$),R=De(I=>{const P=I.key===Ak||I.key===Rk;if(!yb.has(I.key)||!d&&P||CY(I,g)||!j.current)return;const W=i==="rtl",K=W?Mk:Ok,F=W?Ok:Mk,q=n==="vertical"?_k:K,H=n==="vertical"?Ek:F,Y=ln(I.nativeEvent);if(Y!=null&&cA(Y)&&!CV(Y)){const oe=Y.selectionStart,ie=Y.selectionEnd,be=Y.value;if(oe==null||I.shiftKey||oe!==ie||I.key!==H&&oe<be.length||I.key!==q&&oe>0)return}let ne=O;const z=bg(_,p),U=kk(_,p);o!=null&&(ne=o({disabledIndices:p,elementsRef:_,event:I,highlightedIndex:O,loopFocus:e,maxIndex:U,minIndex:z,onLoop:E,orientation:n,rtl:W}));const J=n!=="vertical"&&I.key===K||n!=="horizontal"&&I.key===_k,X=n!=="vertical"&&I.key===F||n!=="horizontal"&&I.key===Ek;d&&(I.key===Ak?ne=z:I.key===Rk&&(ne=U)),ne===O&&(J||X)&&(e&&ne===U&&J?(ne=z,s&&(ne=s(I,O,ne,_))):e&&ne===z&&X?(ne=U,s&&(ne=s(I,O,ne,_))):ne=ir(_.current,{startingIndex:ne,decrement:X,disabledIndices:p})),ne!==O&&!Ef(_.current,ne)&&(h&&I.stopPropagation(),(k||P||J||X)&&I.preventDefault(),N(ne,!0),queueMicrotask(()=>{_.current[ne]?.focus()}))});return{props:{ref:C,onFocus(I){const P=j.current,$=ln(I.nativeEvent);!P||$==null||!cA($)||$.setSelectionRange(0,$.value.length)},onKeyDown:R},highlightedIndex:O,onHighlightedIndexChange:N,elementsRef:_,onMapChange:D,relayKeyboardEvent:R}}function jY(t,e){let n=-1;for(let o=0;o<t.length;o+=1){const s=t[o];if(!(!s||ru(t,o,e))){if(s.hasAttribute(tL))return o;n===-1&&(n=o)}}return Math.max(n,0)}function CY(t,e){for(const n of B9)if(!e.includes(n)&&t.getModifierState(n))return!0;return!1}function TY(t){const{render:e,className:n,style:o,refs:s=br,props:i=br,state:r=nn,stateAttributesMapping:l,highlightedIndex:u,onHighlightedIndexChange:d,orientation:h,grid:p,loopFocus:g,onLoop:b,enableHomeAndEndKeys:w,onMapChange:k,stopEventPropagation:j=!0,rootRef:C,disabledIndices:_,modifierKeys:T,highlightItemOnHover:M=!1,tag:O="div",...N}=t,D=ej(),{props:E,highlightedIndex:R,onHighlightedIndexChange:B,elementsRef:I,onMapChange:P,relayKeyboardEvent:$}=SY({grid:p,loopFocus:g,onLoop:b,orientation:h,highlightedIndex:u,onHighlightedIndexChange:d,rootRef:C,stopEventPropagation:j,enableHomeAndEndKeys:w,direction:D,disabledIndices:_,modifierKeys:T}),W=Ht(O,t,{state:r,ref:s,props:[E,...i,N],stateAttributesMapping:l}),K=S.useMemo(()=>({highlightedIndex:R,onHighlightedIndexChange:B,highlightItemOnHover:M,relayKeyboardEvent:$}),[R,B,M,$]);return y.jsx(dP.Provider,{value:K,children:y.jsx(bB,{elementsRef:I,onMapChange:F=>{k?.(F),P(F)},children:W})})}const EY=S.createContext(void 0);function _Y(){return S.useContext(EY)}const nL=S.createContext(void 0);function MY(){return S.useContext(nL)}const OY=S.forwardRef(function(e,n){const{defaultValue:o,disabled:s=!1,loopFocus:i=!0,onValueChange:r,orientation:l="horizontal",multiple:u=!1,value:d,className:h,render:p,style:g,...b}=e,w=ZS(),k=_Y(),j=o??br,C=d!==void 0||o!==void 0,_=(w?.disabled??!1)||(k?.disabled??!1)||s,[T,M]=lS({controlled:d,default:j,name:"ToggleGroup",state:"value"}),O=De((B,I,P)=>{let $;u?($=T.slice(),I?$.push(B):$.splice(T.indexOf(B),1)):$=I?[B]:[],r?.($,P),!P.isCanceled&&M($)}),N={disabled:_,multiple:u,orientation:l},D=S.useMemo(()=>({disabled:_,setGroupValue:O,value:T,isValueInitialized:C}),[_,O,T,C]),E={role:"group"},R=Ht("div",e,{enabled:!!w,state:N,ref:n,props:[E,b]});return y.jsx(nL.Provider,{value:D,children:w?R:y.jsx(TY,{render:p,className:h,style:g,state:N,refs:[n],props:[E,b],loopFocus:i,enableHomeAndEndKeys:!0,orientation:l})})}),AY=S.forwardRef(function(e,n){const{className:o,defaultPressed:s=!1,disabled:i=!1,form:r,onPressedChange:l,pressed:u,render:d,type:h,value:p,nativeButton:g=!0,style:b,...w}=e,k=ei(p||void 0),j=MY(),C=j?.value??[],_=(i||j?.disabled)??!1,[T,M]=lS({controlled:j?k!==void 0&&C.indexOf(k)>-1:u,default:s,name:"Toggle",state:"pressed"}),{getButtonProps:O,buttonRef:N}=Fa({disabled:_,native:g}),D={disabled:_,pressed:T},E=[N,n],R=[{"aria-pressed":T,onClick(P){const $=!T,W=ft(Lh,P.nativeEvent);l?.($,W),!W.isCanceled&&(k&&j?.setGroupValue?.(k,$,W),!W.isCanceled&&M($))}},w,O],B=Ht("button",e,{enabled:!j,state:D,ref:E,props:R}),I=S.useMemo(()=>({disabled:_,focusableWhenDisabled:!1}),[_]);return j?y.jsx(_B,{tag:"button",render:d,className:o,style:b,metadata:I,state:D,refs:E,props:R}):B}),RY="h-7 w-full min-w-0 rounded-control border border-line bg-surface-2 px-2 text-[13px] text-fg outline-none placeholder:text-fg-subtle focus:border-accent focus:bg-surface",AA=S.forwardRef(function({className:e,...n},o){return y.jsx("input",{ref:o,"data-ui-field":"",className:He(RY,e),...n})});function NY({value:t,options:e,onChange:n,onRepick:o,className:s,...i}){return y.jsx(OY,{value:t===null?[]:[t],onValueChange:r=>{const l=r[0];l!==void 0?n(l):t!==null&&o?.(t)},"aria-label":i["aria-label"],"data-ui-field":"",className:He("flex h-7 items-center gap-0.5 rounded-control bg-surface-2 p-0.5",s),children:e.map(r=>y.jsx(AY,{value:r.value,"aria-label":r.title,title:r.title,className:"flex h-full flex-1 items-center justify-center whitespace-nowrap rounded-[4px] px-1.5 text-fg-muted outline-none hover:text-fg data-[pressed]:bg-surface data-[pressed]:text-fg data-[pressed]:shadow-sm focus-visible:outline-2 focus-visible:outline-accent",children:r.label},r.value))})}function oL({checked:t,onChange:e,disabled:n,...o}){return y.jsx(vY,{checked:t,disabled:n,onCheckedChange:s=>e(s),onKeyDown:Dk,"aria-label":o["aria-label"],className:"relative inline-flex h-4 w-7 shrink-0 items-center rounded-full bg-line-strong p-0.5 transition-colors data-[checked]:bg-accent disabled:opacity-40",children:y.jsx(kY,{className:"size-3 rounded-full bg-white shadow transition-transform data-[checked]:translate-x-3"})})}function DY(t,e){const n=on(t).getComputedStyle(t).transform;let o=0,s=0,i=1;if(n&&n!=="none"){const r=n.match(/matrix(?:3d)?\(([^)]+)\)/);if(r){const l=r[1].split(", ").map(parseFloat);l.length===6?(o=l[4],s=l[5],i=Math.sqrt(l[0]*l[0]+l[1]*l[1])):l.length===16&&(o=l[12],s=l[13],i=l[0])}}return{x:o,y:s,scale:i}}const sL=S.createContext(void 0);function jb(){const t=S.useContext(sL);if(!t)throw new Error(gn(73));return t}let RA=0;function iL(t){return RA+=1,`${t}-${Math.random().toString(36).slice(2,6)}-${RA}`}function Y0(t,e){if(typeof t=="string")return{description:t};if(typeof t=="function"){const n=t(e);return typeof n=="string"?{description:n}:n}return t}function G0(t){const e=new Map;let n=0,o=0;return t.forEach((s,i)=>{const r=s.transitionStatus==="ending";e.set(s.id,{value:s,domIndex:i,visibleIndex:r?-1:n,offsetY:o}),o+=s.height||0,r||(n+=1)}),e}function X0(t,e){let n=0;return t.map(o=>{if(o.transitionStatus==="ending")return o;const s=n>=e;return n+=1,o.limited===s?o:{...o,limited:s}})}const Hs={toasts:t=>t.toasts,isEmpty:t=>t.toasts.length===0,toast:(t,e)=>t.toastMetadata.get(e)?.value,toastIndex:(t,e)=>t.toastMetadata.get(e)?.domIndex??-1,toastOffsetY:(t,e)=>t.toastMetadata.get(e)?.offsetY??0,toastVisibleIndex:(t,e)=>t.toastMetadata.get(e)?.visibleIndex??-1,focused:t=>t.focused,expanded:t=>t.hovering||t.focused,expandedOrOutOfFocus:t=>t.hovering||t.focused||!t.isWindowFocused,prevFocusElement:t=>t.prevFocusElement};class PY extends Gu{timers=new Map;areTimersPaused=!1;constructor(e){super({...e,toastMetadata:G0(e.toasts)},{},Hs)}setViewport=e=>{this.set("viewport",e)};syncProviderProps(e,n){const o=this.state.limit!==n;if(this.state.timeout===e&&!o)return;const s={timeout:e,limit:n};if(o){const i=X0(this.state.toasts,n);s.toasts=i,s.toastMetadata=G0(i)}this.update(s)}disposeEffect=()=>()=>{this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear()};removeToast(e,n=!1){const o=Hs.toastIndex(this.state,e);if(o===-1)return;const s=this.state.toasts[o];n||s?.onRemove?.();const i=[...this.state.toasts];i.splice(o,1),this.setToasts(i)}addToast=e=>{const{timeout:n,limit:o}=this.state,s=e.id||iL("toast");if(e.id){const u=Hs.toast(this.state,e.id);if(u)if(u.transitionStatus==="ending")this.removeToast(e.id,!0);else{const{id:d,transitionStatus:h,...p}=e;return this.updateToastInternal(e.id,p,!0,!0),e.id}}const i={...e,id:s,updateKey:0,transitionStatus:"starting"},r=[i,...this.state.toasts];this.setToasts(X0(r,o));const l=i.timeout??n;return i.type!=="loading"&&l>0&&this.scheduleTimer(s,l,()=>this.closeToast(s)),Hs.expandedOrOutOfFocus(this.state)&&this.pauseTimers(),s};updateToast=(e,n)=>{const o=Hs.toast(this.state,e);!o||o.transitionStatus==="ending"||this.updateToastInternal(e,typeof n=="function"?n(o):n,!1,!0)};updateToastInternal=(e,n,o=!1,s=!1)=>{const{timeout:i,toasts:r}=this.state,l=Hs.toast(this.state,e);if(!l||l.transitionStatus==="ending")return;const u={...l,...n,...s&&{updateKey:l.updateKey+1}};this.setToasts(r.map(j=>j.id===e?u:j));const d=u.timeout??i,h=l.timeout??i,p=Object.hasOwn(n,"timeout"),g=u.transitionStatus!=="ending"&&u.type!=="loading"&&d>0,b=this.timers.has(e),w=h!==d,k=l.type==="loading";if(!g&&b){this.clearTimer(e);return}g&&(!b||w||p||k||o)&&(this.clearTimer(e),this.scheduleTimer(e,d,()=>this.closeToast(e)),Hs.expandedOrOutOfFocus(this.state)&&this.pauseTimers())};closeToast=e=>{const n=e===void 0,{limit:o,toasts:s}=this.state;let i;if(n)i=s,this.clearTimers();else{const u=Hs.toast(this.state,e);if(!u)return;i=[u],this.clearTimer(e)}const r=s.map(u=>n||u.id===e?{...u,transitionStatus:"ending",height:0}:u),l=X0(r,o);this.setToasts(l,!l.some(u=>u.transitionStatus!=="ending")),i.forEach(u=>{u.transitionStatus!=="ending"&&u.onClose?.()}),this.handleFocusManagement(e)};promiseToast=(e,n)=>{const o=Y0(n.loading),s=this.addToast({...o,type:"loading"}),i=e.then(r=>{const l=Y0(n.success,r);return this.updateToast(s,{...l,type:"success",timeout:l.timeout}),r}).catch(r=>{const l=Y0(n.error,r);return this.updateToast(s,{...l,type:"error",timeout:l.timeout}),Promise.reject(r)});return{}.hasOwnProperty.call(n,"setPromise")&&n.setPromise(i),i};pauseTimers(){this.areTimersPaused||(this.areTimersPaused=!0,this.timers.forEach(e=>{e.timeout&&(e.timeout.clear(),e.remaining=Math.max(e.remaining-(Date.now()-e.start),0))}))}resumeTimers(){this.areTimersPaused&&(this.areTimersPaused=!1,this.timers.forEach((e,n)=>{e.remaining=e.remaining>0?e.remaining:e.delay,e.timeout??=Lo.create(),e.timeout.start(e.remaining,()=>{this.handleTimerFired(n),e.callback()}),e.start=Date.now()}))}restoreFocusToPrevElement(){this.state.prevFocusElement?.focus({preventScroll:!0})}handleDocumentPointerDown=e=>{if(e.pointerType!=="touch")return;const n=ln(e);Ie(this.state.viewport,n)||(this.resumeTimers(),this.update({hovering:!1,focused:!1}))};scheduleTimer(e,n,o){const s=Date.now(),r=!Hs.expandedOrOutOfFocus(this.state)?Lo.create():void 0;r?.start(n,()=>{this.handleTimerFired(e),o()}),this.timers.set(e,{timeout:r,start:s,delay:n,remaining:n,callback:o})}clearTimers(){this.timers.forEach(e=>{e.timeout?.clear()}),this.timers.clear(),this.areTimersPaused=!1}clearTimer(e){this.timers.get(e)?.timeout?.clear(),this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}handleTimerFired(e){this.timers.delete(e),this.resetPausedStateIfNoTimersRemain()}resetPausedStateIfNoTimersRemain(){this.timers.size===0&&(this.areTimersPaused=!1)}setToasts(e,n=e.length===0){const o={toasts:e,toastMetadata:G0(e)};n&&(o.hovering=!1,o.focused=!1),this.update(o)}handleFocusManagement(e){const n=Nn(yt(this.state.viewport));if(!this.state.viewport||!Ie(this.state.viewport,n)||!Vg(n))return;if(e===void 0){this.restoreFocusToPrevElement();return}const o=Hs.toasts(this.state),s=Hs.toastIndex(this.state,e),i=(l,u)=>{for(let d=l;d>=0&&d<o.length;d+=u)if(o[d].transitionStatus!=="ending")return o[d];return null},r=i(s+1,1)??i(s-1,-1);r?r.ref?.current?.focus():this.restoreFocusToPrevElement()}}const BY=function(e){const{children:n,timeout:o=5e3,limit:s=3,toastManager:i}=e,r=qn(()=>new PY({timeout:o,limit:s,viewport:null,toasts:[],hovering:!1,focused:!1,isWindowFocused:!0,prevFocusElement:null})).current;return Yy(r.disposeEffect),S.useEffect(function(){return i?i[" subscribe"](({action:d,options:h})=>{const p=h.id;d==="promise"&&h.promise?r.promiseToast(h.promise,h):d==="update"&&p?r.updateToast(p,h.updates):d==="close"?r.closeToast(p):r.addToast(h)}):void 0},[r,i]),y.jsxs(sL.Provider,{value:r,children:[y.jsx(zY,{store:r,timeout:o,limit:s}),n]})};function zY(t){const{store:e,timeout:n,limit:o}=t;return Se(()=>{e.syncProviderProps(n,o)},[e,n,o]),null}const IY="--toast-frontmost-height",LY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,children:r,...l}=e,u=jb(),d=co(),h=S.useRef(!1),p=S.useRef(!1),g=S.useRef(!1),b=u.useState("isEmpty"),w=u.useState("toasts"),k=u.useState("focused"),j=u.useState("expanded"),C=u.useState("prevFocusElement"),_=w[0]?.height,T=w.some(Y=>Y.transitionStatus==="ending"),M=w.filter(Y=>Y.priority==="high");S.useEffect(()=>{const Y=u.state.viewport;if(!Y||b)return;const ne=on(Y),z=yt(Y);function U(oe){oe.key==="F6"&&ln(oe)!==Y&&(oe.preventDefault(),u.set("prevFocusElement",Nn(z)),Y?.focus({preventScroll:!0}),u.pauseTimers(),u.set("focused",!0))}function J(oe){ln(oe)===ne&&(u.set("isWindowFocused",!1),u.pauseTimers())}function X(oe){if(oe.relatedTarget)return;const ie=ln(oe),be=Nn(yt(Y));(ie===ne||!Ie(Y,ie)||!Vg(be))&&u.resumeTimers(),d.start(0,()=>u.set("isWindowFocused",!0))}return Ys(st(ne,"keydown",U),st(ne,"blur",J,!0),st(ne,"focus",X,!0),st(z,"pointerdown",u.handleDocumentPointerDown,!0))},[u,d,b]);function O(Y){h.current=!0;const ne=Y.relatedTarget===u.state.viewport?w.find(z=>z.transitionStatus!=="ending"&&!z.limited):void 0;ne?ne.ref?.current?.focus():u.restoreFocusToPrevElement()}function N(Y){Y.key==="Tab"&&Y.shiftKey&&ln(Y.nativeEvent)===u.state.viewport&&(Y.preventDefault(),u.restoreFocusToPrevElement())}function D(){u.state.toasts.some(ne=>ne.transitionStatus==="ending")||g.current||!p.current||(u.state.isWindowFocused&&u.resumeTimers(),u.set("hovering",!1),p.current=!1)}S.useEffect(D,[T,u]);function E(){u.pauseTimers(),u.set("hovering",!0),p.current=!1}function R(){u.state.isWindowFocused&&u.resumeTimers()}function B(){p.current=!0,D()}function I(Y){Y.pointerType==="touch"&&(g.current=!0)}function P(Y){Y.pointerType==="touch"&&(g.current=!1,D())}function $(){if(h.current){h.current=!1;return}k||Vg(Nn(yt(u.state.viewport)))&&(u.set("focused",!0),u.pauseTimers())}function W(Y){!k||Ie(u.state.viewport,Y.relatedTarget)||(u.set("focused",!1),R())}const K={tabIndex:-1,role:"region","aria-live":"polite","aria-atomic":!1,"aria-relevant":"additions text","aria-label":"Notifications",onMouseEnter:E,onMouseMove:E,onMouseLeave:B,onFocus:$,onBlur:W,onKeyDown:N,onClick:$,onPointerDown:I,onPointerUp:P,onPointerCancel:P,style:{[IY]:_?`${_}px`:void 0}},F={expanded:j},q=!b&&C&&y.jsx(vr,{onFocus:O}),H=Ht("div",e,{ref:[n,u.setViewport],state:F,props:[K,l,{children:y.jsxs(S.Fragment,{children:[q,r,q]})}]});return y.jsxs(S.Fragment,{children:[q,H,!k&&M.length>0&&y.jsx("div",{style:cS,children:M.map(Y=>y.jsxs("div",{role:"alert","aria-atomic":!0,children:[y.jsx("div",{children:Y.title}),y.jsx("div",{children:Y.description})]},Y.id))})]})}),rL=S.createContext(void 0);function Cb(){const t=S.useContext(rL);if(!t)throw new Error(gn(66));return t}function J0(t,e,n){switch(t){case"up":return-n;case"down":return n;case"left":return-e;case"right":return e;default:return 0}}const $Y="--toast-index",FY="--toast-offset-y",HY="--toast-height",qY="--toast-swipe-movement-x",UY="--toast-swipe-movement-y",VY="data-swipe-direction",KY={...wS,swipeDirection(t){return t?{[VY]:t}:null}},NA=40,WY=10,DA=.5,YY=1,GY=`${fU},${hU}`,XY=S.forwardRef(function(e,n){const{toast:o,render:s,className:i,swipeDirection:r=["down","right"],style:l,...u}=e,d=o.positionerProps?.anchor!==void 0;let h=[];d||(h=Array.isArray(r)?r:[r]);const p=h.length>0,g=jb(),[b,w]=S.useState(void 0),[k,j]=S.useState(!1),[C,_]=S.useState(!1),[T,M]=S.useState({x:0,y:0}),[O,N]=S.useState({x:0,y:0,scale:1}),[D,E]=S.useState(),[R,B]=S.useState(),[I,P]=S.useState(null),$=S.useRef(null),W=S.useRef(void 0),K=S.useRef({x:0,y:0}),F=S.useRef({x:0,y:0,scale:1}),q=S.useRef(void 0),H=S.useRef(0),Y=S.useRef(!1),ne=S.useRef({x:0,y:0}),z=S.useRef(!1),U=S.useRef({x:0,y:0}),J=S.useRef(null),X=S.useRef(null),oe=g.useState("toastIndex",o.id),ie=g.useState("toastVisibleIndex",o.id),be=g.useState("toastOffsetY",o.id),ce=g.useState("focused"),ye=g.useState("expanded");Yu({open:o.transitionStatus!=="ending",ref:$,onComplete(){o.transitionStatus==="ending"&&g.removeToast(o.id)}});const Ce=De((Be=!1)=>{const fe=$.current;if(!fe)return;const xe=fe.style.height;fe.style.height="auto";const pe=fe.offsetHeight;fe.style.height=xe;function re(){g.updateToastInternal(o.id,{ref:$,height:pe,transitionStatus:void 0})}Be?Os.flushSync(re):re()});Se(()=>{const Be=W.current;o.transitionStatus!=="starting"&&Be===o.id||(Be!==void 0&&(w(void 0),N({x:0,y:0,scale:1}),Ve({x:0,y:0})),W.current=o.id,Ce())},[Ce,o.id,o.transitionStatus]);function Ve(Be){U.current=Be,M(Be)}Se(()=>()=>{X.current?.abort()},[]);function Me(Be,fe){const xe=ve=>ve>0?ve**DA:-(Math.abs(ve)**DA),pe=Be>0&&!h.includes("right")||Be<0&&!h.includes("left"),re=fe>0&&!h.includes("down")||fe<0&&!h.includes("up");return{x:pe?xe(Be):Be,y:re?xe(fe):fe}}const je=De(Be=>{if(Be.pointerId!==J.current)return;J.current=null,X.current?.abort(),X.current=null,j(!1),_(!1),P(null);const fe=F.current;if(Be.type==="pointercancel"||Y.current){Ve({x:fe.x,y:fe.y}),w(void 0);return}const xe=U.current,pe=xe.x-fe.x,re=xe.y-fe.y;let ve;for(const Ze of h)if(J0(Ze,pe,re)>NA){ve=Ze;break}ve?(w(ve),g.closeToast(o.id)):(Ve({x:fe.x,y:fe.y}),w(void 0))});function Oe(Be){if(Be.button!==0||(Be.pointerType==="touch"&&g.pauseTimers(),ln(Be.nativeEvent)?.closest(`button,a,input,textarea,[role="button"],${GY}`)))return;Y.current=!1,q.current=void 0,H.current=0,J.current=Be.pointerId,K.current={x:Be.clientX,y:Be.clientY},ne.current=K.current;const pe=Be.currentTarget,re=DY(pe);F.current=re,N(re),Ve({x:re.x,y:re.y}),g.set("hovering",!0),j(!0),_(!1),P(null),z.current=!0,X.current?.abort();const ve=new AbortController;X.current=ve;const Ze=yt(pe);Ze.addEventListener("pointerup",je,{signal:ve.signal}),Ze.addEventListener("pointercancel",je,{signal:ve.signal}),pe.setPointerCapture?.(Be.pointerId)}function Fe(Be){if(Be.pointerId!==J.current)return;Be.preventDefault(),z.current&&(K.current={x:Be.clientX,y:Be.clientY},z.current=!1);const{clientY:fe,clientX:xe,movementX:pe,movementY:re}=Be;(re<0&&fe>ne.current.y||re>0&&fe<ne.current.y)&&(ne.current={x:ne.current.x,y:fe}),(pe<0&&xe>ne.current.x||pe>0&&xe<ne.current.x)&&(ne.current={x:xe,y:ne.current.y});const ve=xe-K.current.x,Ze=fe-K.current.y,Ln=fe-ne.current.y,So=xe-ne.current.x;let dn=I;if(!C&&Math.sqrt(ve*ve+Ze*Ze)>=YY){_(!0);const vn=h.includes("left")||h.includes("right"),zs=h.includes("up")||h.includes("down");if(vn&&zs){const dt=Math.abs(ve),un=Math.abs(Ze);dn=dt>un?"horizontal":"vertical",P(dn)}}let Te;if(!q.current)dn==="vertical"?Ze>0?Te="down":Ze<0&&(Te="up"):dn==="horizontal"?ve>0?Te="right":ve<0&&(Te="left"):Math.abs(ve)>=Math.abs(Ze)?Te=ve>0?"right":"left":Te=Ze>0?"down":"up",Te&&h.includes(Te)&&(q.current=Te,H.current=J0(Te,ve,Ze),w(Te));else{const cs=q.current,vn=J0(cs,So,Ln);vn>NA?(Y.current=!1,w(cs)):!(h.includes("left")&&h.includes("right"))&&!(h.includes("up")&&h.includes("down"))&&H.current-vn>=WY&&(Y.current=!0)}const rt=Me(ve,Ze);let _t=F.current.x,Jt=F.current.y;const ls=h.includes("left")||h.includes("right"),Bs=h.includes("up")||h.includes("down");dn!=="vertical"&&ls&&(_t+=rt.x),dn!=="horizontal"&&Bs&&(Jt+=rt.y),Ve({x:_t,y:Jt})}function nt(Be){if(Be.key==="Escape"){if(!$.current||!Ie($.current,Nn(yt($.current))))return;g.closeToast(o.id)}}S.useEffect(()=>{const Be=$.current;if(!p||!Be)return;function fe(xe){J.current===null||!Ie(Be,ln(xe))||xe.preventDefault()}return st(Be,"touchmove",fe,{passive:!1})},[p]);function Ee(){const Be=T.x-O.x,fe=T.y-O.y;return{transition:k?"none":void 0,transform:k?`translateX(${T.x}px) translateY(${T.y}px) scale(${O.scale})`:void 0,[qY]:`${Be}px`,[UY]:`${fe}px`}}const Je=o.priority==="high",_e={role:Je?"alertdialog":"dialog",tabIndex:0,"aria-modal":!1,"aria-labelledby":D,"aria-describedby":R,"aria-hidden":Je&&!ce?!0:void 0,onPointerDown:p?Oe:void 0,onPointerMove:p?Fe:void 0,onPointerUp:p?je:void 0,onPointerCancel:p?je:void 0,onKeyDown:nt,inert:wb(o.limited),style:{...Ee(),[$Y]:o.transitionStatus==="ending"?oe:ie,[FY]:`${be}px`,[HY]:o.height?`${o.height}px`:void 0}},Ae=S.useMemo(()=>({toast:o,setTitleId:E,setDescriptionId:B,recalculateHeight:Ce,visibleIndex:ie,expanded:ye}),[o,E,B,Ce,ie,ye]),Pe={transitionStatus:o.transitionStatus,expanded:ye,limited:o.limited||!1,type:o.type,swiping:k,swipeDirection:b},bt=Ht("div",e,{ref:[n,$],state:Pe,stateAttributesMapping:KY,props:[_e,u]});return y.jsx(rL.Provider,{value:Ae,children:bt})}),JY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,...r}=e,{visibleIndex:l,expanded:u,recalculateHeight:d}=Cb(),h=S.useRef(null);Se(()=>{d();const b=h.current;if(!b||typeof ResizeObserver!="function"||typeof MutationObserver!="function")return;const w=new ResizeObserver(()=>d(!0)),k=new MutationObserver(()=>d(!0));return w.observe(b),k.observe(b,{childList:!0,subtree:!0,characterData:!0}),()=>{w.disconnect(),k.disconnect()}},[d]);const p=l>0;return Ht("div",e,{ref:[n,h],state:{expanded:u,behind:p},props:r})});function aL(t){return t==null||typeof t=="boolean"||t===""?!1:Array.isArray(t)?t.some(aL):!0}function lL(t){return S.isValidElement(t)&&aL(t.props.children)}function cL(t,e,n){const{toast:o,setTitleId:s,setDescriptionId:i}=Cb(),r=n==="title"?s:i,l=e??(n==="title"?o.title:o.description);return{id:Ul(t),children:l,type:o.type,setId:r}}function uL(t,e,n){const o=lL(t);return Se(()=>{if(o)return n(e),()=>{n(s=>s===e?void 0:s)}},[o,e,n]),o?t:null}const QY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,id:r,children:l,...u}=e,{id:d,children:h,type:p,setId:g}=cL(r,l,"description"),w=Ht("p",e,{ref:n,state:{type:p},props:{...u,id:d,children:h}});return uL(w,d,g)}),ZY=S.forwardRef(function(e,n){const{render:o,className:s,style:i,id:r,children:l,...u}=e,{id:d,children:h,type:p,setId:g}=cL(r,l,"title"),w=Ht("h2",e,{ref:n,state:{type:p},props:{...u,id:d,children:h}});return uL(w,d,g)}),eG=S.forwardRef(function(e,n){const{render:o,className:s,style:i,disabled:r,nativeButton:l=!0,...u}=e,d=jb(),{toast:h,expanded:p}=Cb(),[g,b]=S.useState(!1),{getButtonProps:w,buttonRef:k}=Fa({disabled:r,native:l}),j={type:h.type};return Ht("button",e,{ref:[n,k],state:j,props:[{"aria-hidden":!p&&!g,onClick(){d.closeToast(h.id)},onFocus(){b(!0)},onBlur(){b(!1)}},u,w]})}),tG=S.forwardRef(function(e,n){const{render:o,className:s,style:i,disabled:r,nativeButton:l=!0,...u}=e,{toast:d}=Cb(),h=d.actionProps?.children??u.children,{getButtonProps:p,buttonRef:g}=Fa({disabled:r,native:l}),b={type:d.type},w=Ht("button",e,{ref:[n,g],state:b,props:[u,d.actionProps,p,{children:h}]});return lL(w)?w:null}),nG=S.forwardRef(function(e,n){return y.jsx(zB,{ref:n,...e})});function oG(){const t=jb(),e=t.useState("toasts");return S.useMemo(()=>({toasts:e,add:t.addToast,close:t.closeToast,update:t.updateToast,promise:t.promiseToast}),[e,t])}function sG(){const t=new Set;function e(n){t.forEach(o=>o(n))}return{" subscribe":function(o){return t.add(o),()=>{t.delete(o)}},add(n){const o=n.id||iL("toast"),s={...n,id:o,transitionStatus:"starting"};return e({action:"add",options:s}),o},close(n){e({action:"close",options:{id:n}})},update(n,o){e({action:"update",options:{id:n,updates:o}})},promise(n,o){let s=n;return e({action:"promise",options:{...o,promise:n,setPromise(i){s=i}}}),s}}}const qe=sG();function iG(t){if(t.repeat||t.key!=="Enter"&&t.key!==" ")return;const e=t.currentTarget.closest("[data-toast]")??t.currentTarget,n=e.ownerDocument.defaultView;n&&AW(n,t.key,o=>o instanceof n.Node&&e.contains(o))}function rG(){const{toasts:t}=oG();return t.map(e=>y.jsxs(XY,{toast:e,"data-toast":"",className:"pointer-events-auto flex w-80 items-start gap-3 rounded-lg bg-surface p-3 text-fg shadow-popup transition-[opacity,transform] data-[starting-style]:translate-y-2 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",children:[y.jsxs(JY,{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[y.jsx(ZY,{className:"text-[13px] font-semibold"}),y.jsx(QY,{className:"text-xs text-fg-muted"}),e.actionProps?y.jsx(tG,{className:"mt-1 self-start rounded px-2 py-0.5 text-xs font-medium text-accent hover:bg-hover"}):null]}),y.jsx(eG,{"aria-label":"Dismiss",onKeyDown:iG,className:"rounded p-0.5 text-fg-muted hover:bg-hover",children:y.jsx(As,{className:"size-3.5"})})]},e.id))}function aG({children:t}){return y.jsxs(BY,{toastManager:qe,timeout:4e3,children:[t,y.jsx(nG,{children:y.jsx(LY,{className:"pointer-events-none fixed bottom-4 right-4 z-[1100] flex flex-col gap-2",children:y.jsx(rG,{})})})]})}const lG=["a[href]","button","iframe","input","select","textarea","summary","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])","[tabindex]"].join(", "),cG="audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function uG(t){return!(t.tabIndex>=0||!t.hasAttribute("tabindex")&&t.matches(cG))||t.getAttribute("aria-hidden")==="true"||t.matches(":disabled")?!1:typeof t.checkVisibility!="function"||t.checkVisibility({visibilityProperty:!0})}function dG(t){return Array.from(t.querySelectorAll(lG)).filter(uG)}function fG(t){const e=n=>!/visible|hidden|clip/.test(n);return t.scrollWidth>t.clientWidth+1&&e(t.overflowX)||t.scrollHeight>t.clientHeight+1&&e(t.overflowY)}function hG(t){const[e,n]=S.useState(!1);return S.useLayoutEffect(()=>{const o=t.current,s=o?.ownerDocument.defaultView;if(!o||!s)return;const i=()=>{const h=s.getComputedStyle(o);n(fG({scrollWidth:o.scrollWidth,clientWidth:o.clientWidth,scrollHeight:o.scrollHeight,clientHeight:o.clientHeight,overflowX:h.overflowX,overflowY:h.overflowY}))};if(i(),typeof s.ResizeObserver!="function")return;const r=new s.ResizeObserver(i),l=new Set,u=h=>{if(h.nodeType!==1)return;const p=h;if(s.getComputedStyle(p).display==="contents"){p.childNodes.forEach(u);return}l.has(p)||(l.add(p),r.observe(p))};r.observe(o),o.childNodes.forEach(u);const d=new s.MutationObserver(h=>{for(const p of h)p.addedNodes.forEach(u);for(const p of l)o.contains(p)||(r.unobserve(p),l.delete(p));i()});return d.observe(o,{childList:!0,subtree:!0,characterData:!0}),()=>{r.disconnect(),d.disconnect()}},[t]),e}S.forwardRef(function({label:e,className:n,...o},s){const i=S.useRef(null),r=S.useCallback(b=>{i.current=b,typeof s=="function"?s(b):s&&(s.current=b)},[s]),l=hG(i),[u,d]=S.useState(!1),[h,p]=S.useState(null);S.useLayoutEffect(()=>{const b=i.current,w=b?.ownerDocument.defaultView;if(!l||!b||!w)return;const k=()=>{d(dG(b).length===0),p(b.closest('[role="dialog"], [role="alertdialog"]')?.getAttribute("aria-labelledby")??null)};k();const j=new w.MutationObserver(k);return j.observe(b,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex","disabled","hidden","href","contenteditable"]}),()=>j.disconnect()},[l]);const g=l&&u;return y.jsx("div",{ref:r,...g?{role:"group",tabIndex:0,"aria-labelledby":e===void 0?h??void 0:void 0,"aria-label":e??(h===null?"Panel content":void 0)}:{},className:He(g&&"focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-accent",n),...o})});const pG={blur:{label:"Blur",unit:"px",min:0,max:200,step:1,identity:0,initial:4},brightness:{label:"Brightness",unit:"%",min:0,max:500,step:1,identity:100,initial:120},contrast:{label:"Contrast",unit:"%",min:0,max:500,step:1,identity:100,initial:120},grayscale:{label:"Grayscale",unit:"%",min:0,max:100,step:1,identity:0,initial:100},saturate:{label:"Saturate",unit:"%",min:0,max:500,step:1,identity:100,initial:150},"hue-rotate":{label:"Hue rotate",unit:"deg",min:-360,max:360,step:1,identity:0,initial:90},invert:{label:"Invert",unit:"%",min:0,max:100,step:1,identity:0,initial:100},sepia:{label:"Sepia",unit:"%",min:0,max:100,step:1,identity:0,initial:100},opacity:{label:"Opacity",unit:"%",min:0,max:100,step:1,identity:100,initial:50}};[...Object.keys(pG)];const mG="modulepreload",gG=function(t,e){return new URL(t,e).href},PA={},mo=function(e,n,o){let s=Promise.resolve();if(n&&n.length>0){let d=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};const r=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),u=l?.nonce||l?.getAttribute("nonce");s=d(n.map(h=>{if(h=gG(h,o),h in PA)return;PA[h]=!0;const p=h.endsWith(".css"),g=p?'[rel="stylesheet"]':"";if(o)for(let w=r.length-1;w>=0;w--){const k=r[w];if(k.href===h&&(!p||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${g}`))return;const b=document.createElement("link");if(b.rel=p?"stylesheet":mG,p||(b.as="script"),b.crossOrigin="",b.href=h,u&&b.setAttribute("nonce",u),document.head.appendChild(b),p)return new Promise((w,k)=>{b.addEventListener("load",w),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function i(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return s.then(r=>{for(const l of r||[])l.status==="rejected"&&i(l.reason);return e().catch(i)})},BA=["#e5484d","#0091ff","#30a46c","#f76b15","#8e4ec6","#d6409f","#12a594","#ad7f58"],Qf="#6e56cf",Bk=8e3,yG=80,dL=50;function bG(t){let e=0;for(let n=0;n<t.length;n++)e=e*31+t.charCodeAt(n)|0;return BA[Math.abs(e)%BA.length]}const hi={str:(t,e=512)=>typeof t=="string"&&t.length<=e?t:null,num:t=>typeof t=="number"&&Number.isFinite(t)?t:null,strList:(t,e=dL)=>Array.isArray(t)?t.map(n=>hi.str(n)).filter(n=>n!==null).slice(0,e):[],point:t=>{if(!t||typeof t!="object")return null;const e=t,n=hi.num(e.x),o=hi.num(e.y);return n!==null&&o!==null?{x:n,y:o}:null}};function wG(t,e,n,o){return t.filter(s=>s.id!==e).map(s=>{const i=s.state?.[n],r=i&&typeof i=="object"&&!Array.isArray(i)?i:null;return{id:s.id,name:(s.name||(s.kind==="agent"?"Agent":"Guest")).slice(0,60),kind:s.kind,color:s.kind==="agent"?Qf:bG(s.id),cursor:r?hi.point(r.cursor):null,state:r?o(r):null}}).sort((s,i)=>s.kind===i.kind?s.name.localeCompare(i.name):s.kind==="person"?-1:1)}function xG(t){const e=qt()(()=>({available:!1,peers:[],agentWrote:null}));async function n({room:o,artifact:s}){const i=[];let r=null;if(s&&(i.push(s.onChange(T=>{if(T.author!=="agent")return;const M=Object.keys(T.changes).map(D=>t.wrotePath?t.wrotePath(D):D).filter(D=>D!==null),O=e.getState().agentWrote,N=O&&Date.now()-O.at<Bk?O.paths:[];e.setState({agentWrote:{at:Date.now(),paths:[...new Set([...N,...M])].slice(0,dL)}}),r&&clearTimeout(r),r=setTimeout(()=>e.setState({agentWrote:null}),Bk)})),i.push(()=>{r&&clearTimeout(r)})),!o)return()=>i.forEach(T=>T());e.setState({available:!0});const l=await o.self().catch(()=>null),u=t.pointer?.bind(t),d=t.sendMs??yG;let h=null,p="",g=null;const b=()=>{g=null;const T=u?{...t.snapshot(),cursor:h}:t.snapshot(),M=JSON.stringify(T);M!==p&&(p=M,o.presence({[t.key]:T}).catch(()=>{}))},w=()=>{g||(g=setTimeout(b,d))};b(),i.push(t.watch(w));const k=T=>{const M=u?.(T)??null;if(!M){h&&(h=null,w());return}h={x:Math.round(M.x),y:Math.round(M.y)},w()},j=()=>{h=null,w()},C=()=>{document.visibilityState==="hidden"&&j()};u&&(window.addEventListener("pointermove",k,{passive:!0}),document.addEventListener("pointerleave",j),document.addEventListener("visibilitychange",C)),i.push(()=>{u&&(window.removeEventListener("pointermove",k),document.removeEventListener("pointerleave",j),document.removeEventListener("visibilitychange",C)),g&&clearTimeout(g),o.presence({[t.key]:null}).catch(()=>{})});const _=T=>{e.setState({peers:wG(T,l,t.key,t.parse)}),t.onPeers?.(T,l)};return o.peers().then(_,()=>{}),i.push(o.onPeers(_)),()=>i.forEach(T=>T())}return{store:e,start:n}}function vG(t){const e=t.trim().split(/\s+/).filter(Boolean);return((e[0]?.[0]??"?")+(e.length>1?e[e.length-1][0]??"":"")).toUpperCase()}const Q0=200,kG=119,zk=qt()(()=>({message:"",serial:0}));function SG(t){const e=t.replace(/\s+/g," ").trim();if(e.length<=Q0)return e;const n=e.slice(0,Q0).search(/\s+\S*$/);return`${n>=kG?e.slice(0,n):e.slice(0,Q0-1).replace(/[\uD800-\uDBFF]$/,"")}…`}function sn(t){const e=SG(t);e&&zk.setState(n=>({message:e,serial:n.serial+1}))}function jG(){const t=zk(n=>n.message),e=zk(n=>n.serial);return y.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",style:{position:"absolute",width:1,height:1,overflow:"hidden",clip:"rect(0 0 0 0)",whiteSpace:"nowrap"},children:y.jsx("span",{children:t},e)})}function fL(t){return t&&/(^|\s)max-h-/.test(t)?void 0:{maxHeight:"var(--available-height)",overflowY:"auto"}}const Qu=S.forwardRef(function({className:e,...n},o){return y.jsx("div",{ref:o,className:He("pointer-events-auto flex items-center gap-1 rounded-[12px] bg-chrome text-chrome-fg shadow-chrome",e),...n})});function yi({className:t,vertical:e=!0}){return y.jsx("div",{"aria-hidden":"true",className:He(e?"mx-0.5 h-[18px] w-px":"my-1 h-px w-full","shrink-0 bg-chrome-line",t)})}const hj=t=>t?{[t]:""}:{};function wn({label:t,shortcut:e,side:n="bottom",children:o,disabled:s}){return y.jsxs(RB,{disabled:s,children:[y.jsx(PB,{render:o}),y.jsx(IB,{children:y.jsx($B,{side:n,sideOffset:8,className:"z-[1000]",children:y.jsxs(FB,{className:"flex max-w-80 items-center gap-1.5 rounded-[6px] bg-tip px-2 py-[5px] text-[13px] leading-[18px] text-tip-fg shadow-[0_1px_2px_rgb(11_11_11/0.06),0_2px_8px_rgb(11_11_11/0.08)] transition-opacity data-[ending-style]:opacity-0 data-[starting-style]:opacity-0",children:[y.jsx("span",{children:t}),e?y.jsx("kbd",{className:"rounded-[4px] bg-white/15 px-1 font-sans text-[12px] leading-4 text-tip-fg/80",children:e}):null]})})})]})}function pj({children:t}){return y.jsx(HB,{delay:400,closeDelay:0,children:t})}const CG={md:"h-7",lg:"h-8",xl:"h-9"},TG={md:"w-7",lg:"w-8",xl:"w-9"},it=S.forwardRef(function({pressed:e,square:n,size:o="md",className:s,type:i="button",...r},l){return y.jsx("button",{ref:l,type:i,"aria-pressed":e,className:He("inline-flex shrink-0 select-none items-center justify-center gap-1 whitespace-nowrap rounded-[8px] text-[14px] font-control leading-5 text-chrome-fg outline-none transition-colors duration-100 ease-out","hover:bg-chrome-hover focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-chrome-focus","disabled:pointer-events-none disabled:opacity-40",CG[o],n?TG[o]:"px-[9px]",e&&"bg-chrome-pressed text-chrome-pressed-fg hover:bg-chrome-pressed",s),...r})}),No=S.forwardRef(function({tip:e,shortcut:n,side:o,disabled:s,...i},r){const l=y.jsx(it,{ref:r,disabled:s,...i});return y.jsx(wn,{label:e,shortcut:n,side:o,children:s?y.jsx("span",{className:"inline-flex",children:l}):l})}),eo=S.forwardRef(function({label:e,tip:n,icon:o,shortcut:s,tipSide:i="top",size:r="xl",className:l,...u},d){return y.jsx(wn,{label:n??e,shortcut:s,side:i,children:y.jsx(it,{ref:d,square:!0,size:r,"aria-label":e,className:He("[&_svg]:size-[18px] [&_svg]:shrink-0",l),...u,children:o})})}),mj="min-w-[128px] max-w-[320px] rounded-[14px] bg-chrome p-1.5 text-[14px] leading-5 font-control text-chrome-fg shadow-chrome-popup outline-none origin-[var(--transform-origin)] transition-[opacity,transform] duration-100 data-[starting-style]:scale-95 data-[starting-style]:opacity-0 data-[ending-style]:opacity-0",hL="flex h-7 cursor-default select-none items-center gap-2 rounded-[8px] px-2.5 outline-none data-[highlighted]:bg-chrome-hover data-[popup-open]:bg-chrome-hover data-[disabled]:opacity-40";function zn({trigger:t,children:e,side:n="bottom",align:o="start",className:s,tip:i,open:r,onOpenChange:l,sideOffset:u=6,mark:d,popupBase:h=mj}){const p=y.jsx(vV,{render:t});return y.jsxs(EB,{open:r,onOpenChange:l?g=>l(g):void 0,children:[i?y.jsx(wn,{label:i.label,shortcut:i.shortcut,side:i.side??(n==="top"?"top":"bottom"),children:p}):p,y.jsx(gB,{children:y.jsx(kB,{side:n,align:o,sideOffset:u,className:"z-[1000]",children:y.jsx(pB,{...hj(d),className:He(h,s),style:fL(s),children:e})})})]})}function Qe({children:t,onSelect:e,shortcut:n,checked:o,disabled:s,danger:i,icon:r,title:l,description:u,closeOnClick:d}){return y.jsxs(R7,{className:He(hL,u!==void 0&&"h-auto min-h-7 items-start py-1.5",i&&"text-danger data-[highlighted]:bg-danger data-[highlighted]:text-white"),disabled:s,onClick:h=>{d!==!1&&WI(h.nativeEvent),e?.()},closeOnClick:d,title:l,children:[o!==void 0?y.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:o?y.jsx(Va,{className:"size-4 text-chrome-accent",strokeWidth:2.25}):null}):null,r?y.jsx("span",{"data-chrome-icon":"",className:"flex size-4 shrink-0 items-center justify-center text-chrome-muted",children:r}):null,u!==void 0?y.jsxs("span",{className:"flex min-w-0 flex-1 flex-col",children:[y.jsx("span",{className:"truncate",children:t}),y.jsx("span",{className:"truncate text-[12px] leading-4 text-chrome-muted",children:u})]}):y.jsx("span",{className:"min-w-0 flex-1 truncate",children:t}),n?y.jsx("span",{className:"ml-6 max-w-40 shrink-0 truncate text-[13px] text-chrome-muted",children:n}):null]})}function uu({label:t,icon:e,children:n,disabled:o,className:s,mark:i,popupBase:r=mj}){return y.jsxs(gV,{children:[y.jsxs(EV,{className:hL,disabled:o,children:[e?y.jsx("span",{"data-chrome-icon":"",className:"flex size-4 shrink-0 items-center justify-center text-chrome-muted",children:e}):null,y.jsx("span",{className:"min-w-0 flex-1 truncate",children:t}),y.jsx(qh,{className:"size-4 shrink-0 text-chrome-muted",strokeWidth:1.5})]}),y.jsx(gB,{children:y.jsx(kB,{sideOffset:4,className:"z-[1000]",children:y.jsx(pB,{...hj(i),className:He(r,s),style:fL(s),children:n})})})]})}function ts(){return y.jsx(jV,{className:"mx-2.5 my-1 h-px bg-chrome-line"})}function ju({children:t}){return y.jsx("div",{className:"px-2.5 py-1 text-[13px] font-medium text-chrome-muted",children:t})}function EG(t){return!(t instanceof HTMLElement)||!t.matches('input, textarea, [contenteditable="true"]')?!0:t.matches('[type="search"], [role="searchbox"], [role="combobox"]')}function Tb({trigger:t,children:e,side:n="top",align:o="center",open:s,onOpenChange:i,className:r,label:l,anchor:u,gap:d=8,initialFocus:h=!0,mark:p,popupBase:g=mj,style:b,holdWhileTyped:w=!1}){const k=S.useRef(!1),j=(C,_)=>{if(!C&&_.reason==="outside-press"){if(w&&k.current){_.cancel();return}_.event instanceof MouseEvent&&WI(_.event)}i?.(C,_)};return y.jsxs(rY,{open:s,onOpenChange:j,onOpenChangeComplete:C=>{C||(k.current=!1)},children:[y.jsx(uY,{render:t}),y.jsx(fY,{children:y.jsx(pY,{side:n,align:o,sideOffset:d,anchor:u??void 0,className:"z-[1000]",children:y.jsx(yY,{...hj(p),"aria-label":l,initialFocus:h?void 0:!1,className:He(g,r),style:b,onInput:C=>{EG(C.target)||(k.current=!0)},children:e})})})]})}function _G({label:t,swatches:e,current:n,onPick:o,size:s=20,className:i}){return y.jsx("div",{role:"radiogroup","aria-label":t,className:He("flex items-center gap-1",i),children:e.map(r=>{const l=r.name===n;return y.jsx(wn,{label:r.label,side:"top",children:y.jsx("button",{type:"button",role:"radio","aria-checked":l,"aria-label":r.label,onClick:()=>o(r.name),className:"grid shrink-0 place-items-center rounded-full outline-none transition-shadow focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-chrome-focus",style:{width:s+8,height:s+8},children:y.jsx("span",{className:He("block rounded-full ring-1 ring-inset ring-black/10 dark:ring-white/15",l&&"ring-2 ring-chrome-accent ring-offset-2 ring-offset-chrome"),style:{width:s,height:s,background:r.value}})})},r.name)})})}const MG=8,OG=32;function pL({label:t,width:e,min:n,max:o,side:s,onResize:i,onReset:r,className:l}){const u=S.useRef(null),d=s==="left"?-1:1,h=w=>{w.button===0&&(w.preventDefault(),w.currentTarget.setPointerCapture(w.pointerId),u.current={x:w.clientX,width:e})},p=w=>{u.current&&i(u.current.width+(w.clientX-u.current.x)*d)},g=()=>{u.current=null},b=w=>{if(u.current||w.metaKey||w.ctrlKey||w.altKey)return;const k=w.key==="ArrowRight"?1:w.key==="ArrowLeft"?-1:0;k&&(w.preventDefault(),w.stopPropagation(),i(e+k*d*(w.shiftKey?OG:MG)))};return y.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":t,"aria-valuemin":n,"aria-valuemax":o,"aria-valuenow":Math.round(e),tabIndex:0,className:He("absolute inset-y-0 z-10 w-2 cursor-col-resize outline-none pointer-coarse:hidden","hover:bg-[linear-gradient(to_right,transparent_3px,var(--color-chrome-accent)_3px,var(--color-chrome-accent)_5px,transparent_5px)]","focus-visible:bg-[linear-gradient(to_right,transparent_3px,var(--color-chrome-accent)_3px,var(--color-chrome-accent)_5px,transparent_5px)]",s==="left"?"-left-1":"-right-1",l),onPointerDown:h,onPointerMove:p,onPointerUp:g,onPointerCancel:g,onKeyDown:b,onDoubleClick:r})}function AG(t){try{const e=Number(localStorage.getItem(t));return Number.isFinite(e)&&e>0?e:null}catch{return null}}function zA(t,e){try{e===null?localStorage.removeItem(t):localStorage.setItem(t,String(Math.round(e)))}catch{}}function mL(t,e,n,o,s=1/0){const i=S.useCallback(h=>Math.round(Math.max(n,Math.min(o,s,h))),[n,o,s]),[r,l]=S.useState(()=>AG(t)??e),u=S.useCallback(h=>{const p=i(h);l(p),zA(t,p)},[i,t]),d=S.useCallback(()=>{l(e),zA(t,null)},[e,t]);return{width:i(r),resize:u,reset:d}}function tc(){return typeof navigator<"u"&&/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent)}const gj=tc()?"⌘":"Ctrl+",RG=gj==="⌘"?"⌥":"Alt+";function NG(t){const e=t;return!!(e&&(e.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(e.tagName)))}const Ss={find:()=>!1,link:()=>!1,openLink:()=>!1,openReference:()=>!1,comment:()=>!1,toggleComments:()=>!1,shortcuts:()=>!1,slash:()=>!1},Ik={find:t=>Ss.find(t),link:()=>Ss.link(),openLink:()=>Ss.openLink(),openReference:()=>Ss.openReference(),comment:()=>Ss.comment(),toggleComments:()=>Ss.toggleComments(),shortcuts:()=>Ss.shortcuts(),slash:()=>Ss.slash()};function Wa(t,e){const n=Ss[t];return Ss[t]=e,()=>{Ss[t]===e&&(Ss[t]=n)}}const DG={headingFont:"serif",textFont:"sans",pageWidth:"default",tabsLocation:"menu"},he=qt(()=>({phase:{kind:"opening"},project:null,me:null,writable:!1,commentable:!1,activeTab:null,saving:{},suggestions:{},comments:"margin",history:!1,find:"closed",shortcuts:!1,focusedSuggestion:null})),lt=he.setState,ke=he.getState;function Zu(t){const e=(l,u)=>l.order<u.order?-1:l.order>u.order?1:l.id<u.id?-1:1,n=new Set(t.map(l=>l.id)),o=new Map;for(const l of t){const u=l.subtabOf&&n.has(l.subtabOf)&&l.subtabOf!==l.id?l.subtabOf:void 0,d=o.get(u)??[];d.push(l),o.set(u,d)}const s=[],i=new Set,r=(l,u)=>{for(const d of(o.get(l)??[]).sort(e))i.has(d.id)||(i.add(d.id),s.push({...d,depth:u}),r(d.id,u+1))};r(void 0,0);for(const l of t)i.has(l.id)||s.push({...l,depth:0});return s}function Lk(t){const e=t??{},n=(o,s)=>s.includes(e[o])?e[o]:DG[o];return{headingFont:n("headingFont",["serif","sans"]),textFont:n("textFont",["serif","sans"]),pageWidth:n("pageWidth",["default","wide"]),tabsLocation:n("tabsLocation",["menu","left"])}}function Kh(){const t=he(e=>e.project?.display);return S.useMemo(()=>Lk(t),[t])}const PG=(t,e)=>t?.find(n=>n.id===e)??null,ga=["#785ee8","#dc3c3d","#019c7f","#fbb315","#ce447d","#10a122","#257de0","#d25f25"],yj=["#785ee8"],BG=1500,zG=2e3,IA=8e3,IG=1e4,LG=6e4,$G=6e4;function Qg(t,e=yj){const n=Math.max(0,ga.indexOf(t));return ga.map((o,s)=>ga[(n+s)%ga.length]).filter(o=>!e.includes(o))}function Eb(t){const e=typeof t=="string"?t.toLowerCase():"";return ga.includes(e)?e:void 0}function gL(t){let e=0;for(let n=0;n<t.length;n+=1)e=e*31+t.charCodeAt(n)>>>0;return Qg(ga[e%ga.length])[0]??ga[1]}function FG(t,e){return Eb(t)??gL(e)}function bj(t){const[e=0,n=0,o=0]=[1,3,5].map(s=>{const i=parseInt(t.slice(s,s+2),16)/255;return i<=.03928?i/12.92:((i+.055)/1.055)**2.4});return 1.05/(.2126*e+.7152*n+.0722*o+.05)<3?"#0b0b0b":"#ffffff"}function LA(t,e,n=yj){if(!n.includes(t)&&!e.includes(t))return t;const o=s=>e.filter(i=>i===s).length;return Qg(t,n).reduce((s,i)=>o(i)<o(s)?i:s)}function mf(t,e,n,o){return t.t<n.t||t.t===n.t&&e<o}function HG(t){const e=[];for(const n of t){const o=e.findIndex(s=>mf(n,n.key,s,s.key));e.splice(o<0?e.length:o,0,n)}return e}function $A(t){return t.filter(e=>!e.own).map(e=>e.c)}function qG(t,e=()=>{}){const{now:n}=t,o=t.neverGiven??yj,s=Eb(t.kept.read());let i=LA(s!==void 0&&!o.includes(s)?s:gL(t.id),[],o),r=null,l=0,u=-1/0,d,h,p=n(),g=-1/0,b;const w=()=>{const D=n(),E=D-p>IG;return E&&(g=D),p=D,E},k=(D,E)=>{const R=D!==i;[i,r]=[D,E],E!==null&&t.kept.write(i);const B=`${i} ${String(r)}`;B!==b&&(b=B,t.publish({c:i,t:r})),R&&e()},j=()=>{h?.cancel(),h=void 0,k(i,null)},C=D=>{const E=D.filter(R=>!o.includes(R.c));return E.filter(R=>!E.some(B=>B!==R&&B.key===R.key&&B.own===R.own&&mf(B,B.peer,R,R.peer)))},_=(D,E,R)=>D.some(B=>!B.own&&B.c===E&&mf(B,B.key,R,t.id)),T=(D,E,R,B)=>{const I={key:t.id,peer:t.peer,own:!0,c:R,t:B.t},P=HG([...E.filter(K=>!K.own),I]),$=P.filter(K=>K===I||P.some(F=>F!==K&&F.c===K.c&&mf(F,F.key,K,K.key))),W=new Set([R,...$A(D)]);for(const K of $){const F=Qg(K.c,o).find(q=>!W.has(q));if(F===void 0||K===I)return F;W.add(F)}},M=()=>{d=void 0;const D=t.claims(),E=C(D),R=E.find(B=>B.own);R===void 0?k(LA(i,$A(D),o),n()):k((_(E,R.c,R)?T(D,E,R.c,R):void 0)??R.c,R.t)},O=()=>{if(h!==void 0)return;const D=t.claims(),E=C(D),R=E.find(P=>P.own);if(r===null){R!==void 0&&R.c!==i&&k(R.c,null);return}const B={t:r};if(R!==void 0&&mf(R,R.peer,B,t.peer)&&!(_(E,R.c,R)&&T(D,E,R.c,R)!==void 0)){(R.c!==i||R.t!==r)&&k(R.c,R.t);return}n()-u>$G&&(l=0);const I=_(E,i,B)&&l<Qg(i,o).length?T(D,E,i,B):void 0;I!==void 0&&([l,u]=[l+1,n()],k(I,r))},N=t.every(()=>{w()&&h!==void 0&&j(),O()},zG);return b=`${i} null`,t.publish({c:i,t:null}),{worn:()=>i,heard:O,here(){const D=h;h=void 0,D?.cancel();const E=D!==void 0&&n()-D.at>=IA;if(E&&k(i,null),D!==void 0&&!E)return O();d!==void 0||r!==null||(l=0,k(i,null),d=t.after(M,BG))},away(){if(d?.(),d=void 0,!(r===null||h!==void 0)){if(w(),n()-g<LG)return k(i,null);h={at:n(),cancel:t.after(j,IA)}}},dispose(){h!==void 0&&j(),d?.(),d=void 0,N()}}}function UG(t){return{read(){try{return globalThis.localStorage?.getItem(t)??null}catch{return null}},write(e){try{globalThis.localStorage?.setItem(t,e)}catch{}}}}const VG={now:()=>Date.now(),after(t,e){const n=setTimeout(t,e);return()=>clearTimeout(n)},every(t,e){const n=setInterval(t,e);return()=>clearInterval(n)}},KG="1.4.0";class du extends Error{code;paths;retryable;constructor(e,n,o,s){super(n),this.name="ArtifactError",this.code=e,o&&(this.paths=o),s&&(this.retryable=!0)}}function WG(t){return t==="owner"||t==="editor"}const FA={defaultMs:12e4,maxMs:6e5};function YG(t,e={}){const n=e.timeoutMs??1e4,o=new Map;return Object.freeze({version:KG,use:i=>{const r=o.get(i);if(r)return r;const l=new Promise(u=>{const d=setTimeout(()=>u(null),n);Promise.resolve().then(()=>t.get(i)).then(h=>{clearTimeout(d),u(h?Object.freeze(h):null)},()=>{clearTimeout(d),u(null)})});return o.set(i,l),l}})}function GG(t,e){const n=globalThis.window?.openartifact;if(n)return n;const o=YG(t,e);return Object.defineProperty(window,"openartifact",{value:o,configurable:!1,enumerable:!0,writable:!1}),o}const gt={session:"_api/session",files:"_api/files",file:"_api/file",publish:"_api/publish",assets:"_api/assets",events:"_api/events",agentSend:"_api/agent/send",presence:"_api/presence",peers:"_api/peers",downloads:"_api/downloads",roomEmit:"_api/room/emit",dbGet:"_api/db/get",dbList:"_api/db/list",dbWrite:"_api/db/write",comments:"_api/comments",commentsCreate:"_api/comments/create",commentsReply:"_api/comments/reply",commentsEdit:"_api/comments/edit",commentsReact:"_api/comments/react",commentsResolve:"_api/comments/resolve",commentsMove:"_api/comments/move",commentsRemove:"_api/comments/remove",commentsSend:"_api/comments/send",history:"_api/history",historyFiles:"_api/history/files",historyFile:"_api/history/file",historyDiff:"_api/history/diff",historyRestore:"_api/history/restore",historyDismiss:"_api/history/dismiss",systemCopy:"_api/design/system-copy",mcpTools:"_api/mcp/tools",mcpCall:"_api/mcp/call",dataRefresh:"_api/data/refresh"},qm={read:"_api/sheet/read",send:"_api/sheet/send",widget:"_api/sheet/widget",importFile:"_api/sheet/import"},XG="sheet",JG="sheetWalkthrough",na={session:"_api/doc/session",read:"_api/doc/read",call:"_api/doc/call",history:"_api/doc/history",version:"_api/doc/version",restore:"_api/doc/restore",importFile:"_api/doc/import",exportFile:"_api/doc/export"};function QG(t,e,n){return e===401||e===403?"removed":e<200||e>=300||!n||n.id===t.id&&n.role===t.role?null:"changed"}async function Z0(t){let e={};try{e=await t.json()}catch{}const n=t.status===409?"conflict":t.status===403?"not_writer":t.status===404?"not_found":"unavailable";return new du(e.code??n,e.message??`HTTP ${t.status}`,e.paths,e.retryable===!0)}function ZG(){const t=new Uint8Array(8);return crypto.getRandomValues(t),Array.from(t,e=>e.toString(16).padStart(2,"0")).join("")}function yL(t={}){const e=new URL(t.base??"./",location.href),n=ZG(),o=(R,B)=>{const I=new URL(R,e);for(const[P,$]of Object.entries(B??{}))I.searchParams.set(P,$);return I.toString()},s=async(R,B,I)=>{let P;try{P=await fetch(o(R,I),B)}catch($){throw new du("unavailable",$ instanceof Error?$.message:String($))}if(!P.ok)throw await Z0(P);return await P.json()},i=(R,B)=>s(R,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(B)}),r=new Map,l=(R,B)=>{for(const I of r.get(R)??[])I(B)},u=(R,B)=>{let I=r.get(R);return I||(I=new Set,r.set(R,I),p?.addEventListener(R,b)),I.add(B),T(),()=>I.delete(B)};let d=null,h=!1,p=null,g=null;const b=R=>{l(R.type,JSON.parse(R.data))},w=()=>{const R=new EventSource(o(gt.events,{client:n}));p=R;for(const B of r.keys())R.addEventListener(B,b);R.onerror=()=>{_().then(B=>{B||R.readyState!==EventSource.CLOSED||p!==R||(p=null,g=setTimeout(()=>{g=null,T()},2e3))})}};let k=!1,j=!1;const C=R=>{k||(k=!0,g&&clearTimeout(g),g=null,p?.close(),p=null,d?.close(),d=null,t.onAccessChange?t.onAccessChange(R):location.reload())},_=async()=>{if(k)return!0;if(!M||j)return!1;j=!0;try{const R=(await M.catch(()=>null))?.viewer;if(!R)return!1;let B;try{B=await fetch(o(gt.session),{cache:"no-store"})}catch{return!1}const I=B.ok?(await B.json().catch(()=>null))?.viewer:null,P=QG(R,B.status,I);return P&&C(P),P!==null}finally{j=!1}};function T(){if(d||p||g||k)return;if(typeof WebSocket>"u")return w();const R=new URL(o(gt.events,{client:n}));R.protocol=R.protocol==="https:"?"wss:":"ws:";const B=new WebSocket(R);d=B,B.onopen=()=>{h=!0},B.onmessage=I=>{let P;try{P=JSON.parse(String(I.data))}catch{return}P.event&&l(P.event,P.data)},B.onclose=()=>{if(d===B&&(d=null),!k){if(!h)return w();_().then(I=>{I||d||p||g||(g=setTimeout(()=>{g=null,T()},2e3))})}}}let M=null;const O=()=>M??=s(gt.session),N={async artifact(){const{artifact:R,stores:B}=await O();return{id:R.id,...B?.systemCopy?{systemCopy:(P,$)=>s(gt.systemCopy,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({namespace:P,action:$})})}:{},title:async()=>(await s(gt.session)).artifact.title,list:async()=>(await s(gt.files)).files,readText:async P=>new TextDecoder().decode(await D(P)),readBytes:P=>D(P),publish:async P=>{const $={files:P,client:n};return s(gt.publish,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify($)})},onChange:P=>u("files",P)}},async assets(){const{viewer:R}=await O();return WG(R.role)?{upload:async(I,P)=>s(gt.assets,{method:"POST",headers:{"content-type":I.type||"application/octet-stream"},body:I},P?.name?{name:P.name}:void 0)}:null},async user(){const{viewer:R}=await O();return{me:async()=>R}},async agent(){return{send:async(B,I)=>{const P={request:B,deliver:I?.deliver??"send"};return s(gt.agentSend,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(P)})},status:async()=>(await s(gt.session)).agent,onStatus:B=>u("agent",B)}},async room(){return{self:async()=>n,presence:async B=>{const I={client:n,patch:B};await s(gt.presence,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(I)})},peers:async()=>(await s(gt.peers)).peers,onPeers:B=>u("peers",B),emit:async(B,I)=>{const P={client:n,topic:B,data:I};await i(gt.roomEmit,P)},onMessage:B=>u("room",B)}},async db(){const{stores:R}=await O();return R?.db?{get:async I=>(await s(gt.dbGet,{cache:"no-store"},{path:I})).data,list:async I=>(await s(gt.dbList,{cache:"no-store"},{collection:I})).documents,listing:async I=>{const{documents:P,epoch:$,seq:W}=await s(gt.dbList,{cache:"no-store"},{collection:I});return typeof $=="string"&&typeof W=="number"?{documents:P,epoch:$,seq:W}:{documents:P}},write:async I=>{const P={writes:I,client:n},{epoch:$,seq:W,documents:K}=await i(gt.dbWrite,P);return typeof $=="string"&&typeof W=="number"&&K!==void 0?{epoch:$,seq:W,documents:K}:void 0},onChange:I=>u("db",I)}:null},async comments(){const{stores:R}=await O();if(!R?.comments)return null;const B=async(P,$)=>(await i(P,$)).thread;return{list:async()=>(await s(gt.comments,{cache:"no-store"})).threads,create:P=>B(gt.commentsCreate,{input:P}),reply:(P,$,W)=>B(gt.commentsReply,{threadId:P,text:$,...W?.to?.length?{to:W.to}:{}}),edit:(P,$,W,K)=>B(gt.commentsEdit,{threadId:P,messageId:$,text:W,...K?.to?{to:K.to}:{}}),react:(P,$,W,K)=>B(gt.commentsReact,{threadId:P,messageId:$,emoji:W,on:K}),setResolved:(P,$)=>B(gt.commentsResolve,{threadId:P,resolved:$}),move:(P,$,W)=>B(gt.commentsMove,{threadId:P,anchor:$,...W?{location:W}:{}}),remove:async(P,$)=>{await i(gt.commentsRemove,{threadId:P,...$?{messageId:$}:{}})},sendToAgent:(P,$)=>B(gt.commentsSend,{threadId:P,...$?.unasked?{unasked:!0}:{}}),onChange:P=>u("comments",P)}},async doc(){const{stores:R}=await O();return R?.doc?{session:()=>i(na.session,{client:n}),read:I=>i(na.read,{tab:I}),call:I=>i(na.call,{...I,client:n}),history:I=>i(na.history,{tab:I}),version:(I,P)=>i(na.version,{tab:I,rev:P}),restore:I=>i(na.restore,I),importFile:(I,P,$)=>s(na.importFile,{method:"POST",headers:{"content-type":"application/octet-stream"},body:P},{name:I,...$?{tabName:$}:{}}),exportFile:async I=>{let P;try{P=await fetch(o(na.exportFile,{format:I.format,...I.tab?{tab:I.tab}:{},...I.paper?{paper:I.paper}:{}}),{cache:"no-store"})}catch(F){throw new du("unavailable",F instanceof Error?F.message:String(F))}if(!P.ok)throw await Z0(P);const $=P.headers.get("content-disposition")??"",W=decodeURIComponent(/filename\*=UTF-8''([^;]+)/.exec($)?.[1]??"")||`doc.${I.format==="markdown"?"md":I.format}`;let K=[];try{K=JSON.parse(decodeURIComponent(P.headers.get("x-doc-export-notes")??"%5B%5D"))}catch{}return{name:W,mime:P.headers.get("content-type")??"application/octet-stream",bytes:new Uint8Array(await P.arrayBuffer()),notes:K}},onFrame:I=>u("doc",I)}:null},async history(){const{stores:R}=await O();if(!R?.history)return null;const B=(P,$)=>({n:String(P),...$===void 0?{}:{path:$}});return{list:()=>s(gt.history,{cache:"no-store"}),files:async P=>(await s(gt.historyFiles,{cache:"no-store"},B(P))).files,read:async(P,$)=>new TextDecoder().decode(await E(gt.historyFile,B(P,$))),readBytes:(P,$)=>E(gt.historyFile,B(P,$)),diff:(P,$)=>s(gt.historyDiff,{cache:"no-store"},B(P,$)),restore:(P,$)=>i(gt.historyRestore,{n:P,...$?{paths:$}:{},client:n}),dismissNotice:async P=>{await i(gt.historyDismiss,{id:P})},onChange:P=>u("history",P)}},async mcp(){const{viewer:R}=await O();return R.role!=="owner"?null:{callTool:async(I,P,$,W)=>{const K=W?.signal;K?.throwIfAborted();const F={server:I,tool:P,args:$,...W?.timeoutMs===void 0?{}:{timeoutMs:W.timeoutMs}};try{return await s(gt.mcpCall,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(F),...K?{signal:K}:{}})}catch(q){throw K?.aborted?K.reason:q}},listTools:I=>s(gt.mcpTools,{cache:"no-store"},I===void 0?void 0:{server:I})}},async sheet(){const{stores:R}=await O();if(!R?.sheet)return null;let B=Promise.resolve();return{read:P=>i(qm.read,P),send:P=>{const $=B.then(()=>i(qm.send,P));return B=$.catch(()=>{}),$},widget:P=>i(qm.widget,P),importFile:(P,$)=>s(qm.importFile,{method:"POST",headers:{"content-type":P.type||"application/octet-stream"},body:P},{name:$}),onFrame:P=>u(XG,P),onWalkthrough:P=>u(JG,P)}},async downloads(){return{save:async({name:B,data:I})=>s(gt.downloads,{method:"POST",headers:{"content-type":I.type||"application/octet-stream"},body:I},{name:B})}}};function D(R){return E(gt.file,{path:R})}async function E(R,B){let I;try{I=await fetch(o(R,B),{cache:"no-store"})}catch(P){throw new du("unavailable",P instanceof Error?P.message:String(P))}if(!I.ok)throw await Z0(I);return new Uint8Array(await I.arrayBuffer())}return{get(R){const B=N[R];return B?B():null}}}const eX="[Artifact comment sent to agent]",tX="[Artifact edit request sent to agent]",nX="[Artifact task finished]",oX="[Open Artifact] ",sX={id:"open_artifact_id"},iX=1,rX=1,aX=/^[a-z][a-z0-9]{0,23}$/,lX="may not have run: the artifact was updated before this call was answered",cX=["quickstart","list","publish","read","open","call","adopt","delete","share"],uX=["get","list","query","set","update","delete","str_replace","batch"],dX=["read","reply","resolve","reopen","wait"],fX=["share","export"],hX={type:"object",properties:{action:{type:"string",enum:cX,description:"What to do: quickstart, list, publish, read, open, call, adopt, delete or share. Omitted: publish."},intent:{type:"string",description:"quickstart: what is being made (design, design-system, slides, whiteboard, document, data, sheets, motion, page, other), or a few words about it."},scope:{type:"string",enum:["types","mine","all"],description:"list: types (the installed types), mine (this session's and this project's artifacts; the default) or all (every artifact)."},type:{type:"string",description:"list: only artifacts of this type (an id, or open-artifact://type/<id>). quickstart: the type already chosen (an id), to get its create call and steps without matching."},query:{type:"string",description:"list: only artifacts whose title contains this text."},limit:{type:"integer",description:"list: how many to return (default 50, at most 200)."},cursor:{type:"string",description:"list: the next_cursor of the previous page."},type_url:{type:"string",description:"publish without url: the type to create from (open-artifact://type/<id>, from quickstart). read without url: the type to describe."},title:{type:"string",description:"publish without url: the new artifact's name. quickstart: the name it will have, to find similar ones."},folder:{type:"string",description:"publish without url: the exact folder for the new artifact (absolute, or relative to the workspace), only when the person named one. Omitted: Open Artifact chooses the folder and its name. adopt: the folder to add."},location:{type:"string",enum:["home","workspace"],description:"publish without url: where the new artifact's folder goes when the person asked: workspace (in the project, under the working folder) or home (the person's Open Artifact folder). Omitted: what the person's settings say. The folder is named from the title either way."},url:{type:"string",description:"An artifact: open-artifact://artifact/<id>, as publish returned it."},files:{type:"object",additionalProperties:!0,description:'publish with url: files to write under the artifact root, as {"rel/path": "text"} or {"rel/path": {"content": "...", "encoding": "base64"}}; null deletes.'},if_match:{type:"object",additionalProperties:!0,description:'publish with url: {"rel/path": sha256 | null | "*"}. Write only while the file still has the sha256 you read, does not exist (null), or anyway ("*"). One mismatch writes nothing and returns the current versions.'},check:{type:"boolean",description:"publish with url: run the type's check action after writing; its result comes back as check."},capabilities:{type:"object",additionalProperties:!0,description:'publish, page artifacts only: the runtime capabilities the page may use, as {"db": true, "assets": true, ...}. Omitted: kept; {}: none; otherwise the whole set. With url it may be given without files.'},open:{type:"string",enum:["after_first_write","now","never"],description:"publish without url: after_first_write (the default) opens the page in your app once your first write lands; now opens it at once; never leaves it closed. Where your app cannot show pages by itself the result says so: open view_url in your app's built-in browser, if you have one."},related:{type:"boolean",description:"quickstart: list existing artifacts the recommended type can build on, such as design systems (default true)."},path:{type:"string",description:"read: one file or folder under the root (omitted: the record and the file list)."},paths:{type:"array",items:{type:"string"},description:"read: several files under the root at once."},name:{type:"string",description:"call: the action's name (check, upload, ...; read with url lists them)."},args:{type:"object",additionalProperties:!0,description:"call: the action's arguments. upload: {file: absolute path, name?, group?}."},panel:{type:"string",enum:fX,description:"open: also open the page's Share panel (share), for the person to share it on the network, or its Export tab (export), for them to download a file."},cloud:{type:"string",description:"share: publish the artifact to this cloud remote (its name, as `open-artifact remote list` shows it). It works only on a remote the person set up and let agents publish to (agentMayPublish); otherwise the person publishes it, from the Share panel or with `open-artifact publish <id> --remote <name>`."}}},pX={type:"object",properties:{action:{type:"string",enum:uX,description:"What to do: get, list, query, set, update, delete, str_replace or batch."},url:{type:"string",description:"The artifact (open-artifact://artifact/<id>)."},collection:{type:"string",description:"The collection: alone for list / query (query needs it), with doc_id for one document."},doc_id:{type:"string",description:"With collection: the document to get / set / update / delete / str_replace."},path:{type:"string",description:"collection/doc_id, instead of the two."},data:{type:"object",additionalProperties:!0,description:"set / update: the document's fields."},file_path:{type:"string",description:"set / update: a JSON file holding the fields, instead of data."},if_match:{description:'set / update / delete / str_replace: the sha256 get returned (write only if unchanged), null (only if it does not exist) or "*" (replace whatever is there).'},field:{type:"string",description:"str_replace: the text field, as a dot path (body, notes.text)."},old:{type:"string",description:"str_replace: the passage to replace; it must occur exactly once."},new:{type:"string",description:"str_replace: the passage that replaces it."},where:{type:"array",items:{type:"object",additionalProperties:!0},description:"query: [{field, op, value}], all must hold. op: ==, !=, <, <=, >, >=, in, not-in (up to 30 values), array-contains."},order_by:{type:"object",additionalProperties:!0,description:'query: {field, dir: "asc" | "desc"}.'},limit:{type:"integer",description:"list / query: how many documents (default 100, at most 1000)."},cursor:{type:"string",description:"list / query: the next_cursor of the previous page."},out_file:{type:"string",description:"get / list / query: write the result to this JSON file (absolute, or relative to the workspace) and return only its path and counts."},writes:{type:"array",items:{type:"object",additionalProperties:!0},description:"batch: [{op: set|update|delete|str_replace, path | collection+doc_id, data | file_path, if_match?, field?, old?, new?}], at most 500."}},required:["action","url"]},mX={type:"object",properties:{action:{type:"string",enum:dX,description:"What to do: read, reply, resolve, reopen or wait."},url:{type:"string",description:"The artifact (open-artifact://artifact/<id>). wait: optional."},thread_id:{type:"string",description:'reply / resolve / reopen: the thread (after ";thread=" in the message).'},text:{type:"string",description:"reply: the answer."},resolve:{type:"boolean",description:"reply: resolve the thread too."},all:{type:"boolean",description:"read: resolved threads too."},since:{type:"string",description:"read: only threads with a message at or after this time (ISO 8601)."},acknowledge_duplicate:{type:"boolean",description:"reply: send the same text as your last reply in this thread again, on purpose."},timeout_ms:{type:"number",description:"wait: how long (default 600000)."}},required:["action"]},HA={Artifact:hX,ArtifactData:pX,ArtifactComments:mX},gX={Artifact:["Make and change artifacts: typed folders of files that open as live pages the person can view, edit, comment on and export. Actions:","- quickstart {intent, type?}: call first for a new artifact; recommends a type (or takes the one given) and returns the call that creates it, the steps for this app and similar artifacts that already exist.",'- list {scope: "mine" | "all" | "types", type?, query?}: find existing artifacts, or the installed types.',"- publish {type_url, title, folder?, open?}: create an artifact; the result carries its root folder and the type's instructions. publish {url, files, if_match?, check?}: write files when you have no file tools of your own. A page artifact also takes capabilities (on create or write): the runtime capabilities its page may use.","- read {url, path? | paths?}: the artifact's record, files and actions, or some of its files with their sha256. read {type_url}: a type's instructions, before creating.",`- open {url, panel?}: show it to the person in the computer's browser (or the app, when it shows pages), once its content is written. When your app has a built-in browser, open view_url there instead. panel "share" or "export" opens its Share panel or Export tab for them.`,"- call {url, name, args?}: run one of the type's actions (check, upload, ...). A long one answers {task, pending: true}; its result comes later as a message.","- adopt {url | folder}: take over an artifact, or add an existing folder. Only when the person asks.","- share {url}: whether it is shared on the local network, and its links. Only the person changes that, in the page's Share panel.","- delete {url}: forget an artifact; its folder stays. Only when the person asks."].join(`
|
|
11
11
|
`),ArtifactData:'Read and write the document store of an artifact whose type keeps one (its instructions say so). get, list and query read documents with their sha256; set, update, delete, str_replace and batch write them. update merges fields, and {"__delete__": true} removes one; str_replace changes one passage of a long text field. Replacing or deleting an existing document needs if_match: the sha256 you read, or "*". Your writes show live on open pages.',ArtifactComments:`Comments the person leaves on their artifact's page, kept in the artifact's own folder on this computer (no outside service). read lists the threads; reply answers one (thread_id is after ";thread=" in the message), with resolve: true when it is done; resolve and reopen change a thread's state. A thread sent to you is the person asking for your answer in it, so replying there is what they asked for. Answer only threads sent to you, in one or two lines. wait blocks until the next message for this session: use it only when nothing else can wake you.`},qA={Artifact:{title:"Artifact",openWorldHint:!1},ArtifactData:{title:"Artifact data",openWorldHint:!1},ArtifactComments:{title:"Artifact comments",destructiveHint:!1,openWorldHint:!1}},yX={Artifact:{quickstart:"read",list:"read",read:"read",publish:"write",call:"write",open:"ui",delete:"remove",adopt:"remove",share:"person"},ArtifactData:{get:"read",list:"read",query:"read",set:"write",update:"write",str_replace:"write",batch:"write",delete:"write"},ArtifactComments:{read:"read",wait:"read",reply:"write",resolve:"write",reopen:"write"}},bX={Artifact:["publish","open","call","share"],ArtifactData:["get","list","query","set","update","str_replace","batch","delete"],ArtifactComments:["read","reply","resolve","reopen"]};function wX(t={any:!1,actions:!1}){return Object.keys(HA).map(e=>{const n=e==="Artifact"?t.any:t.actions;return{name:e,description:gX[e],inputSchema:HA[e],annotations:n?{...qA[e],openWorldHint:!0}:qA[e],actions:yX[e],remoteActions:[...bX[e]]}})}wX();const xX=300,vX=12,UA=["Artifact","ArtifactData","ArtifactComments"];function ja(t,e=xX){const n=String(t??"").replace(/[<>]/g,"").replace(/\s+/g," ").trim();return n.length>e?`${n.slice(0,e-1).trimEnd()}…`:n}function kX(t){const e=ja(t,Number.MAX_SAFE_INTEGER),n=e.search(/[.!?。!?](\s|$)/);return n>=0?e.slice(0,n+1):e}function SX(t){const e=ja(t,24);return/^[a-z0-9]{1,5}$/i.test(e)?e.toUpperCase():e}const VA=t=>!t||/[.!?。!?…]$/.test(t)?t:`${t}.`;function jX(t,e=!1){const n=ja(t.title,80)||t.id;if(e)return`- ${t.id}: ${n}`;const o=ja(t.when)||ja(kX(t.description)),s=(t.exports??[]).map(SX).filter(Boolean),i=[VA(n),VA(o),s.length?`Exports: ${s.join(", ")}.`:""].filter(Boolean);return`- ${t.id}: ${i.join(" ")}`}const CX="Open Artifact lets you make artifacts: typed folders of files (a slide deck, a design canvas, a whiteboard, a data dashboard, a spreadsheet, a doc, an animated motion piece, a free HTML page and more) that open as live pages the person can view, edit, comment on and export. You make and change them with the Artifact, ArtifactData and ArtifactComments tools.",TX=`<where_output_goes>
|
|
12
12
|
Decide where your output will live before you make anything.
|
|
13
13
|
- Something the person will read once and move on from (an answer, an explanation, a summary, a short report) goes in your reply, however long it is. A diagram or chart that explains your answer goes in the reply too, when you can show one there.
|
|
@@ -73,13 +73,13 @@ ${n.slice(0,Fk)}`:o}const kj="agent",xL=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&
|
|
|
73
73
|
`;)s++;return t[s]!==")"?null:{label:t.slice(e+1,o),href:i,end:s+1}}function tS(t,e,n,o=!1){if(e>Ah.depth)throw new cw;const s=[];let i="",r=0;const l=()=>{i&&s.push({t:"text",text:i}),i=""};let u=0;for(;u<t.length;){const d=t[u],h=u>0?t[u-1]:void 0;if(d==="\\"&&NF.test(t[u+1]??"")){i+=t[u+1],u+=2;continue}if(d==="`"){const p=/^`+/.exec(t.slice(u))[0];let g=-1;for(let w=t.indexOf(p,u+p.length);w>=0;w=t.indexOf(p,w+1)){const k=/^`+/.exec(t.slice(w))[0].length;if(k===p.length&&t[w-1]!=="`"){g=w;break}w+=k-1}if(g<0){i+=p,u+=p.length;continue}let b=t.slice(u+p.length,g).replace(/\n/g," ");b.length>2&&b.startsWith(" ")&&b.endsWith(" ")&&b.trim()!==""&&(b=b.slice(1,-1)),l(),s.push({t:"code",text:b}),u=g+p.length;continue}if(d==="<"){const p=ume.exec(t.slice(u)),g=p&&!o?tk(p[1]):null;if(p&&g){l(),s.push({t:"link",href:g,c:[{t:"text",text:p[1]}]}),u+=p[0].length;continue}i+=d,u++;continue}if(d==="!"&&t[u+1]==="["){const p=rD(t,u+1);if(p){i+=t.slice(u,p.end),u=p.end;continue}}if(d==="["&&!o){const p=rD(t,u);if(p){const g=tk(p.href),b=g?tS(p.label,e+1,n,!0):[];l(),s.push(g?{t:"link",href:g,c:b.length?b:[{t:"text",text:p.href}]}:{t:"text",text:t.slice(u,p.end)}),u=p.end;continue}}if((d==="h"||d==="H"||d==="w"||d==="W")&&!o&&(h===void 0||!/[\p{L}\p{N}_/@.:-]/u.test(h))){const p=cme.exec(t.slice(u)),g=p?fme(p[0]):"",b=g&&!/^www\.$/i.test(g)&&!/^https?:\/\/$/i.test(g)?tk(g):null;if(b){l(),s.push({t:"link",href:b,c:[{t:"text",text:g}]}),u+=g.length;continue}}if(d==="@"&&n.mentions&&(h===void 0||By.test(h))){const p=n.mentions.exec(t.slice(u));if(p){l(),s.push({t:"mention",text:p[0]}),u+=p[0].length;continue}}if(d==="*"||d==="_"||d==="~"){const p=/^(\*+|_+|~+)/.exec(t.slice(u))[0].length,g=dme(d,h,t[u+p]);(g.open||g.close)&&(d!=="~"||p===2)&&r<Ah.delimiters?(l(),s.push({t:"delim",ch:d,n:p,orig:p,...g}),r++):i+=t.slice(u,u+p),u+=p;continue}i+=d,u++}return l(),DF(hme(s),e)}const nS=t=>t.t==="delim",aD=t=>nS(t)?{t:"text",text:t.ch.repeat(t.n)}:t;function hme(t){const e=[...t];let n=0;for(;n<e.length;){const o=e[n];if(!nS(o)||!o.close||o.n===0){n++;continue}let s=-1;for(let h=n-1;h>=0;h--){const p=e[h];if(!nS(p)||p.ch!==o.ch||!p.open||p.n===0)continue;if(o.ch==="~"){if(p.n===2&&o.n===2&&(s=h),s>=0)break;continue}if(!((p.close||o.open)&&(p.orig+o.orig)%3===0&&(p.orig%3!==0||o.orig%3!==0))){s=h;break}}if(s<0){n++;continue}const i=e[s],r=o.ch==="~"||i.n>=2&&o.n>=2?2:1,l={t:o.ch==="~"?"del":r===2?"strong":"em",c:e.slice(s+1,n).map(aD)};i.n-=r,o.n-=r;const u=i.n>0?s+1:s,d=o.n>0?n:n+1;e.splice(u,d-u,l,...o.n>0?[o]:[]),n=u+1}return e.map(aD)}function DF(t,e){const n=[];for(const o of t){if(o.t==="em"||o.t==="strong"||o.t==="del"||o.t==="link"){if(e>Ah.depth)throw new cw;n.push({...o,c:DF(o.c,e+1)});continue}if(o.t==="text"){if(!o.text)continue;const s=n[n.length-1];if(s?.t==="text"){n[n.length-1]={t:"text",text:s.text+o.text};continue}}n.push(o)}return n}const pme="rounded bg-chrome-hover px-1 py-px font-mono text-[12px] [overflow-wrap:anywhere]";function PF({text:t}){return y.jsx("span",{className:"font-medium text-chrome-accent",children:t})}function Rl({nodes:t}){return t.map((e,n)=>{switch(e.t){case"text":return e.text;case"mention":return y.jsx(PF,{text:e.text},n);case"code":return y.jsx("code",{dir:"ltr",className:pme,children:e.text},n);case"em":return y.jsx("em",{children:y.jsx(Rl,{nodes:e.c})},n);case"strong":return y.jsx("strong",{className:"font-semibold",children:y.jsx(Rl,{nodes:e.c})},n);case"del":return y.jsx("del",{children:y.jsx(Rl,{nodes:e.c})},n);case"link":return y.jsx("a",{href:e.href,title:e.href,target:"_blank",rel:"noopener noreferrer nofollow",className:"text-chrome-accent underline underline-offset-2 [overflow-wrap:anywhere] hover:opacity-80",onClick:o=>o.stopPropagation(),children:y.jsx(Rl,{nodes:e.c})},n)}})}function oS({blocks:t}){return t.map((e,n)=>{const o=n>0?"mt-1.5":"";switch(e.t){case"p":return y.jsx("p",{className:`m-0 ${o}`,children:y.jsx(Rl,{nodes:e.c})},n);case"h":return y.jsx("p",{role:"heading","aria-level":e.level,className:`m-0 font-semibold ${e.level<=2?"text-[14px]":""} ${o}`,children:y.jsx(Rl,{nodes:e.c})},n);case"code":return y.jsx("pre",{dir:"ltr",className:`m-0 rounded bg-chrome-hover px-2 py-1 font-mono text-[12px] leading-[18px] whitespace-pre-wrap [overflow-wrap:anywhere] ${o}`,children:y.jsx("code",{children:e.text})},n);case"quote":return y.jsx("blockquote",{className:`m-0 border-l-2 border-chrome-line pl-2 text-chrome-muted ${o}`,children:y.jsx(oS,{blocks:e.c})},n);case"list":{const s=e.items.map((i,r)=>y.jsx("li",{className:"pl-0.5",children:y.jsx(oS,{blocks:i})},r));return e.ordered?y.jsx("ol",{start:e.start===1?void 0:e.start,className:`m-0 list-decimal pl-5 ${o}`,children:s},n):y.jsx("ul",{className:`m-0 list-disc pl-5 ${o}`,children:s},n)}case"hr":return y.jsx("hr",{className:"my-1.5 border-0 border-t border-chrome-line"},n)}})}const mme=["👍","❤️","😂","🎉","😮","😢","👀","🙏","✅","🔥","💯","🤔"];function BF({onPick:t}){return y.jsx("div",{role:"group","aria-label":"Reactions",className:"grid grid-cols-6 gap-0.5",children:mme.map(e=>y.jsx("button",{type:"button","data-emoji":e,"aria-label":e,onClick:()=>t(e),className:"flex size-8 items-center justify-center rounded-[8px] text-[18px] outline-none hover:bg-chrome-hover focus-visible:bg-chrome-hover",children:e},e))})}function gme({thread:t,message:e}){const[n,o]=S.useState(!1);return y.jsx(Tb,{open:n,onOpenChange:o,side:"top",align:"end",label:"Add a reaction",className:"p-1",trigger:y.jsx(it,{square:!0,"aria-label":"Add a reaction",className:"size-6 text-chrome-muted",onClick:s=>s.stopPropagation(),children:y.jsx(_z,{className:"size-3.5"})}),children:y.jsx(BF,{onPick:s=>{o(!1),uC(t,e,s)}})})}function yme({thread:t,message:e}){const n=(e.reactions??[]).filter(i=>i.authors.length>0);if(!n.length)return null;const o=Js(),s=Fo();return y.jsx("div",{className:"mt-1.5 flex flex-wrap gap-1",children:n.map(i=>{const r=a5(i,o),l=i.authors.map(h=>h.name===o&&h.kind==="person"?"You":h.name).join(", "),u=He("flex h-6 items-center gap-1 rounded-full border px-1.5 text-[12px] leading-none transition-colors",r?"border-chrome-accent bg-chrome-pressed text-chrome-pressed-fg":"border-chrome-line text-chrome-muted",s&&!r&&"hover:bg-chrome-hover"),d=y.jsxs(y.Fragment,{children:[y.jsx("span",{className:"text-[13px]",children:i.emoji}),y.jsx("span",{children:i.authors.length})]});return y.jsx(wn,{label:l,side:"top",children:s?y.jsx("button",{type:"button","aria-pressed":r,"aria-label":`${i.emoji} ${i.authors.length}: ${l}`,className:u,onClick:h=>{h.stopPropagation(),uC(t,e.id,i.emoji)},children:d}):y.jsx("span",{role:"img","aria-label":`${i.emoji} ${i.authors.length}: ${l}`,className:u,children:d})},i.emoji)})})}function bme(){const t=kt(o=>o.picker),[e,n]=S.useState(null);return t?y.jsxs(y.Fragment,{children:[y.jsx("div",{ref:n,"aria-hidden":"true",className:"pointer-events-none fixed",style:{top:t.top,left:t.left,width:t.width,height:t.height}}),e?y.jsx(Tb,{open:!0,onOpenChange:o=>!o&&Bn({picker:null}),anchor:e,side:"bottom",align:"center",label:"React to the selection",className:"p-1",trigger:y.jsx("span",{hidden:!0}),children:y.jsx(BF,{onPick:o=>{Bn({picker:null}),rie(o)}})}):null]}):null}function wme(t,e=Date.now()){const n=Date.parse(t);if(!Number.isFinite(n))return"";const o=Math.max(0,(e-n)/1e3);if(o<60)return"Just now";if(o<3600)return`${Math.floor(o/60)}m`;if(o<86400)return`${Math.floor(o/3600)}h`;const s=new Date(n),i=s.getFullYear()===new Date(e).getFullYear();return s.toLocaleDateString(void 0,i?{month:"short",day:"numeric"}:{year:"numeric",month:"short",day:"numeric"})}function xme(t){const e=Date.parse(t);return Number.isFinite(e)?new Date(e).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"}):""}function vme({text:t,lines:e=6}){const n=_F(),o=S.useRef(null),[s,i]=S.useState(!1),[r,l]=S.useState(!1),u=n.map(w=>w.name),d=u.join(`
|
|
74
74
|
`),h=S.useMemo(()=>Zpe(t)?eme(t,d?d.split(`
|
|
75
75
|
`):[]):null,[t,d]),p=h?tme(h):null,g=h!==null&&p===null;S.useLayoutEffect(()=>{const w=o.current;!w||s||l(w.scrollHeight>w.clientHeight+1)},[t,e,s,h]);const b=s?void 0:g?{maxHeight:e*20,overflow:"hidden"}:{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:e,overflow:"hidden"};return y.jsxs("div",{children:[y.jsx("div",{ref:o,className:"whitespace-pre-wrap break-words text-[13px] leading-5 text-chrome-fg","data-comment-markdown":h?"":void 0,style:b,children:h===null?wJ(t,u).map((w,k)=>w.mention?y.jsx(PF,{text:w.text},k):w.text):p?y.jsx(Rl,{nodes:p}):y.jsx(oS,{blocks:h})}),r||s?y.jsx("button",{type:"button",className:"mt-0.5 text-[12px] font-medium text-chrome-muted hover:text-chrome-fg",onClick:w=>{w.stopPropagation(),i(!s)},children:s?"Show less":"Show more"}):null]})}const kme="joined without being asked";function lD({thread:t,message:e,root:n,open:o,removablePlace:s}){const i=Js(),r=kt(O=>O.editing?.thread===t.id&&O.editing.message===e.id),[l,u]=S.useState(e.text),[d,h]=S.useState(!1),[p,g]=S.useState(null),b=Fo(),w=t.status==="resolved",k=Pse(e,i,b),j=n?l5(t,i,b,Zg()):Bse(e,i,b,Zg()),C=e.author.kind==="agent",_=e.author.kind==="person"&&e.author.name===i&&i!=="You"?`${e.author.name} (you)`:e.author.name,T=()=>Bn({editing:null}),M=()=>{u(e.text),Bn({editing:{thread:t.id,message:e.id}})};return y.jsxs("div",{className:"group/message","data-comment-message":e.id,children:[y.jsxs("div",{className:"flex items-center gap-1.5",children:[y.jsx(rT,{name:e.author.name,agent:C,size:"md"}),y.jsxs("div",{className:"flex min-w-0 flex-1 items-baseline gap-1.5",children:[y.jsx("span",{className:"truncate text-[13px] font-medium text-chrome-fg",children:_}),C&&e.joined?y.jsx(wn,{label:"No one @mentioned it: it answered a reply in a thread it was part of",side:"top",children:y.jsx("span",{className:"shrink-0 text-[12px] text-chrome-muted",children:kme})}):null,y.jsx(wn,{label:xme(e.editedAt??e.at),side:"top",children:y.jsxs("span",{className:"shrink-0 text-[12px] text-chrome-muted",children:[wme(e.at),e.editedAt?" (edited)":""]})})]}),y.jsxs("div",{className:He("flex shrink-0 items-center gap-0.5",!o&&"opacity-0 group-hover/message:opacity-100 focus-within:opacity-100"),children:[b&&!r?y.jsx(gme,{thread:t.id,message:e.id}):null,y.jsxs(zn,{align:"end",tip:{label:"More options",side:"top"},trigger:y.jsx(it,{square:!0,"aria-label":"More options",className:"size-6 text-chrome-muted",onClick:O=>O.stopPropagation(),children:y.jsx(Xu,{className:"size-3.5"})}),children:[y.jsx(Qe,{onSelect:()=>{uie(t)},children:"Copy link"}),k?y.jsx(Qe,{onSelect:M,children:"Edit"}):null,n&&s!==void 0&&b&&!w?y.jsx(Qe,{onSelect:()=>{die(t,s)},children:"Remove from these words"}):null,n&&w&&b?y.jsx(Qe,{onSelect:()=>{Mg(t.id,!1)},children:"Reopen"}):null,j?y.jsxs(y.Fragment,{children:[y.jsx(ts,{}),y.jsx(Qe,{danger:!0,onSelect:()=>g("delete"),children:n&&t.messages.length>1?"Delete thread":"Delete comment"})]}):null]}),n&&b?w?y.jsx(wn,{label:"Reopen",side:"top",children:y.jsx(it,{square:!0,"aria-label":"Reopen",className:"size-6 text-chrome-accent",onClick:O=>{O.stopPropagation(),Mg(t.id,!1)},children:y.jsx(HK,{className:"size-3.5"})})}):y.jsx(wn,{label:"Resolve",side:"top",children:y.jsx(it,{square:!0,"aria-label":"Resolve",className:"size-6 text-chrome-muted hover:text-chrome-accent",onClick:O=>{O.stopPropagation(),Mg(t.id,!0)},children:y.jsx(Va,{className:"size-4"})})}):null]})]}),y.jsxs("div",{className:"mt-1 pl-[30px]",onClick:r?O=>O.stopPropagation():void 0,children:[r?y.jsx(iT,{label:"Edit comment",placeholder:"Edit comment",submitLabel:"Save",value:l,onChange:u,busy:d,autoFocus:!0,onSubmit:O=>{h(!0),lie(t.id,e.id,O).finally(()=>h(!1))},onCancel:()=>l.trim()!==e.text.trim()?g("discard"):T()}):y.jsx(vme,{text:e.text,lines:o?12:4}),y.jsx(yme,{thread:t.id,message:e})]}),y.jsx(Jf,{open:p==="delete",onOpenChange:O=>!O&&g(null),title:n&&t.messages.length>1?"Delete this thread?":"Delete this comment?",description:n&&t.messages.length>1?"The comment and its replies will be deleted for everyone.":"It will be deleted for everyone.",confirmLabel:"Delete",danger:!0,onConfirm:()=>{x5(t.id,n?void 0:e.id)}}),y.jsx(Jf,{open:p==="discard",onOpenChange:O=>!O&&g(null),title:"Discard changes?",description:"What you have typed in this comment will be lost.",confirmLabel:"Discard",danger:!0,onConfirm:T})]})}const Sme=t=>{const e=St.anchorOf(t).kind;return e==="cell"||e==="cells"};function jme({thread:t,hold:e}){return t.label?e==="detached"?y.jsxs("div",{className:"mb-2 truncate text-[12px] text-chrome-muted",title:Sme(t)?"The cells this was on were deleted":"The words this was on were deleted",children:[y.jsx("span",{className:"font-medium",children:"was on:"})," ",y.jsx("span",{className:"line-through",children:t.label})]}):y.jsx("div",{className:"mb-2 truncate border-l-2 border-[rgb(255_196_0/0.8)] pl-2 text-[12px] text-chrome-muted",children:t.label}):null}function Cme({thread:t}){const e=kt(s=>s.agent),n=t.status==="open"?t.agent?.status:void 0;if(n!=="pending"&&n!=="delivered")return null;const o=Ci();return y.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] text-chrome-muted",role:"status",children:[y.jsx(rT,{name:o,agent:!0,size:"md"}),y.jsx("span",{className:"truncate",children:n==="pending"?yW({name:o,...e?.wakesIdle!==void 0?{wakesIdle:e.wakesIdle}:{}}):t.agent?.drafted?vW(o).label:"Working…"})]})}function Tme({thread:t}){const e=St.store(p=>p.replies[t.id]?.text??""),[n,o]=S.useState(!1),[s,i]=S.useState(!1),[r,l]=S.useState(null);kt(p=>p.agent);const u=p=>St.store.getState().setReply(t.id,{text:p,send:!1}),d=Wb(e),h=Rs()?{checked:d||(r??u5(t,e)),locked:d,onChange:l}:void 0;return y.jsxs("div",{className:"mt-3",onClick:p=>p.stopPropagation(),children:[y.jsx(iT,{compact:!0,label:"Reply",placeholder:t.status==="resolved"?"Reply to reopen…":"Reply",submitLabel:"Reply",value:e,onChange:u,busy:n,sendBox:h,onSubmit:p=>{o(!0),aie(t.id,p,h?.checked).then(g=>g&&l(null)).finally(()=>o(!1))},onCancel:()=>e.trim()?i(!0):Ns(null)}),y.jsx(Jf,{open:s,onOpenChange:i,title:"Discard reply?",description:"Your unsent reply will be lost.",confirmLabel:"Discard",danger:!0,onConfirm:()=>{u(""),Ns(null)}})]})}function fT({thread:t,open:e,cardRef:n,onOpen:o}){const s=t.messages[0],i=Js(),r=s.text.trim(),l=s.reactions?.find(h=>h.emoji===r)?.authors??[],u=[s.author,...l.filter(h=>h.name!==s.author.name||h.kind!==s.author.kind)].map(h=>gr(h,i)?"You":h.name),d=gr(s.author,i)||l.some(h=>gr(h,i));return y.jsx("div",{ref:n,className:"flex","data-comment-card":t.id,children:y.jsx(wn,{label:`${u.join(", ")} reacted`,side:"left",children:y.jsxs("button",{type:"button","aria-pressed":d,"aria-label":`${r} ${NR(t)}: ${u.join(", ")}`,disabled:!Fo(),onFocus:o,onClick:()=>{o(),cie(t,l5(t,i,Fo(),Zg()))},className:He("flex h-6 items-center gap-1 rounded-full border px-2 leading-none transition-colors disabled:opacity-100",d?"border-chrome-accent/35 bg-chrome-accent/10 text-chrome-accent hover:bg-chrome-accent/15":"border-chrome-line bg-chrome text-chrome-muted hover:bg-chrome-hover",e&&"ring-1 ring-chrome-accent/60"),children:[y.jsx("span",{className:"text-[15px] leading-none",children:r}),y.jsx("span",{className:"text-[12px] tabular-nums",children:NR(t)})]})})})}function Eme(t,e){const n=[...t.ownerDocument.querySelectorAll("[data-comment-card]")].sort((o,s)=>o.getBoundingClientRect().top-s.getBoundingClientRect().top);n[n.indexOf(t)+e]?.focus()}function zF({thread:t,hold:e,open:n,inList:o=!1,tabName:s,removablePlace:i,cardRef:r,onOpen:l}){const[u,...d]=t.messages;if(!u)return null;const h=t.status==="resolved",p=n?d:[];return y.jsxs("div",{ref:r,role:"article","aria-label":`Comment by ${u.author.name}${t.label?` on “${t.label}”`:""}${h?". Resolved.":""}`,"data-comment-card":t.id,"data-open":n?"":void 0,tabIndex:n?-1:0,onClick:()=>!n&&l(),onKeyDown:g=>{if(g.target===g.currentTarget)if((g.key==="Enter"||g.key===" ")&&!n)g.preventDefault(),l();else if(g.key==="Enter"&&n){const b=g.currentTarget.querySelector("[data-comment-composer] textarea");if(!b)return;g.preventDefault(),b.focus()}else g.key==="ArrowDown"||g.key==="ArrowUp"?(g.preventDefault(),Eme(g.currentTarget,g.key==="ArrowDown"?1:-1)):g.key==="Escape"&&n&&(g.preventDefault(),Ns(null))},className:He("pointer-events-auto rounded-[12px] bg-chrome p-3 text-chrome-fg shadow-chrome outline-none transition-[transform,box-shadow] duration-150",n?"ring-1 ring-chrome-accent/50 shadow-chrome-popup":"cursor-pointer hover:shadow-chrome-popup",h&&!n&&"opacity-70"),children:[o&&s?y.jsx("div",{className:"mb-1 truncate text-[11px] font-medium uppercase tracking-wide text-chrome-muted",children:s}):null,o||e==="detached"?y.jsx(jme,{thread:t,hold:e}):null,h?y.jsxs("div",{className:"mb-2 flex items-center gap-1 text-[12px] text-chrome-muted",children:[y.jsx(aK,{className:"size-3.5 text-chrome-accent"}),zse(t,Js(),Ci())]}):null,y.jsx(lD,{thread:t,message:u,root:!0,open:n,removablePlace:i}),p.length?y.jsx("div",{className:"mt-3 flex flex-col gap-3",children:p.map(g=>y.jsx(lD,{thread:t,message:g,root:!1,open:n,removablePlace:void 0},g.id))}):null,!n&&d.length?y.jsx("div",{className:"mt-2 pl-[30px] text-[12px] font-medium text-chrome-muted",children:d.length===1?"1 reply":`${d.length} replies`}):null,n?y.jsx("div",{className:"mt-3 empty:hidden",children:y.jsx(Cme,{thread:t})}):null,n&&Fo()?y.jsx(Tme,{thread:t}):null]})}const _me=[{value:"open",label:"Open"},{value:"resolved",label:"Resolved"},{value:"all",label:"All"}];function Mme(t,e){const n=new Map;for(const i of t){const r=St.anchorOf(i).tab,l=r!==null&&e.some(u=>u.id===r)?r:null;n.set(l,[...n.get(l)??[],i])}const o=[],s=n.get(null);s&&o.push({tab:null,name:null,threads:s.sort(DR)});for(const i of e){const r=n.get(i.id);r&&o.push({tab:i.id,name:i.name,threads:r.sort(DR)})}return o}const Ome=320,cD=240,uD=600;function Ame(){const t=Sr(g=>g.threads),e=Sr(g=>g.active),n=kt(g=>g.filter),o=kt(g=>g.placed),s=he(g=>g.project?.files),i=he(g=>g.activeTab),r=kt(g=>!!g.composer&&g.composer.anchor.tab===i),l=S.useRef(null);S.useLayoutEffect(()=>{r&&l.current&&(l.current.scrollTop=0)},[r]);const u=S.useMemo(()=>{const g=t.filter(b=>n==="all"||(n==="open"?b.status==="open":b.status==="resolved"));return Mme(g,s??[])},[t,n,s]),d=u.length>1,h=mL("docs.comments.width",Ome,cD,uD),p=mC(pC,!1);return y.jsxs("aside",{className:"relative flex max-w-[max(20rem,calc(100vw-24rem))] flex-none flex-col border-l border-chrome-line bg-chrome text-chrome-fg",style:p?{width:"100%",maxWidth:"none"}:{width:h.width},"aria-label":"Comments",children:[y.jsxs("div",{className:"flex h-11 flex-none items-center gap-2 border-b border-chrome-line pr-2 pl-4",children:[y.jsx("div",{className:"min-w-0 flex-1 truncate text-[13px] font-semibold",children:"Comments"}),y.jsx("button",{type:"button","aria-label":"Close comments",onClick:()=>lt({comments:"margin"}),className:"grid size-7 place-items-center rounded-md text-chrome-muted hover:bg-chrome-hover",children:y.jsx(As,{className:"size-4"})})]}),y.jsx("div",{className:"flex-none px-3 py-2",children:y.jsx(NY,{"aria-label":"Filter comments",value:n,options:_me,onChange:g=>Bn({filter:g}),className:"w-full [&>*]:flex-1"})}),y.jsxs("div",{ref:l,className:"min-h-0 flex-1 overflow-y-auto px-3 pb-6",children:[r&&y.jsx(aT,{}),u.length===0&&!r?y.jsx("div",{className:"py-10 text-center text-[13px] text-chrome-muted",children:"No comments"}):u.map(g=>y.jsxs("section",{className:"mt-2 flex flex-col gap-2","aria-label":g.name??"Doc",children:[d&&g.name?y.jsx("h3",{className:"px-1 pt-2 text-[11px] font-medium uppercase tracking-wide text-chrome-muted",children:g.name}):null,g.threads.map(b=>{const w=b.id===e,k=()=>{v5(b)},j=o.tab!==null&&o.tab===g.tab?o.holds[b.id]:void 0;return Du(b)?y.jsx(fT,{thread:b,open:w,onOpen:k},b.id):y.jsx(zF,{thread:b,hold:j,open:w,inList:!0,tabName:!d&&g.tab!==i?g.name:null,onOpen:k},b.id)})]},g.tab??""))]}),y.jsx(pL,{label:"Resize comments",side:"left",width:h.width,min:cD,max:uD,onResize:h.resize,onReset:h.reset})]})}const IF=320,LF=26;function Rme(){const t=he(i=>i.comments),e=he(i=>i.activeTab),n=St.store(i=>i.available),o=Nme(),s=mC(pC,!1);return n?t==="all"?y.jsx(Ame,{}):t==="hidden"||!e?null:s?y.jsx(zme,{tab:e}):y.jsx(Pme,{tab:e,room:o}):null}const Sf=()=>document.querySelector("[data-doc-scroll]");function Nme(){const[t,e]=S.useState(!0);return S.useLayoutEffect(()=>{const n=Sf(),o=n?.parentElement,s=n?.firstElementChild;if(!n||!o||!(s instanceof HTMLElement))return;const i=()=>{let l=o.clientWidth;for(const d of o.children){if(d===n||!(d instanceof HTMLElement)||d.hasAttribute("data-margin"))continue;const{position:h}=getComputedStyle(d);h!=="absolute"&&h!=="fixed"&&(l-=d.offsetWidth)}const u=Number.parseFloat(getComputedStyle(s).maxWidth);e(!Number.isFinite(u)||l>=u+IF)};if(i(),typeof ResizeObserver>"u")return;const r=new ResizeObserver(i);for(const l of[o,n,s])r.observe(l);return()=>r.disconnect()},[]),t}function Dme(t,e,n){let o;try{if(e.kind==="words")o=t.coordsAtPos(e.from,1).top;else{const s=t.nodeDOM(e.from);o=s instanceof HTMLElement?s.getBoundingClientRect().top:t.coordsAtPos(Math.min(e.from+1,t.state.doc.content.size)).top}}catch{return null}return o-n.getBoundingClientRect().top+n.scrollTop}function Pme({tab:t,room:e}){const n=Sr(z=>z.threads),o=Sr(z=>z.active),s=kt(z=>z.composer),i=kt(z=>z.activePlace),r=kt(z=>z.placed.tab===t?z.placed.holds:null),l=me(S$(z=>({view:z.view,state:z.state,tab:z.tab}))),u=l.tab===t&&!!l.view&&!!r,d=Cr(z=>z.feeds);S.useEffect(()=>(oD(e?"cards":"icons"),()=>oD("off")),[e]);const h=S.useMemo(()=>{if(!u)return[];const z=[];for(const U of n)r?.[U.id]&&(U.status!=="open"&&U.id!==o||z.push({id:U.id,thread:U}));s&&s.anchor.tab===t&&z.push({id:bi,thread:null});for(const U of Object.values(d))for(const J of U.cards)z.push({id:J.id,thread:null,card:J});return z},[u,n,r,o,s,t,d]),p=S.useRef(null),g=S.useRef(new Map),b=S.useRef(new Map),[w,k]=S.useState(new Map),[j,C]=S.useState([]),[_,T]=S.useState(0),M=S.useRef(new Set),O=S.useCallback(()=>T(z=>z+1),[]),N=S.useMemo(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(z=>{let U=!1;for(const J of z){const X=J.target.dataset.marginItem;if(!X)continue;const oe=J.target.offsetHeight;b.current.get(X)!==oe&&(b.current.set(X,oe),U=!0)}U&&O()}),[O]);S.useEffect(()=>()=>N?.disconnect(),[N]);const D=S.useRef(new Map),E=z=>{let U=D.current.get(z);return U||(U=J=>{const X=g.current.get(z);if(X&&X!==J&&N?.unobserve(X),!J){g.current.delete(z),D.current.delete(z);return}g.current.set(z,J),b.current.set(z,J.offsetHeight),N?.observe(J)},D.current.set(z,U)),U};S.useEffect(()=>{const z=Sf();if(!z)return;const U=()=>{p.current&&(p.current.style.transform=`translateY(${-z.scrollTop}px)`)};U(),z.addEventListener("scroll",U,{passive:!0});const J=typeof ResizeObserver>"u"?null:new ResizeObserver(O);return J?.observe(z),z.firstElementChild&&J?.observe(z.firstElementChild),window.addEventListener("resize",O),()=>{z.removeEventListener("scroll",U),J?.disconnect(),window.removeEventListener("resize",O)}},[O,h.length>0]);const R=s&&s.anchor.tab===t?bi:o,B=S.useRef({id:null,at:0});R!==B.current.id&&(B.current={id:R,at:Date.now()});const I=new Set(h.map(z=>z.id)),P=new Set(Object.values(d).flatMap(z=>z.focus?[z.focus]:[])),$=Ype([[R,B.current.at],...Object.values(d).map(z=>[z.focus,z.focusedAt])],z=>I.has(z));S.useLayoutEffect(()=>{const z=Sf(),U=l.view;if(!z||!U||!u)return;let J=0;const X=U.dom.firstElementChild;X instanceof HTMLElement&&(J=X.getBoundingClientRect().top-z.getBoundingClientRect().top+z.scrollTop);const oe=h.map(ce=>{const ye=ce.card?void 0:iC(l.state,ce.id)[0],Ce=ce.card?ce.card.anchor(z):ye?Dme(U,ye,z):null;return{id:ce.id,top:Ce??J,height:b.current.get(ce.id)??0}});oe.sort((ce,ye)=>ce.top-ye.top);let ie;const be=new Set(h.flatMap(ce=>ce.thread&&Du(ce.thread)?[ce.id]:[]));if(e)ie=EF(oe,$),C(ce=>ce.length?[]:ce);else{const ce=Xpe(oe.filter(Ce=>Ce.id!==bi)),ye=oe.find(Ce=>Ce.id===$&&!be.has(Ce.id));ie=new Map(ye?[[ye.id,ye.top+LF+4]]:[]),C(Ce=>JSON.stringify(Ce)===JSON.stringify(ce)?Ce:ce)}k(ce=>ce.size===ie.size&&[...ie].every(([ye,Ce])=>ce.get(ye)===Ce)?ce:ie)},[h,l.state,l.view,u,$,_,e]),S.useEffect(()=>{M.current=new Set([...w.keys()])},[w]);const W=S.useRef(null),K=h.length>0;if(S.useLayoutEffect(()=>{const z=Sf(),U=z?.parentElement;if(!z||!U||!K)return;const J=()=>{if(!W.current)return;const oe=U.getBoundingClientRect().right-z.getBoundingClientRect().right;W.current.style.right=`${Math.max(0,oe)+z.offsetWidth-z.clientWidth}px`};e&&(z.style.paddingRight=`${IF}px`),z.dataset.marginColumn=e?"rail":"icons",J();const X=typeof ResizeObserver>"u"?null:new ResizeObserver(J);return X?.observe(z),X?.observe(U),()=>{X?.disconnect(),z.style.paddingRight="",delete z.dataset.marginColumn}},[K,e]),!h.length)return null;const F=new Map(h.map(z=>[z.id,z])),q=(z,U)=>{const J=F.get(z);J?.card?J.card.select(U):J?.thread&&Ns(U?z:null)},H=z=>{const U=$?z.indexOf($):-1,J=U!==-1&&z.length===1?null:z[(U+1)%z.length];$&&$!==J&&q($,!1),J&&q(J,!0)},Y=e?h:h.filter(z=>w.has(z.id)&&!(z.thread&&Du(z.thread))),ne=z=>{const U=z.target;U instanceof HTMLTextAreaElement&&U.scrollHeight>U.clientHeight||Sf()?.scrollBy({top:z.deltaY,left:0})};return y.jsx("div",{ref:W,className:He("pointer-events-none absolute inset-y-0 right-0 w-80 max-w-full overflow-hidden [&_[data-margin-item]]:pointer-events-auto",e?"z-10":"z-30"),"aria-label":"Comments",role:"complementary","data-margin":"",onWheel:ne,children:y.jsxs("div",{ref:p,className:"absolute inset-x-0 top-0",children:[e?null:j.map(z=>y.jsx(Bme,{row:z,items:F,open:$,onChoose:H},z.ids.join(" "))),Y.map(z=>{const U=w.get(z.id),J=e?z.card?P.has(z.id):z.id===R:z.id===$,X={top:U??0,visibility:U===void 0?"hidden":void 0};return y.jsx("div",{ref:E(z.id),"data-margin-item":z.id,className:He("absolute inset-x-0 px-3",M.current.has(z.id)&&"transition-[top,transform] duration-150",J&&e&&"-translate-x-2"),style:X,children:z.card?z.card.render(J):z.thread?y.jsx($F,{thread:z.thread,hold:r?.[z.id],open:J,place:i}):y.jsx(aT,{})},z.id)})]})})}function Bme({row:t,items:e,open:n,onChoose:o}){const s=t.ids.flatMap(h=>{const p=e.get(h)?.thread;return p&&Du(p)?[p]:[]}),i=t.ids.filter(h=>!s.some(p=>p.id===h)),r=i.filter(h=>e.get(h)?.thread).length,l=i.reduce((h,p)=>{const g=e.get(p);return g?.thread?h:h+(g?.card?.count??1)},0),u=[r?`${r} ${r===1?"comment":"comments"}`:"",l?`${l} ${l===1?"suggestion":"suggestions"}`:""].filter(Boolean).join(", "),d=r?cj:Uh;return y.jsxs("div",{className:"absolute right-3 flex items-center gap-1",style:{top:t.top,height:LF},"data-margin-marker":t.ids.join(" "),children:[s.map(h=>y.jsx("div",{className:"pointer-events-auto",onMouseDown:p=>p.preventDefault(),children:y.jsx(fT,{thread:h,open:!1,onOpen:()=>Ns(h.id)})},h.id)),i.length?y.jsxs("button",{type:"button","aria-label":`${u} on this line`,title:`${u} on this line`,"aria-pressed":!!n&&i.includes(n),className:He("pointer-events-auto inline-flex h-full items-center gap-1 rounded-md px-1.5 text-[12px] text-chrome-muted transition-colors hover:bg-chrome-hover hover:text-chrome-fg",n&&i.includes(n)&&"bg-chrome-hover text-chrome-fg ring-1 ring-chrome-accent/60"),onMouseDown:h=>h.preventDefault(),onClick:()=>o(i),children:[y.jsx(d,{className:"size-3.5",strokeWidth:1.75,"aria-hidden":"true"}),r+l]}):null]})}function zme({tab:t}){const e=Sr(d=>d.active),n=Sr(d=>d.active?d.threads.find(h=>h.id===d.active):void 0),o=kt(d=>d.composer),s=kt(d=>d.activePlace),i=kt(d=>d.placed.tab===t?d.placed.holds:null),r=!!o&&o.anchor.tab===t,l=!r&&!!n&&e!==bi&&!!i?.[n.id];if(!r&&!l)return null;const u=()=>r?j1():Ns(null);return y.jsxs(y.Fragment,{children:[y.jsx("div",{className:"fixed inset-0 z-40 bg-black/30","aria-hidden":"true",onClick:u}),y.jsx("div",{role:"dialog","aria-label":r?"New comment":"Comment",className:"fixed inset-x-0 bottom-0 z-50 max-h-[70vh] overflow-y-auto rounded-t-2xl bg-chrome p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] shadow-chrome-popup",children:l&&n?y.jsx($F,{thread:n,hold:i?.[n.id],open:!0,place:s}):y.jsx(aT,{})})]})}function $F({thread:t,hold:e,open:n,place:o}){const s=me(l=>l.state),i=()=>Ns(t.id);if(Du(t))return y.jsx(fT,{thread:t,open:n,onOpen:i});const r=n&&Use(s,t)>1?o:void 0;return y.jsx(zF,{thread:t,hold:e,open:n,removablePlace:r,onOpen:i})}function Ime({draft:t}){const e=S.useRef(null);return S.useEffect(()=>{t.copy==="manual"&&(e.current?.focus(),e.current?.select())},[t.copy]),y.jsxs("div",{role:"alert","data-testid":"refused-draft","data-copy":t.copy,className:"pointer-events-auto flex w-full max-w-[420px] items-start gap-2.5 rounded-lg border border-chrome-line bg-chrome px-3 py-2.5 text-[13px] text-chrome-fg shadow-sm",children:[y.jsx(mz,{className:"mt-0.5 size-4 flex-none text-danger","aria-hidden":!0}),y.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[y.jsx("p",{className:"font-medium",children:t.title}),y.jsx("p",{className:"text-chrome-muted",children:t.detail}),y.jsx("p",{children:t.advice}),t.copy==="manual"?y.jsxs(y.Fragment,{children:[y.jsx("p",{className:"text-chrome-muted",children:"Copying isn’t available here. Select the text and copy it yourself:"}),y.jsx("textarea",{ref:e,readOnly:!0,"aria-label":"Your draft",value:t.text,rows:Math.min(6,t.text.split(`
|
|
76
|
-
`).length+1),className:"w-full resize-y rounded-control border border-chrome-line bg-surface px-2 py-1 text-[13px] text-fg"})]}):y.jsxs("p",{className:"line-clamp-2 text-chrome-muted",children:["“",t.text,"”"]}),y.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[y.jsx(Mt,{size:"sm",onClick:()=>{Jse(t.id)},children:"Copy draft"}),t.copy==="copied"?y.jsx("span",{role:"status",className:"text-chrome-muted",children:"Copied the whole draft"}):null]})]}),y.jsx(PW,{size:"sm",label:"Close",icon:y.jsx(As,{className:"size-3.5"}),onClick:()=>Gse(t.id)})]})}function Lme(){const t=nd(e=>e.drafts);return t.length?y.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-6 z-40 flex flex-col items-center gap-2 px-4",children:t.map(e=>y.jsx(Ime,{draft:e},e.id))}):null}ko({plugins:()=>[Vse()]});ht("topBar","comments",Vpe,30);ht("rail","comments",Rme,10);ht("overlay","comment-reaction-picker",bme);ht("float","refused-comments",Lme,40);Upe(t=>{oie(t)});function FF(){const t=me.getState().state;if(!t||!t.selection.empty)return!1;const e=c5(t,t.selection.from);return!e||!ed(e.id)?!1:(ke().comments==="hidden"&<({comments:"margin"}),Ns(e.id,e.place),!0)}Wa("comment",()=>FF()?!0:!Fo()||!me.getState().view?!1:(g5(),!0));Wa("toggleComments",()=>St.store.getState().available?(lt({comments:ke().comments==="hidden"?"margin":"hidden"}),!0):!1);h$("comment",{label:"Comment",shortcut:"Mod-Alt-m",icon:zK,available:()=>lC(me.getState().state),run:()=>{FF()||g5()}});h$("react",{label:"Add a reaction",icon:_z,available:()=>lC(me.getState().state),run:t=>{const{top:e,left:n,width:o,height:s}=t.getBoundingClientRect();Bn({picker:{top:e,left:n,width:o,height:s}})}});function dD(t,e){const n=new Set;for(const o of t)o.kind==="person"&&o.name&&o.name!==e&&n.add(o.name);return[...n]}function $me(){const t=Ase(window.location.href);if(!t)return;const e=ed(t);e&&v5(e);try{window.history.replaceState(window.history.state,"",Rse(window.location.href))}catch{}}let fD=!1;async function Fme(){const t=In();if(!t||fD)return;fD=!0,kW(t.agent,n=>Bn({agent:n}));const e=t.room;if(e){const n=t.viewer.name;e.peers().then(o=>Bn({peers:dD(o,n)}),()=>{}),e.onPeers(o=>Bn({peers:dD(o,n)}))}await St.start(t.comments),$me()}he.subscribe(t=>{t.phase.kind==="ready"&&Fme()});const Hme={rowAbove:eK,rowBelow:ZV,colLeft:nK,colRight:tK,move:QB,up:sj,down:JV,left:YB,right:XB,width:fj,delete:dj,sortAsc:QV,sortDesc:XV,alignLeft:ZK,alignCenter:JK,alignRight:QK,merge:GK,split:XK,headerRow:FK,headerColumn:$K};function HF({name:t}){const e=Hme[t];return y.jsx(e,{className:"size-4",strokeWidth:1.75})}const qme=["up","down","left","right"],Ume={up:"Move row up",down:"Move row down",left:"Move column left",right:"Move column right"};function hT(t){switch(t.reason){case"edge":return t.dir==="up"?"This row is already at the top.":t.dir==="down"?"This row is already at the bottom.":t.dir==="left"?"This column is already at the far left.":"This column is already at the far right.";case"header":return"Header rows stay at the top.";case"spans":return t.kind==="row"?"Rows with cells merged across rows can’t move.":"Columns with merged cells can’t move."}}function Vme(t,e,n){return`${t==="up"||t==="down"?"Row":"Column"} moved ${t}, ${e} of ${n}`}const pg=672,Kme=[{key:"narrow",label:"Narrow",px:Math.floor(pg/6)},{key:"medium",label:"Medium",px:Math.floor(pg/3)},{key:"wide",label:"Wide",px:Math.floor(pg/2)},{key:"extraWide",label:"Extra wide",px:pg}],Wme=48,Yme=4e3,qF=[{label:"None",value:null},{label:"Gray",value:"#f0efec"},{label:"Red",value:"#fbebeb"},{label:"Orange",value:"#f9ece7"},{label:"Yellow",value:"#f9eeda"},{label:"Green",value:"#e5f4e4"},{label:"Blue",value:"#e7f1fb"},{label:"Purple",value:"#efedff"}],Gme=t=>typeof t=="string"&&/^#[0-9a-f]{6}$/i.test(t),UF=t=>{if(!t.childCount)return!1;let e=!0;return t.forEach(n=>{n.attrs.header!==!0&&(e=!1)}),e};function Tr(t){let e=0;for(;e<t.childCount&&UF(t.child(e));)e++;return e}function zy(t){const e=ut.get(t);if(!e.height)return!1;for(let n=0;n<e.height;n++)if(t.nodeAt(e.map[n*e.width])?.attrs.header!==!0)return!1;return!0}function pp(t){const e=ut.get(t),n=[];let o=0;return t.forEach((s,i,r)=>{s.forEach((l,u)=>{const d=o+1+u,h=e.findCell(d);n.push({node:l,pos:d,row:r,...h})}),o+=s.nodeSize}),n}function Xme(t,e){const n=t.doc.nodeAt(e);if(!n||n.type.spec.tableRole!=="table"||!n.childCount)return!1;const o=n.child(0),s=!UF(o),i=e+2;return o.forEach((r,l)=>{r.attrs.header!==s&&t.setNodeMarkup(i+l,void 0,{...r.attrs,header:s})}),!0}function Jme(t,e){const n=t.doc.nodeAt(e);if(!n||n.type.spec.tableRole!=="table"||!n.childCount)return!1;const o=!zy(n);for(const s of pp(n))s.left!==0||s.node.attrs.header===o||t.setNodeMarkup(e+1+s.pos,void 0,{...s.node.attrs,header:o});return!0}function hD(t,e,n,o){const s=t.doc.nodeAt(e);if(s)for(const i of pp(s)){if(!(n.kind==="row"?i.top===n.index:i.left===n.index))continue;const l=n.kind==="row"?n.index<o.rows||o.column&&i.left===0:i.top<o.rows||o.column&&n.index===0;i.node.attrs.header!==l&&t.setNodeMarkup(e+1+i.pos,void 0,{...i.node.attrs,header:l})}}function VF(t,e){const n=ut.get(t);if(e<=0||e>=n.height)return e===0||e===n.height;for(let o=0;o<n.width;o++)if(n.map[(e-1)*n.width+o]===n.map[e*n.width+o])return!1;return!0}function KF(t,e){const n=ut.get(t);if(e<=0||e>=n.width)return e===0||e===n.width;for(let o=0;o<n.height;o++)if(n.map[o*n.width+e-1]===n.map[o*n.width+e])return!1;return!0}function WF(t,e,n,o){const s=ut.get(t),i=o==="up"||o==="down"?"row":"col",r=i==="row"?e:n,l=i==="row"?s.height:s.width,u=o==="up"||o==="left",d=i==="row"?Tr(t):0,h=g=>({dir:o,kind:i,from:r,ok:!1,reason:g});if(r<0||r>=l)return h("edge");if(r<d||u&&d>0&&r===d)return h("header");if(u?r===0:r===l-1)return h("edge");const p=g=>i==="row"?VF(t,g):KF(t,g);if(!p(r)||!p(r+1))return h("spans");if(u){for(let g=r-1;g>=d;g--)if(p(g))return{dir:o,kind:i,from:r,ok:!0,boundary:g}}else for(let g=r+2;g<=l;g++)if(p(g))return{dir:o,kind:i,from:r,ok:!0,boundary:g};return h(d>0?"header":"edge")}function YF(t,e,n,o){const s=ut.get(t),i=e==="row"?s.height:s.width,r=o<=n,l=e==="row"?r?"up":"down":r?"left":"right",u=p=>({dir:l,kind:e,from:n,ok:!1,reason:p});if(n<0||n>=i||o<0||o>i)return u("edge");const d=e==="row"?Tr(t):0;if(n<d||o<d)return u("header");const h=p=>e==="row"?VF(t,p):KF(t,p);return!h(n)||!h(n+1)||!h(o)?u("spans"):{dir:l,kind:e,from:n,ok:!0,boundary:o}}const uw=(t,e)=>e>t?e-1:e;function Qme(t,e,n){const o=[];t.forEach(i=>o.push(i));const[s]=o.splice(e,1);return o.splice(uw(e,n),0,s),o}function Zme(t,e,n){const o=pp(t),s=[];return t.forEach((i,r,l)=>{const u=o.filter(g=>g.row===l),d=u.find(g=>g.left===e);if(!d){s.push(i);return}const h=u.filter(g=>g!==d),p=h.findIndex(g=>g.left>=n);h.splice(p<0?h.length:p,0,d),s.push(i.copy(de.from(h.map(g=>g.node))))}),s}function GF(t,e,n){const o=t.doc.nodeAt(e);o&&t.replaceWith(e+1,e+o.nodeSize-1,de.from(n))}function ege(t){return t?t.textBetween(0,t.content.size," ",e=>e.type.name==="date"&&typeof e.attrs.ts=="string"?e.attrs.ts:"").trim():""}function tge(t){let e=t.replace(/[$€£%]/g,"").trim();if(/^-?\d{1,3}(,\d{3})+(\.\d+)?$/.test(e)&&(e=e.replaceAll(",","")),!e||/[,\s]/.test(e))return null;const n=Number(e);return Number.isFinite(n)?n:null}function XF(t){const e=ut.get(t),n=Tr(t);if(e.height-n<2||e.problems?.some(o=>o.type!=="colwidth mismatch"))return!1;for(let o=0;o<t.childCount;o++){let s=!1;if(t.child(o).forEach(i=>{(i.attrs.rowspan??1)>1&&o+i.attrs.rowspan>n&&(s=!0)}),s)return!1}return!0}function JF(t,e,n){const o=ut.get(t),s=Tr(t),i=[];for(let d=s;d<o.height;d++)i.push(ege(t.nodeAt(o.map[d*o.width+e])));const r=i.map(tge),l=i.some(Boolean)&&i.every((d,h)=>!d||r[h]!==null),u=n==="asc"?1:-1;return i.map((d,h)=>({key:d,index:h})).sort((d,h)=>{if(!d.key||!h.key)return d.key?-1:h.key?1:d.index-h.index;const p=l?r[d.index]-r[h.index]:d.key.localeCompare(h.key,void 0,{numeric:!0,sensitivity:"base"});return u*p||d.index-h.index}).map(d=>s+d.index)}function nge(t,e,n){const o=JF(t,e,n),s=Tr(t);if(o.every((r,l)=>r===s+l))return null;const i=[];for(let r=0;r<s;r++)i.push(t.child(r));for(const r of o)i.push(t.child(r));return i}function oge(t,e){let n;for(const o of pp(t)){if(e<o.left||e>=o.right)continue;const s=o.node.attrs.colwidth,i=Array.isArray(s)&&s[e-o.left]?s[e-o.left]:null;if(n===void 0)n=i;else if(n!==i)return null}return n??null}function sge(t,e,n,o){if(o!==null&&!Number.isFinite(o))return!1;const s=t.doc.nodeAt(e);if(!s)return!1;const i=o===null?0:Math.min(Yme,Math.max(Wme,Math.trunc(o)));let r=!1;for(const l of pp(s)){const u=n.filter(b=>b>=l.left&&b<l.right);if(!u.length)continue;const d=l.right-l.left,h=l.node.attrs.colwidth,p=Array.from({length:d},(b,w)=>Array.isArray(h)&&Number(h[w])||0);for(const b of u)p[b-l.left]=i;const g=p.some(Boolean)?p:null;JSON.stringify(g)!==JSON.stringify(h??null)&&(t.setNodeMarkup(e+1+l.pos,void 0,{...l.node.attrs,colwidth:g}),r=!0)}return r}function pD(t,e,n,o){let s=!1;for(const{pos:i,node:r}of e)(r.attrs[n]??null)!==o&&(t.setNodeMarkup(i,void 0,{...r.attrs,[n]:o}),s=!0);return s}function ji(t,e){if(e<0||e>t.doc.content.size)return null;const n=t.doc.resolve(e),o=n.nodeAfter;if(!o||o.type.spec.tableRole!=="cell")return null;const s=n.node(-1);if(s.type.spec.tableRole!=="table")return null;const i=n.before(-1),r=ut.get(s).findCell(e-i-1);return{tablePos:i,table:s,cellPos:e,cell:o,row:r.top,col:r.left}}function dw(t){const e=t.selection;if(e instanceof Et)return ji(t,e.$headCell.pos);const n=es(e.$head);return n?ji(t,n.pos):null}function $a(t){return{bid:t.cell.attrs.bid??null,pos:t.cellPos}}function ao(t,e){if(e.bid){let n=null;if(t.doc.descendants((o,s)=>n!==null?!1:(o.type.spec.tableRole==="cell"&&o.attrs.bid===e.bid&&(n=s),n===null&&!o.isTextblock)),n!==null)return ji(t,n)}return ji(t,e.pos)}function nk(t,e){const n=t.selection,o=[];if(n instanceof Et)n.forEachCell((s,i)=>o.push({pos:i,node:s}));else{const s=e??dw(t);s&&o.push({pos:s.cellPos,node:s.cell})}return o}const Nl=(t,e)=>{const n=t.selection;if(!(n instanceof Et))return!1;let o=!1;return n.forEachCell((s,i)=>{i===e&&(o=!0)}),o};function fw(t,e){const n=Ke.findFrom(t.doc.resolve(e+1),1,!0);return n?t.setSelection(n):t}function Iy(t,e,n,o){const s=t.doc.nodeAt(e);if(!s)return t;const i=ut.get(s),r=Math.min(Math.max(n,0),i.height-1),l=Math.min(Math.max(o,0),i.width-1);return fw(t,e+1+i.map[r*i.width+l])}function pT(t,e){const n=ao(t.state,e);if(!n)return null;if(!Nl(t.state,n.cellPos)){const o=fw(t.state.tr,n.cellPos);o.selection.eq(t.state.selection)||t.dispatch(o)}return ao(t.state,e)}function Rh(t,e,n){let o=null;if(!e(t.state,r=>{o=r})||!o)return!1;const i=o;return n?.(i),t.dispatch(i.scrollIntoView()),!0}const ige={addRowBefore:"Insert row above",addRowAfter:"Insert row below",addColumnBefore:"Insert column left",addColumnAfter:"Insert column right"},rge={addRowBefore:"Row inserted above",addRowAfter:"Row inserted below",addColumnBefore:"Column inserted left",addColumnAfter:"Column inserted right"},age={addRowBefore:Mee,addRowAfter:Oee,addColumnBefore:jee,addColumnAfter:Cee},lge={addRowBefore:"rowAbove",addRowAfter:"rowBelow",addColumnBefore:"colLeft",addColumnAfter:"colRight"};function su(t,e,n){return{key:t,label:ige[t],icon:lge[t],run:o=>{const s=pT(o,e);if(!s)return n("That cell is gone.");Ig=t;const i=Ho(o.state),r=t==="addRowBefore"?i.top:t==="addRowAfter"?i.bottom:null,l=t==="addColumnBefore"?i.left:t==="addColumnAfter"?i.right:null,u={rows:Tr(s.table),column:zy(s.table)};Rh(o,age[t],h=>{r!==null?(hD(h,s.tablePos,{kind:"row",index:r},u),Iy(h,s.tablePos,r,s.col)):l!==null&&(hD(h,s.tablePos,{kind:"col",index:l},u),Iy(h,s.tablePos,s.row,l))})&&n(rge[t])}}}function sS(t,e,n){if(!(t.selection instanceof Et)||!Nl(t,n.cellPos))return 1;const o=Ho(t);return e==="row"?o.bottom-o.top:o.right-o.left}function cge(t,e){return e<=1?t==="row"?"Delete row":"Delete column":t==="row"?`Delete ${e} rows`:`Delete ${e} columns`}function Ly(t,e,n,o){return{key:t==="row"?"deleteRow":"deleteColumn",label:cge(t,n),icon:"delete",run:s=>{if(!pT(s,e))return o("That cell is gone.");const r=Ho(s.state);if(t==="row"?r.top===0&&r.bottom===r.map.height:r.left===0&&r.right===r.map.width){o(`That would delete every ${t==="row"?"row":"column"}, so nothing was deleted. To delete the whole table, choose Delete table.`);return}const u=t==="row"?r.bottom-r.top:r.right-r.left;Rh(s,t==="row"?Ree:Eee)&&o(t==="row"?u===1?"Row deleted":"Rows deleted":u===1?"Column deleted":"Columns deleted")}}}function uge(t,e){return{key:"deleteTable",label:"Delete table",danger:!0,run:n=>{if(!pT(n,t))return e("That cell is gone.");Rh(n,Iee)&&e("Table deleted")}}}function dge(t,e,n,o){const s=ao(t.state,e);if(!s)return o("That cell is gone.");const i=WF(s.table,s.row,s.col,n);if(!i.ok)return o(hT(i));QF(t,s,i.kind,i.boundary,o,n)}function QF(t,e,n,o,s,i){const r=n==="row"?e.row:e.col,l=uw(r,o);if(l===r)return!1;const u=n==="row"?Qme(e.table,r,o):Zme(e.table,r,o),d=t.state.tr;GF(d,e.tablePos,u),Iy(d,e.tablePos,n==="row"?l:e.row,n==="row"?e.col:l),t.dispatch(d.scrollIntoView());const h=ut.get(e.table),p=i??(n==="row"?l<r?"up":"down":l<r?"left":"right");return s(Vme(p,l+1,n==="row"?h.height:h.width)),!0}function mD(t,e,n){return{key:e==="asc"?"sortAsc":"sortDesc",label:e==="asc"?"Sort column ascending":"Sort column descending",icon:e==="asc"?"sortAsc":"sortDesc",run:o=>{const s=ao(o.state,t);if(!s||!XF(s.table))return;const i=nge(s.table,s.col,e),r=e==="asc"?"Column sorted ascending":"Column sorted descending";if(!i)return n(r);const l=JF(s.table,s.col,e),u=o.state.tr;GF(u,s.tablePos,i);const d=Tr(s.table),h=s.row<d?s.row:d+l.indexOf(s.row);Iy(u,s.tablePos,h,s.col),o.dispatch(u.scrollIntoView()),n(r)}}}const fge=[{value:null,label:"Align left",icon:"alignLeft",done:"Aligned left"},{value:"center",label:"Align center",icon:"alignCenter",done:"Aligned center"},{value:"right",label:"Align right",icon:"alignRight",done:"Aligned right"}];function ZF(t,e,n){const o=n===void 0?dw(t):ji(t,n);if(!o)return null;const s=$a(o),i=nk(t,Nl(t,o.cellPos)?null:o),r=qme.map(N=>{const D=WF(o.table,o.row,o.col,N);return{key:`move-${N}`,label:Ume[N],icon:N,disabledReason:D.ok?void 0:hT(D),run:E=>dge(E,s,N,e)}}),l=Nl(t,o.cellPos)?Ho(t):null,u=l?Array.from({length:l.right-l.left},(N,D)=>l.left+D):[o.col],d=u.map(N=>oge(o.table,N)),h=d.every(N=>N===d[0])?d[0]:void 0,p=(N,D,E)=>({key:D,label:N,checked:h===E,run:R=>{const B=ao(R.state,s);if(!B)return e("That cell is gone.");const I=R.state.tr;sge(I,B.tablePos,u,E)&&R.dispatch(I),e(`Column width set to ${N}`)}}),g=[...Kme.map(N=>p(N.label,N.key,N.px)),p("Auto","auto",null)],b=[Ly("row",s,sS(t,"row",o),e),Ly("col",s,sS(t,"col",o),e),uge(s,e)],w=XF(o.table)?[mD(s,"asc",e),mD(s,"desc",e)]:[],k=new Set(i.map(N=>N.node.attrs.align??null)),j=fge.map(N=>({key:N.icon,label:N.label,icon:N.icon,checked:k.size===1&&k.has(N.value),run:D=>{if(!ao(D.state,s))return e("That cell is gone.");const E=D.state.tr;pD(E,nk(D.state,Nl(D.state,o.cellPos)?null:ao(D.state,s)),"align",N.value)&&D.dispatch(E),e(N.done)}})),C=new Set(i.map(N=>N.node.attrs.background??null)),_={current:C.size===1?[...C][0]:void 0,pick:(N,D)=>{const E=ao(N.state,s);if(!E)return e("That cell is gone.");const R=N.state.tr;pD(R,nk(N.state,Nl(N.state,E.cellPos)?null:E),"background",D)&&N.dispatch(R);const B=qF.find(I=>I.value===D)?.label;e(D===null?"Cell color removed":`Cell color ${B??D}`)}},T=[];t.selection instanceof Et&&G2(t)&&T.push({key:"merge",label:"Merge cells",icon:"merge",run:N=>{Rh(N,G2)&&e("Cells merged")}}),((o.cell.attrs.colspan??1)>1||(o.cell.attrs.rowspan??1)>1)&&T.push({key:"split",label:"Split cell",icon:"split",run:N=>{const D=ao(N.state,s);if(!D)return e("That cell is gone.");N.dispatch(fw(N.state.tr,D.cellPos)),Rh(N,Dee)&&e("Cell split")}});const M=N=>({key:N?"headerColumn":"headerRow",label:N?"Toggle header column":"Toggle header row",icon:N?"headerColumn":"headerRow",checked:N?zy(o.table):Tr(o.table)>0,run:D=>{const E=ao(D.state,s);if(!E)return e("That cell is gone.");const R=D.state.tr;if(!(N?Jme(R,E.tablePos):Xme(R,E.tablePos)))return;D.dispatch(R);const B=D.state.doc.nodeAt(E.tablePos),I=B?N?zy(B):Tr(B)>0:!1;e(N?I?"Header column on":"Header column off":I?"Header row on":"Header row off")}});T.push(M(!1),M(!0));const O=["addRowBefore","addRowAfter","addColumnBefore","addColumnAfter"].map(N=>su(N,s,e));return{target:o,insert:O,move:r,widths:g,remove:b,sort:w,align:j,color:_,structure:T}}let Ig=null;function hge(t,e){const n=Ig&&t.editable?dw(t.state):null;return!Ig||!n?!1:(su(Ig,$a(n),e).run(t),!0)}function pge(t,e,n,o){const s=ji(t,n);if(!s)return[];const i=$a(s),r=sS(t,e,s);return e==="row"?[su("addRowBefore",i,o),su("addRowAfter",i,o),Ly("row",i,r,o)]:[su("addColumnBefore",i,o),su("addColumnAfter",i,o),Ly("col",i,r,o)]}function mge(t,e,n){const o=ji(t,n);if(!o)return null;const s=ut.get(o.table),i=o.tablePos+1,r=t.doc.resolve(i+(e==="row"?s.map[o.row*s.width]:s.map[o.col])),l=t.doc.resolve(i+(e==="row"?s.map[o.row*s.width+s.width-1]:s.map[(s.height-1)*s.width+o.col])),u=e==="row"?Et.rowSelection(r,l):Et.colSelection(r,l);return t.tr.setSelection(u)}function e6({view:t,action:e}){return y.jsx(Qe,{danger:e.danger,checked:e.checked,disabled:e.disabledReason!==void 0,title:e.disabledReason,icon:e.icon?y.jsx(HF,{name:e.icon}):void 0,onSelect:()=>e.run(t),children:e.label})}function gge({value:t}){return y.jsx("span",{className:"block size-3.5 rounded-full ring-1 ring-inset ring-chrome-line","data-cell-swatch":t??"none"})}function t6({current:t,onPick:e}){return qF.map(n=>y.jsx(Qe,{checked:t===n.value,icon:y.jsx(gge,{value:n.value}),onSelect:()=>e(n.value),children:n.label},n.label))}function n6({view:t,cell:e}){const n=me(r=>r.state)??t.state,o=ao(n,e),s=o?ZF(n,sn,o.cellPos):null;if(!s)return null;const i=r=>y.jsx(e6,{view:t,action:r},r.key);return y.jsxs(y.Fragment,{children:[s.insert.map(i),y.jsx(uu,{label:"Move row or column",icon:y.jsx(QB,{className:"size-4",strokeWidth:1.75}),children:s.move.map(i)}),y.jsx(uu,{label:"Set column width",icon:y.jsx(fj,{className:"size-4",strokeWidth:1.75}),children:s.widths.map(r=>y.jsx(Qe,{checked:r.checked,onSelect:()=>r.run(t),children:r.label},r.key))}),y.jsx(ts,{}),s.remove.map(i),y.jsx(ts,{}),s.sort.map(i),s.align.map(i),y.jsx(uu,{label:"Cell color",icon:y.jsx(dI,{className:"size-4",strokeWidth:1.75}),children:y.jsx(t6,{current:s.color.current,onPick:r=>s.color.pick(t,r)})}),s.structure.length?y.jsx(ts,{}):null,s.structure.map(i)]})}function yge({view:t,cell:e,kind:n}){const o=me(i=>i.state)??t.state,s=ao(o,e);return s?pge(o,n,s.cellPos,sn).map(i=>y.jsx(e6,{view:t,action:i},i.key)):null}const Nh=(t,e)=>{const n=t.nodeDOM(e);return n instanceof HTMLElement?n:null},o6=(t,e)=>Nh(t,e.cellPos)?.closest("table")??null;function s6(t,e,n){const o=o6(t,e);if(!o)return[];const s=o.getBoundingClientRect(),i=ut.get(e.table),r=e.tablePos+1,l=[];if(n==="row"){for(let u=0;u<i.height;u++){const d=Nh(t,r+i.map[u*i.width])?.closest("tr");l.push(d?d.getBoundingClientRect().top:l.at(-1)??s.top)}l.push(s.bottom)}else{for(let u=0;u<i.width;u++){let d=null;for(let h=0;h<i.height&&d===null;h++){const p=i.map[h*i.width+u];if(i.findCell(p).left!==u)continue;const g=Nh(t,r+p);g&&(d=g.getBoundingClientRect().left)}l.push(d??l.at(-1)??s.left)}l.push(s.right)}return l}function bge(t,e){let n=0;return t.forEach((o,s)=>{Math.abs(o-e)<Math.abs(t[n]-e)&&(n=s)}),n}const gD=40,wge=["comment","react"],ok=8;function xge(t,e){let n=null;return e.forEachCell((o,s)=>{const i=Nh(t,s)?.getBoundingClientRect();i&&(n=n?DOMRect.fromRect({x:Math.min(n.left,i.left),y:Math.min(n.top,i.top),width:Math.max(n.right,i.right)-Math.min(n.left,i.left),height:Math.max(n.bottom,i.bottom)-Math.min(n.top,i.top)}):i)}),n}function vge(){const t=me(i=>i.view),e=me(i=>i.state),n=me(i=>i.focused),[o,s]=S.useState(0);return!t||!e||!t.editable||!(e.selection instanceof Et)||!n&&o===0?null:y.jsx(kge,{view:t,state:e,selection:e.selection,onMenu:i=>s(r=>Math.max(0,r+(i?1:-1)))})}function kge({view:t,state:e,selection:n,onMenu:o}){const s=S.useRef(null),i=vy(T=>T.actions),r=wge.flatMap(T=>{const M=i[T];return M&&M.available()?[{key:T,action:M}]:[]}),l=t.dom.closest(".doc-page"),u=xge(t,n),d=ZF(e,sn,n.$headCell.pos);if(!l||!u||!d)return null;const h=l.getBoundingClientRect(),p=u.top-gD-ok>=0,g=(p?u.top-gD-ok:u.bottom+ok)-h.top,b=Math.max(0,u.left-h.left),w=p?"top":"bottom",k=T=>T.preventDefault(),j=d.structure.filter(T=>T.key==="merge"||T.key==="split"),C=d.remove.filter(T=>T.key!=="deleteTable"),_=T=>o(T);return y.jsxs(Qu,{ref:s,role:"toolbar","aria-label":"Cell actions",className:"absolute z-30 h-10 gap-0.5 px-1",style:{left:b,top:g},onMouseDown:k,children:[r.map(({key:T,action:M})=>{const O=M.icon;return y.jsx(eo,{size:"md",tipSide:w,label:M.label,shortcut:M.shortcut?Si(M.shortcut):void 0,icon:y.jsx(O,{className:"size-4"}),onClick:()=>{s.current&&M.run(s.current)}},T)}),r.length?y.jsx(yi,{}):null,j.map(T=>y.jsx(eo,{size:"md",tipSide:w,label:T.label,icon:T.icon?y.jsx(HF,{name:T.icon}):null,onClick:()=>T.run(t)},T.key)),y.jsx(zn,{side:w==="top"?"bottom":"top",onOpenChange:_,trigger:y.jsx(eo,{size:"md",tipSide:w,label:"Cell color",icon:y.jsx(dI,{className:"size-4",strokeWidth:1.75})}),children:y.jsx(t6,{current:d.color.current,onPick:T=>d.color.pick(t,T)})}),y.jsx(yi,{}),C.map(T=>y.jsx(it,{className:"px-2 text-[13px]",onClick:()=>T.run(t),children:T.label},T.key)),y.jsx(yi,{}),y.jsx(zn,{side:w==="top"?"bottom":"top",align:"end",onOpenChange:_,trigger:y.jsx(eo,{size:"md",tipSide:w,label:"More cell actions",icon:y.jsx(Xu,{className:"size-4",strokeWidth:1.75})}),children:y.jsx(n6,{view:t,cell:$a(d.target)})})]})}function i6({left:t,top:e,open:n,onClose:o,side:s="bottom",align:i="start",children:r}){return y.jsx("div",{className:"pointer-events-none absolute size-0",style:{left:t,top:e},children:y.jsx(zn,{open:n,onOpenChange:l=>{l||o()},side:s,align:i,sideOffset:2,trigger:y.jsx("button",{type:"button",tabIndex:-1,"aria-hidden":"true",className:"block size-0 opacity-0"}),children:r})})}const mT=qt(()=>({context:null})),yD=(t,e)=>mT.setState({context:{ref:t,...e}}),Sge=()=>mT.setState({context:null});function bD(t,e,n){const o=t.closest(".doc-page");if(!o)return null;const s=o.getBoundingClientRect();return{left:e-s.left,top:n-s.top}}function jge(){const t=me(n=>n.view),e=mT(n=>n.context);return!t||!e?null:y.jsx(i6,{left:e.left,top:e.top,open:!0,onClose:()=>{Sge(),requestAnimationFrame(()=>{!t.isDestroyed&&t.editable&&t.focus()})},children:y.jsx(n6,{view:t,cell:e.ref})},`${e.left}:${e.top}`)}const Cge=40,Tge=48;function Ege(t,e,n){let o=-1;for(const[l,u]of t.entries()){const{box:d,overflow:h}=u;h<=1||d.bottom<=d.top||d.bottom<=e.bottom||d.top>e.bottom-n-Cge||(o===-1||d.top>t[o].box.top)&&(o=l)}if(o===-1)return null;const s=t[o],i=Math.max(s.shownLeft,e.left),r=Math.min(s.shownRight,e.right)-i;return r<Tge?null:{index:o,left:i,width:r,track:r+s.overflow}}function _ge(t,e){return!t||!e?t===e:t.index===e.index&&Math.abs(t.left-e.left)<.5&&Math.abs(t.width-e.width)<.5&&Math.abs(t.track-e.track)<.5}const sk=12;function Mge(t){const e=t.getBoundingClientRect(),n=getComputedStyle(t),o=e.left+t.clientLeft,s=t.parentElement?.classList.contains("doc-text")??!1;return{box:e,shownLeft:o+(s?0:Number.parseFloat(n.paddingLeft)||0),shownRight:o+t.clientWidth-(Number.parseFloat(n.paddingRight)||0),overflow:t.scrollWidth-t.clientWidth}}function Oge(){const t=me(u=>u.view),e=me(u=>u.state?.doc),[n,o]=S.useState(null),s=S.useRef(null),i=S.useRef(null),r=S.useRef(()=>{});if(S.useEffect(()=>{const u=t?.dom.closest("[data-doc-scroll]"),d=u?.parentElement;if(!t||!u||!d)return;let h=0;const p=new Set,g=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>w()),b=()=>{h=0;const j=[...t.dom.querySelectorAll(".tableWrapper")],C=new Set(j.flatMap(R=>[...R.querySelectorAll(":scope > table")]));for(const R of p)C.has(R)||g?.unobserve(R);for(const R of C)p.has(R)||g?.observe(R);p.clear();for(const R of C)p.add(R);const _=u.getBoundingClientRect(),T=_.top+u.clientTop,M=_.left+u.clientLeft,O={left:M,bottom:T+u.clientHeight,right:M+u.clientWidth},N=t.dom.isConnected?Ege(j.map(Mge),O,sk):null;i.current=N?j[N.index]:null;const D=d.getBoundingClientRect(),E=N?{place:N,left:N.left-D.left,top:O.bottom-D.top-sk}:null;o(R=>_ge(R?.place??null,E?.place??null)&&Math.abs((R?.top??0)-(E?.top??0))<.5&&Math.abs((R?.left??0)-(E?.left??0))<.5?R:E),i.current&&s.current&&Math.abs(s.current.scrollLeft-i.current.scrollLeft)>.5&&(s.current.scrollLeft=i.current.scrollLeft)},w=()=>{h||(h=requestAnimationFrame(b))},k=j=>{const C=i.current;C&&j.target===C&&s.current&&Math.abs(s.current.scrollLeft-C.scrollLeft)>.5&&(s.current.scrollLeft=C.scrollLeft),w()};return u.addEventListener("scroll",k,{capture:!0,passive:!0}),window.addEventListener("resize",w),g?.observe(u),g?.observe(t.dom),r.current=w,w(),()=>{cancelAnimationFrame(h),u.removeEventListener("scroll",k,{capture:!0}),window.removeEventListener("resize",w),g?.disconnect(),r.current=()=>{},i.current=null,o(null)}},[t]),S.useEffect(()=>r.current(),[e]),S.useLayoutEffect(()=>{s.current&&i.current&&(s.current.scrollLeft=i.current.scrollLeft)},[n?.place.index,n?.place.track]),!n)return null;const l=u=>{const d=i.current,h=u.currentTarget.scrollLeft;d&&Math.abs(d.scrollLeft-h)>.5&&(d.scrollLeft=h)};return y.jsx("div",{ref:s,className:"doc-table-dock absolute z-20 overflow-x-scroll overflow-y-hidden bg-page/85",style:{left:n.left,top:n.top,width:n.place.width,height:sk},tabIndex:-1,"aria-hidden":"true","data-table-dock":"",onScroll:l,children:y.jsx("div",{style:{width:n.place.track,height:1}})})}const Age=4,Jc=24,Qc=14,Rge={col:"Click for column options · drag to move",row:"Click for row options · drag to move"};function Nge(t,e,n){const o=document.elementFromPoint(e,n);if(!o)return null;if(o.closest("[data-table-grip]"))return"keep";if(!t.dom.contains(o))return null;if(!o.closest("td, th"))return o.closest("table, .tableWrapper")?"keep":null;const i=t.posAtCoords({left:e,top:n}),r=i?es(t.state.doc.resolve(i.pos)):null,l=r?ji(t.state,r.pos):null;return l?$a(l):null}function Dge(){const t=me(M=>M.view),e=me(M=>M.state),[n,o]=S.useState(null),[s,i]=S.useState(null),[r,l]=S.useState(null),u=S.useRef(!1);if(u.current=s!==null||r!==null,S.useEffect(()=>{const M=t?.dom.closest("[data-doc-scroll]");if(!t||!M)return;let O=0,N={x:0,y:0};const D=()=>{if(O=0,u.current||!t.editable)return;const B=Nge(t,N.x,N.y);B!=="keep"&&o(I=>I&&B&&I.bid===B.bid&&I.pos===B.pos?I:B)},E=B=>{const{clientX:I,clientY:P}=B;N={x:I,y:P},O||(O=requestAnimationFrame(D))},R=()=>{u.current||o(null)};return M.addEventListener("mousemove",E,{passive:!0}),M.addEventListener("mouseleave",R),t.dom.addEventListener("keydown",R),()=>{cancelAnimationFrame(O),M.removeEventListener("mousemove",E),M.removeEventListener("mouseleave",R),t.dom.removeEventListener("keydown",R)}},[t]),S.useEffect(()=>o(null),[t]),!t||!e||!t.editable)return null;const d=s?.ref??r?.ref??n,h=d?ao(e,d):null,p=t.dom.closest(".doc-page"),g=h?Nh(t,h.cellPos)?.getBoundingClientRect():null,b=h?o6(t,h)?.getBoundingClientRect():null;if(!h||!p||!g||!b)return null;const w=p.getBoundingClientRect(),k=$a(h),j={left:g.left+g.width/2-w.left,top:b.top-w.top},C={left:b.left-w.left,top:g.top+g.height/2-w.top},_=(M,O)=>{if(M.button!==0)return;M.preventDefault();const N=mge(t.state,O,h.cellPos);N&&t.dispatch(N),t.focus();const D={x:M.clientX,y:M.clientY};let E=null;const R=W=>{if(E===null&&Math.hypot(W.clientX-D.x,W.clientY-D.y)<Age)return;const K=ao(t.state,k);K&&(E=bge(s6(t,K,O),O==="row"?W.clientY:W.clientX),l({kind:O,ref:k,boundary:E}))},B=()=>{window.removeEventListener("pointermove",R),window.removeEventListener("pointerup",I),window.removeEventListener("pointercancel",P),window.removeEventListener("keydown",$,!0),document.body.style.removeProperty("cursor"),l(null)},I=()=>{B(),E===null?i({kind:O,ref:k}):Pge(t,k,O,E)},P=()=>B(),$=W=>{W.key==="Escape"&&(W.preventDefault(),W.stopPropagation(),B())};window.addEventListener("pointermove",R),window.addEventListener("pointerup",I),window.addEventListener("pointercancel",P),window.addEventListener("keydown",$,!0),document.body.style.cursor="grabbing"},T=(M,O)=>{const N=M==="col";return y.jsx(wn,{label:Rge[M],side:N?"top":"left",disabled:s!==null||r!==null,children:y.jsx("button",{type:"button",tabIndex:-1,"aria-label":M==="col"?"Column options":"Row options","data-table-grip":"","data-active":s?.kind===M||r?.kind===M?"":void 0,className:"table-grip absolute z-20 flex cursor-grab items-center justify-center rounded-[5px] border border-chrome-line bg-chrome text-chrome-muted shadow-chrome hover:bg-chrome-hover hover:text-chrome-fg data-[active]:bg-chrome-accent data-[active]:text-white",style:{left:O.left-(N?Jc:Qc)/2,top:O.top-(N?Qc:Jc)/2,width:N?Jc:Qc,height:N?Qc:Jc},onPointerDown:D=>_(D,M),children:N?y.jsx(yK,{className:"size-3.5",strokeWidth:2}):y.jsx(rj,{className:"size-3.5",strokeWidth:2})})})};return y.jsxs(y.Fragment,{children:[T("col",j),T("row",C),r?y.jsx(Bge,{view:t,drag:r,page:w,table:b}):null,s?y.jsx(i6,{left:s.kind==="col"?j.left-Jc/2:C.left+Qc/2,top:s.kind==="col"?j.top+Qc/2:C.top-Jc/2,side:s.kind==="col"?"bottom":"right",open:!0,onClose:()=>{i(null),requestAnimationFrame(()=>{t.isDestroyed||t.focus()})},children:y.jsx(yge,{view:t,cell:s.ref,kind:s.kind})}):null]})}function Pge(t,e,n,o){const s=ao(t.state,e);if(!s)return;const i=n==="row"?s.row:s.col;if(uw(i,o)===i)return;const r=YF(s.table,n,i,o);if(!r.ok){sn(hT(r));return}QF(t,s,n,o,sn)}function Bge({view:t,drag:e,page:n,table:o}){const s=ao(t.state,e.ref);if(!s)return null;const i=e.kind==="row"?s.row:s.col;if(uw(i,e.boundary)===i)return null;const r=s6(t,s,e.kind)[e.boundary];if(r===void 0)return null;const l=YF(s.table,e.kind,i,e.boundary).ok,u=e.kind==="row";return y.jsx("div",{"aria-hidden":"true","data-allowed":l?"":void 0,className:"table-drop-line pointer-events-none absolute z-20 rounded-full",style:u?{left:o.left-n.left,top:r-n.top-1,width:o.width,height:2}:{left:r-n.left-1,top:o.top-n.top,width:2,height:o.height}})}const zge=12,Ige=20,r6=48,Zc=99,Lge=7,a6=t=>Array.from(t).length;function $ge(t){let e=0;return t.descendants(n=>{if(n.isAtom&&n.isBlock&&(e=Zc),!n.isTextblock)return e<Zc;let o=0;return n.forEach(s=>{e>=Zc||(s.type.name==="hardBreak"?o=0:s.isText?o+=a6((s.text??"").slice(0,2*Zc)):s.type.name==="media"?o=Zc:o+=Lge,e=Math.max(e,o))}),!1}),Math.min(e,Zc)}function Fge(t){return t.textBetween(0,t.content.size," "," ").split(/\s+/).reduce((e,n)=>Math.max(e,a6(n)),0)}function Hge(t,e,n){return t<=zge&&!n?{wrap:"short",chars:0}:{wrap:e()<=Ige?"words":null,chars:t}}function qge(t){const e=ut.get(t),n=Array.from({length:e.width},()=>0),o=new Set;for(let s=0;s<e.height;s++)for(let i=0;i<e.width;i++){const r=e.map[s*e.width+i];if(o.has(r)&&n[i])continue;o.add(r);const l=t.nodeAt(r),u=e.findCell(r).left,d=Array.isArray(l?.attrs.colwidth)&&Number(l.attrs.colwidth[i-u])||0;d>0&&!n[i]&&(n[i]=d)}return n}function Uge(t,e){let n=0,o=0;for(const r of e)r>0?n+=r:o+=1;const{wrap:s,chars:i}=Hge($ge(t),()=>Fge(t),e.length>1);return{wrap:s,chars:i,min:n>0?n+o*r6:null}}function Vge(t){const e=qge(t);if(e.every(i=>i>0))return[];const n=ut.get(t),o=[],s=new Set;for(const i of n.map){if(s.has(i))continue;s.add(i);const r=t.nodeAt(i);if(!r)continue;const{left:l,right:u}=n.findCell(i),d=Uge(r,e.slice(l,u));o.push({offset:i,size:r.nodeSize,left:l,right:u,wrap:d.wrap,style:Kge(d)})}return o}function Kge(t){return[t.chars?`--fit-chars: ${t.chars}`:"",t.min?`--fit-min: ${t.min}px`:""].filter(Boolean).join("; ")}const Wge={rail:0,icons:64,none:24};function Yge(t,e,n){const o=e.left+e.contentWidth-e.paddingRight-Wge[n];return Math.max(t.width,Math.floor(o-t.left))}const Gge=24,Xge=48;function Jge(t,e){return Math.max(Xge,Math.floor(t.left-e.left-Gge))}function Qge(t,e){const n=Array.from({length:e},()=>0);let o=e;const s=[];for(const i of t){if(!o)break;if(i.right-i.left>1)s.push(i);else if(!n[i.left]){if(i.width===null)return null;n[i.left]=i.width,o-=1}}for(const i of o?s:[]){if(i.width===null)return null;let r=i.width;const l=[];for(let u=i.left;u<i.right;u++)n[u]?r-=n[u]:l.push(u);for(const u of l)n[u]=r/l.length}return n.every(i=>i>0)?n.map(i=>Math.max(r6,Math.ceil(i*1e3)/1e3)):null}const Dl=new so("tableCells");function wD(t,e){const n=[];return t.descendants((o,s)=>{if(o.type.spec.tableRole!=="table")return!o.isTextblock;const i=e?.pos===s?e.widths:null;n.push(tt.node(s,s+o.nodeSize,i?{"data-fit-lock":"cursor"}:{"data-fit":""}));const r=new Map(Vge(o).map(d=>[d.offset,d])),l=ut.get(o),u=new Set;for(const d of l.map){if(u.has(d))continue;u.add(d);const h=o.nodeAt(d);if(!h)continue;const p=r.get(d),g=h.attrs.background,{left:b,right:w}=l.findCell(d),k=i?i.slice(b,w).reduce((T,M)=>T+M,0):0,j=[Gme(g)?`--cell-bg: ${g.toLowerCase()}`:"",p?.style??"",k?`--fit-lock: ${Math.round(k*1e3)/1e3}px`:""].filter(Boolean).join("; "),C={...j?{style:j}:{},...p?.wrap?{"data-fit-cell":p.wrap}:{}},_=s+1+d;Object.keys(C).length&&n.push(tt.node(_,_+h.nodeSize,C))}return!1}),Ge.create(t,n)}function Zge(t,e){if(!t||!e.docChanged)return t;const n=e.mapping.mapResult(t.pos,1),o=n.deleted?null:e.doc.nodeAt(n.pos);return o?.type.spec.tableRole!=="table"||ut.get(o).width!==t.widths.length?null:n.pos===t.pos?t:{...t,pos:n.pos}}function eye(t){const{$head:e}=t.selection;for(let n=1;n<=e.depth;n++){const o=e.node(n);if(o.type.spec.tableRole==="table")return{pos:e.before(n),node:o}}return null}function tye(t){const e=getComputedStyle(t);return t.clientWidth-(Number.parseFloat(e.paddingLeft)||0)-(Number.parseFloat(e.paddingRight)||0)}function nye(t,e){const n=t.nodeDOM(e);if(!(n instanceof HTMLElement)||!n.classList.contains("tableWrapper"))return null;const o=n.querySelector(":scope > table");return o?{wrapper:n,table:o}:null}function oye(t,e){const n=e.target instanceof Element?e.target.closest("td, th"):null;if(!n||!t.dom.contains(n))return null;const o=t.posAtCoords({left:e.clientX,top:e.clientY});if(!o)return null;const s=es(t.state.doc.resolve(o.pos));if(!s||!ji(t.state,s.pos))return null;const{selection:i}=t.state;if(!(i instanceof Et?Nl(t.state,s.pos):es(i.$from)?.pos===s.pos&&es(i.$to)?.pos===s.pos)){const l=t.state.doc.resolve(o.pos),u=es(l)?.pos===s.pos&&l.parent.inlineContent;t.dispatch(u?t.state.tr.setSelection(Le.create(t.state.doc,o.pos)):fw(t.state.tr,s.pos))}return s.pos}function sye(t){const e=t.dom.closest("[data-doc-scroll]"),n=t.dom.parentElement;if(!e||!n||typeof ResizeObserver>"u")return()=>{};const o=()=>{const r=t.dom.getBoundingClientRect(),l=e.getBoundingClientRect(),u=e.dataset.marginColumn,d=u==="rail"||u==="icons"?u:"none",h=Yge({left:r.left+t.dom.clientLeft,width:t.dom.clientWidth},{left:l.left+e.clientLeft,contentWidth:e.clientWidth,paddingRight:Number.parseFloat(getComputedStyle(e).paddingRight)||0},d),p=Jge({left:r.left+t.dom.clientLeft},{left:l.left+e.clientLeft});for(const[g,b]of[["--table-room",`${h}px`],["--table-left",`${p}px`]])n.style.getPropertyValue(g)!==b&&n.style.setProperty(g,b)},s=new ResizeObserver(o);s.observe(e),s.observe(t.dom);const i=new MutationObserver(o);return i.observe(e,{attributes:!0,attributeFilter:["data-margin-column","style"]}),o(),()=>{s.disconnect(),i.disconnect(),n.style.removeProperty("--table-room"),n.style.removeProperty("--table-left")}}function iye(t){if(typeof ResizeObserver>"u")return{sync(){},destroy(){}};const e=new Set,n=l=>{const u=l.querySelector(":scope > table"),d=!!u&&l.scrollLeft>0&&u.getBoundingClientRect().left<l.getBoundingClientRect().left+l.clientLeft-.5,h=l.scrollWidth-l.clientWidth-l.scrollLeft>1,p=[d?"left":"",h?"right":""].filter(Boolean).join(" ");p!==(l.dataset.clip??"")&&(p?l.dataset.clip=p:delete l.dataset.clip)},o=l=>n(l.currentTarget),s=new ResizeObserver(l=>{for(const u of l){const d=u.target.closest(".tableWrapper");d&&e.has(d)&&n(d)}}),i=l=>{l.removeEventListener("scroll",o),s.unobserve(l);const u=l.querySelector(":scope > table");u&&s.unobserve(u),e.delete(l)},r=()=>{const l=new Set(t.dom.querySelectorAll(".tableWrapper"));for(const u of e)l.has(u)||i(u);for(const u of l){if(e.has(u))continue;e.add(u),u.addEventListener("scroll",o,{passive:!0}),s.observe(u);const d=u.querySelector(":scope > table");d&&s.observe(d),n(u)}};return r(),{sync:r,destroy(){for(const l of[...e])i(l);s.disconnect()}}}function rye(t){let e=null,n=0;const o=()=>{Dl.getState(t.state)?.lock&&t.dispatch(t.state.tr.setMeta(Dl,{lock:null}).setMeta("addToHistory",!1))},s=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{if(!e)return;const l=e.clientWidth;Math.abs(l-n)<.5||(n=l,o())}),i=l=>{e!==l&&(e&&s?.unobserve(e),e=l,l&&(n=l.clientWidth,s?.observe(l)))};return{update:()=>{if(t.composing)return;const l=Dl.getState(t.state)?.lock??null,u=!!Do.getState(t.state)?.dragging,d=t.editable&&!u?eye(t.state):null;if(!d)return i(null),o();const h=nye(t,d.pos);if(l?.pos===d.pos)return i(h?.wrapper??null);if(!h||h.table.getBoundingClientRect().width<tye(h.wrapper)-1.5)return i(null),o();const p=ut.get(d.node),g=new Set,b=[];for(const k of p.map){if(g.has(k))continue;g.add(k);const j=t.nodeDOM(d.pos+1+k),{left:C,right:_}=p.findCell(k);b.push({left:C,right:_,width:j instanceof HTMLElement?j.getBoundingClientRect().width:null})}const w=Qge(b,p.width);if(!w)return o();i(h.wrapper),t.dispatch(t.state.tr.setMeta(Dl,{lock:{pos:d.pos,widths:w}}).setMeta("addToHistory",!1))},destroy(){s?.disconnect()}}}const aye=1e3;function lye(){let t=0;return[Nf({"Mod-y":(e,n,o)=>ah(e,n)||!!o&&hge(o,sn)}),new It({key:Dl,state:{init:(e,n)=>({lock:null,decorations:wD(n.doc,null)}),apply(e,n){const o=e.getMeta(Dl),s=o?o.lock:Zge(n.lock,e);return!e.docChanged&&s===n.lock?n:{lock:s,decorations:wD(e.doc,s)}}},view(e){const n=sye(e),o=iye(e),s=rye(e);return{update(){o.sync(),s.update()},destroy(){n(),o.destroy(),s.destroy()}}},props:{decorations:e=>Dl.getState(e)?.decorations,handleDOMEvents:{contextmenu(e,n){if(Date.now()-t<aye)return t=0,n.preventDefault(),!0;if(!e.editable)return!1;const o=oye(e,n);if(o===null)return!1;const s=ji(e.state,o),i=bD(e.dom,n.clientX,n.clientY);return!s||!i?!1:(n.preventDefault(),yD($a(s),i),!0)}},handleKeyDown(e,n){if(!e.editable||!(n.key==="ContextMenu"||n.key==="F10"&&n.shiftKey))return!1;const o=dw(e.state);if(!o)return!1;const s=e.coordsAtPos(e.state.selection.head),i=bD(e.dom,s.left,s.bottom);return i?(n.preventDefault(),t=Date.now(),yD($a(o),i),!0):!1}}})]}ko({plugins:lye});ht("layer","table-grips",Dge,20);ht("layer","table-cell-bar",vge,21);ht("layer","table-context-menu",jge,22);ht("float","table-dock",Oge,10);const cye=new Set(["csv","latex","markdown","mermaid"]),l6={bash:"bash",css:"css",html:"xml",javascript:"javascript",json:"json",latex:"latex",markdown:"markdown",python:"python",sql:"sql",typescript:"typescript",xml:"xml",yaml:"yaml"},gT=["bash","css","xml","javascript","json","python","sql","typescript","yaml"];function mp(t){if(!t)return null;const e=t.trim().toLowerCase();return Eh.find(n=>n.key===e||n.aliases.includes(e))??null}function uye(t){const e=mp(t)?.key;return e&&cye.has(e)?e:null}function c6(t){if(!t)return"auto";const e=mp(t)?.key;return e?l6[e]??null:null}function dye(t){return Eh.find(n=>n.key===t||l6[n.key]===t)?.label??t}function fye(t,e){return t?mp(t)?.label??t:e?`auto (${dye(e)})`:"auto"}function xD(t){const e=t.trim().toLowerCase();return e?Eh.filter(n=>n.key.includes(e)||n.label.toLowerCase().includes(e)||n.aliases.some(o=>o.includes(e))):[...Eh]}const hye=304;function pye({shown:t,language:e,disabled:n,onPick:o,onClose:s}){const[i,r]=S.useState(!1),[l,u]=S.useState(""),[d,h]=S.useState(0),p=S.useId(),g=mp(e)?.key??(e||null),b=S.useMemo(()=>{const _=xD(l).map(M=>({key:M.key,label:M.label}));return!l.trim()||"auto".startsWith(l.trim().toLowerCase())?[{key:null,label:"auto"},..._]:_},[l]),w=_=>{r(_),_?(u(""),h(Math.max(0,[{key:null},...xD("")].findIndex(T=>T.key===g)))):s()},k=_=>{_&&(r(!1),o(_.key))},j=_=>{if(_.key==="ArrowDown"||_.key==="ArrowUp"){_.preventDefault();const T=_.key==="ArrowDown"?1:-1;h(M=>b.length?(M+T+b.length)%b.length:0)}else _.key==="Enter"&&(_.preventDefault(),k(b[d]))},C=y.jsxs("button",{type:"button",disabled:n,"aria-label":`${t}, language`,title:n?void 0:"Set language",className:"inline-flex h-6 items-center gap-1 rounded-[6px] px-1.5 text-[12px] text-chrome-muted outline-none hover:bg-chrome-hover hover:text-chrome-fg focus-visible:outline-2 focus-visible:outline-chrome-focus disabled:pointer-events-none data-[popup-open]:bg-chrome-hover",children:[y.jsx("span",{children:t}),n?null:y.jsx(Ps,{className:"size-3",strokeWidth:2})]});return n?C:y.jsxs(Tb,{trigger:C,side:"bottom",align:"start",gap:4,open:i,onOpenChange:w,label:"Set language",className:"w-56 p-1.5",children:[y.jsx("input",{autoFocus:!0,value:l,role:"combobox","aria-label":"Language","aria-controls":p,"aria-expanded":"true","aria-activedescendant":b[d]?`${p}-${d}`:void 0,placeholder:"Language",onChange:_=>{u(_.target.value),h(0)},onKeyDown:j,className:"mb-1 h-7 w-full rounded-[8px] bg-chrome-hover px-2 text-[13px] text-chrome-fg outline-none placeholder:text-chrome-muted"}),y.jsxs("div",{id:p,role:"listbox","aria-label":"Language",className:"overflow-y-auto",style:{maxHeight:hye},children:[b.map((_,T)=>y.jsxs("div",{id:`${p}-${T}`,role:"option","aria-selected":T===d,onMouseMove:()=>h(T),onMouseDown:M=>M.preventDefault(),onClick:()=>k(_),className:He("flex h-7 cursor-default items-center gap-2 rounded-[8px] px-2 text-[13px]",T===d&&"bg-chrome-hover"),children:[y.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:_.key===g?y.jsx(Va,{className:"size-4 text-chrome-accent",strokeWidth:2.25}):null}),_.label]},_.key??"auto")),b.length===0?y.jsx("div",{className:"px-2 py-1.5 text-[13px] text-chrome-muted",children:"No languages match"}):null]})]})}const mye=1200;function gye(t,e,n){const o=e();if(o===void 0)return;const s=t.state.doc.nodeAt(o);!s||s.type.name!=="codeBlock"||((s.attrs.language??null)!==n&&t.dispatch(t.state.tr.setNodeAttribute(o,"language",n)),sn(`Language set to ${n?mp(n)?.label??n:"auto"}`))}function yye({view:t,getPos:e,language:n,detected:o,live:s,sourceShown:i,sourceLocked:r,onToggleSource:l,text:u}){const[d,h]=S.useState(!1),p=S.useRef(0);S.useEffect(()=>()=>window.clearTimeout(p.current),[]);const g=t.editable,b=async()=>{try{await navigator.clipboard.writeText(u()),sn("Code copied"),h(!0),window.clearTimeout(p.current),p.current=window.setTimeout(()=>h(!1),mye)}catch{const w=s&&!i?"Couldn’t copy — open Source, then select the text and press ⌘C (Ctrl+C)":"Couldn’t copy — select the code and press ⌘C (Ctrl+C)";qe.add({title:w,type:"error"})}};return y.jsxs(y.Fragment,{children:[y.jsx(pye,{shown:fye(n,o),language:n,disabled:!g,onPick:w=>gye(t,e,w),onClose:()=>{g&&requestAnimationFrame(()=>!t.isDestroyed&&t.focus())}}),y.jsx("span",{className:"flex-1"}),s?y.jsx(it,{className:"h-6 px-1.5 text-[12px] text-chrome-muted","aria-pressed":i,disabled:r,onClick:l,children:i?"Hide source":"Show source"}):null,y.jsx(wn,{label:d?"Code copied":"Copy code",side:"top",children:y.jsx(it,{square:!0,"aria-label":"Copy code",className:"size-6 text-chrome-muted",onClick:()=>{b()},children:d?y.jsx(Va,{className:"size-3.5",strokeWidth:2.25}):y.jsx(Sb,{className:"size-3.5",strokeWidth:1.75})})})]})}const bye={bash:()=>mo(()=>import("./bash-I8pq0VWm.js"),[],import.meta.url),css:()=>mo(()=>import("./css-DazXZka4.js"),[],import.meta.url),javascript:()=>mo(()=>import("./javascript-BKRaQes9.js"),[],import.meta.url),json:()=>mo(()=>import("./json-DIYVocXf.js"),[],import.meta.url),latex:()=>mo(()=>import("./latex-lHs7bxnR.js"),[],import.meta.url),markdown:()=>mo(()=>import("./markdown-BrP960CR.js"),[],import.meta.url),python:()=>mo(()=>import("./python-sE43i1Pi.js"),[],import.meta.url),sql:()=>mo(()=>import("./sql-BC88IN-V.js"),[],import.meta.url),typescript:()=>mo(()=>import("./typescript-C2FFdlUC.js"),[],import.meta.url),xml:()=>mo(()=>import("./xml-BXBhIUeX.js"),[],import.meta.url),yaml:()=>mo(()=>import("./yaml-drsDnIKT.js"),[],import.meta.url)};let wu=null,vD=null;const $y=new Set,kD=new Map;function wye(){return vD??=mo(()=>import("./core-Cw4Llisp.js"),[],import.meta.url).then(t=>(wu=t.default,wu)),vD}function u6(t){return wu?t==="auto"?gT.every(e=>$y.has(e)):$y.has(t):!1}function d6(t){if(t==="auto")return Promise.all(gT.map(d6)).then(o=>o.every(Boolean));const e=bye[t];if(!e)return Promise.resolve(!1);if($y.has(t))return Promise.resolve(!0);let n=kD.get(t);return n||(n=Promise.all([wye(),e()]).then(([o,s])=>(o.registerLanguage(t,s.default),$y.add(t),!0)).catch(()=>!1),kD.set(t,n)),n}function xye(t,e){if(!wu||!u6(e))return null;if(!t)return{ranges:[],detected:null};if(e==="auto"){const n=wu.highlightAuto(t,[...gT]),o=n.language&&(n.relevance??0)>2?n.language:null;return{ranges:o?jD(n.value):[],detected:o}}return{ranges:jD(wu.highlight(t,{language:e,ignoreIllegals:!0}).value),detected:null}}const SD={amp:"&",lt:"<",gt:">",quot:'"',apos:"'","#x27":"'","#39":"'"},vye=t=>t in SD?SD[t]:t.startsWith("#x")?String.fromCodePoint(parseInt(t.slice(2),16)):t.startsWith("#")?String.fromCodePoint(parseInt(t.slice(1),10)):`&${t};`;function jD(t,e=!1){const n=[],o=[];let s=0;const i=u=>{if(!u)return;const d=o.filter(Boolean).join(" "),h=n.at(-1);h&&h.to===s&&h.classes===d?h.to+=u:n.push({from:s,to:s+u,classes:d}),s+=u},r=/<(\/?)span([^>]*)>|&(#?[a-z0-9]+);/gi;let l=0;for(let u=r.exec(t);u;u=r.exec(t))i(u.index-l),l=u.index+u[0].length,u[3]!==void 0?i(vye(u[3]).length):u[1]?o.pop():o.push(/class="([^"]*)"/.exec(u[2]??"")?.[1]??"");return i(t.length-l),e?n:n.filter(u=>u.classes)}const kye=1e5,mg=new so("codeHighlight"),CD=new WeakMap;function f6(t){const e=c6(t.attrs.language);if(e===null||t.textContent.length>kye)return null;const n=CD.get(t);if(n)return n;const o=xye(t.textContent,e);return o&&CD.set(t,o),o}function TD(t,e){const n=[];return t.descendants((o,s)=>{if(o.type.name!=="codeBlock")return!o.isTextblock;const i=c6(o.attrs.language);if(i===null)return!1;if(!u6(i))return e.add(i),!1;const r=f6(o);for(const l of r?.ranges??[])n.push(tt.inline(s+1+l.from,s+1+l.to,{class:l.classes}));return!1}),Ge.create(t,n)}function Sye(){let t=null;const e=new Set,n=o=>{for(const s of o)e.has(s)||(e.add(s),d6(s).then(i=>{i&&t&&!t.isDestroyed&&t.dispatch(t.state.tr.setMeta(mg,s))}))};return new It({key:mg,state:{init:(o,s)=>{const i=new Set,r=TD(s.doc,i);return queueMicrotask(()=>n(i)),r},apply:(o,s)=>{if(!o.docChanged&&o.getMeta(mg)===void 0)return s;const i=new Set,r=TD(o.doc,i);return i.size&&queueMicrotask(()=>n(i)),r}},view:o=>(t=o,{destroy:()=>{t=null}}),props:{decorations:o=>mg.getState(o)}})}function jye(){return new It({props:{decorations(t){const{$from:e,$to:n}=t.selection;if(e.depth===0||e.parent.type.name!=="codeBlock"||!e.sameParent(n))return null;const o=e.before();return Ge.create(t.doc,[tt.node(o,o+e.parent.nodeSize,{},{codeActive:!0})])}}})}function yT(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Cye(t){const e=[];let n=[],o="",s=!1,i=!1;for(let r=0;r<t.length;r++){const l=t[r];if(s){l==='"'&&t[r+1]==='"'?(o+='"',r++):l==='"'?s=!1:o+=l;continue}l==='"'&&o===""?(s=!0,i=!0):l===","?(n.push(o),o="",i=!0):l===`
|
|
76
|
+
`).length+1),className:"w-full resize-y rounded-control border border-chrome-line bg-surface px-2 py-1 text-[13px] text-fg"})]}):y.jsxs("p",{className:"line-clamp-2 text-chrome-muted",children:["“",t.text,"”"]}),y.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[y.jsx(Mt,{size:"sm",onClick:()=>{Jse(t.id)},children:"Copy draft"}),t.copy==="copied"?y.jsx("span",{role:"status",className:"text-chrome-muted",children:"Copied the whole draft"}):null]})]}),y.jsx(PW,{size:"sm",label:"Close",icon:y.jsx(As,{className:"size-3.5"}),onClick:()=>Gse(t.id)})]})}function Lme(){const t=nd(e=>e.drafts);return t.length?y.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-6 z-40 flex flex-col items-center gap-2 px-4",children:t.map(e=>y.jsx(Ime,{draft:e},e.id))}):null}ko({plugins:()=>[Vse()]});ht("topBar","comments",Vpe,30);ht("rail","comments",Rme,10);ht("overlay","comment-reaction-picker",bme);ht("float","refused-comments",Lme,40);Upe(t=>{oie(t)});function FF(){const t=me.getState().state;if(!t||!t.selection.empty)return!1;const e=c5(t,t.selection.from);return!e||!ed(e.id)?!1:(ke().comments==="hidden"&<({comments:"margin"}),Ns(e.id,e.place),!0)}Wa("comment",()=>FF()?!0:!Fo()||!me.getState().view?!1:(g5(),!0));Wa("toggleComments",()=>St.store.getState().available?(lt({comments:ke().comments==="hidden"?"margin":"hidden"}),!0):!1);h$("comment",{label:"Comment",shortcut:"Mod-Alt-m",icon:zK,available:()=>lC(me.getState().state),run:()=>{FF()||g5()}});h$("react",{label:"Add a reaction",icon:_z,available:()=>lC(me.getState().state),run:t=>{const{top:e,left:n,width:o,height:s}=t.getBoundingClientRect();Bn({picker:{top:e,left:n,width:o,height:s}})}});function dD(t,e){const n=new Set;for(const o of t)o.kind==="person"&&o.name&&o.name!==e&&n.add(o.name);return[...n]}function $me(){const t=Ase(window.location.href);if(!t)return;const e=ed(t);e&&v5(e);try{window.history.replaceState(window.history.state,"",Rse(window.location.href))}catch{}}let fD=!1;async function Fme(){const t=In();if(!t||fD)return;fD=!0,kW(t.agent,n=>Bn({agent:n}));const e=t.room;if(e){const n=t.viewer.name;e.peers().then(o=>Bn({peers:dD(o,n)}),()=>{}),e.onPeers(o=>Bn({peers:dD(o,n)}))}await St.start(t.comments),$me()}he.subscribe(t=>{t.phase.kind==="ready"&&Fme()});const Hme={rowAbove:eK,rowBelow:ZV,colLeft:nK,colRight:tK,move:QB,up:sj,down:JV,left:YB,right:XB,width:fj,delete:dj,sortAsc:QV,sortDesc:XV,alignLeft:ZK,alignCenter:JK,alignRight:QK,merge:GK,split:XK,headerRow:FK,headerColumn:$K};function HF({name:t}){const e=Hme[t];return y.jsx(e,{className:"size-4",strokeWidth:1.75})}const qme=["up","down","left","right"],Ume={up:"Move row up",down:"Move row down",left:"Move column left",right:"Move column right"};function hT(t){switch(t.reason){case"edge":return t.dir==="up"?"This row is already at the top.":t.dir==="down"?"This row is already at the bottom.":t.dir==="left"?"This column is already at the far left.":"This column is already at the far right.";case"header":return"Header rows stay at the top.";case"spans":return t.kind==="row"?"Rows with cells merged across rows can’t move.":"Columns with merged cells can’t move."}}function Vme(t,e,n){return`${t==="up"||t==="down"?"Row":"Column"} moved ${t}, ${e} of ${n}`}const pg=672,Kme=[{key:"narrow",label:"Narrow",px:Math.floor(pg/6)},{key:"medium",label:"Medium",px:Math.floor(pg/3)},{key:"wide",label:"Wide",px:Math.floor(pg/2)},{key:"extraWide",label:"Extra wide",px:pg}],Wme=48,Yme=4e3,qF=[{label:"None",value:null},{label:"Gray",value:"#f0efec"},{label:"Red",value:"#fbebeb"},{label:"Orange",value:"#f9ece7"},{label:"Yellow",value:"#f9eeda"},{label:"Green",value:"#e5f4e4"},{label:"Blue",value:"#e7f1fb"},{label:"Purple",value:"#efedff"}],Gme=t=>typeof t=="string"&&/^#[0-9a-f]{6}$/i.test(t),UF=t=>{if(!t.childCount)return!1;let e=!0;return t.forEach(n=>{n.attrs.header!==!0&&(e=!1)}),e};function Tr(t){let e=0;for(;e<t.childCount&&UF(t.child(e));)e++;return e}function zy(t){const e=ut.get(t);if(!e.height)return!1;for(let n=0;n<e.height;n++)if(t.nodeAt(e.map[n*e.width])?.attrs.header!==!0)return!1;return!0}function pp(t){const e=ut.get(t),n=[];let o=0;return t.forEach((s,i,r)=>{s.forEach((l,u)=>{const d=o+1+u,h=e.findCell(d);n.push({node:l,pos:d,row:r,...h})}),o+=s.nodeSize}),n}function Xme(t,e){const n=t.doc.nodeAt(e);if(!n||n.type.spec.tableRole!=="table"||!n.childCount)return!1;const o=n.child(0),s=!UF(o),i=e+2;return o.forEach((r,l)=>{r.attrs.header!==s&&t.setNodeMarkup(i+l,void 0,{...r.attrs,header:s})}),!0}function Jme(t,e){const n=t.doc.nodeAt(e);if(!n||n.type.spec.tableRole!=="table"||!n.childCount)return!1;const o=!zy(n);for(const s of pp(n))s.left!==0||s.node.attrs.header===o||t.setNodeMarkup(e+1+s.pos,void 0,{...s.node.attrs,header:o});return!0}function hD(t,e,n,o){const s=t.doc.nodeAt(e);if(s)for(const i of pp(s)){if(!(n.kind==="row"?i.top===n.index:i.left===n.index))continue;const l=n.kind==="row"?n.index<o.rows||o.column&&i.left===0:i.top<o.rows||o.column&&n.index===0;i.node.attrs.header!==l&&t.setNodeMarkup(e+1+i.pos,void 0,{...i.node.attrs,header:l})}}function VF(t,e){const n=ut.get(t);if(e<=0||e>=n.height)return e===0||e===n.height;for(let o=0;o<n.width;o++)if(n.map[(e-1)*n.width+o]===n.map[e*n.width+o])return!1;return!0}function KF(t,e){const n=ut.get(t);if(e<=0||e>=n.width)return e===0||e===n.width;for(let o=0;o<n.height;o++)if(n.map[o*n.width+e-1]===n.map[o*n.width+e])return!1;return!0}function WF(t,e,n,o){const s=ut.get(t),i=o==="up"||o==="down"?"row":"col",r=i==="row"?e:n,l=i==="row"?s.height:s.width,u=o==="up"||o==="left",d=i==="row"?Tr(t):0,h=g=>({dir:o,kind:i,from:r,ok:!1,reason:g});if(r<0||r>=l)return h("edge");if(r<d||u&&d>0&&r===d)return h("header");if(u?r===0:r===l-1)return h("edge");const p=g=>i==="row"?VF(t,g):KF(t,g);if(!p(r)||!p(r+1))return h("spans");if(u){for(let g=r-1;g>=d;g--)if(p(g))return{dir:o,kind:i,from:r,ok:!0,boundary:g}}else for(let g=r+2;g<=l;g++)if(p(g))return{dir:o,kind:i,from:r,ok:!0,boundary:g};return h(d>0?"header":"edge")}function YF(t,e,n,o){const s=ut.get(t),i=e==="row"?s.height:s.width,r=o<=n,l=e==="row"?r?"up":"down":r?"left":"right",u=p=>({dir:l,kind:e,from:n,ok:!1,reason:p});if(n<0||n>=i||o<0||o>i)return u("edge");const d=e==="row"?Tr(t):0;if(n<d||o<d)return u("header");const h=p=>e==="row"?VF(t,p):KF(t,p);return!h(n)||!h(n+1)||!h(o)?u("spans"):{dir:l,kind:e,from:n,ok:!0,boundary:o}}const uw=(t,e)=>e>t?e-1:e;function Qme(t,e,n){const o=[];t.forEach(i=>o.push(i));const[s]=o.splice(e,1);return o.splice(uw(e,n),0,s),o}function Zme(t,e,n){const o=pp(t),s=[];return t.forEach((i,r,l)=>{const u=o.filter(g=>g.row===l),d=u.find(g=>g.left===e);if(!d){s.push(i);return}const h=u.filter(g=>g!==d),p=h.findIndex(g=>g.left>=n);h.splice(p<0?h.length:p,0,d),s.push(i.copy(de.from(h.map(g=>g.node))))}),s}function GF(t,e,n){const o=t.doc.nodeAt(e);o&&t.replaceWith(e+1,e+o.nodeSize-1,de.from(n))}function ege(t){return t?t.textBetween(0,t.content.size," ",e=>e.type.name==="date"&&typeof e.attrs.ts=="string"?e.attrs.ts:"").trim():""}function tge(t){let e=t.replace(/[$€£%]/g,"").trim();if(/^-?\d{1,3}(,\d{3})+(\.\d+)?$/.test(e)&&(e=e.replaceAll(",","")),!e||/[,\s]/.test(e))return null;const n=Number(e);return Number.isFinite(n)?n:null}function XF(t){const e=ut.get(t),n=Tr(t);if(e.height-n<2||e.problems?.some(o=>o.type!=="colwidth mismatch"))return!1;for(let o=0;o<t.childCount;o++){let s=!1;if(t.child(o).forEach(i=>{(i.attrs.rowspan??1)>1&&o+i.attrs.rowspan>n&&(s=!0)}),s)return!1}return!0}function JF(t,e,n){const o=ut.get(t),s=Tr(t),i=[];for(let d=s;d<o.height;d++)i.push(ege(t.nodeAt(o.map[d*o.width+e])));const r=i.map(tge),l=i.some(Boolean)&&i.every((d,h)=>!d||r[h]!==null),u=n==="asc"?1:-1;return i.map((d,h)=>({key:d,index:h})).sort((d,h)=>{if(!d.key||!h.key)return d.key?-1:h.key?1:d.index-h.index;const p=l?r[d.index]-r[h.index]:d.key.localeCompare(h.key,void 0,{numeric:!0,sensitivity:"base"});return u*p||d.index-h.index}).map(d=>s+d.index)}function nge(t,e,n){const o=JF(t,e,n),s=Tr(t);if(o.every((r,l)=>r===s+l))return null;const i=[];for(let r=0;r<s;r++)i.push(t.child(r));for(const r of o)i.push(t.child(r));return i}function oge(t,e){let n;for(const o of pp(t)){if(e<o.left||e>=o.right)continue;const s=o.node.attrs.colwidth,i=Array.isArray(s)&&s[e-o.left]?s[e-o.left]:null;if(n===void 0)n=i;else if(n!==i)return null}return n??null}function sge(t,e,n,o){if(o!==null&&!Number.isFinite(o))return!1;const s=t.doc.nodeAt(e);if(!s)return!1;const i=o===null?0:Math.min(Yme,Math.max(Wme,Math.trunc(o)));let r=!1;for(const l of pp(s)){const u=n.filter(b=>b>=l.left&&b<l.right);if(!u.length)continue;const d=l.right-l.left,h=l.node.attrs.colwidth,p=Array.from({length:d},(b,w)=>Array.isArray(h)&&Number(h[w])||0);for(const b of u)p[b-l.left]=i;const g=p.some(Boolean)?p:null;JSON.stringify(g)!==JSON.stringify(h??null)&&(t.setNodeMarkup(e+1+l.pos,void 0,{...l.node.attrs,colwidth:g}),r=!0)}return r}function pD(t,e,n,o){let s=!1;for(const{pos:i,node:r}of e)(r.attrs[n]??null)!==o&&(t.setNodeMarkup(i,void 0,{...r.attrs,[n]:o}),s=!0);return s}function ji(t,e){if(e<0||e>t.doc.content.size)return null;const n=t.doc.resolve(e),o=n.nodeAfter;if(!o||o.type.spec.tableRole!=="cell")return null;const s=n.node(-1);if(s.type.spec.tableRole!=="table")return null;const i=n.before(-1),r=ut.get(s).findCell(e-i-1);return{tablePos:i,table:s,cellPos:e,cell:o,row:r.top,col:r.left}}function dw(t){const e=t.selection;if(e instanceof Et)return ji(t,e.$headCell.pos);const n=es(e.$head);return n?ji(t,n.pos):null}function $a(t){return{bid:t.cell.attrs.bid??null,pos:t.cellPos}}function ao(t,e){if(e.bid){let n=null;if(t.doc.descendants((o,s)=>n!==null?!1:(o.type.spec.tableRole==="cell"&&o.attrs.bid===e.bid&&(n=s),n===null&&!o.isTextblock)),n!==null)return ji(t,n)}return ji(t,e.pos)}function nk(t,e){const n=t.selection,o=[];if(n instanceof Et)n.forEachCell((s,i)=>o.push({pos:i,node:s}));else{const s=e??dw(t);s&&o.push({pos:s.cellPos,node:s.cell})}return o}const Nl=(t,e)=>{const n=t.selection;if(!(n instanceof Et))return!1;let o=!1;return n.forEachCell((s,i)=>{i===e&&(o=!0)}),o};function fw(t,e){const n=Ke.findFrom(t.doc.resolve(e+1),1,!0);return n?t.setSelection(n):t}function Iy(t,e,n,o){const s=t.doc.nodeAt(e);if(!s)return t;const i=ut.get(s),r=Math.min(Math.max(n,0),i.height-1),l=Math.min(Math.max(o,0),i.width-1);return fw(t,e+1+i.map[r*i.width+l])}function pT(t,e){const n=ao(t.state,e);if(!n)return null;if(!Nl(t.state,n.cellPos)){const o=fw(t.state.tr,n.cellPos);o.selection.eq(t.state.selection)||t.dispatch(o)}return ao(t.state,e)}function Rh(t,e,n){let o=null;if(!e(t.state,r=>{o=r})||!o)return!1;const i=o;return n?.(i),t.dispatch(i.scrollIntoView()),!0}const ige={addRowBefore:"Insert row above",addRowAfter:"Insert row below",addColumnBefore:"Insert column left",addColumnAfter:"Insert column right"},rge={addRowBefore:"Row inserted above",addRowAfter:"Row inserted below",addColumnBefore:"Column inserted left",addColumnAfter:"Column inserted right"},age={addRowBefore:Mee,addRowAfter:Oee,addColumnBefore:jee,addColumnAfter:Cee},lge={addRowBefore:"rowAbove",addRowAfter:"rowBelow",addColumnBefore:"colLeft",addColumnAfter:"colRight"};function su(t,e,n){return{key:t,label:ige[t],icon:lge[t],run:o=>{const s=pT(o,e);if(!s)return n("That cell is gone.");Ig=t;const i=Ho(o.state),r=t==="addRowBefore"?i.top:t==="addRowAfter"?i.bottom:null,l=t==="addColumnBefore"?i.left:t==="addColumnAfter"?i.right:null,u={rows:Tr(s.table),column:zy(s.table)};Rh(o,age[t],h=>{r!==null?(hD(h,s.tablePos,{kind:"row",index:r},u),Iy(h,s.tablePos,r,s.col)):l!==null&&(hD(h,s.tablePos,{kind:"col",index:l},u),Iy(h,s.tablePos,s.row,l))})&&n(rge[t])}}}function sS(t,e,n){if(!(t.selection instanceof Et)||!Nl(t,n.cellPos))return 1;const o=Ho(t);return e==="row"?o.bottom-o.top:o.right-o.left}function cge(t,e){return e<=1?t==="row"?"Delete row":"Delete column":t==="row"?`Delete ${e} rows`:`Delete ${e} columns`}function Ly(t,e,n,o){return{key:t==="row"?"deleteRow":"deleteColumn",label:cge(t,n),icon:"delete",run:s=>{if(!pT(s,e))return o("That cell is gone.");const r=Ho(s.state);if(t==="row"?r.top===0&&r.bottom===r.map.height:r.left===0&&r.right===r.map.width){o(`That would delete every ${t==="row"?"row":"column"}, so nothing was deleted. To delete the whole table, choose Delete table.`);return}const u=t==="row"?r.bottom-r.top:r.right-r.left;Rh(s,t==="row"?Ree:Eee)&&o(t==="row"?u===1?"Row deleted":"Rows deleted":u===1?"Column deleted":"Columns deleted")}}}function uge(t,e){return{key:"deleteTable",label:"Delete table",danger:!0,run:n=>{if(!pT(n,t))return e("That cell is gone.");Rh(n,Iee)&&e("Table deleted")}}}function dge(t,e,n,o){const s=ao(t.state,e);if(!s)return o("That cell is gone.");const i=WF(s.table,s.row,s.col,n);if(!i.ok)return o(hT(i));QF(t,s,i.kind,i.boundary,o,n)}function QF(t,e,n,o,s,i){const r=n==="row"?e.row:e.col,l=uw(r,o);if(l===r)return!1;const u=n==="row"?Qme(e.table,r,o):Zme(e.table,r,o),d=t.state.tr;GF(d,e.tablePos,u),Iy(d,e.tablePos,n==="row"?l:e.row,n==="row"?e.col:l),t.dispatch(d.scrollIntoView());const h=ut.get(e.table),p=i??(n==="row"?l<r?"up":"down":l<r?"left":"right");return s(Vme(p,l+1,n==="row"?h.height:h.width)),!0}function mD(t,e,n){return{key:e==="asc"?"sortAsc":"sortDesc",label:e==="asc"?"Sort column ascending":"Sort column descending",icon:e==="asc"?"sortAsc":"sortDesc",run:o=>{const s=ao(o.state,t);if(!s||!XF(s.table))return;const i=nge(s.table,s.col,e),r=e==="asc"?"Column sorted ascending":"Column sorted descending";if(!i)return n(r);const l=JF(s.table,s.col,e),u=o.state.tr;GF(u,s.tablePos,i);const d=Tr(s.table),h=s.row<d?s.row:d+l.indexOf(s.row);Iy(u,s.tablePos,h,s.col),o.dispatch(u.scrollIntoView()),n(r)}}}const fge=[{value:null,label:"Align left",icon:"alignLeft",done:"Aligned left"},{value:"center",label:"Align center",icon:"alignCenter",done:"Aligned center"},{value:"right",label:"Align right",icon:"alignRight",done:"Aligned right"}];function ZF(t,e,n){const o=n===void 0?dw(t):ji(t,n);if(!o)return null;const s=$a(o),i=nk(t,Nl(t,o.cellPos)?null:o),r=qme.map(N=>{const D=WF(o.table,o.row,o.col,N);return{key:`move-${N}`,label:Ume[N],icon:N,disabledReason:D.ok?void 0:hT(D),run:E=>dge(E,s,N,e)}}),l=Nl(t,o.cellPos)?Ho(t):null,u=l?Array.from({length:l.right-l.left},(N,D)=>l.left+D):[o.col],d=u.map(N=>oge(o.table,N)),h=d.every(N=>N===d[0])?d[0]:void 0,p=(N,D,E)=>({key:D,label:N,checked:h===E,run:R=>{const B=ao(R.state,s);if(!B)return e("That cell is gone.");const I=R.state.tr;sge(I,B.tablePos,u,E)&&R.dispatch(I),e(`Column width set to ${N}`)}}),g=[...Kme.map(N=>p(N.label,N.key,N.px)),p("Auto","auto",null)],b=[Ly("row",s,sS(t,"row",o),e),Ly("col",s,sS(t,"col",o),e),uge(s,e)],w=XF(o.table)?[mD(s,"asc",e),mD(s,"desc",e)]:[],k=new Set(i.map(N=>N.node.attrs.align??null)),j=fge.map(N=>({key:N.icon,label:N.label,icon:N.icon,checked:k.size===1&&k.has(N.value),run:D=>{if(!ao(D.state,s))return e("That cell is gone.");const E=D.state.tr;pD(E,nk(D.state,Nl(D.state,o.cellPos)?null:ao(D.state,s)),"align",N.value)&&D.dispatch(E),e(N.done)}})),C=new Set(i.map(N=>N.node.attrs.background??null)),_={current:C.size===1?[...C][0]:void 0,pick:(N,D)=>{const E=ao(N.state,s);if(!E)return e("That cell is gone.");const R=N.state.tr;pD(R,nk(N.state,Nl(N.state,E.cellPos)?null:E),"background",D)&&N.dispatch(R);const B=qF.find(I=>I.value===D)?.label;e(D===null?"Cell color removed":`Cell color ${B??D}`)}},T=[];t.selection instanceof Et&&G2(t)&&T.push({key:"merge",label:"Merge cells",icon:"merge",run:N=>{Rh(N,G2)&&e("Cells merged")}}),((o.cell.attrs.colspan??1)>1||(o.cell.attrs.rowspan??1)>1)&&T.push({key:"split",label:"Split cell",icon:"split",run:N=>{const D=ao(N.state,s);if(!D)return e("That cell is gone.");N.dispatch(fw(N.state.tr,D.cellPos)),Rh(N,Dee)&&e("Cell split")}});const M=N=>({key:N?"headerColumn":"headerRow",label:N?"Toggle header column":"Toggle header row",icon:N?"headerColumn":"headerRow",checked:N?zy(o.table):Tr(o.table)>0,run:D=>{const E=ao(D.state,s);if(!E)return e("That cell is gone.");const R=D.state.tr;if(!(N?Jme(R,E.tablePos):Xme(R,E.tablePos)))return;D.dispatch(R);const B=D.state.doc.nodeAt(E.tablePos),I=B?N?zy(B):Tr(B)>0:!1;e(N?I?"Header column on":"Header column off":I?"Header row on":"Header row off")}});T.push(M(!1),M(!0));const O=["addRowBefore","addRowAfter","addColumnBefore","addColumnAfter"].map(N=>su(N,s,e));return{target:o,insert:O,move:r,widths:g,remove:b,sort:w,align:j,color:_,structure:T}}let Ig=null;function hge(t,e){const n=Ig&&t.editable?dw(t.state):null;return!Ig||!n?!1:(su(Ig,$a(n),e).run(t),!0)}function pge(t,e,n,o){const s=ji(t,n);if(!s)return[];const i=$a(s),r=sS(t,e,s);return e==="row"?[su("addRowBefore",i,o),su("addRowAfter",i,o),Ly("row",i,r,o)]:[su("addColumnBefore",i,o),su("addColumnAfter",i,o),Ly("col",i,r,o)]}function mge(t,e,n){const o=ji(t,n);if(!o)return null;const s=ut.get(o.table),i=o.tablePos+1,r=t.doc.resolve(i+(e==="row"?s.map[o.row*s.width]:s.map[o.col])),l=t.doc.resolve(i+(e==="row"?s.map[o.row*s.width+s.width-1]:s.map[(s.height-1)*s.width+o.col])),u=e==="row"?Et.rowSelection(r,l):Et.colSelection(r,l);return t.tr.setSelection(u)}function e6({view:t,action:e}){return y.jsx(Qe,{danger:e.danger,checked:e.checked,disabled:e.disabledReason!==void 0,title:e.disabledReason,icon:e.icon?y.jsx(HF,{name:e.icon}):void 0,onSelect:()=>e.run(t),children:e.label})}function gge({value:t}){return y.jsx("span",{className:"block size-3.5 rounded-full ring-1 ring-inset ring-chrome-line","data-cell-swatch":t??"none"})}function t6({current:t,onPick:e}){return qF.map(n=>y.jsx(Qe,{checked:t===n.value,icon:y.jsx(gge,{value:n.value}),onSelect:()=>e(n.value),children:n.label},n.label))}function n6({view:t,cell:e}){const n=me(r=>r.state)??t.state,o=ao(n,e),s=o?ZF(n,sn,o.cellPos):null;if(!s)return null;const i=r=>y.jsx(e6,{view:t,action:r},r.key);return y.jsxs(y.Fragment,{children:[s.insert.map(i),y.jsx(uu,{label:"Move row or column",icon:y.jsx(QB,{className:"size-4",strokeWidth:1.75}),children:s.move.map(i)}),y.jsx(uu,{label:"Set column width",icon:y.jsx(fj,{className:"size-4",strokeWidth:1.75}),children:s.widths.map(r=>y.jsx(Qe,{checked:r.checked,onSelect:()=>r.run(t),children:r.label},r.key))}),y.jsx(ts,{}),s.remove.map(i),y.jsx(ts,{}),s.sort.map(i),s.align.map(i),y.jsx(uu,{label:"Cell color",icon:y.jsx(dI,{className:"size-4",strokeWidth:1.75}),children:y.jsx(t6,{current:s.color.current,onPick:r=>s.color.pick(t,r)})}),s.structure.length?y.jsx(ts,{}):null,s.structure.map(i)]})}function yge({view:t,cell:e,kind:n}){const o=me(i=>i.state)??t.state,s=ao(o,e);return s?pge(o,n,s.cellPos,sn).map(i=>y.jsx(e6,{view:t,action:i},i.key)):null}const Nh=(t,e)=>{const n=t.nodeDOM(e);return n instanceof HTMLElement?n:null},o6=(t,e)=>Nh(t,e.cellPos)?.closest("table")??null;function s6(t,e,n){const o=o6(t,e);if(!o)return[];const s=o.getBoundingClientRect(),i=ut.get(e.table),r=e.tablePos+1,l=[];if(n==="row"){for(let u=0;u<i.height;u++){const d=Nh(t,r+i.map[u*i.width])?.closest("tr");l.push(d?d.getBoundingClientRect().top:l.at(-1)??s.top)}l.push(s.bottom)}else{for(let u=0;u<i.width;u++){let d=null;for(let h=0;h<i.height&&d===null;h++){const p=i.map[h*i.width+u];if(i.findCell(p).left!==u)continue;const g=Nh(t,r+p);g&&(d=g.getBoundingClientRect().left)}l.push(d??l.at(-1)??s.left)}l.push(s.right)}return l}function bge(t,e){let n=0;return t.forEach((o,s)=>{Math.abs(o-e)<Math.abs(t[n]-e)&&(n=s)}),n}const gD=40,wge=["comment","react"],ok=8;function xge(t,e){let n=null;return e.forEachCell((o,s)=>{const i=Nh(t,s)?.getBoundingClientRect();i&&(n=n?DOMRect.fromRect({x:Math.min(n.left,i.left),y:Math.min(n.top,i.top),width:Math.max(n.right,i.right)-Math.min(n.left,i.left),height:Math.max(n.bottom,i.bottom)-Math.min(n.top,i.top)}):i)}),n}function vge(){const t=me(i=>i.view),e=me(i=>i.state),n=me(i=>i.focused),[o,s]=S.useState(0);return!t||!e||!t.editable||!(e.selection instanceof Et)||!n&&o===0?null:y.jsx(kge,{view:t,state:e,selection:e.selection,onMenu:i=>s(r=>Math.max(0,r+(i?1:-1)))})}function kge({view:t,state:e,selection:n,onMenu:o}){const s=S.useRef(null),i=vy(T=>T.actions),r=wge.flatMap(T=>{const M=i[T];return M&&M.available()?[{key:T,action:M}]:[]}),l=t.dom.closest(".doc-page"),u=xge(t,n),d=ZF(e,sn,n.$headCell.pos);if(!l||!u||!d)return null;const h=l.getBoundingClientRect(),p=u.top-gD-ok>=0,g=(p?u.top-gD-ok:u.bottom+ok)-h.top,b=Math.max(0,u.left-h.left),w=p?"top":"bottom",k=T=>T.preventDefault(),j=d.structure.filter(T=>T.key==="merge"||T.key==="split"),C=d.remove.filter(T=>T.key!=="deleteTable"),_=T=>o(T);return y.jsxs(Qu,{ref:s,role:"toolbar","aria-label":"Cell actions",className:"absolute z-30 h-10 gap-0.5 px-1",style:{left:b,top:g},onMouseDown:k,children:[r.map(({key:T,action:M})=>{const O=M.icon;return y.jsx(eo,{size:"md",tipSide:w,label:M.label,shortcut:M.shortcut?Si(M.shortcut):void 0,icon:y.jsx(O,{className:"size-4"}),onClick:()=>{s.current&&M.run(s.current)}},T)}),r.length?y.jsx(yi,{}):null,j.map(T=>y.jsx(eo,{size:"md",tipSide:w,label:T.label,icon:T.icon?y.jsx(HF,{name:T.icon}):null,onClick:()=>T.run(t)},T.key)),y.jsx(zn,{side:w==="top"?"bottom":"top",onOpenChange:_,trigger:y.jsx(eo,{size:"md",tipSide:w,label:"Cell color",icon:y.jsx(dI,{className:"size-4",strokeWidth:1.75})}),children:y.jsx(t6,{current:d.color.current,onPick:T=>d.color.pick(t,T)})}),y.jsx(yi,{}),C.map(T=>y.jsx(it,{className:"px-2 text-[13px]",onClick:()=>T.run(t),children:T.label},T.key)),y.jsx(yi,{}),y.jsx(zn,{side:w==="top"?"bottom":"top",align:"end",onOpenChange:_,trigger:y.jsx(eo,{size:"md",tipSide:w,label:"More cell actions",icon:y.jsx(Xu,{className:"size-4",strokeWidth:1.75})}),children:y.jsx(n6,{view:t,cell:$a(d.target)})})]})}function i6({left:t,top:e,open:n,onClose:o,side:s="bottom",align:i="start",children:r}){return y.jsx("div",{className:"pointer-events-none absolute size-0",style:{left:t,top:e},children:y.jsx(zn,{open:n,onOpenChange:l=>{l||o()},side:s,align:i,sideOffset:2,trigger:y.jsx("button",{type:"button",tabIndex:-1,"aria-hidden":"true",className:"block size-0 opacity-0"}),children:r})})}const mT=qt(()=>({context:null})),yD=(t,e)=>mT.setState({context:{ref:t,...e}}),Sge=()=>mT.setState({context:null});function bD(t,e,n){const o=t.closest(".doc-page");if(!o)return null;const s=o.getBoundingClientRect();return{left:e-s.left,top:n-s.top}}function jge(){const t=me(n=>n.view),e=mT(n=>n.context);return!t||!e?null:y.jsx(i6,{left:e.left,top:e.top,open:!0,onClose:()=>{Sge(),requestAnimationFrame(()=>{!t.isDestroyed&&t.editable&&t.focus()})},children:y.jsx(n6,{view:t,cell:e.ref})},`${e.left}:${e.top}`)}const Cge=40,Tge=48;function Ege(t,e,n){let o=-1;for(const[l,u]of t.entries()){const{box:d,overflow:h}=u;h<=1||d.bottom<=d.top||d.bottom<=e.bottom||d.top>e.bottom-n-Cge||(o===-1||d.top>t[o].box.top)&&(o=l)}if(o===-1)return null;const s=t[o],i=Math.max(s.shownLeft,e.left),r=Math.min(s.shownRight,e.right)-i;return r<Tge?null:{index:o,left:i,width:r,track:r+s.overflow}}function _ge(t,e){return!t||!e?t===e:t.index===e.index&&Math.abs(t.left-e.left)<.5&&Math.abs(t.width-e.width)<.5&&Math.abs(t.track-e.track)<.5}const sk=12;function Mge(t){const e=t.getBoundingClientRect(),n=getComputedStyle(t),o=e.left+t.clientLeft,s=t.parentElement?.classList.contains("doc-text")??!1;return{box:e,shownLeft:o+(s?0:Number.parseFloat(n.paddingLeft)||0),shownRight:o+t.clientWidth-(Number.parseFloat(n.paddingRight)||0),overflow:t.scrollWidth-t.clientWidth}}function Oge(){const t=me(u=>u.view),e=me(u=>u.state?.doc),[n,o]=S.useState(null),s=S.useRef(null),i=S.useRef(null),r=S.useRef(()=>{});if(S.useEffect(()=>{const u=t?.dom.closest("[data-doc-scroll]"),d=u?.parentElement;if(!t||!u||!d)return;let h=0;const p=new Set,g=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>w()),b=()=>{h=0;const j=[...t.dom.querySelectorAll(".tableWrapper")],C=new Set(j.flatMap(R=>[...R.querySelectorAll(":scope > table")]));for(const R of p)C.has(R)||g?.unobserve(R);for(const R of C)p.has(R)||g?.observe(R);p.clear();for(const R of C)p.add(R);const _=u.getBoundingClientRect(),T=_.top+u.clientTop,M=_.left+u.clientLeft,O={left:M,bottom:T+u.clientHeight,right:M+u.clientWidth},N=t.dom.isConnected?Ege(j.map(Mge),O,sk):null;i.current=N?j[N.index]:null;const D=d.getBoundingClientRect(),E=N?{place:N,left:N.left-D.left,top:O.bottom-D.top-sk}:null;o(R=>_ge(R?.place??null,E?.place??null)&&Math.abs((R?.top??0)-(E?.top??0))<.5&&Math.abs((R?.left??0)-(E?.left??0))<.5?R:E),i.current&&s.current&&Math.abs(s.current.scrollLeft-i.current.scrollLeft)>.5&&(s.current.scrollLeft=i.current.scrollLeft)},w=()=>{h||(h=requestAnimationFrame(b))},k=j=>{const C=i.current;C&&j.target===C&&s.current&&Math.abs(s.current.scrollLeft-C.scrollLeft)>.5&&(s.current.scrollLeft=C.scrollLeft),w()};return u.addEventListener("scroll",k,{capture:!0,passive:!0}),window.addEventListener("resize",w),g?.observe(u),g?.observe(t.dom),r.current=w,w(),()=>{cancelAnimationFrame(h),u.removeEventListener("scroll",k,{capture:!0}),window.removeEventListener("resize",w),g?.disconnect(),r.current=()=>{},i.current=null,o(null)}},[t]),S.useEffect(()=>r.current(),[e]),S.useLayoutEffect(()=>{s.current&&i.current&&(s.current.scrollLeft=i.current.scrollLeft)},[n?.place.index,n?.place.track]),!n)return null;const l=u=>{const d=i.current,h=u.currentTarget.scrollLeft;d&&Math.abs(d.scrollLeft-h)>.5&&(d.scrollLeft=h)};return y.jsx("div",{ref:s,className:"doc-table-dock absolute z-20 overflow-x-scroll overflow-y-hidden bg-page/85",style:{left:n.left,top:n.top,width:n.place.width,height:sk},tabIndex:-1,"aria-hidden":"true","data-table-dock":"",onScroll:l,children:y.jsx("div",{style:{width:n.place.track,height:1}})})}const Age=4,Jc=24,Qc=14,Rge={col:"Click for column options · drag to move",row:"Click for row options · drag to move"};function Nge(t,e,n){const o=document.elementFromPoint(e,n);if(!o)return null;if(o.closest("[data-table-grip]"))return"keep";if(!t.dom.contains(o))return null;if(!o.closest("td, th"))return o.closest("table, .tableWrapper")?"keep":null;const i=t.posAtCoords({left:e,top:n}),r=i?es(t.state.doc.resolve(i.pos)):null,l=r?ji(t.state,r.pos):null;return l?$a(l):null}function Dge(){const t=me(M=>M.view),e=me(M=>M.state),[n,o]=S.useState(null),[s,i]=S.useState(null),[r,l]=S.useState(null),u=S.useRef(!1);if(u.current=s!==null||r!==null,S.useEffect(()=>{const M=t?.dom.closest("[data-doc-scroll]");if(!t||!M)return;let O=0,N={x:0,y:0};const D=()=>{if(O=0,u.current||!t.editable)return;const B=Nge(t,N.x,N.y);B!=="keep"&&o(I=>I&&B&&I.bid===B.bid&&I.pos===B.pos?I:B)},E=B=>{const{clientX:I,clientY:P}=B;N={x:I,y:P},O||(O=requestAnimationFrame(D))},R=()=>{u.current||o(null)};return M.addEventListener("mousemove",E,{passive:!0}),M.addEventListener("mouseleave",R),t.dom.addEventListener("keydown",R),()=>{cancelAnimationFrame(O),M.removeEventListener("mousemove",E),M.removeEventListener("mouseleave",R),t.dom.removeEventListener("keydown",R)}},[t]),S.useEffect(()=>o(null),[t]),!t||!e||!t.editable)return null;const d=s?.ref??r?.ref??n,h=d?ao(e,d):null,p=t.dom.closest(".doc-page"),g=h?Nh(t,h.cellPos)?.getBoundingClientRect():null,b=h?o6(t,h)?.getBoundingClientRect():null;if(!h||!p||!g||!b)return null;const w=p.getBoundingClientRect(),k=$a(h),j={left:g.left+g.width/2-w.left,top:b.top-w.top},C={left:b.left-w.left,top:g.top+g.height/2-w.top},_=(M,O)=>{if(M.button!==0)return;M.preventDefault();const N=mge(t.state,O,h.cellPos);N&&t.dispatch(N),t.focus();const D={x:M.clientX,y:M.clientY};let E=null;const R=W=>{if(E===null&&Math.hypot(W.clientX-D.x,W.clientY-D.y)<Age)return;const K=ao(t.state,k);K&&(E=bge(s6(t,K,O),O==="row"?W.clientY:W.clientX),l({kind:O,ref:k,boundary:E}))},B=()=>{window.removeEventListener("pointermove",R),window.removeEventListener("pointerup",I),window.removeEventListener("pointercancel",P),window.removeEventListener("keydown",$,!0),document.body.style.removeProperty("cursor"),l(null)},I=()=>{B(),E===null?i({kind:O,ref:k}):Pge(t,k,O,E)},P=()=>B(),$=W=>{W.key==="Escape"&&(W.preventDefault(),W.stopPropagation(),B())};window.addEventListener("pointermove",R),window.addEventListener("pointerup",I),window.addEventListener("pointercancel",P),window.addEventListener("keydown",$,!0),document.body.style.cursor="grabbing"},T=(M,O)=>{const N=M==="col";return y.jsx(wn,{label:Rge[M],side:N?"top":"left",disabled:s!==null||r!==null,children:y.jsx("button",{type:"button",tabIndex:-1,"aria-label":M==="col"?"Column options":"Row options","data-table-grip":"","data-active":s?.kind===M||r?.kind===M?"":void 0,className:"table-grip absolute z-20 flex cursor-grab items-center justify-center rounded-[5px] border border-chrome-line bg-chrome text-chrome-muted shadow-chrome hover:bg-chrome-hover hover:text-chrome-fg data-[active]:bg-chrome-accent data-[active]:text-white",style:{left:O.left-(N?Jc:Qc)/2,top:O.top-(N?Qc:Jc)/2,width:N?Jc:Qc,height:N?Qc:Jc},onPointerDown:D=>_(D,M),children:N?y.jsx(yK,{className:"size-3.5",strokeWidth:2}):y.jsx(rj,{className:"size-3.5",strokeWidth:2})})})};return y.jsxs(y.Fragment,{children:[T("col",j),T("row",C),r?y.jsx(Bge,{view:t,drag:r,page:w,table:b}):null,s?y.jsx(i6,{left:s.kind==="col"?j.left-Jc/2:C.left+Qc/2,top:s.kind==="col"?j.top+Qc/2:C.top-Jc/2,side:s.kind==="col"?"bottom":"right",open:!0,onClose:()=>{i(null),requestAnimationFrame(()=>{t.isDestroyed||t.focus()})},children:y.jsx(yge,{view:t,cell:s.ref,kind:s.kind})}):null]})}function Pge(t,e,n,o){const s=ao(t.state,e);if(!s)return;const i=n==="row"?s.row:s.col;if(uw(i,o)===i)return;const r=YF(s.table,n,i,o);if(!r.ok){sn(hT(r));return}QF(t,s,n,o,sn)}function Bge({view:t,drag:e,page:n,table:o}){const s=ao(t.state,e.ref);if(!s)return null;const i=e.kind==="row"?s.row:s.col;if(uw(i,e.boundary)===i)return null;const r=s6(t,s,e.kind)[e.boundary];if(r===void 0)return null;const l=YF(s.table,e.kind,i,e.boundary).ok,u=e.kind==="row";return y.jsx("div",{"aria-hidden":"true","data-allowed":l?"":void 0,className:"table-drop-line pointer-events-none absolute z-20 rounded-full",style:u?{left:o.left-n.left,top:r-n.top-1,width:o.width,height:2}:{left:r-n.left-1,top:o.top-n.top,width:2,height:o.height}})}const zge=12,Ige=20,r6=48,Zc=99,Lge=7,a6=t=>Array.from(t).length;function $ge(t){let e=0;return t.descendants(n=>{if(n.isAtom&&n.isBlock&&(e=Zc),!n.isTextblock)return e<Zc;let o=0;return n.forEach(s=>{e>=Zc||(s.type.name==="hardBreak"?o=0:s.isText?o+=a6((s.text??"").slice(0,2*Zc)):s.type.name==="media"?o=Zc:o+=Lge,e=Math.max(e,o))}),!1}),Math.min(e,Zc)}function Fge(t){return t.textBetween(0,t.content.size," "," ").split(/\s+/).reduce((e,n)=>Math.max(e,a6(n)),0)}function Hge(t,e,n){return t<=zge&&!n?{wrap:"short",chars:0}:{wrap:e()<=Ige?"words":null,chars:t}}function qge(t){const e=ut.get(t),n=Array.from({length:e.width},()=>0),o=new Set;for(let s=0;s<e.height;s++)for(let i=0;i<e.width;i++){const r=e.map[s*e.width+i];if(o.has(r)&&n[i])continue;o.add(r);const l=t.nodeAt(r),u=e.findCell(r).left,d=Array.isArray(l?.attrs.colwidth)&&Number(l.attrs.colwidth[i-u])||0;d>0&&!n[i]&&(n[i]=d)}return n}function Uge(t,e){let n=0,o=0;for(const r of e)r>0?n+=r:o+=1;const{wrap:s,chars:i}=Hge($ge(t),()=>Fge(t),e.length>1);return{wrap:s,chars:i,min:n>0?n+o*r6:null}}function Vge(t){const e=qge(t);if(e.every(i=>i>0))return[];const n=ut.get(t),o=[],s=new Set;for(const i of n.map){if(s.has(i))continue;s.add(i);const r=t.nodeAt(i);if(!r)continue;const{left:l,right:u}=n.findCell(i),d=Uge(r,e.slice(l,u));o.push({offset:i,size:r.nodeSize,left:l,right:u,wrap:d.wrap,style:Kge(d)})}return o}function Kge(t){return[t.chars?`--fit-chars: ${t.chars}`:"",t.min?`--fit-min: ${t.min}px`:""].filter(Boolean).join("; ")}const Wge={rail:0,icons:64,none:24};function Yge(t,e,n){const o=e.left+e.contentWidth-e.paddingRight-Wge[n];return Math.max(t.width,Math.floor(o-t.left))}const Gge=24,Xge=48;function Jge(t,e){return Math.max(Xge,Math.floor(t.left-e.left-Gge))}function Qge(t,e){const n=Array.from({length:e},()=>0);let o=e;const s=[];for(const i of t){if(!o)break;if(i.right-i.left>1)s.push(i);else if(!n[i.left]){if(i.width===null)return null;n[i.left]=i.width,o-=1}}for(const i of o?s:[]){if(i.width===null)return null;let r=i.width;const l=[];for(let u=i.left;u<i.right;u++)n[u]?r-=n[u]:l.push(u);for(const u of l)n[u]=r/l.length}return n.every(i=>i>0)?n.map(i=>Math.max(r6,Math.ceil(i*1e3)/1e3)):null}const Dl=new so("tableCells");function wD(t,e){const n=[];return t.descendants((o,s)=>{if(o.type.spec.tableRole!=="table")return!o.isTextblock;const i=e?.pos===s?e.widths:null;n.push(tt.node(s,s+o.nodeSize,i?{"data-fit-lock":"cursor"}:{"data-fit":""}));const r=new Map(Vge(o).map(d=>[d.offset,d])),l=ut.get(o),u=new Set;for(const d of l.map){if(u.has(d))continue;u.add(d);const h=o.nodeAt(d);if(!h)continue;const p=r.get(d),g=h.attrs.background,{left:b,right:w}=l.findCell(d),k=i?i.slice(b,w).reduce((T,M)=>T+M,0):0,j=[Gme(g)?`--cell-bg: ${g.toLowerCase()}`:"",p?.style??"",k?`--fit-lock: ${Math.round(k*1e3)/1e3}px`:""].filter(Boolean).join("; "),C={...j?{style:j}:{},...p?.wrap?{"data-fit-cell":p.wrap}:{}},_=s+1+d;Object.keys(C).length&&n.push(tt.node(_,_+h.nodeSize,C))}return!1}),Ge.create(t,n)}function Zge(t,e){if(!t||!e.docChanged)return t;const n=e.mapping.mapResult(t.pos,1),o=n.deleted?null:e.doc.nodeAt(n.pos);return o?.type.spec.tableRole!=="table"||ut.get(o).width!==t.widths.length?null:n.pos===t.pos?t:{...t,pos:n.pos}}function eye(t){const{$head:e}=t.selection;for(let n=1;n<=e.depth;n++){const o=e.node(n);if(o.type.spec.tableRole==="table")return{pos:e.before(n),node:o}}return null}function tye(t){const e=getComputedStyle(t);return t.clientWidth-(Number.parseFloat(e.paddingLeft)||0)-(Number.parseFloat(e.paddingRight)||0)}function nye(t,e){const n=t.nodeDOM(e);if(!(n instanceof HTMLElement)||!n.classList.contains("tableWrapper"))return null;const o=n.querySelector(":scope > table");return o?{wrapper:n,table:o}:null}function oye(t,e){const n=e.target instanceof Element?e.target.closest("td, th"):null;if(!n||!t.dom.contains(n))return null;const o=t.posAtCoords({left:e.clientX,top:e.clientY});if(!o)return null;const s=es(t.state.doc.resolve(o.pos));if(!s||!ji(t.state,s.pos))return null;const{selection:i}=t.state;if(!(i instanceof Et?Nl(t.state,s.pos):es(i.$from)?.pos===s.pos&&es(i.$to)?.pos===s.pos)){const l=t.state.doc.resolve(o.pos),u=es(l)?.pos===s.pos&&l.parent.inlineContent;t.dispatch(u?t.state.tr.setSelection(Le.create(t.state.doc,o.pos)):fw(t.state.tr,s.pos))}return s.pos}function sye(t){const e=t.dom.closest("[data-doc-scroll]"),n=t.dom.parentElement;if(!e||!n||typeof ResizeObserver>"u")return()=>{};const o=()=>{const r=t.dom.getBoundingClientRect(),l=e.getBoundingClientRect(),u=e.dataset.marginColumn,d=u==="rail"||u==="icons"?u:"none",h=Yge({left:r.left+t.dom.clientLeft,width:t.dom.clientWidth},{left:l.left+e.clientLeft,contentWidth:e.clientWidth,paddingRight:Number.parseFloat(getComputedStyle(e).paddingRight)||0},d),p=Jge({left:r.left+t.dom.clientLeft},{left:l.left+e.clientLeft});for(const[g,b]of[["--table-room",`${h}px`],["--table-left",`${p}px`]])n.style.getPropertyValue(g)!==b&&n.style.setProperty(g,b)},s=new ResizeObserver(o);s.observe(e),s.observe(t.dom);const i=new MutationObserver(o);return i.observe(e,{attributes:!0,attributeFilter:["data-margin-column","style"]}),o(),()=>{s.disconnect(),i.disconnect(),n.style.removeProperty("--table-room"),n.style.removeProperty("--table-left")}}function iye(t){if(typeof ResizeObserver>"u")return{sync(){},destroy(){}};const e=new Set,n=l=>{const u=l.querySelector(":scope > table"),d=!!u&&l.scrollLeft>0&&u.getBoundingClientRect().left<l.getBoundingClientRect().left+l.clientLeft-.5,h=l.scrollWidth-l.clientWidth-l.scrollLeft>1,p=[d?"left":"",h?"right":""].filter(Boolean).join(" ");p!==(l.dataset.clip??"")&&(p?l.dataset.clip=p:delete l.dataset.clip)},o=l=>n(l.currentTarget),s=new ResizeObserver(l=>{for(const u of l){const d=u.target.closest(".tableWrapper");d&&e.has(d)&&n(d)}}),i=l=>{l.removeEventListener("scroll",o),s.unobserve(l);const u=l.querySelector(":scope > table");u&&s.unobserve(u),e.delete(l)},r=()=>{const l=new Set(t.dom.querySelectorAll(".tableWrapper"));for(const u of e)l.has(u)||i(u);for(const u of l){if(e.has(u))continue;e.add(u),u.addEventListener("scroll",o,{passive:!0}),s.observe(u);const d=u.querySelector(":scope > table");d&&s.observe(d),n(u)}};return r(),{sync:r,destroy(){for(const l of[...e])i(l);s.disconnect()}}}function rye(t){let e=null,n=0;const o=()=>{Dl.getState(t.state)?.lock&&t.dispatch(t.state.tr.setMeta(Dl,{lock:null}).setMeta("addToHistory",!1))},s=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{if(!e)return;const l=e.clientWidth;Math.abs(l-n)<.5||(n=l,o())}),i=l=>{e!==l&&(e&&s?.unobserve(e),e=l,l&&(n=l.clientWidth,s?.observe(l)))};return{update:()=>{if(t.composing)return;const l=Dl.getState(t.state)?.lock??null,u=!!Do.getState(t.state)?.dragging,d=t.editable&&!u?eye(t.state):null;if(!d)return i(null),o();const h=nye(t,d.pos);if(l?.pos===d.pos)return i(h?.wrapper??null);if(!h||h.table.getBoundingClientRect().width<tye(h.wrapper)-1.5)return i(null),o();const p=ut.get(d.node),g=new Set,b=[];for(const k of p.map){if(g.has(k))continue;g.add(k);const j=t.nodeDOM(d.pos+1+k),{left:C,right:_}=p.findCell(k);b.push({left:C,right:_,width:j instanceof HTMLElement?j.getBoundingClientRect().width:null})}const w=Qge(b,p.width);if(!w)return o();i(h.wrapper),t.dispatch(t.state.tr.setMeta(Dl,{lock:{pos:d.pos,widths:w}}).setMeta("addToHistory",!1))},destroy(){s?.disconnect()}}}const aye=1e3;function lye(){let t=0;return[Nf({"Mod-y":(e,n,o)=>ah(e,n)||!!o&&hge(o,sn)}),new It({key:Dl,state:{init:(e,n)=>({lock:null,decorations:wD(n.doc,null)}),apply(e,n){const o=e.getMeta(Dl),s=o?o.lock:Zge(n.lock,e);return!e.docChanged&&s===n.lock?n:{lock:s,decorations:wD(e.doc,s)}}},view(e){const n=sye(e),o=iye(e),s=rye(e);return{update(){o.sync(),s.update()},destroy(){n(),o.destroy(),s.destroy()}}},props:{decorations:e=>Dl.getState(e)?.decorations,handleDOMEvents:{contextmenu(e,n){if(Date.now()-t<aye)return t=0,n.preventDefault(),!0;if(!e.editable)return!1;const o=oye(e,n);if(o===null)return!1;const s=ji(e.state,o),i=bD(e.dom,n.clientX,n.clientY);return!s||!i?!1:(n.preventDefault(),yD($a(s),i),!0)}},handleKeyDown(e,n){if(!e.editable||!(n.key==="ContextMenu"||n.key==="F10"&&n.shiftKey))return!1;const o=dw(e.state);if(!o)return!1;const s=e.coordsAtPos(e.state.selection.head),i=bD(e.dom,s.left,s.bottom);return i?(n.preventDefault(),t=Date.now(),yD($a(o),i),!0):!1}}})]}ko({plugins:lye});ht("layer","table-grips",Dge,20);ht("layer","table-cell-bar",vge,21);ht("layer","table-context-menu",jge,22);ht("float","table-dock",Oge,10);const cye=new Set(["csv","latex","markdown","mermaid"]),l6={bash:"bash",css:"css",html:"xml",javascript:"javascript",json:"json",latex:"latex",markdown:"markdown",python:"python",sql:"sql",typescript:"typescript",xml:"xml",yaml:"yaml"},gT=["bash","css","xml","javascript","json","python","sql","typescript","yaml"];function mp(t){if(!t)return null;const e=t.trim().toLowerCase();return Eh.find(n=>n.key===e||n.aliases.includes(e))??null}function uye(t){const e=mp(t)?.key;return e&&cye.has(e)?e:null}function c6(t){if(!t)return"auto";const e=mp(t)?.key;return e?l6[e]??null:null}function dye(t){return Eh.find(n=>n.key===t||l6[n.key]===t)?.label??t}function fye(t,e){return t?mp(t)?.label??t:e?`auto (${dye(e)})`:"auto"}function xD(t){const e=t.trim().toLowerCase();return e?Eh.filter(n=>n.key.includes(e)||n.label.toLowerCase().includes(e)||n.aliases.some(o=>o.includes(e))):[...Eh]}const hye=304;function pye({shown:t,language:e,disabled:n,onPick:o,onClose:s}){const[i,r]=S.useState(!1),[l,u]=S.useState(""),[d,h]=S.useState(0),p=S.useId(),g=mp(e)?.key??(e||null),b=S.useMemo(()=>{const _=xD(l).map(M=>({key:M.key,label:M.label}));return!l.trim()||"auto".startsWith(l.trim().toLowerCase())?[{key:null,label:"auto"},..._]:_},[l]),w=_=>{r(_),_?(u(""),h(Math.max(0,[{key:null},...xD("")].findIndex(T=>T.key===g)))):s()},k=_=>{_&&(r(!1),o(_.key))},j=_=>{if(_.key==="ArrowDown"||_.key==="ArrowUp"){_.preventDefault();const T=_.key==="ArrowDown"?1:-1;h(M=>b.length?(M+T+b.length)%b.length:0)}else _.key==="Enter"&&(_.preventDefault(),k(b[d]))},C=y.jsxs("button",{type:"button",disabled:n,"aria-label":`${t}, language`,title:n?void 0:"Set language",className:"inline-flex h-6 items-center gap-1 rounded-[6px] px-1.5 text-[12px] text-chrome-muted outline-none hover:bg-chrome-hover hover:text-chrome-fg focus-visible:outline-2 focus-visible:outline-chrome-focus disabled:pointer-events-none data-[popup-open]:bg-chrome-hover",children:[y.jsx("span",{children:t}),n?null:y.jsx(Ps,{className:"size-3",strokeWidth:2})]});return n?C:y.jsxs(Tb,{trigger:C,side:"bottom",align:"start",gap:4,open:i,onOpenChange:w,label:"Set language",className:"w-56 p-1.5",children:[y.jsx("input",{autoFocus:!0,value:l,role:"combobox","aria-label":"Language","aria-controls":p,"aria-expanded":"true","aria-activedescendant":b[d]?`${p}-${d}`:void 0,placeholder:"Language",onChange:_=>{u(_.target.value),h(0)},onKeyDown:j,className:"mb-1 h-7 w-full rounded-[8px] bg-chrome-hover px-2 text-[13px] text-chrome-fg outline-none placeholder:text-chrome-muted"}),y.jsxs("div",{id:p,role:"listbox","aria-label":"Language",className:"overflow-y-auto",style:{maxHeight:hye},children:[b.map((_,T)=>y.jsxs("div",{id:`${p}-${T}`,role:"option","aria-selected":T===d,onMouseMove:()=>h(T),onMouseDown:M=>M.preventDefault(),onClick:()=>k(_),className:He("flex h-7 cursor-default items-center gap-2 rounded-[8px] px-2 text-[13px]",T===d&&"bg-chrome-hover"),children:[y.jsx("span",{className:"flex size-4 shrink-0 items-center justify-center",children:_.key===g?y.jsx(Va,{className:"size-4 text-chrome-accent",strokeWidth:2.25}):null}),_.label]},_.key??"auto")),b.length===0?y.jsx("div",{className:"px-2 py-1.5 text-[13px] text-chrome-muted",children:"No languages match"}):null]})]})}const mye=1200;function gye(t,e,n){const o=e();if(o===void 0)return;const s=t.state.doc.nodeAt(o);!s||s.type.name!=="codeBlock"||((s.attrs.language??null)!==n&&t.dispatch(t.state.tr.setNodeAttribute(o,"language",n)),sn(`Language set to ${n?mp(n)?.label??n:"auto"}`))}function yye({view:t,getPos:e,language:n,detected:o,live:s,sourceShown:i,sourceLocked:r,onToggleSource:l,text:u}){const[d,h]=S.useState(!1),p=S.useRef(0);S.useEffect(()=>()=>window.clearTimeout(p.current),[]);const g=t.editable,b=async()=>{try{await navigator.clipboard.writeText(u()),sn("Code copied"),h(!0),window.clearTimeout(p.current),p.current=window.setTimeout(()=>h(!1),mye)}catch{const w=s&&!i?"Couldn’t copy — open Source, then select the text and press ⌘C (Ctrl+C)":"Couldn’t copy — select the code and press ⌘C (Ctrl+C)";qe.add({title:w,type:"error"})}};return y.jsxs(y.Fragment,{children:[y.jsx(pye,{shown:fye(n,o),language:n,disabled:!g,onPick:w=>gye(t,e,w),onClose:()=>{g&&requestAnimationFrame(()=>!t.isDestroyed&&t.focus())}}),y.jsx("span",{className:"flex-1"}),s?y.jsx(it,{className:"h-6 px-1.5 text-[12px] text-chrome-muted","aria-pressed":i,disabled:r,onClick:l,children:i?"Hide source":"Show source"}):null,y.jsx(wn,{label:d?"Code copied":"Copy code",side:"top",children:y.jsx(it,{square:!0,"aria-label":"Copy code",className:"size-6 text-chrome-muted",onClick:()=>{b()},children:d?y.jsx(Va,{className:"size-3.5",strokeWidth:2.25}):y.jsx(Sb,{className:"size-3.5",strokeWidth:1.75})})})]})}const bye={bash:()=>mo(()=>import("./bash-I8pq0VWm.js"),[],import.meta.url),css:()=>mo(()=>import("./css-DazXZka4.js"),[],import.meta.url),javascript:()=>mo(()=>import("./javascript-BKRaQes9.js"),[],import.meta.url),json:()=>mo(()=>import("./json-DIYVocXf.js"),[],import.meta.url),latex:()=>mo(()=>import("./latex-lHs7bxnR.js"),[],import.meta.url),markdown:()=>mo(()=>import("./markdown-BrP960CR.js"),[],import.meta.url),python:()=>mo(()=>import("./python-sE43i1Pi.js"),[],import.meta.url),sql:()=>mo(()=>import("./sql-BC88IN-V.js"),[],import.meta.url),typescript:()=>mo(()=>import("./typescript-C2FFdlUC.js"),[],import.meta.url),xml:()=>mo(()=>import("./xml-BXBhIUeX.js"),[],import.meta.url),yaml:()=>mo(()=>import("./yaml-drsDnIKT.js"),[],import.meta.url)};let wu=null,vD=null;const $y=new Set,kD=new Map;function wye(){return vD??=mo(()=>import("./core-CMnn1N7u.js"),[],import.meta.url).then(t=>(wu=t.default,wu)),vD}function u6(t){return wu?t==="auto"?gT.every(e=>$y.has(e)):$y.has(t):!1}function d6(t){if(t==="auto")return Promise.all(gT.map(d6)).then(o=>o.every(Boolean));const e=bye[t];if(!e)return Promise.resolve(!1);if($y.has(t))return Promise.resolve(!0);let n=kD.get(t);return n||(n=Promise.all([wye(),e()]).then(([o,s])=>(o.registerLanguage(t,s.default),$y.add(t),!0)).catch(()=>!1),kD.set(t,n)),n}function xye(t,e){if(!wu||!u6(e))return null;if(!t)return{ranges:[],detected:null};if(e==="auto"){const n=wu.highlightAuto(t,[...gT]),o=n.language&&(n.relevance??0)>2?n.language:null;return{ranges:o?jD(n.value):[],detected:o}}return{ranges:jD(wu.highlight(t,{language:e,ignoreIllegals:!0}).value),detected:null}}const SD={amp:"&",lt:"<",gt:">",quot:'"',apos:"'","#x27":"'","#39":"'"},vye=t=>t in SD?SD[t]:t.startsWith("#x")?String.fromCodePoint(parseInt(t.slice(2),16)):t.startsWith("#")?String.fromCodePoint(parseInt(t.slice(1),10)):`&${t};`;function jD(t,e=!1){const n=[],o=[];let s=0;const i=u=>{if(!u)return;const d=o.filter(Boolean).join(" "),h=n.at(-1);h&&h.to===s&&h.classes===d?h.to+=u:n.push({from:s,to:s+u,classes:d}),s+=u},r=/<(\/?)span([^>]*)>|&(#?[a-z0-9]+);/gi;let l=0;for(let u=r.exec(t);u;u=r.exec(t))i(u.index-l),l=u.index+u[0].length,u[3]!==void 0?i(vye(u[3]).length):u[1]?o.pop():o.push(/class="([^"]*)"/.exec(u[2]??"")?.[1]??"");return i(t.length-l),e?n:n.filter(u=>u.classes)}const kye=1e5,mg=new so("codeHighlight"),CD=new WeakMap;function f6(t){const e=c6(t.attrs.language);if(e===null||t.textContent.length>kye)return null;const n=CD.get(t);if(n)return n;const o=xye(t.textContent,e);return o&&CD.set(t,o),o}function TD(t,e){const n=[];return t.descendants((o,s)=>{if(o.type.name!=="codeBlock")return!o.isTextblock;const i=c6(o.attrs.language);if(i===null)return!1;if(!u6(i))return e.add(i),!1;const r=f6(o);for(const l of r?.ranges??[])n.push(tt.inline(s+1+l.from,s+1+l.to,{class:l.classes}));return!1}),Ge.create(t,n)}function Sye(){let t=null;const e=new Set,n=o=>{for(const s of o)e.has(s)||(e.add(s),d6(s).then(i=>{i&&t&&!t.isDestroyed&&t.dispatch(t.state.tr.setMeta(mg,s))}))};return new It({key:mg,state:{init:(o,s)=>{const i=new Set,r=TD(s.doc,i);return queueMicrotask(()=>n(i)),r},apply:(o,s)=>{if(!o.docChanged&&o.getMeta(mg)===void 0)return s;const i=new Set,r=TD(o.doc,i);return i.size&&queueMicrotask(()=>n(i)),r}},view:o=>(t=o,{destroy:()=>{t=null}}),props:{decorations:o=>mg.getState(o)}})}function jye(){return new It({props:{decorations(t){const{$from:e,$to:n}=t.selection;if(e.depth===0||e.parent.type.name!=="codeBlock"||!e.sameParent(n))return null;const o=e.before();return Ge.create(t.doc,[tt.node(o,o+e.parent.nodeSize,{},{codeActive:!0})])}}})}function yT(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Cye(t){const e=[];let n=[],o="",s=!1,i=!1;for(let r=0;r<t.length;r++){const l=t[r];if(s){l==='"'&&t[r+1]==='"'?(o+='"',r++):l==='"'?s=!1:o+=l;continue}l==='"'&&o===""?(s=!0,i=!0):l===","?(n.push(o),o="",i=!0):l===`
|
|
77
77
|
`||l==="\r"?(l==="\r"&&t[r+1]===`
|
|
78
78
|
`&&r++,n.push(o),e.push(n),n=[],o="",i=!1):(o+=l,i=!0)}return(i||o||n.length)&&(n.push(o),e.push(n)),e}function Tye(t){const e=Cye(t).filter(l=>l.some(u=>u.trim()!=="")||l.length>1);if(!e.length)return"";const n=Math.max(...e.map(l=>l.length)),o=(l,u)=>Array.from({length:n},(d,h)=>`<${u}>${yT(l[h]??"")}</${u}>`).join(""),[s,...i]=e,r=i.length?`<tbody>${i.map(l=>`<tr>${o(l,"td")}</tr>`).join("")}</tbody>`:"";return`<table><thead><tr>${o(s,"th")}</tr></thead>${r}</table>`}const Eye=/^(https?:\/\/|mailto:)/i;function Dh(t){const e=[];let n=yT(t).replace(/`([^`]+)`/g,(o,s)=>(e.push(s),`\0${e.length-1}\0`));return n=n.replace(/\[([^\]]+)\]\(([^)\s]+)\)/g,(o,s,i)=>Eye.test(i)?`<a href="${i}" target="_blank" rel="noopener noreferrer">${s}</a>`:o),n=n.replace(/\*\*(?=\S)(.+?)\*\*|__(?=\S)(.+?)__/g,(o,s,i)=>`<strong>${s??i}</strong>`),n=n.replace(/(^|[^*\w])\*(?=\S)([^*]+?)\*(?!\*)/g,"$1<em>$2</em>").replace(/(^|[^_\w])_(?=\S)([^_]+?)_(?![_\w])/g,"$1<em>$2</em>"),n=n.replace(/~~(?=\S)(.+?)~~/g,"<del>$1</del>"),n.replace(/\u0000(\d+)\u0000/g,(o,s)=>`<code>${e[Number(s)]}</code>`)}const _ye=/^(#{1,6})\s+(.*?)\s*#*\s*$/,Mye=/^\s*([-*_])(?:\s*\1){2,}\s*$/,ik=/^\s*>\s?(.*)$/,rk=/^(\s*)([-*+]|\d+[.)])\s+(.*)$/,ED=/^\s*(```|~~~)/,Oye=/^\s*\|?\s*:?-+:?\s*(\|\s*:?-+:?\s*)*\|?\s*$/,ak=t=>t.trim().replace(/^\|/,"").replace(/\|$/,"").split(/(?<!\\)\|/).map(n=>n.trim().replace(/\\\|/g,"|"));function Aye(t){const e=ak(t[0]),n=ak(t[1]).map(i=>i.startsWith(":")&&i.endsWith(":")?"center":i.endsWith(":")?"right":i.startsWith(":")?"left":null),o=(i,r,l)=>{const u=n[l];return`<${i}${u?` style="text-align:${u}"`:""}>${Dh(r)}</${i}>`},s=t.slice(2).map(i=>`<tr>${e.map((r,l)=>o("td",ak(i)[l]??"",l)).join("")}</tr>`);return`<table><thead><tr>${e.map((i,r)=>o("th",i,r)).join("")}</tr></thead>${s.length?`<tbody>${s.join("")}</tbody>`:""}</table>`}function Rye(t){let e="";const n=[];for(const o of t){const s=o.ordered?"ol":"ul";for(;n.length&&o.indent<n.at(-1).indent;)e+=`</li></${n.pop().tag}>`;const i=n.at(-1);!i||o.indent>i.indent?(e+=`<${s}>`,n.push({indent:o.indent,tag:s})):(e+="</li>",i.tag!==s&&(e+=`</${i.tag}><${s}>`,i.tag=s));const r=/^\[([ xX])\]\s+(.*)$/.exec(o.text);e+=r?`<li class="task"><input type="checkbox" disabled${r[1]===" "?"":" checked"}> ${Dh(r[2])}`:`<li>${Dh(o.text)}`}for(;n.length;)e+=`</li></${n.pop().tag}>`;return e}function h6(t){const e=t.replace(/\r\n?/g,`
|
|
79
79
|
`).split(`
|
|
80
80
|
`),n=[];let o=[];const s=()=>{o.length&&n.push(`<p>${o.map(Dh).join("<br>")}</p>`),o=[]};for(let i=0;i<e.length;i++){const r=e[i];if(!r.trim()){s();continue}if(ED.test(r)){s();const u=ED.exec(r)[1],d=[];for(i++;i<e.length&&!e[i].trim().startsWith(u);i++)d.push(e[i]);n.push(`<pre><code>${yT(d.join(`
|
|
81
81
|
`))}</code></pre>`);continue}const l=_ye.exec(r);if(l){s(),n.push(`<h${l[1].length}>${Dh(l[2])}</h${l[1].length}>`);continue}if(Mye.test(r)){s(),n.push("<hr>");continue}if(ik.test(r)){s();const u=[];for(;i<e.length&&ik.test(e[i]);i++)u.push(ik.exec(e[i])[1]);i--,n.push(`<blockquote>${h6(u.join(`
|
|
82
|
-
`))}</blockquote>`);continue}if(rk.test(r)){s();const u=[];for(;i<e.length&&rk.test(e[i]);i++){const d=rk.exec(e[i]);u.push({indent:d[1].replace(/\t/g," ").length,ordered:/\d/.test(d[2]),text:d[3]})}i--,n.push(Rye(u));continue}if(r.includes("|")&&i+1<e.length&&Oye.test(e[i+1])&&e[i+1].includes("-")){s();const u=[r,e[i+1]];for(i+=2;i<e.length&&e[i].includes("|")&&e[i].trim();i++)u.push(e[i]);i--,n.push(Aye(u));continue}o.push(r.trim())}return s(),n.join("")}const _D={csv:"Empty table",latex:"Empty formula",markdown:"Empty markdown",mermaid:"Empty diagram"},Nye={latex:"Loading formula renderer…",mermaid:"Rendering diagram…"};function Dye(t,e){return{ok:!0,html:t==="csv"?Tye(e):h6(e)}}async function Pye(t){const[{default:e}]=await Promise.all([mo(()=>import("./katex-CW6j7-4E.js"),[],import.meta.url),mo(()=>Promise.resolve({}),__vite__mapDeps([0]),import.meta.url)]);try{return{ok:!0,html:e.renderToString(t,{displayMode:!0,throwOnError:!0})}}catch(n){return n instanceof e.ParseError?{ok:!1,message:n.rawMessage}:{ok:!1,message:n instanceof Error?n.message:String(n)}}}let MD=null,OD=null,AD=Promise.resolve(),Bye=0;const zye=()=>{const e=document.documentElement.getAttribute("data-theme");return e?e==="dark":matchMedia("(prefers-color-scheme: dark)").matches};async function Iye(t){MD??=mo(()=>import("./mermaid.core-
|
|
82
|
+
`))}</blockquote>`);continue}if(rk.test(r)){s();const u=[];for(;i<e.length&&rk.test(e[i]);i++){const d=rk.exec(e[i]);u.push({indent:d[1].replace(/\t/g," ").length,ordered:/\d/.test(d[2]),text:d[3]})}i--,n.push(Rye(u));continue}if(r.includes("|")&&i+1<e.length&&Oye.test(e[i+1])&&e[i+1].includes("-")){s();const u=[r,e[i+1]];for(i+=2;i<e.length&&e[i].includes("|")&&e[i].trim();i++)u.push(e[i]);i--,n.push(Aye(u));continue}o.push(r.trim())}return s(),n.join("")}const _D={csv:"Empty table",latex:"Empty formula",markdown:"Empty markdown",mermaid:"Empty diagram"},Nye={latex:"Loading formula renderer…",mermaid:"Rendering diagram…"};function Dye(t,e){return{ok:!0,html:t==="csv"?Tye(e):h6(e)}}async function Pye(t){const[{default:e}]=await Promise.all([mo(()=>import("./katex-CW6j7-4E.js"),[],import.meta.url),mo(()=>Promise.resolve({}),__vite__mapDeps([0]),import.meta.url)]);try{return{ok:!0,html:e.renderToString(t,{displayMode:!0,throwOnError:!0})}}catch(n){return n instanceof e.ParseError?{ok:!1,message:n.rawMessage}:{ok:!1,message:n instanceof Error?n.message:String(n)}}}let MD=null,OD=null,AD=Promise.resolve(),Bye=0;const zye=()=>{const e=document.documentElement.getAttribute("data-theme");return e?e==="dark":matchMedia("(prefers-color-scheme: dark)").matches};async function Iye(t){MD??=mo(()=>import("./mermaid.core-T4owCd57.js").then(s=>s.bb),[],import.meta.url).then(s=>s.default);const e=await MD,n=zye()?"dark":"default";n!==OD&&(e.initialize({startOnLoad:!1,securityLevel:"strict",theme:n}),OD=n);const o=`code-diagram-${++Bye}`;try{const{svg:s}=await e.render(o,t);return{ok:!0,html:s}}catch(s){return document.getElementById(o)?.remove(),document.getElementById(`d${o}`)?.remove(),{ok:!1,message:s instanceof Error?s.message:String(s)}}}function Lye(t,e){if(t==="latex")return Pye(e).catch(o=>({ok:!1,message:String(o)}));const n=AD.then(()=>Iye(e)).catch(o=>({ok:!1,message:String(o)}));return AD=n,n}const bT=qt(()=>({sourceOpen:{}})),lk=t=>bT.getState().sourceOpen[t]===!0;function $ye(t,e){bT.setState(n=>({sourceOpen:{...n.sourceOpen,[t]:e}}))}const Fye=250;let Hye=0;const RD=t=>t.some(e=>e.spec.codeActive===!0);class qye{dom;contentDOM;node;view;getPos;bar;pane;output;status;root;localKey=`unsaved-${++Hye}`;unsubscribe;active;renderedKey=null;hasRender=!1;version=0;timer=0;destroyed=!1;constructor(e,n,o,s){this.node=e,this.view=n,this.getPos=o,this.active=RD(s),this.dom=document.createElement("div"),this.dom.className="code-block",this.bar=document.createElement("div"),this.bar.className="code-block-bar",this.bar.contentEditable="false",this.bar.setAttribute("role","toolbar"),this.bar.setAttribute("aria-label","Code block actions"),this.pane=document.createElement("div"),this.pane.className="code-block-render",this.pane.contentEditable="false",this.output=document.createElement("div"),this.output.className="code-block-output",this.status=document.createElement("div"),this.status.className="code-block-status",this.status.setAttribute("role","status"),this.pane.append(this.output,this.status);const i=document.createElement("pre");this.contentDOM=document.createElement("code"),i.append(this.contentDOM),this.dom.append(this.bar,this.pane,i),this.pane.addEventListener("mousedown",this.editFromRender),this.root=tP.createRoot(this.bar);let r=lk(this.key);this.unsubscribe=bT.subscribe(l=>{const u=l.sourceOpen[this.key]===!0;u!==r&&(r=u,this.draw())}),this.draw()}get key(){return this.node.attrs.bid??this.localKey}get kind(){return uye(this.node.attrs.language)}get empty(){return this.node.textContent.trim()===""}get editing(){return this.active&&this.view.editable}get sourceShown(){return!this.kind||this.empty||this.editing||lk(this.key)}draw(){const{node:e,dom:n}=this,o=(i,r)=>r?n.setAttribute(i,r):n.removeAttribute(i);o("data-bid",e.attrs.bid),o("data-suggest-id",e.attrs.suggestId),o("data-suggest-op",e.attrs.suggestId?e.attrs.suggestOp??"ins":null),o("data-language",e.attrs.language);const s=this.kind;o("data-live",s),n.toggleAttribute("data-source-hidden",!this.sourceShown),this.pane.hidden=s===null,s?this.drawLive(s):this.renderedKey=null,this.root.render(S.createElement(yye,{view:this.view,getPos:this.getPos,language:e.attrs.language??null,detected:f6(e)?.detected??null,live:s,sourceShown:this.sourceShown,sourceLocked:this.empty||this.editing,onToggleSource:()=>$ye(this.key,!lk(this.key)),text:()=>this.node.textContent}))}drawLive(e){const n=this.node.textContent,o=`${e}\0${n}`;if(o===this.renderedKey)return;this.renderedKey=o;const s=++this.version;if(window.clearTimeout(this.timer),!n.trim()){this.hasRender=!1,this.showNote(_D[e],"empty");return}if(e==="csv"||e==="markdown"){this.show(Dye(e,n),e);return}this.hasRender||this.showNote(Nye[e]??"","loading"),this.timer=window.setTimeout(()=>{Lye(e,n).then(i=>{!this.destroyed&&s===this.version&&this.show(i,e)})},this.hasRender?Fye:0)}showNote(e,n){this.output.replaceChildren(),this.output.removeAttribute("data-stale"),this.status.textContent=e,this.status.dataset.state=n,this.status.hidden=!1}show(e,n){if(e.ok&&e.html){this.output.innerHTML=e.html,this.output.removeAttribute("data-stale"),this.status.hidden=!0,this.status.textContent="",delete this.status.dataset.state,this.hasRender=!0;return}if(e.ok){this.hasRender=!1,this.showNote(_D[n],"empty");return}this.hasRender?this.output.setAttribute("data-stale",""):this.output.replaceChildren(),this.status.textContent=e.message,this.status.dataset.state="error",this.status.hidden=!1}editFromRender=e=>{if(!this.view.editable||e.button!==0||e.target instanceof Element&&e.target.closest("a"))return;const n=this.getPos();n!==void 0&&(e.preventDefault(),this.view.dispatch(this.view.state.tr.setSelection(Le.create(this.view.state.doc,n+1)).scrollIntoView()),this.view.focus())};update(e,n){return e.type!==this.node.type?!1:(this.node=e,this.active=RD(n),this.draw(),!0)}stopEvent(e){const n=e.target;return n instanceof Node&&(this.bar.contains(n)||this.pane.contains(n))}ignoreMutation(e){return!this.contentDOM.contains(e.target)}destroy(){this.destroyed=!0,window.clearTimeout(this.timer),this.unsubscribe(),this.pane.removeEventListener("mousedown",this.editFromRender);const e=this.root;queueMicrotask(()=>e.unmount())}}ko({plugins:()=>[Sye(),jye()],nodeViews:{codeBlock:(t,e,n,o)=>new qye(t,e,n,o)}});const Lg=t=>`folded:${t}`;function Uye(t,e){if(!Xb(t).size)return[];const n=new Map;for(const o of e){const s=Ub(t.doc,o);if(!s.length)continue;const i=s.map(u=>P5(t,u.from)),r=i[0];if(!r||i.some(u=>!u))continue;const l=n.get(r);l?l.ids.push(o):n.set(r,{heading:r,ids:[o]})}return[...n.values()]}function Vye(t,e){return t.length===e.length&&t.every((n,o)=>n.heading===e[o].heading&&n.ids.join(" ")===e[o].ids.join(" "))}function p6(t,e){for(const n of t.querySelectorAll(`[data-suggest-id="${e}"]`))if(n.getClientRects().length)return n;return null}function m6(t,e){let n=!1;for(const o of Ub(t.state.doc,e))B5(t,o.from)&&(n=!0);return n}const g6="(unrecognised change)";function Kye(t){return t.map(e=>e.quote?`“${e.text}”`:e.text).join(" ").replace(/ ,/g,",")}const ND=80,Wye="¶",Yye="↵",y6=`
|
|
83
83
|
`,b6="\u2028";function xu(t){const e=t.replace(/\uFFFC/g," ").replace(/\r\n?|\n/g,` ${Wye} `).replace(/[\u2028\u2029]/g,` ${Yye} `).replace(/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g,"").replace(/\s+/g," ").trim();if(!e.replace(/[¶↵\s]/g,""))return"";const n=[...e];return n.length>ND?n.slice(0,ND-1).join("").trimEnd()+"…":e}const Gye={paragraph:"paragraphs",heading:"headings","code block":"code blocks",list:"lists","list item":"list items",quote:"quotes",table:"tables",row:"rows",cell:"cells",divider:"dividers",embed:"embeds",block:"blocks"};function w6(t){const e=t.attrs?.heading;return typeof e=="number"&&e>0?e:void 0}function Xye(t){switch(t.type){case"paragraph":return w6(t)?"heading":"paragraph";case"codeBlock":return"code block";case"list":return"list";case"listItem":return"list item";case"blockquote":return"quote";case"table":return"table";case"tableRow":return"row";case"cell":return"cell";case"horizontalRule":return"divider";case"embed":return"embed";default:return"block"}}const x6=t=>Pn(t)?t.atom==="hardBreak"?b6:"":t.ch;function v6(t){return t.inline?t.inline.map(x6).join(""):(t.children??[]).map(v6).filter(Boolean).join(y6)}function Jye(t,e){const n={blocks:[],runs:[]},o=s=>{for(const i of s){if(i.suggest?.id===e){const l=i.inline??[],u=typeof i.attrs?.kind=="string"?i.attrs.kind:void 0,d=w6(i);n.blocks.push({op:i.suggest.op,name:Xye(i),text:v6(i),isBreak:i.suggest.op==="ins"&&l.length>0&&l.every(h=>h.suggest?.id!==e),...d?{heading:d}:{},...u?{listKind:u}:{}});continue}let r=null;for(const l of i.inline??[]){const u=l.suggest?.id===e?l.suggest.op:null;if(!u){r=null;continue}(!r||r.op!==u)&&(r={op:u,block:i.id,text:"",chars:0,atoms:[]},l.marks&&(r.marks=l.marks),n.runs.push(r)),r.text+=x6(l),Pn(l)?l.atom!=="hardBreak"&&r.atoms.push(l.atom):r.chars++}i.children&&o(i.children)}};return o(t.blocks),n}const Qye={bold:"Bold",italic:"Italic",strike:"Strikethrough",code:"Code",underline:"Underline",highlight:"Highlight",textColor:"Text color"};function DD(t,e){return t==="textColor"&&e.textColor?`Text color (${e.textColor})`:Qye[t]}const PD={mention:["mention","mentions"],date:["date","dates"],dropdown:["dropdown","dropdowns"],media:["image","images"]};function Zye(t){const e=new Map;for(const o of t)PD[o]&&e.set(o,(e.get(o)??0)+1);const n=[...e].map(([o,s])=>{const[i,r]=PD[o];return s>1?`${s} ${r}`:`${/^[aeiou]/.test(i)?"an":"a"} ${i}`});return n.length?n.length===1?n[0]:`${n.slice(0,-1).join(", ")} and ${n.at(-1)}`:null}function ck(t){try{return new URL(t).host||t}catch{return t}}const xa=t=>[{text:t}],tr=(t,e)=>{const n=xu(e);return n?[{text:t},{text:n,quote:!0}]:[{text:t}]};function BD(t){let e="";return t.forEach((n,o)=>{o>0&&(e+=t[o-1].block===n.block?" ":y6),e+=n.text}),e}function ebe(t,e,n){const o=t??{},s=e??{},i=[],r=[];for(const d of Qh)d!=="link"&&o[d]!==s[d]&&(s[d]!==void 0&&i.push(DD(d,s)),o[d]!==void 0&&(s[d]===void 0||d!=="textColor")&&r.push(DD(d,o)));const l=o.link!==s.link;if(l&&!i.length&&!r.length)return o.link?s.link?tr(`Change link: ${ck(o.link)} → ${ck(s.link)}`,n):tr("Remove link",n):tr(`Add link (${ck(s.link)})`,n);if(!i.length&&!r.length)return null;const u=l?[s.link?"+Link":"−Link"]:[];return!r.length&&!u.length?tr(`Format: ${i.join(", ")}`,n):!i.length&&!u.length?tr(`Remove format: ${r.join(", ")}`,n):tr(`Format: ${[...i.map(d=>`+${d}`),...r.map(d=>`−${d}`),...u].join(", ")}`,n)}function zD(t){const e=t.filter(h=>h.op==="ins"),n=t.filter(h=>h.op==="del"),o=BD(e),s=BD(n);if(e.length&&n.length){if(o===s&&e.length===1&&n.length===1){const g=ebe(n[0].marks,e[0].marks,o);if(g)return g}const h=xu(s),p=xu(o);return!h&&!p?xa("Replace text"):p?h?[{text:"Replace"},{text:h,quote:!0},{text:"with"},{text:p,quote:!0}]:[{text:"Replace with"},{text:p,quote:!0}]:[{text:"Replace"},{text:h,quote:!0},{text:"with new text"}]}const i=e.length?"Add":"Delete",r=e.length?e:n,l=e.length?o:s;if(!r.reduce((h,p)=>h+p.chars,0)){const h=Zye(r.flatMap(g=>g.atoms));if(h)return xa(`${i} ${h}`);const p=[...l].filter(g=>g===b6).length;if(p)return xa(p>1?`${i} ${p} line breaks`:`${i} line break`)}const d=xu(l);return d?[{text:i},{text:d,quote:!0}]:xa(`${i} text`)}const tbe=(t,e)=>e>1?`${e} ${Gye[t]}`:t,nbe=t=>new Set(t.map(n=>n.name)).size===1?t[0].name:null,ID={bullet:"bulleted list",ordered:"numbered list",check:"checklist"};function obe(t,e){return t.text!==e.text?null:e.name==="heading"&&(t.name==="paragraph"||t.name==="heading"&&t.heading!==e.heading)?`Format: Heading ${e.heading}`:t.name==="heading"&&e.name==="paragraph"?"Format: Normal text":e.name==="list"&&t.name==="list"&&e.listKind!==t.listKind?`Format: Make ${ID[e.listKind??"bullet"]??"list"}`:e.name==="list"&&t.name!=="list"?`Format: Make ${ID[e.listKind??"bullet"]??"list"}`:t.name==="list"&&e.name!=="list"?"Format: Remove list":e.name==="quote"&&t.name!=="quote"?"Format: Make quote":t.name==="quote"&&e.name!=="quote"?"Format: Remove quote":null}function gg(t,e){const n=nbe(e);return n?`${t} ${tbe(n,e.length)}`:`${t} ${e.length} blocks`}function LD(t){const e=t.filter(r=>r.isBreak),n=t.filter(r=>r.op==="ins"&&!r.isBreak),o=t.filter(r=>r.op==="del"),s=e.length>1?`Add ${e.length} paragraph breaks`:e.length?"Add paragraph break":"",i=s&&(n.length||o.length)?[{text:`, ${s}`}]:[];if(!n.length&&!o.length)return xa(s||g6);if(n.length&&!o.length){const r=gg("Add",n);return[...n.length===1?tr(r,n[0].text):xa(r),...i]}if(o.length&&!n.length){const r=gg("Delete",o);return[...o.length===1?tr(r,o[0].text):xa(r),...i]}if(n.length===1&&o.length===1){const r=o[0],l=n[0],u=obe(r,l);if(u)return[...tr(u,l.text),...i];if(r.name===l.name){const d=xu(r.text),h=xu(l.text);return d&&h?[{text:"Replace"},{text:d,quote:!0},{text:"with"},{text:h,quote:!0},...i]:[{text:`Replace ${r.name}`},...i]}return[{text:`Replace ${r.name} with ${l.name}`},...i]}return[{text:`${gg("Add",n)}, ${gg("Delete",o)}`},...i]}function sbe(t){const{blocks:e,runs:n}=t;if(!e.length&&!n.length)return xa(g6);if(!e.length)return zD(n);if(!n.length)return LD(e);const[o,...s]=zD(n);return[...LD(e),{text:`, ${o.text}`},...s]}function ibe(t,e){return sbe(Jye(t,e))}function rbe(t,e){return Po(t.blocks).map(n=>{const o=t.suggestions?.[n],s=o?.by||(e&&d$(n)?e:"");return{id:n,by:s,at:o?.at??"",agent:o?.via==="agent",mine:!!e&&s===e,asOf:qj(t.blocks,n),sentence:ibe(t,n)}})}const Io=qt(()=>({tab:null,shadow:null,cards:[]}));function gp(){if(ke().phase.kind!=="ready")return;const t=me.getState().tab,e=t?pt().openTabOf(t)?.sync.shadow??null:null,n=Io.getState();n.tab===t&&n.shadow===e||Io.setState({tab:t,shadow:e,cards:e?rbe(e,ke().me?.id??null):[]})}const wo=qt(()=>({hoveredText:null,hoveredCard:null,last:null,busy:!1,notice:null,margin:!0})),bo=wo.setState,Ds=wo.getState;function Cs(t,e=!1){bo(n=>({notice:{text:t,undo:e,serial:(n.notice?.serial??0)+1}}))}const va=new so("docSuggest"),abe="↵",lbe="¶";function $D(t,e){const n=document.createElement("span");return n.className=`doc-suggest-sign doc-suggest-sign-${e}`,n.setAttribute("aria-hidden","true"),n.textContent=t,n}const cbe=t=>{for(const e of t.marks){if(e.type===Ye.marks.suggestIns)return"ins";if(e.type===Ye.marks.suggestDel)return"del"}return null};function k6(t){const e=[];return t.descendants((n,o)=>{if(n.type===Ye.nodes.hardBreak){const s=cbe(n);return s&&e.push(tt.widget(o,()=>$D(abe,s),{side:-1,ignoreSelection:!0,key:`line-${s}`})),!1}if(n.isTextblock&&n.content.size===0&&typeof n.attrs.suggestId=="string"&&n.attrs.suggestId){const s=n.attrs.suggestOp==="del"?"del":"ins";return e.push(tt.widget(o+1,()=>$D(lbe,s),{side:1,ignoreSelection:!0,key:`block-${s}`})),!1}return!0}),Ge.create(t,e)}function ube(t,e){const n=[];if(e.highlight)for(const o of Ub(t,e.highlight))n.push(o.block?tt.node(o.from,o.to,{class:"doc-suggest-focused"}):tt.inline(o.from,o.to,{class:"doc-suggest-focused"}));return Ge.create(t,n)}function dbe(t,e,n,o){const s=Zh(t),i=t.getMeta(va);let r=e;return t.docChanged&&(r={...e,signs:k6(o.doc),editSerial:s?e.editSerial:e.editSerial+1}),t.selectionSet&&!s&&(r={...r,selectSerial:r.selectSerial+1}),i&&"highlight"in i&&i.highlight!==r.highlight&&(r={...r,...i}),r!==e&&(t.docChanged||i)&&(r={...r,marks:ube(o.doc,r)}),r}const S6=t=>va.getState(t)?.editSerial??0;function fbe(t,e){const n=va.getState(t.state);n&&"highlight"in e&&e.highlight!==n.highlight&&t.dispatch(t.state.tr.setMeta(va,e).setMeta("addToHistory",!1))}function hbe(t,e){if(!(e instanceof Element))return null;const n=e.closest("[data-suggest-id]");return!n||!t.dom.contains(n)?null:n.getAttribute("data-suggest-id")}const pbe=250;let FD=0;function HD(t){if(window.clearTimeout(FD),t){Ds().hoveredText!==t&&bo({hoveredText:t});return}Ds().hoveredText!==null&&(FD=window.setTimeout(()=>bo({hoveredText:null}),pbe))}function mbe(t){const e=new It({key:va,state:{init:(n,o)=>({highlight:null,editSerial:0,selectSerial:0,signs:k6(o.doc),marks:Ge.empty}),apply:dbe},props:{decorations(n){const o=va.getState(n);return o?o.marks===Ge.empty?o.signs:o.signs.add(n.doc,o.marks.find()):null},handleDOMEvents:{mouseover(n,o){return HD(hbe(n,o.target)),!1},mouseleave(){return HD(null),!1}}},view(){return{update(n,o){const s=va.getState(n.state),i=va.getState(o);if(n.state.doc!==o.doc&&gp(),s&&i&&s.selectSerial!==i.selectSerial){const r=hse(n.state);r!==ke().focusedSuggestion&&(r||n.hasFocus())&<({focusedSuggestion:r})}}}}});return[Nf({"Mod-z":n=>t.undoDecision(n)}),e]}const iS={accept:"accepted",reject:"rejected",withdraw:"withdrawn"},gbe={accept:"Accepting…",reject:"Rejecting…",withdraw:"Withdrawing…"},qD=t=>typeof t=="object"&&t!==null&&!Array.isArray(t);function UD(t,e){return e===1?`Suggestion ${iS[t]}`:`${e} suggestions ${iS[t]}`}function ybe(t){const e=Io.getState().cards.map(s=>s.id),n=new Set(t),o=e.findIndex(s=>n.has(s));return o<0?null:e.slice(o).find(s=>!n.has(s))??e.slice(0,o).reverse().find(s=>!n.has(s))??null}async function wT(t,e,n){if(!ke().writable||Ds().busy||!e.length)return;const o=e.length>1;o&&(bo({busy:!0}),Cs(gbe[n]));try{const s=await pt().tab(t),i=s.sync.shadow,r=e.filter(k=>ch(i.blocks,k).length>0);if(!r.length){Cs(`Nothing to ${n}. ${e.length===1?"This had":"These had"} already been decided.`);return}const l=ke().focusedSuggestion,u=Ut(),d=u&&me.getState().tab===t?S6(u.state):-1,h=l&&r.includes(l)?ybe(r):l;s.sync.write(r.map(k=>({op:"decide",suggestId:k,verdict:n,asOf:qj(i.blocks,k)}))),bo({last:{tab:t,ids:r,verdict:n,editSerial:d},hoveredCard:null,hoveredText:null}),lt({focusedSuggestion:h}),gp();const p=UD(n,r.length);Cs(p,!0),sn(p),await s.sync.settled();const g=new Set(Po(s.sync.shadow.blocks)),b=r.filter(k=>g.has(k)).length;if(!b)return;const w=r.length-b;w?Cs(`${UD(n,w)}. ${b} need a look`,!0):(Ds().last?.ids===r&&bo({last:null}),Cs(b===1?"This suggestion changed. Have another look.":`${b} need a look`))}catch(s){Cs(s instanceof Error?`Couldn’t ${n}: ${s.message}`:`Couldn’t ${n}`)}finally{o&&bo({busy:!1})}}function Fy(t){const{tab:e,cards:n}=Io.getState();return e?wT(e,n.map(o=>o.id),t):Promise.resolve()}function bbe(t,e){const n=[],o=s=>{!qD(s)||typeof s.suggestId!="string"||!e.has(s.suggestId)||n.some(i=>i.suggestId===s.suggestId)||n.push({suggestId:s.suggestId,outcome:String(s.outcome??""),...typeof s.why=="string"?{why:s.why}:{}})};if(Array.isArray(t.results))for(const s of t.results)qD(s)&&o(s.undecided);return o(t.undecided),n}async function xT(){const t=Ds().last;if(!t||Ds().busy||!ke().writable)return;bo({busy:!0,last:null}),Cs("Undoing…");const e=new Set(t.ids),n=[],o=pt().onAnswer((s,i)=>{s===t.tab&&n.push(...bbe(i,e).filter(r=>!n.some(l=>l.suggestId===r.suggestId)))});try{const s=await pt().tab(t.tab);await s.sync.settled(),s.sync.write([...t.ids].reverse().map(d=>({op:"undecide",suggestId:d}))),await s.sync.settled(),s.sync.reconnected(),await s.sync.settled(),gp();const i=Po(s.sync.shadow.blocks).filter(d=>e.has(d)),r=t.ids.length,l=iS[t.verdict];let u;i.length===r?u=r===1?"Suggestion is back":`${r} suggestions are back`:i.length?u=`${i.length} suggestions are back. ${r-i.length} stay ${l}.`:n.some(d=>d.why==="all_written_since")?u="Undo stopped, to keep your other changes":u=`Couldn’t undo. ${r===1?"It stays":`${r} stay`} ${l}.`,Cs(u),sn(u),i[0]&&me.getState().tab===t.tab&<({focusedSuggestion:i[0]})}catch(s){Cs(s instanceof Error?`Couldn’t undo: ${s.message}`:"Couldn’t undo")}finally{o(),bo({busy:!1})}}function j6(t){const{last:e,busy:n}=Ds();return!e||n||e.tab!==me.getState().tab||e.editSerial!==S6(t)?!1:(xT(),!0)}function Hy(t,e=!1){lt({focusedSuggestion:t});const n=Ut();if(!n)return;const o=fse(n.state.doc,t);if(o===null)return;m6(n,t);const s=Ke.near(n.state.doc.resolve(Math.min(o,n.state.doc.content.size)),1);n.dispatch(n.state.tr.setSelection(s).scrollIntoView().setMeta("addToHistory",!1)),e&&n.focus()}function rS(t,e=!1){const n=Io.getState().cards.map(r=>r.id);if(!n.length)return null;const o=ke().focusedSuggestion,s=o?n.indexOf(o):-1,i=s<0?n[t>0?0:n.length-1]:n[(s+t+n.length)%n.length];return Hy(i,e),i}const wbe=8e3;function xbe(){const t=wo(i=>i.notice),e=wo(i=>i.last!==null&&!i.busy),n=wo(i=>i.busy),[o,s]=S.useState(!1);return S.useEffect(()=>{if(!t||n||o)return;const i=t.serial,r=window.setTimeout(()=>bo(l=>l.notice?.serial===i?{notice:null}:l),wbe);return()=>window.clearTimeout(r)},[t,n,o]),t?y.jsx("div",{className:"pointer-events-none absolute inset-x-0 bottom-6 z-40 flex justify-center px-4","data-suggest-notice":"",children:y.jsxs("div",{className:"pointer-events-auto flex min-h-10 max-w-full items-center gap-3 rounded-[12px] bg-tip py-1.5 pl-4 pr-1.5 text-[13px] leading-5 text-tip-fg shadow-chrome",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),onFocus:()=>s(!0),onBlur:()=>s(!1),children:[y.jsx("span",{className:"min-w-0 truncate",children:t.text}),t.undo&&e?y.jsx(it,{className:"text-tip-fg hover:bg-white/15",title:`Undo (${Si("Mod-z")})`,onClick:()=>{xT()},children:"Undo"}):y.jsx("span",{className:"w-1.5"})]})}):null}const Xt={notYet:"that change can’t be made as a suggestion yet",uploads:"images and files can’t be added as a suggestion",uploadsLeftOut:"images and files can’t be added as a suggestion, so they were left out. Your text was kept",itemBreak:"a list item can’t be split in two as a suggestion yet",flattened:"the line breaks in that paste can’t be kept in a suggestion, so the pasted text stays in this line, joined together",peer:"that’s someone else’s suggestion: to remove it, reject it from its card or ask an editor",changed:"someone else just changed that spot, so your change was not made. Check that line before you go on"},Ws=t=>({kind:"refuse",why:t}),$g=(t,e=t)=>({kind:"chars",range:[t,e]}),vT=(...t)=>({kind:"blocks",ids:t}),C6=t=>t.type===Ye.marks.suggestIns||t.type===Ye.marks.suggestDel;function T6(t,e,n=e){const o=t.doc.resolve(e);return(t.storedMarks??(e===n?o.marks():o.marksAcross(t.doc.resolve(n))??[])).filter(i=>!C6(i)).map(i=>i.toJSON())}const kT=(t,e=[])=>t?[{type:"text",text:t,...e.length?{marks:e}:{}}]:[];function vbe(t){let e=0;for(const n of t)e+=n.type==="text"?Array.from(String(n.text??"")).length:1;return e}function yp(t,e){const n=t.state.doc.resolve(e),o=n.parent,s=o.attrs.bid;if(!o.isTextblock||typeof s!="string"||!s)return null;const i=Dt(t.shadow,s)?.block;return i?.inline?{node:o,start:n.start(),depth:n.depth,block:i,$pos:n}:null}function kbe(t,e){let n=0,o=0;for(let s=0;s<t.childCount&&o<e;s++){const i=t.child(s);if(i.isText){const r=Math.min(i.text.length,e-o);n+=Array.from(i.text.slice(0,r)).length,o+=r}else n+=1,o+=i.nodeSize}return n}const Ku=(t,e)=>kbe(t.node,e-t.start),yr=(t,e)=>e&&t.mine(e.id)?e.id:null,hw=(t,e)=>e.suggest?.op==="ins"?yr(t,e.suggest):null,E6=(t,e)=>e.some(n=>n.suggest&&!t.mine(n.suggest.id)),ST=(t,e)=>!!e.suggest&&!(e.suggest.op==="ins"&&t.mine(e.suggest.id));function Wu(t,e,n,o){const s=yp(t,e);if(!s||!t.state.doc.resolve(n).sameParent(s.$pos))return Ws(Xt.notYet);const i=vbe(o),r=Ku(s,e),l=Ku(s,n);if(l<=r){if(!i)return null}else if(!i)return vu(t,e,n,-1);const{block:u}=s,d=u.inline,h=d.slice(r,l),p=d[r-1]?.suggest,g=l<=r&&!!p&&p.id===d[r]?.suggest?.id&&!t.mine(p.id);if(ST(t,u)||E6(t,h)||g)return Ws(Xt.peer);const b=hw(t,u)??h.map(_=>yr(t,_.suggest)).find(Boolean)??yr(t,d[r-1]?.suggest)??yr(t,d[l]?.suggest)??t.fresh(),w=t.take(i),k={as:"inline",from:{kind:"inline",content:o}},j={ids:{from:w[0],count:i},with:k,suggest:b};let C;return l>r?C={op:"replace",target:$g(d[r].id,d[l-1].id),...j}:r>0?C={op:"insert",target:$g(d[r-1].id),side:"after",...j}:d.length?C={op:"insert",target:$g(d[0].id),side:"before",...j}:C={op:"insert",target:vT(u.id),side:"start",...j},{kind:"write",ops:[C],id:b,caret:{bid:u.id,after:w[i-1]}}}function vu(t,e,n,o){const s=yp(t,e);return!s||!t.state.doc.resolve(n).sameParent(s.$pos)?Ws(Xt.notYet):_6(t,s,Ku(s,e),Ku(s,n),o)}function _6(t,e,n,o,s){if(o<=n)return null;const{block:i}=e,r=i.inline,l=r.slice(n,o),u=n>0?r[n-1].id:null;if(l.every(g=>g.suggest?.op==="del"))return{kind:"move",caret:{bid:i.id,after:s<0?u:l[l.length-1].id}};if(ST(t,i)||E6(t,l))return Ws(Xt.peer);const d=l.map(g=>yr(t,g.suggest)).find(Boolean)??yr(t,r[n-1]?.suggest)??yr(t,r[o]?.suggest)??hw(t,i)??t.fresh(),h=l.filter(g=>g.suggest?.op!=="ins"),p=s<0?u:h[h.length-1]?.id??u;return{kind:"write",ops:[{op:"delete",target:$g(l[0].id,l[l.length-1].id),suggest:d}],id:d,caret:{bid:i.id,after:p}}}function Sbe(t,e,n){const o=yp(t,e);if(!o)return Ws(Xt.notYet);const s=o.block.inline,i=Ku(o,e);let r=n<0?i-1:i;for(;r>=0&&r<s.length&&s[r].suggest?.op==="del";)r+=n;return r<0||r>=s.length?r!==(n<0?i-1:i)?{kind:"move",caret:{bid:o.block.id,after:n<0?null:s[s.length-1]?.id??null}}:jbe(t,o,n):_6(t,o,r,r+1,n)}function jbe(t,e,n){const o=t.state.doc;let s=e;if(n>0){const h=Cbe(o,e.start+e.node.content.size+1);if(h===null)return null;const p=yp(t,h);if(!p)return Ws(Xt.notYet);s=p}else if(e.start<=1&&e.depth===1)return null;const i=hw(t,s.block);if(!i||s.block.inline.length>0)return Ws(Xt.notYet);let r=s.block.id,l=s.depth;const u=s.$pos.node(s.depth-1);u.type===Ye.nodes.listItem&&u.childCount===1&&u.attrs.suggestId===i&&u.attrs.suggestOp==="ins"&&(r=u.attrs.bid,l-=1);const d=n<0?{near:s.$pos.before(l),bias:-1}:{bid:e.block.id,after:e.block.inline[e.block.inline.length-1]?.id??null};return{kind:"write",ops:[{op:"delete",target:vT(r),suggest:i}],id:i,caret:d}}function Cbe(t,e){let n=null;return t.nodesBetween(Math.min(e,t.content.size),t.content.size,(o,s)=>n!==null?!1:o.isTextblock&&s>=e-1?(n=s+1,!1):!0),n}function Tbe(t,e){const n=yp(t,e);if(!n)return Ws(Xt.notYet);if(n.node.type===Ye.nodes.codeBlock)return Wu(t,e,e,kT(`
|
|
84
84
|
`));const{block:o,$pos:s}=n,i=o.inline,r=Ku(n,e),l=i.slice(r).every(C=>C.suggest?.op==="del"),u=r===0&&!l,d=s.node(n.depth-1),h=d.type===Ye.nodes.listItem;if(!l&&!u)return Ws(h?Xt.itemBreak:Xt.notYet);if(ST(t,o))return Ws(Xt.peer);const p=l?s.index(n.depth-1)===d.childCount-1:s.index(n.depth-1)===0,g=h&&p&&typeof d.attrs.bid=="string"?d.attrs.bid:null;if(g&&d.attrs.suggestId&&!(d.attrs.suggestOp==="ins"&&t.mine(d.attrs.suggestId)))return Ws(Xt.peer);const b=hw(t,o)??(g&&d.attrs.suggestOp==="ins"?yr(t,{id:d.attrs.suggestId}):null)??yr(t,i[r-1]?.suggest)??t.fresh(),w=t.take(g?2:1),k={op:"insert",target:vT(g??o.id),side:l?"after":"before",ids:{from:w[0],count:w.length},with:{as:"blocks",from:{kind:"blocks",content:[{type:"paragraph"}]}},suggest:b},j=l?{bid:w[w.length-1],after:null}:{bid:o.id,after:null};return{kind:"write",ops:[k],id:b,caret:j}}function jT(t,e){const n=[];let o=!1,s=!1,i=0;const r=e?`
|
|
85
85
|
`:" ",l=(h,p=[])=>{if(!h)return;const g=n[n.length-1];g&&g.type==="text"&&JSON.stringify(g.marks??[])===JSON.stringify(p)?g.text=`${String(g.text)}${h}`:n.push({type:"text",text:h,...p.length?{marks:p}:{}})},u=h=>{h.forEach(p=>{p.isText?l(p.text,e?[]:p.marks.filter(g=>!C6(g)).map(g=>g.toJSON())):p.type===Ye.nodes.hardBreak?(o=!0,l(r)):p.type===Ye.nodes.media?s=!0:e||n.push({...p.toJSON(),marks:void 0})})},d=h=>{if(h.isTextblock)i++>0&&(o=!0,l(r)),u(h);else if(h.type===Ye.nodes.media)s=!0;else if(h.isLeaf){if(!h.isInline)return;u({forEach:p=>p(h)})}else h.forEach(d)};t.content.forEach(d);for(const h of n)h.marks===void 0&&delete h.marks;return{content:n,joined:o,leftOut:s}}function Ebe(t){const e=t.steps.length===1?t.steps[0]:null,n=t.steps.some(u=>u instanceof _n&&_be(u.slice,Ye.nodes.media));if(!e||e.constructor!==_n)return{kind:"refuse",why:n?Xt.uploads:Xt.notYet};const{from:o,to:s,slice:i}=e,r=t.before.resolve(o);if(!r.parent.isTextblock||!r.sameParent(t.before.resolve(s))||i.openStart!==i.openEnd)return{kind:"refuse",why:Xt.notYet};if(n)return{kind:"refuse",why:Xt.uploads};if(!i.content.size)return{kind:"remove",from:o,to:s};const l=jT(i,r.parent.type===Ye.nodes.codeBlock);return l.joined?{kind:"refuse",why:Xt.notYet}:{kind:"insert",from:o,to:s,content:l.content}}function _be(t,e){let n=!1;return t.content.descendants(o=>(o.type===e&&(n=!0),!n)),n}const pw="docSuggesting",cr=t=>Cs(t.charAt(0).toUpperCase()+t.slice(1)),Mbe=new Set(["others_pending","in_suggestion","not_yours"]),Obe=t=>Mbe.has(t)?Xt.peer:Xt.notYet;function Abe(t,e,n){if(d$(n))return!0;const o=t.suggestions?.[n];return!!e&&!!o&&o.by===e&&o.via!=="agent"}function ql(t,e){const n=e.binding.shadow,o=ke().me?.id??null,s=pt().writer;return{state:t,shadow:n,mine:i=>Abe(n,o,i),take:i=>Array.from({length:i},(r,l)=>`${s.sess}.${s.next+l}`),fresh:Ole}}const Ph=new Map;let El=null,uk=!1;function Rbe(t,e){const n=(Ph.get(t)??[]).filter(o=>o!==e);n.push(e),Ph.set(t,n.slice(-50)),El=null}function Nbe(t){if(uk)return;const e=Ph.get(t.id)??[],n=new Set(Po(t.sync.shadow.blocks));for(;e.length&&!n.has(e[e.length-1]);)e.pop();const o=e.pop();o&&(uk=!0,wT(t.id,[o],"withdraw").finally(()=>{uk=!1;const s=Ds().last;s?.verdict==="withdraw"&&s.ids.length===1&&s.ids[0]===o&&(bo({last:{...s,editSerial:-1}}),El={tab:t.id,id:o})}))}function Dbe(t){const e=Ds().last;if(!El||El.tab!==t.id||e?.verdict!=="withdraw"||e.ids[0]!==El.id)return;const n=El.id;El=null,xT().then(()=>{const o=Ph.get(t.id)??[];o.push(n),Ph.set(t.id,o)})}function ka(t){const{tab:e,view:n}=me.getState();return!e||n!==t?null:pt().openTabOf(e)}function VD(t,e,n){const o=t.state.doc;let s=null;if("bid"in n){const i=Au(o,e.binding.shadow,n);i!==null&&(s=Le.create(o,i))}else s=Ke.near(o.resolve(Math.max(0,Math.min(n.near,o.content.size))),n.bias);s&&t.dispatch(t.state.tr.setSelection(s).setMeta(pw,!0).setMeta("addToHistory",!1).scrollIntoView())}function Aa(t,e,n){if(!n)return!1;if(n.kind==="refuse")return cr(n.why),!1;if(n.kind==="move")return VD(t,e,n.caret),!1;try{e.sync.write(n.ops)}catch(s){if(!(s instanceof Re))throw s;return cr(Obe(s.code)),!1}Rbe(e.id,n.id);const o=Ds().last;return o&&o.editSerial!==-1&&bo({last:{...o,editSerial:-1}}),VD(t,e,n.caret),!0}function Pbe(t,e){const{$head:n}=t.selection;return e<0?t.doc.textBetween(n.start(),n.pos,void 0,""):t.doc.textBetween(n.pos,n.end(),void 0,"")}function Bbe(t,e,n,o){const{selection:s}=t;if(!(s instanceof Le))return{kind:"refuse",why:Xt.notYet};if(!s.empty)return vu(e,s.from,s.to,o);const i=tc(),r=i?n.metaKey:!1,l=i?n.altKey:n.ctrlKey;if(r||l){const u=Pbe(t,o),d=r?u:o<0?u.match(/\S*\s*$/u)?.[0]??"":u.match(/^\s*\S*/u)?.[0]??"";if(d.length){const h=s.head;return o<0?vu(e,h-d.length,h,-1):vu(e,h,h+d.length,1)}}return Sbe(e,s.head,o)}function zbe(t,e){if(!sr()||t.composing||e.isComposing)return!1;const n=ka(t);if(!n)return!1;const o=t.state,s=tc()?e.metaKey:e.ctrlKey,i=e.key;if(s&&!e.altKey&&(i==="z"||i==="Z"||i==="y"))return i==="y"||e.shiftKey?Dbe(n):j6(o)||Nbe(n),!0;if(i==="Backspace"||i==="Delete")return Aa(t,n,Bbe(o,ql(o,n),e,i==="Backspace"?-1:1)),!0;if(i==="Enter"&&!s&&!e.altKey){const{selection:r}=o;if(!(r instanceof Le)||!r.empty)return cr(Xt.notYet),!0;const l=ql(o,n);if(e.shiftKey){const u=r.$head.parent.type===Ye.nodes.codeBlock;Aa(t,n,Wu(l,r.head,r.head,u?kT(`
|