@inkeep/open-knowledge 0.4.0-beta.9 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/open-knowledge/SKILL.md +1 -1
- package/dist/cli.mjs +31 -31
- package/dist/constants-BWv15Llm.mjs +2 -0
- package/dist/dist-Bu-MwAbD.mjs +1 -0
- package/dist/{dist-ou5qina8.mjs → dist-D4M20vXU.mjs} +13 -12
- package/dist/{dist-DVM7wH81.mjs → dist-DfIz2LcA.mjs} +15 -15
- package/dist/index.mjs +1 -1
- package/dist/{init-Cw_1Ay1s.mjs → init-B1cOyI0L.mjs} +5 -5
- package/dist/init-DssmNpgE.mjs +1 -0
- package/dist/loader-CHkc9V89.mjs +1 -0
- package/dist/{loader-BTC8Ab4t.mjs → loader-CWaAs1JL.mjs} +3 -3
- package/dist/open-browser-BOeCxs2W.mjs +2 -0
- package/dist/preview-BjoTulUl.mjs +1 -0
- package/dist/{preview-IJyfVtTf.mjs → preview-FAMk9J0z.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-1ymqlcHI.js → ActivityModeContent-BS-F_q5b.js} +2 -2
- package/dist/public/assets/DocumentContext-CKgn09Wu.js +37 -0
- package/dist/public/assets/{GraphPanel-DdVygxYk.js → GraphPanel-BYxZ6mOr.js} +2 -2
- package/dist/public/assets/McpConsentDialogBody-C-eBNOSk.js +1 -0
- package/dist/public/assets/{OutlinePanel-dumodx-h.js → OutlinePanel-B1VwD6nb.js} +1 -1
- package/dist/public/assets/SettingsPane-Byz_-VcF.js +11 -0
- package/dist/public/assets/{SourceEditor-CR_7DOAH.js → SourceEditor-CF1C1jlS.js} +2 -2
- package/dist/public/assets/{_baseFor-CX8dsZbW.js → _baseFor-DTImdh6y.js} +1 -1
- package/dist/public/assets/{agent-presence-Ds2n3U5P.js → agent-presence-CaGG2gp7.js} +1 -1
- package/dist/public/assets/{arc-BL_OKZmE.js → arc-VNWsD8TF.js} +1 -1
- package/dist/public/assets/architecture-YZFGNWBL-BiRl99NU.js +1 -0
- package/dist/public/assets/{architectureDiagram-Q4EWVU46-BKKtWWhU.js → architectureDiagram-Q4EWVU46-C7EDVIb_.js} +1 -1
- package/dist/public/assets/{blockDiagram-DXYQGD6D-fzO4vZye.js → blockDiagram-DXYQGD6D-RDoQRmSR.js} +1 -1
- package/dist/public/assets/button-qDXa0MxS.js +1 -0
- package/dist/public/assets/{c4Diagram-AHTNJAMY-BkXqEjiP.js → c4Diagram-AHTNJAMY-DWq5v6f-.js} +1 -1
- package/dist/public/assets/channel-C0UNiHDS.js +1 -0
- package/dist/public/assets/checkbox-kWXLLH40.js +1 -0
- package/dist/public/assets/{chunk-2KRD3SAO-DQj0pw3H.js → chunk-2KRD3SAO-BTibUhx6.js} +1 -1
- package/dist/public/assets/{chunk-336JU56O-CBajDulv.js → chunk-336JU56O-Bm6IwRki.js} +2 -2
- package/dist/public/assets/chunk-426QAEUC-BexV_O4G.js +1 -0
- package/dist/public/assets/{chunk-4BX2VUAB-D8pbSOlJ.js → chunk-4BX2VUAB-Dzrv7xRQ.js} +1 -1
- package/dist/public/assets/{chunk-4TB4RGXK-mA6CujZO.js → chunk-4TB4RGXK-n_VCZ-Dw.js} +1 -1
- package/dist/public/assets/chunk-55IACEB6-yo8vOoww.js +1 -0
- package/dist/public/assets/{chunk-5FUZZQ4R-BVDLgFg2.js → chunk-5FUZZQ4R-CwFS-NM9.js} +1 -1
- package/dist/public/assets/{chunk-5PVQY5BW-Cxi5d3lT.js → chunk-5PVQY5BW-Cf3pEIAB.js} +1 -1
- package/dist/public/assets/{chunk-67CJDMHE-CdrAY8qZ.js → chunk-67CJDMHE-B1qjR6o5.js} +1 -1
- package/dist/public/assets/{chunk-7N4EOEYR-CJ3HBg3c.js → chunk-7N4EOEYR-9LthribN.js} +1 -1
- package/dist/public/assets/{chunk-AA7GKIK3-D0ckJAXt.js → chunk-AA7GKIK3-DFgv_Jxv.js} +1 -1
- package/dist/public/assets/{chunk-BSJP7CBP-D4bNhKd7.js → chunk-BSJP7CBP-BMfaq0VP.js} +1 -1
- package/dist/public/assets/{chunk-CIAEETIT-D1Fpp2md.js → chunk-CIAEETIT-DUfZ-zCl.js} +1 -1
- package/dist/public/assets/{chunk-EDXVE4YY-ChhT3Iyo.js → chunk-EDXVE4YY-BKbUy63F.js} +1 -1
- package/dist/public/assets/{chunk-ENJZ2VHE-Bby39so4.js → chunk-ENJZ2VHE-DIZOQmDi.js} +1 -1
- package/dist/public/assets/{chunk-FMBD7UC4-pRkDIOZn.js → chunk-FMBD7UC4-DA5iFIgZ.js} +1 -1
- package/dist/public/assets/{chunk-FOC6F5B3-BsB4oTj4.js → chunk-FOC6F5B3-DlEcGgqD.js} +1 -1
- package/dist/public/assets/{chunk-ICPOFSXX-CrnuSfeJ.js → chunk-ICPOFSXX-BDU_0nPa.js} +2 -2
- package/dist/public/assets/{chunk-K5T4RW27-CtREah_n.js → chunk-K5T4RW27-CZi_8YH2.js} +1 -1
- package/dist/public/assets/{chunk-KGLVRYIC-DtDxSfKu.js → chunk-KGLVRYIC-q8yxX2UV.js} +1 -1
- package/dist/public/assets/{chunk-LIHQZDEY-D63TRk6j.js → chunk-LIHQZDEY-BqlaDvTQ.js} +1 -1
- package/dist/public/assets/{chunk-ORNJ4GCN-Dv2PvYVu.js → chunk-ORNJ4GCN-B6A2jdfA.js} +1 -1
- package/dist/public/assets/{chunk-OYMX7WX6-BhfqKepC.js → chunk-OYMX7WX6-BtgGgZZ0.js} +1 -1
- package/dist/public/assets/chunk-QZHKN3VN-Dm2czGiD.js +1 -0
- package/dist/public/assets/{chunk-U2HBQHQK-6BAKH95D.js → chunk-U2HBQHQK-LrOM0aht.js} +1 -1
- package/dist/public/assets/{chunk-X2U36JSP-Cqpkx90-.js → chunk-X2U36JSP-CsEhwsxu.js} +1 -1
- package/dist/public/assets/{chunk-XPW4576I-DSytTnq4.js → chunk-XPW4576I-D3W7wPR1.js} +1 -1
- package/dist/public/assets/{chunk-YZCP3GAM-Dt9awjVh.js → chunk-YZCP3GAM-C2TR8l-U.js} +1 -1
- package/dist/public/assets/{chunk-ZZ45TVLE-JGFITgiO.js → chunk-ZZ45TVLE-DGa_Hgat.js} +1 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-DqMO_sxB.js +1 -0
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-BbC-74zc.js +1 -0
- package/dist/public/assets/clone-DpRB82L-.js +1 -0
- package/dist/public/assets/config-validation-events-BX5T6Pv4.js +7 -0
- package/dist/public/assets/{cose-bilkent-S5V4N54A-B9nG-SHi.js → cose-bilkent-S5V4N54A-cxoevGhk.js} +1 -1
- package/dist/public/assets/{dagre-BEdPLXba.js → dagre-DoC3Vx7E.js} +1 -1
- package/dist/public/assets/{dagre-KV5264BT-DKn5nGCC.js → dagre-KV5264BT-CjRUxU3J.js} +1 -1
- package/dist/public/assets/{diagram-5BDNPKRD-BQuwYEd0.js → diagram-5BDNPKRD-DlgILr6_.js} +1 -1
- package/dist/public/assets/{diagram-G4DWMVQ6-BmzIMyV5.js → diagram-G4DWMVQ6-CA3PL8En.js} +1 -1
- package/dist/public/assets/{diagram-MMDJMWI5-CI5eJfgr.js → diagram-MMDJMWI5-DVx-bZhM.js} +1 -1
- package/dist/public/assets/{diagram-TYMM5635-Cc8TJ7v3.js → diagram-TYMM5635-DCl_Xx4h.js} +1 -1
- package/dist/public/assets/dialog-CV9Q4JrD.js +45 -0
- package/dist/public/assets/{dist-nPpvoMNC.js → dist-BEF_m-Pp.js} +1 -1
- package/dist/public/assets/{dist-BH1b1nWB.js → dist-BJPjDIRr.js} +1 -1
- package/dist/public/assets/{dist-S8LJmtzL.js → dist-Bf3rdSRu.js} +1 -1
- package/dist/public/assets/{dist-D08h1pJc.js → dist-ByDNshqn.js} +1 -1
- package/dist/public/assets/{dist-B4kUko7n.js → dist-CSfB7p8y.js} +1 -1
- package/dist/public/assets/{dist-VyzSEzD4.js → dist-DVWct0HX.js} +1 -1
- package/dist/public/assets/{dist-BOapDt7N.js → dist-Gvva1zQ6.js} +1 -1
- package/dist/public/assets/{doc-hash-Q6dTjwu5.js → doc-hash-CfmBVnag.js} +90 -90
- package/dist/public/assets/{erDiagram-SMLLAGMA-BkrhGWMT.js → erDiagram-SMLLAGMA-ChTvmoDx.js} +1 -1
- package/dist/public/assets/{flatten-UmyAv3V9.js → flatten-DXpXo4tl.js} +1 -1
- package/dist/public/assets/{flowDiagram-DWJPFMVM-qh62fanI.js → flowDiagram-DWJPFMVM-8ceKQudh.js} +1 -1
- package/dist/public/assets/{ganttDiagram-T4ZO3ILL-DXuCeCk6.js → ganttDiagram-T4ZO3ILL-uadeK_KN.js} +1 -1
- package/dist/public/assets/gitGraph-7Q5UKJZL-CN7yaTu1.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-UUTBAWPF-BbcuenPj.js → gitGraphDiagram-UUTBAWPF-BcANz6_Q.js} +1 -1
- package/dist/public/assets/{graphlib-CasrTmMJ.js → graphlib-D3l3HBM4.js} +1 -1
- package/dist/public/assets/index-B4T9ZPge.js +1854 -0
- package/dist/public/assets/index-DFiz58v4.css +1 -0
- package/dist/public/assets/info-OMHHGYJF-oSrA8B1G.js +1 -0
- package/dist/public/assets/{infoDiagram-42DDH7IO-WFAMbO2S.js → infoDiagram-42DDH7IO-qKcHjiUa.js} +1 -1
- package/dist/public/assets/{isEmpty-DWJlzxR1.js → isEmpty-D9j5AQZB.js} +1 -1
- package/dist/public/assets/isSymbol-C4J31wCa.js +1 -0
- package/dist/public/assets/{ishikawaDiagram-UXIWVN3A-BJBiReWg.js → ishikawaDiagram-UXIWVN3A-DyndBZjz.js} +1 -1
- package/dist/public/assets/{journeyDiagram-VCZTEJTY-Boq77pl6.js → journeyDiagram-VCZTEJTY-CTiuXUzg.js} +1 -1
- package/dist/public/assets/{kanban-definition-6JOO6SKY-DYMSr18F.js → kanban-definition-6JOO6SKY-D03tqXqX.js} +1 -1
- package/dist/public/assets/label-BOVWulDu.js +1 -0
- package/dist/public/assets/{line-_p5Px7MV.js → line-CZuyNGqX.js} +1 -1
- package/dist/public/assets/{linear-DwuDS4qT.js → linear-CoY1VP-w.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-BcBb_Ows.js → mermaid-parser.core-D4O7MeLl.js} +2 -2
- package/dist/public/assets/{mermaid.core-ZLTnLqVQ.js → mermaid.core-4xgx5kDJ.js} +3 -3
- package/dist/public/assets/{mindmap-definition-QFDTVHPH-BSxM4djR.js → mindmap-definition-QFDTVHPH-BaMNW13B.js} +1 -1
- package/dist/public/assets/{now-BBH4UqDm.js → now-CJgVN_7h.js} +1 -1
- package/dist/public/assets/{ordinal-CeOFUmRv.js → ordinal-BZbu6HlW.js} +1 -1
- package/dist/public/assets/packet-4T2RLAQJ-N-KqWOhj.js +1 -0
- package/dist/public/assets/{panel-BgMqDESF.js → panel-BaN47PCr.js} +1 -1
- package/dist/public/assets/pie-ZZUOXDRM-BcRf7Q2g.js +1 -0
- package/dist/public/assets/{pieDiagram-DEJITSTG-CHRE_Jie.js → pieDiagram-DEJITSTG-_dBzvPAb.js} +1 -1
- package/dist/public/assets/{propagation-api-qAYD7s-v.js → propagation-api-CuTE-jIt.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-34T5L4WZ-CQkE5TwH.js → quadrantDiagram-34T5L4WZ-jnOwhGSn.js} +1 -1
- package/dist/public/assets/radar-PYXPWWZC-CqcGRFrW.js +1 -0
- package/dist/public/assets/{reduce-DotyoGA7.js → reduce-Cn1fAmcq.js} +1 -1
- package/dist/public/assets/{requirementDiagram-MS252O5E-DHK98tKS.js → requirementDiagram-MS252O5E-DpZY5MOe.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-XADWPNL6-BIXaStZh.js → sankeyDiagram-XADWPNL6-CNLrFRka.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-FGHM5R23-BCNH3kJo.js → sequenceDiagram-FGHM5R23-Cqjio9cN.js} +1 -1
- package/dist/public/assets/{src-C9jsS3p4.js → src-CVigMQ0t.js} +1 -1
- package/dist/public/assets/{stateDiagram-FHFEXIEX-BC5mjB6x.js → stateDiagram-FHFEXIEX-rE9sZdwc.js} +1 -1
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-CrJSNsUc.js +1 -0
- package/dist/public/assets/{target-navigation-intent-BfGOumP6.js → target-navigation-intent-CNDuSbLi.js} +1 -1
- package/dist/public/assets/{telemetry-impl-CMeDUVKn.js → telemetry-impl-iq6UBtaA.js} +2 -2
- package/dist/public/assets/{timeline-definition-GMOUNBTQ-VNxUGgXp.js → timeline-definition-GMOUNBTQ-B_X3o8J_.js} +1 -1
- package/dist/public/assets/tooltip-csUfbEtd.js +1 -0
- package/dist/public/assets/treeView-SZITEDCU-B1rO_oUt.js +1 -0
- package/dist/public/assets/treemap-W4RFUUIX-DXE3h2Bn.js +1 -0
- package/dist/public/assets/{vennDiagram-DHZGUBPP-DV2Y2j0r.js → vennDiagram-DHZGUBPP-Cs25K1vw.js} +1 -1
- package/dist/public/assets/wardley-RL74JXVD-ChWi2iyS.js +1 -0
- package/dist/public/assets/{wardleyDiagram-NUSXRM2D-C1mMZ3kx.js → wardleyDiagram-NUSXRM2D-RgfpVD8G.js} +1 -1
- package/dist/public/assets/{xychartDiagram-5P7HB3ND-CxFcwN2X.js → xychartDiagram-5P7HB3ND-BrRrEDJB.js} +1 -1
- package/dist/public/index.html +20 -19
- package/dist/src-B_Vh13Py.mjs +1 -0
- package/dist/{start-BDIOjX_O.mjs → start-CSRc43Yr.mjs} +2 -2
- package/dist/start-DVUu2YvT.mjs +1 -0
- package/package.json +1 -1
- package/dist/constants-CswmjLU5.mjs +0 -2
- package/dist/dist-BToVkFhc.mjs +0 -1
- package/dist/init-C90VliDt.mjs +0 -1
- package/dist/loader-BOTBqos-.mjs +0 -1
- package/dist/open-browser-BZZK_gJj.mjs +0 -2
- package/dist/preview-CGUMKfC0.mjs +0 -1
- package/dist/public/assets/DocumentContext-bvfr7pL2.js +0 -37
- package/dist/public/assets/McpConsentDialogBody-CJwPf_uv.js +0 -1
- package/dist/public/assets/SettingsPane-CtgbQZxP.js +0 -6
- package/dist/public/assets/architecture-YZFGNWBL-DVxNz-zn.js +0 -1
- package/dist/public/assets/button-BsFpqlpT.js +0 -1
- package/dist/public/assets/channel-CR-xJel6.js +0 -1
- package/dist/public/assets/chunk-426QAEUC-BoBKbVmN.js +0 -1
- package/dist/public/assets/chunk-55IACEB6-CqVyNzhX.js +0 -1
- package/dist/public/assets/chunk-QZHKN3VN-DBRWHtgj.js +0 -1
- package/dist/public/assets/classDiagram-6PBFFD2Q-oopM_Z0m.js +0 -1
- package/dist/public/assets/classDiagram-v2-HSJHXN6E-ZAL74u9S.js +0 -1
- package/dist/public/assets/clone-C5y6xhRJ.js +0 -1
- package/dist/public/assets/config-validation-events-BvuBj41U.js +0 -1
- package/dist/public/assets/dialog-Cv1qneWl.js +0 -45
- package/dist/public/assets/gitGraph-7Q5UKJZL-CYhZlmk3.js +0 -1
- package/dist/public/assets/index-BBbaN3Kd.js +0 -1858
- package/dist/public/assets/index-DOkkqO-8.css +0 -1
- package/dist/public/assets/info-OMHHGYJF-BslcKZhH.js +0 -1
- package/dist/public/assets/isSymbol-BP7IOIqG.js +0 -1
- package/dist/public/assets/mcp-consent-store-BBTXqzE6.js +0 -1
- package/dist/public/assets/packet-4T2RLAQJ-QVnYA304.js +0 -1
- package/dist/public/assets/pie-ZZUOXDRM-C61c5byc.js +0 -1
- package/dist/public/assets/radar-PYXPWWZC-CMxjRtd8.js +0 -1
- package/dist/public/assets/stateDiagram-v2-QKLJ7IA2-B8L3BBt1.js +0 -1
- package/dist/public/assets/tooltip-CBGDOTMI.js +0 -1
- package/dist/public/assets/treeView-SZITEDCU-DfSa_Oiv.js +0 -1
- package/dist/public/assets/treemap-W4RFUUIX-Cp0s5wEq.js +0 -1
- package/dist/public/assets/wardley-RL74JXVD-CXcBKCuj.js +0 -1
- package/dist/src-DXx7F2B7.mjs +0 -1
- package/dist/start-DmOxN4Ez.mjs +0 -1
- /package/dist/public/assets/{ActivityPanelDiffView-DoHWP1ak.js → ActivityPanelDiffView-B_49ivYc.js} +0 -0
- /package/dist/public/assets/{__vite-browser-external-FEGw1XPd.js → __vite-browser-external-6Gb3h3lj.js} +0 -0
- /package/dist/public/assets/{array-X0JlPOfd.js → array-DO1uCttT.js} +0 -0
- /package/dist/public/assets/{colors-XIJoz9Bd.js → colors-BjbB2MOj.js} +0 -0
- /package/dist/public/assets/{cytoscape.esm-BkjNfcSF.js → cytoscape.esm-AyAnQ5hQ.js} +0 -0
- /package/dist/public/assets/{defaultLocale-ZxyFnXCb.js → defaultLocale-B6RGN4id.js} +0 -0
- /package/dist/public/assets/{dist-CIRuNcH5.js → dist-0bM9CqzR.js} +0 -0
- /package/dist/public/assets/{go-a33xvodr.js → go-BRhAdNMM.js} +0 -0
- /package/dist/public/assets/{init-CBj3ecIW.js → init-BmUWJJHz.js} +0 -0
- /package/dist/public/assets/{isObjectLike-AdQZ65l0.js → isObjectLike-CjYO71dq.js} +0 -0
- /package/dist/public/assets/{katex-qwlL5fSd.js → katex-DBuiuHex.js} +0 -0
- /package/dist/public/assets/{min-HKuGSUqa.js → min-CwjSmrJ6.js} +0 -0
- /package/dist/public/assets/{path-rUlDLHdA.js → path-CoPyR7c2.js} +0 -0
- /package/dist/public/assets/{pdf-a35ddrIO.js → pdf-DaFpV-4n.js} +0 -0
- /package/dist/public/assets/{pdf.worker-CM-zAFN-.js → pdf.worker-Cq62cyp3.js} +0 -0
- /package/dist/public/assets/{rough.esm-BFJ-MgcB.js → rough.esm-ec8xsRC7.js} +0 -0
- /package/dist/public/assets/{shell-40VLet8r.js → shell-DT_H80Gx.js} +0 -0
- /package/dist/public/assets/{src-zyMpT2LE.js → src-CWigLjcs.js} +0 -0
- /package/dist/public/assets/{stex-BKMR5xQj.js → stex-DQW679lh.js} +0 -0
- /package/dist/public/assets/{trace-api-DPMyR1_m.js → trace-api-CbLDdnQA.js} +0 -0
- /package/dist/public/assets/{w3c-keyname-Dfj2imOv.js → w3c-keyname-B5t0fahT.js} +0 -0
|
@@ -1,1858 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./telemetry-impl-CMeDUVKn.js","./chunk-CFjPhJqf.js","./preload-helper-2ej06EnG.js","./trace-api-DPMyR1_m.js","./propagation-api-qAYD7s-v.js","./McpConsentDialogBody-CJwPf_uv.js","./button-BsFpqlpT.js","./compiler-runtime-CVnuRdak.js","./dialog-Cv1qneWl.js","./mcp-consent-store-BBTXqzE6.js","./ActivityPanelDiffView-DoHWP1ak.js","./ActivityPanelDiffView-legcy4jI.css","./GraphPanel-DdVygxYk.js","./doc-hash-Q6dTjwu5.js","./w3c-keyname-Dfj2imOv.js","./tooltip-CBGDOTMI.js","./panel-BgMqDESF.js","./min-HKuGSUqa.js","./src-zyMpT2LE.js","./colors-XIJoz9Bd.js","./ordinal-CeOFUmRv.js","./init-CBj3ecIW.js","./isObjectLike-AdQZ65l0.js","./now-BBH4UqDm.js","./isSymbol-BP7IOIqG.js","./target-navigation-intent-BfGOumP6.js","./ActivityModeContent-1ymqlcHI.js","./DocumentContext-bvfr7pL2.js","./dist-S8LJmtzL.js","./dist-nPpvoMNC.js","./dist-D08h1pJc.js","./agent-presence-Ds2n3U5P.js","./SourceEditor-CR_7DOAH.js","./OutlinePanel-dumodx-h.js","./SettingsPane-CtgbQZxP.js","./config-validation-events-BvuBj41U.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e,r as t,t as n}from"./chunk-CFjPhJqf.js";import{t as r}from"./preload-helper-2ej06EnG.js";import{n as i,r as a,t as o}from"./compiler-runtime-CVnuRdak.js";import{A as s,C as c,D as l,E as u,O as d,S as f,T as p,_ as m,a as h,b as g,c as _,d as v,f as y,g as b,h as x,i as S,k as C,l as w,m as T,n as E,p as D,r as O,s as k,t as A,u as j,v as M,w as N,x as P,y as F}from"./panel-BgMqDESF.js";import{$n as I,$t as L,At as R,Ct as z,Dt as B,En as V,F as H,Gn as U,Gt as W,Hn as G,I as ee,J as te,Jn as ne,Kn as re,Mn as ie,Nn as ae,P as oe,Qn as se,Qt as ce,Rt as le,St as ue,Tt as K,Un as q,V as de,Wn as fe,Xn as pe,Xt as me,Yn as he,Yt as ge,Zn as _e,_ as ve,_t as ye,a as be,an as xe,ar as Se,at as Ce,b as we,bn as Te,c as Ee,cr as De,dr as Oe,dt as ke,en as Ae,er as je,fn as Me,fr as Ne,ft as Pe,gt as Fe,i as Ie,in as Le,ir as Re,it as ze,jn as Be,kt as Ve,l as He,m as Ue,mr as We,n as Ge,nr as Ke,nt as qe,o as Je,or as Ye,ot as Xe,p as Ze,pn as Qe,pr as $e,pt as et,qn as tt,r as nt,rn as rt,rr as it,rt as at,s as ot,sr as st,t as ct,tr as lt,u as ut,v as dt,vt as ft,wn as pt,x as mt,xn as ht,y as gt,yt as _t}from"./doc-hash-Q6dTjwu5.js";import{C as vt,S as yt,_ as bt,a as xt,b as St,c as Ct,f as wt,g as Tt,h as Et,i as Dt,l as Ot,m as kt,n as At,o as jt,r as J,s as Mt,t as Y,u as Nt,v as Pt,w as Ft,x as It}from"./button-BsFpqlpT.js";import{$t as Lt,A as Rt,At as zt,Bt,C as Vt,Ct as Ht,D as Ut,Dt as Wt,E as Gt,Et as Kt,F as qt,Ft as Jt,G as Yt,Gt as Xt,H as Zt,Ht as Qt,I as $t,It as en,J as tn,Jt as nn,K as rn,Kt as an,L as on,Lt as sn,M as cn,Mt as ln,N as un,Nt as dn,O as fn,Ot as pn,P as mn,Pt as hn,Q as gn,Qt as _n,R as vn,Rt as yn,S as bn,T as xn,Tt as Sn,U as Cn,Ut as wn,V as Tn,Vt as En,W as Dn,Wt as On,X as kn,Xt as An,Y as jn,Zt as Mn,a as Nn,at as Pn,b as Fn,c as In,ct as Ln,d as Rn,dt as zn,en as Bn,et as Vn,f as Hn,i as Un,it as Wn,j as Gn,jt as Kn,k as qn,kt as Jn,l as Yn,lt as Xn,m as Zn,n as Qn,nt as $n,o as er,ot as tr,p as nr,q as rr,qt as ir,r as ar,rt as or,s as sr,st as cr,t as lr,tn as ur,tt as dr,u as fr,v as pr,w as mr,wt as hr,x as gr,y as _r,z as vr,zt as yr}from"./DocumentContext-bvfr7pL2.js";import{a as br,c as xr,d as Sr,f as Cr,i as wr,l as Tr,m as Er,n as Dr,o as Or,p as kr,r as Ar,s as jr,t as Mr,u as Nr}from"./agent-presence-Ds2n3U5P.js";import{_ as Pr,a as Fr,b as Ir,c as Lr,d as Rr,f as zr,g as Br,h as Vr,i as Hr,l as Ur,m as Wr,o as Gr,p as Kr,r as qr,s as Jr,t as Yr,u as Xr,v as Zr,x as Qr,y as $r}from"./config-validation-events-BvuBj41U.js";import{n as ei,r as ti,t as ni}from"./target-navigation-intent-BfGOumP6.js";import{S as ri,_ as ii,a as ai,b as oi,c as si,f as ci,g as li,h as ui,i as di,l as fi,m as pi,n as mi,o as hi,p as gi,r as _i,s as vi,t as yi,u as bi,v as xi,x as X,y as Si}from"./dialog-Cv1qneWl.js";import{i as Ci,n as wi,r as Ti,t as Ei}from"./tooltip-CBGDOTMI.js";import{n as Di,t as Oi}from"./mcp-consent-store-BBTXqzE6.js";import{At as ki,C as Ai,Dt as ji,Et as Mi,F as Ni,Ft as Pi,Nt as Fi,O as Ii,Pt as Li,Q as Ri,St as zi,X as Bi,Y as Vi,Z as Hi,it as Ui,jt as Wi,kt as Gi,q as Ki,wt as qi,yt as Ji}from"./dist-nPpvoMNC.js";import{n as Yi,r as Xi,s as Zi,t as Qi}from"./OutlinePanel-dumodx-h.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function $i(){({BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1})?.VITE_OTEL_ENABLED===`true`&&r(()=>import(`./telemetry-impl-CMeDUVKn.js`).then(e=>e.install()),__vite__mapDeps([0,1,2,3,4]),import.meta.url)}function ea(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{b(e,()=>t.signal,()=>n=!0)},u=F(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?M:m;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?na:ta,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:ta(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function ta(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function na(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ra=class extends y{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ia(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=D({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),x.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function ia(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var aa=class extends s{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new ra({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=oa(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=oa(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=oa(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=oa(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){x.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>c(t,e))}findAll(e={}){return this.getAll().filter(t=>c(e,t))}notify(e){x.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return x.batch(()=>Promise.all(e.map(e=>e.continue().catch(p))))}};function oa(e){return e.options.scope?.id}var sa=class extends s{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??f(r,t),a=this.get(i);return a||(a=new v({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){x.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>N(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>N(e,t)):t}notify(e){x.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){x.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){x.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},ca=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new sa,this.#t=e.mutationCache||new aa,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=C.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=T.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(l(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=g(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return x.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;x.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return x.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=x.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(p).catch(p)}invalidateQueries(e,t={}){return x.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=x.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(p)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(p)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(l(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(p).catch(p)}fetchInfiniteQuery(e){return e.behavior=ea(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(p).catch(p)}ensureInfiniteQueryData(e){return e.behavior=ea(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return T.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(P(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{u(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(P(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{u(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=f(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===d&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},la=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),ua=n(((e,t)=>{t.exports=la()})),da=n((e=>{var t=ua(),n=i(),r=Ft();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},L=[],R=-1;function z(e){return{current:e}}function B(e){0>R||(e.current=L[R],L[R]=null,R--)}function V(e,t){R++,L[R]=e.current,e.current=t}var H=z(null),U=z(null),W=z(null),G=z(null);function ee(e,t){switch(V(W,t),V(U,e),V(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(H),V(H,e)}function te(){B(H),B(U),B(W)}function ne(e){e.memoizedState!==null&&V(G,e);var t=H.current,n=Hd(t,e.type);t!==n&&(V(U,e),V(H,n))}function re(e){U.current===e&&(B(H),B(U)),G.current===e&&(B(G),Qf._currentValue=I)}var ie,ae;function oe(e){if(ie===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ie=t&&t[1]||``,ae=-1<e.stack.indexOf(`
|
|
3
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
-
`+ie+e+ae}var se=!1;function ce(e,t){if(!e||se)return``;se=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
-
`),l=s.split(`
|
|
6
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{se=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?oe(n):``}function le(e,t){switch(e.tag){case 26:case 27:case 5:return oe(e.type);case 16:return oe(`Lazy`);case 13:return e.child!==t&&t!==null?oe(`Suspense Fallback`):oe(`Suspense`);case 19:return oe(`SuspenseList`);case 0:case 15:return ce(e.type,!1);case 11:return ce(e.type.render,!1);case 1:return ce(e.type,!0);case 31:return oe(`Activity`);default:return``}}function ue(e){try{var t=``,n=null;do t+=le(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
-
Error generating stack: `+e.message+`
|
|
9
|
-
`+e.stack}}var K=Object.prototype.hasOwnProperty,q=t.unstable_scheduleCallback,de=t.unstable_cancelCallback,fe=t.unstable_shouldYield,pe=t.unstable_requestPaint,me=t.unstable_now,he=t.unstable_getCurrentPriorityLevel,ge=t.unstable_ImmediatePriority,_e=t.unstable_UserBlockingPriority,ve=t.unstable_NormalPriority,ye=t.unstable_LowPriority,be=t.unstable_IdlePriority,xe=t.log,Se=t.unstable_setDisableYieldValue,Ce=null,we=null;function Te(e){if(typeof xe==`function`&&Se(e),we&&typeof we.setStrictMode==`function`)try{we.setStrictMode(Ce,e)}catch{}}var Ee=Math.clz32?Math.clz32:ke,De=Math.log,Oe=Math.LN2;function ke(e){return e>>>=0,e===0?32:31-(De(e)/Oe|0)|0}var Ae=256,je=262144,Me=4194304;function Ne(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Pe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ne(n))):i=Ne(o):i=Ne(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ne(n))):i=Ne(o)):i=Ne(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Fe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ie(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 Le(){var e=Me;return Me<<=1,!(Me&62914560)&&(Me=4194304),e}function Re(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ze(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Be(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ee(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Ve(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Ve(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ee(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function He(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ee(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Ue(e,t){var n=t&-t;return n=n&42?1:We(n),(n&(e.suspendedLanes|t))===0?n:0}function We(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ge(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Ke(){var e=F.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function qe(e,t){var n=F.p;try{return F.p=e,t()}finally{F.p=n}}var Je=Math.random().toString(36).slice(2),Ye=`__reactFiber$`+Je,Xe=`__reactProps$`+Je,Ze=`__reactContainer$`+Je,Qe=`__reactEvents$`+Je,$e=`__reactListeners$`+Je,et=`__reactHandles$`+Je,tt=`__reactResources$`+Je,nt=`__reactMarker$`+Je;function rt(e){delete e[Ye],delete e[Xe],delete e[Qe],delete e[$e],delete e[et]}function it(e){var t=e[Ye];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ze]||n[Ye]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=df(e);e!==null;){if(n=e[Ye])return n;e=df(e)}return t}e=n,n=e.parentNode}return null}function at(e){if(e=e[Ye]||e[Ze]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ot(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function st(e){var t=e[tt];return t||=e[tt]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ct(e){e[nt]=!0}var lt=new Set,ut={};function dt(e,t){ft(e,t),ft(e+`Capture`,t)}function ft(e,t){for(ut[e]=t,e=0;e<t.length;e++)lt.add(t[e])}var pt=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]*$`),mt={},ht={};function gt(e){return K.call(ht,e)?!0:K.call(mt,e)?!1:pt.test(e)?ht[e]=!0:(mt[e]=!0,!1)}function _t(e,t,n){if(gt(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function vt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function yt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function bt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function xt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function St(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ct(e){if(!e._valueTracker){var t=xt(e)?`checked`:`value`;e._valueTracker=St(e,t,``+e[t])}}function wt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=xt(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Tt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Et=/[\n"\\]/g;function Dt(e){return e.replace(Et,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ot(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+bt(t)):e.value!==``+bt(t)&&(e.value=``+bt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):At(e,o,bt(n)):At(e,o,bt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+bt(s):e.removeAttribute(`name`)}function kt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Ct(e);return}n=n==null?``:``+bt(n),t=t==null?n:``+bt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Ct(e)}function At(e,t,n){t===`number`&&Tt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function jt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+bt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function J(e,t,n){if(t!=null&&(t=``+bt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+bt(n)}function Mt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(N(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=bt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Ct(e)}function Y(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Nt=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 Pt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Nt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function It(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Pt(e,i,r)}else for(var o in t)t.hasOwnProperty(o)&&Pt(e,o,t[o])}function Lt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){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 Rt=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`]]),zt=/^[\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 Bt(e){return zt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Vt(){}var Ht=null;function Ut(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Wt=null,Gt=null;function Kt(e){var t=at(e);if(t&&(e=t.stateNode)){var n=e[Xe]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ot(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Dt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Xe]||null;if(!i)throw Error(a(90));Ot(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&wt(r)}break a;case`textarea`:J(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&jt(e,!!n.multiple,t,!1)}}}var qt=!1;function Jt(e,t,n){if(qt)return e(t,n);qt=!0;try{return e(t)}finally{if(qt=!1,(Wt!==null||Gt!==null)&&(_u(),Wt&&(t=Wt,e=Gt,Gt=Wt=null,Kt(t),e)))for(t=0;t<e.length;t++)Kt(e[t])}}function Yt(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Xe]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var Xt=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),Zt=!1;if(Xt)try{var Qt={};Object.defineProperty(Qt,`passive`,{get:function(){Zt=!0}}),window.addEventListener(`test`,Qt,Qt),window.removeEventListener(`test`,Qt,Qt)}catch{Zt=!1}var $t=null,en=null,tn=null;function nn(){if(tn)return tn;var e,t=en,n=t.length,r,i=`value`in $t?$t.value:$t.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return tn=i.slice(e,1<r?1-r:void 0)}function rn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function an(){return!0}function on(){return!1}function sn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?an:on,this.isPropagationStopped=on,this}return p(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=an)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=an)},persist:function(){},isPersistent:an}),t}var cn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ln=sn(cn),un=p({},cn,{view:0,detail:0}),dn=sn(un),fn,pn,mn,hn=p({},un,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:En,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==mn&&(mn&&e.type===`mousemove`?(fn=e.screenX-mn.screenX,pn=e.screenY-mn.screenY):pn=fn=0,mn=e),fn)},movementY:function(e){return`movementY`in e?e.movementY:pn}}),gn=sn(hn),_n=sn(p({},hn,{dataTransfer:0})),vn=sn(p({},un,{relatedTarget:0})),yn=sn(p({},cn,{animationName:0,elapsedTime:0,pseudoElement:0})),bn=sn(p({},cn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),xn=sn(p({},cn,{data:0})),Sn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Cn={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`},wn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Tn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=wn[e])?!!t[e]:!1}function En(){return Tn}var Dn=sn(p({},un,{key:function(e){if(e.key){var t=Sn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=rn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Cn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:En,charCode:function(e){return e.type===`keypress`?rn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?rn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),On=sn(p({},hn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),kn=sn(p({},un,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:En})),An=sn(p({},cn,{propertyName:0,elapsedTime:0,pseudoElement:0})),jn=sn(p({},hn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Mn=sn(p({},cn,{newState:0,oldState:0})),Nn=[9,13,27,32],Pn=Xt&&`CompositionEvent`in window,Fn=null;Xt&&`documentMode`in document&&(Fn=document.documentMode);var In=Xt&&`TextEvent`in window&&!Fn,Ln=Xt&&(!Pn||Fn&&8<Fn&&11>=Fn),Rn=` `,zn=!1;function Bn(e,t){switch(e){case`keyup`:return Nn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Vn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Hn=!1;function Un(e,t){switch(e){case`compositionend`:return Vn(t);case`keypress`:return t.which===32?(zn=!0,Rn):null;case`textInput`:return e=t.data,e===Rn&&zn?null:e;default:return null}}function Wn(e,t){if(Hn)return e===`compositionend`||!Pn&&Bn(e,t)?(e=nn(),tn=en=$t=null,Hn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Ln&&t.locale!==`ko`?null:t.data;default:return null}}var Gn={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 Kn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Gn[e.type]:t===`textarea`}function qn(e,t,n,r){Wt?Gt?Gt.push(r):Gt=[r]:Wt=r,t=Td(t,`onChange`),0<t.length&&(n=new ln(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Jn=null,Yn=null;function Xn(e){_d(e,0)}function Zn(e){if(wt(ot(e)))return e}function Qn(e,t){if(e===`change`)return t}var $n=!1;if(Xt){var er;if(Xt){var tr=`oninput`in document;if(!tr){var nr=document.createElement(`div`);nr.setAttribute(`oninput`,`return;`),tr=typeof nr.oninput==`function`}er=tr}else er=!1;$n=er&&(!document.documentMode||9<document.documentMode)}function rr(){Jn&&(Jn.detachEvent(`onpropertychange`,ir),Yn=Jn=null)}function ir(e){if(e.propertyName===`value`&&Zn(Yn)){var t=[];qn(t,Yn,e,Ut(e)),Jt(Xn,t)}}function ar(e,t,n){e===`focusin`?(rr(),Jn=t,Yn=n,Jn.attachEvent(`onpropertychange`,ir)):e===`focusout`&&rr()}function or(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Zn(Yn)}function sr(e,t){if(e===`click`)return Zn(t)}function cr(e,t){if(e===`input`||e===`change`)return Zn(t)}function lr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var ur=typeof Object.is==`function`?Object.is:lr;function dr(e,t){if(ur(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!K.call(t,i)||!ur(e[i],t[i]))return!1}return!0}function fr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pr(e,t){var n=fr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=fr(n)}}function mr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?mr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Tt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Tt(e.document)}return t}function gr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var _r=Xt&&`documentMode`in document&&11>=document.documentMode,vr=null,yr=null,br=null,xr=!1;function Sr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xr||vr==null||vr!==Tt(r)||(r=vr,`selectionStart`in r&&gr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),br&&dr(br,r)||(br=r,r=Td(yr,`onSelect`),0<r.length&&(t=new ln(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=vr)))}function Cr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var wr={animationend:Cr(`Animation`,`AnimationEnd`),animationiteration:Cr(`Animation`,`AnimationIteration`),animationstart:Cr(`Animation`,`AnimationStart`),transitionrun:Cr(`Transition`,`TransitionRun`),transitionstart:Cr(`Transition`,`TransitionStart`),transitioncancel:Cr(`Transition`,`TransitionCancel`),transitionend:Cr(`Transition`,`TransitionEnd`)},Tr={},Er={};Xt&&(Er=document.createElement(`div`).style,`AnimationEvent`in window||(delete wr.animationend.animation,delete wr.animationiteration.animation,delete wr.animationstart.animation),`TransitionEvent`in window||delete wr.transitionend.transition);function Dr(e){if(Tr[e])return Tr[e];if(!wr[e])return e;var t=wr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Er)return Tr[e]=t[n];return e}var Or=Dr(`animationend`),kr=Dr(`animationiteration`),Ar=Dr(`animationstart`),jr=Dr(`transitionrun`),Mr=Dr(`transitionstart`),Nr=Dr(`transitioncancel`),Pr=Dr(`transitionend`),Fr=new Map,Ir=`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(` `);Ir.push(`scrollEnd`);function Lr(e,t){Fr.set(e,t),dt(t,[e])}var Rr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},zr=[],Br=0,Vr=0;function Hr(){for(var e=Br,t=Vr=Br=0;t<e;){var n=zr[t];zr[t++]=null;var r=zr[t];zr[t++]=null;var i=zr[t];zr[t++]=null;var a=zr[t];if(zr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Kr(n,i,a)}}function Ur(e,t,n,r){zr[Br++]=e,zr[Br++]=t,zr[Br++]=n,zr[Br++]=r,Vr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Wr(e,t,n,r){return Ur(e,t,n,r),qr(e)}function Gr(e,t){return Ur(e,null,null,t),qr(e)}function Kr(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ee(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function qr(e){if(50<cu)throw cu=0,lu=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Jr={};function Yr(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xr(e,t,n,r){return new Yr(e,t,n,r)}function Zr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qr(e,t){var n=e.alternate;return n===null?(n=Xr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function $r(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ei(e,t,n,r,i,o){var s=0;if(r=e,typeof e==`function`)Zr(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,H.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case D:return e=Xr(31,n,t,i),e.elementType=D,e.lanes=o,e;case _:return ti(n.children,i,o,t);case v:s=8,i|=24;break;case y:return e=Xr(12,n,t,i|2),e.elementType=y,e.lanes=o,e;case C:return e=Xr(13,n,t,i),e.elementType=C,e.lanes=o,e;case w:return e=Xr(19,n,t,i),e.elementType=w,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case x:s=10;break a;case b:s=9;break a;case S:s=11;break a;case T:s=14;break a;case E:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=Xr(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function ti(e,t,n,r){return e=Xr(7,e,r,t),e.lanes=n,e}function ni(e,t,n){return e=Xr(6,e,null,t),e.lanes=n,e}function ri(e){var t=Xr(18,null,null,0);return t.stateNode=e,t}function ii(e,t,n){return t=Xr(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var ai=new WeakMap;function oi(e,t){if(typeof e==`object`&&e){var n=ai.get(e);return n===void 0?(t={value:e,source:t,stack:ue(t)},ai.set(e,t),t):n}return{value:e,source:t,stack:ue(t)}}var si=[],ci=0,li=null,ui=0,di=[],fi=0,pi=null,mi=1,hi=``;function gi(e,t){si[ci++]=ui,si[ci++]=li,li=e,ui=t}function _i(e,t,n){di[fi++]=mi,di[fi++]=hi,di[fi++]=pi,pi=e;var r=mi;e=hi;var i=32-Ee(r)-1;r&=~(1<<i),n+=1;var a=32-Ee(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,mi=1<<32-Ee(t)+i|n<<i|r,hi=a+e}else mi=1<<a|n<<i|r,hi=e}function vi(e){e.return!==null&&(gi(e,1),_i(e,1,0))}function yi(e){for(;e===li;)li=si[--ci],si[ci]=null,ui=si[--ci],si[ci]=null;for(;e===pi;)pi=di[--fi],di[fi]=null,hi=di[--fi],di[fi]=null,mi=di[--fi],di[fi]=null}function bi(e,t){di[fi++]=mi,di[fi++]=hi,di[fi++]=pi,mi=t.id,hi=t.overflow,pi=e}var xi=null,X=null,Si=!1,Ci=null,wi=!1,Ti=Error(a(519));function Ei(e){throw Mi(oi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ti}function Di(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[Ye]=e,t[Xe]=r,n){case`dialog`:vd(`cancel`,t),vd(`close`,t);break;case`iframe`:case`object`:case`embed`:vd(`load`,t);break;case`video`:case`audio`:for(n=0;n<hd.length;n++)vd(hd[n],t);break;case`source`:vd(`error`,t);break;case`img`:case`image`:case`link`:vd(`error`,t),vd(`load`,t);break;case`details`:vd(`toggle`,t);break;case`input`:vd(`invalid`,t),kt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:vd(`invalid`,t);break;case`textarea`:vd(`invalid`,t),Mt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||jd(t.textContent,n)?(r.popover!=null&&(vd(`beforetoggle`,t),vd(`toggle`,t)),r.onScroll!=null&&vd(`scroll`,t),r.onScrollEnd!=null&&vd(`scrollend`,t),r.onClick!=null&&(t.onclick=Vt),t=!0):t=!1,t||Ei(e,!0)}function Oi(e){for(xi=e.return;xi;)switch(xi.tag){case 5:case 31:case 13:wi=!1;return;case 27:case 3:wi=!0;return;default:xi=xi.return}}function ki(e){if(e!==xi)return!1;if(!Si)return Oi(e),Si=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Ud(e.type,e.memoizedProps)),n=!n),n&&X&&Ei(e),Oi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));X=uf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));X=uf(e)}else t===27?(t=X,Zd(e.type)?(e=lf,lf=null,X=e):X=t):X=xi?cf(e.stateNode.nextSibling):null;return!0}function Ai(){X=xi=null,Si=!1}function ji(){var e=Ci;return e!==null&&(Jl===null?Jl=e:Jl.push.apply(Jl,e),Ci=null),e}function Mi(e){Ci===null?Ci=[e]:Ci.push(e)}var Ni=z(null),Pi=null,Fi=null;function Ii(e,t,n){V(Ni,t._currentValue),t._currentValue=n}function Li(e){e._currentValue=Ni.current,B(Ni)}function Ri(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function zi(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ri(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ri(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Bi(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;ur(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===G.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}i=i.return}e!==null&&zi(t,e,n,r),t.flags|=262144}function Vi(e){for(e=e.firstContext;e!==null;){if(!ur(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Hi(e){Pi=e,Fi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ui(e){return Gi(Pi,e)}function Wi(e,t){return Pi===null&&Hi(e),Gi(e,t)}function Gi(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Fi===null){if(e===null)throw Error(a(308));Fi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fi=Fi.next=t;return n}var Ki=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},qi=t.unstable_scheduleCallback,Ji=t.unstable_NormalPriority,Yi={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xi(){return{controller:new Ki,data:new Map,refCount:0}}function Zi(e){e.refCount--,e.refCount===0&&qi(Ji,function(){e.controller.abort()})}var Qi=null,$i=0,ea=0,ta=null;function na(e,t){if(Qi===null){var n=Qi=[];$i=0,ea=ld(),ta={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return $i++,t.then(ra,ra),t}function ra(){if(--$i===0&&Qi!==null){ta!==null&&(ta.status=`fulfilled`);var e=Qi;Qi=null,ea=0,ta=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ia(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var aa=P.S;P.S=function(e,t){Zl=me(),typeof t==`object`&&t&&typeof t.then==`function`&&na(e,t),aa!==null&&aa(e,t)};var oa=z(null);function sa(){var e=oa.current;return e===null?Ml.pooledCache:e}function ca(e,t){t===null?V(oa,oa.current):V(oa,t.pool)}function la(){var e=sa();return e===null?null:{parent:Yi._currentValue,pool:e}}var da=Error(a(460)),fa=Error(a(474)),pa=Error(a(542)),ma={then:function(){}};function ha(e){return e=e.status,e===`fulfilled`||e===`rejected`}function ga(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Vt,Vt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,va(e),e;default:if(typeof t.status==`string`)t.then(Vt,Vt);else{if(e=Ml,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,va(e),e}throw Q=t,da}}function Z(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Q=e,da):e}}var Q=null;function _a(){if(Q===null)throw Error(a(459));var e=Q;return Q=null,e}function va(e){if(e===da||e===pa)throw Error(a(483))}var $=null,ya=0;function ba(e){var t=ya;return ya+=1,$===null&&($=[]),ga($,e,t)}function xa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Sa(e,t){throw t.$$typeof===m?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Ca(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Qr(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=ni(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===_?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===E&&Z(a)===t.type)?(t=i(t,n.props),xa(t,n),t.return=e,t):(t=ei(n.type,n.key,n.props,null,e.mode,r),xa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=ii(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=ti(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=ni(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case h:return n=ei(t.type,t.key,t.props,null,e.mode,n),xa(n,t),n.return=e,n;case g:return t=ii(t,e.mode,n),t.return=e,t;case E:return t=Z(t),f(e,t,n)}if(N(t)||A(t))return t=ti(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,ba(t),n);if(t.$$typeof===x)return f(e,Wi(e,t),n);Sa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case h:return n.key===i?l(e,t,n,r):null;case g:return n.key===i?u(e,t,n,r):null;case E:return n=Z(n),p(e,t,n,r)}if(N(n)||A(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,ba(n),r);if(n.$$typeof===x)return p(e,t,Wi(e,n),r);Sa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case h:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case g:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case E:return r=Z(r),m(e,t,n,r,i)}if(N(r)||A(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,ba(r),i);if(r.$$typeof===x)return m(e,t,n,Wi(t,r),i);Sa(t,r)}return null}function v(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Si&&gi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Si&&gi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Si&&gi(i,h),l}function y(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),Si&&gi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Si&&gi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),Si&&gi(i,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&Z(l)===r.type){n(e,r.sibling),c=i(r,o.props),xa(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===_?(c=ti(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=ei(o.type,o.key,o.props,null,e.mode,c),xa(c,o),c.return=e,e=c)}return s(e);case g:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=ii(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=Z(o),b(e,r,o,c)}if(N(o))return v(e,r,o,c);if(A(o)){if(l=A(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,ba(o),c);if(o.$$typeof===x)return b(e,r,Wi(e,o),c);Sa(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=ni(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ya=0;var i=b(e,t,n,r);return $=null,i}catch(t){if(t===da||t===pa)throw t;var a=Xr(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var wa=Ca(!0),Ta=Ca(!1),Ea=!1;function Da(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Oa(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ka(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Aa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,jl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=qr(e),Kr(e,null,n),t}return Ur(e,r,t,n),qr(e)}function ja(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,He(e,n)}}function Ma(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Na=!1;function Pa(){if(Na){var e=ta;if(e!==null)throw e}}function Fa(e,t,n,r){Na=!1;var i=e.updateQueue;Ea=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,m=f!==s.lane;if(m?(Pl&f)===f:(r&f)===f){f!==0&&f===ea&&(Na=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Ea=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Hl|=o,e.lanes=o,e.memoizedState=d}}function Ia(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function La(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ia(n[e],t)}var Ra=z(null),za=z(0);function Ba(e,t){e=Bl,V(za,e),V(Ra,t),Bl=e|t.baseLanes}function Va(){V(za,Bl),V(Ra,Ra.current)}function Ha(){Bl=za.current,B(Ra),B(za)}var Ua=z(null),Wa=null;function Ga(e){var t=e.alternate;V(Xa,Xa.current&1),V(Ua,e),Wa===null&&(t===null||Ra.current!==null||t.memoizedState!==null)&&(Wa=e)}function Ka(e){V(Xa,Xa.current),V(Ua,e),Wa===null&&(Wa=e)}function qa(e){e.tag===22?(V(Xa,Xa.current),V(Ua,e),Wa===null&&(Wa=e)):Ja(e)}function Ja(){V(Xa,Xa.current),V(Ua,Ua.current)}function Ya(e){B(Ua),Wa===e&&(Wa=null),B(Xa)}var Xa=z(0);function Za(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||af(n)||of(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Qa=0,$a=null,eo=null,to=null,no=!1,ro=!1,io=!1,ao=0,oo=0,so=null,co=0;function lo(){throw Error(a(321))}function uo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ur(e[n],t[n]))return!1;return!0}function fo(e,t,n,r,i,a){return Qa=a,$a=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,P.H=e===null||e.memoizedState===null?ks:As,io=!1,a=n(r,i),io=!1,ro&&(a=mo(t,n,r,i)),po(e),a}function po(e){P.H=Os;var t=eo!==null&&eo.next!==null;if(Qa=0,to=eo=$a=null,no=!1,oo=0,so=null,t)throw Error(a(300));e===null||qs||(e=e.dependencies,e!==null&&Vi(e)&&(qs=!0))}function mo(e,t,n,r){$a=e;var i=0;do{if(ro&&(so=null),oo=0,ro=!1,25<=i)throw Error(a(301));if(i+=1,to=eo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}P.H=js,o=t(n,r)}while(ro);return o}function ho(){var e=P.H,t=e.useState()[0];return t=typeof t.then==`function`?So(t):t,e=e.useState()[0],(eo===null?null:eo.memoizedState)!==e&&($a.flags|=1024),t}function go(){var e=ao!==0;return ao=0,e}function _o(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function vo(e){if(no){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}no=!1}Qa=0,to=eo=$a=null,ro=!1,oo=ao=0,so=null}function yo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return to===null?$a.memoizedState=to=e:to=to.next=e,to}function bo(){if(eo===null){var e=$a.alternate;e=e===null?null:e.memoizedState}else e=eo.next;var t=to===null?$a.memoizedState:to.next;if(t!==null)to=t,eo=e;else{if(e===null)throw $a.alternate===null?Error(a(467)):Error(a(310));eo=e,e={memoizedState:eo.memoizedState,baseState:eo.baseState,baseQueue:eo.baseQueue,queue:eo.queue,next:null},to===null?$a.memoizedState=to=e:to=to.next=e}return to}function xo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function So(e){var t=oo;return oo+=1,so===null&&(so=[]),e=ga(so,e,t),t=$a,(to===null?t.memoizedState:to.next)===null&&(t=t.alternate,P.H=t===null||t.memoizedState===null?ks:As),e}function Co(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return So(e);if(e.$$typeof===x)return Ui(e)}throw Error(a(438,String(e)))}function wo(e){var t=null,n=$a.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=$a.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=xo(),$a.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=O;return t.index++,n}function To(e,t){return typeof t==`function`?t(e):t}function Eo(e){return Do(bo(),eo,e)}function Do(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Qa&f)===f:(Pl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ea&&(d=!0);else if((Qa&p)===p){u=u.next,p===ea&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,$a.lanes|=p,Hl|=p;f=u.action,io&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,$a.lanes|=f,Hl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!ur(o,e.memoizedState)&&(qs=!0,d&&(n=ta,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Oo(e){var t=bo(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);ur(o,t.memoizedState)||(qs=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function ko(e,t,n){var r=$a,i=bo(),o=Si;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!ur((eo||i).memoizedState,n);if(s&&(i.memoizedState=n,qs=!0),i=i.queue,es(Mo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||to!==null&&to.memoizedState.tag&1){if(r.flags|=2048,Yo(9,{destroy:void 0},jo.bind(null,r,i,n,t),null),Ml===null)throw Error(a(349));o||Qa&127||Ao(r,t,n)}return n}function Ao(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$a.updateQueue,t===null?(t=xo(),$a.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function jo(e,t,n,r){t.value=n,t.getSnapshot=r,No(t)&&Po(e)}function Mo(e,t,n){return n(function(){No(t)&&Po(e)})}function No(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ur(e,n)}catch{return!0}}function Po(e){var t=Gr(e,2);t!==null&&fu(t,e,2)}function Fo(e){var t=yo();if(typeof e==`function`){var n=e;if(e=n(),io){Te(!0);try{n()}finally{Te(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:To,lastRenderedState:e},t}function Io(e,t,n,r){return e.baseState=n,Do(e,eo,typeof r==`function`?r:To)}function Lo(e,t,n,r,i){if(Ts(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};P.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ro(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ro(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=P.T,o={};P.T=o;try{var s=n(i,r),c=P.S;c!==null&&c(o,s),zo(e,t,s)}catch(n){Vo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),P.T=a}}else try{a=n(i,r),zo(e,t,a)}catch(n){Vo(e,t,n)}}function zo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Bo(e,t,n)},function(n){return Vo(e,t,n)}):Bo(e,t,n)}function Bo(e,t,n){t.status=`fulfilled`,t.value=n,Ho(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ro(e,n)))}function Vo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Ho(t),t=t.next;while(t!==r)}e.action=null}function Ho(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Uo(e,t){return t}function Wo(e,t){if(Si){var n=Ml.formState;if(n!==null){a:{var r=$a;if(Si){if(X){b:{for(var i=X,a=wi;i.nodeType!==8;){if(!a){i=null;break b}if(i=cf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){X=cf(i.nextSibling),r=i.data===`F!`;break a}}Ei(r)}r=!1}r&&(t=n[0])}}return n=yo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Uo,lastRenderedState:t},n.queue=r,n=Ss.bind(null,$a,r),r.dispatch=n,r=Fo(!1),a=ws.bind(null,$a,!1,r.queue),r=yo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Lo.bind(null,$a,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Go(e){return Ko(bo(),eo,e)}function Ko(e,t,n){if(t=Do(e,t,Uo)[0],e=Eo(To)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=So(t)}catch(e){throw e===da?pa:e}else r=t;t=bo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&($a.flags|=2048,Yo(9,{destroy:void 0},qo.bind(null,i,n),null)),[r,a,e]}function qo(e,t){e.action=t}function Jo(e){var t=bo(),n=eo;if(n!==null)return Ko(t,n,e);bo(),t=t.memoizedState,n=bo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Yo(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=$a.updateQueue,t===null&&(t=xo(),$a.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Xo(){return bo().memoizedState}function Zo(e,t,n,r){var i=yo();$a.flags|=e,i.memoizedState=Yo(1|t,{destroy:void 0},n,r===void 0?null:r)}function Qo(e,t,n,r){var i=bo();r=r===void 0?null:r;var a=i.memoizedState.inst;eo!==null&&r!==null&&uo(r,eo.memoizedState.deps)?i.memoizedState=Yo(t,a,n,r):($a.flags|=e,i.memoizedState=Yo(1|t,a,n,r))}function $o(e,t){Zo(8390656,8,e,t)}function es(e,t){Qo(2048,8,e,t)}function ts(e){$a.flags|=4;var t=$a.updateQueue;if(t===null)t=xo(),$a.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ns(e){var t=bo().memoizedState;return ts({ref:t,nextImpl:e}),function(){if(jl&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function rs(e,t){return Qo(4,2,e,t)}function is(e,t){return Qo(4,4,e,t)}function as(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function os(e,t,n){n=n==null?null:n.concat([e]),Qo(4,4,as.bind(null,t,e),n)}function ss(){}function cs(e,t){var n=bo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&uo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function ls(e,t){var n=bo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&uo(t,r[1]))return r[0];if(r=e(),io){Te(!0);try{e()}finally{Te(!1)}}return n.memoizedState=[r,t],r}function us(e,t,n){return n===void 0||Qa&1073741824&&!(Pl&261930)?e.memoizedState=t:(e.memoizedState=n,e=du(),$a.lanes|=e,Hl|=e,n)}function ds(e,t,n,r){return ur(n,t)?n:Ra.current===null?!(Qa&42)||Qa&1073741824&&!(Pl&261930)?(qs=!0,e.memoizedState=n):(e=du(),$a.lanes|=e,Hl|=e,t):(e=us(e,n,r),ur(e,t)||(qs=!0),e)}function fs(e,t,n,r,i){var a=F.p;F.p=a!==0&&8>a?a:8;var o=P.T,s={};P.T=s,ws(e,!1,t,n);try{var c=i(),l=P.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Cs(e,t,ia(c,r),uu(e)):Cs(e,t,r,uu(e))}catch(n){Cs(e,t,{then:function(){},status:`rejected`,reason:n},uu())}finally{F.p=a,o!==null&&s.types!==null&&(o.types=s.types),P.T=o}}function ps(){}function ms(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=hs(e).queue;fs(e,i,t,I,n===null?ps:function(){return gs(e),n(r)})}function hs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:I,baseState:I,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:To,lastRenderedState:I},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:To,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function gs(e){var t=hs(e);t.next===null&&(t=e.alternate.memoizedState),Cs(e,t.next.queue,{},uu())}function _s(){return Ui(Qf)}function vs(){return bo().memoizedState}function ys(){return bo().memoizedState}function bs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=uu();e=ka(n);var r=Aa(t,e,n);r!==null&&(fu(r,t,n),ja(r,t,n)),t={cache:Xi()},e.payload=t;return}t=t.return}}function xs(e,t,n){var r=uu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ts(e)?Es(t,n):(n=Wr(e,t,n,r),n!==null&&(fu(n,e,r),Ds(n,t,r)))}function Ss(e,t,n){Cs(e,t,n,uu())}function Cs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ts(e))Es(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,ur(s,o))return Ur(e,t,i,0),Ml===null&&Hr(),!1}catch{}if(n=Wr(e,t,i,r),n!==null)return fu(n,e,r),Ds(n,t,r),!0}return!1}function ws(e,t,n,r){if(r={lane:2,revertLane:ld(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ts(e)){if(t)throw Error(a(479))}else t=Wr(e,n,r,2),t!==null&&fu(t,e,2)}function Ts(e){var t=e.alternate;return e===$a||t!==null&&t===$a}function Es(e,t){ro=no=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ds(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,He(e,n)}}var Os={readContext:Ui,use:Co,useCallback:lo,useContext:lo,useEffect:lo,useImperativeHandle:lo,useLayoutEffect:lo,useInsertionEffect:lo,useMemo:lo,useReducer:lo,useRef:lo,useState:lo,useDebugValue:lo,useDeferredValue:lo,useTransition:lo,useSyncExternalStore:lo,useId:lo,useHostTransitionStatus:lo,useFormState:lo,useActionState:lo,useOptimistic:lo,useMemoCache:lo,useCacheRefresh:lo};Os.useEffectEvent=lo;var ks={readContext:Ui,use:Co,useCallback:function(e,t){return yo().memoizedState=[e,t===void 0?null:t],e},useContext:Ui,useEffect:$o,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Zo(4194308,4,as.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zo(4194308,4,e,t)},useInsertionEffect:function(e,t){Zo(4,2,e,t)},useMemo:function(e,t){var n=yo();t=t===void 0?null:t;var r=e();if(io){Te(!0);try{e()}finally{Te(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=yo();if(n!==void 0){var i=n(t);if(io){Te(!0);try{n(t)}finally{Te(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=xs.bind(null,$a,e),[r.memoizedState,e]},useRef:function(e){var t=yo();return e={current:e},t.memoizedState=e},useState:function(e){e=Fo(e);var t=e.queue,n=Ss.bind(null,$a,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ss,useDeferredValue:function(e,t){return us(yo(),e,t)},useTransition:function(){var e=Fo(!1);return e=fs.bind(null,$a,e.queue,!0,!1),yo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=$a,i=yo();if(Si){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),Ml===null)throw Error(a(349));Pl&127||Ao(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,$o(Mo.bind(null,r,o,e),[e]),r.flags|=2048,Yo(9,{destroy:void 0},jo.bind(null,r,o,n,t),null),n},useId:function(){var e=yo(),t=Ml.identifierPrefix;if(Si){var n=hi,r=mi;n=(r&~(1<<32-Ee(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=ao++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=co++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:_s,useFormState:Wo,useActionState:Wo,useOptimistic:function(e){var t=yo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=ws.bind(null,$a,!0,n),n.dispatch=t,[e,t]},useMemoCache:wo,useCacheRefresh:function(){return yo().memoizedState=bs.bind(null,$a)},useEffectEvent:function(e){var t=yo(),n={impl:e};return t.memoizedState=n,function(){if(jl&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},As={readContext:Ui,use:Co,useCallback:cs,useContext:Ui,useEffect:es,useImperativeHandle:os,useInsertionEffect:rs,useLayoutEffect:is,useMemo:ls,useReducer:Eo,useRef:Xo,useState:function(){return Eo(To)},useDebugValue:ss,useDeferredValue:function(e,t){return ds(bo(),eo.memoizedState,e,t)},useTransition:function(){var e=Eo(To)[0],t=bo().memoizedState;return[typeof e==`boolean`?e:So(e),t]},useSyncExternalStore:ko,useId:vs,useHostTransitionStatus:_s,useFormState:Go,useActionState:Go,useOptimistic:function(e,t){return Io(bo(),eo,e,t)},useMemoCache:wo,useCacheRefresh:ys};As.useEffectEvent=ns;var js={readContext:Ui,use:Co,useCallback:cs,useContext:Ui,useEffect:es,useImperativeHandle:os,useInsertionEffect:rs,useLayoutEffect:is,useMemo:ls,useReducer:Oo,useRef:Xo,useState:function(){return Oo(To)},useDebugValue:ss,useDeferredValue:function(e,t){var n=bo();return eo===null?us(n,e,t):ds(n,eo.memoizedState,e,t)},useTransition:function(){var e=Oo(To)[0],t=bo().memoizedState;return[typeof e==`boolean`?e:So(e),t]},useSyncExternalStore:ko,useId:vs,useHostTransitionStatus:_s,useFormState:Jo,useActionState:Jo,useOptimistic:function(e,t){var n=bo();return eo===null?(n.baseState=e,[e,n.queue.dispatch]):Io(n,eo,e,t)},useMemoCache:wo,useCacheRefresh:ys};js.useEffectEvent=ns;function Ms(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:p({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ns={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=uu(),i=ka(r);i.payload=t,n!=null&&(i.callback=n),t=Aa(e,i,r),t!==null&&(fu(t,e,r),ja(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=uu(),i=ka(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Aa(e,i,r),t!==null&&(fu(t,e,r),ja(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=uu(),r=ka(n);r.tag=2,t!=null&&(r.callback=t),t=Aa(e,r,n),t!==null&&(fu(t,e,n),ja(t,e,n))}};function Ps(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!dr(n,r)||!dr(i,a):!0}function Fs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ns.enqueueReplaceState(t,t.state,null)}function Is(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=p({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ls(e){Rr(e)}function Rs(e){console.error(e)}function zs(e){Rr(e)}function Bs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Vs(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Hs(e,t,n){return n=ka(n),n.tag=3,n.payload={element:null},n.callback=function(){Bs(e,t)},n}function Us(e){return e=ka(e),e.tag=3,e}function Ws(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Vs(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Vs(t,n,r),typeof i!=`function`&&(eu===null?eu=new Set([this]):eu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Gs(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Bi(t,n,i,!0),n=Ua.current,n!==null){switch(n.tag){case 31:case 13:return Wa===null?wu():n.alternate===null&&Vl===0&&(Vl=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===ma?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Uu(e,r,i)),!1;case 22:return n.flags|=65536,r===ma?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Uu(e,r,i)),!1}throw Error(a(435,n.tag))}return Uu(e,r,i),wu(),!1}if(Si)return t=Ua.current,t===null?(r!==Ti&&(t=Error(a(423),{cause:r}),Mi(oi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=oi(r,n),i=Hs(e.stateNode,r,i),Ma(e,i),Vl!==4&&(Vl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Ti&&(e=Error(a(422),{cause:r}),Mi(oi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=oi(o,n),ql===null?ql=[o]:ql.push(o),Vl!==4&&(Vl=2),t===null)return!0;r=oi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Hs(n.stateNode,r,e),Ma(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(eu===null||!eu.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Us(i),Ws(i,e,n,r),Ma(n,i),!1}n=n.return}while(n!==null);return!1}var Ks=Error(a(461)),qs=!1;function Js(e,t,n,r){t.child=e===null?Ta(t,null,n,r):wa(t,e.child,n,r)}function Ys(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Hi(t),r=fo(e,t,n,o,a,i),s=go(),e!==null&&!qs?(_o(e,t,i),yc(e,t,i)):(Si&&s&&vi(t),t.flags|=1,Js(e,t,r,i),t.child)}function Xs(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Zr(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Zs(e,t,a,r,i)):(e=ei(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!bc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?dr:n,n(o,r)&&e.ref===t.ref)return yc(e,t,i)}return t.flags|=1,e=Qr(a,r),e.ref=t.ref,e.return=t,t.child=e}function Zs(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(dr(a,r)&&e.ref===t.ref)if(qs=!1,t.pendingProps=r=a,bc(e,i))e.flags&131072&&(qs=!0);else return t.lanes=e.lanes,yc(e,t,i)}return ac(e,t,n,r,i)}function Qs(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return ec(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ca(t,a===null?null:a.cachePool),a===null?Va():Ba(t,a),qa(t);else return r=t.lanes=536870912,ec(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ca(t,null),Va(),Ja(t)):(ca(t,a.cachePool),Ba(t,a),Ja(t),t.memoizedState=null);return Js(e,t,i,n),t.child}function $s(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ec(e,t,n,r,i){var a=sa();return a=a===null?null:{parent:Yi._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ca(t,null),Va(),qa(t),e!==null&&Bi(e,t,r,!0),t.childLanes=i,null}function tc(e,t){return t=mc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function nc(e,t,n){return wa(t,e.child,null,n),e=tc(t,t.pendingProps),e.flags|=2,Ya(t),t.memoizedState=null,e}function rc(e,t,n){var r=t.pendingProps,i=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Si){if(r.mode===`hidden`)return e=tc(t,r),t.lanes=536870912,$s(null,e);if(Ka(t),(e=X)?(e=rf(e,wi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pi===null?null:{id:mi,overflow:hi},retryLane:536870912,hydrationErrors:null},n=ri(e),n.return=t,t.child=n,xi=t,X=null)):e=null,e===null)throw Ei(t);return t.lanes=536870912,null}return tc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Ka(t),i)if(t.flags&256)t.flags&=-257,t=nc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558));else if(qs||Bi(e,t,n,!1),i=(n&e.childLanes)!==0,qs||i){if(r=Ml,r!==null&&(s=Ue(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Gr(e,s),fu(r,e,s),Ks;wu(),t=nc(e,t,n)}else e=o.treeContext,X=cf(s.nextSibling),xi=t,Si=!0,Ci=null,wi=!1,e!==null&&bi(t,e),t=tc(t,r),t.flags|=4096;return t}return e=Qr(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ic(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function ac(e,t,n,r,i){return Hi(t),n=fo(e,t,n,r,void 0,i),r=go(),e!==null&&!qs?(_o(e,t,i),yc(e,t,i)):(Si&&r&&vi(t),t.flags|=1,Js(e,t,n,i),t.child)}function oc(e,t,n,r,i,a){return Hi(t),t.updateQueue=null,n=mo(t,r,n,i),po(e),r=go(),e!==null&&!qs?(_o(e,t,a),yc(e,t,a)):(Si&&r&&vi(t),t.flags|=1,Js(e,t,n,a),t.child)}function sc(e,t,n,r,i){if(Hi(t),t.stateNode===null){var a=Jr,o=n.contextType;typeof o==`object`&&o&&(a=Ui(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ns,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Da(t),o=n.contextType,a.context=typeof o==`object`&&o?Ui(o):Jr,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ms(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ns.enqueueReplaceState(a,a.state,null),Fa(t,r,a,i),Pa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Is(n,s);a.props=c;var l=a.context,u=n.contextType;o=Jr,typeof u==`object`&&u&&(o=Ui(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Fs(t,a,r,o),Ea=!1;var f=t.memoizedState;a.state=f,Fa(t,r,a,i),Pa(),l=t.memoizedState,s||f!==l||Ea?(typeof d==`function`&&(Ms(t,n,d,r),l=t.memoizedState),(c=Ea||Ps(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Oa(e,t),o=t.memoizedProps,u=Is(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=Jr,typeof l==`object`&&l&&(c=Ui(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Fs(t,a,r,c),Ea=!1,f=t.memoizedState,a.state=f,Fa(t,r,a,i),Pa();var p=t.memoizedState;o!==d||f!==p||Ea||e!==null&&e.dependencies!==null&&Vi(e.dependencies)?(typeof s==`function`&&(Ms(t,n,s,r),p=t.memoizedState),(u=Ea||Ps(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Vi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,ic(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=wa(t,e.child,null,i),t.child=wa(t,null,n,i)):Js(e,t,n,i),t.memoizedState=a.state,e=t.child):e=yc(e,t,i),e}function cc(e,t,n,r){return Ai(),t.flags|=256,Js(e,t,n,r),t.child}var lc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function uc(e){return{baseLanes:e,cachePool:la()}}function dc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Gl),e}function fc(e,t,n){var r=t.pendingProps,i=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(Xa.current&2)!=0),s&&(i=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Si){if(i?Ga(t):Ja(t),(e=X)?(e=rf(e,wi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:pi===null?null:{id:mi,overflow:hi},retryLane:536870912,hydrationErrors:null},n=ri(e),n.return=t,t.child=n,xi=t,X=null)):e=null,e===null)throw Ei(t);return of(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(Ja(t),i=t.mode,c=mc({mode:`hidden`,children:c},i),r=ti(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=uc(n),r.childLanes=dc(e,s,n),t.memoizedState=lc,$s(null,r)):(Ga(t),pc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(Ga(t),t.flags&=-257,t=hc(e,t,n)):t.memoizedState===null?(Ja(t),c=r.fallback,i=t.mode,r=mc({mode:`visible`,children:r.children},i),c=ti(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,wa(t,e.child,null,n),r=t.child,r.memoizedState=uc(n),r.childLanes=dc(e,s,n),t.memoizedState=lc,t=$s(null,r)):(Ja(t),t.child=e.child,t.flags|=128,t=null);else if(Ga(t),of(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(a(419)),r.stack=``,r.digest=s,Mi({value:r,source:null,stack:null}),t=hc(e,t,n)}else if(qs||Bi(e,t,n,!1),s=(n&e.childLanes)!==0,qs||s){if(s=Ml,s!==null&&(r=Ue(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Gr(e,r),fu(s,e,r),Ks;af(c)||wu(),t=hc(e,t,n)}else af(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,X=cf(c.nextSibling),xi=t,Si=!0,Ci=null,wi=!1,e!==null&&bi(t,e),t=pc(t,r.children),t.flags|=4096);return t}return i?(Ja(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=Qr(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ti(c,i,n,null),c.flags|=2):c=Qr(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,$s(null,r),r=t.child,c=e.child.memoizedState,c===null?c=uc(n):(i=c.cachePool,i===null?i=la():(l=Yi._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=dc(e,s,n),t.memoizedState=lc,$s(e.child,r)):(Ga(t),n=e.child,e=n.sibling,n=Qr(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function pc(e,t){return t=mc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function mc(e,t){return e=Xr(22,e,null,t),e.lanes=0,e}function hc(e,t,n){return wa(t,e.child,null,n),e=pc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function gc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ri(e.return,t,n)}function _c(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function vc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Xa.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,V(Xa,o),Js(e,t,r,n),r=Si?ui:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gc(e,n,t);else if(e.tag===19)gc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Za(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),_c(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Za(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}_c(t,!0,n,null,a,r);break;case`together`:_c(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function yc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Hl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Bi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=Qr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Qr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function bc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Vi(e))):!0}function xc(e,t,n){switch(t.tag){case 3:ee(t,t.stateNode.containerInfo),Ii(t,Yi,e.memoizedState.cache),Ai();break;case 27:case 5:ne(t);break;case 4:ee(t,t.stateNode.containerInfo);break;case 10:Ii(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ka(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(Ga(t),e=yc(e,t,n),e===null?null:e.sibling):fc(e,t,n):(Ga(t),t.flags|=128,null);Ga(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Bi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return vc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),V(Xa,Xa.current),r)break;return null;case 22:return t.lanes=0,Qs(e,t,n,t.pendingProps);case 24:Ii(t,Yi,e.memoizedState.cache)}return yc(e,t,n)}function Sc(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)qs=!0;else{if(!bc(e,n)&&!(t.flags&128))return qs=!1,xc(e,t,n);qs=!!(e.flags&131072)}else qs=!1,Si&&t.flags&1048576&&_i(t,ui,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Z(t.elementType),t.type=e,typeof e==`function`)Zr(e)?(r=Is(e,r),t.tag=1,t=sc(null,t,e,r,n)):(t.tag=0,t=ac(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===S){t.tag=11,t=Ys(null,t,e,r,n);break a}else if(i===T){t.tag=14,t=Xs(null,t,e,r,n);break a}}throw t=M(e)||e,Error(a(306,t,``))}}return t;case 0:return ac(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Is(r,t.pendingProps),sc(e,t,r,i,n);case 3:a:{if(ee(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,Oa(e,t),Fa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ii(t,Yi,r),r!==o.cache&&zi(t,[Yi],n,!0),Pa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=cc(e,t,r,n);break a}else if(r!==i){i=oi(Error(a(424)),t),Mi(i),t=cc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(X=cf(e.firstChild),xi=t,Si=!0,Ci=null,wi=!0,n=Ta(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ai(),r===i){t=yc(e,t,n);break a}Js(e,t,r,n)}t=t.child}return t;case 26:return ic(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:Si||(n=t.type,e=t.pendingProps,r=Bd(W.current).createElement(n),r[Ye]=t,r[Xe]=e,Pd(r,n,e),ct(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ne(t),e===null&&Si&&(r=t.stateNode=ff(t.type,t.pendingProps,W.current),xi=t,wi=!0,i=X,Zd(t.type)?(lf=i,X=cf(r.firstChild)):X=i),Js(e,t,t.pendingProps.children,n),ic(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Si&&((i=r=X)&&(r=tf(r,t.type,t.pendingProps,wi),r===null?i=!1:(t.stateNode=r,xi=t,X=cf(r.firstChild),wi=!1,i=!0)),i||Ei(t)),ne(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Ud(i,o)?r=null:s!==null&&Ud(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=fo(e,t,ho,null,null,n),Qf._currentValue=i),ic(e,t),Js(e,t,r,n),t.child;case 6:return e===null&&Si&&((e=n=X)&&(n=nf(n,t.pendingProps,wi),n===null?e=!1:(t.stateNode=n,xi=t,X=null,e=!0)),e||Ei(t)),null;case 13:return fc(e,t,n);case 4:return ee(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=wa(t,null,r,n):Js(e,t,r,n),t.child;case 11:return Ys(e,t,t.type,t.pendingProps,n);case 7:return Js(e,t,t.pendingProps,n),t.child;case 8:return Js(e,t,t.pendingProps.children,n),t.child;case 12:return Js(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ii(t,t.type,r.value),Js(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Hi(t),i=Ui(i),r=r(i),t.flags|=1,Js(e,t,r,n),t.child;case 14:return Xs(e,t,t.type,t.pendingProps,n);case 15:return Zs(e,t,t.type,t.pendingProps,n);case 19:return vc(e,t,n);case 31:return rc(e,t,n);case 22:return Qs(e,t,n,t.pendingProps);case 24:return Hi(t),r=Ui(Yi),e===null?(i=sa(),i===null&&(i=Ml,o=Xi(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},Da(t),Ii(t,Yi,i)):((e.lanes&n)!==0&&(Oa(e,t),Fa(t,null,null,n),Pa()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Ii(t,Yi,r),r!==i.cache&&zi(t,[Yi],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ii(t,Yi,r))),Js(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function Cc(e){e.flags|=4}function wc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(xu())e.flags|=8192;else throw Q=ma,fa}else e.flags&=-16777217}function Tc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t))if(xu())e.flags|=8192;else throw Q=ma,fa}function Ec(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Le(),e.lanes|=t,Kl|=t)}function Dc(e,t){if(!Si)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Oc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function kc(e,t,n){var r=t.pendingProps;switch(yi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Oc(t),null;case 1:return Oc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Li(Yi),te(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ki(t)?Cc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,ji())),Oc(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(Cc(t),o===null?(Oc(t),wc(t,i,null,r,n)):(Oc(t),Tc(t,o))):o?o===e.memoizedState?(Oc(t),t.flags&=-16777217):(Cc(t),Oc(t),Tc(t,o)):(e=e.memoizedProps,e!==r&&Cc(t),Oc(t),wc(t,i,e,r,n)),null;case 27:if(re(t),n=W.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Cc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Oc(t),null}e=H.current,ki(t)?Di(t,e):(e=ff(i,r,n),t.stateNode=e,Cc(t))}return Oc(t),null;case 5:if(re(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Cc(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return Oc(t),null}if(o=H.current,ki(t))Di(t,o);else{var s=Bd(W.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[Ye]=t,o[Xe]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Pd(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Cc(t)}}return Oc(t),wc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Cc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=W.current,ki(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=xi,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Ye]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||jd(e.nodeValue,n)),e||Ei(t,!0)}else e=Bd(e).createTextNode(r),e[Ye]=t,t.stateNode=e}return Oc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ki(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[Ye]=t}else Ai(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Oc(t),e=!1}else n=ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ya(t),t):(Ya(t),null);if(t.flags&128)throw Error(a(558))}return Oc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ki(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[Ye]=t}else Ai(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Oc(t),i=!1}else i=ji(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Ya(t),t):(Ya(t),null)}return Ya(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Ec(t,t.updateQueue),Oc(t),null);case 4:return te(),e===null&&xd(t.stateNode.containerInfo),Oc(t),null;case 10:return Li(t.type),Oc(t),null;case 19:if(B(Xa),r=t.memoizedState,r===null)return Oc(t),null;if(i=(t.flags&128)!=0,o=r.rendering,o===null)if(i)Dc(r,!1);else{if(Vl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Za(e),o!==null){for(t.flags|=128,Dc(r,!1),e=o.updateQueue,t.updateQueue=e,Ec(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)$r(n,e),n=n.sibling;return V(Xa,Xa.current&1|2),Si&&gi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&me()>Ql&&(t.flags|=128,i=!0,Dc(r,!1),t.lanes=4194304)}else{if(!i)if(e=Za(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Ec(t,e),Dc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Si)return Oc(t),null}else 2*me()-r.renderingStartTime>Ql&&n!==536870912&&(t.flags|=128,i=!0,Dc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Oc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=me(),e.sibling=null,n=Xa.current,V(Xa,i?n&1|2:n&1),Si&&gi(t,r.treeForkCount),e);case 22:case 23:return Ya(t),Ha(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Oc(t),t.subtreeFlags&6&&(t.flags|=8192)):Oc(t),n=t.updateQueue,n!==null&&Ec(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&B(oa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Li(Yi),Oc(t),null;case 25:return null;case 30:return null}throw Error(a(156,t.tag))}function Ac(e,t){switch(yi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Li(Yi),te(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return re(t),null;case 31:if(t.memoizedState!==null){if(Ya(t),t.alternate===null)throw Error(a(340));Ai()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ya(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Ai()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(Xa),null;case 4:return te(),null;case 10:return Li(t.type),null;case 22:case 23:return Ya(t),Ha(),e!==null&&B(oa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Li(Yi),null;case 25:return null;default:return null}}function jc(e,t){switch(yi(t),t.tag){case 3:Li(Yi),te();break;case 26:case 27:case 5:re(t);break;case 4:te();break;case 31:t.memoizedState!==null&&Ya(t);break;case 13:Ya(t);break;case 19:B(Xa);break;case 10:Li(t.type);break;case 22:case 23:Ya(t),Ha(),e!==null&&B(oa);break;case 24:Li(Yi)}}function Mc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Hu(t,t.return,e)}}function Nc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Hu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Hu(t,t.return,e)}}function Pc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{La(t,n)}catch(t){Hu(e,e.return,t)}}}function Fc(e,t,n){n.props=Is(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Hu(e,t,n)}}function Ic(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Hu(e,t,n)}}function Lc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Hu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Hu(e,t,n)}else n.current=null}function Rc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Hu(e,e.return,t)}}function zc(e,t,n){try{var r=e.stateNode;Fd(r,e.type,n,t),r[Xe]=t}catch(t){Hu(e,e.return,t)}}function Bc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Zd(e.type)||e.tag===4}function Vc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Bc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Zd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Hc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Vt));else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Hc(e,t,n),e=e.sibling;e!==null;)Hc(e,t,n),e=e.sibling}function Uc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Zd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Uc(e,t,n),e=e.sibling;e!==null;)Uc(e,t,n),e=e.sibling}function Wc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Pd(t,r,n),t[Ye]=e,t[Xe]=n}catch(t){Hu(e,e.return,t)}}var Gc=!1,Kc=!1,qc=!1,Jc=typeof WeakSet==`function`?WeakSet:Set,Yc=null;function Xc(e,t){if(e=e.containerInfo,Rd=sp,e=hr(e),gr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(zd={focusedElem:e,selectionRange:n},sp=!1,Yc=t;Yc!==null;)if(t=Yc,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,Yc=e;else for(;Yc!==null;){switch(t=Yc,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,i=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Is(n.type,i);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Hu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)ef(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:ef(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(a(163))}if(e=t.sibling,e!==null){e.return=t.return,Yc=e;break}Yc=t.return}}function Zc(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:fl(e,n),r&4&&Mc(5,n);break;case 1:if(fl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Hu(n,n.return,e)}else{var i=Is(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Hu(n,n.return,e)}}r&64&&Pc(n),r&512&&Ic(n,n.return);break;case 3:if(fl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{La(e,t)}catch(e){Hu(n,n.return,e)}}break;case 27:t===null&&r&4&&Wc(n);case 26:case 5:fl(e,n),t===null&&r&4&&Rc(n),r&512&&Ic(n,n.return);break;case 12:fl(e,n);break;case 31:fl(e,n),r&4&&rl(e,n);break;case 13:fl(e,n),r&4&&il(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Ku.bind(null,n),sf(e,n))));break;case 22:if(r=n.memoizedState!==null||Gc,!r){t=t!==null&&t.memoizedState!==null||Kc,i=Gc;var a=Kc;Gc=r,(Kc=t)&&!a?ml(e,n,(n.subtreeFlags&8772)!=0):fl(e,n),Gc=i,Kc=a}break;case 30:break;default:fl(e,n)}}function Qc(e){var t=e.alternate;t!==null&&(e.alternate=null,Qc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&rt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var $c=null,el=!1;function tl(e,t,n){for(n=n.child;n!==null;)nl(e,t,n),n=n.sibling}function nl(e,t,n){if(we&&typeof we.onCommitFiberUnmount==`function`)try{we.onCommitFiberUnmount(Ce,n)}catch{}switch(n.tag){case 26:Kc||Lc(n,t),tl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Kc||Lc(n,t);var r=$c,i=el;Zd(n.type)&&($c=n.stateNode,el=!1),tl(e,t,n),pf(n.stateNode),$c=r,el=i;break;case 5:Kc||Lc(n,t);case 6:if(r=$c,i=el,$c=null,tl(e,t,n),$c=r,el=i,$c!==null)if(el)try{($c.nodeType===9?$c.body:$c.nodeName===`HTML`?$c.ownerDocument.body:$c).removeChild(n.stateNode)}catch(e){Hu(n,t,e)}else try{$c.removeChild(n.stateNode)}catch(e){Hu(n,t,e)}break;case 18:$c!==null&&(el?(e=$c,Qd(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):Qd($c,n.stateNode));break;case 4:r=$c,i=el,$c=n.stateNode.containerInfo,el=!0,tl(e,t,n),$c=r,el=i;break;case 0:case 11:case 14:case 15:Nc(2,n,t),Kc||Nc(4,n,t),tl(e,t,n);break;case 1:Kc||(Lc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Fc(n,t,r)),tl(e,t,n);break;case 21:tl(e,t,n);break;case 22:Kc=(r=Kc)||n.memoizedState!==null,tl(e,t,n),Kc=r;break;default:tl(e,t,n)}}function rl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){Hu(t,t.return,e)}}}function il(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){Hu(t,t.return,e)}}function al(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Jc),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Jc),t;default:throw Error(a(435,e.tag))}}function ol(e,t){var n=al(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=qu.bind(null,e,t);t.then(r,r)}})}function sl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Zd(c.type)){$c=c.stateNode,el=!1;break a}break;case 5:$c=c.stateNode,el=!1;break a;case 3:case 4:$c=c.stateNode.containerInfo,el=!0;break a}c=c.return}if($c===null)throw Error(a(160));nl(o,s,i),$c=null,el=!1,o=i.alternate,o!==null&&(o.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)ll(t,e),t=t.sibling}var cl=null;function ll(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:sl(t,e),ul(e),r&4&&(Nc(3,e,e.return),Mc(3,e),Nc(5,e,e.return));break;case 1:sl(t,e),ul(e),r&512&&(Kc||n===null||Lc(n,n.return)),r&64&&Gc&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=cl;if(sl(t,e),ul(e),r&512&&(Kc||n===null||Lc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:o=i.getElementsByTagName(`title`)[0],(!o||o[nt]||o[Ye]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=i.createElement(r),i.head.insertBefore(o,i.querySelector(`head > title`))),Pd(o,r,n),o[Ye]=e,ct(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=i.createElement(r),Pd(o,r,n),i.head.appendChild(o);break;default:throw Error(a(468,r))}o[Ye]=e,ct(o),r=o}e.stateNode=r}else Hf(i,e.type,e.stateNode);else e.stateNode=If(i,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&zc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(i,e.type,e.stateNode):If(i,r,e.memoizedProps))}break;case 27:sl(t,e),ul(e),r&512&&(Kc||n===null||Lc(n,n.return)),n!==null&&r&4&&zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(sl(t,e),ul(e),r&512&&(Kc||n===null||Lc(n,n.return)),e.flags&32){i=e.stateNode;try{Y(i,``)}catch(t){Hu(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,zc(e,i,n===null?i:n.memoizedProps)),r&1024&&(qc=!0);break;case 6:if(sl(t,e),ul(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Hu(e,e.return,t)}}break;case 3:if(Bf=null,i=cl,cl=gf(t.containerInfo),sl(t,e),cl=i,ul(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){Hu(e,e.return,t)}qc&&(qc=!1,dl(e));break;case 4:r=cl,cl=gf(e.stateNode.containerInfo),sl(t,e),ul(e),cl=r;break;case 12:sl(t,e),ul(e);break;case 31:sl(t,e),ul(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ol(e,r)));break;case 13:sl(t,e),ul(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Xl=me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ol(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=Gc,d=Kc;if(Gc=u||i,Kc=d||l,sl(t,e),Kc=d,Gc=u,ul(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||Gc||Kc||pl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,i)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Hu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Hu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?$d(m,!0):$d(l.stateNode,!1)}catch(e){Hu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ol(e,n))));break;case 19:sl(t,e),ul(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ol(e,r)));break;case 30:break;case 21:break;default:sl(t,e),ul(e)}}function ul(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Bc(r)){n=r;break}r=r.return}if(n==null)throw Error(a(160));switch(n.tag){case 27:var i=n.stateNode;Uc(e,Vc(e),i);break;case 5:var o=n.stateNode;n.flags&32&&(Y(o,``),n.flags&=-33),Uc(e,Vc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Hc(e,Vc(e),s);break;default:throw Error(a(161))}}catch(t){Hu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;dl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function fl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Zc(e,t.alternate,t),t=t.sibling}function pl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Nc(4,t,t.return),pl(t);break;case 1:Lc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Fc(t,t.return,n),pl(t);break;case 27:pf(t.stateNode);case 26:case 5:Lc(t,t.return),pl(t);break;case 22:t.memoizedState===null&&pl(t);break;case 30:pl(t);break;default:pl(t)}e=e.sibling}}function ml(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:ml(i,a,n),Mc(4,a);break;case 1:if(ml(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Hu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ia(c[i],s)}catch(e){Hu(r,r.return,e)}}n&&o&64&&Pc(a),Ic(a,a.return);break;case 27:Wc(a);case 26:case 5:ml(i,a,n),n&&r===null&&o&4&&Rc(a),Ic(a,a.return);break;case 12:ml(i,a,n);break;case 31:ml(i,a,n),n&&o&4&&rl(i,a);break;case 13:ml(i,a,n),n&&o&4&&il(i,a);break;case 22:a.memoizedState===null&&ml(i,a,n),Ic(a,a.return);break;case 30:break;default:ml(i,a,n)}t=t.sibling}}function hl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Zi(n))}function gl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Zi(e))}function _l(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)vl(e,t,n,r),t=t.sibling}function vl(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:_l(e,t,n,r),i&2048&&Mc(9,t);break;case 1:_l(e,t,n,r);break;case 3:_l(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Zi(e)));break;case 12:if(i&2048){_l(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Hu(t,t.return,e)}}else _l(e,t,n,r);break;case 31:_l(e,t,n,r);break;case 13:_l(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?_l(e,t,n,r):(a._visibility|=2,yl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?_l(e,t,n,r):bl(e,t),i&2048&&hl(o,t);break;case 24:_l(e,t,n,r),i&2048&&gl(t.alternate,t);break;default:_l(e,t,n,r)}}function yl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:yl(a,o,s,c,i),Mc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,yl(a,o,s,c,i)):u._visibility&2?yl(a,o,s,c,i):bl(a,o),i&&l&2048&&hl(o.alternate,o);break;case 24:yl(a,o,s,c,i),i&&l&2048&&gl(o.alternate,o);break;default:yl(a,o,s,c,i)}t=t.sibling}}function bl(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:bl(n,r),i&2048&&hl(r.alternate,r);break;case 24:bl(n,r),i&2048&&gl(r.alternate,r);break;default:bl(n,r)}t=t.sibling}}var xl=8192;function Sl(e,t,n){if(e.subtreeFlags&xl)for(e=e.child;e!==null;)Cl(e,t,n),e=e.sibling}function Cl(e,t,n){switch(e.tag){case 26:Sl(e,t,n),e.flags&xl&&e.memoizedState!==null&&Gf(n,cl,e.memoizedState,e.memoizedProps);break;case 5:Sl(e,t,n);break;case 3:case 4:var r=cl;cl=gf(e.stateNode.containerInfo),Sl(e,t,n),cl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=xl,xl=16777216,Sl(e,t,n),xl=r):Sl(e,t,n));break;default:Sl(e,t,n)}}function wl(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Tl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Yc=r,Ol(r,e)}wl(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)El(e),e=e.sibling}function El(e){switch(e.tag){case 0:case 11:case 15:Tl(e),e.flags&2048&&Nc(9,e,e.return);break;case 3:Tl(e);break;case 12:Tl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Dl(e)):Tl(e);break;default:Tl(e)}}function Dl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Yc=r,Ol(r,e)}wl(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Nc(8,t,t.return),Dl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Dl(t));break;default:Dl(t)}e=e.sibling}}function Ol(e,t){for(;Yc!==null;){var n=Yc;switch(n.tag){case 0:case 11:case 15:Nc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Zi(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Yc=r;else a:for(n=e;Yc!==null;){r=Yc;var i=r.sibling,a=r.return;if(Qc(r),r===n){Yc=null;break a}if(i!==null){i.return=a,Yc=i;break a}Yc=a}}}var kl={getCacheForType:function(e){var t=Ui(Yi),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ui(Yi).controller.signal}},Al=typeof WeakMap==`function`?WeakMap:Map,jl=0,Ml=null,Nl=null,Pl=0,Fl=0,Il=null,Ll=!1,Rl=!1,zl=!1,Bl=0,Vl=0,Hl=0,Ul=0,Wl=0,Gl=0,Kl=0,ql=null,Jl=null,Yl=!1,Xl=0,Zl=0,Ql=1/0,$l=null,eu=null,tu=0,nu=null,ru=null,iu=0,au=0,ou=null,su=null,cu=0,lu=null;function uu(){return jl&2&&Pl!==0?Pl&-Pl:P.T===null?Ke():ld()}function du(){if(Gl===0)if(!(Pl&536870912)||Si){var e=je;je<<=1,!(je&3932160)&&(je=262144),Gl=e}else Gl=536870912;return e=Ua.current,e!==null&&(e.flags|=32),Gl}function fu(e,t,n){(e===Ml&&(Fl===2||Fl===9)||e.cancelPendingCommit!==null)&&(yu(e,0),gu(e,Pl,Gl,!1)),ze(e,n),(!(jl&2)||e!==Ml)&&(e===Ml&&(!(jl&2)&&(Ul|=n),Vl===4&&gu(e,Pl,Gl,!1)),td(e))}function pu(e,t,n){if(jl&6)throw Error(a(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||Fe(e,t),i=r?Du(e,t):Tu(e,t,!0),o=r;do{if(i===0){Rl&&!r&&gu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!hu(n)){i=Tu(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=ql;var l=c.current.memoizedState.isDehydrated;if(l&&(yu(c,s).flags|=256),s=Tu(c,s,!1),s!==2){if(zl&&!l){c.errorRecoveryDisabledLanes|=o,Ul|=o,i=4;break a}o=Jl,Jl=i,o!==null&&(Jl===null?Jl=o:Jl.push.apply(Jl,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){yu(e,0),gu(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t)break;case 6:gu(r,t,Gl,!Ll);break a;case 2:Jl=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=Xl+300-me(),10<i)){if(gu(r,t,Gl,!Ll),Pe(r,0,!0)!==0)break a;iu=t,r.timeoutHandle=Kd(mu.bind(null,r,n,Jl,$l,Yl,t,Gl,Ul,Kl,Ll,o,`Throttled`,-0,0),i);break a}mu(r,n,Jl,$l,Yl,t,Gl,Ul,Kl,Ll,o,null,-0,0)}}break}while(1);td(e)}function mu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vt},Cl(t,a,d);var m=(a&62914560)===a?Xl-me():(a&4194048)===a?Zl-me():0;if(m=qf(d,m),m!==null){iu=a,e.cancelPendingCommit=m(Pu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),gu(e,a,o,!l);return}}Pu(e,t,a,n,r,i,o,s,c)}function hu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!ur(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gu(e,t,n,r){t&=~Wl,t&=~Ul,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ee(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Ve(e,n,t)}function _u(){return jl&6?!0:(nd(0,!1),!1)}function vu(){if(Nl!==null){if(Fl===0)var e=Nl.return;else e=Nl,Fi=Pi=null,vo(e),$=null,ya=0,e=Nl;for(;e!==null;)jc(e.alternate,e),e=e.return;Nl=null}}function yu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,qd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),iu=0,vu(),Ml=e,Nl=n=Qr(e.current,null),Pl=t,Fl=0,Il=null,Ll=!1,Rl=Fe(e,t),zl=!1,Kl=Gl=Wl=Ul=Hl=Vl=0,Jl=ql=null,Yl=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ee(r),a=1<<i;t|=e[i],r&=~a}return Bl=t,Hr(),n}function bu(e,t){$a=null,P.H=Os,t===da||t===pa?(t=_a(),Fl=3):t===fa?(t=_a(),Fl=4):Fl=t===Ks?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Il=t,Nl===null&&(Vl=1,Bs(e,oi(t,e.current)))}function xu(){var e=Ua.current;return e===null?!0:(Pl&4194048)===Pl?Wa===null:(Pl&62914560)===Pl||Pl&536870912?e===Wa:!1}function Su(){var e=P.H;return P.H=Os,e===null?Os:e}function Cu(){var e=P.A;return P.A=kl,e}function wu(){Vl=4,Ll||(Pl&4194048)!==Pl&&Ua.current!==null||(Rl=!0),!(Hl&134217727)&&!(Ul&134217727)||Ml===null||gu(Ml,Pl,Gl,!1)}function Tu(e,t,n){var r=jl;jl|=2;var i=Su(),a=Cu();(Ml!==e||Pl!==t)&&($l=null,yu(e,t)),t=!1;var o=Vl;a:do try{if(Fl!==0&&Nl!==null){var s=Nl,c=Il;switch(Fl){case 8:vu(),o=6;break a;case 3:case 2:case 9:case 6:Ua.current===null&&(t=!0);var l=Fl;if(Fl=0,Il=null,ju(e,s,c,l),n&&Rl){o=0;break a}break;default:l=Fl,Fl=0,Il=null,ju(e,s,c,l)}}Eu(),o=Vl;break}catch(t){bu(e,t)}while(1);return t&&e.shellSuspendCounter++,Fi=Pi=null,jl=r,P.H=i,P.A=a,Nl===null&&(Ml=null,Pl=0,Hr()),o}function Eu(){for(;Nl!==null;)ku(Nl)}function Du(e,t){var n=jl;jl|=2;var r=Su(),i=Cu();Ml!==e||Pl!==t?($l=null,Ql=me()+500,yu(e,t)):Rl=Fe(e,t);a:do try{if(Fl!==0&&Nl!==null){t=Nl;var o=Il;b:switch(Fl){case 1:Fl=0,Il=null,ju(e,t,o,1);break;case 2:case 9:if(ha(o)){Fl=0,Il=null,Au(t);break}t=function(){Fl!==2&&Fl!==9||Ml!==e||(Fl=7),td(e)},o.then(t,t);break a;case 3:Fl=7;break a;case 4:Fl=5;break a;case 7:ha(o)?(Fl=0,Il=null,Au(t)):(Fl=0,Il=null,ju(e,t,o,7));break;case 5:var s=null;switch(Nl.tag){case 26:s=Nl.memoizedState;case 5:case 27:var c=Nl;if(s?Wf(s):c.stateNode.complete){Fl=0,Il=null;var l=c.sibling;if(l!==null)Nl=l;else{var u=c.return;u===null?Nl=null:(Nl=u,Mu(u))}break b}}Fl=0,Il=null,ju(e,t,o,5);break;case 6:Fl=0,Il=null,ju(e,t,o,6);break;case 8:vu(),Vl=6;break a;default:throw Error(a(462))}}Ou();break}catch(t){bu(e,t)}while(1);return Fi=Pi=null,P.H=r,P.A=i,jl=n,Nl===null?(Ml=null,Pl=0,Hr(),Vl):0}function Ou(){for(;Nl!==null&&!fe();)ku(Nl)}function ku(e){var t=Sc(e.alternate,e,Bl);e.memoizedProps=e.pendingProps,t===null?Mu(e):Nl=t}function Au(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=oc(n,t,t.pendingProps,t.type,void 0,Pl);break;case 11:t=oc(n,t,t.pendingProps,t.type.render,t.ref,Pl);break;case 5:vo(t);default:jc(n,t),t=Nl=$r(t,Bl),t=Sc(n,t,Bl)}e.memoizedProps=e.pendingProps,t===null?Mu(e):Nl=t}function ju(e,t,n,r){Fi=Pi=null,vo(t),$=null,ya=0;var i=t.return;try{if(Gs(e,i,t,n,Pl)){Vl=1,Bs(e,oi(n,e.current)),Nl=null;return}}catch(t){if(i!==null)throw Nl=i,t;Vl=1,Bs(e,oi(n,e.current)),Nl=null;return}t.flags&32768?(Si||r===1?e=!0:Rl||Pl&536870912?e=!1:(Ll=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ua.current,r!==null&&r.tag===13&&(r.flags|=16384))),Nu(t,e)):Mu(t)}function Mu(e){var t=e;do{if(t.flags&32768){Nu(t,Ll);return}e=t.return;var n=kc(t.alternate,t,Bl);if(n!==null){Nl=n;return}if(t=t.sibling,t!==null){Nl=t;return}Nl=t=e}while(t!==null);Vl===0&&(Vl=5)}function Nu(e,t){do{var n=Ac(e.alternate,e);if(n!==null){n.flags&=32767,Nl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Nl=e;return}Nl=e=n}while(e!==null);Vl=6,Nl=null}function Pu(e,t,n,r,i,o,s,c,l){e.cancelPendingCommit=null;do zu();while(tu!==0);if(jl&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));if(o=t.lanes|t.childLanes,o|=Vr,Be(e,n,o,s,c,l),e===Ml&&(Nl=Ml=null,Pl=0),ru=t,nu=e,iu=n,au=o,ou=i,su=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Ju(ve,function(){return Bu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=P.T,P.T=null,i=F.p,F.p=2,s=jl,jl|=4;try{Xc(e,t,n)}finally{jl=s,F.p=i,P.T=r}}tu=1,Fu(),Iu(),Lu()}}function Fu(){if(tu===1){tu=0;var e=nu,t=ru,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=jl;jl|=4;try{ll(t,e);var a=zd,o=hr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&mr(s.ownerDocument.documentElement,s)){if(c!==null&&gr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=pr(s,h),v=pr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!Rd,zd=Rd=null}finally{jl=i,F.p=r,P.T=n}}e.current=t,tu=2}}function Iu(){if(tu===2){tu=0;var e=nu,t=ru,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=P.T,P.T=null;var r=F.p;F.p=2;var i=jl;jl|=4;try{Zc(e,t.alternate,t)}finally{jl=i,F.p=r,P.T=n}}tu=3}}function Lu(){if(tu===4||tu===3){tu=0,pe();var e=nu,t=ru,n=iu,r=su;t.subtreeFlags&10256||t.flags&10256?tu=5:(tu=0,ru=nu=null,Ru(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(eu=null),Ge(n),t=t.stateNode,we&&typeof we.onCommitFiberRoot==`function`)try{we.onCommitFiberRoot(Ce,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=P.T,i=F.p,F.p=2,P.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{P.T=t,F.p=i}}iu&3&&zu(),td(e),i=e.pendingLanes,n&261930&&i&42?e===lu?cu++:(cu=0,lu=e):cu=0,nd(0,!1)}}function Ru(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Zi(t)))}function zu(){return Fu(),Iu(),Lu(),Bu()}function Bu(){if(tu!==5)return!1;var e=nu,t=au;au=0;var n=Ge(iu),r=P.T,i=F.p;try{F.p=32>n?32:n,P.T=null,n=ou,ou=null;var o=nu,s=iu;if(tu=0,ru=nu=null,iu=0,jl&6)throw Error(a(331));var c=jl;if(jl|=4,El(o.current),vl(o,o.current,s,n),jl=c,nd(0,!1),we&&typeof we.onPostCommitFiberRoot==`function`)try{we.onPostCommitFiberRoot(Ce,o)}catch{}return!0}finally{F.p=i,P.T=r,Ru(e,t)}}function Vu(e,t,n){t=oi(n,t),t=Hs(e.stateNode,t,2),e=Aa(e,t,2),e!==null&&(ze(e,2),td(e))}function Hu(e,t,n){if(e.tag===3)Vu(e,e,n);else for(;t!==null;){if(t.tag===3){Vu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(eu===null||!eu.has(r))){e=oi(n,e),n=Us(2),r=Aa(t,n,2),r!==null&&(Ws(n,r,t,e),ze(r,2),td(r));break}}t=t.return}}function Uu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Al;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(zl=!0,i.add(n),e=Wu.bind(null,e,t,n),t.then(e,e))}function Wu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ml===e&&(Pl&n)===n&&(Vl===4||Vl===3&&(Pl&62914560)===Pl&&300>me()-Xl?!(jl&2)&&yu(e,0):Wl|=n,Kl===Pl&&(Kl=0)),td(e)}function Gu(e,t){t===0&&(t=Le()),e=Gr(e,t),e!==null&&(ze(e,t),td(e))}function Ku(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Gu(e,n)}function qu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Gu(e,n)}function Ju(e,t){return q(e,t)}var Yu=null,Xu=null,Zu=!1,Qu=!1,$u=!1,ed=0;function td(e){e!==Xu&&e.next===null&&(Xu===null?Yu=Xu=e:Xu=Xu.next=e),Qu=!0,Zu||(Zu=!0,cd())}function nd(e,t){if(!$u&&Qu){$u=!0;do for(var n=!1,r=Yu;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ee(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,sd(r,a))}else a=Pl,a=Pe(r,r===Ml?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Fe(r,a)||(n=!0,sd(r,a));r=r.next}while(n);$u=!1}}function rd(){id()}function id(){Qu=Zu=!1;var e=0;ed!==0&&Gd()&&(e=ed);for(var t=me(),n=null,r=Yu;r!==null;){var i=r.next,a=ad(r,t);a===0?(r.next=null,n===null?Yu=i:n.next=i,i===null&&(Xu=n)):(n=r,(e!==0||a&3)&&(Qu=!0)),r=i}tu!==0&&tu!==5||nd(e,!1),ed!==0&&(ed=0)}function ad(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ee(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ie(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Ml,n=Pl,n=Pe(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Fl===2||Fl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&de(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Fe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&de(r),Ge(n)){case 2:case 8:n=_e;break;case 32:n=ve;break;case 268435456:n=be;break;default:n=ve}return r=od.bind(null,e),n=q(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&de(r),e.callbackPriority=2,e.callbackNode=null,2}function od(e,t){if(tu!==0&&tu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(zu()&&e.callbackNode!==n)return null;var r=Pl;return r=Pe(e,e===Ml?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(pu(e,r,t),ad(e,me()),e.callbackNode!=null&&e.callbackNode===n?od.bind(null,e):null)}function sd(e,t){if(zu())return null;pu(e,t,!0)}function cd(){Yd(function(){jl&6?q(ge,rd):id()})}function ld(){if(ed===0){var e=ea;e===0&&(e=Ae,Ae<<=1,!(Ae&261888)&&(Ae=256)),ed=e}return ed}function ud(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Bt(``+e)}function dd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function fd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=ud((i[Xe]||null).action),o=r.submitter;o&&(t=(t=o[Xe]||null)?ud(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new ln(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ed!==0){var e=o?dd(i,o):new FormData(i);ms(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?dd(i,o):new FormData(i),ms(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var pd=0;pd<Ir.length;pd++){var md=Ir[pd];Lr(md.toLowerCase(),`on`+(md[0].toUpperCase()+md.slice(1)))}Lr(Or,`onAnimationEnd`),Lr(kr,`onAnimationIteration`),Lr(Ar,`onAnimationStart`),Lr(`dblclick`,`onDoubleClick`),Lr(`focusin`,`onFocus`),Lr(`focusout`,`onBlur`),Lr(jr,`onTransitionRun`),Lr(Mr,`onTransitionStart`),Lr(Nr,`onTransitionCancel`),Lr(Pr,`onTransitionEnd`),ft(`onMouseEnter`,[`mouseout`,`mouseover`]),ft(`onMouseLeave`,[`mouseout`,`mouseover`]),ft(`onPointerEnter`,[`pointerout`,`pointerover`]),ft(`onPointerLeave`,[`pointerout`,`pointerover`]),dt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),dt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),dt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),dt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),dt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),dt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var hd=`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(` `),gd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(hd));function _d(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Rr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Rr(e)}i.currentTarget=null,a=c}}}}function vd(e,t){var n=t[Qe];n===void 0&&(n=t[Qe]=new Set);var r=e+`__bubble`;n.has(r)||(Sd(t,e,2,!1),n.add(r))}function yd(e,t,n){var r=0;t&&(r|=4),Sd(n,e,r,t)}var bd=`_reactListening`+Math.random().toString(36).slice(2);function xd(e){if(!e[bd]){e[bd]=!0,lt.forEach(function(t){t!==`selectionchange`&&(gd.has(t)||yd(t,!1,e),yd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bd]||(t[bd]=!0,yd(`selectionchange`,!1,t))}}function Sd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!Zt||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Cd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=it(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}Jt(function(){var r=a,i=Ut(n),o=[];a:{var c=Fr.get(e);if(c!==void 0){var l=ln,u=e;switch(e){case`keypress`:if(rn(n)===0)break a;case`keydown`:case`keyup`:l=Dn;break;case`focusin`:u=`focus`,l=vn;break;case`focusout`:u=`blur`,l=vn;break;case`beforeblur`:case`afterblur`:l=vn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=gn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=_n;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=kn;break;case Or:case kr:case Ar:l=yn;break;case Pr:l=An;break;case`scroll`:case`scrollend`:l=dn;break;case`wheel`:l=jn;break;case`copy`:case`cut`:case`paste`:l=bn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=On;break;case`toggle`:case`beforetoggle`:l=Mn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Yt(m,p),g!=null&&d.push(wd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Ht&&(u=n.relatedTarget||n.fromElement)&&(it(u)||u[Ze]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?it(u):null,u!==null&&(f=s(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=gn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=On,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:ot(l),h=u==null?c:ot(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,it(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Ed,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Dd(o,c,l,d,!1),u!==null&&f!==null&&Dd(o,f,u,d,!0)}}a:{if(c=r?ot(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=Qn;else if(Kn(c))if($n)v=cr;else{v=or;var y=ar}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Lt(r.elementType)&&(v=Qn):v=sr;if(v&&=v(e,r)){qn(o,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&At(c,`number`,c.value)}switch(y=r?ot(r):window,e){case`focusin`:(Kn(y)||y.contentEditable===`true`)&&(vr=y,yr=r,br=null);break;case`focusout`:br=yr=vr=null;break;case`mousedown`:xr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:xr=!1,Sr(o,n,i);break;case`selectionchange`:if(_r)break;case`keydown`:case`keyup`:Sr(o,n,i)}var b;if(Pn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Hn?Bn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Ln&&n.locale!==`ko`&&(Hn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Hn&&(b=nn()):($t=i,en=`value`in $t?$t.value:$t.textContent,Hn=!0)),y=Td(r,x),0<y.length&&(x=new xn(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Vn(n),b!==null&&(x.data=b)))),(b=In?Un(e,n):Wn(e,n))&&(x=Td(r,`onBeforeInput`),0<x.length&&(y=new xn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),fd(o,e,r,n,i)}_d(o,t)})}function wd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Td(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Yt(e,n),i!=null&&r.unshift(wd(e,i,a)),i=Yt(e,t),i!=null&&r.push(wd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Ed(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Dd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Yt(n,a),l!=null&&o.unshift(wd(n,l,c))):i||(l=Yt(n,a),l!=null&&o.push(wd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Od=/\r\n?/g,kd=/\u0000|\uFFFD/g;function Ad(e){return(typeof e==`string`?e:``+e).replace(Od,`
|
|
10
|
-
`).replace(kd,``)}function jd(e,t){return t=Ad(t),Ad(e)===t}function Md(e,t,n,r,i,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Y(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Y(e,``+r);break;case`className`:vt(e,`class`,r);break;case`tabIndex`:vt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:vt(e,n,r);break;case`style`:It(e,r,o);break;case`data`:if(t!==`object`){vt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Bt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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 o==`function`&&(n===`formAction`?(t!==`input`&&Md(e,t,`name`,i.name,i,null),Md(e,t,`formEncType`,i.formEncType,i,null),Md(e,t,`formMethod`,i.formMethod,i,null),Md(e,t,`formTarget`,i.formTarget,i,null)):(Md(e,t,`encType`,i.encType,i,null),Md(e,t,`method`,i.method,i,null),Md(e,t,`target`,i.target,i,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Bt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Vt);break;case`onScroll`:r!=null&&vd(`scroll`,e);break;case`onScrollEnd`:r!=null&&vd(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Bt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:vd(`beforetoggle`,e),vd(`toggle`,e),_t(e,`popover`,r);break;case`xlinkActuate`:yt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:yt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:yt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:yt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:yt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:yt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:yt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:_t(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Rt.get(n)||n,_t(e,n,r))}}function Nd(e,t,n,r,i,o){switch(n){case`style`:It(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Y(e,r):(typeof r==`number`||typeof r==`bigint`)&&Y(e,``+r);break;case`onScroll`:r!=null&&vd(`scroll`,e);break;case`onScrollEnd`:r!=null&&vd(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Vt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!ut.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),o=e[Xe]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,i),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):_t(e,n,r)}}}function Pd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:vd(`error`,e),vd(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Md(e,t,o,s,n,null)}}i&&Md(e,t,`srcSet`,n.srcSet,n,null),r&&Md(e,t,`src`,n.src,n,null);return;case`input`:vd(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:Md(e,t,r,d,n,null)}}kt(e,o,c,l,u,s,i,!1);return;case`select`:for(i in vd(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Md(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&jt(e,!!r,n,!0):jt(e,!!r,t,!1);return;case`textarea`:for(s in vd(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:Md(e,t,s,c,n,null)}Mt(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Md(e,t,l,r,n,null)}return;case`dialog`:vd(`beforetoggle`,e),vd(`toggle`,e),vd(`cancel`,e),vd(`close`,e);break;case`iframe`:case`object`:vd(`load`,e);break;case`video`:case`audio`:for(r=0;r<hd.length;r++)vd(hd[r],e);break;case`image`:vd(`error`,e),vd(`load`,e);break;case`details`:vd(`toggle`,e);break;case`embed`:case`source`:case`link`:vd(`error`,e),vd(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Md(e,t,u,r,n,null)}return;default:if(Lt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Nd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Md(e,t,c,r,n,null))}function Fd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Md(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&Md(e,t,p,m,r,f)}}Ot(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Md(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Md(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?jt(e,!!n,n?[]:``,!1):jt(e,!!n,t,!0)):jt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Md(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&Md(e,t,s,i,r,o)}J(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Md(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Md(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Md(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:Md(e,t,u,p,r,m)}return;default:if(Lt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Nd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Nd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Md(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Md(e,t,f,p,r,m)}function Id(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ld(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Id(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Id(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Rd=null,zd=null;function Bd(e){return e.nodeType===9?e:e.ownerDocument}function Vd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Hd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Ud(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Wd=null;function Gd(){var e=window.event;return e&&e.type===`popstate`?e===Wd?!1:(Wd=e,!0):(Wd=null,!1)}var Kd=typeof setTimeout==`function`?setTimeout:void 0,qd=typeof clearTimeout==`function`?clearTimeout:void 0,Jd=typeof Promise==`function`?Promise:void 0,Yd=typeof queueMicrotask==`function`?queueMicrotask:Jd===void 0?Kd:function(e){return Jd.resolve(null).then(e).catch(Xd)};function Xd(e){setTimeout(function(){throw e})}function Zd(e){return e===`head`}function Qd(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)pf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,pf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[nt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&pf(e.ownerDocument.body);n=i}while(n);Np(t)}function $d(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function ef(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:ef(n),rt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function tf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[nt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=cf(e.nextSibling),e===null)break}return null}function nf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=cf(e.nextSibling),e===null))return null;return e}function rf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=cf(e.nextSibling),e===null))return null;return e}function af(e){return e.data===`$?`||e.data===`$~`}function of(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function sf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function cf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var lf=null;function uf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return cf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function df(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ff(e,t,n){switch(t=Bd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function pf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);rt(e)}var mf=new Map,hf=new Set;function gf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var _f=F.d;F.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=_f.f(),t=_u();return e||t}function yf(e){var t=at(e);t!==null&&t.tag===5&&t.type===`form`?gs(t):_f.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Dt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),hf.has(i)||(hf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Pd(t,`link`,e),ct(t),r.head.appendChild(t)))}}function Sf(e){_f.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){_f.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){_f.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Dt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Dt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Dt(n.imageSizes)+`"]`)):i+=`[href="`+Dt(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}mf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),mf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Pd(t,`link`,e),ct(t),r.head.appendChild(t)))}}function Tf(e,t){_f.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Dt(r)+`"][href="`+Dt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!mf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),mf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Pd(r,`link`,e),ct(r),n.head.appendChild(r)}}}function Ef(e,t,n){_f.S(e,t,n);var r=bf;if(r&&e){var i=st(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=mf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);ct(c),Pd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){_f.X(e,t);var n=bf;if(n&&e){var r=st(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),ct(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){_f.M(e,t);var n=bf;if(n&&e){var r=st(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=mf.get(i))&&zf(e,t),a=n.createElement(`script`),ct(a),Pd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var i=(i=W.current)?gf(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=st(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=st(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),mf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},mf.set(e,n),o||Nf(i,e,n,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=st(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Af(e){return`href="`+Dt(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Pd(t,`link`,n),ct(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Dt(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Dt(n.href)+`"]`);if(r)return t.instance=r,ct(r),r;var i=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ct(r),Pd(r,`style`,i),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Af(n.href);var o=e.querySelector(jf(i));if(o)return t.state.loading|=4,t.instance=o,ct(o),o;r=Mf(n),(i=mf.get(i))&&Rf(r,i),o=(e.ownerDocument||e).createElement(`link`),ct(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Pd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(i=e.querySelector(Ff(o)))?(t.instance=i,ct(i),i):(r=n,(i=mf.get(o))&&(r=p({},n),zf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),ct(i),Pd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[nt]||a[Ye]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ct(a);return}a=t.ownerDocument||t,r=Mf(r),(i=mf.get(i))&&Rf(r,i),a=a.createElement(`link`),ct(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Pd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Ld());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:x,Provider:null,Consumer:null,_currentValue:I,_currentValue2:I,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,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=Re(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Re(0),this.hiddenUpdates=Re(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Xr(3,null,null,t),e.current=a,a.stateNode=e,t=Xi(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Da(a),e}function tp(e){return e?(e=Jr,e):Jr}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=ka(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Aa(e,r,t),n!==null&&(fu(n,e,t),ja(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=Gr(e,67108864);t!==null&&fu(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=uu();t=We(t);var n=Gr(e,t);n!==null&&fu(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=2,up(e,t,n,r)}finally{F.p=a,P.T=i}}function lp(e,t,n,r){var i=P.T;P.T=null;var a=F.p;try{F.p=8,up(e,t,n,r)}finally{F.p=a,P.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)Cd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=at(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Ne(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ee(o);s.entanglements[1]|=c,o&=~c}td(a),!(jl&6)&&(Ql=me()+500,nd(0,!1))}}break;case 31:case 13:s=Gr(a,2),s!==null&&fu(s,a,2),_u(),ip(a,2)}if(a=dp(r),a===null&&Cd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Cd(e,t,r,null,n)}}function dp(e){return e=Ut(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=it(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return fp=e,null}function mp(e){switch(e){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(he()){case ge:return 2;case _e:return 8;case ve:case ye:return 32;case be:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=at(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=it(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,qe(e.priority,function(){op(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,qe(e.priority,function(){op(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Ht=r,n.target.dispatchEvent(r),Ht=null}else return t=at(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=at(n);a!==null&&(e.splice(t,3),t-=3,ms(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Xe]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Xe]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;np(n,uu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),_u(),t[Ze]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ke();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.5`)throw Error(a(527,Lp,`19.2.5`));F.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.5`,rendererPackageName:`react-dom`,currentDispatcherRef:P,reconcilerVersion:`19.2.5`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Ce=zp.inject(Rp),we=zp}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=Ls,s=Rs,c=zs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,i,s,c,Pp),e[Ze]=t.current,xd(e),new Fp(t)}})),fa=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=da()})),pa=vt(`arrow-down-to-line`,[[`path`,{d:`M12 17V3`,key:`1cwfxf`}],[`path`,{d:`m6 11 6 6 6-6`,key:`12ii2o`}],[`path`,{d:`M19 21H5`,key:`150jfl`}]]),ma=vt(`arrow-up-down`,[[`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`}]]),ha=vt(`bird`,[[`path`,{d:`M16 7h.01`,key:`1kdx03`}],[`path`,{d:`M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20`,key:`oj1oa8`}],[`path`,{d:`m20 7 2 .5-2 .5`,key:`12nv4d`}],[`path`,{d:`M10 18v3`,key:`1yea0a`}],[`path`,{d:`M14 17.75V21`,key:`1pymcb`}],[`path`,{d:`M7 18a6 6 0 0 0 3.84-10.61`,key:`1npnn0`}]]),ga=vt(`bold`,[[`path`,{d:`M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8`,key:`mg9rjx`}]]),Z=a(),Q=e(i(),1),_a=e(Ft()),va=fa(),$=o(),ya=[[`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`}]];vt(`bot`,ya);var ba=vt(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),xa=vt(`cat`,[[`path`,{d:`M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z`,key:`x6xyqk`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M11.25 16.25h1.5L12 17l-.75-.75Z`,key:`12kq1m`}]]),Sa=vt(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Ca=vt(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),wa=vt(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Ta=vt(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ea=vt(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Da=vt(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),Oa=vt(`columns-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M12 3v18`,key:`108xh3`}]]),ka=vt(`columns-3`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),Aa=vt(`contrast`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 18a6 6 0 0 0 0-12v12z`,key:`j4l70d`}]]),ja=vt(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Ma=vt(`diamond`,[[`path`,{d:`M2.7 10.3a2.41 2.41 0 0 0 0 3.41l7.59 7.59a2.41 2.41 0 0 0 3.41 0l7.59-7.59a2.41 2.41 0 0 0 0-3.41l-7.59-7.59a2.41 2.41 0 0 0-3.41 0Z`,key:`1f1r0c`}]]),Na=vt(`dog`,[[`path`,{d:`M11.25 16.25h1.5L12 17z`,key:`w7jh35`}],[`path`,{d:`M16 14v.5`,key:`1lajdz`}],[`path`,{d:`M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309`,key:`u7s9ue`}],[`path`,{d:`M8 14v.5`,key:`1nzgdb`}],[`path`,{d:`M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5`,key:`v8hric`}]]),Pa=vt(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Fa=vt(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),Ia=vt(`file-text`,[[`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`}]]),La=vt(`fish`,[[`path`,{d:`M6.5 12c.94-3.46 4.94-6 8.5-6 3.56 0 6.06 2.54 7 6-.94 3.47-3.44 6-7 6s-7.56-2.53-8.5-6Z`,key:`15baut`}],[`path`,{d:`M18 12v.5`,key:`18hhni`}],[`path`,{d:`M16 17.93a9.77 9.77 0 0 1 0-11.86`,key:`16dt7o`}],[`path`,{d:`M7 10.67C7 8 5.58 5.97 2.73 5.5c-1 1.5-1 5 .23 6.5-1.24 1.5-1.24 5-.23 6.5C5.58 18.03 7 16 7 13.33`,key:`l9di03`}],[`path`,{d:`M10.46 7.26C10.2 5.88 9.17 4.24 8 3h5.8a2 2 0 0 1 1.98 1.67l.23 1.4`,key:`1kjonw`}],[`path`,{d:`m16.01 17.93-.23 1.4A2 2 0 0 1 13.8 21H9.5a5.96 5.96 0 0 0 1.49-3.98`,key:`1zlm23`}]]),Ra=vt(`fold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3-3-3 3`,key:`e37ymu`}],[`path`,{d:`m15 5-3 3-3-3`,key:`19d6lf`}]]),za=vt(`folder-cog`,[[`path`,{d:`M10.3 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.98a2 2 0 0 1 1.69.9l.66 1.2A2 2 0 0 0 12 6h8a2 2 0 0 1 2 2v3.3`,key:`128dxu`}],[`path`,{d:`m14.305 19.53.923-.382`,key:`3m78fa`}],[`path`,{d:`m15.228 16.852-.923-.383`,key:`npixar`}],[`path`,{d:`m16.852 15.228-.383-.923`,key:`5xggr7`}],[`path`,{d:`m16.852 20.772-.383.924`,key:`dpfhf9`}],[`path`,{d:`m19.148 15.228.383-.923`,key:`1reyyz`}],[`path`,{d:`m19.53 21.696-.382-.924`,key:`1goivc`}],[`path`,{d:`m20.772 16.852.924-.383`,key:`htqkph`}],[`path`,{d:`m20.772 19.148.924.383`,key:`9w9pjp`}],[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}]]),Ba=vt(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Va=vt(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Ha=vt(`git-branch`,[[`path`,{d:`M15 6a9 9 0 0 0-9 9V3`,key:`1cii5b`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}]]),Ua=vt(`grid-2x2-x`,[[`path`,{d:`M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3`,key:`11za1p`}],[`path`,{d:`m16 16 5 5`,key:`8tpb07`}],[`path`,{d:`m16 21 5-5`,key:`193jll`}]]),Wa=vt(`grip-vertical`,[[`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`}]]),Ga=vt(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),Ka=vt(`highlighter`,[[`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`}]]),qa=vt(`italic`,[[`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`}]]),Ja=vt(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),Ya=[[`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`}]],Xa=vt(`link-2`,Ya),Za=vt(`link`,[[`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`}]]),Qa=vt(`list-collapse`,[[`path`,{d:`M10 5h11`,key:`1hkqpe`}],[`path`,{d:`M10 12h11`,key:`6m4ad9`}],[`path`,{d:`M10 19h11`,key:`14g2nv`}],[`path`,{d:`m3 10 3-3-3-3`,key:`i7pm08`}],[`path`,{d:`m3 20 3-3-3-3`,key:`20gx1n`}]]),$a=vt(`list-plus`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`M18 9v6`,key:`1twb98`}],[`path`,{d:`M21 12h-6`,key:`bt1uis`}]]),eo=vt(`list-tree`,[[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`M3 10a2 2 0 0 0 2 2h3`,key:`1npucw`}],[`path`,{d:`M3 5v12a2 2 0 0 0 2 2h3`,key:`x1gjn2`}]]),to=vt(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),no=vt(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),ro=vt(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),io=vt(`octagon-x`,[[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),ao=vt(`panel-right-close`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m8 9 3 3-3 3`,key:`12hl5m`}]]),oo=vt(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),so=vt(`pilcrow`,[[`path`,{d:`M13 4v16`,key:`8vvj80`}],[`path`,{d:`M17 4v16`,key:`7dpous`}],[`path`,{d:`M19 4H9.5a4.5 4.5 0 0 0 0 9H13`,key:`sh4n9v`}]]),co=vt(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),lo=vt(`rabbit`,[[`path`,{d:`M13 16a3 3 0 0 1 2.24 5`,key:`1epib5`}],[`path`,{d:`M18 12h.01`,key:`yjnet6`}],[`path`,{d:`M18 21h-8a4 4 0 0 1-4-4 7 7 0 0 1 7-7h.2L9.6 6.4a1 1 0 1 1 2.8-2.8L15.8 7h.2c3.3 0 6 2.7 6 6v1a2 2 0 0 1-2 2h-1a3 3 0 0 0-3 3`,key:`ue9ozu`}],[`path`,{d:`M20 8.54V4a2 2 0 1 0-4 0v3`,key:`49iql8`}],[`path`,{d:`M7.612 12.524a3 3 0 1 0-1.6 4.3`,key:`1e33i0`}]]),uo=vt(`rat`,[[`path`,{d:`M13 22H4a2 2 0 0 1 0-4h12`,key:`bt3f23`}],[`path`,{d:`M13.236 18a3 3 0 0 0-2.2-5`,key:`1tbvmo`}],[`path`,{d:`M16 9h.01`,key:`1bdo4e`}],[`path`,{d:`M16.82 3.94a3 3 0 1 1 3.237 4.868l1.815 2.587a1.5 1.5 0 0 1-1.5 2.1l-2.872-.453a3 3 0 0 0-3.5 3`,key:`9ch7kn`}],[`path`,{d:`M17 4.988a3 3 0 1 0-5.2 2.052A7 7 0 0 0 4 14.015 4 4 0 0 0 8 18`,key:`3s7e9i`}]]),fo=vt(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),po=vt(`rows-2`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}]]),mo=vt(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),ho=vt(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),go=vt(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),_o=vt(`shrimp`,[[`path`,{d:`M11 12h.01`,key:`1lr4k6`}],[`path`,{d:`M13 22c.5-.5 1.12-1 2.5-1-1.38 0-2-.5-2.5-1`,key:`fatpdi`}],[`path`,{d:`M14 2a3.28 3.28 0 0 1-3.227 1.798l-6.17-.561A2.387 2.387 0 1 0 4.387 8H15.5a1 1 0 0 1 0 13 1 1 0 0 0 0-5H12a7 7 0 0 1-7-7V8`,key:`kehrqe`}],[`path`,{d:`M14 8a8.5 8.5 0 0 1 0 8`,key:`1imjx2`}],[`path`,{d:`M16 16c2 0 4.5-4 4-6`,key:`z0nejz`}]]),vo=vt(`snail`,[[`path`,{d:`M2 13a6 6 0 1 0 12 0 4 4 0 1 0-8 0 2 2 0 0 0 4 0`,key:`hneq2s`}],[`circle`,{cx:`10`,cy:`13`,r:`8`,key:`194lz3`}],[`path`,{d:`M2 21h12c4.4 0 8-3.6 8-8V7a2 2 0 1 0-4 0v6`,key:`ixqyt7`}],[`path`,{d:`M18 3 19.1 5.2`,key:`9tjm43`}],[`path`,{d:`M22 3 20.9 5.2`,key:`j3odrs`}]]),yo=vt(`square-check`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),bo=vt(`square-code`,[[`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`}]]),xo=vt(`square-pen`,[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]]),So=vt(`squirrel`,[[`path`,{d:`M15.236 22a3 3 0 0 0-2.2-5`,key:`21bitc`}],[`path`,{d:`M16 20a3 3 0 0 1 3-3h1a2 2 0 0 0 2-2v-2a4 4 0 0 0-4-4V4`,key:`oh0fg0`}],[`path`,{d:`M18 13h.01`,key:`9veqaj`}],[`path`,{d:`M18 6a4 4 0 0 0-4 4 7 7 0 0 0-7 7c0-5 4-5 4-10.5a4.5 4.5 0 1 0-9 0 2.5 2.5 0 0 0 5 0C7 10 3 11 3 17c0 2.8 2.2 5 5 5h10`,key:`980v8a`}]]),Co=vt(`strikethrough`,[[`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`}]]),wo=vt(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),To=vt(`table-properties`,[[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]]),Eo=vt(`turtle`,[[`path`,{d:`m12 10 2 4v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3a8 8 0 1 0-16 0v3a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-3l2-4h4Z`,key:`1lbbv7`}],[`path`,{d:`M4.82 7.9 8 10`,key:`m9wose`}],[`path`,{d:`M15.18 7.9 12 10`,key:`p8dp2u`}],[`path`,{d:`M16.93 10H20a2 2 0 0 1 0 4H2`,key:`12nsm7`}]]),Do=vt(`type`,[[`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`}]]),Oo=vt(`underline`,[[`path`,{d:`M6 4v6a6 6 0 0 0 12 0V4`,key:`9kb039`}],[`line`,{x1:`4`,x2:`20`,y1:`20`,y2:`20`,key:`nun2al`}]]),ko=vt(`unfold-vertical`,[[`path`,{d:`M12 22v-6`,key:`6o8u61`}],[`path`,{d:`M12 8V2`,key:`1wkif3`}],[`path`,{d:`M4 12H2`,key:`rhcxmi`}],[`path`,{d:`M10 12H8`,key:`s88cx1`}],[`path`,{d:`M16 12h-2`,key:`10asgb`}],[`path`,{d:`M22 12h-2`,key:`14jgyd`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m15 5-3-3-3 3`,key:`itvq4r`}]]),Ao=vt(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),jo=vt(`user`,[[`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`}]]);function Mo(e,t){return e instanceof Error&&e.message?e.message:t}async function No(e,t,n,r=`action`){try{n(null),await e()}catch(e){console.error(`[${r}] action failed:`,e),n(Mo(e,t))}}async function Po(e,t,n=X,r=`action`){await No(e,t,e=>{e!==null&&n.error(e)},r)}async function Fo(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}function Io(e){let t=e.split(`
|
|
11
|
-
`);for(let e=t.length-1;e>=0;e--){let n=t[e]?.trim();if(n)try{let e=JSON.parse(n);if(e&&typeof e==`object`)return e}catch{}}return null}function Lo(){return{async status(e){let t=e?.host??`github.com`,n=await Fo(`/api/local-op/auth/status`,e);if(!n.ok)return{authenticated:!1,host:t};let r=await n.json(),i=typeof r.host==`string`?r.host:t;return r.authenticated===!0&&typeof r.login==`string`?{authenticated:!0,host:i,login:r.login,name:typeof r.name==`string`?r.name:void 0,email:typeof r.email==`string`?r.email:void 0}:{authenticated:!1,host:i,error:typeof r.error==`string`?r.error:void 0}},async repos(e){let t=e?.host??`github.com`,n=await Fo(`/api/local-op/auth/repos`,e);if(!n.ok)return{ok:!1,error:`Failed to fetch repositories`};let r=Io(await n.text());if(!r||!Array.isArray(r.repos))return{ok:!1,error:`Failed to fetch repositories`};let i=[];for(let e of r.repos){let t=e;typeof t?.full_name==`string`&&typeof t.clone_url==`string`&&i.push({full_name:t.full_name,clone_url:t.clone_url,private:t.private===!0})}return{ok:!0,host:typeof r.host==`string`?r.host:t,repos:i}}}}function Ro(e){return{status:t=>e.localOp.authStatus(t),repos:t=>e.localOp.authRepos(t)}}async function zo(e,t){let n=e.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:a}=await n.read();if(e)return i+=r.decode(),!!(i.trim()&&t(i)===`terminal`);i+=r.decode(a,{stream:!0});let o=i.split(`
|
|
12
|
-
`);i=o.pop()??``;for(let e of o)if(e.trim()&&t(e)===`terminal`)return!0}}function Bo(e){let t=[],n=[],r=new AbortController,i=!1,a=()=>{for(let e of n.splice(0))e(null)};return e(e=>{i||(n.length>0?n.shift()?.(e):t.push(e),(e.type===`complete`||e.type===`error`)&&(i=!0,r.abort(),a()))},r.signal),{events:{[Symbol.asyncIterator](){return{async next(){if(t.length>0){let e=t.shift();return e===void 0?{value:void 0,done:!0}:{value:e,done:!1}}return i?{value:void 0,done:!0}:new Promise(e=>{n.push(t=>{e(t===null?{value:void 0,done:!0}:{value:t,done:!1})})})}}}},cancel:()=>{i||(i=!0,r.abort(),a())}}}function Vo(){return{start(){return Bo((e,t)=>{(async()=>{try{let n=await fetch(`/api/local-op/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({json:!0}),signal:t});if(!n.ok||!n.body){e({type:`error`,message:`Failed to start sign-in — try again`});return}!await zo(n.body,t=>{try{let n=JSON.parse(t);if(e(n),n.type===`complete`||n.type===`error`)return`terminal`}catch{}return`continue`})&&!t.aborted&&e({type:`error`,message:`Sign-in stream ended without confirmation — please try again`})}catch(t){if(t instanceof Error&&t.name===`AbortError`)return;e({type:`error`,message:`Connection error — try again`})}})()})}}}function Ho(e){return{start(){return e.localOp.auth.start()}}}function Uo(){return{start(e){return Bo((t,n)=>{(async()=>{try{let r=await fetch(`/api/local-op/clone`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:e.url,dir:e.dir||void 0}),signal:n});if(!r.ok||!r.body){t({type:`error`,message:`Clone failed — check the URL and try again`});return}let i=r.body.getReader(),a=new TextDecoder,o=``;for(;;){let{done:e,value:r}=await i.read();if(e)break;o+=a.decode(r,{stream:!0});let s=o.split(`
|
|
13
|
-
`);o=s.pop()??``;for(let e of s)if(e.trim())try{t(JSON.parse(e))}catch{}if(n.aborted)break}n.aborted||t({type:`error`,message:`Clone stream ended unexpectedly — check if the clone completed`})}catch(e){if(e instanceof Error&&e.name===`AbortError`)return;t({type:`error`,message:`Clone failed — connection error`})}})()})}}}function Wo(e){return{start(t){return e.localOp.clone.start(t)}}}var Go=`Checkbox`,[Ko,qo]=kt(Go),[Jo,Yo]=Ko(Go);function Xo(e){let{__scopeCheckbox:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Nt({prop:n,defaultProp:i??!1,onChange:c,caller:Go}),[m,h]=Q.useState(null),[g,_]=Q.useState(null),v=Q.useRef(!1),y=m?!!o||!!m.closest(`form`):!0,b={checked:f,disabled:a,setChecked:p,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:v,required:l,defaultChecked:as(i)?!1:i,isFormControl:y,bubbleInput:g,setBubbleInput:_};return(0,Z.jsx)(Jo,{scope:t,...b,children:is(d)?d(b):r})}var Zo=`CheckboxTrigger`,Qo=Q.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},i)=>{let{control:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,isFormControl:p,bubbleInput:m}=Yo(Zo,e),h=It(i,u),g=Q.useRef(c);return Q.useEffect(()=>{let e=a?.form;if(e){let t=()=>d(g.current);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[a,d]),(0,Z.jsx)(Et.button,{type:`button`,role:`checkbox`,"aria-checked":as(c)?`mixed`:c,"aria-required":l,"data-state":os(c),"data-disabled":s?``:void 0,disabled:s,value:o,...r,ref:h,onKeyDown:wt(t,e=>{e.key===`Enter`&&e.preventDefault()}),onClick:wt(n,e=>{d(e=>as(e)?!0:!e),m&&p&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})});Qo.displayName=Zo;var $o=Q.forwardRef((e,t)=>{let{__scopeCheckbox:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,Z.jsx)(Xo,{__scopeCheckbox:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Qo,{...d,ref:t,__scopeCheckbox:n}),e&&(0,Z.jsx)(rs,{__scopeCheckbox:n})]})})});$o.displayName=Go;var es=`CheckboxIndicator`,ts=Q.forwardRef((e,t)=>{let{__scopeCheckbox:n,forceMount:r,...i}=e,a=Yo(es,n);return(0,Z.jsx)(Ot,{present:r||as(a.checked)||a.checked===!0,children:(0,Z.jsx)(Et.span,{"data-state":os(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t,style:{pointerEvents:`none`,...e.style}})})});ts.displayName=es;var ns=`CheckboxBubbleInput`,rs=Q.forwardRef(({__scopeCheckbox:e,...t},n)=>{let{control:r,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:o,required:s,disabled:c,name:l,value:u,form:d,bubbleInput:f,setBubbleInput:p}=Yo(ns,e),m=It(n,p),h=zt(a),g=Ye(r);Q.useEffect(()=>{let e=f;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=!i.current;if(h!==a&&n){let t=new Event(`click`,{bubbles:r});e.indeterminate=as(a),n.call(e,as(a)?!1:a),e.dispatchEvent(t)}},[f,h,a,i]);let _=Q.useRef(as(a)?!1:a);return(0,Z.jsx)(Et.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:o??_.current,required:s,disabled:c,name:l,value:u,form:d,...t,tabIndex:-1,ref:m,style:{...t.style,...g,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})});rs.displayName=ns;function is(e){return typeof e==`function`}function as(e){return e===`indeterminate`}function os(e){return as(e)?`indeterminate`:e?`checked`:`unchecked`}var ss=[`Enter`,` `],cs=[`ArrowDown`,`PageUp`,`Home`],ls=[`ArrowUp`,`PageDown`,`End`],us=[...cs,...ls],ds={ltr:[...ss,`ArrowRight`],rtl:[...ss,`ArrowLeft`]},fs={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},ps=`Menu`,[ms,hs,gs]=De(ps),[_s,vs]=kt(ps,[gs,he,fe]),ys=he(),bs=fe(),[xs,Ss]=_s(ps),[Cs,ws]=_s(ps),Ts=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=ys(t),[c,l]=Q.useState(null),u=Q.useRef(!1),d=Mt(a),f=st(i);return Q.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,Z.jsx)(ne,{...s,children:(0,Z.jsx)(xs,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,Z.jsx)(Cs,{scope:t,onClose:Q.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};Ts.displayName=ps;var Es=`MenuAnchor`,Ds=Q.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ys(n);return(0,Z.jsx)(U,{...i,...r,ref:t})});Ds.displayName=Es;var Os=`MenuPortal`,[ks,As]=_s(Os,{forceMount:void 0}),js=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ss(Os,t);return(0,Z.jsx)(ks,{scope:t,forceMount:n,children:(0,Z.jsx)(Ot,{present:n||a.open,children:(0,Z.jsx)(xt,{asChild:!0,container:i,children:r})})})};js.displayName=Os;var Ms=`MenuContent`,[Ns,Ps]=_s(Ms),Fs=Q.forwardRef((e,t)=>{let n=As(Ms,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ss(Ms,e.__scopeMenu),o=ws(Ms,e.__scopeMenu);return(0,Z.jsx)(ms.Provider,{scope:e.__scopeMenu,children:(0,Z.jsx)(Ot,{present:r||a.open,children:(0,Z.jsx)(ms.Slot,{scope:e.__scopeMenu,children:o.modal?(0,Z.jsx)(Is,{...i,ref:t}):(0,Z.jsx)(Ls,{...i,ref:t})})})})}),Is=Q.forwardRef((e,t)=>{let n=Ss(Ms,e.__scopeMenu),r=Q.useRef(null),i=It(t,r);return Q.useEffect(()=>{let e=r.current;if(e)return li(e)},[]),(0,Z.jsx)(zs,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:wt(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Ls=Q.forwardRef((e,t)=>{let n=Ss(Ms,e.__scopeMenu);return(0,Z.jsx)(zs,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Rs=Pt(`MenuContent.ScrollLock`),zs=Q.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Ss(Ms,n),_=ws(Ms,n),v=ys(n),y=bs(n),b=hs(n),[x,S]=Q.useState(null),C=Q.useRef(null),w=It(t,C,g.onContentChange),T=Q.useRef(0),E=Q.useRef(``),D=Q.useRef(0),O=Q.useRef(null),k=Q.useRef(`right`),A=Q.useRef(0),j=m?ii:Q.Fragment,M=m?{as:Rs,allowPinchZoom:!0}:void 0,N=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=Cc(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};Q.useEffect(()=>()=>window.clearTimeout(T.current),[]),xi();let P=Q.useCallback(e=>k.current===O.current?.side&&Tc(e,O.current?.area),[]);return(0,Z.jsx)(Ns,{scope:n,searchRef:E,onItemEnter:Q.useCallback(e=>{P(e)&&e.preventDefault()},[P]),onItemLeave:Q.useCallback(e=>{P(e)||(C.current?.focus(),S(null))},[P]),onTriggerLeave:Q.useCallback(e=>{P(e)&&e.preventDefault()},[P]),pointerGraceTimerRef:D,onPointerGraceIntentChange:Q.useCallback(e=>{O.current=e},[]),children:(0,Z.jsx)(j,{...M,children:(0,Z.jsx)(Si,{asChild:!0,trapped:i,onMountAutoFocus:wt(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,Z.jsx)(jt,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,Z.jsx)(q,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:wt(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,Z.jsx)(tt,{role:`menu`,"aria-orientation":`vertical`,"data-state":vc(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:wt(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&N(e.key));let i=C.current;if(e.target!==i||!us.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);ls.includes(e.key)&&a.reverse(),xc(a)}),onBlur:wt(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:wt(e.onPointerMove,Ec(e=>{let t=e.target,n=A.current!==e.clientX;e.currentTarget.contains(t)&&n&&(k.current=e.clientX>A.current?`right`:`left`,A.current=e.clientX)}))})})})})})})});Fs.displayName=Ms;var Bs=`MenuGroup`,Vs=Q.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,Z.jsx)(Et.div,{role:`group`,...r,ref:t})});Vs.displayName=Bs;var Hs=`MenuLabel`,Us=Q.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,Z.jsx)(Et.div,{...r,ref:t})});Us.displayName=Hs;var Ws=`MenuItem`,Gs=`menu.itemSelect`,Ks=Q.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=Q.useRef(null),o=ws(Ws,e.__scopeMenu),s=Ps(Ws,e.__scopeMenu),c=It(t,a),l=Q.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Gs,{bubbles:!0,cancelable:!0});e.addEventListener(Gs,e=>r?.(e),{once:!0}),Tt(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,Z.jsx)(qs,{...i,ref:c,disabled:n,onClick:wt(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:wt(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:wt(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||ss.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Ks.displayName=Ws;var qs=Q.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Ps(Ws,n),s=bs(n),c=Q.useRef(null),l=It(t,c),[u,d]=Q.useState(!1),[f,p]=Q.useState(``);return Q.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,Z.jsx)(ms.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,Z.jsx)(G,{asChild:!0,...s,focusable:!r,children:(0,Z.jsx)(Et.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:wt(e.onPointerMove,Ec(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:wt(e.onPointerLeave,Ec(e=>o.onItemLeave(e))),onFocus:wt(e.onFocus,()=>d(!0)),onBlur:wt(e.onBlur,()=>d(!1))})})})}),Js=`MenuCheckboxItem`,Ys=Q.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,Z.jsx)(rc,{scope:e.__scopeMenu,checked:n,children:(0,Z.jsx)(Ks,{role:`menuitemcheckbox`,"aria-checked":yc(n)?`mixed`:n,...i,ref:t,"data-state":bc(n),onSelect:wt(i.onSelect,()=>r?.(yc(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ys.displayName=Js;var Xs=`MenuRadioGroup`,[Zs,Qs]=_s(Xs,{value:void 0,onValueChange:()=>{}}),$s=Q.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=Mt(r);return(0,Z.jsx)(Zs,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,Z.jsx)(Vs,{...i,ref:t})})});$s.displayName=Xs;var ec=`MenuRadioItem`,tc=Q.forwardRef((e,t)=>{let{value:n,...r}=e,i=Qs(ec,e.__scopeMenu),a=n===i.value;return(0,Z.jsx)(rc,{scope:e.__scopeMenu,checked:a,children:(0,Z.jsx)(Ks,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":bc(a),onSelect:wt(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});tc.displayName=ec;var nc=`MenuItemIndicator`,[rc,ic]=_s(nc,{checked:!1}),ac=Q.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=ic(nc,n);return(0,Z.jsx)(Ot,{present:r||yc(a.checked)||a.checked===!0,children:(0,Z.jsx)(Et.span,{...i,ref:t,"data-state":bc(a.checked)})})});ac.displayName=nc;var oc=`MenuSeparator`,sc=Q.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,Z.jsx)(Et.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});sc.displayName=oc;var cc=`MenuArrow`,lc=Q.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=ys(n);return(0,Z.jsx)(re,{...i,...r,ref:t})});lc.displayName=cc;var uc=`MenuSub`,[dc,fc]=_s(uc),pc=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Ss(uc,t),o=ys(t),[s,c]=Q.useState(null),[l,u]=Q.useState(null),d=Mt(i);return Q.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,Z.jsx)(ne,{...o,children:(0,Z.jsx)(xs,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,Z.jsx)(dc,{scope:t,contentId:Ct(),triggerId:Ct(),trigger:s,onTriggerChange:c,children:n})})})};pc.displayName=uc;var mc=`MenuSubTrigger`,hc=Q.forwardRef((e,t)=>{let n=Ss(mc,e.__scopeMenu),r=ws(mc,e.__scopeMenu),i=fc(mc,e.__scopeMenu),a=Ps(mc,e.__scopeMenu),o=Q.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=Q.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return Q.useEffect(()=>u,[u]),Q.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,Z.jsx)(Ds,{asChild:!0,...l,children:(0,Z.jsx)(qs,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":vc(n.open),...e,ref:St(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:wt(e.onPointerMove,Ec(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:wt(e.onPointerLeave,Ec(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:wt(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||ds[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});hc.displayName=mc;var gc=`MenuSubContent`,_c=Q.forwardRef((e,t)=>{let n=As(Ms,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ss(Ms,e.__scopeMenu),o=ws(Ms,e.__scopeMenu),s=fc(gc,e.__scopeMenu),c=Q.useRef(null),l=It(t,c);return(0,Z.jsx)(ms.Provider,{scope:e.__scopeMenu,children:(0,Z.jsx)(Ot,{present:r||a.open,children:(0,Z.jsx)(ms.Slot,{scope:e.__scopeMenu,children:(0,Z.jsx)(zs,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:wt(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:wt(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:wt(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=fs[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});_c.displayName=gc;function vc(e){return e?`open`:`closed`}function yc(e){return e===`indeterminate`}function bc(e){return yc(e)?`indeterminate`:e?`checked`:`unchecked`}function xc(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Sc(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Cc(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Sc(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function wc(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Tc(e,t){return t?wc({x:e.clientX,y:e.clientY},t):!1}function Ec(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Dc=Ts,Oc=Ds,kc=js,Ac=Fs,jc=Vs,Mc=Us,Nc=Ks,Pc=Ys,Fc=$s,Ic=tc,Lc=ac,Rc=sc,zc=lc,Bc=pc,Vc=hc,Hc=_c,Uc=`DropdownMenu`,[Wc,Gc]=kt(Uc,[vs]),Kc=vs(),[qc,Jc]=Wc(Uc),Yc=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Kc(t),l=Q.useRef(null),[u,d]=Nt({prop:i,defaultProp:a??!1,onChange:o,caller:Uc});return(0,Z.jsx)(qc,{scope:t,triggerId:Ct(),triggerRef:l,contentId:Ct(),open:u,onOpenChange:d,onOpenToggle:Q.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,Z.jsx)(Dc,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Yc.displayName=Uc;var Xc=`DropdownMenuTrigger`,Zc=Q.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Jc(Xc,n),o=Kc(n);return(0,Z.jsx)(Oc,{asChild:!0,...o,children:(0,Z.jsx)(Et.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:St(t,a.triggerRef),onPointerDown:wt(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:wt(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Zc.displayName=Xc;var Qc=`DropdownMenuPortal`,$c=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Kc(t);return(0,Z.jsx)(kc,{...r,...n})};$c.displayName=Qc;var el=`DropdownMenuContent`,tl=Q.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Jc(el,n),a=Kc(n),o=Q.useRef(!1);return(0,Z.jsx)(Ac,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:wt(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:wt(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});tl.displayName=el;var nl=`DropdownMenuGroup`,rl=Q.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kc(n);return(0,Z.jsx)(jc,{...i,...r,ref:t})});rl.displayName=nl;var il=`DropdownMenuLabel`,al=Q.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kc(n);return(0,Z.jsx)(Mc,{...i,...r,ref:t})});al.displayName=il;var ol=`DropdownMenuItem`,sl=Q.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kc(n);return(0,Z.jsx)(Nc,{...i,...r,ref:t})});sl.displayName=ol;var cl=`DropdownMenuCheckboxItem`,ll=Q.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kc(n);return(0,Z.jsx)(Pc,{...i,...r,ref:t})});ll.displayName=cl;var ul=`DropdownMenuRadioGroup`,dl=Q.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kc(n);return(0,Z.jsx)(Fc,{...i,...r,ref:t})});dl.displayName=ul;var fl=`DropdownMenuRadioItem`,pl=Q.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kc(n);return(0,Z.jsx)(Ic,{...i,...r,ref:t})});pl.displayName=fl;var ml=`DropdownMenuItemIndicator`,hl=Q.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kc(n);return(0,Z.jsx)(Lc,{...i,...r,ref:t})});hl.displayName=ml;var gl=`DropdownMenuSeparator`,_l=Q.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kc(n);return(0,Z.jsx)(Rc,{...i,...r,ref:t})});_l.displayName=gl;var vl=`DropdownMenuArrow`,yl=Q.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kc(n);return(0,Z.jsx)(zc,{...i,...r,ref:t})});yl.displayName=vl;var bl=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=Kc(t),[s,c]=Nt({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,Z.jsx)(Bc,{...o,open:s,onOpenChange:c,children:n})},xl=`DropdownMenuSubTrigger`,Sl=Q.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kc(n);return(0,Z.jsx)(Vc,{...i,...r,ref:t})});Sl.displayName=xl;var Cl=`DropdownMenuSubContent`,wl=Q.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kc(n);return(0,Z.jsx)(Hc,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});wl.displayName=Cl;var Tl=Yc,El=Zc,Dl=$c,Ol=tl,kl=al,Al=sl,jl=dl,Ml=pl,Nl=hl,Pl=_l,Fl=bl,Il=Sl,Ll=wl,Rl=`Separator`,zl=`horizontal`,Bl=[`horizontal`,`vertical`],Vl=Q.forwardRef((e,t)=>{let{decorative:n,orientation:r=zl,...i}=e,a=Hl(r)?r:zl,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,Z.jsx)(Et.div,{"data-orientation":a,...o,...i,ref:t})});Vl.displayName=Rl;function Hl(e){return Bl.includes(e)}var Ul=Vl;async function Wl(e){try{await navigator.clipboard.writeText(e)}catch{}}var Gl=120*1e3;function Kl(e){let t=(0,$.c)(26),{onSuccess:n,onCancel:r,transport:i}=e,[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(`https://github.com/login/device`),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(null),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(Gl),_=(0,Q.useRef)(null),v=(0,Q.useRef)(null),y;t[0]!==n||t[1]!==i?(y=async function(){f(null),m(!0);try{let e=i.start();_.current=e.cancel;let t=e.events[Symbol.asyncIterator](),r=!1,a=await t.next();for(;!a.done;){let e=a.value;if(e.type===`verification`)o(e.user_code),c(e.verification_uri),g(e.expires_in*1e3),Wl(e.user_code).then(()=>{u(!0),setTimeout(()=>u(!1),2e3)});else if(e.type===`complete`){r=!0,m(!1),n({login:e.login,name:e.name,email:e.email,avatarUrl:e.avatarUrl});break}else if(e.type===`error`){r=!0,f(e.message),m(!1);break}a=await t.next()}r||(f(`Sign-in stream ended without confirmation — please try again`),m(!1))}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&f(`Connection error — try again`),m(!1)}},t[0]=n,t[1]=i,t[2]=y):y=t[2];let b=y,x;t[3]===b?x=t[4]:(x=()=>{let e=!1;return queueMicrotask(()=>{e||b()}),()=>{e=!0,_.current?.(),_.current=null,v.current&&clearInterval(v.current)}},t[3]=b,t[4]=x);let S;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[5]=S):S=t[5],(0,Q.useEffect)(x,S);let C,w;t[6]===a?(C=t[7],w=t[8]):(C=()=>{if(!a)return;let e=Date.now();return v.current=setInterval(()=>{let t=Gl-(Date.now()-e);t<=0?(g(0),v.current&&clearInterval(v.current),f(`Code expired — please try again`)):g(t)},1e3),()=>{v.current&&clearInterval(v.current)}},w=[a],t[6]=a,t[7]=C,t[8]=w),(0,Q.useEffect)(C,w);let T=Math.floor(h/6e4),E=Math.floor(h%6e4/1e3),D;t[9]===E?D=t[10]:(D=E.toString().padStart(2,`0`),t[9]=E,t[10]=D);let O=`${T}:${D}`,k;t[11]!==l||t[12]!==d||t[13]!==O||t[14]!==a||t[15]!==s?(k=a?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Open`,` `,(0,Z.jsx)(`a`,{href:s,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Pr(e,s),onAuxClick:e=>Pr(e,s),className:`underline underline-offset-2`,children:s}),` `,`and enter this code:`]}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`code`,{className:`flex-1 text-center text-2xl font-mono font-bold tracking-widest border rounded-md py-3 bg-muted`,children:a}),(0,Z.jsx)(Y,{variant:`outline`,size:`sm`,onClick:()=>void Wl(a).then(()=>{u(!0),setTimeout(()=>u(!1),2e3)}),children:l?`Copied!`:`Copy`})]}),(0,Z.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500 animate-pulse`}),`Waiting for authorization…`]}),(0,Z.jsxs)(`span`,{children:[`Expires in `,O]})]})]}):(0,Z.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:d?null:`Starting sign-in flow…`}),t[11]=l,t[12]=d,t[13]=O,t[14]=a,t[15]=s,t[16]=k):k=t[16];let A;t[17]===d?A=t[18]:(A=d&&(0,Z.jsx)(`p`,{className:`text-sm text-destructive`,children:d}),t[17]=d,t[18]=A);let j;t[19]!==r||t[20]!==p?(j=p&&(0,Z.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:r,children:`Cancel`}),t[19]=r,t[20]=p,t[21]=j):j=t[21];let M;return t[22]!==k||t[23]!==A||t[24]!==j?(M=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[k,A,j]}),t[22]=k,t[23]=A,t[24]=j,t[25]=M):M=t[25],M}function ql(e){let t=(0,$.c)(32),{onSuccess:n,onCancel:r}=e,[i,a]=(0,Q.useState)(``),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(null),d,f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>()=>{u.current?.abort()},f=[],t[0]=d,t[1]=f):(d=t[0],f=t[1]),(0,Q.useEffect)(d,f);let p;t[2]!==n||t[3]!==i?(p=async function(){if(!i.trim()){l(`Paste a personal access token`);return}u.current?.abort();let e=new AbortController;u.current=e,s(!0),l(null);try{let t=await fetch(`/api/local-op/auth/pat`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pat:i.trim()}),signal:e.signal});if(!t.ok||!t.body){l(`Invalid token — check that it has repo scope`),s(!1);return}await zo(t.body,e=>{try{let t=JSON.parse(e);if(t.type===`complete`)return n({login:t.login,name:t.name,email:t.email}),s(!1),`terminal`;if(t.type===`error`)return l(t.message),s(!1),`terminal`}catch{}return`continue`})||l(`No response — try again`)}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&l(`Connection error — try again`)}s(!1)},t[2]=n,t[3]=i,t[4]=p):p=t[4];let m=p,h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(`a`,{href:`https://github.com/settings/tokens`,target:`_blank`,rel:`noopener noreferrer`,onClick:Yl,onAuxClick:Jl,className:`underline underline-offset-2`,children:`github.com/settings/tokens`}),t[5]=h):h=t[5];let g;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Create a token at`,` `,h,` `,`with `,(0,Z.jsx)(`code`,{className:`text-xs bg-muted px-1 rounded`,children:`repo`}),` scope.`]}),t[6]=g):g=t[6];let _;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>a(e.target.value),t[7]=_):_=t[7];let v;t[8]===m?v=t[9]:(v=e=>{e.key===`Enter`&&m()},t[8]=m,t[9]=v);let y;t[10]!==o||t[11]!==i||t[12]!==v?(y=(0,Z.jsx)(Jn,{type:`password`,"aria-label":`Personal access token`,placeholder:`ghp_…`,value:i,onChange:_,disabled:o,onKeyDown:v}),t[10]=o,t[11]=i,t[12]=v,t[13]=y):y=t[13];let b;t[14]===c?b=t[15]:(b=c&&(0,Z.jsx)(`p`,{className:`text-sm text-destructive`,children:c}),t[14]=c,t[15]=b);let x;t[16]===m?x=t[17]:(x=()=>void m(),t[16]=m,t[17]=x);let S=o?`Validating…`:`Add token`,C;t[18]!==o||t[19]!==x||t[20]!==S?(C=(0,Z.jsx)(Y,{className:`flex-1`,onClick:x,disabled:o,children:S}),t[18]=o,t[19]=x,t[20]=S,t[21]=C):C=t[21];let w;t[22]!==o||t[23]!==r?(w=(0,Z.jsx)(Y,{variant:`ghost`,onClick:r,disabled:o,children:`Cancel`}),t[22]=o,t[23]=r,t[24]=w):w=t[24];let T;t[25]!==C||t[26]!==w?(T=(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[C,w]}),t[25]=C,t[26]=w,t[27]=T):T=t[27];let E;return t[28]!==T||t[29]!==y||t[30]!==b?(E=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[g,y,b,T]}),t[28]=T,t[29]=y,t[30]=b,t[31]=E):E=t[31],E}function Jl(e){return Pr(e,`https://github.com/settings/tokens`)}function Yl(e){return Pr(e,`https://github.com/settings/tokens`)}function Xl(e){let t=(0,$.c)(27),{login:n,onSave:r,onSkip:i}=e,[a,o]=(0,Q.useState)(``),[s,c]=(0,Q.useState)(``),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Before syncing, set your identity for git commits:`}),t[0]=l):l=t[0];let u=`Name (e.g. ${n})`,d;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(d=e=>o(e.target.value),t[1]=d):d=t[1];let f;t[2]!==a||t[3]!==u?(f=(0,Z.jsx)(Jn,{"aria-label":`Name`,placeholder:u,value:a,onChange:d}),t[2]=a,t[3]=u,t[4]=f):f=t[4];let p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>c(e.target.value),t[5]=p):p=t[5];let m;t[6]===s?m=t[7]:(m=(0,Z.jsx)(Jn,{type:`email`,"aria-label":`Email`,placeholder:`Email`,value:s,onChange:p}),t[6]=s,t[7]=m);let h;t[8]!==s||t[9]!==a||t[10]!==r?(h=()=>r(a.trim(),s.trim()),t[8]=s,t[9]=a,t[10]=r,t[11]=h):h=t[11];let g;t[12]!==s||t[13]!==a?(g=!a.trim()||!s.trim(),t[12]=s,t[13]=a,t[14]=g):g=t[14];let _;t[15]!==h||t[16]!==g?(_=(0,Z.jsx)(Y,{className:`flex-1`,onClick:h,disabled:g,children:`Save`}),t[15]=h,t[16]=g,t[17]=_):_=t[17];let v;t[18]===i?v=t[19]:(v=(0,Z.jsx)(Y,{variant:`ghost`,onClick:i,children:`Skip`}),t[18]=i,t[19]=v);let y;t[20]!==v||t[21]!==_?(y=(0,Z.jsxs)(`div`,{className:`flex gap-2`,children:[_,v]}),t[20]=v,t[21]=_,t[22]=y):y=t[22];let b;return t[23]!==y||t[24]!==f||t[25]!==m?(b=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[l,f,m,y]}),t[23]=y,t[24]=f,t[25]=m,t[26]=b):b=t[26],b}function Zl(e){let t=(0,$.c)(42),{open:n,onOpenChange:r,onSuccess:i,identityPrompt:a,reauth:o,transport:s}=e,c;t[0]===s?c=t[1]:(c=s??Vo(),t[0]=s,t[1]=c);let l=c,[u,d]=(0,Q.useState)(`device`),[f,p]=(0,Q.useState)(`auth`),[m,h]=(0,Q.useState)(null),g,_;t[2]===n?(g=t[3],_=t[4]):(g=()=>{n&&(d(`device`),p(`auth`),h(null))},_=[n],t[2]=n,t[3]=g,t[4]=_),(0,Q.useEffect)(g,_);let v;t[5]!==a||t[6]!==r||t[7]!==i?(v=function(e){h(e),a&&(!e.name||!e.email)?p(`identity`):(p(`done`),i?.(e),r(!1),X.success(`Signed in as @${e.login}`))},t[5]=a,t[6]=r,t[7]=i,t[8]=v):v=t[8];let y=v,b;t[9]!==m||t[10]!==r||t[11]!==i?(b=function(e,t){fetch(`/api/local-op/auth/status`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({setIdentity:{name:e,email:t}})}).catch(Ql);let n={...m??{login:``},name:e,email:t};p(`done`),i?.(n),r(!1),X.success(`Signed in as @${n.login}`)},t[9]=m,t[10]=r,t[11]=i,t[12]=b):b=t[12];let x=b,S;t[13]!==m||t[14]!==r||t[15]!==i?(S=function(){m&&(p(`done`),i?.(m),r(!1),X.success(`Signed in as @${m.login}`))},t[13]=m,t[14]=r,t[15]=i,t[16]=S):S=t[16];let C=S,w;t[17]===r?w=t[18]:(w=function(){r(!1)},t[17]=r,t[18]=w);let T=w,E=o?`Re-authenticate with GitHub`:`Sign in to GitHub`,D;t[19]===E?D=t[20]:(D=(0,Z.jsx)(vi,{children:(0,Z.jsx)(si,{children:E})}),t[19]=E,t[20]=D);let O;t[21]!==y||t[22]!==T||t[23]!==l||t[24]!==f||t[25]!==u?(O=f===`auth`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex gap-1 border-b pb-2 mb-1`,children:[(0,Z.jsx)(Y,{variant:u===`device`?`secondary`:`ghost`,size:`sm`,onClick:()=>d(`device`),children:`GitHub App`}),(0,Z.jsx)(Y,{variant:u===`pat`?`secondary`:`ghost`,size:`sm`,onClick:()=>d(`pat`),children:`Token`})]}),u===`device`?(0,Z.jsx)(Kl,{onSuccess:y,onCancel:T,transport:l}):(0,Z.jsx)(ql,{onSuccess:y,onCancel:T})]}),t[21]=y,t[22]=T,t[23]=l,t[24]=f,t[25]=u,t[26]=O):O=t[26];let k;t[27]!==m||t[28]!==x||t[29]!==C||t[30]!==f?(k=f===`identity`&&m&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`p`,{className:`text-sm font-medium`,children:[`Signed in as @`,m.login]}),(0,Z.jsx)(Xl,{login:m.login,onSave:x,onSkip:C})]}),t[27]=m,t[28]=x,t[29]=C,t[30]=f,t[31]=k):k=t[31];let A;t[32]!==k||t[33]!==O?(A=(0,Z.jsxs)(mi,{children:[O,k]}),t[32]=k,t[33]=O,t[34]=A):A=t[34];let j;t[35]!==A||t[36]!==D?(j=(0,Z.jsxs)(di,{className:`sm:max-w-md`,children:[D,A]}),t[35]=A,t[36]=D,t[37]=j):j=t[37];let M;return t[38]!==r||t[39]!==n||t[40]!==j?(M=(0,Z.jsx)(yi,{open:n,onOpenChange:r,children:j}),t[38]=r,t[39]=n,t[40]=j,t[41]=M):M=t[41],M}function Ql(){}function $l(e){let t=(0,$.c)(2),{className:n}=e,{channel:r}=Zr();if(r!==`beta`)return null;let i;return t[0]===n?i=t[1]:(i=(0,Z.jsx)(pn,{variant:`secondary`,"aria-label":`Beta channel`,"data-testid":`beta-badge`,className:n,children:`BETA`}),t[0]=n,t[1]=i),i}function eu(e){switch(e){case`receiving`:return`Receiving objects`;case`resolving`:return`Resolving deltas`;case`checking`:return`Checking out files`;case`init`:return`Initializing project`;case`done`:return`Complete`;default:return`Cloning`}}function tu(e){let t=e.trim();if(/^[\w.-]+\/[\w.-]+$/.test(t))return t.split(`/`)[1];try{return new URL(t.replace(/^git@([^:]+):/,`https://$1/`)).pathname.replace(/\.git$/,``).split(`/`).pop()??`repo`}catch{return t.split(`/`).pop()?.replace(/\.git$/,``)??`repo`}}function nu(e){let t=(0,$.c)(94),{open:n,onOpenChange:r,onSignIn:i,onCloneComplete:a,transport:o,authQueryTransport:s,pickParentFolder:c}=e,l;t[0]===o?l=t[1]:(l=o??Uo(),t[0]=o,t[1]=l);let u=l,d;t[2]===s?d=t[3]:(d=s??Lo(),t[2]=s,t[3]=d);let f=d,p=c!==void 0,[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(!1),[S,C]=(0,Q.useState)(``),[w,T]=(0,Q.useState)(!1),[E,D]=(0,Q.useState)(!1),O=(0,Q.useRef)(null),k=(0,Q.useRef)(null),A;t[4]!==n||t[5]!==f?(A=()=>{if(!n)return;let e=!1;return f.status().then(t=>{e||T(t.authenticated)}).catch(()=>{e||T(!1)}),()=>{e=!0}},t[4]=n,t[5]=f,t[6]=A):A=t[6];let j;t[7]===n?j=t[8]:(j=[n],t[7]=n,t[8]=j),(0,Q.useEffect)(A,j);let M;t[9]!==w||t[10]!==n||t[11]!==f?(M=()=>{if(!w||!n)return;let e=!1;return x(!0),f.repos().then(t=>{e||(y(t.ok?t.repos:[]),x(!1))}).catch(()=>{e||(y([]),x(!1))}),()=>{e=!0}},t[9]=w,t[10]=n,t[11]=f,t[12]=M):M=t[12];let N;t[13]!==w||t[14]!==n?(N=[w,n],t[13]=w,t[14]=n,t[15]=N):N=t[15],(0,Q.useEffect)(M,N);let P;t[16]===p?P=t[17]:(P=function(e){if(h(e),p)return;let t=tu(e);t&&_(`~/Documents/${t}`)},t[16]=p,t[17]=P);let F=P,I;t[18]===p?I=t[19]:(I=function(e){if(h(e.clone_url),p)return;let t=e.full_name.split(`/`)[1];_(`~/Documents/${t}`)},t[18]=p,t[19]=I);let L=I,R;t[20]!==g||t[21]!==a||t[22]!==r||t[23]!==c||t[24]!==u||t[25]!==m?(R=async function(){let e=m.trim();if(!e){X.error(`Enter a repository URL or owner/repo`);return}let t=g||``;if(c){D(!0);let n=await c();if(!n){D(!1);return}let r=tu(e);t=`${n.replace(/\/$/,``)}/${r}`}else D(!0);let n=X.loading(`Starting clone…`,{duration:1/0});k.current=n;let i=u.start({url:e,dir:t});O.current=i.cancel;try{let e=i.events[Symbol.asyncIterator](),t=await e.next();for(;!t.done;){let i=t.value;if(i.type===`progress`)X.loading(`${eu(i.phase)} — ${i.pct}%`,{id:n});else if(i.type===`complete`){X.success(`Clone complete — opening project`,{id:n}),r(!1),D(!1),O.current=null;let e=`port`in i?i.port:void 0;a?a({port:e,dir:i.dir}):e!==void 0&&(window.location.href=`http://localhost:${e}`);return}else if(i.type===`error`){X.error(`Clone failed: ${i.message}`,{id:n}),D(!1),O.current=null;return}t=await e.next()}X.error(`Clone stream ended unexpectedly — check if the clone completed`,{id:n}),D(!1),O.current=null}catch(e){console.error(`[CloneDialog] clone iteration failed:`,e),X.error(`Clone failed — connection error`,{id:n}),D(!1),O.current=null}},t[20]=g,t[21]=a,t[22]=r,t[23]=c,t[24]=u,t[25]=m,t[26]=R):R=t[26];let z=R,B;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(B=function(){O.current?.(),O.current=null,D(!1),X.dismiss(k.current??void 0)},t[27]=B):B=t[27];let V=B,H;t[28]!==E||t[29]!==r||t[30]!==p?(H=function(e){E||(r(e),e||(h(``),p||_(``),C(``)))},t[28]=E,t[29]=r,t[30]=p,t[31]=H):H=t[31];let U=H,W,G,ee,te,ne,re,ie,ae,oe,se;if(t[32]!==E||t[33]!==U||t[34]!==L||t[35]!==F||t[36]!==w||t[37]!==b||t[38]!==n||t[39]!==S||t[40]!==v||t[41]!==m){let e=v?.filter(e=>e.full_name.toLowerCase().includes(S.toLowerCase()));ee=yi,oe=n,se=U,G=di,ie=`sm:max-w-lg`,t[52]===Symbol.for(`react.memo_cache_sentinel`)?(ae=(0,Z.jsx)(vi,{children:(0,Z.jsx)(si,{children:`Clone from GitHub`})}),t[52]=ae):ae=t[52],W=mi,te=`flex flex-col gap-4`;let r;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`label`,{htmlFor:`clone-url`,className:`text-sm font-medium`,children:`Repository URL or owner/repo`}),t[53]=r):r=t[53];let i;t[54]===F?i=t[55]:(i=e=>F(e.target.value),t[54]=F,t[55]=i),t[56]!==E||t[57]!==i||t[58]!==m?(ne=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[r,(0,Z.jsx)(Jn,{id:`clone-url`,placeholder:`https://github.com/owner/repo or owner/repo`,value:m,onChange:i,disabled:E})]}),t[56]=E,t[57]=i,t[58]=m,t[59]=ne):ne=t[59],re=w&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Z.jsx)(`label`,{htmlFor:`repo-filter`,className:`text-sm font-medium`,children:`Your repositories`}),(0,Z.jsx)(Jn,{id:`repo-filter`,"aria-label":`Filter repositories`,placeholder:`Filter repositories…`,value:S,onChange:e=>C(e.target.value),disabled:E||b&&v===null}),(0,Z.jsx)(`div`,{className:`border rounded-md max-h-40 overflow-y-auto subtle-scrollbar`,"aria-busy":b&&v===null,children:b&&v===null?(0,Z.jsxs)(`output`,{className:`flex flex-col gap-1.5 px-3 py-2`,"aria-label":`Loading repositories`,children:[(0,Z.jsx)(Br,{className:`h-4 w-2/3`}),(0,Z.jsx)(Br,{className:`h-4 w-1/2`}),(0,Z.jsx)(Br,{className:`h-4 w-3/4`}),(0,Z.jsx)(Br,{className:`h-4 w-2/5`}),(0,Z.jsx)(Br,{className:`h-4 w-3/5`})]}):e?.length===0?(0,Z.jsx)(`p`,{className:`px-3 py-2 text-xs text-muted-foreground`,children:v?.length===0?`No repositories found.`:`No matches.`}):e?.map(e=>(0,Z.jsxs)(`button`,{type:`button`,className:`w-full text-left px-3 py-1.5 text-sm hover:bg-muted flex items-center gap-2 truncate disabled:opacity-50`,onClick:()=>L(e),disabled:E,children:[e.private&&(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:`🔒`}),e.full_name]},e.full_name))})]}),t[32]=E,t[33]=U,t[34]=L,t[35]=F,t[36]=w,t[37]=b,t[38]=n,t[39]=S,t[40]=v,t[41]=m,t[42]=W,t[43]=G,t[44]=ee,t[45]=te,t[46]=ne,t[47]=re,t[48]=ie,t[49]=ae,t[50]=oe,t[51]=se}else W=t[42],G=t[43],ee=t[44],te=t[45],ne=t[46],re=t[47],ie=t[48],ae=t[49],oe=t[50],se=t[51];let ce;t[60]!==E||t[61]!==w||t[62]!==i?(ce=!w&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,Z.jsx)(`span`,{children:`Browse your repos:`}),(0,Z.jsx)(Y,{variant:`link`,size:`sm`,className:`h-auto p-0`,onClick:()=>i?.(),disabled:E,children:`Sign in to GitHub`})]}),t[60]=E,t[61]=w,t[62]=i,t[63]=ce):ce=t[63];let le;t[64]!==E||t[65]!==g||t[66]!==p?(le=!p&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,Z.jsx)(`label`,{htmlFor:`clone-path`,className:`text-sm font-medium`,children:`Local path`}),(0,Z.jsx)(Jn,{id:`clone-path`,placeholder:`~/Documents/repo-name`,value:g,onChange:e=>_(e.target.value),disabled:E})]}),t[64]=E,t[65]=g,t[66]=p,t[67]=le):le=t[67];let ue;t[68]!==te||t[69]!==ne||t[70]!==re||t[71]!==ce||t[72]!==le?(ue=(0,Z.jsxs)(`div`,{className:te,children:[ne,re,ce,le]}),t[68]=te,t[69]=ne,t[70]=re,t[71]=ce,t[72]=le,t[73]=ue):ue=t[73];let K;t[74]!==W||t[75]!==ue?(K=(0,Z.jsx)(W,{children:ue}),t[74]=W,t[75]=ue,t[76]=K):K=t[76];let q;t[77]!==E||t[78]!==z||t[79]!==U||t[80]!==m||t[81]!==p?(q=(0,Z.jsx)(hi,{children:E?(0,Z.jsx)(Y,{variant:`outline`,className:`font-mono uppercase`,onClick:V,children:`Cancel`}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Y,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>U(!1),children:`Cancel`}),(0,Z.jsx)(Y,{onClick:()=>void z(),disabled:!m.trim(),"aria-describedby":p?`clone-picker-hint`:void 0,children:p?`Clone…`:`Clone`}),p&&(0,Z.jsx)(`span`,{id:`clone-picker-hint`,className:`sr-only`,children:`Opens a folder picker to choose where to clone the repository.`})]})}),t[77]=E,t[78]=z,t[79]=U,t[80]=m,t[81]=p,t[82]=q):q=t[82];let de;t[83]!==G||t[84]!==ie||t[85]!==ae||t[86]!==K||t[87]!==q?(de=(0,Z.jsxs)(G,{className:ie,children:[ae,K,q]}),t[83]=G,t[84]=ie,t[85]=ae,t[86]=K,t[87]=q,t[88]=de):de=t[88];let fe;return t[89]!==ee||t[90]!==oe||t[91]!==se||t[92]!==de?(fe=(0,Z.jsx)(ee,{open:oe,onOpenChange:se,children:de}),t[89]=ee,t[90]=oe,t[91]=se,t[92]=de,t[93]=fe):fe=t[93],fe}function ru(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`GitHub`}),r=(0,Z.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function iu(e){let t=(0,$.c)(5),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Open Knowledge icon`}),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`g`,{filter:`url(#filter0_d_ok)`,children:[(0,Z.jsx)(`path`,{d:`M66.8902 16.1017C58.2694 3.86669 46.1739 -0.690239 29.9182 2.17749C21.3995 3.67813 13.4602 9.555 8.67934 17.9009C3.93974 26.1701 2.98514 35.6533 6.05714 43.9166C9.31574 52.6868 16.7168 58.4752 24.2299 63.4231C25.7973 64.4562 26.1351 65.7172 26.3551 68.9896C26.5221 71.4625 26.799 75.6011 30.6842 77.7204C31.8176 78.3372 33.0648 78.6515 34.3946 78.6515C37.0796 78.6515 39.4033 77.3649 40.5189 76.7482C47.1049 73.1046 68.8878 59.7147 72.6453 40.4027C74.3444 31.6679 70.9797 21.9019 66.8922 16.1017H66.8902Z`,fill:`white`}),(0,Z.jsx)(`path`,{d:`M37.4214 71.154C28.7888 75.929 36.787 64.0397 27.7458 58.0843C21.6372 54.0616 14.788 49.0568 12.0499 41.6911C6.74463 27.4192 17.5438 10.8473 31.028 8.47262C45.1977 5.97613 54.6946 9.8947 61.6635 19.7844C65.2089 24.8167 67.6013 32.8365 66.3658 39.1828C63.6906 52.9341 49.073 64.7075 37.4214 71.154Z`,fill:`#69A3FF`}),(0,Z.jsx)(`path`,{d:`M52.7244 29.2638C53.4665 28.5217 54.6697 28.5217 55.4119 29.2638V29.2638C56.154 30.0059 56.154 31.2091 55.4119 31.9513L49.2589 38.1042L46.5715 35.4167L52.7244 29.2638Z`,fill:`#D5E5FF`}),(0,Z.jsx)(`path`,{d:`M55.4119 38.8821C56.154 39.6242 56.154 40.8274 55.4119 41.5696V41.5696C54.6698 42.3117 53.4665 42.3117 52.7244 41.5696L46.5715 35.4166L49.259 32.7292L55.4119 38.8821Z`,fill:`#D5E5FF`})]}),t[1]=r):r=t[1];let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`defs`,{children:(0,Z.jsxs)(`filter`,{id:`filter0_d_ok`,x:`-9.53674e-07`,y:`-0.0799994`,width:`77.3817`,height:`85.8743`,filterUnits:`userSpaceOnUse`,colorInterpolationFilters:`sRGB`,children:[(0,Z.jsx)(`feFlood`,{floodOpacity:`0`,result:`BackgroundImageFix`}),(0,Z.jsx)(`feColorMatrix`,{in:`SourceAlpha`,type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0`,result:`hardAlpha`}),(0,Z.jsx)(`feOffset`,{dy:`2.85714`}),(0,Z.jsx)(`feGaussianBlur`,{stdDeviation:`2.14286`}),(0,Z.jsx)(`feComposite`,{in2:`hardAlpha`,operator:`out`}),(0,Z.jsx)(`feColorMatrix`,{type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in2:`BackgroundImageFix`,result:`effect1_dropShadow_ok`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in:`SourceGraphic`,in2:`effect1_dropShadow_ok`,result:`shape`})]})}),t[2]=i):i=t[2];let a;return t[3]===e?a=t[4]:(a=(0,Z.jsxs)(`svg`,{role:`img`,"aria-label":`Open Knowledge icon`,fill:`none`,height:24,width:24,viewBox:`0 0 78 80`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var au=(0,Q.lazy)(()=>r(()=>import(`./McpConsentDialogBody-CJwPf_uv.js`),__vite__mapDeps([5,1,6,7,8,9]),import.meta.url));function ou(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(Di.subscribe,cu,su))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(au,{})}),e[0]=t):t=e[0],t}function su(){return!1}function cu(){return Di.getSnapshot()!==null}var lu=(e,t,n)=>No(e,t,n,`NavigatorApp`);function uu(e){let t=(0,$.c)(70),{bridge:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(!0),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(!1),[g,_]=(0,Q.useState)(`auth`),{channel:v}=Zr(),y;t[1]===n.project?y=t[2]:(y=()=>{let e=!1;return n.project.listRecent().then(t=>{e||a(t)}).catch(t=>{console.error(`[NavigatorApp] listRecent failed:`,t),e||l(t instanceof Error?t.message:`Failed to load recent projects.`)}).finally(()=>{e||s(!1)}),()=>{e=!0}},t[1]=n.project,t[2]=y);let b;t[3]===n?b=t[4]:(b=[n],t[3]=n,t[4]=b),(0,Q.useEffect)(y,b);let x;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(x=(e,t)=>lu(e,t,l),t[5]=x):x=t[5];let S=x,C;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(C=()=>d(!0),t[6]=C):C=t[6];let w=C,T;t[7]===n?T=t[8]:(T=()=>S(async()=>{let e=await n.dialog.openFolder();e&&await pu(n,e)},`Failed to open folder.`),t[7]=n,t[8]=T);let E=T,D;t[9]===n?D=t[10]:(D=()=>S(async()=>{let e=await n.dialog.createFolder();e&&await pu(n,e)},`Failed to create project folder.`),t[9]=n,t[10]=D);let O=D,k;t[11]===n?k=t[12]:(k=e=>S(async()=>{await pu(n,e)},`Failed to open project.`),t[11]=n,t[12]=k);let A=k,j=`flex h-screen w-screen flex-col overflow-hidden bg-primary-foreground dark:bg-background p-12 pb-2 text-foreground max-w-5xl space-y-10 mx-auto ${!o&&i.length===0?`justify-center`:``}`,M;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(iu,{className:`size-12 shrink-0`}),t[13]=M):M=t[13];let N;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`h1`,{className:`font-medium text-xl tracking-tight`,children:`Open Knowledge`}),(0,Z.jsx)($l,{})]}),t[14]=N):N=t[14];let P;t[15]===n.appVersion?P=t[16]:(P=(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-xs font-mono`,children:[`v`,n.appVersion]}),t[15]=n.appVersion,t[16]=P);let F;t[17]===v?F=t[18]:(F=v!==null&&(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-xs font-mono`,"data-testid":`navigator-channel-row`,children:[`Channel: `,v===`beta`?`Beta`:`Stable`]}),t[17]=v,t[18]=F);let I;t[19]!==P||t[20]!==F?(I=(0,Z.jsxs)(`header`,{className:`shrink-0 flex-wrap flex items-center gap-2.5`,children:[M,(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[N,P,F]})]}),t[19]=P,t[20]=F,t[21]=I):I=t[21];let L;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(du,{title:`Clone from GitHub`,description:`Bring a remote repository onto this machine.`,onClick:w,dataTestId:`nav-clone`,Icon:ru}),t[22]=L):L=t[22];let R;t[23]===E?R=t[24]:(R=(0,Z.jsx)(du,{title:`Open folder on disk`,description:`Open an existing folder as a project.`,onClick:E,dataTestId:`nav-open`,Icon:On}),t[23]=E,t[24]=R);let z;t[25]===O?z=t[26]:(z=(0,Z.jsx)(du,{title:`Start fresh`,description:`Create a new folder for a brand-new project.`,onClick:O,dataTestId:`nav-fresh`,Icon:co}),t[25]=O,t[26]=z);let B;t[27]!==R||t[28]!==z?(B=(0,Z.jsxs)(`section`,{className:`grid shrink-0 sm:grid-cols-3 gap-3`,children:[L,R,z]}),t[27]=R,t[28]=z,t[29]=B):B=t[29];let V;t[30]===c?V=t[31]:(V=c===null?null:(0,Z.jsxs)(`div`,{className:`mb-3 flex shrink-0 items-start justify-between gap-3 rounded-md border border-red-500/30 bg-red-500/10 px-3 py-2`,"data-testid":`nav-error-banner`,role:`alert`,children:[(0,Z.jsx)(`span`,{className:`text-red-700 text-xs dark:text-red-300`,children:c}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>l(null),className:`text-red-700 text-xs underline hover:no-underline dark:text-red-300`,"data-testid":`nav-error-dismiss`,children:`Dismiss`})]}),t[30]=c,t[31]=V);let H;t[32]!==o||t[33]!==A||t[34]!==i?(H=o?(0,Z.jsx)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(`div`,{className:`flex items-center justify-center h-full`,children:(0,Z.jsx)(Jt,{className:`size-4 animate-spin text-muted-foreground/60`})})}):i.length>0?(0,Z.jsxs)(`section`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,Z.jsx)(`h2`,{className:`mb-2 shrink-0 font-medium text-muted-foreground font-mono text-xs uppercase tracking-wide`,children:`Recent`}),(0,Z.jsx)(`ul`,{className:`min-h-0 flex-1 subtle-scrollbar overflow-y-auto space-y-0.5 -mx-4`,"data-testid":`nav-recent-list`,children:i.map(e=>(0,Z.jsx)(fu,{project:e,onOpen:()=>A(e.path)},e.path))})]}):null,t[32]=o,t[33]=A,t[34]=i,t[35]=H):H=t[35];let U;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(ou,{}),t[36]=U):U=t[36];let W;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>{p(e),e||h(!1)},t[37]=W):W=t[37];let G;t[38]===n?G=t[39]:(G=Ho(n),t[38]=n,t[39]=G);let ee=g===`identity`,te;t[40]===m?te=t[41]:(te=()=>{p(!1),m&&(h(!1),d(!0))},t[40]=m,t[41]=te);let ne;t[42]!==f||t[43]!==G||t[44]!==ee||t[45]!==te?(ne=(0,Z.jsx)(Zl,{open:f,onOpenChange:W,transport:G,identityPrompt:ee,onSuccess:te}),t[42]=f,t[43]=G,t[44]=ee,t[45]=te,t[46]=ne):ne=t[46];let re;t[47]===n?re=t[48]:(re=Wo(n),t[47]=n,t[48]=re);let ie;t[49]===n?ie=t[50]:(ie=Ro(n),t[49]=n,t[50]=ie);let ae;t[51]===n.dialog?ae=t[52]:(ae=()=>n.dialog.openFolder(),t[51]=n.dialog,t[52]=ae);let oe;t[53]===Symbol.for(`react.memo_cache_sentinel`)?(oe=()=>{d(!1),_(`auth`),h(!0),p(!0)},t[53]=oe):oe=t[53];let se;t[54]===n?se=t[55]:(se=e=>{let{dir:t}=e;S(()=>pu(n,t),`Failed to open cloned project.`)},t[54]=n,t[55]=se);let ce;t[56]!==u||t[57]!==re||t[58]!==ie||t[59]!==ae||t[60]!==se?(ce=(0,Z.jsx)(nu,{open:u,onOpenChange:d,transport:re,authQueryTransport:ie,pickParentFolder:ae,onSignIn:oe,onCloneComplete:se}),t[56]=u,t[57]=re,t[58]=ie,t[59]=ae,t[60]=se,t[61]=ce):ce=t[61];let le;return t[62]!==I||t[63]!==B||t[64]!==V||t[65]!==H||t[66]!==ne||t[67]!==ce||t[68]!==j?(le=(0,Z.jsxs)(`div`,{className:j,children:[I,B,V,H,U,ne,ce]}),t[62]=I,t[63]=B,t[64]=V,t[65]=H,t[66]=ne,t[67]=ce,t[68]=j,t[69]=le):le=t[69],le}function du(e){let t=(0,$.c)(14),{title:n,description:r,onClick:i,dataTestId:a,Icon:o}=e,s;t[0]===o?s=t[1]:(s=o?(0,Z.jsx)(o,{className:`size-4 shrink-0 text-muted-foreground`}):null,t[0]=o,t[1]=s);let c;t[2]===n?c=t[3]:(c=(0,Z.jsx)(`span`,{className:`font-medium text-gray-700 dark:text-foreground text-sm`,children:n}),t[2]=n,t[3]=c);let l;t[4]!==s||t[5]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s,c]}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=(0,Z.jsx)(`span`,{className:`text-muted-foreground text-xs leading-snug`,children:r}),t[7]=r,t[8]=u);let d;return t[9]!==a||t[10]!==i||t[11]!==l||t[12]!==u?(d=(0,Z.jsxs)(`button`,{type:`button`,onClick:i,"data-testid":a,className:`flex flex-col items-start gap-1.5 rounded-lg border border-border bg-card py-3.5 px-4 text-left transition-colors hover:bg-accent`,children:[l,u]}),t[9]=a,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function fu(e){let t=(0,$.c)(17),{project:n,onOpen:r}=e,i=`flex items-center justify-between ${n.missing?`opacity-50`:``}`,a;t[0]===n.name?a=t[1]:(a=(0,Z.jsx)(`span`,{className:`font-medium text-sm text-gray-700 dark:text-foreground`,children:n.name}),t[0]=n.name,t[1]=a);let o;t[2]===n.path?o=t[3]:(o=(0,Z.jsx)(`span`,{className:`truncate w-full text-muted-foreground text-xs`,children:n.path}),t[2]=n.path,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1 truncate`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===n.missing?c=t[8]:(c=n.missing?(0,Z.jsx)(pn,{className:`text-2xs rounded-sm`,variant:`warning`,children:`Missing`}):null,t[7]=n.missing,t[8]=c);let l;t[9]!==r||t[10]!==n.missing||t[11]!==s||t[12]!==c?(l=(0,Z.jsxs)(`button`,{type:`button`,onClick:r,disabled:n.missing,className:`flex min-w-0 flex-1 items-center text-left disabled:cursor-not-allowed py-3.5 px-4 hover:bg-accent rounded-lg gap-2 justify-between`,children:[s,c]}),t[9]=r,t[10]=n.missing,t[11]=s,t[12]=c,t[13]=l):l=t[13];let u;return t[14]!==i||t[15]!==l?(u=(0,Z.jsx)(`li`,{className:i,children:l}),t[14]=i,t[15]=l,t[16]=u):u=t[16],u}async function pu(e,t){await e.project.open({path:t,target:`new-window`})}var mu=e=>{let t=(0,$.c)(8),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{theme:r}=We(),i=r===void 0?`system`:r,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={success:(0,Z.jsx)(Ne,{className:`size-4`}),info:(0,Z.jsx)(yr,{className:`size-4`}),warning:(0,Z.jsx)(Oe,{className:`size-4`}),error:(0,Z.jsx)(io,{className:`size-4`}),loading:(0,Z.jsx)(Jt,{className:`size-4 animate-spin`})},o={"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},t[2]=a,t[3]=o):(a=t[2],o=t[3]);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={classNames:{toast:`cn-toast`}},t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsx)(oi,{theme:i,className:`toaster group`,icons:a,style:o,toastOptions:s,...n}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c};function hu(e){let{apiOrigin:t}=e;if(!t)return;let n=Symbol.for(`ok.desktop.fetchRewrite`);if(window.fetch[n])return;let r=window.fetch.bind(window),i=((e,n)=>{if(typeof e==`string`)return r(gu(e,t),n);if(e instanceof URL)return e.pathname.startsWith(`/api/`)&&(e.origin===window.location.origin||e.protocol===`file:`)?r(t+(e.pathname+e.search+e.hash),n):r(e,n);try{let i=new URL(e.url,window.location.origin);if(i.pathname.startsWith(`/api/`)){let a=i.pathname+i.search+i.hash;return r(new Request(t+a,e),n)}}catch{}return r(e,n)});i[n]=!0,window.fetch=i}function gu(e,t){return e.startsWith(`/api/`)?t+e:e}function _u(e){return`#/${encodeURIComponent(e)}`}function vu(e){let t=e.bridge;if(!t)return;let n=e.setHash??(e=>{window.location.hash=e});return t.onDeepLink(e=>{n(_u(e.doc))})}function yu(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function bu(){return!0}function xu(e){return bu()?e:e.map(e=>{let t=e.name??`unknown`,n=yu(t);return e.extend({onBeforeCreate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;Wt(`ok/cold/ext-${n}-on-before-create`,{ext:t,hook:`onBeforeCreate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onCreate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;Wt(`ok/cold/ext-${n}-on-create`,{ext:t,hook:`onCreate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onUpdate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;Wt(`ok/cold/ext-${n}-on-update`,{ext:t,hook:`onUpdate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onDestroy(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;Wt(`ok/cold/ext-${n}-on-destroy`,{ext:t,hook:`onDestroy`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}}})})}var Su=`Update ready`,Cu=`Relaunch`,wu=`Release notes`,Tu=`Updates paused`,Eu=`Download`,Du=`Continue to Stable`,Ou=`Stay on Beta`,ku=`Reset and Continue to Stable`,Au=`Stay on Beta`,ju=`Relaunch failed — please restart manually`,Mu=`Channel switch failed — please try again`,Nu=`Recovery action failed — please try again`;function Pu(e,t){let n=t instanceof Error&&t.message?t.message:``;return n?`${e}: ${n}`:e}function Fu(e){return`Updated to v${e}`}function Iu(e,t){return`Switching to Stable will replace your current version (${e}) with the latest stable (${t}). Some recent settings or data from beta may be lost.`}function Lu(e){return`Your settings and recent projects were saved by a newer build than this one (v${e}). Reset to defaults, or stay on Beta to keep them.`}var Ru=0,zu=0,Bu=1,Vu=1,Hu=2,Uu=3;function Wu(e,t,n=()=>{}){let r=[];return r.push(e.onUpdateDownloaded(({version:r})=>{let i=`update-downloaded-${r}`;t({id:i,body:Su,priority:Hu,action:{label:Cu,onClick:()=>{e.update.relaunchNow().then(()=>{n(i)},e=>{t({id:`relaunch-error-${r}`,body:Pu(ju,e),variant:`error`,priority:Bu})})}}})})),r.push(e.onWhatsNew(({version:n,releaseUrl:r})=>{t({id:`whats-new-${n}`,body:Fu(n),priority:Uu,action:{label:wu,onClick:()=>{e.shell.openExternal(r)}}})})),r.push(e.onUpdateStuckHint(({downloadUrl:n})=>{t({id:`update-stuck-hint`,body:Tu,priority:zu,action:{label:Eu,onClick:()=>{e.shell.openExternal(n)}}})})),r.push(e.onUpdateDowngradeWarning(({currentVersion:r,targetVersion:i})=>{let a=`downgrade-warning-${r}-${i}`,o=`downgrade-error-${r}-${i}`,s=e=>{n(a),t({id:o,body:Pu(Mu,e),variant:`error`,priority:Bu})};t({id:a,body:Iu(r,i),priority:Vu,action:{label:Du,onClick:()=>{e.update.confirmDowngrade().then(()=>{n(a)},s)}},secondaryAction:{label:Ou,onClick:()=>{e.update.setChannel(`beta`).then(()=>{n(a)},s)}}})})),()=>{for(let e of r)e()}}function Gu(e,t,n,r=()=>{}){let i=`schema-incompatibility-${t.persistedSchemaVersion}`,a=`schema-incompatibility-error-${t.persistedSchemaVersion}`,o=e=>{r(i),n({id:a,body:Pu(Nu,e),variant:`error`,priority:Ru})};n({id:i,body:Lu(t.currentBuild),priority:Ru,action:{label:ku,onClick:()=>{e.state.resetIncompatible().then(()=>{r(i)},o)}},secondaryAction:{label:Au,onClick:()=>{e.update.setChannel(`beta`).then(()=>{r(i)},o)}}})}var Ku=[],qu=new Set,Ju=!1;function Yu(){for(let e of qu)e()}function Xu(e){let t=Ku.findIndex(t=>t.id===e.id);if(t===-1)Ku=[...Ku,e];else{let n=Ku.slice();n[t]=e,Ku=n}Yu()}function Zu(e){let t=Ku.filter(t=>t.id!==e);t.length!==Ku.length&&(Ku=t,Yu())}function Qu(){return Ku}function $u(e){return qu.add(e),()=>{qu.delete(e)}}function ed(){if(Ju||typeof window>`u`)return;let e=window.okDesktop;e&&(Ju=!0,Wu(e,Xu,Zu),e.state.query().then(t=>{t.schemaIncompatibility&&Gu(e,t.schemaIncompatibility,Xu,Zu)},e=>{console.warn(`[update-notices-store] bridge.state.query() failed`,e)}))}var td=`ok-omnibar-recents-v1`,nd=10;function rd(e){return typeof e==`object`&&!!e&&(e.kind===`file`||e.kind===`folder`)&&typeof e.path==`string`&&typeof e.lastOpenedAt==`string`}function id(e){if(e)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function ad(e,t){return`${e}:${t}`}function od(e){let t=id(e);if(!t)return[];try{let e=t.getItem(td);if(!e)return[];let n=JSON.parse(e);return Array.isArray(n)?n.filter(rd).slice(0,nd):[]}catch{return[]}}function sd(e,t){let n=id(t);if(n)try{n.setItem(td,JSON.stringify(e.slice(0,nd)))}catch(e){console.warn(`[omnibar] Failed to save recent entries:`,e)}}function cd(e,t){return[t,...e.filter(e=>e.kind!==t.kind||e.path!==t.path)].slice(0,nd)}function ld(e,t){return e.filter(e=>t.has(ad(e.kind,e.path)))}var ud=50,dd=30,fd=``,pd=null;function md(e){return e.trim().toLowerCase()}function hd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function gd(e){let t=e.trim();return t?[...new Set(t.split(/\s+/).filter(Boolean))].sort((e,t)=>t.length-e.length):[]}function _d(e,t,n=new Map,r=new Map){let i=[];for(let t of e){let e=r.get(t)?.modified,a=n.get(t);i.push({kind:`file`,path:t,name:rt(t),...a?{title:a}:{},...e?{modifiedTs:Date.parse(e)}:{}})}for(let e of t)i.push({kind:`folder`,path:e,name:rt(e)});return i.sort((e,t)=>{let n=e.path.localeCompare(t.path);return n===0?e.kind===t.kind?0:e.kind===`folder`?-1:1:n}),i}function vd(e){return ye({kind:e.kind===`file`?`page`:`folder`,path:e.path,title:e.title??e.name,modifiedTs:e.modifiedTs??0})}function yd(e){return{entries:e,byId:new Map(e.map(e=>[`${e.kind===`file`?`page`:`folder`}:${e.path}`,e])),corpus:Fe(e.map(vd))}}function bd(e){return e.map(e=>`${e.kind}\u0000${e.path}\u0000${e.title??``}\u0000${e.modifiedTs??0}`).join(``)}function xd(e){let t=bd(e);return pd&&fd===t?pd:(fd=t,pd=yd(e),pd)}function Sd(e,t,n=ud){return Cd(xd(e),t,n)}function Cd(e,t,n=ud){let r=md(t);return r?ce(e.corpus,r,{intent:`omnibar`,limit:n,scopes:[`page`,`folder`]}).map(t=>e.byId.get(t.document.id)).filter(e=>e!==void 0):e.entries.slice(0,20)}function wd(e,t){let n=gd(t);if(n.length===0||e.length===0)return[{text:e,match:!1,start:0}];let r=RegExp(`(${n.map(hd).join(`|`)})`,`gi`),i=[],a=0;for(let t of e.matchAll(r)){let n=t.index??0;n>a&&i.push({text:e.slice(a,n),match:!1,start:a}),i.push({text:t[0],match:!0,start:n}),a=n+t[0].length}return a<e.length&&i.push({text:e.slice(a),match:!1,start:a}),i.length>0?i:[{text:e,match:!1,start:0}]}function Td(e){if(e.kind!==`page`&&e.kind!==`folder`||typeof e.path!=`string`)return null;let t=rt(e.path);return{kind:e.kind===`page`?`file`:`folder`,path:e.path,name:t,...e.title&&{title:e.title},...e.snippet&&{snippet:e.snippet},...typeof e.score==`number`&&{score:e.score}}}async function Ed(e,t={}){let n=e.trim();if(!n)return[];let r=await fetch(`/api/search`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({query:n,intent:`full_text`,scopes:[`page`,`folder`,`content`],limit:t.limit??dd}),signal:t.signal});if(!r.ok)throw Error(`Search failed with status ${r.status}`);let i=await r.json();if(i.ok!==!0)throw Error(i.error??`Search failed`);return(i.results??[]).map(Td).filter(e=>!!e)}function Dd(e,t,n=[]){let r=md(t);return r?md([e,...n].join(` `)).includes(r):!0}var Od=`tag:`;function kd(e,t){if(!e.toLowerCase().startsWith(`tag:`))return{kind:`normal`,query:e};let n=e.slice(4).replace(/^\s+/,``).trim();return n&&t.has(n)?{kind:`tag-docs`,tagName:n}:{kind:`tag-list`,query:n}}function Ad(e,t){return Ln(e,t)}var jd=cr;async function Md(e){let t=await fetch(`/api/tags/${encodeURIComponent(e)}`);if(!t.ok)throw Error(`/api/tags/${e} responded with ${t.status}`);let n=await t.json();return n.ok&&Array.isArray(n.docs)?n.docs:[]}var Nd=`open-knowledge:doc-panel-tab`,Pd=null;function Fd(){let e=Pd;return Pd=null,e}function Id(e,t=typeof window>`u`?new EventTarget:window){Pd=e,t.dispatchEvent(new CustomEvent(Nd,{detail:{tab:e}}))}function Ld(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail?.tab:void 0;n&&e(n)};return t.addEventListener(Nd,n),()=>t.removeEventListener(Nd,n)}var Rd=1,zd=.9,Bd=.8,Vd=.17,Hd=.1,Ud=.999,Wd=.9999,Gd=.99,Kd=/[\\\/_+.#"@\[\(\{&]/,qd=/[\\\/_+.#"@\[\(\{&]/g,Jd=/[\s-]/,Yd=/[\s-]/g;function Xd(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Rd:Gd;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=Xd(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Rd:Kd.test(e.charAt(l-1))?(d*=Bd,p=e.slice(i,l-1).match(qd),p&&i>0&&(d*=Ud**+p.length)):Jd.test(e.charAt(l-1))?(d*=zd,m=e.slice(i,l-1).match(Yd),m&&i>0&&(d*=Ud**+m.length)):(d*=Vd,i>0&&(d*=Ud**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Wd)),(d<Hd&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=Xd(e,t,n,r,l+1,a+2,o),f*Hd>d&&(d=f*Hd)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Zd(e){return e.toLowerCase().replace(Yd,` `)}function Qd(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,Xd(e,t,Zd(e),Zd(t),0,0,{})}var $d=`[cmdk-group=""]`,ef=`[cmdk-group-items=""]`,tf=`[cmdk-group-heading=""]`,nf=`[cmdk-item=""]`,rf=`${nf}:not([aria-disabled="true"])`,af=`cmdk-item-select`,of=`data-value`,sf=(e,t,n)=>Qd(e,t,n),cf=Q.createContext(void 0),lf=()=>Q.useContext(cf),uf=Q.createContext(void 0),df=()=>Q.useContext(uf),ff=Q.createContext(void 0),pf=Q.forwardRef((e,t)=>{let n=Df(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Df(()=>new Set),i=Df(()=>new Map),a=Df(()=>new Map),o=Df(()=>new Set),s=Tf(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,v=Ct(),y=Ct(),b=Ct(),x=Q.useRef(null),S=Af();Ef(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,C.emit()}},[u]),Ef(()=>{S(6,k)},[]);let C=Q.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)O(),E(),S(1,D);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(b);e?e.focus():(i=document.getElementById(v))==null||i.focus()}if(S(7,()=>{n.current.selectedItemId=A()?.id,C.emit()}),r||S(5,k),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}C.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),w=Q.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,T(t,r)),S(2,()=>{E(),C.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),S(3,()=>{O(),E(),n.current.value||D(),C.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();S(4,()=>{O(),t?.getAttribute(`id`)===e&&D(),C.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:v,inputId:b,labelId:y,listInnerRef:x}),[]);function T(e,t){let r=s.current?.filter??sf;return e?r(e,n.current.search,t):0}function E(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=x.current;j().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(ef);t?t.appendChild(e.parentElement===t?e:e.closest(`${ef} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${ef} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=x.current?.querySelector(`${$d}[${of}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function D(){let e=j().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(of);C.setState(`value`,e||void 0)}function O(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=T(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function k(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest($d)?.querySelector(tf))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return x.current?.querySelector(`${nf}[aria-selected="true"]`)}function j(){return Array.from(x.current?.querySelectorAll(rf)||[])}function M(e){let t=j()[e];t&&C.setState(`value`,t.getAttribute(of))}function N(e){var t;let n=A(),r=j(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&C.setState(`value`,a.getAttribute(of))}function P(e){let t=A()?.closest($d),n;for(;t&&!n;)t=e>0?Cf(t,$d):wf(t,$d),n=t?.querySelector(rf);n?C.setState(`value`,n.getAttribute(of)):N(e)}let F=()=>M(j().length-1),I=e=>{e.preventDefault(),e.metaKey?F():e.altKey?P(1):N(1)},L=e=>{e.preventDefault(),e.metaKey?M(0):e.altKey?P(-1):N(-1)};return Q.createElement(Et.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&I(e);break;case`ArrowDown`:I(e);break;case`p`:case`k`:g&&e.ctrlKey&&L(e);break;case`ArrowUp`:L(e);break;case`Home`:e.preventDefault(),M(0);break;case`End`:e.preventDefault(),F();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(af);t.dispatchEvent(e)}}}}},Q.createElement(`label`,{"cmdk-label":``,htmlFor:w.inputId,id:w.labelId,style:Nf},c),Mf(e,e=>Q.createElement(uf.Provider,{value:C},Q.createElement(cf.Provider,{value:w},e))))}),mf=Q.forwardRef((e,t)=>{let n=Ct(),r=Q.useRef(null),i=Q.useContext(ff),a=lf(),o=Tf(e),s=o.current?.forceMount??i?.forceMount;Ef(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=kf(n,r,[e.value,e.children,r],e.keywords),l=df(),u=Of(e=>e.value&&e.value===c.current),d=Of(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);Q.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(af,f),()=>t.removeEventListener(af,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:v,...y}=e;return Q.createElement(Et.div,{ref:St(r,t),...y,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),hf=Q.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=Ct(),s=Q.useRef(null),c=Q.useRef(null),l=Ct(),u=lf(),d=Of(e=>i||u.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Ef(()=>u.group(o),[]),kf(o,s,[e.value,e.heading,c]);let f=Q.useMemo(()=>({id:o,forceMount:i}),[i]);return Q.createElement(Et.div,{ref:St(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:d?void 0:!0},n&&Q.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),Mf(e,e=>Q.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},Q.createElement(ff.Provider,{value:f},e))))}),gf=Q.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=Q.useRef(null),a=Of(e=>!e.search);return!n&&!a?null:Q.createElement(Et.div,{ref:St(i,t),...r,"cmdk-separator":``,role:`separator`})}),_f=Q.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=df(),o=Of(e=>e.search),s=Of(e=>e.selectedItemId),c=lf();return Q.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),Q.createElement(Et.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),vf=Q.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=Q.useRef(null),o=Q.useRef(null),s=Of(e=>e.selectedItemId),c=lf();return Q.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),Q.createElement(Et.div,{ref:St(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Mf(e,e=>Q.createElement(`div`,{ref:St(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),yf=Q.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return Q.createElement(pi,{open:n,onOpenChange:r},Q.createElement(gi,{container:o},Q.createElement(ci,{"cmdk-overlay":``,className:i}),Q.createElement(bi,{"aria-label":e.label,"cmdk-dialog":``,className:a},Q.createElement(pf,{ref:t,...s}))))}),bf=Q.forwardRef((e,t)=>Of(e=>e.filtered.count===0)?Q.createElement(Et.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),xf=Q.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return Q.createElement(Et.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Mf(e,e=>Q.createElement(`div`,{"aria-hidden":!0},e)))}),Sf=Object.assign(pf,{List:vf,Item:mf,Input:_f,Group:hf,Separator:gf,Dialog:yf,Empty:bf,Loading:xf});function Cf(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function wf(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Tf(e){let t=Q.useRef(e);return Ef(()=>{t.current=e}),t}var Ef=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function Df(e){let t=Q.useRef();return t.current===void 0&&(t.current=e()),t}function Of(e){let t=df(),n=()=>e(t.snapshot());return Q.useSyncExternalStore(t.subscribe,n,n)}function kf(e,t,n,r=[]){let i=Q.useRef(),a=lf();return Ef(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(of,s),i.current=s}),i}var Af=()=>{let[e,t]=Q.useState(),n=Df(()=>new Map);return Ef(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function jf(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Mf({asChild:e,children:t},n){return e&&Q.isValidElement(t)?Q.cloneElement(jf(t),{ref:t.ref},n(t.props.children)):n(t)}var Nf={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`};function Pf(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Sf,{"data-slot":`command`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ff(e){let t=(0,$.c)(36),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({title:o,description:s,children:n,className:r,showCloseButton:c,commandProps:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=o===void 0?`Command Palette`:o,u=s===void 0?`Search for a command to run…`:s,d=c===void 0?!0:c,f;t[8]===i?f=t[9]:(f=i??{},t[8]=i,t[9]=f);let p,m;t[10]===f?(p=t[11],m=t[12]):({className:p,...m}=f,t[10]=f,t[11]=p,t[12]=m);let h;t[13]===l?h=t[14]:(h=(0,Z.jsx)(si,{children:l}),t[13]=l,t[14]=h);let g;t[15]===u?g=t[16]:(g=(0,Z.jsx)(ai,{children:u}),t[15]=u,t[16]=g);let _;t[17]!==h||t[18]!==g?(_=(0,Z.jsxs)(vi,{className:`sr-only`,children:[h,g]}),t[17]=h,t[18]=g,t[19]=_):_=t[19];let v;t[20]===r?v=t[21]:(v=J(`overflow-hidden p-0`,r),t[20]=r,t[21]=v);let y;t[22]===p?y=t[23]:(y=J(`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,p),t[22]=p,t[23]=y);let b;t[24]!==n||t[25]!==m||t[26]!==y?(b=(0,Z.jsx)(Pf,{className:y,...m,children:n}),t[24]=n,t[25]=m,t[26]=y,t[27]=b):b=t[27];let x;t[28]!==d||t[29]!==b||t[30]!==v?(x=(0,Z.jsx)(di,{className:v,showCloseButton:d,children:b}),t[28]=d,t[29]=b,t[30]=v,t[31]=x):x=t[31];let S;return t[32]!==a||t[33]!==x||t[34]!==_?(S=(0,Z.jsxs)(yi,{...a,children:[_,x]}),t[32]=a,t[33]=x,t[34]=_,t[35]=S):S=t[35],S}function If(e){let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(ho,{className:`size-4 shrink-0 opacity-50`}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=J(`flex w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a?(o=(0,Z.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex items-center gap-2 border-b px-3`,children:[i,(0,Z.jsx)(Sf.Input,{"data-slot":`command-input`,className:a,...r})]}),t[6]=r,t[7]=a,t[8]=o):o=t[8],o}function Lf(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`max-h-[300px] scroll-py-1 overflow-y-auto overflow-x-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Sf.List,{"data-slot":`command-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Rf(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(Sf.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e}),t[0]=e,t[1]=n),n}function zf(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-mono [&_[cmdk-group-heading]]:uppercase **:[[cmdk-group-heading]]:tracking-wider`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Sf.Group,{"data-slot":`command-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Bf(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 [&_svg:not([class*='text-'])]:text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Sf.Item,{"data-slot":`command-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Vf(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`ml-auto text-muted-foreground text-xs tracking-widest`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{"data-slot":`command-shortcut`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var Hf=`Switch Project…`,Uf=[{id:`claude-cowork`,displayName:`Claude Cowork`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,hasWebFallback:!0},{id:`claude-code`,displayName:`Claude Code`,appBrandName:`Claude Desktop`,schemes:[`claude:`],installUrl:`https://claude.com/download`,hasWebFallback:!0},{id:`codex`,displayName:`Codex`,appBrandName:`Codex Desktop`,schemes:[`codex:`],installUrl:`https://openai.com/codex`},{id:`cursor`,displayName:`Cursor`,schemes:[`cursor:`],installUrl:`https://cursor.com/`}],Wf=`#settings`;function Gf(e){let t=e.target;return t?.tagName===`INPUT`||t?.tagName===`TEXTAREA`||t?.isContentEditable?!1:!!((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key===`,`)}function Kf(e){let t=e.replace(/^#/,``);return t===`settings`||t===`settings/project`?`project`:t===`settings/user`?`user`:null}function qf(e){return`#settings/${e}`}function Jf(){return typeof window>`u`?``:window.location.hash}function Yf(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(Zf),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=()=>{n(Kf(Jf()))};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a=Xf,o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=e=>{if(typeof window>`u`)return;let t=qf(e);if(window.location.hash===t)return;let{pathname:r,search:i}=window.location;window.history.replaceState(null,``,`${r}${i}${t}`),n(e)},e[2]=o):o=e[2];let s=o,c;return e[3]===t?c=e[4]:(c={scope:t,close:a,setScope:s},e[3]=t,e[4]=c),c}function Xf(){typeof window>`u`||Kf(Jf())!==null&&window.history.back()}function Zf(){return Kf(Jf())}function Qf(){let e=(0,$.c)(3),[t,n]=(0,Q.useState)(tp),r,i;return e[0]===t?(r=e[1],i=e[2]):(r=()=>{if(t!==null||typeof window>`u`||window.okDesktop)return;let e=!0;return fetch(`/api/workspace`).then(async t=>{let r=await t.json().catch(ep);e&&t.ok&&r?.ok&&typeof r.contentDir==`string`&&(r.pathSeparator===`/`||r.pathSeparator===`\\`)&&n({contentDir:r.contentDir,pathSeparator:r.pathSeparator})}).catch($f),()=>{e=!1}},i=[t],e[0]=t,e[1]=r,e[2]=i),(0,Q.useEffect)(r,i),t}function $f(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function ep(){return null}function tp(){return np()}function np(e=typeof window>`u`?void 0:window){if(!e)return null;let t=e.okDesktop;return t?{contentDir:t.config.projectPath,pathSeparator:t.platform===`win32`?`\\`:`/`}:null}function rp(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function ip(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=await r.json(),n=typeof t.error==`string`?t.error:t.error?.message;n&&(e=n)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function ap(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?rp(e):ip()}var op=`ok:skill:cowork:installed`,sp=`1`,cp=250,lp=`/api/skill/install-state`;function up(e){return`${op}:v${e}`}var dp=new Map;async function fp(e={},t={}){let n=t.force?`__force__`:`__default__`,r=dp.get(n);if(r)return r;let i=pp(e,t);return dp.set(n,i),i.finally(()=>{dp.get(n)===i&&dp.delete(n)}),i}async function pp(e,t){let n=e.installer===void 0?ap():e.installer,r=mp(e.storage),i=e.fetchSnapshot??gp,a=e.serverTimeoutMs??cp,o=null;if(!t.force){try{o=await _p(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=up(o?.currentVersion??e.fallbackSkillVersion??hp());if(!t.force&&r?.getItem(s)===sp)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,sp)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function mp(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function hp(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function gp(){let e;try{e=await fetch(lp,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function _p(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function vp(e){return fp({},e)}function yp(){return fp({},{force:!0})}async function bp(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.openExternal)try{return await n.shell.openExternal(e),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:xp(e)}}let r=t.doc??(typeof document<`u`?document:void 0);if(!r)return{ok:!1,reason:`dispatch-error`,detail:`no DOM available`};try{let t=r.createElement(`a`);return t.href=e,t.rel=`noopener noreferrer`,/^https?:/i.test(e)&&(t.target=`_blank`),r.body.appendChild(t),t.click(),t.remove(),{ok:!0}}catch(e){return{ok:!1,reason:`dispatch-error`,detail:xp(e)}}}function xp(e){if(e instanceof Error)return e.message;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var Sp=1e3,Cp=1500;function wp(e){return new Promise(t=>setTimeout(t,e))}async function Tp(e,t={}){let n=t.spawnCursor??(typeof window<`u`?window.okDesktop?.shell.spawnCursor:void 0);if(!n)return{ok:!1,reason:`web-host-cursor-unsupported`};let r=await n(e.projectDir);if(!r.ok)return Ep(r.reason);let i=t.isCursorRunning&&await t.isCursorRunning().catch(()=>!1)?Sp:Cp;return await(t.sleep??wp)(i),bp(Xe(e),t.openExternalDeps)}function Ep(e){switch(e){case`not-installed`:return{ok:!1,reason:`not-installed`,detail:`cursor binary not found`};case`invalid-path`:return{ok:!1,reason:`invalid-payload`,detail:`cursor spawn: invalid path`};case`timeout`:return{ok:!1,reason:`dispatch-error`,detail:`cursor spawn: timeout`};case`spawn-error`:return{ok:!1,reason:`dispatch-error`,detail:`cursor spawn: spawn-error`};default:return{ok:!1,reason:`dispatch-error`,detail:`cursor spawn: ${String(e)}`}}}async function Dp(e,t={}){switch(e.target){case`claude-cowork`:return bp(ze({mode:`cowork`},e),t.openExternalDeps);case`claude-code`:return bp(ze({mode:`code`},e),t.openExternalDeps);case`codex`:return bp(Ce(e),t.openExternalDeps);case`cursor`:return Tp(e,{...t.cursorDeps,openExternalDeps:t.cursorDeps?.openExternalDeps??t.openExternalDeps});default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function Op(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}function kp(e,t,n){let r=n===`\\`?t.replaceAll(`/`,`\\`):t;return`${e.endsWith(n)?e.slice(0,-1):e}${n}${r}`}function Ap(e){return`${e}.md`}function jp(e){if(!e.docName||!e.workspace)return null;let t=Ap(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:kp(n,t,r)}}function Mp(e){return`Opened in ${e}.`}function Np(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function Pp(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function Fp(e,t,n,r){return t.ok?{target:e,host:n,outcome:`ok`,ts:r}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason}}async function Ip(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install Open Knowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`Open Knowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install Open Knowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:Pe(t.docContext)},a=await n.dispatchHandoff(i),o=Fp(e,a,n.isElectronHost()?`electron`:`web`,n.now().toISOString());await n.recordHandoff(o);let s=n.getDisplayName(e);if(a.ok)n.toast.success(Mp(s));else{let i=Pp(r),a=Np(s,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Ip(e,t,n,r+1)}}})}return a}function Lp(e){return Uf.find(t=>t.id===e)?.displayName??e}function Rp(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function zp(){return{dispatchHandoff:Dp,recordHandoff:Op,toast:{success:e=>{X.success(e)},error:(e,t)=>{X.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>Rp(),getDisplayName:Lp,ensureCoworkSkillInstalled:vp}}function Bp(){return{dispatch:(e,t)=>Ip(e,t,zp()),reinstallCoworkSkill:yp}}var Vp=[...new Set(Uf.flatMap(e=>e.schemes))];function Hp(e,t){let n=t.now?.()??Date.now(),r={};for(let i of Uf){if(!t.isElectronHost&&i.id===`cursor`){r[i.id]={installed:!1,lastChecked:n};continue}let a=i.schemes[0],o=a===void 0?void 0:e[a];if(!o){r[i.id]={installed:null};continue}r[i.id]={installed:o.installed,...o.displayName===void 0?{}:{displayName:o.displayName},lastChecked:n}}return r}function Up(e){return Hp({},e)}async function Wp(e){let t=e.schemes??Vp,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var Gp=Object.fromEntries(Vp.map(e=>[e,{installed:!1}]));async function Kp(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return Gp}if(!t.ok)return Gp;let n;try{n=await t.json()}catch{return Gp}if(typeof n!=`object`||!n||Array.isArray(n))return Gp;let r=n,i={};for(let e of Vp)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function qp(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Jp(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Up({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Hp(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!qp(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function Yp(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Xp(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Wp({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>Kp({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Zp(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(Qp),r=(0,Q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Jp(Xp());r.current=e;let t=e.subscribe(n);return e.probe(),()=>{t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,Q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Qp(){return Up({isElectronHost:Yp(),now:Date.now})}var $p=3e3,em=(e,t,n)=>Po(e,t,n,`CommandPalette`);function tm(e){window.location.assign(Ie(e))}function nm(e,t){return e?.kind===`folder`||e?.kind===`folder-index`?e.folderPath:ve(t)}function rm(e){let t=(0,$.c)(23),{entry:n,query:r,onSelect:i}=e,a=r===void 0?``:r,o=n.kind===`folder`?On:Ia,s;t[0]===n?s=t[1]:(s=`title`in n&&n.title?n.title:n.path.split(`/`).pop()??n.path,t[0]=n,t[1]=s);let c=s,l=`snippet`in n?n.snippet:void 0,u=`${n.kind} ${n.path}`,d=`command-palette-nav-${n.kind}-${n.path}`,f;t[2]===o?f=t[3]:(f=(0,Z.jsx)(o,{className:`mt-0.5`}),t[2]=o,t[3]=f);let p;t[4]!==a||t[5]!==c?(p=(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:(0,Z.jsx)(im,{query:a,text:c})}),t[4]=a,t[5]=c,t[6]=p):p=t[6];let m;t[7]!==n.path||t[8]!==a?(m=(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,children:(0,Z.jsx)(im,{query:a,text:n.path})}),t[7]=n.path,t[8]=a,t[9]=m):m=t[9];let h;t[10]!==a||t[11]!==l?(h=l?(0,Z.jsx)(`span`,{className:`max-h-10 overflow-hidden text-muted-foreground text-xs leading-relaxed`,children:(0,Z.jsx)(im,{query:a,text:l})}):null,t[10]=a,t[11]=l,t[12]=h):h=t[12];let g;t[13]!==p||t[14]!==m||t[15]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[p,m,h]}),t[13]=p,t[14]=m,t[15]=h,t[16]=g):g=t[16];let _;return t[17]!==i||t[18]!==u||t[19]!==d||t[20]!==f||t[21]!==g?(_=(0,Z.jsxs)(Bf,{value:u,onSelect:i,"data-testid":d,className:`items-start`,children:[f,g]}),t[17]=i,t[18]=u,t[19]=d,t[20]=f,t[21]=g,t[22]=_):_=t[22],_}function im(e){let t=(0,$.c)(5),{text:n,query:r}=e,i;t[0]!==r||t[1]!==n?(i=wd(n,r).map(am),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a;return t[3]===i?a=t[4]:(a=(0,Z.jsx)(Z.Fragment,{children:i}),t[3]=i,t[4]=a),a}function am(e){let t=`${e.start}:${e.match?`match`:`plain`}`;return e.match?(0,Z.jsx)(`mark`,{className:`rounded-sm bg-primary/10 px-0.5 font-semibold text-primary`,children:e.text},t):(0,Z.jsx)(`span`,{children:e.text},t)}function om(e){let t=(0,$.c)(105),{bridge:n,open:r,onOpenChange:i}=e,a=n===void 0?null:n,[o,s]=(0,Q.useState)(``),c=(0,Q.useDeferredValue)(o),l=c.trim(),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u=[],t[0]=u):u=t[0];let[d,f]=(0,Q.useState)(u),[p,m]=(0,Q.useState)(`idle`),h;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(h=[],t[1]=h):h=t[1];let[g,_]=(0,Q.useState)(h),v;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(v=[],t[2]=v):v=t[2];let[y,b]=(0,Q.useState)(v),[x,S]=(0,Q.useState)(null),C;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(C=[],t[3]=C):C=t[3];let[w,T]=(0,Q.useState)(C),[E,D]=(0,Q.useState)(`idle`),O;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(O=[],t[4]=O):O=t[4];let[k,A]=(0,Q.useState)(O),[j,M]=(0,Q.useState)(`idle`),N=(0,Q.useRef)(!1),P=(0,Q.useRef)(null),{activeDocName:F,activeTarget:I}=Qn(),{pages:L,pageTitles:R,pageMeta:z,folderPaths:B}=Ee(),V=Qf(),{states:H,refresh:U}=Zp(),{dispatch:W}=Bp(),G=jp({docName:F,workspace:V}),ee=_d(L,B,R,z),te=ld(y,new Set(ee.map(lm))),ne=a?.config.projectPath??null,re=a?g.filter(e=>e.path!==ne):[],ie;t[5]!==F||t[6]!==I?(ie=nm(I,F),t[5]=F,t[6]=I,t[7]=ie):ie=t[7];let ae=ie,oe=l===``?[]:Sd(ee,l,8),se,ce;t[8]!==i||t[9]!==r?(se=()=>{let e=function(e){e.key===`k`&&(Dt()?e.metaKey:e.ctrlKey)&&(e.preventDefault(),i(!r))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},ce=[i,r],t[8]=i,t[9]=r,t[10]=se,t[11]=ce):(se=t[10],ce=t[11]),(0,Q.useEffect)(se,ce);let le,ue;t[12]!==a||t[13]!==r||t[14]!==U?(le=()=>{if(r){if(b(od()),U(),a){let e=!1;return em(async()=>{let t=await a.project.listRecent();e||_(t)},`Failed to load recent projects.`),()=>{e=!0}}return}s(``),T([]),D(`idle`),N.current=!1,A([]),M(`idle`)},ue=[r,a,U],t[12]=a,t[13]=r,t[14]=U,t[15]=le,t[16]=ue):(le=t[15],ue=t[16]),(0,Q.useEffect)(le,ue);let K=kd(c,new Set(w.map(cm))),q=K.kind!==`normal`,de,fe;t[17]!==q||t[18]!==r?(de=()=>{if(!r||!q||N.current)return;N.current=!0,D(`loading`);let e=!1;return jd().then(t=>{e||(T(t),D(`success`))}).catch(t=>{e||(console.error(`[command-palette-tag] fetch tags failed`,t),T([]),D(`error`))}),()=>{e=!0}},fe=[r,q],t[17]=q,t[18]=r,t[19]=de,t[20]=fe):(de=t[19],fe=t[20]),(0,Q.useEffect)(de,fe);let pe=K.kind===`tag-docs`?K.tagName:null;(0,Q.useEffect)(()=>{if(!r||pe===null){A([]),M(`idle`);return}M(`loading`),A([]);let e=!1;return Md(pe).then(t=>{e||(A(t),M(`success`))}).catch(t=>{e||(console.error(`[command-palette-tag] fetch tag docs failed`,t),A([]),M(`error`))}),()=>{e=!0}},[r,pe]),(0,Q.useEffect)(()=>{if(!r||!l||q){f([]),m(`idle`);return}let e=new AbortController;m(`loading`),f([]);let t=!1,n=window.setTimeout(()=>{t=!0,e.abort(),f([]),m(`error`)},$p);return Ed(l,{signal:e.signal}).then(e=>{window.clearTimeout(n),f(e),m(`success`)}).catch(e=>{window.clearTimeout(n),!(e instanceof Error&&e.name===`AbortError`&&!t)&&(f([]),m(`error`))}),()=>{window.clearTimeout(n),e.abort()}},[r,l,q]);let me;t[21]===i?me=t[22]:(me=(e,t)=>{let n=t===void 0?`Command failed.`:t;i(!1),em(async()=>{await e()},n)},t[21]=i,t[22]=me);let he=me,ge;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(ge=function(e){let t={kind:e.kind,path:e.path,lastOpenedAt:new Date().toISOString()},n=cd(od(),t);sd(n),b(n)},t[23]=ge):ge=t[23];let _e=ge,ve;t[24]===i?ve=t[25]:(ve=function(e){i(!1),_e(e),tm(e.path)},t[24]=i,t[25]=ve);let ye=ve,be=!q&&l===``&&te.length>0,xe=d.length>0||p===`success`?d:oe,Se=!q&&xe.length>0,Ce=!q&&l!==``&&p===`loading`&&!Se,we;t[26]!==c||t[27]!==q?(we=!q&&Dd(`New file`,c,[`create file`]),t[26]=c,t[27]=q,t[28]=we):we=t[28];let Te=we,De;t[29]!==c||t[30]!==q?(De=!q&&Dd(`New folder`,c,[`create folder`]),t[29]=c,t[30]=q,t[31]=De):De=t[31];let Oe=De,ke;t[32]!==c||t[33]!==q?(ke=!q&&Dd(`Open graph`,c,[`graph panel network`]),t[32]=c,t[33]=q,t[34]=ke):ke=t[34];let Ae=ke,je=!q&&a!==null&&Dd(`Open folder on disk`,c,[`project`]),Me=!q&&a!==null&&Dd(`Switch Project…`,c,[`switch project navigator projects`]),Ne=!q&&Dd(`Settings`,c,[`preferences config`]),Pe=!q&&Dd(`Install for Claude Chat & Cowork (Desktop App)`,c,[`claude desktop install cowork`]),Fe=!q&&a!==null&&re.length>0&&(l===``||re.some(e=>Dd(`${e.name} ${e.path}`,c,[`recent project`]))),Ie=!q&&(l===``||Uf.some(e=>Dd(`Open in ${e.displayName}`,c,[e.id,`agent handoff`]))),Le=K.kind===`tag-list`?Ad(w,K.query):[],Re=K.kind===`tag-list`&&E!==`loading`&&Le.length===0,ze=K.kind===`tag-docs`&&j===`success`&&k.length===0,Be=q||be||Se||Ce||Te||Oe||Ae||je||Me||Ne||Pe||Fe||Ie,Ve;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=function(e){s(`${Od}${e}`)},t[35]=Ve):Ve=t[35];let He=Ve,Ue=Ff,We;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(We={shouldFilter:!1,className:`[&_[cmdk-input-wrapper]_svg]:h-4 [&_[cmdk-input-wrapper]_svg]:w-4 [&_[cmdk-item]_svg]:h-4 [&_[cmdk-item]_svg]:w-4`},t[36]=We):We=t[36];let Ge;t[37]===o?Ge=t[38]:(Ge=(0,Z.jsx)(If,{ref:P,value:o,onValueChange:s,placeholder:`Search files, folders, or commands…`}),t[37]=o,t[38]=Ge);let Ke;t[39]===q?Ke=t[40]:(Ke=()=>{s(q?``:Od),P.current?.focus()},t[39]=q,t[40]=Ke);let qe=q?`border-primary/30 bg-primary/10 text-primary`:`border-border bg-transparent text-muted-foreground hover:bg-accent hover:text-accent-foreground`,Je;t[41]===qe?Je=t[42]:(Je=J(`inline-flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-xs font-medium transition-colors`,qe),t[41]=qe,t[42]=Je);let Ye,Xe;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=(0,Z.jsx)(wn,{className:`size-3.5`}),Xe=(0,Z.jsx)(`span`,{children:`By tag`}),t[43]=Ye,t[44]=Xe):(Ye=t[43],Xe=t[44]);let Ze;t[45]!==q||t[46]!==Ke||t[47]!==Je?(Ze=(0,Z.jsx)(`div`,{className:`flex flex-wrap gap-1.5 border-b px-3 py-2`,children:(0,Z.jsxs)(`button`,{type:`button`,onClick:Ke,"data-testid":`command-palette-filter-tag`,"data-active":q,"aria-pressed":q,className:Je,children:[Ye,Xe]})}),t[45]=q,t[46]=Ke,t[47]=Je,t[48]=Ze):Ze=t[48];let Qe=Lf,$e;t[49]!==Se||t[50]!==Ce?($e=Ce&&!Se?(0,Z.jsx)(Rf,{children:`Searching…`}):null,t[49]=Se,t[50]=Ce,t[51]=$e):$e=t[51];let et=Be?null:(0,Z.jsx)(Rf,{children:p===`error`?`Search failed.`:`No matching commands.`}),tt=K.kind===`tag-list`?(0,Z.jsxs)(zf,{heading:K.query?`Tags matching "${K.query}"`:`All tags`,children:[E===`loading`?(0,Z.jsx)(Rf,{children:`Loading tags…`}):null,E===`error`?(0,Z.jsx)(Rf,{children:`Failed to load tags. Press Escape and re-open to retry.`}):null,Re?(0,Z.jsx)(Rf,{children:K.query?`No tags match "${K.query}".`:"No tags yet — author `#tagname` in any doc to populate the index."}):null,Le.map(e=>(0,Z.jsxs)(Bf,{value:`tag ${e.name}`,onSelect:()=>He(e.name),"data-testid":`command-palette-tag-${e.name}`,children:[(0,Z.jsx)(wn,{}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium`,children:e.name}),(0,Z.jsxs)(`span`,{className:`ml-auto shrink-0 text-[11px] text-muted-foreground tabular-nums`,children:[e.count,` `,e.count===1?`doc`:`docs`]})]},`tag:${e.name}`))]}):null,nt;t[52]!==i||t[53]!==K||t[54]!==ze||t[55]!==k||t[56]!==j?(nt=K.kind===`tag-docs`?(0,Z.jsxs)(zf,{heading:`Docs tagged #${K.tagName}`,children:[j===`loading`?(0,Z.jsx)(Rf,{children:`Loading docs…`}):null,j===`error`?(0,Z.jsx)(Rf,{children:`Failed to load docs. Press Escape and re-open to retry.`}):null,ze?(0,Z.jsx)(Rf,{children:`No docs registered under #${K.tagName}.`}):null,k.map(e=>{let t=e.title||e.docName.split(`/`).pop()||e.docName;return(0,Z.jsxs)(Bf,{value:`tag-doc ${e.docName}`,onSelect:()=>{i(!1),tm(e.docName)},"data-testid":`command-palette-tag-doc-${e.docName}`,className:`items-start`,children:[(0,Z.jsx)(Ia,{className:`mt-0.5`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:t}),(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,children:e.docName}),e.matchingTags.length>0&&e.matchingTags.some(e=>e!==K.tagName)?(0,Z.jsxs)(`span`,{className:`truncate text-muted-foreground text-[11px]`,children:[`via`,` `,e.matchingTags.filter(e=>e!==K.tagName).map(sm).join(`, `)]}):null]})]},`tag-doc:${e.docName}`)})]}):null,t[52]=i,t[53]=K,t[54]=ze,t[55]=k,t[56]=j,t[57]=nt):nt=t[57];let rt=be?(0,Z.jsx)(zf,{heading:`Recently opened`,children:te.map(e=>(0,Z.jsx)(rm,{entry:e,onSelect:()=>ye(e)},ad(e.kind,e.path)))}):null,it;t[58]!==ye||t[59]!==Se||t[60]!==l||t[61]!==xe?(it=Se?(0,Z.jsx)(zf,{heading:`Search`,children:xe.map(e=>(0,Z.jsx)(rm,{entry:e,query:l,onSelect:()=>ye(e)},ad(e.kind,e.path)))}):null,t[58]=ye,t[59]=Se,t[60]=l,t[61]=xe,t[62]=it):it=t[62];let at;t[63]!==F||t[64]!==i||t[65]!==S||t[66]!==Te||t[67]!==Oe||t[68]!==Ae?(at=Te||Oe||Ae?(0,Z.jsxs)(zf,{heading:`Commands`,children:[Te?(0,Z.jsxs)(Bf,{value:`new file create file`,onSelect:()=>{i(!1),S(`file`)},"data-testid":`command-palette-new-file`,children:[(0,Z.jsx)(an,{}),(0,Z.jsx)(`span`,{children:`New file`})]}):null,Oe?(0,Z.jsxs)(Bf,{value:`new folder create folder`,onSelect:()=>{i(!1),S(`folder`)},"data-testid":`command-palette-new-folder`,children:[(0,Z.jsx)(Ba,{}),(0,Z.jsx)(`span`,{children:`New folder`})]}):null,Ae?(0,Z.jsxs)(Bf,{value:`open graph graph panel network`,disabled:!F,onSelect:()=>{F&&(i(!1),Id(`graph`))},"data-testid":`command-palette-open-graph`,"aria-label":F?`Open graph`:`Open graph, No active doc`,children:[(0,Z.jsx)(ro,{}),(0,Z.jsx)(`span`,{children:`Open graph`}),F?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-auto text-muted-foreground text-xs`,children:`No active doc`})]}):null]}):null,t[63]=F,t[64]=i,t[65]=S,t[66]=Te,t[67]=Oe,t[68]=Ae,t[69]=at):at=t[69];let ot=Ie?(0,Z.jsx)(zf,{heading:`Open in agent`,children:Uf.filter(e=>Dd(`Open in ${e.displayName}`,c,[e.id,`agent handoff`])).map(e=>{let t=H[e.id],n=t.installed===!0&&G!==null,r=t.installed===null?`Detecting…`:t.installed===!1?`Not installed`:G===null?`No active doc`:null,a=r?`Open in ${e.displayName}, ${r}`:`Open in ${e.displayName}`;return(0,Z.jsxs)(Bf,{value:`open in ${e.displayName} ${e.id} agent`,disabled:!n,onSelect:()=>{!n||!G||(i(!1),W(e.id,G))},"data-testid":`command-palette-open-in-${e.id}`,"aria-label":a,children:[(0,Z.jsxs)(`span`,{className:`flex-1`,children:[`Open in `,e.displayName]}),r?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-auto text-muted-foreground text-xs`,children:r}):null]},e.id)})}):null,st=je||Me||Ne||Pe||Fe?(0,Z.jsxs)(zf,{heading:`Project`,children:[je&&a?(0,Z.jsxs)(Bf,{value:`open folder on disk project`,onSelect:()=>he(async()=>{let e=await a.dialog.openFolder();e&&await a.project.open({path:e,target:`new-window`})}),"data-testid":`command-palette-open-folder`,children:[(0,Z.jsx)(On,{}),(0,Z.jsx)(`span`,{children:`Open folder on disk…`}),(0,Z.jsx)(Vf,{children:`⌘O`})]}):null,Me&&a?(0,Z.jsxs)(Bf,{value:`switch-project navigator projects`,onSelect:()=>he(()=>a.navigator.open(),`Failed to open Project Navigator.`),"data-testid":`command-palette-switch-project`,children:[(0,Z.jsx)(Ja,{}),(0,Z.jsx)(`span`,{children:Hf}),(0,Z.jsx)(Vf,{children:`⌘⇧N`})]}):null,Ne?(0,Z.jsxs)(Bf,{value:`settings preferences config`,onSelect:()=>{i(!1),window.location.hash!==`#settings`&&(window.location.hash=Wf)},"data-testid":`command-palette-settings`,children:[(0,Z.jsx)(go,{}),(0,Z.jsx)(`span`,{children:`Settings…`}),(0,Z.jsx)(Vf,{children:`⌘,`})]}):null,Pe?(0,Z.jsxs)(Bf,{value:`install claude desktop cowork app`,onSelect:()=>{i(!1),window.location.hash=`#install-claude-desktop`},"data-testid":`command-palette-install-claude-desktop`,children:[(0,Z.jsx)($r,{}),(0,Z.jsx)(`span`,{children:`Install for Claude Chat & Cowork (Desktop App)…`})]}):null,Fe&&a?re.filter(e=>Dd(`${e.name} ${e.path}`,c,[`recent project`])).slice(0,10).map(e=>(0,Z.jsxs)(Bf,{value:`${e.name} ${e.path} recent project`,disabled:e.missing,onSelect:()=>he(()=>a.project.open({path:e.path,target:`new-window`}),`Failed to open project.`),"data-testid":`command-palette-recent-${e.path}`,children:[(0,Z.jsx)(kr,{}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col`,children:[(0,Z.jsx)(`span`,{className:`truncate font-medium`,children:e.name}),(0,Z.jsxs)(`span`,{className:`truncate text-muted-foreground text-xs`,children:[e.path,e.missing?` (missing)`:``]})]})]},e.path)):null]}):null,ct;t[70]!==Qe||t[71]!==$e||t[72]!==et||t[73]!==tt||t[74]!==nt||t[75]!==rt||t[76]!==it||t[77]!==at||t[78]!==ot||t[79]!==st?(ct=(0,Z.jsxs)(Qe,{className:`subtle-scrollbar`,children:[$e,et,tt,nt,rt,it,at,ot,st]}),t[70]=Qe,t[71]=$e,t[72]=et,t[73]=tt,t[74]=nt,t[75]=rt,t[76]=it,t[77]=at,t[78]=ot,t[79]=st,t[80]=ct):ct=t[80];let lt;t[81]!==Ue||t[82]!==i||t[83]!==r||t[84]!==We||t[85]!==Ge||t[86]!==Ze||t[87]!==ct?(lt=(0,Z.jsxs)(Ue,{open:r,onOpenChange:i,title:`Workspace Command Palette`,description:`Search files, folders, and commands for the current workspace.`,commandProps:We,children:[Ge,Ze,ct]}),t[81]=Ue,t[82]=i,t[83]=r,t[84]=We,t[85]=Ge,t[86]=Ze,t[87]=ct,t[88]=lt):lt=t[88];let ut=x===`file`,dt;t[89]===S?dt=t[90]:(dt=e=>{e||S(null)},t[89]=S,t[90]=dt);let ft;t[91]!==ae||t[92]!==ut||t[93]!==dt?(ft=(0,Z.jsx)(Pn,{open:ut,onOpenChange:dt,kind:`file`,initialDir:ae}),t[91]=ae,t[92]=ut,t[93]=dt,t[94]=ft):ft=t[94];let pt=x===`folder`,mt;t[95]===S?mt=t[96]:(mt=e=>{e||S(null)},t[95]=S,t[96]=mt);let ht;t[97]!==ae||t[98]!==pt||t[99]!==mt?(ht=(0,Z.jsx)(Pn,{open:pt,onOpenChange:mt,kind:`folder`,initialDir:ae}),t[97]=ae,t[98]=pt,t[99]=mt,t[100]=ht):ht=t[100];let gt;return t[101]!==lt||t[102]!==ft||t[103]!==ht?(gt=(0,Z.jsxs)(Z.Fragment,{children:[lt,ft,ht]}),t[101]=lt,t[102]=ft,t[103]=ht,t[104]=gt):gt=t[104],gt}function sm(e){return`#${e}`}function cm(e){return e.name}function lm(e){return ad(e.kind,e.path)}var um=500;function dm(e,t,n){return t?`terminal`:e===null&&n?`retrying`:`hidden`}function fm(e){return e===null?`no response`:e.kind===`null-collab`?`ok ui responded but server.lock has no port yet`:e.code===`network`?"network error (is `ok ui` running?)":e.code===`invalid-body`?`/api/config returned a malformed body`:`/api/config returned HTTP ${e.code}`}function pm(){let e=(0,$.c)(16),{collabUrl:t,collabTerminal:n,collabLastError:r,retryCollab:i}=Qn(),[a,o]=(0,Q.useState)(!1),s,c;e[0]!==n||e[1]!==t?(s=()=>{if(t!==null||n){o(!1);return}let e=setTimeout(()=>o(!0),um);return()=>clearTimeout(e)},c=[t,n],e[0]=n,e[1]=t,e[2]=s,e[3]=c):(s=e[2],c=e[3]),(0,Q.useEffect)(s,c);let l=dm(t,n,a);if(l===`hidden`)return null;if(l===`terminal`){let t;e[4]===r?t=e[5]:(t=fm(r),e[4]=r,e[5]=t);let n;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`code`,{className:`bg-red-100/60 px-1 rounded`,children:`ok status`}),e[6]=n):n=e[6];let a;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`code`,{className:`bg-red-100/60 px-1 rounded`,children:`.ok/local/last-spawn-error.log`}),e[7]=a):a=e[7];let o;e[8]===t?o=e[9]:(o=(0,Z.jsxs)(`span`,{children:[`Couldn't reach collab server — `,t,`. Try`,` `,n,` or check`,` `,a,`.`]}),e[8]=t,e[9]=o);let s;e[10]===i?s=e[11]:(s=(0,Z.jsx)(`button`,{type:`button`,onClick:i,className:`bg-red-950 text-red-50 px-2 py-0.5 rounded text-xs font-medium hover:bg-red-900`,children:`Retry`}),e[10]=i,e[11]=s);let c;return e[12]!==o||e[13]!==s?(c=(0,Z.jsxs)(`div`,{role:`alert`,"aria-live":`assertive`,className:`fixed top-0 inset-x-0 z-50 bg-red-500/95 text-red-950 text-sm text-center py-2 px-4 shadow-md flex items-center justify-center gap-3 flex-wrap`,children:[o,s]}),e[12]=o,e[13]=s,e[14]=c):c=e[14],c}let u;return e[15]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`div`,{role:`status`,"aria-live":`polite`,className:`fixed top-0 inset-x-0 z-50 bg-amber-500/95 text-amber-950 text-sm text-center py-2 px-4 shadow-md`,children:`Connecting — waiting for collab server…`}),e[15]=u):u=e[15],u}async function mm(e){let t=await fetch(`/api/tags/${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Server error: ${t.status} ${t.statusText}`);let n=await t.json();if(!n.ok)throw Error(n.error??`Failed to load tag membership`);return n.docs??[]}function hm(){let e=(0,$.c)(15),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={kind:`idle`},e[0]=a):a=e[0];let[o,s]=(0,Q.useState)(a),c=(0,Q.useRef)(0),l,u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{let e=function(e){let t=e.detail;if(!t||typeof t.value!=`string`)return;let r=c.current+=1;i(t.value),n(!0),s({kind:`loading`}),mm(t.value).then(e=>{c.current===r&&s({kind:`ready`,docs:e})}).catch(e=>{c.current===r&&s({kind:`error`,message:e instanceof Error?e.message:String(e)})})};return document.addEventListener(nr,e),()=>document.removeEventListener(nr,e)},u=[],e[1]=l,e[2]=u):(l=e[1],u=e[2]),(0,Q.useEffect)(l,u);let d;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=function(e){n(!1),window.location.assign(Ie(e))},e[3]=d):d=e[3];let f=d,p=r??``,m;e[4]===p?m=e[5]:(m=(0,Z.jsx)(vi,{children:(0,Z.jsxs)(si,{children:[`Documents tagged `,(0,Z.jsxs)(`span`,{className:`font-mono`,children:[`#`,p]})]})}),e[4]=p,e[5]=m);let h=r??``,g;e[6]!==o||e[7]!==h?(g=(0,Z.jsx)(mi,{children:(0,Z.jsx)(gm,{fetchState:o,tag:h,onSelectDoc:f})}),e[6]=o,e[7]=h,e[8]=g):g=e[8];let _;e[9]!==m||e[10]!==g?(_=(0,Z.jsxs)(di,{children:[m,g]}),e[9]=m,e[10]=g,e[11]=_):_=e[11];let v;return e[12]!==t||e[13]!==_?(v=(0,Z.jsx)(yi,{open:t,onOpenChange:n,children:_}),e[12]=t,e[13]=_,e[14]=v):v=e[14],v}function gm(e){let t=(0,$.c)(12),{fetchState:n,tag:r,onSelectDoc:i}=e;if(n.kind===`idle`||n.kind===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`tag-dialog-loading`,children:`Loading…`}),t[0]=e):e=t[0],e}if(n.kind===`error`){let e;return t[1]===n.message?e=t[2]:(e=(0,Z.jsx)(`p`,{className:`text-destructive text-sm`,"data-testid":`tag-dialog-error`,children:n.message}),t[1]=n.message,t[2]=e),e}if(n.docs.length===0){let e;return t[3]===r?e=t[4]:(e=(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`tag-dialog-empty`,children:[`Only the current document uses `,(0,Z.jsxs)(`span`,{className:`font-mono`,children:[`#`,r]}),`.`]}),t[3]=r,t[4]=e),e}let a;if(t[5]!==n.docs||t[6]!==i){let e;t[8]===i?e=t[9]:(e=e=>{let t=e.matchingTags??[];return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,className:`w-full rounded-md px-2 py-1.5 text-left text-sm hover:bg-muted focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-ring`,onClick:()=>i(e.docName),"data-testid":`tag-dialog-row`,children:[(0,Z.jsx)(`span`,{className:`block truncate font-medium`,children:e.title}),e.docName===e.title?null:(0,Z.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:e.docName}),t.length>0?(0,Z.jsx)(`span`,{className:`mt-1 flex flex-wrap items-center gap-1`,"data-testid":`tag-dialog-row-matches`,children:t.map(_m)}):null]})},e.docName)},t[8]=i,t[9]=e),a=n.docs.map(e),t[5]=n.docs,t[6]=i,t[7]=a}else a=t[7];let o;return t[10]===a?o=t[11]:(o=(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1`,"data-testid":`tag-dialog-list`,children:a}),t[10]=a,t[11]=o),o}function _m(e){return(0,Z.jsxs)(`span`,{"data-testid":`tag-dialog-row-match`,"data-tag":e,className:`tag pointer-events-none text-xs`,children:[`#`,e]},e)}var vm=`raw-mdx-nav`,ym=`ok-editor-mode-v1`,bm=[`wysiwyg`,`source`],xm=`wysiwyg`;function Sm(e){return bm.includes(e)}function Cm(e=localStorage){try{let t=e.getItem(ym);if(t===null)return xm;if(Sm(t))return t;console.warn(`[editor-mode] invalid persisted value, falling back to default`,{raw:t})}catch{}return xm}function wm(e=window,t=localStorage){let n=e.__OK_EDITOR_MODE__;return Sm(n)?n:Cm(t)}function Tm(e,t=localStorage){try{return t.setItem(ym,e),!0}catch(e){return console.warn(`[editor-mode] persist failed`,e),!1}}function Em(){let e=(0,$.c)(3),[t,n]=(0,Q.useState)(wm),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=function(e){n(e),Tm(e)},e[0]=r):r=e[0];let i=r,a;return e[1]===t?a=e[2]:(a=[t,i],e[1]=t,e[2]=a),a}function Dm(e){let t=(0,$.c)(21),{open:n,onResolved:r}=e,i=Ur(),a;t[0]!==r||t[1]!==i?(a=function(e){if(i===null){X.error(`Sync settings not yet loaded — try again in a moment`);return}let t=i(e);if(!t.ok){X.error(`Could not ${e?`enable sync`:`save sync preference`}: ${t.error}`);return}r()},t[0]=r,t[1]=i,t[2]=a):a=t[2];let o=a,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(vi,{children:(0,Z.jsx)(Xr,{})}),t[3]=s):s=t[3];let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(mi,{children:(0,Z.jsx)(Rr,{})}),t[4]=c):c=t[4];let l;t[5]===o?l=t[6]:(l=()=>o(!1),t[5]=o,t[6]=l);let u=i===null,d;t[7]!==l||t[8]!==u?(d=(0,Z.jsx)(Y,{variant:`ghost`,className:`uppercase font-mono`,onClick:l,disabled:u,children:`Keep disabled`}),t[7]=l,t[8]=u,t[9]=d):d=t[9];let f;t[10]===o?f=t[11]:(f=()=>o(!0),t[10]=o,t[11]=f);let p=i===null,m;t[12]!==f||t[13]!==p?(m=(0,Z.jsx)(Y,{onClick:f,disabled:p,children:`Enable auto-sync`}),t[12]=f,t[13]=p,t[14]=m):m=t[14];let h;t[15]!==d||t[16]!==m?(h=(0,Z.jsxs)(di,{className:`sm:max-w-lg`,showCloseButton:!1,children:[s,c,(0,Z.jsxs)(hi,{children:[d,m]})]}),t[15]=d,t[16]=m,t[17]=h):h=t[17];let g;return t[18]!==n||t[19]!==h?(g=(0,Z.jsx)(yi,{open:n,onOpenChange:Om,children:h}),t[18]=n,t[19]=h,t[20]=g):g=t[20],g}function Om(){}function km(e){let t=(0,$.c)(9),{onOpenResolver:n}=e,r=Wr();if(!r||r.state!==`conflict`)return null;let i=r.conflictCount,a=i>0?`${i} page${i===1?``:`s`}`:`Some pages`,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Oe,{className:`size-4 shrink-0`}),t[0]=o):o=t[0];let s=i===1?`has`:`have`,c;t[1]!==a||t[2]!==s?(c=(0,Z.jsxs)(`span`,{className:`flex-1`,children:[a,` `,s,` conflicting changes.`]}),t[1]=a,t[2]=s,t[3]=c):c=t[3];let l;t[4]===n?l=t[5]:(l=(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,className:`shrink-0 border-amber-400 dark:border-amber-700 text-amber-800 dark:text-amber-300 hover:bg-amber-100 dark:hover:bg-amber-900/50`,onClick:n,children:`Review and resolve`}),t[4]=n,t[5]=l);let u;return t[6]!==c||t[7]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm border-b bg-amber-50 dark:bg-amber-950/30 text-amber-800 dark:text-amber-300 shrink-0`,children:[o,c,l]}),t[6]=c,t[7]=l,t[8]=u):u=t[8],u}var Am=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}offset(t,n=t){return new e(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}};function jm(e,t,n,r,i,a){if(e==r)return[];let o=Vm(e,t,n,r,i,a),s=Hm(e,t+o,n,r,i+o,a);t+=o,n-=s,i+=o,a-=s;let c=n-t,l=a-i;if(!c||!l)return[new Am(t,n,i,a)];if(c>l){let o=e.slice(t,n).indexOf(r.slice(i,a));if(o>-1)return[new Am(t,t+o,i,i),new Am(t+o+l,n,a,a)]}else if(l>c){let o=r.slice(i,a).indexOf(e.slice(t,n));if(o>-1)return[new Am(t,t,i,i+o),new Am(n,n,i+o+c,a)]}if(c==1||l==1)return[new Am(t,n,i,a)];let u=Wm(e,t,n,r,i,a);if(u){let[o,s,c]=u;return jm(e,t,o,r,i,s).concat(jm(e,o+c,n,r,s+c,a))}return Fm(e,t,n,r,i,a)}var Mm=1e9,Nm=0,Pm=!1;function Fm(e,t,n,r,i,a){let o=n-t,s=a-i;if(Mm<1e9&&Math.min(o,s)>Mm*16||Nm>0&&Date.now()>Nm)return Math.min(o,s)>Mm*64?[new Am(t,n,i,a)]:Gm(e,t,n,r,i,a);let c=Math.ceil((o+s)/2);Lm.reset(c),Rm.reset(c);let l=(n,a)=>e.charCodeAt(t+n)==r.charCodeAt(i+a),u=(t,i)=>e.charCodeAt(n-t-1)==r.charCodeAt(a-i-1),d=(o-s)%2==0?null:Rm,f=d?null:Lm;for(let p=0;p<c;p++){if(p>Mm||Nm>0&&!(p&63)&&Date.now()>Nm)return Gm(e,t,n,r,i,a);let m=Lm.advance(p,o,s,c,d,!1,l)||Rm.advance(p,o,s,c,f,!0,u);if(m)return zm(e,t,n,t+m[0],r,i,a,i+m[1])}return[new Am(t,n,i,a)]}var Im=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let e=0;e<this.len;e++)this.vec[e]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,n,r,i,a,o){for(let s=-e+this.start;s<=e-this.end;s+=2){let c=r+s,l=s==-e||s!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,u=l-s;for(;l<t&&u<n&&o(l,u);)l++,u++;if(this.vec[c]=l,l>t)this.end+=2;else if(u>n)this.start+=2;else if(i){let e=r+(t-n)-s;if(e>=0&&e<this.len&&i.vec[e]!=-1)if(a){let n=i.vec[e];if(n>=t-l)return[n,r+n-e]}else{let n=t-i.vec[e];if(l>=n)return[l,u]}}}return null}},Lm=new Im,Rm=new Im;function zm(e,t,n,r,i,a,o,s){let c=!1;return!oh(e,r)&&++r==n&&(c=!0),!oh(i,s)&&++s==o&&(c=!0),c?[new Am(t,n,a,o)]:jm(e,t,r,i,a,s).concat(jm(e,r,n,i,s,o))}function Bm(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n<<=1;return n}function Vm(e,t,n,r,i,a){if(t==n||t==a||e.charCodeAt(t)!=r.charCodeAt(i))return 0;let o=Bm(n-t,a-i);for(let s=t,c=i;;){let i=s+o,l=c+o;if(i>n||l>a||e.slice(s,i)!=r.slice(c,l)){if(o==1)return s-t-+!oh(e,s);o>>=1}else if(i==n||l==a)return i-t;else s=i,c=l}}function Hm(e,t,n,r,i,a){if(t==n||i==a||e.charCodeAt(n-1)!=r.charCodeAt(a-1))return 0;let o=Bm(n-t,a-i);for(let s=n,c=a;;){let a=s-o,l=c-o;if(a<t||l<i||e.slice(a,s)!=r.slice(l,c)){if(o==1)return n-s-+!oh(e,s);o>>=1}else if(a==t||l==i)return n-a;else s=a,c=l}}function Um(e,t,n,r,i,a,o,s){let c=r.slice(i,a),l=null;for(;;){if(l||o<s)return l;for(let s=t+o;;){oh(e,s)||s++;let u=s+o;if(oh(e,u)||(u+=u==s+1?1:-1),u>=n)break;let d=e.slice(s,u),f=-1;for(;(f=c.indexOf(d,f+1))!=-1;){let o=Vm(e,u,n,r,i+f+d.length,a),c=Hm(e,t,s,r,i,i+f),p=d.length+o+c;(!l||l[2]<p)&&(l=[s-c,i+f-c,p])}s=u}if(s<0)return l;o>>=1}}function Wm(e,t,n,r,i,a){let o=n-t,s=a-i;if(o<s){let o=Wm(r,i,a,e,t,n);return o&&[o[1],o[0],o[2]]}return o<4||s*2<o?null:Um(e,t,n,r,i,a,Math.floor(o/4),-1)}function Gm(e,t,n,r,i,a){Pm=!0;let o=n-t,s=a-i,c;if(o<s){let s=Um(r,i,a,e,t,n,Math.floor(o/6),50);c=s&&[s[1],s[0],s[2]]}else c=Um(e,t,n,r,i,a,Math.floor(s/6),50);if(!c)return[new Am(t,n,i,a)];let[l,u,d]=c;return jm(e,t,l,r,i,u).concat(jm(e,l+d,n,r,u+d,a))}function Km(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];r.toA>i.fromA-t&&r.toB>i.fromB-t&&(e[n-1]=new Am(r.fromA,i.toA,r.fromB,i.toB),e.splice(n--,1))}}function qm(e,t,n){for(;;){Km(n,1);let r=!1;for(let i=0;i<n.length;i++){let a=n[i],o,s;(o=Vm(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new Am(a.fromA+o,a.toA,a.fromB+o,a.toB)),(s=Hm(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new Am(a.fromA,a.toA-s,a.fromB,a.toB-s));let c=a.toA-a.fromA,l=a.toB-a.fromB;if(c&&l)continue;let u=a.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:e.length)-a.toA;if(!u||!d)continue;let f=c?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);u<=f.length&&e.slice(a.fromA-u,a.fromA)==f.slice(f.length-u)?(n[i]=new Am(a.fromA-u,a.toA-u,a.fromB-u,a.toB-u),r=!0):d<=f.length&&e.slice(a.toA,a.toA+d)==f.slice(0,d)&&(n[i]=new Am(a.fromA+d,a.toA+d,a.fromB+d,a.toB+d),r=!0)}if(!r)break}return n}function Jm(e,t,n){for(let r=0,i=0;i<e.length;i++){let a=e[i],o=a.toA-a.fromA,s=a.toB-a.fromB;if(o&&s||o>3||s>3){let c=i==e.length-1?t.length:e[i+1].fromA,l=a.fromA-r,u=c-a.toA,d=th(t,a.fromA,l),f=eh(t,a.toA,u),p=a.fromA-d,m=f-a.toA;if((!o||!s)&&p&&m){let l=Math.max(o,s),[u,h,g]=o?[t,a.fromA,a.toA]:[n,a.fromB,a.toB];l>p&&t.slice(d,a.fromA)==u.slice(g-p,g)?(a=e[i]=new Am(d,d+o,a.fromB-p,a.toB-p),d=a.fromA,f=eh(t,a.toA,c-a.toA)):l>m&&t.slice(a.toA,f)==u.slice(h,h+m)&&(a=e[i]=new Am(f-o,f,a.fromB+m,a.toB+m),f=a.toA,d=th(t,a.fromA,a.fromA-r)),p=a.fromA-d,m=f-a.toA}if(p||m)a=e[i]=new Am(a.fromA-p,a.toA+m,a.fromB-p,a.toB+m);else if(!o){let t=rh(n,a.fromB,a.toB),r,o=t<0?-1:nh(n,a.toB,a.fromB);t>-1&&(r=t-a.fromB)<=u&&n.slice(a.fromB,t)==n.slice(a.toB,a.toB+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toB-o)<=l&&n.slice(a.fromB-r,a.fromB)==n.slice(o,a.toB)&&(a=e[i]=a.offset(-r))}else if(!s){let n=rh(t,a.fromA,a.toA),r,o=n<0?-1:nh(t,a.toA,a.fromA);n>-1&&(r=n-a.fromA)<=u&&t.slice(a.fromA,n)==t.slice(a.toA,a.toA+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toA-o)<=l&&t.slice(a.fromA-r,a.fromA)==t.slice(o,a.toA)&&(a=e[i]=a.offset(-r))}}r=a.toA}return Km(e,3),e}var Ym;try{Ym=RegExp(`[\\p{Alphabetic}\\p{Number}]`,`u`)}catch{}function Xm(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function Zm(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?+!!Xm(n):Ym?!ih(n)||t==e.length-1?+!!Ym.test(String.fromCharCode(n)):Ym.test(e.slice(t,t+2))?2:0:0}function Qm(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?+!!Xm(n):Ym?!ah(n)||t==1?+!!Ym.test(String.fromCharCode(n)):Ym.test(e.slice(t-2,t))?2:0:0}var $m=8;function eh(e,t,n){if(t==e.length||!Qm(e,t))return t;for(let r=t,i=t+n,a=0;a<$m;a++){let t=Zm(e,r);if(!t||r+t>i)return r;r+=t}return t}function th(e,t,n){if(!t||!Zm(e,t))return t;for(let r=t,i=t-n,a=0;a<$m;a++){let t=Qm(e,r);if(!t||r-t<i)return r;r-=t}return t}function nh(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function rh(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}var ih=e=>e>=55296&&e<=56319,ah=e=>e>=56320&&e<=57343;function oh(e,t){return!t||t==e.length||!ih(e.charCodeAt(t-1))||!ah(e.charCodeAt(t))}function sh(e,t,n){let r=n?.override;return r?r(e,t):(Mm=(n?.scanLimit??1e9)>>1,Nm=n?.timeout?Date.now()+n.timeout:0,Pm=!1,qm(e,t,jm(e,0,e.length,t,0,t.length)))}function ch(){return!Pm}function lh(e,t,n){return Jm(sh(e,t,n),e,t)}var uh=ji.define({combine:e=>e[0]}),dh=Fi.define(),fh=ji.define(),ph=Li.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(dh)&&(e=n.value);for(let n of t.state.facet(fh))e=n(e,t);return e}});function mh(e){let t=e.field(ph,!1);if(!t)return null;let n=e.facet(uh);return{chunks:t,side:n?n.side:null}}var hh=class e{constructor(e,t,n,r,i,a=!0){this.changes=e,this.fromA=t,this.toA=n,this.fromB=r,this.toB=i,this.precise=a}offset(t,n){return t||n?new e(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,n){return vh(lh(e.toString(),t.toString(),n),e,t,0,0,ch())}static updateA(e,t,n,r,i){return Sh(xh(e,r,!0,n.length),e,t,n,i)}static updateB(e,t,n,r,i){return Sh(xh(e,r,!1,t.length),e,t,n,i)}};function gh(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.to==e&&a.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[i.from,a.from]}function _h(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.from==e&&a.from==t?[e,t]:[i.to+1,a.to+1]}function vh(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length;s++){let c=e[s],[l,u]=gh(c.fromA+r,c.fromB+i,t,n),[d,f]=_h(c.toA+r,c.toB+i,t,n),p=[c.offset(-l+r,-u+i)];for(;s<e.length-1;){let a=e[s+1],[o,c]=gh(a.fromA+r,a.fromB+i,t,n);if(o>d+1&&c>f+1)break;p.push(a.offset(-l+r,-u+i)),[d,f]=_h(a.toA+r,a.toB+i,t,n),s++}o.push(new hh(p,l,Math.max(l,d),u,Math.max(u,f),a))}return o}var yh=1e3;function bh(e,t,n,r){let i=0,a=e.length;for(;;){if(i==a){let r=0,a=0;i&&({toA:r,toB:a}=e[i-1]);let o=t-(n?r:a);return[r+o,a+o]}let o=i+a>>1,s=e[o],[c,l]=n?[s.fromA,s.toA]:[s.fromB,s.toB];if(c>t)a=o;else if(l<=t)i=o+1;else return r?[s.fromA,s.fromB]:[s.toA,s.toB]}}function xh(e,t,n,r){let i=[];return t.iterChangedRanges((a,o,s,c)=>{let l=0,u=n?t.length:r,d=0,f=n?r:t.length;a>yh&&([l,d]=bh(e,a-yh,n,!0)),o<t.length-yh&&([u,f]=bh(e,o+yh,n,!1));let p=c-s-(o-a),m,[h,g]=n?[p,0]:[0,p];i.length&&(m=i[i.length-1]).toA>=l?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:u,toB:f,diffA:m.diffA+h,diffB:m.diffB+g}:i.push({fromA:l,toA:u,fromB:d,toB:f,diffA:h,diffB:g})}),i}function Sh(e,t,n,r,i){if(!e.length)return t;let a=[];for(let o=0,s=0,c=0,l=0;;o++){let u=o==e.length?null:e[o],d=u?u.fromA+s:n.length,f=u?u.fromB+c:r.length;for(;l<t.length;){let e=t[l];if(u&&(e.toA+s>d||e.toB+c>f))break;a.push(e.offset(s,c)),l++}if(!u)break;let p=u.toA+s+u.diffA,m=u.toB+c+u.diffB,h=lh(n.sliceString(d,p),r.sliceString(f,m),i);for(let e of vh(h,n,r,d,f,ch()))a.push(e);for(s+=u.diffA,c+=u.diffB;l<t.length;){let e=t[l];if(e.fromA+s>p&&e.fromB+c>m)break;l++}}return a}var Ch={scanLimit:500},wh=Hi.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=Ph(e))}update(e){(e.docChanged||e.viewportChanged||Eh(e.startState,e.state)||Dh(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=Ph(e.view))}},{decorations:e=>e.deco}),Th=Gi.low(Ui({class:`cm-changeGutter`,markers:e=>e.plugin(wh)?.gutter||ki.empty}));function Eh(e,t){return e.field(ph,!1)!=t.field(ph,!1)}function Dh(e,t){return e.facet(uh)!=t.facet(uh)}var Oh=Ki.line({class:`cm-changedLine`}),kh=Ki.mark({class:`cm-changedText`}),Ah=Ki.mark({tagName:`ins`,class:`cm-insertedLine`}),jh=Ki.mark({tagName:`del`,class:`cm-deletedLine`}),Mh=new class extends Bi{constructor(){super(...arguments),this.elementClass=`cm-changedLineGutter`}};function Nh(e,t,n,r,i,a){let o=n?e.fromA:e.fromB,s=n?e.toA:e.toB,c=0;if(o!=s){i.add(o,o,Oh),i.add(o,s,n?jh:Ah),a&&a.add(o,o,Mh);for(let l=t.iterRange(o,s-1),u=o;!l.next().done;){if(l.lineBreak){u++,i.add(u,u,Oh),a&&a.add(u,u,Mh);continue}let t=u+l.value.length;if(r)for(;c<e.changes.length;){let r=e.changes[c],a=o+(n?r.fromA:r.fromB),s=o+(n?r.toA:r.toB),l=Math.max(u,a),d=Math.min(t,s);if(l<d&&i.add(l,d,kh),s<t)c++;else break}u=t}}}function Ph(e){let t=e.state.field(ph),{side:n,highlightChanges:r,markGutter:i,overrideChunk:a}=e.state.facet(uh),o=n==`a`,s=new Wi,c=i?new Wi:null,{from:l,to:u}=e.viewport;for(let n of t){if((o?n.fromA:n.fromB)>=u)break;(o?n.toA:n.toB)>l&&(!a||!a(e.state,n,s,c))&&Nh(n,e.state.doc,o,r,s,c)}return{deco:s.finish(),gutter:c&&c.finish()}}var Fh=class extends Ri{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement(`div`);return e.className=`cm-mergeSpacer`,e.style.height=this.height+`px`,e}updateDOM(e){return e.style.height=this.height+`px`,!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},Ih=Fi.define({map:(e,t)=>e.map(t)}),Lh=Li.define({create:()=>Ki.none,update:(e,t)=>{for(let e of t.effects)if(e.is(Ih))return e.value;return e.map(t.changes)},provide:e=>Vi.decorations.from(e)}),Rh=.01;function zh(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function Bh(e,t,n){let r=new Wi,i=new Wi,a=e.state.field(Lh).iter(),o=t.state.field(Lh).iter(),s=0,c=0,l=0,u=0,d=e.viewport,f=t.viewport;for(let p=0;;p++){let m=p<n.length?n[p]:null,h=m?m.fromA:e.state.doc.length,g=m?m.fromB:t.state.doc.length;if(s<h){let n=e.lineBlockAt(s).top+l-(t.lineBlockAt(c).top+u);n<-Rh?(l-=n,r.add(s,s,Ki.widget({widget:new Fh(-n),block:!0,side:-1}))):n>Rh&&(u+=n,i.add(c,c,Ki.widget({widget:new Fh(n),block:!0,side:-1})))}if(h>s+1e3&&s<d.from&&h>d.from&&c<f.from&&g>f.from){let e=Math.min(d.from-s,f.from-c);s+=e,c+=e,p--}else if(m)s=m.toA,c=m.toB;else break;for(;a.value&&a.from<s;)l-=a.value.spec.widget.height,a.next();for(;o.value&&o.from<c;)u-=o.value.spec.widget.height,o.next()}for(;a.value;)l-=a.value.spec.widget.height,a.next();for(;o.value;)u-=o.value.spec.widget.height,o.next();let p=e.contentHeight+l-(t.contentHeight+u);p<Rh?r.add(e.state.doc.length,e.state.doc.length,Ki.widget({widget:new Fh(-p),block:!0,side:1})):p>Rh&&i.add(t.state.doc.length,t.state.doc.length,Ki.widget({widget:new Fh(p),block:!0,side:1}));let m=r.finish(),h=i.finish();zh(m,e.state.field(Lh))||e.dispatch({effects:Ih.of(m)}),zh(h,t.state.field(Lh))||t.dispatch({effects:Ih.of(h)})}var Vh=Fi.define({map:(e,t)=>t.mapPos(e)}),Hh=class extends Ri{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement(`div`);return t.className=`cm-collapsedLines`,t.textContent=e.state.phrase(`$ unchanged lines`,this.lines),t.addEventListener(`click`,t=>{let n=e.posAtDOM(t.target);e.dispatch({effects:Vh.of(n)});let{side:r,sibling:i}=e.state.facet(uh);i&&i().dispatch({effects:Vh.of(Uh(n,e.state.field(ph),r==`a`))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return`collapsed-unchanged-code`}};function Uh(e,t,n){let r=0,i=0;for(let a=0;;a++){let o=a<t.length?t[a]:null;if(!o||(n?o.fromA:o.fromB)>=e)return i+(e-r);[r,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}var Wh=Li.define({create(e){return Ki.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(Vh)&&(e=e.update({filter:e=>e!=n.value}));return e},provide:e=>Vi.decorations.from(e)});function Gh({margin:e=3,minSize:t=4}){return Wh.init(n=>Kh(n,e,t))}function Kh(e,t,n){let r=new Wi,i=e.facet(uh).side==`a`,a=e.field(ph),o=1;for(let s=0;;s++){let c=s<a.length?a[s]:null,l=s?o+t:1,u=c?e.doc.lineAt(i?c.fromA:c.fromB).number-1-t:e.doc.lines,d=u-l+1;if(d>=n&&r.add(e.doc.line(l).from,e.doc.line(u).to,Ki.replace({widget:new Hh(d),block:!0})),!c)break;o=e.doc.lineAt(Math.min(e.doc.length,i?c.toA:c.toB)).number}return r.finish()}var qh=Vi.styleModule.of(new Ji({".cm-mergeView":{overflowY:`auto`},".cm-mergeViewEditors":{display:`flex`,alignItems:`stretch`},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:`hidden`},".cm-merge-revert":{width:`1.6em`,flexGrow:0,flexShrink:0,position:`relative`},".cm-merge-revert button":{position:`absolute`,display:`block`,width:`100%`,boxSizing:`border-box`,textAlign:`center`,background:`none`,border:`none`,font:`inherit`,cursor:`pointer`}})),Jh=Vi.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:`auto !important`,overflowY:`visible !important`},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:`rgba(160, 128, 100, .08)`},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:`rgba(100, 160, 128, .08)`},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat`},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat`},"&light.cm-merge-b .cm-changedText":{background:`linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat`},"&dark.cm-merge-b .cm-changedText":{background:`linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat`},"&.cm-merge-b .cm-deletedText":{background:`#ff000033`},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:`none`},".cm-deletedChunk":{paddingLeft:`6px`,"& .cm-chunkButtons":{position:`absolute`,insetInlineEnd:`5px`},"& button":{border:`none`,cursor:`pointer`,color:`white`,margin:`0 2px`,borderRadius:`3px`,"&[name=accept]":{background:`#2a2`},"&[name=reject]":{background:`#d43`}}},".cm-collapsedLines":{padding:`5px 5px 5px 10px`,cursor:`pointer`,"&:before":{content:`"⦚"`,marginInlineEnd:`7px`},"&:after":{content:`"⦚"`,marginInlineStart:`7px`}},"&light .cm-collapsedLines":{color:`#444`,background:`linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)`},"&dark .cm-collapsedLines":{color:`#ddd`,background:`linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)`},".cm-changeGutter":{width:`3px`,paddingLeft:`1px`},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:`#e43`},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:`#fa9`},"&light.cm-merge-b .cm-changedLineGutter":{background:`#2b2`},"&dark.cm-merge-b .cm-changedLineGutter":{background:`#8f8`},".cm-inlineChangedLineGutter":{background:`#75d`}}),Yh=new qi,Xh=new qi,Zh=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||Ch;let t=[Gi.low(wh),Jh,qh,Lh,Vi.updateListener.of(e=>{this.measuring<0&&(e.heightChanged||e.viewportChanged)&&!e.transactions.some(e=>e.effects.some(e=>e.is(Ih)))&&this.measure()})],n=[uh.of({side:`a`,sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(Th);let r=Mi.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],Vi.editorAttributes.of({class:`cm-merge-a`}),Xh.of(n),t]}),i=[uh.of({side:`b`,sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(Th);let a=Mi.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],Vi.editorAttributes.of({class:`cm-merge-b`}),Xh.of(i),t]});this.chunks=hh.build(r.doc,a.doc,this.diffConf);let o=[ph.init(()=>this.chunks),Yh.of(e.collapseUnchanged?Gh(e.collapseUnchanged):[])];r=r.update({effects:Fi.appendConfig.of(o)}).state,a=a.update({effects:Fi.appendConfig.of(o)}).state,this.dom=document.createElement(`div`),this.dom.className=`cm-mergeView`,this.editorDOM=this.dom.appendChild(document.createElement(`div`)),this.editorDOM.className=`cm-mergeViewEditors`;let s=e.orientation||`a-b`,c=document.createElement(`div`);c.className=`cm-mergeViewEditor`;let l=document.createElement(`div`);l.className=`cm-mergeViewEditor`,this.editorDOM.appendChild(s==`a-b`?c:l),this.editorDOM.appendChild(s==`a-b`?l:c),this.a=new Vi({state:r,parent:c,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.a)}),this.b=new Vi({state:a,parent:l,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls==`b-to-a`,e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(e=>e.docChanged)){let n=e[e.length-1],r=e.reduce((e,t)=>e.compose(t.changes),zi.empty(e[0].startState.doc.length));this.chunks=t==this.a?hh.updateA(this.chunks,n.newDoc,this.b.state.doc,r,this.diffConf):hh.updateB(this.chunks,this.a.state.doc,n.newDoc,r,this.diffConf),t.update([...e,n.state.update({effects:dh.of(this.chunks)})]);let i=t==this.a?this.b:this.a;i.update([i.state.update({effects:dh.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if(`diffConfig`in e&&(this.diffConf=e.diffConfig),`orientation`in e){let t=e.orientation!=`b-a`;if(t!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let e=this.a.dom.parentNode,n=this.b.dom.parentNode;e.remove(),n.remove(),this.editorDOM.insertBefore(t?e:n,this.editorDOM.firstChild),this.editorDOM.appendChild(t?n:e),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent=``)}}if(`revertControls`in e||`renderRevertControl`in e){let t=!!this.revertDOM,n=this.revertToA,r=this.renderRevert;`revertControls`in e&&(t=!!e.revertControls,n=e.revertControls==`b-to-a`),`renderRevertControl`in e&&(r=e.renderRevertControl),this.setupRevertControls(t,n,r)}let t=`highlightChanges`in e,n=`gutter`in e,r=`collapseUnchanged`in e;if(t||n||r){let i=[],a=[];if(t||n){let r=this.a.state.facet(uh),o=n?e.gutter!==!1:r.markGutter,s=t?e.highlightChanges!==!1:r.highlightChanges;i.push(Xh.reconfigure([uh.of({side:`a`,sibling:()=>this.b,highlightChanges:s,markGutter:o}),o?Th:[]])),a.push(Xh.reconfigure([uh.of({side:`b`,sibling:()=>this.a,highlightChanges:s,markGutter:o}),o?Th:[]]))}if(r){let t=Yh.reconfigure(e.collapseUnchanged?Gh(e.collapseUnchanged):[]);i.push(t),a.push(t)}this.a.dispatch({effects:i}),this.b.dispatch({effects:a})}this.scheduleMeasure()}setupRevertControls(e,t,n){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement(`div`),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener(`mousedown`,e=>this.revertClicked(e)),this.revertDOM.className=`cm-merge-revert`):this.revertDOM&&(this.revertDOM.textContent=``)}scheduleMeasure(){this.measuring<0&&(this.measuring=(this.dom.ownerDocument.defaultView||window).requestAnimationFrame(()=>{this.measuring=-1,this.measure()}))}measure(){Bh(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,n=this.a.viewport,r=this.b.viewport;for(let i=0;i<this.chunks.length;i++){let a=this.chunks[i];if(a.fromA>n.to||a.fromB>r.to)break;if(a.fromA<n.from||a.fromB<r.from)continue;let o=this.a.lineBlockAt(a.fromA).top+`px`;for(;t&&+t.dataset.chunk<i;)t=Qh(t);t&&t.dataset.chunk==String(i)?(t.style.top!=o&&(t.style.top=o),t=t.nextSibling):e.insertBefore(this.renderRevertButton(o,i),t)}for(;t;)t=Qh(t)}renderRevertButton(e,t){let n;if(this.renderRevert)n=this.renderRevert();else{n=document.createElement(`button`);let e=this.a.state.phrase(`Revert this chunk`);n.setAttribute(`aria-label`,e),n.setAttribute(`title`,e),n.textContent=this.revertToLeft?`⇜`:`⇝`}return n.style.top=e,n.setAttribute(`data-chunk`,String(t)),n}revertClicked(e){let t=e.target,n;for(;t&&t.parentNode!=this.revertDOM;)t=t.parentNode;if(t&&(n=this.chunks[t.dataset.chunk])){let[t,r,i,a,o,s]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],c=t.state.sliceDoc(i,Math.max(i,a-1));i!=a&&s<=r.state.doc.length&&(c+=t.state.lineBreak),r.dispatch({changes:{from:o,to:Math.min(r.state.doc.length,s),insert:c},userEvent:`revert`}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function Qh(e){let t=e.nextSibling;return e.remove(),t}var $h=new class extends Bi{constructor(){super(...arguments),this.elementClass=`cm-deletedLineGutter`}},eg=Gi.low(Ui({class:`cm-changeGutter`,markers:e=>e.plugin(wh)?.gutter||ki.empty,widgetMarker:(e,t)=>t instanceof ag?$h:null}));function tg(e){let t=typeof e.original==`string`?Pi.of(e.original.split(/\r?\n/)):e.original,n=e.diffConfig||Ch;return[Gi.low(wh),ug,Jh,Vi.editorAttributes.of({class:`cm-merge-b`}),fh.of((e,t)=>{let r=t.effects.find(e=>e.is(ng));return r&&(e=hh.updateA(e,r.value.doc,t.startState.doc,r.value.changes,n)),t.docChanged&&(e=hh.updateB(e,t.state.field(rg),t.newDoc,t.changes,n)),e}),uh.of({highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1,syntaxHighlightDeletions:e.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:e.mergeControls??!0,overrideChunk:e.allowInlineDiffs?gg:void 0,side:`b`}),rg.init(()=>t),e.gutter===!1?[]:eg,e.collapseUnchanged?Gh(e.collapseUnchanged):[],ph.init(e=>hh.build(t,e.doc,n))]}var ng=Fi.define(),rg=Li.define({create:()=>Pi.empty,update(e,t){for(let n of t.effects)n.is(ng)&&(e=n.value.doc);return e}}),ig=new WeakMap,ag=class extends Ri{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||=this.buildDOM(e)}};function og(e,t,n){let r=ig.get(t.changes);if(r)return r;let i=Ki.widget({block:!0,side:-1,widget:new ag(r=>{let{highlightChanges:i,syntaxHighlightDeletions:a,syntaxHighlightDeletionsMaxLength:o,mergeControls:s}=e.facet(uh),c=document.createElement(`div`);if(c.className=`cm-deletedChunk`,s){let t=c.appendChild(document.createElement(`div`));t.className=`cm-chunkButtons`;let n=e=>{e.preventDefault(),sg(r,r.posAtDOM(c))},i=e=>{e.preventDefault(),cg(r,r.posAtDOM(c))};if(typeof s==`function`)t.appendChild(s(`accept`,n)),t.appendChild(s(`reject`,i));else{let r=t.appendChild(document.createElement(`button`));r.name=`accept`,r.textContent=e.phrase(`Accept`),r.onmousedown=n;let a=t.appendChild(document.createElement(`button`));a.name=`reject`,a.textContent=e.phrase(`Reject`),a.onmousedown=i}}if(n||t.fromA>=t.toA)return c;let l=r.state.field(rg).sliceString(t.fromA,t.endA),u=a&&e.facet(Ii),d=h(),f=t.changes,p=0,m=!1;function h(){let e=c.appendChild(document.createElement(`div`));return e.className=`cm-deletedLine`,e.appendChild(document.createElement(`del`))}function g(e,t,n){for(let r=e;r<t;){if(l.charAt(r)==`
|
|
14
|
-
`){d.firstChild||d.appendChild(document.createElement(`br`)),d=h(),r++;continue}let e=t,a=n+(m?` cm-deletedText`:``),o=!1,s=l.indexOf(`
|
|
15
|
-
`,r);if(s>-1&&s<t&&(e=s),i&&p<f.length){let t=Math.max(0,m?f[p].toA:f[p].fromA);t<=e&&(e=t,m&&p++,o=!0)}if(e>r){let t=document.createTextNode(l.slice(r,e));if(a){let e=d.appendChild(document.createElement(`span`));e.className=a,e.appendChild(t)}else d.appendChild(t);r=e}o&&(m=!m)}}if(u&&t.toA-t.fromA<=o){let t=u.parser.parse(l),n=0;Ni(t,{style:t=>Ai(e,t)},(e,t,r)=>{e>n&&g(n,e,``),g(e,t,r),n=t}),g(n,l.length,``)}else g(0,l.length,``);return d.firstChild||d.appendChild(document.createElement(`br`)),c})});return ig.set(t.changes,i),i}function sg(e,t){let{state:n}=e,r=t??n.selection.main.head,i=e.state.field(ph).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=e.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),o=e.state.field(rg);i.fromB!=i.toB&&i.toA<=o.length&&(a+=e.state.lineBreak);let s=zi.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:a},o.length);return e.dispatch({effects:ng.of({doc:s.apply(o),changes:s}),userEvent:`accept`}),!0}function cg(e,t){let{state:n}=e,r=t??n.selection.main.head,i=n.field(ph).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=n.field(rg).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(a+=n.lineBreak),e.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:a},userEvent:`revert`}),!0}function lg(e){let t=new Wi;for(let n of e.field(ph)){let r=e.facet(uh).overrideChunk&&fg(e,n);t.add(n.fromB,n.fromB,og(e,n,!!r))}return t.finish()}var ug=Li.define({create:e=>lg(e),update(e,t){return t.state.field(ph,!1)==t.startState.field(ph,!1)?e:lg(t.state)},provide:e=>Vi.decorations.from(e)}),dg=new WeakMap;function fg(e,t){let n=dg.get(t);if(n!==void 0)return n;n=null;let r=e.field(rg),i=e.doc,a=r.lineAt(t.endA).number-r.lineAt(t.fromA).number+1,o=i.lineAt(t.endB).number-i.lineAt(t.fromB).number+1;abort:if(a==o&&a<10){let e=[],i=0,o=t.fromA,s=t.fromB;for(let n of t.changes){if(n.fromA<n.toA){i+=n.toA-n.fromA;let t=r.sliceString(o+n.fromA,o+n.toA);if(/\n/.test(t))break abort;e.push(Ki.widget({widget:new pg(t),side:-1}).range(s+n.fromB))}n.fromB<n.toB&&e.push(kh.range(s+n.fromB,s+n.toB))}i<t.endA-t.fromA-a*2&&(n=e)}return dg.set(t,n),n}var pg=class extends Ri{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let t=document.createElement(`del`);return t.className=`cm-deletedText`,t.textContent=this.text,t}},mg=new class extends Bi{constructor(){super(...arguments),this.elementClass=`cm-inlineChangedLineGutter`}},hg=Ki.line({class:`cm-inlineChangedLine`});function gg(e,t,n,r){let i=fg(e,t),a=0;if(!i)return!1;for(let o=e.doc.lineAt(t.fromB);;){for(r&&r.add(o.from,o.from,mg),n.add(o.from,o.from,hg);a<i.length&&i[a].to<=o.to;){let e=i[a++];n.add(e.from,e.to,e.value)}if(o.to>=t.endB)break;o=e.doc.lineAt(o.to+1)}return!0}var _g=_r({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),vg=pr({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}});function yg(e){let t=(0,$.c)(20),{oldContent:n,newContent:r,layout:i,conflictMode:a,onResolve:o,onAbort:s}=e,c=(0,Q.useRef)(null),l=(0,Q.useRef)(null),{resolvedTheme:u}=We(),d=(0,Q.useRef)(o),f=(0,Q.useRef)(s),[p,m]=(0,Q.useState)(null),h;t[0]!==s||t[1]!==o?(h=()=>{d.current=o,f.current=s},t[0]=s,t[1]=o,t[2]=h):h=t[2],(0,Q.useEffect)(h);let g,_;t[3]!==a||t[4]!==i||t[5]!==r||t[6]!==n||t[7]!==u?(g=()=>{if(!c.current)return;let e=u===`dark`?_g:vg,t=[Vi.editable.of(!1),Mi.readOnly.of(!0)],o=[Xi,Fn(),...t,e,Vi.lineWrapping];if(l.current&&=(l.current.destroy(),null),a){let t=new Vi({doc:r,extensions:[Xi,Fn(),Vi.editable.of(!1),e,Vi.lineWrapping,tg({original:n,highlightChanges:!0,gutter:!0,mergeControls:!0,collapseUnchanged:{margin:3,minSize:4}}),Vi.updateListener.of(e=>{let t=mh(e.state);m(t?t.chunks.length:0)})],parent:c.current});l.current=t;let i=mh(t.state);m(i?i.chunks.length:0)}else i===`split`?l.current=new Zh({a:{doc:n,extensions:o},b:{doc:r,extensions:o},parent:c.current,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}):l.current=new Vi({doc:r,extensions:[...o,tg({original:n,highlightChanges:!0,gutter:!0,mergeControls:!1,collapseUnchanged:{margin:3,minSize:4}})],parent:c.current});return()=>{l.current&&=(l.current.destroy(),null)}},_=[n,r,i,u,a],t[3]=a,t[4]=i,t[5]=r,t[6]=n,t[7]=u,t[8]=g,t[9]=_):(g=t[8],_=t[9]),(0,Q.useEffect)(g,_);let v;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(v=function(){let e=l.current;!e||!(e instanceof Vi)||d.current?.(e.state.doc.toString())},t[10]=v):v=t[10];let y=v,b=p===0,x=p===null?``:p===0?`All hunks resolved`:`${p} unresolved hunk${p===1?``:`s`}`,S;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(`div`,{ref:c,className:`diff-view min-h-0 flex-1 overflow-y-auto subtle-scrollbar`}),t[11]=S):S=t[11];let C;t[12]!==b||t[13]!==a||t[14]!==x||t[15]!==s||t[16]!==o?(C=a&&(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-2 border-t shrink-0`,children:[(0,Z.jsx)(`span`,{className:`text-xs ${b?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`}`,children:x}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s&&(0,Z.jsx)(Y,{variant:`ghost`,size:`sm`,onClick:s,children:`Exit merge`}),o&&(0,Z.jsx)(Y,{variant:`default`,size:`sm`,disabled:!b,onClick:y,children:`Save resolution`})]})]}),t[12]=b,t[13]=a,t[14]=x,t[15]=s,t[16]=o,t[17]=C):C=t[17];let w;return t[18]===C?w=t[19]:(w=(0,Z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[S,C]}),t[18]=C,t[19]=w),w}function bg(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(pi,{"data-slot":`sheet`,...n}),t[2]=n,t[3]=r),r}function xg(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(gi,{"data-slot":`sheet-portal`,...n}),t[2]=n,t[3]=r),r}function Sg(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(ci,{"data-slot":`sheet-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Cg(e){let t=(0,$.c)(17),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,side:a,showCloseButton:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?`right`:a,c=o===void 0?!0:o,l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Sg,{}),t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=J(`fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-[side=bottom]:data-open:slide-in-from-bottom-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:animate-out data-closed:fade-out-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=right]:data-closed:slide-out-to-right-10 data-[side=top]:data-closed:slide-out-to-top-10`,r),t[7]=r,t[8]=u);let d;t[9]===c?d=t[10]:(d=c&&(0,Z.jsx)(fi,{"data-slot":`sheet-close`,asChild:!0,children:(0,Z.jsxs)(Y,{variant:`ghost`,className:`absolute top-3 right-3`,size:`icon-sm`,children:[(0,Z.jsx)(ri,{}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Close`})]})}),t[9]=c,t[10]=d);let f;return t[11]!==n||t[12]!==i||t[13]!==s||t[14]!==u||t[15]!==d?(f=(0,Z.jsxs)(xg,{children:[l,(0,Z.jsxs)(bi,{"data-slot":`sheet-content`,"data-side":s,className:u,...i,children:[n,d]})]}),t[11]=n,t[12]=i,t[13]=s,t[14]=u,t[15]=d,t[16]=f):f=t[16],f}function wg(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`flex flex-col gap-0.5 p-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sheet-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Tg(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`font-heading text-base font-medium text-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(ui,{"data-slot":`sheet-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}async function Eg(){try{let e=await fetch(`/api/sync/conflicts`);return e.ok?{conflicts:(await e.json()).conflicts??[]}:{conflicts:[],error:`server`}}catch{return{conflicts:[],error:`network`}}}async function Dg(e){try{let t=await fetch(`/api/sync/conflict-content?file=${encodeURIComponent(e)}`);if(!t.ok)return{ours:``,theirs:``,base:``};let n=await t.json();return{ours:n.ours??``,theirs:n.theirs??``,base:n.base??``}}catch{return{ours:``,theirs:``,base:``}}}async function Og(e,t,n){try{let r={file:e,strategy:t};return n!==void 0&&(r.content=n),(await fetch(`/api/sync/resolve-conflict`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)})).ok}catch{return!1}}var kg=`w-[98vw] !max-w-[98vw] h-[96vh] flex flex-col gap-0 sm:!max-w-[98vw]`;function Ag(e){let t=(0,$.c)(31),{file:n,onResolve:r,onAbort:i}=e,[a,o]=(0,Q.useState)(null),s,c;if(t[0]===n?(s=t[1],c=t[2]):(s=()=>{let e=!1;return Dg(n).then(t=>{e||o(t)}),()=>{e=!0}},c=[n],t[0]=n,t[1]=s,t[2]=c),(0,Q.useEffect)(s,c),a===null){let e;t[3]===i?e=t[4]:(e=e=>!e&&i(),t[3]=i,t[4]=e);let r;t[5]===n?r=t[6]:(r=(0,Z.jsx)(vi,{className:`shrink-0`,children:(0,Z.jsxs)(si,{children:[`Resolving: `,n]})}),t[5]=n,t[6]=r);let a;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-sm text-muted-foreground`,children:`Loading…`}),t[7]=a):a=t[7];let o;t[8]===r?o=t[9]:(o=(0,Z.jsxs)(di,{className:kg,children:[r,a]}),t[8]=r,t[9]=o);let s;return t[10]!==e||t[11]!==o?(s=(0,Z.jsx)(yi,{open:!0,onOpenChange:e,children:o}),t[10]=e,t[11]=o,t[12]=s):s=t[12],s}let l;t[13]===i?l=t[14]:(l=e=>!e&&i(),t[13]=i,t[14]=l);let u;t[15]===n?u=t[16]:(u=(0,Z.jsxs)(si,{className:`text-sm font-medium`,children:[`Resolving: `,n]}),t[15]=n,t[16]=u);let d;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Red = your version (ours). Green = team's version (theirs). Accept each hunk to take theirs, reject to keep yours, then save.`}),t[17]=d):d=t[17];let f;t[18]===u?f=t[19]:(f=(0,Z.jsxs)(vi,{className:`px-4 pt-4 pb-2 shrink-0`,children:[u,d]}),t[18]=u,t[19]=f);let p;t[20]!==i||t[21]!==r||t[22]!==a.ours||t[23]!==a.theirs?(p=(0,Z.jsx)(`div`,{className:`flex-1 min-h-0 overflow-hidden`,children:(0,Z.jsx)(yg,{oldContent:a.ours,newContent:a.theirs,layout:`unified`,conflictMode:!0,onResolve:r,onAbort:i})}),t[20]=i,t[21]=r,t[22]=a.ours,t[23]=a.theirs,t[24]=p):p=t[24];let m;t[25]!==f||t[26]!==p?(m=(0,Z.jsxs)(di,{className:`${kg} p-0`,children:[f,p]}),t[25]=f,t[26]=p,t[27]=m):m=t[27];let h;return t[28]!==l||t[29]!==m?(h=(0,Z.jsx)(yi,{open:!0,onOpenChange:l,children:m}),t[28]=l,t[29]=m,t[30]=h):h=t[30],h}function jg(e){let t=(0,$.c)(50),{open:n,onOpenChange:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=[],t[0]=i):i=t[0];let[a,o]=(0,Q.useState)(i),[s,c]=(0,Q.useState)(null),l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(l=new Set,t[1]=l):l=t[1];let[u,d]=(0,Q.useState)(l),f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=new Set,t[2]=f):f=t[2];let[p,m]=(0,Q.useState)(f),[h,g]=(0,Q.useState)(null),_;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(_=function(){Eg().then(e=>{let{conflicts:t,error:n}=e;c(n??null),o(t),d(e=>{let n=new Set(t.map(Mg));return new Set([...e].filter(e=>!n.has(e)))})})},t[3]=_):_=t[3];let v=_,y,b;t[4]===n?(y=t[5],b=t[6]):(y=()=>{n&&v()},b=[n],t[4]=n,t[5]=y,t[6]=b),(0,Q.useEffect)(y,b);let x,S;t[7]===n?(x=t[8],S=t[9]):(x=()=>Ue(e=>{e.includes(`sync-status`)&&n&&v()}),S=[n],t[7]=n,t[8]=x,t[9]=S),(0,Q.useEffect)(x,S);let C,w;t[10]!==a.length||t[11]!==r||t[12]!==n||t[13]!==u.size?(w=()=>{n&&a.length>0&&u.size>=a.length&&(X.success(`All conflicts resolved — sync resuming`),r(!1),d(new Set))},C=[n,a.length,u.size,r],t[10]=a.length,t[11]=r,t[12]=n,t[13]=u.size,t[14]=C,t[15]=w):(C=t[14],w=t[15]),(0,Q.useEffect)(w,C);let T;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(T=async function(e,t,n){m(t=>new Set([...t,e]));let r=await Og(e,t,n);m(t=>{let n=new Set(t);return n.delete(e),n}),r?d(t=>new Set([...t,e])):X.error(`Failed to resolve ${e}`)},t[16]=T):T=t[16];let E=T,D;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(D=function(e){g(e)},t[17]=D):D=t[17];let O=D,k;t[18]===h?k=t[19]:(k=async function(e){if(!h)return;let t=h;g(null),await E(t,`content`,e)},t[18]=h,t[19]=k);let A=k,j;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(){g(null)},t[20]=j):j=t[20];let M=j,N;t[21]===r?N=t[22]:(N=async function(){try{(await fetch(`/api/sync/abort-merge`,{method:`POST`})).ok?X.info(`Merge aborted — sync paused`):X.error(`Failed to abort merge`)}catch{X.error(`Failed to abort merge — connection error`)}r(!1),d(new Set)},t[21]=r,t[22]=N);let P=N,F=a.length,I=u.size,L;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(Tg,{className:`text-sm font-medium`,children:`Resolve conflicts`}),t[23]=L):L=t[23];let R;t[24]!==I||t[25]!==F?(R=F>0&&(0,Z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[I,` of `,F,` resolved`]}),t[24]=I,t[25]=F,t[26]=R):R=t[26];let z;t[27]===R?z=t[28]:(z=(0,Z.jsxs)(wg,{className:`px-4 py-3 border-b shrink-0`,children:[L,R]}),t[27]=R,t[28]=z);let B;t[29]!==a||t[30]!==s||t[31]!==u||t[32]!==p?(B=(0,Z.jsx)(`div`,{className:`flex-1 overflow-y-auto subtle-scrollbar`,children:s?(0,Z.jsxs)(`div`,{className:`px-4 py-6 text-sm text-center space-y-2`,children:[(0,Z.jsx)(`p`,{className:`text-destructive`,children:s===`network`?`Could not reach the sync server — check your connection.`:`Sync server error — try again in a moment.`}),(0,Z.jsx)(Y,{variant:`outline`,size:`sm`,onClick:v,children:`Retry`})]}):a.length===0?(0,Z.jsx)(`p`,{className:`px-4 py-6 text-sm text-muted-foreground text-center`,children:`No conflicts found.`}):(0,Z.jsx)(`ul`,{className:`divide-y`,children:a.map(e=>{let t=u.has(e.file),n=p.has(e.file),r=e.file.split(`/`).pop()??e.file;return(0,Z.jsxs)(`li`,{className:`px-4 py-3 ${t?`opacity-50`:``}`,children:[(0,Z.jsxs)(`p`,{className:`text-sm font-medium truncate mb-2`,title:e.file,children:[t?`✓ `:``,r]}),!t&&(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,disabled:n,onClick:()=>void E(e.file,`mine`),children:`Keep my version`}),(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,disabled:n,onClick:()=>void E(e.file,`theirs`),children:`Keep team's version`}),(0,Z.jsx)(Y,{variant:`ghost`,size:`xs`,disabled:n,onClick:()=>O(e.file),children:`Resolve manually`})]})]},e.file)})})}),t[29]=a,t[30]=s,t[31]=u,t[32]=p,t[33]=B):B=t[33];let V;t[34]===P?V=t[35]:(V=(0,Z.jsx)(`div`,{className:`px-4 py-3 border-t shrink-0`,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`sm`,className:`w-full`,onClick:P,children:`Exit merge`})}),t[34]=P,t[35]=V);let H;t[36]!==z||t[37]!==B||t[38]!==V?(H=(0,Z.jsxs)(Cg,{side:`right`,className:`w-80 sm:w-96 flex flex-col gap-0 p-0`,children:[z,B,V]}),t[36]=z,t[37]=B,t[38]=V,t[39]=H):H=t[39];let U;t[40]!==r||t[41]!==n||t[42]!==H?(U=(0,Z.jsx)(bg,{open:n,onOpenChange:r,children:H}),t[40]=r,t[41]=n,t[42]=H,t[43]=U):U=t[43];let W;t[44]!==A||t[45]!==h?(W=h&&(0,Z.jsx)(Ag,{file:h,onResolve:e=>void A(e),onAbort:M}),t[44]=A,t[45]=h,t[46]=W):W=t[46];let G;return t[47]!==U||t[48]!==W?(G=(0,Z.jsxs)(Z.Fragment,{children:[U,W]}),t[47]=U,t[48]=W,t[49]=G):G=t[49],G}function Mg(e){return e.file}function Ng(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,orientation:i,decorative:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`horizontal`:i,s=a===void 0?!0:a,c;t[5]===n?c=t[6]:(c=J(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,n),t[5]=n,t[6]=c);let l;return t[7]!==s||t[8]!==o||t[9]!==r||t[10]!==c?(l=(0,Z.jsx)(Ul,{"data-slot":`separator`,decorative:s,orientation:o,className:c,...r}),t[7]=s,t[8]=o,t[9]=r,t[10]=c,t[11]=l):l=t[11],l}var Pg=5;async function Fg(e){let t=await fetch(`/api/backlinks?docName=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Server error: ${t.status} ${t.statusText}`);let n=await t.json();if(!n.ok)throw Error(n.error??`Failed to load backlinks`);return n.backlinks??[]}async function Ig(e){let t=await fetch(`/api/forward-links?docName=${encodeURIComponent(e)}`);if(!t.ok)throw Error(`Server error: ${t.status} ${t.statusText}`);let n=await t.json();if(!n.ok)throw Error(n.error??`Failed to load outgoing links`);return n.forwardLinks??[]}function Lg(e){let t=e.split(`/`);return t.length<=2?e:`…/${t.slice(-2).join(`/`)}`}function Rg(e){let t=(0,$.c)(9),{title:n,count:r,isLoading:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(Mn,{className:`size-3.5 text-muted-foreground transition-transform group-data-[state=closed]:-rotate-90`}),t[0]=a):a=t[0];let o;t[1]===n?o=t[2]:(o=(0,Z.jsxs)(`span`,{className:`flex items-center gap-2.5`,children:[a,(0,Z.jsx)(k,{children:n})]}),t[1]=n,t[2]=o);let s;t[3]!==r||t[4]!==i?(s=!i&&(0,Z.jsx)(O,{children:r}),t[3]=r,t[4]=i,t[5]=s):s=t[5];let c;return t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(Rt,{className:`group flex w-full cursor-pointer items-center justify-between px-5 py-3 text-left transition-colors hover:bg-muted/40`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8],c}function zg(e){let t=(0,$.c)(7),{total:n,expanded:r,onToggle:i}=e;if(n<=Pg)return null;let a=n-Pg,o;t[0]===r?o=t[1]:(o=r?(0,Z.jsx)(Mn,{className:`size-3`}):(0,Z.jsx)(An,{className:`size-3`}),t[0]=r,t[1]=o);let s=r?`Show fewer`:`Show ${a} more`,c;return t[2]!==r||t[3]!==i||t[4]!==o||t[5]!==s?(c=(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,className:`mt-2 inline-flex cursor-pointer items-center gap-1 px-3 text-xs text-muted-foreground transition-colors hover:text-foreground`,onClick:i,children:[o,s]}),t[2]=r,t[3]=i,t[4]=o,t[5]=s,t[6]=c):c=t[6],c}function Bg(e){let t=(0,$.c)(37),{icon:n,iconColorClass:r,rowTooltip:i,title:a,path:o,anchor:s,snippet:c,titleHover:l,ariaLabel:u,href:d,external:f,onClick:p,hoverAction:m}=e,h=o!==void 0&&o!==a,g=r??`text-muted-foreground`,_;t[0]===g?_=t[1]:(_=J(`mt-0.5 shrink-0`,g),t[0]=g,t[1]=_);let v;t[2]!==n||t[3]!==_?(v=(0,Z.jsx)(`span`,{className:_,children:n}),t[2]=n,t[3]=_,t[4]=v):v=t[4];let y=v,b;t[5]!==u||t[6]!==f||t[7]!==d||t[8]!==p||t[9]!==a||t[10]!==l?(b=d?(0,Z.jsxs)(`a`,{href:d,target:f?`_blank`:void 0,rel:f?`noopener noreferrer`:void 0,"aria-label":u,title:l,onClick:p,className:`block w-full truncate text-left font-medium text-foreground no-underline outline-none after:absolute after:inset-0 after:rounded-md focus-visible:after:ring-2 focus-visible:after:ring-ring`,children:[a,f?(0,Z.jsx)(`span`,{className:`sr-only`,children:` (opens in new tab)`}):null]}):(0,Z.jsx)(`button`,{type:`button`,"aria-label":u,title:l,onClick:p,className:J(`block w-full truncate text-left font-medium text-foreground no-underline outline-none after:absolute after:inset-0 after:rounded-md focus-visible:after:ring-2 focus-visible:after:ring-ring`,`cursor-pointer bg-transparent p-0`),children:a}),t[5]=u,t[6]=f,t[7]=d,t[8]=p,t[9]=a,t[10]=l,t[11]=b):b=t[11];let x=b,S;t[12]===y?S=t[13]:(S=(0,Z.jsx)(`div`,{className:`mt-px flex items-center`,children:y}),t[12]=y,t[13]=S);let C;t[14]!==s||t[15]!==o||t[16]!==h?(C=h?(0,Z.jsxs)(`div`,{className:`truncate font-mono text-xs text-muted-foreground`,children:[o,s?(0,Z.jsxs)(`span`,{className:`ml-1`,children:[`· #`,s]}):null]}):null,t[14]=s,t[15]=o,t[16]=h,t[17]=C):C=t[17];let w;t[18]===c?w=t[19]:(w=c?(0,Z.jsx)(`p`,{className:`line-clamp-2 text-muted-foreground`,children:c}):null,t[18]=c,t[19]=w);let T;t[20]!==x||t[21]!==C||t[22]!==w?(T=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5 text-1sm`,children:[x,C,w]}),t[20]=x,t[21]=C,t[22]=w,t[23]=T):T=t[23];let E;t[24]===m?E=t[25]:(E=m?(0,Z.jsxs)(Ei,{children:[(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(`button`,{type:`button`,"aria-label":m.tooltip,className:`relative z-10 shrink-0 cursor-pointer rounded-md p-1 text-muted-foreground opacity-0 transition-opacity hover:bg-accent hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-hover:opacity-100`,onClick:m.onClick,children:m.icon})}),(0,Z.jsx)(wi,{side:`top`,children:m.tooltip})]}):null,t[24]=m,t[25]=E);let D;t[26]!==S||t[27]!==T||t[28]!==E?(D=(0,Z.jsxs)(`div`,{className:`group relative flex items-start gap-2.5 rounded-md px-3 py-2.5 transition-colors hover:bg-muted/80`,children:[S,T,E]}),t[26]=S,t[27]=T,t[28]=E,t[29]=D):D=t[29];let O=D;if(i){let e;t[30]===O?e=t[31]:(e=(0,Z.jsx)(Ci,{asChild:!0,children:O}),t[30]=O,t[31]=e);let n;t[32]===i?n=t[33]:(n=(0,Z.jsx)(wi,{side:`top`,children:i}),t[32]=i,t[33]=n);let r;return t[34]!==e||t[35]!==n?(r=(0,Z.jsxs)(Ei,{children:[e,n]}),t[34]=e,t[35]=n,t[36]=r):r=t[36],r}return O}function Vg(e){let t=(0,$.c)(33),{docName:n}=e,{folderPaths:r,pages:i,loading:a}=Ee(),o,s;t[0]===n?(o=t[1],s=t[2]):(o=[`backlinks`,n],s=()=>Fg(n),t[0]=n,t[1]=o,t[2]=s);let c;t[3]!==n||t[4]!==a||t[5]!==i?(c=!a&&i.has(n),t[3]=n,t[4]=a,t[5]=i,t[6]=c):c=t[6];let l;t[7]!==o||t[8]!==s||t[9]!==c?(l={queryKey:o,queryFn:s,enabled:c},t[7]=o,t[8]=s,t[9]=c,t[10]=l):l=t[10];let{data:u,isLoading:d,error:f}=_(l),p;t[11]===u?p=t[12]:(p=u===void 0?[]:u,t[11]=u,t[12]=p);let m=p,[g,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(n);y!==n&&(b(n),v(!1));let x;t[13]!==m||t[14]!==g?(x=g?m:m.slice(0,Pg),t[13]=m,t[14]=g,t[15]=x):x=t[15];let C=x,w;t[16]!==m.length||t[17]!==d?(w=(0,Z.jsx)(Rg,{title:`Backlinks`,count:m.length,isLoading:d}),t[16]=m.length,t[17]=d,t[18]=w):w=t[18];let T;t[19]!==m.length||t[20]!==f||t[21]!==g||t[22]!==r||t[23]!==d||t[24]!==i||t[25]!==C?(T=f?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(h,{children:f instanceof Error?f.message:`Failed to load backlinks`})}):m.length===0&&!d?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(S,{children:`No pages link here yet.`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex flex-col gap-1`,children:C.map((e,t)=>{let n=ni(e.source,{pages:i,folderPaths:r});return(0,Z.jsx)(Bg,{icon:(0,Z.jsx)(Xt,{className:`size-3.5`}),title:e.title,path:Lg(e.source),titleHover:e.source,anchor:e.anchor,snippet:e.snippet,href:Ie(n.hashDocName,e.anchor)},`${e.source}-${t}`)})}),(0,Z.jsx)(zg,{total:m.length,expanded:g,onToggle:()=>v(Hg)})]}),t[19]=m.length,t[20]=f,t[21]=g,t[22]=r,t[23]=d,t[24]=i,t[25]=C,t[26]=T):T=t[26];let E;t[27]!==d||t[28]!==T?(E=(0,Z.jsx)(qn,{children:(0,Z.jsx)(`div`,{className:`px-2 pb-3`,"aria-busy":d,children:T})}),t[27]=d,t[28]=T,t[29]=E):E=t[29];let D;return t[30]!==E||t[31]!==w?(D=(0,Z.jsxs)(fn,{defaultOpen:!0,children:[w,E]}),t[30]=E,t[31]=w,t[32]=D):D=t[32],D}function Hg(e){return!e}function Ug(e){let t=(0,$.c)(50),{docName:n}=e,{folderPaths:r,pages:i,pagesBySlug:a,loading:o}=Ee(),s,c;t[0]===n?(s=t[1],c=t[2]):(s=[`forward-links`,n],c=()=>Ig(n),t[0]=n,t[1]=s,t[2]=c);let l;t[3]!==n||t[4]!==i||t[5]!==o?(l=!o&&i.has(n),t[3]=n,t[4]=i,t[5]=o,t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c||t[9]!==l?(u={queryKey:s,queryFn:c,enabled:l},t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10];let{data:d,isLoading:f,error:p}=_(u),m;t[11]===d?m=t[12]:(m=d===void 0?[]:d,t[11]=d,t[12]=m);let g=m,[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(n);C!==n&&(w(n),x(!1));let T;t[13]!==b||t[14]!==g?(T=b?g:g.slice(0,Pg),t[13]=b,t[14]=g,t[15]=T):T=t[15];let E=T,D;if(t[16]!==v||t[17]!==r||t[18]!==i||t[19]!==a){let e=v===null?null:vn(v.docName,{pages:i,folderPaths:r,pagesBySlug:a});D=e===null?null:e.kind===`create`?{initialDir:e.initialDir,suggestedName:e.suggestedName}:on(e),t[16]=v,t[17]=r,t[18]=i,t[19]=a,t[20]=D}else D=t[20];let O=D,k;t[21]!==r||t[22]!==i||t[23]!==a||t[24]!==o?(k=function(e){if(e.kind===`external`){let t=e.title===e.url;return(0,Z.jsx)(Bg,{icon:(0,Z.jsx)(ti,{className:`size-3.5`}),rowTooltip:`Opens in a new tab`,title:e.title,path:t?void 0:e.url,titleHover:e.url,snippet:e.snippet,href:e.url,external:!0},`ext:${e.url}`)}let t=vn(e.docName,{pages:i,folderPaths:r,pagesBySlug:a}),n=!o&&t.kind===`create`,s=!o&&t.kind===`navigate`&&t.displayState===`folder`,c=Lg(e.docName),l=e.title===e.docName?c:e.title,u=`doc:${e.docName}:${e.anchor??``}`,d=Ie(t.kind===`navigate`?t.hashDocName:e.docName,e.anchor);return n?(0,Z.jsx)(Bg,{icon:(0,Z.jsx)(Oe,{className:`size-3.5`}),iconColorClass:`text-amber-600 dark:text-amber-400`,rowTooltip:`Missing page — click to create`,ariaLabel:`Missing page: ${e.title}. Click to create.`,title:l,path:c,titleHover:e.docName,anchor:e.anchor,snippet:e.snippet,onClick:()=>y(e)},u):s?(0,Z.jsx)(Bg,{icon:(0,Z.jsx)(Va,{className:`size-3.5`}),iconColorClass:`text-sky-600 dark:text-sky-400`,ariaLabel:`Folder target: ${e.title}. Click to open the overview.`,title:l,path:c,titleHover:e.docName,anchor:e.anchor,snippet:e.snippet,href:d,hoverAction:{icon:(0,Z.jsx)(co,{className:`size-3.5`}),tooltip:`Create index note`,onClick:()=>y(e)}},u):(0,Z.jsx)(Bg,{icon:(0,Z.jsx)(Xt,{className:`size-3.5`}),title:l,path:c,titleHover:e.docName,anchor:e.anchor,snippet:e.snippet,href:d},u)},t[21]=r,t[22]=i,t[23]=a,t[24]=o,t[25]=k):k=t[25];let A=k,j;t[26]!==f||t[27]!==g.length?(j=(0,Z.jsx)(Rg,{title:`Outgoing`,count:g.length,isLoading:f}),t[26]=f,t[27]=g.length,t[28]=j):j=t[28];let M;t[29]!==p||t[30]!==b||t[31]!==f||t[32]!==g.length||t[33]!==A||t[34]!==E?(M=p?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(h,{children:p instanceof Error?p.message:`Failed to load outgoing links`})}):g.length===0&&!f?(0,Z.jsx)(`div`,{className:`px-3`,children:(0,Z.jsx)(S,{children:`This page doesn't link to anything yet.`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`flex flex-col gap-1`,children:E.map(A)}),(0,Z.jsx)(zg,{total:g.length,expanded:b,onToggle:()=>x(Wg)})]}),t[29]=p,t[30]=b,t[31]=f,t[32]=g.length,t[33]=A,t[34]=E,t[35]=M):M=t[35];let N;t[36]!==f||t[37]!==M?(N=(0,Z.jsx)(qn,{children:(0,Z.jsx)(`div`,{className:`px-2 pb-3`,"aria-busy":f,children:M})}),t[36]=f,t[37]=M,t[38]=N):N=t[38];let P;t[39]!==j||t[40]!==N?(P=(0,Z.jsxs)(fn,{defaultOpen:!0,children:[j,N]}),t[39]=j,t[40]=N,t[41]=P):P=t[41];let F=v!==null,I=O?.initialDir??``,L=O?.suggestedName,R;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(R=e=>{e||y(null)},t[42]=R):R=t[42];let z;t[43]!==F||t[44]!==I||t[45]!==L?(z=(0,Z.jsx)(Pn,{open:F,kind:`file`,initialDir:I,suggestedName:L,onOpenChange:R}),t[43]=F,t[44]=I,t[45]=L,t[46]=z):z=t[46];let B;return t[47]!==P||t[48]!==z?(B=(0,Z.jsxs)(Z.Fragment,{children:[P,z]}),t[47]=P,t[48]=z,t[49]=B):B=t[49],B}function Wg(e){return!e}function Gg(e){let t=(0,$.c)(11),{docName:n,className:r}=e,i=r===void 0?``:r,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(Vg,{docName:n}),t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Ng,{}),t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,Z.jsx)(Ug,{docName:n}),t[3]=n,t[4]=s);let c;t[5]!==a||t[6]!==s?(c=(0,Z.jsxs)(E,{className:`px-0 py-0`,children:[a,o,s]}),t[5]=a,t[6]=s,t[7]=c):c=t[7];let l;return t[8]!==i||t[9]!==c?(l=(0,Z.jsx)(A,{className:i,children:c}),t[8]=i,t[9]=c,t[10]=l):l=t[10],l}var Kg=class{diff(e,t,n={}){let r;typeof n==`function`?(r=n,n={}):`callback`in n&&(r=n.callback);let i=this.castInput(e,n),a=this.castInput(t,n),o=this.removeEmpty(this.tokenize(i,n)),s=this.removeEmpty(this.tokenize(a,n));return this.diffWithOptionsObj(o,s,n,r)}diffWithOptionsObj(e,t,n,r){let i=e=>{if(e=this.postProcess(e,n),r){setTimeout(function(){r(e)},0);return}else return e},a=t.length,o=e.length,s=1,c=a+o;n.maxEditLength!=null&&(c=Math.min(c,n.maxEditLength));let l=n.timeout??1/0,u=Date.now()+l,d=[{oldPos:-1,lastComponent:void 0}],f=this.extractCommon(d[0],t,e,0,n);if(d[0].oldPos+1>=o&&f+1>=a)return i(this.buildValues(d[0].lastComponent,t,e));let p=-1/0,m=1/0,h=()=>{for(let r=Math.max(p,-s);r<=Math.min(m,s);r+=2){let s,c=d[r-1],l=d[r+1];c&&(d[r-1]=void 0);let u=!1;if(l){let e=l.oldPos-r;u=l&&0<=e&&e<a}let h=c&&c.oldPos+1<o;if(!u&&!h){d[r]=void 0;continue}if(s=!h||u&&c.oldPos<l.oldPos?this.addToPath(l,!0,!1,0,n):this.addToPath(c,!1,!0,1,n),f=this.extractCommon(s,t,e,r,n),s.oldPos+1>=o&&f+1>=a)return i(this.buildValues(s.lastComponent,t,e))||!0;d[r]=s,s.oldPos+1>=o&&(m=Math.min(m,r-1)),f+1>=a&&(p=Math.max(p,r+1))}s++};if(r)(function e(){setTimeout(function(){if(s>c||Date.now()>u)return r(void 0);h()||e()},0)})();else for(;s<=c&&Date.now()<=u;){let e=h();if(e)return e}}addToPath(e,t,n,r,i){let a=e.lastComponent;return a&&!i.oneChangePerToken&&a.added===t&&a.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:a.count+1,added:t,removed:n,previousComponent:a.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:a}}}extractCommon(e,t,n,r,i){let a=t.length,o=n.length,s=e.oldPos,c=s-r,l=0;for(;c+1<a&&s+1<o&&this.equals(n[s+1],t[c+1],i);)c++,s++,l++,i.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return l&&!i.oneChangePerToken&&(e.lastComponent={count:l,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=s,c}equals(e,t,n){return n.comparator?n.comparator(e,t):e===t||!!n.ignoreCase&&e.toLowerCase()===t.toLowerCase()}removeEmpty(e){let t=[];for(let n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t}castInput(e,t){return e}tokenize(e,t){return Array.from(e)}join(e){return e.join(``)}postProcess(e,t){return e}get useLongestToken(){return!1}buildValues(e,t,n){let r=[],i;for(;e;)r.push(e),i=e.previousComponent,delete e.previousComponent,e=i;r.reverse();let a=r.length,o=0,s=0,c=0;for(;o<a;o++){let e=r[o];if(e.removed)e.value=this.join(n.slice(c,c+e.count)),c+=e.count;else{if(!e.added&&this.useLongestToken){let r=t.slice(s,s+e.count);r=r.map(function(e,t){let r=n[c+t];return r.length>e.length?r:e}),e.value=this.join(r)}else e.value=this.join(t.slice(s,s+e.count));s+=e.count,e.added||(c+=e.count)}}return r}};new class extends Kg{};function qg(e,t){let n;for(n=0;n<e.length&&n<t.length;n++)if(e[n]!=t[n])return e.slice(0,n);return e.slice(0,n)}function Jg(e,t){let n;if(!e||!t||e[e.length-1]!=t[t.length-1])return``;for(n=0;n<e.length&&n<t.length;n++)if(e[e.length-(n+1)]!=t[t.length-(n+1)])return e.slice(-n);return e.slice(-n)}function Yg(e,t,n){if(e.slice(0,t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't start with prefix ${JSON.stringify(t)}; this is a bug`);return n+e.slice(t.length)}function Xg(e,t,n){if(!t)return e+n;if(e.slice(-t.length)!=t)throw Error(`string ${JSON.stringify(e)} doesn't end with suffix ${JSON.stringify(t)}; this is a bug`);return e.slice(0,-t.length)+n}function Zg(e,t){return Yg(e,t,``)}function Qg(e,t){return Xg(e,t,``)}function $g(e,t){return t.slice(0,e_(e,t))}function e_(e,t){let n=0;e.length>t.length&&(n=e.length-t.length);let r=t.length;e.length<t.length&&(r=e.length);let i=Array(r),a=0;i[0]=0;for(let e=1;e<r;e++){for(t[e]==t[a]?i[e]=i[a]:i[e]=a;a>0&&t[e]!=t[a];)a=i[a];t[e]==t[a]&&a++}a=0;for(let r=n;r<e.length;r++){for(;a>0&&e[r]!=t[a];)a=i[a];e[r]==t[a]&&a++}return a}function t_(e,t){let n=[];for(let r of Array.from(t.segment(e))){let e=r.segment;n.length&&/\s/.test(n[n.length-1])&&/\s/.test(e)?n[n.length-1]+=e:n.push(e)}return n}function n_(e,t){if(t)return i_(e,t)[1];let n;for(n=e.length-1;n>=0&&e[n].match(/\s/);n--);return e.substring(n+1)}function r_(e,t){if(t)return i_(e,t)[0];let n=e.match(/^\s*/);return n?n[0]:``}function i_(e,t){if(!t)return[r_(e),n_(e)];if(t.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);let n=t_(e,t),r=n[0],i=n[n.length-1];return[/\s/.test(r)?r:``,/\s/.test(i)?i:``]}var a_=`a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}`,o_=RegExp(`[${a_}]+|\\s+|[^${a_}]`,`ug`);new class extends Kg{equals(e,t,n){return n.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e.trim()===t.trim()}tokenize(e,t={}){let n;if(t.intlSegmenter){let r=t.intlSegmenter;if(r.resolvedOptions().granularity!=`word`)throw Error(`The segmenter passed must have a granularity of "word"`);n=t_(e,r)}else n=e.match(o_)||[];let r=[],i=null;return n.forEach(e=>{/\s/.test(e)?i==null?r.push(e):r.push(r.pop()+e):i!=null&&/\s/.test(i)?r[r.length-1]==i?r.push(r.pop()+e):r.push(i+e):r.push(e),i=e}),r}join(e){return e.map((e,t)=>t==0?e:e.replace(/^\s+/,``)).join(``)}postProcess(e,t){if(!e||t.oneChangePerToken)return e;let n=null,r=null,i=null;return e.forEach(e=>{e.added?r=e:e.removed?i=e:((r||i)&&s_(n,i,r,e,t.intlSegmenter),n=e,r=null,i=null)}),(r||i)&&s_(n,i,r,null,t.intlSegmenter),e}};function s_(e,t,n,r,i){if(t&&n){let[a,o]=i_(t.value,i),[s,c]=i_(n.value,i);if(e){let r=qg(a,s);e.value=Xg(e.value,s,r),t.value=Zg(t.value,r),n.value=Zg(n.value,r)}if(r){let e=Jg(o,c);r.value=Yg(r.value,c,e),t.value=Qg(t.value,e),n.value=Qg(n.value,e)}}else if(n){if(e){let e=r_(n.value,i);n.value=n.value.substring(e.length)}if(r){let e=r_(r.value,i);r.value=r.value.substring(e.length)}}else if(e&&r){let n=r_(r.value,i),[a,o]=i_(t.value,i),s=qg(n,a);t.value=Zg(t.value,s);let c=Jg(Zg(n,s),o);t.value=Qg(t.value,c),r.value=Yg(r.value,n,c),e.value=Xg(e.value,n,n.slice(0,n.length-c.length))}else if(r){let e=r_(r.value,i),n=$g(n_(t.value,i),e);t.value=Qg(t.value,n)}else if(e){let n=$g(n_(e.value,i),r_(t.value,i));t.value=Zg(t.value,n)}}new class extends Kg{tokenize(e){let t=RegExp(`(\\r?\\n)|[${a_}]+|[^\\S\\n\\r]+|[^${a_}]`,`ug`);return e.match(t)||[]}};var c_=new class extends Kg{constructor(){super(...arguments),this.tokenize=u_}equals(e,t,n){return n.ignoreWhitespace?((!n.newlineIsToken||!e.includes(`
|
|
16
|
-
`))&&(e=e.trim()),(!n.newlineIsToken||!t.includes(`
|
|
17
|
-
`))&&(t=t.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(e.endsWith(`
|
|
18
|
-
`)&&(e=e.slice(0,-1)),t.endsWith(`
|
|
19
|
-
`)&&(t=t.slice(0,-1))),super.equals(e,t,n)}};function l_(e,t,n){return c_.diff(e,t,n)}function u_(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
20
|
-
`));let n=[],r=e.split(/(\n|\r\n)/);r[r.length-1]||r.pop();for(let e=0;e<r.length;e++){let i=r[e];e%2&&!t.newlineIsToken?n[n.length-1]+=i:n.push(i)}return n}function d_(e){return e==`.`||e==`!`||e==`?`}new class extends Kg{tokenize(e){let t=[],n=0;for(let r=0;r<e.length;r++){if(r==e.length-1){t.push(e.slice(n));break}if(d_(e[r])&&e[r+1].match(/\s/)){for(t.push(e.slice(n,r+1)),r=n=r+1;e[r+1]?.match(/\s/);)r++;t.push(e.slice(n,r+1)),n=r+1}}return t}},new class extends Kg{tokenize(e){return e.split(/([{}:;,]|\s+)/)}},new class extends Kg{constructor(){super(...arguments),this.tokenize=u_}get useLongestToken(){return!0}castInput(e,t){let{undefinedReplacement:n,stringifyReplacer:r=(e,t)=>t===void 0?n:t}=t;return typeof e==`string`?e:JSON.stringify(f_(e,null,null,r),null,` `)}equals(e,t,n){return super.equals(e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`),n)}};function f_(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i===void 0?``:i,e));let a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];let o;if(Object.prototype.toString.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=f_(e[a],t,n,r,String(a));return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),typeof e==`object`&&e){t.push(e),o={},n.push(o);let i=[],s;for(s in e)Object.prototype.hasOwnProperty.call(e,s)&&i.push(s);for(i.sort(),a=0;a<i.length;a+=1)s=i[a],o[s]=f_(e[s],t,n,r,s);t.pop(),n.pop()}else o=e;return o}new class extends Kg{tokenize(e){return e.slice()}join(e){return e}removeEmpty(e){return e}};var p_={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function m_(e,t,n,r,i,a,o){let s;s=o?typeof o==`function`?{callback:o}:o:{},s.context===void 0&&(s.context=4);let c=s.context;if(s.newlineIsToken)throw Error(`newlineIsToken may not be used with patch-generation functions, only with diffing functions`);if(s.callback){let{callback:e}=s;l_(n,r,Object.assign(Object.assign({},s),{callback:t=>{e(l(t))}}))}else return l(l_(n,r,s));function l(n){if(!n)return;n.push({value:``,lines:[]});function r(e){return e.map(function(e){return` `+e})}let o=[],s=0,l=0,u=[],d=1,f=1;for(let e=0;e<n.length;e++){let t=n[e],i=t.lines||v_(t.value);if(t.lines=i,t.added||t.removed){if(!s){let t=n[e-1];s=d,l=f,t&&(u=c>0?r(t.lines.slice(-c)):[],s-=u.length,l-=u.length)}for(let e of i)u.push((t.added?`+`:`-`)+e);t.added?f+=i.length:d+=i.length}else{if(s)if(i.length<=c*2&&e<n.length-2)for(let e of r(i))u.push(e);else{let e=Math.min(i.length,c);for(let t of r(i.slice(0,e)))u.push(t);let t={oldStart:s,oldLines:d-s+e,newStart:l,newLines:f-l+e,lines:u};o.push(t),s=0,l=0,u=[]}d+=i.length,f+=i.length}}for(let e of o)for(let t=0;t<e.lines.length;t++)e.lines[t].endsWith(`
|
|
21
|
-
`)?e.lines[t]=e.lines[t].slice(0,-1):(e.lines.splice(t+1,0,`\`),t++);return{oldFileName:e,newFileName:t,oldHeader:i,newHeader:a,hunks:o}}}function h_(e,t){if(t||=p_,Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders)throw Error(`Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)`);return e.map(e=>h_(e,t)).join(`
|
|
22
|
-
`)}let n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push(`Index: `+e.oldFileName),t.includeUnderline&&n.push(`===================================================================`),t.includeFileHeaders&&(n.push(`--- `+e.oldFileName+(e.oldHeader===void 0?``:` `+e.oldHeader)),n.push(`+++ `+e.newFileName+(e.newHeader===void 0?``:` `+e.newHeader)));for(let t=0;t<e.hunks.length;t++){let r=e.hunks[t];r.oldLines===0&&--r.oldStart,r.newLines===0&&--r.newStart,n.push(`@@ -`+r.oldStart+`,`+r.oldLines+` +`+r.newStart+`,`+r.newLines+` @@`);for(let e of r.lines)n.push(e)}return n.join(`
|
|
23
|
-
`)+`
|
|
24
|
-
`}function g_(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;m_(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?h_(e,o.headerOptions):void 0)}}))}else{let s=m_(e,t,n,r,i,a,o);return s?h_(s,o?.headerOptions):void 0}}function __(e,t,n,r,i,a){return g_(e,e,t,n,r,i,a)}function v_(e){let t=e.endsWith(`
|
|
25
|
-
`),n=e.split(`
|
|
26
|
-
`).map(e=>e+`
|
|
27
|
-
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function y_(e,t){return`${e}\u0000${t}`}function b_(e,t,n){let r=Ae(e).body,i=Ae(t).body;return r===i?``:__(n,r,i,``,``,{context:3})}function x_(e,t,n){let r=(0,$.c)(8),{activeProvider:i}=Qn(),a;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={status:`idle`,diff:null},r[0]=a):a=r[0];let[o,s]=(0,Q.useState)(a),c=(0,Q.useRef)(i),l;r[1]===i?l=r[2]:(l=()=>{c.current=i},r[1]=i,r[2]=l),(0,Q.useEffect)(l);let u,d;return r[3]!==n||r[4]!==t||r[5]!==e?(u=()=>{if(!e){s({status:`idle`,diff:null});return}let r=e,i=!1;return s({status:`loading`,diff:null}),(async function(){try{let e=y_(t,r),a=n.get(e);if(a===void 0){let o=await fetch(`/api/history/${r}?docName=${encodeURIComponent(t)}`);if(i)return;if(!o.ok){s({status:`error`,diff:null});return}let c=await o.json();if(i)return;a=c.content??``,n.set(e,a)}if(i)return;let o=c.current?.document.getText(`source`).toString()??``,l=b_(a,o,t);if(i)return;s({status:`ready`,diff:l})}catch(e){i||(console.error(`[timeline-diff] failed to load entry diff`,{sha:r,docName:t,err:e}),s({status:`error`,diff:null}))}})(),()=>{i=!0}},d=[e,t,n],r[3]=n,r[4]=t,r[5]=e,r[6]=u,r[7]=d):(u=r[6],d=r[7]),(0,Q.useEffect)(u,d),o}var S_=(0,Q.lazy)(async()=>({default:(await r(()=>import(`./ActivityPanelDiffView-DoHWP1ak.js`),__vite__mapDeps([10,1,7,11]),import.meta.url)).ActivityPanelDiffView}));function C_(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return`just now`;if(r<3600)return`${Math.floor(r/60)} min ago`;if(r<86400)return`${Math.floor(r/3600)}h ago`;if(r<86400*2)return`yesterday`;let i=Math.floor(r/86400);return i<7?`${i} days ago`:t.toLocaleDateString()}function w_(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function T_(e){return e.slice(0,7)}function E_(e){return e.type===`upstream`?`Upstream sync`:e.contributors.length===1?e.contributors[0].name:e.contributors.length>1?e.contributors.map(e=>e.name).join(`, `):e.author===`openknowledge-server`||e.author===`server`?`Auto-save`:e.author}function D_(e){let t=(0,$.c)(17),n,r;if(t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n===`claude`){let e;return t[3]===r?e=t[4]:(e=(0,Z.jsx)(Sr,{...r}),t[3]=r,t[4]=e),e}if(n===`cursor`){let e;return t[5]===r?e=t[6]:(e=(0,Z.jsx)(Or,{...r}),t[5]=r,t[6]=e),e}if(n===`windsurf`){let e;return t[7]===r?e=t[8]:(e=(0,Z.jsx)(br,{...r}),t[7]=r,t[8]=e),e}if(n===`openai`){let e;return t[9]===r?e=t[10]:(e=(0,Z.jsx)(Tr,{...r}),t[9]=r,t[10]=e),e}if(n===`cline`){let e;return t[11]===r?e=t[12]:(e=(0,Z.jsx)(Nr,{...r}),t[11]=r,t[12]=e),e}if(n===`github`){let e;return t[13]===r?e=t[14]:(e=(0,Z.jsx)(jr,{...r}),t[13]=r,t[14]=e),e}let i=r,a;return t[15]===i?a=t[16]:(a=(0,Z.jsx)(kr,{strokeWidth:1.5,...i}),t[15]=i,t[16]=a),a}function O_(e){let t=(0,$.c)(17),{entry:n,isDark:r}=e;if(n.type===`upstream`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ha,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[0]=e):e=t[0],e}if(n.contributors.length>0){let e=n.contributors[0],i=e.colorSeed??e.name,a;t[1]===i?a=t[2]:(a=R(i),t[1]=i,t[2]=a);let o=a,s=r?mt[o]??we[o]:we[o],c;t[3]!==s||t[4]!==i?(c=s??ke(i),t[3]=s,t[4]=i,t[5]=c):c=t[5];let l=c;if(o!==`bot`){let e;t[6]===l?e=t[7]:(e={color:l},t[6]=l,t[7]=e);let n;return t[8]!==o||t[9]!==e?(n=(0,Z.jsx)(D_,{icon:o,width:14,height:14,className:`shrink-0`,style:e}),t[8]=o,t[9]=e,t[10]=n):n=t[10],n}if(e.name===`File System`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ga,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[11]=e):e=t[11],e}if(e.name===`Open Knowledge (service)`||e.name===`Git (upstream)`){let e;return t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(pa,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[12]=e):e=t[12],e}let u;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(jo,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[13]=u):u=t[13],u}if(n.authorEmail.includes(`agent`)||n.author.includes(`agent`)||n.authorEmail.includes(`cursor`)||n.authorEmail.includes(`claude`)){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(kr,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[14]=e):e=t[14],e}if(n.author===`openknowledge-server`||n.author===`server`){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(pa,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[15]=e):e=t[15],e}let i;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(jo,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[16]=i):i=t[16],i}function k_(e){let t=(0,$.c)(20),{entries:n,defaultExpanded:r,isDark:i,diffLayout:a,cache:o,docName:s,expandedShas:c,onToggleExpanded:l,onRestoreSuccess:u}=e,[d,f]=(0,Q.useState)(r);if(n.length===0)return null;let p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>f(A_),t[0]=p):p=t[0];let m;t[1]===d?m=t[2]:(m=d?(0,Z.jsx)(Mn,{className:`size-3`}):(0,Z.jsx)(An,{className:`size-3`}),t[1]=d,t[2]=m);let h=d?`Hide ${n.length} auto-save${n.length>1?`s`:``}`:`Show ${n.length} auto-save${n.length>1?`s`:``}`,g;t[3]!==d||t[4]!==m||t[5]!==h?(g=(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":d,className:`flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/80 transition-colors text-left`,onClick:p,children:[m,h]}),t[3]=d,t[4]=m,t[5]=h,t[6]=g):g=t[6];let _;t[7]!==o||t[8]!==a||t[9]!==s||t[10]!==n||t[11]!==d||t[12]!==c||t[13]!==i||t[14]!==u||t[15]!==l?(_=d&&n.map(e=>(0,Z.jsx)(W_,{entry:e,isDark:i,diffLayout:a,cache:o,docName:s,expanded:c.has(e.sha),onToggleExpanded:l,onRestoreSuccess:u},e.sha)),t[7]=o,t[8]=a,t[9]=s,t[10]=n,t[11]=d,t[12]=c,t[13]=i,t[14]=u,t[15]=l,t[16]=_):_=t[16];let v;return t[17]!==g||t[18]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-0.5`,children:[g,_]}),t[17]=g,t[18]=_,t[19]=v):v=t[19],v}function A_(e){return!e}function j_(e){return e.checkpoint?e.checkpoint.kind:`save`}function M_(e){let t=j_(e);if(t===`save`)return`Save Version`;let n=e.checkpoint?.size??null,r=n!=null&&n>0?` (${N_(n)})`:``;return t===`bridge-merge-loss`?`Auto-saved before a concurrent edit${r}`:`Recovered from an external change${r}`}function N_(e){return e<1024?`${e} B`:e<1024*1024?`${Math.round(e/102.4)/10} KB`:`${Math.round(e/104857.6)/10} MB`}function P_(e){return e.type===`checkpoint`?j_(e)===`save`?`version`:`auto-save`:`wip`}var F_={version:`Restore this version`,"auto-save":`Restore this auto-save`,wip:`Restore to this point`},I_={version:`Restore this version?`,"auto-save":`Restore this auto-save?`,wip:`Restore to this point?`};function L_(e){return F_[P_(e)]}function R_(e){return I_[P_(e)]}function z_(e){let t=[];for(let n of e.contributors)if(n.summaries)for(let e of n.summaries)t.push(e);return t}function B_(e){let t=(0,$.c)(20),{summaries:n}=e,[r,i]=(0,Q.useState)(!1),a=(0,Q.useId)();if(n.length===0)return null;let o,s;t[0]===n?(o=t[1],s=t[2]):([o,...s]=n,t[0]=n,t[1]=o,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),t[3]=c):c=t[3];let l;t[4]===o?l=t[5]:(l=(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[c,o]}),t[4]=o,t[5]=l);let u;t[6]!==r||t[7]!==s?(u=r&&s.map(H_),t[6]=r,t[7]=s,t[8]=u):u=t[8];let d;t[9]!==a||t[10]!==l||t[11]!==u?(d=(0,Z.jsxs)(`ul`,{id:a,className:`list-none`,children:[l,u]}),t[9]=a,t[10]=l,t[11]=u,t[12]=d):d=t[12];let f;t[13]!==r||t[14]!==a||t[15]!==s.length?(f=s.length>0&&(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,onClick:e=>{e.stopPropagation(),i(V_)},children:[r?(0,Z.jsx)(Mn,{className:`size-3`}):(0,Z.jsx)(An,{className:`size-3`}),r?`Hide ${s.length} more`:`Show ${s.length} more`]}),t[13]=r,t[14]=a,t[15]=s.length,t[16]=f):f=t[16];let p;return t[17]!==d||t[18]!==f?(p=(0,Z.jsxs)(`div`,{className:`mt-0.5`,children:[d,f]}),t[17]=d,t[18]=f,t[19]=p):p=t[19],p}function V_(e){return!e}function H_(e,t){return(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),e]},`${t}-${e}`)}function U_(e){let t=(0,$.c)(13),{sha:n,docName:r,cache:i,diffLayout:a,panelId:o}=e,s=x_(n,r,i),c;t[0]===s.status?c=t[1]:(c=s.status===`loading`&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Jt,{className:`size-3 animate-spin`}),`Loading diff…`]}),t[0]=s.status,t[1]=c);let l;t[2]===s.status?l=t[3]:(l=s.status===`error`&&(0,Z.jsx)(`p`,{className:`py-2 text-xs text-destructive`,children:`Diff unavailable`}),t[2]=s.status,t[3]=l);let u;t[4]!==a||t[5]!==s.diff||t[6]!==s.status?(u=s.status===`ready`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)(Jt,{className:`size-3 animate-spin`}),`Loading diff renderer…`]}),children:(0,Z.jsx)(S_,{diff:s.diff,viewType:a})}),t[4]=a,t[5]=s.diff,t[6]=s.status,t[7]=u):u=t[7];let d;return t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,Z.jsxs)(`div`,{id:o,className:`px-3 pb-2`,"data-testid":`timeline-entry-diff`,children:[c,l,u]}),t[8]=o,t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function W_(e){let t=(0,$.c)(128),{entry:n,prominent:r,isDark:i,diffLayout:a,cache:o,docName:s,expanded:c,onToggleExpanded:l,onRestoreSuccess:u}=e,d=r===void 0?!1:r,f;t[0]===n.timestamp?f=t[1]:(f=C_(n.timestamp),t[0]=n.timestamp,t[1]=f);let p=f,m;t[2]===n?m=t[3]:(m=E_(n),t[2]=n,t[3]=m);let h=m,g=n.contributors.flatMap(G_),_;t[4]===n?_=t[5]:(_=z_(n),t[4]=n,t[5]=_);let v=_,[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1),C=(0,Q.useRef)(null),w=(0,Q.useId)(),T,E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>()=>C.current?.abort(),E=[],t[6]=T,t[7]=E):(T=t[6],E=t[7]),(0,Q.useEffect)(T,E);let D;t[8]!==n.sha||t[9]!==l?(D=()=>l(n.sha),t[8]=n.sha,t[9]=l,t[10]=D):D=t[10];let O=D,k;t[11]===b?k=t[12]:(k=function(){C.current?.abort(),C.current=null,S(!1),b(!1)},t[11]=b,t[12]=k);let A=k,j;t[13]!==s||t[14]!==n.sha||t[15]!==u||t[16]!==b?(j=async function(){S(!0);let e=new AbortController;C.current=e;let t=function(){e.signal.aborted||S(!1),C.current===e&&(C.current=null)},r;try{r=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:s,commitSha:n.sha}),signal:e.signal})}catch(r){let i=r;!e.signal.aborted&&!(i instanceof DOMException&&i.name===`AbortError`)&&(console.error(`[timeline] rollback fetch failed`,{docName:s,sha:n.sha,err:i}),X.error(`Restore failed — document unchanged`,{duration:4e3})),t();return}if(e.signal.aborted){t();return}if(r.ok)b(!1),u();else{let e=`HTTP ${r.status}`;try{let t=await r.json();t.error&&(e=t.error)}catch{}console.error(`[timeline] rollback failed`,{docName:s,sha:n.sha,status:r.status,detail:e}),X.error(`Restore failed`,{description:e,duration:6e3})}t()},t[13]=s,t[14]=n.sha,t[15]=u,t[16]=b,t[17]=j):j=t[17];let M=j,N;t[18]!==n||t[19]!==i||t[20]!==d?(N=d?(()=>{let e=j_(n);return e===`bridge-merge-loss`?(0,Z.jsx)(Oe,{className:`size-3.5 shrink-0 text-amber-600 dark:text-amber-400`,"aria-hidden":`true`}):e===`external-change-rescue`?(0,Z.jsx)(Fa,{className:`size-3.5 shrink-0 text-sky-600 dark:text-sky-400`,"aria-hidden":`true`}):(0,Z.jsx)(Ma,{className:`size-3.5 shrink-0 text-muted-foreground`})})():(0,Z.jsx)(O_,{entry:n,isDark:i}),t[18]=n,t[19]=i,t[20]=d,t[21]=N):N=t[21];let P=N,F=c?w:void 0,I=c?`bg-muted`:`hover:bg-muted/80`,L;t[22]===I?L=t[23]:(L=[`group flex w-full items-start gap-2.5 rounded-lg px-3 py-2.5 text-left transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring`,I],t[22]=I,t[23]=L);let R=L.join(` `),z;t[24]===O?z=t[25]:(z=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),O())},t[24]=O,t[25]=z);let B;t[26]===P?B=t[27]:(B=(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:P}),t[26]=P,t[27]=B);let V;t[28]!==h||t[29]!==n||t[30]!==d?(V=d?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`text-xs text-foreground truncate`,children:M_(n)}),(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground/50`,children:`·`}),(0,Z.jsx)(`span`,{className:`truncate text-xs text-muted-foreground`,children:h})]}):(0,Z.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:h}),t[28]=h,t[29]=n,t[30]=d,t[31]=V):V=t[31];let H;t[32]!==n.timestamp||t[33]!==p?(H=(0,Z.jsx)(`time`,{className:`ml-auto shrink-0 text-xs text-muted-foreground/80`,dateTime:n.timestamp,title:n.timestamp,children:p}),t[32]=n.timestamp,t[33]=p,t[34]=H):H=t[34];let U;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`h-3 w-px shrink-0 bg-border`}),t[35]=U):U=t[35];let W;t[36]===n?W=t[37]:(W=L_(n),t[36]=n,t[37]=W);let G;t[38]===b?G=t[39]:(G=e=>{e.stopPropagation(),b(!0)},t[38]=b,t[39]=G);let ee;t[40]===x?ee=t[41]:(ee=x?(0,Z.jsx)(Jt,{className:`size-3 animate-spin`}):(0,Z.jsx)(Cr,{className:`size-3`}),t[40]=x,t[41]=ee);let te;t[42]!==x||t[43]!==W||t[44]!==G||t[45]!==ee?(te=(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`timeline-entry-restore`,"aria-label":W,disabled:x,onClick:G,children:ee})}),t[42]=x,t[43]=W,t[44]=G,t[45]=ee,t[46]=te):te=t[46];let ne;t[47]===n?ne=t[48]:(ne=L_(n),t[47]=n,t[48]=ne);let re;t[49]===ne?re=t[50]:(re=(0,Z.jsx)(wi,{side:`top`,children:ne}),t[49]=ne,t[50]=re);let ie;t[51]!==te||t[52]!==re?(ie=(0,Z.jsxs)(Ei,{children:[te,re]}),t[51]=te,t[52]=re,t[53]=ie):ie=t[53];let ae;t[54]!==V||t[55]!==H||t[56]!==ie?(ae=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[V,H,U,ie]}),t[54]=V,t[55]=H,t[56]=ie,t[57]=ae):ae=t[57];let oe;t[58]===v?oe=t[59]:(oe=v.length>0&&(0,Z.jsx)(B_,{summaries:v}),t[58]=v,t[59]=oe);let se=g.length>0?(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:g.join(`, `),children:g.join(`, `)}):(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:n.message,children:n.message}),ce;t[60]!==ae||t[61]!==oe||t[62]!==se?(ce=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[ae,oe,se]}),t[60]=ae,t[61]=oe,t[62]=se,t[63]=ce):ce=t[63];let le;t[64]!==c||t[65]!==O||t[66]!==F||t[67]!==R||t[68]!==z||t[69]!==B||t[70]!==ce?(le=(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":c,"aria-controls":F,"data-testid":`timeline-entry-expand`,className:R,onClick:O,onKeyDown:z,children:[B,ce]}),t[64]=c,t[65]=O,t[66]=F,t[67]=R,t[68]=z,t[69]=B,t[70]=ce,t[71]=le):le=t[71];let ue;t[72]!==o||t[73]!==a||t[74]!==w||t[75]!==s||t[76]!==n.sha||t[77]!==c?(ue=c&&(0,Z.jsx)(U_,{sha:n.sha,docName:s,cache:o,diffLayout:a,panelId:w}),t[72]=o,t[73]=a,t[74]=w,t[75]=s,t[76]=n.sha,t[77]=c,t[78]=ue):ue=t[78];let K;t[79]!==le||t[80]!==ue?(K=(0,Z.jsxs)(`div`,{className:`flex flex-col rounded-lg`,children:[le,ue]}),t[79]=le,t[80]=ue,t[81]=K):K=t[81];let q;t[82]!==A||t[83]!==b?(q=e=>{e?b(!0):A()},t[82]=A,t[83]=b,t[84]=q):q=t[84];let de;t[85]===n?de=t[86]:(de=R_(n),t[85]=n,t[86]=de);let fe;t[87]===de?fe=t[88]:(fe=(0,Z.jsx)(si,{children:de}),t[87]=de,t[88]=fe);let pe;t[89]===n.timestamp?pe=t[90]:(pe=w_(n.timestamp),t[89]=n.timestamp,t[90]=pe);let me;t[91]===n.sha?me=t[92]:(me=T_(n.sha),t[91]=n.sha,t[92]=me);let he;t[93]!==p||t[94]!==pe||t[95]!==me?(he=(0,Z.jsxs)(`span`,{className:`font-medium text-foreground`,children:[p,` (`,pe,`, `,me,`)`]}),t[93]=p,t[94]=pe,t[95]=me,t[96]=he):he=t[96];let ge;t[97]===h?ge=t[98]:(ge=(0,Z.jsx)(`span`,{className:`font-medium text-foreground`,children:h}),t[97]=h,t[98]=ge);let _e;t[99]!==he||t[100]!==ge?(_e=(0,Z.jsxs)(ai,{children:[`This will replace the current document content with the version from`,` `,he,` `,`by `,ge,`. Your current content is already saved in the timeline — you can restore it anytime.`]}),t[99]=he,t[100]=ge,t[101]=_e):_e=t[101];let ve;t[102]!==fe||t[103]!==_e?(ve=(0,Z.jsxs)(vi,{children:[fe,_e]}),t[102]=fe,t[103]=_e,t[104]=ve):ve=t[104];let ye;t[105]===A?ye=t[106]:(ye=(0,Z.jsx)(Y,{variant:`outline`,"data-testid":`timeline-entry-restore-cancel`,onClick:A,children:`Cancel`}),t[105]=A,t[106]=ye);let be;t[107]===M?be=t[108]:(be=()=>M(),t[107]=M,t[108]=be);let xe;t[109]===x?xe=t[110]:(xe=x?(0,Z.jsx)(Jt,{className:`mr-2 size-4 animate-spin`}):null,t[109]=x,t[110]=xe);let Se;t[111]!==x||t[112]!==be||t[113]!==xe?(Se=(0,Z.jsxs)(Y,{variant:`destructive`,"data-testid":`timeline-entry-restore-confirm`,disabled:x,onClick:be,children:[xe,`Restore`]}),t[111]=x,t[112]=be,t[113]=xe,t[114]=Se):Se=t[114];let Ce;t[115]!==ye||t[116]!==Se?(Ce=(0,Z.jsxs)(hi,{children:[ye,Se]}),t[115]=ye,t[116]=Se,t[117]=Ce):Ce=t[117];let we;t[118]!==ve||t[119]!==Ce?(we=(0,Z.jsxs)(di,{children:[ve,Ce]}),t[118]=ve,t[119]=Ce,t[120]=we):we=t[120];let Te;t[121]!==y||t[122]!==q||t[123]!==we?(Te=(0,Z.jsx)(yi,{open:y,onOpenChange:q,children:we}),t[121]=y,t[122]=q,t[123]=we,t[124]=Te):Te=t[124];let Ee;return t[125]!==K||t[126]!==Te?(Ee=(0,Z.jsxs)(Z.Fragment,{children:[K,Te]}),t[125]=K,t[126]=Te,t[127]=Ee):Ee=t[127],Ee}function G_(e){return e.docs}function K_(e){let t=(0,$.c)(63),{docName:n,diffLayout:r,onDiffLayoutChange:i}=e,{resolvedTheme:a}=We(),o=a===`dark`,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=[],t[0]=s):s=t[0];let[c,l]=(0,Q.useState)(s),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(null),m=(0,Q.useRef)(null),[h]=(0,Q.useState)(X_),[g,_]=(0,Q.useState)(Y_),v;t[1]===h?v=t[2]:(v=()=>{_(new Set),h.clear()},t[1]=h,t[2]=v);let y;t[3]===n?y=t[4]:(y=[n],t[3]=n,t[4]=y),(0,Q.useEffect)(v,y);let b;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(e){_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[5]=b):b=t[5];let x=b,S;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(){_(new Set)},t[6]=S):S=t[6];let C=S,w,T;t[7]===n?(w=t[8],T=t[9]):(w=()=>{if(!n){l([]);return}let e=!1,t=async function(){if(n)try{let t=await fetch(`/api/history?docName=${encodeURIComponent(n)}&limit=100`);if(e)return;if(!t.ok){p(`History unavailable`);return}let r=await t.json();if(e)return;l(r.entries??[]),p(null)}catch(t){let n=t;if(e)return;p(`History unavailable`),console.error(`[timeline]`,n)}};return d(!0),t().finally(()=>{e||d(!1)}),m.current=setInterval(t,1e4),()=>{e=!0,m.current&&clearInterval(m.current)}},T=[n],t[7]=n,t[8]=w,t[9]=T),(0,Q.useEffect)(w,T);let E,D,O,k,A,j,M,N;if(t[10]!==h||t[11]!==r||t[12]!==n||t[13]!==c||t[14]!==f||t[15]!==g||t[16]!==o||t[17]!==u||t[18]!==i){let e=[],a=[],s=!1;for(let t of c)t.type===`checkpoint`?(a.length>0&&(e.push({kind:`wip-group`,entries:a,isPreCheckpoint:!s}),a=[]),e.push({kind:`checkpoint`,entry:t}),s=!0):a.push(t);a.length>0&&e.push({kind:`wip-group`,entries:a,isPreCheckpoint:!s});let l;t[27]===c?l=t[28]:(l=c.some(J_),t[27]=c,t[28]=l);let d=!l,p=!u&&!f&&c.length>0;A=`flex h-full flex-col`,t[29]!==r||t[30]!==p||t[31]!==i?(j=p&&(0,Z.jsx)(`div`,{className:`flex items-center justify-end gap-1 px-2 py-1.5`,children:(0,Z.jsxs)(Ei,{children:[(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsxs)(be,{type:`single`,value:r,onValueChange:e=>{e&&i(e)},"aria-label":`Diff layout`,variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-md shrink-0`,children:[(0,Z.jsx)(Je,{value:`unified`,"aria-label":`Unified diff`,className:`size-6 px-0`,children:(0,Z.jsx)(po,{className:`size-3.5`})}),(0,Z.jsx)(Je,{value:`split`,"aria-label":`Split diff`,className:`size-6 px-0`,children:(0,Z.jsx)(Oa,{className:`size-3.5`})})]})}),(0,Z.jsx)(wi,{children:r===`unified`?`Unified diff`:`Split diff`})]})}),t[29]=r,t[30]=p,t[31]=i,t[32]=j):j=t[32],M=`flex-1 overflow-y-auto subtle-scrollbar`,t[33]===u?N=t[34]:(N=u&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,role:`status`,"aria-busy":`true`,"aria-label":`Loading timeline history`,children:[1,2,3].map(q_)}),t[33]=u,t[34]=N),t[35]!==f||t[36]!==u?(E=!u&&f&&(0,Z.jsx)(`div`,{className:`px-4 py-3`,children:(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:f})}),t[35]=f,t[36]=u,t[37]=E):E=t[37],t[38]!==c.length||t[39]!==f||t[40]!==u?(D=!u&&!f&&c.length===0&&(0,Z.jsx)(`div`,{className:`px-4 py-8 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No history yet`})}),t[38]=c.length,t[39]=f,t[40]=u,t[41]=D):D=t[41],t[42]!==h||t[43]!==r||t[44]!==n||t[45]!==c||t[46]!==f||t[47]!==g||t[48]!==d||t[49]!==o||t[50]!==u?(O=!u&&!f&&d&&c.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:c.map(e=>(0,Z.jsx)(W_,{entry:e,isDark:o,diffLayout:r,cache:h,docName:n,expanded:g.has(e.sha),onToggleExpanded:x,onRestoreSuccess:C},e.sha))}),t[42]=h,t[43]=r,t[44]=n,t[45]=c,t[46]=f,t[47]=g,t[48]=d,t[49]=o,t[50]=u,t[51]=O):O=t[51],k=!u&&!f&&!d&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:e.map((e,t)=>e.kind===`checkpoint`?(0,Z.jsx)(W_,{entry:e.entry,prominent:!0,isDark:o,diffLayout:r,cache:h,docName:n,expanded:g.has(e.entry.sha),onToggleExpanded:x,onRestoreSuccess:C},e.entry.sha):(0,Z.jsx)(k_,{entries:e.entries,defaultExpanded:e.isPreCheckpoint,isDark:o,diffLayout:r,cache:h,docName:n,expandedShas:g,onToggleExpanded:x,onRestoreSuccess:C},e.entries[0]?.sha??`wip-${t}`))}),t[10]=h,t[11]=r,t[12]=n,t[13]=c,t[14]=f,t[15]=g,t[16]=o,t[17]=u,t[18]=i,t[19]=E,t[20]=D,t[21]=O,t[22]=k,t[23]=A,t[24]=j,t[25]=M,t[26]=N}else E=t[19],D=t[20],O=t[21],k=t[22],A=t[23],j=t[24],M=t[25],N=t[26];let P;t[52]!==E||t[53]!==D||t[54]!==O||t[55]!==k||t[56]!==M||t[57]!==N?(P=(0,Z.jsxs)(`div`,{className:M,children:[N,E,D,O,k]}),t[52]=E,t[53]=D,t[54]=O,t[55]=k,t[56]=M,t[57]=N,t[58]=P):P=t[58];let F;return t[59]!==A||t[60]!==j||t[61]!==P?(F=(0,Z.jsxs)(`div`,{className:A,children:[j,P]}),t[59]=A,t[60]=j,t[61]=P,t[62]=F):F=t[62],F}function q_(e){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5`,children:[(0,Z.jsx)(Br,{className:`size-3.5 rounded mt-0.5 shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Z.jsx)(Br,{className:`h-3 w-28`}),(0,Z.jsx)(Br,{className:`h-3 w-40`})]})]},e)}function J_(e){return e.type===`checkpoint`}function Y_(){return new Set}function X_(){return new wr(32)}var Z_=[{id:`outline`,label:`Outline`,icon:eo},{id:`links`,label:`Links`,icon:Xa},{id:`graph`,label:`Graph`,icon:ro},{id:`timeline`,label:`Timeline`,icon:wa}];function Q_(){return r(()=>import(`./GraphPanel-DdVygxYk.js`),__vite__mapDeps([12,1,13,3,6,7,14,15,16,17,18,19,20,21,22,23,24,25]),import.meta.url)}var $_=(0,Q.lazy)(async()=>({default:(await Q_()).GraphPanel})),ev=(0,Q.lazy)(async()=>({default:(await r(()=>import(`./ActivityModeContent-1ymqlcHI.js`),__vite__mapDeps([26,1,2,27,28,29,14,13,3,6,7,30,4,8,15,31]),import.meta.url)).ActivityModeContent}));function tv(e){let t=(0,$.c)(13),{docName:n,isSourceMode:r,activeTab:i,onActiveTabChange:a,mode:o}=e,[s,c]=(0,Q.useState)(`unified`),l;t[0]!==i||t[1]!==o||t[2]!==a?(l=o===`doc`?(0,Z.jsx)(`div`,{className:`flex flex-row items-center justify-center gap-3 border-b border-border/60 p-2`,children:(0,Z.jsx)(be,{type:`single`,variant:`outline`,value:i,onValueChange:e=>{e&&a(e)},"aria-label":`Document panels`,children:Z_.map(nv)})}):null,t[0]=i,t[1]=o,t[2]=a,t[3]=l):l=t[3];let u;t[4]!==i||t[5]!==s||t[6]!==n||t[7]!==r||t[8]!==o?(u=o===`doc`?(0,Z.jsxs)(`div`,{role:`tabpanel`,id:`panel-${i}`,"aria-labelledby":`tab-${i}`,className:`min-h-0 flex-1`,children:[i===`outline`&&(0,Z.jsx)(Yi,{docName:n,isSourceMode:r}),i===`links`&&(0,Z.jsx)(Gg,{docName:n}),i===`graph`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Loading graph…`}),children:(0,Z.jsx)($_,{activeDocName:n})}),i===`timeline`&&(0,Z.jsx)(K_,{docName:n,diffLayout:s,onDiffLayoutChange:c})]}):(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Loading agent activity…`}),children:(0,Z.jsx)(ev,{})})}),t[4]=i,t[5]=s,t[6]=n,t[7]=r,t[8]=o,t[9]=u):u=t[9];let d;return t[10]!==l||t[11]!==u?(d=(0,Z.jsxs)(Z.Fragment,{children:[l,u]}),t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function nv(e){let{id:t,label:n,icon:r}=e;return(0,Z.jsxs)(Ei,{children:[(0,Z.jsx)(Je,{value:t,role:`tab`,id:`tab-${t}`,"aria-controls":`panel-${t}`,"aria-label":n,asChild:!0,children:(0,Z.jsx)(Ci,{children:(0,Z.jsx)(r,{})})}),(0,Z.jsx)(wi,{side:`bottom`,children:n})]},t)}function rv(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function iv(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function av(e){return e/100*window.innerHeight}function ov(e){return e/100*window.innerWidth}function sv(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function cv({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=sv(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=iv(t,i);break;case`em`:r=rv(t,i);break;case`vh`:r=av(i);break;case`vw`:r=ov(i);break}return r}function lv(e){return parseFloat(e.toFixed(3))}function uv({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function dv(e){let{panels:t}=e,n=uv({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=lv(cv({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=lv(cv({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=lv(cv({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=lv(cv({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function fv(e,t=`Assertion error`){if(!e)throw Error(t)}function pv(e,t){return Array.from(t).sort(e===`horizontal`?mv:hv)}function mv(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function hv(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function gv(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function _v(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function vv({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=_v(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return fv(i,`No rect found`),i}var yv;function bv(){return yv===void 0&&(yv=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),yv}function xv(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=pv(n,Array.from(t.children).filter(gv).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,vv({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=bv()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:uv({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var Sv=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},Cv=new Map,wv=new Sv;function Tv(e){Cv=new Map(Cv),Cv.delete(e)}function Ev(e,t){for(let[t]of Cv)if(t.id===e)return t}function Dv(e,t){for(let[t,n]of Cv)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function Ov(){return Cv}function kv(e,t){return wv.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function Av(e,t){let n=Cv.get(e);Cv=new Map(Cv),Cv.set(e,t),wv.emit(`groupChange`,{group:e,prev:n,next:t})}function jv(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=_v(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function Mv(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function Nv(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:zv(e),b:zv(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();fv(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:Rv(Lv(n.a)),b:Rv(Lv(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var Pv=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Fv(e){let t=getComputedStyle(Bv(e)??e).display;return t===`flex`||t===`inline-flex`}function Iv(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||Fv(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||Pv.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function Lv(e){let t=e.length;for(;t--;){let n=e[t];if(fv(n,`Missing node`),Iv(n))return n}return null}function Rv(e){return e&&Number(getComputedStyle(e).zIndex)||0}function zv(e){let t=[];for(;e;)t.push(e),e=Bv(e);return t}function Bv(e){let{parentNode:t}=e;return Mv(t)?t.host:t}function Vv(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Hv({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!gv(n)||n.contains(e)||e.contains(n))return!0;if(Nv(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(Vv(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function Uv(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=xv(r),a=jv(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Hv({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function Wv(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function Gv(e,t,n=0){return Math.abs(lv(e)-lv(t))<=n}function Kv(e,t){return Gv(e,t)?0:e>t?1:-1}function qv({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(Kv(r,c)<0)if(a){let e=(i+c)/2;r=Kv(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=lv(r),r}function Jv({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(Gv(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;fv(u!=null,`Invalid first pivot index`),fv(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];fv(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(fv(n!=null,`Previous layout not found for panel index ${t}`),Gv(n,i)){let t=o-n;Kv(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];fv(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(fv(n!=null,`Previous layout not found for panel index ${t}`),Gv(n,o)){let t=n-i;Kv(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];fv(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&Kv(i,c)<0)if(e>0){let t=c-o,n=t/2;Kv(i+e,c)<0&&(e=Kv(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;Kv(i-e,c)<0&&(e=Kv(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];fv(e!=null,`Previous layout not found for panel index ${r}`);let a=qv({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];fv(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=qv({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!Gv(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(Wv(c,l))return i;{let t=e<0?d:u,r=s[t];fv(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=qv({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!Gv(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];fv(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=qv({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(Gv(i,s)||(t-=s-i,l[r]=s),Gv(t,0))break;e>0?r--:r++}}}if(!Gv(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function Yv(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||Kv(e[n],t[n])!==0)return!1;return!0}function Xv({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!Gv(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];fv(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];fv(i!=null,`No layout data found for index ${e}`);let o=r[e];fv(o!=null,`No layout data found for index ${e}`);let s=qv({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!Gv(a,0))for(let e=0;e<t.length;e++){let n=r[e];fv(n!=null,`No layout data found for index ${e}`);let i=n+a,o=qv({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,Gv(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function Zv({groupId:e,panelId:t}){let n=()=>{let t=Ov();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=Xv({layout:Jv({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});Yv(l,p)||Av(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&Gv(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=uv({group:t});o(lv(cv({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function Qv(e){e.defaultPrevented||Uv(e,Ov()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=Zv({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function $v(e){let t=Ov();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function ey({groupId:e}){let t=()=>{let t=Ov();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=Xv({layout:e,panelConstraints:r});return n?o:(Yv(o,c)||Av(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function ty(e,t){let n=$v(e),r=Dv(n.id,!0),i=n.separators.find(t=>t.element===e);fv(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);fv(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=ey({groupId:n.id}).getLayout(),c=Xv({layout:Jv({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});Yv(s,c)||Av(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function ny(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=$v(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&ty(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&ty(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&ty(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&ty(t,-5);break;case`End`:e.preventDefault(),ty(t,100);break;case`Enter`:{e.preventDefault();let n=$v(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=Dv(n.id,!0),o=n.separators.find(e=>e.element===t);fv(o,`Matching separator not found`);let s=a.get(o);fv(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(fv(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];ty(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=$v(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);fv(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),ty(t,-100);break}}var ry={cursorFlags:0,state:`inactive`},iy=new Sv;function ay(){return ry}function oy(e){return iy.addListener(`change`,e)}function sy(e){let t=ry,n={...ry};n.cursorFlags=e,ry=n,iy.emit(`change`,{prev:t,next:n})}function cy(e){let t=ry;ry=e,iy.emit(`change`,{prev:t,next:e})}function ly(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Ov(),n=Uv(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),cy({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var uy=e=>e,dy=()=>{},fy=1,py=2,my=4,hy=8,gy=3,_y=12,vy;function yy(){return vy===void 0&&(vy=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(vy=!0)),vy}function by({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&yy()){let t=(e&fy)!==0,n=(e&py)!==0,r=(e&my)!==0,i=(e&hy)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return yy()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var xy=new WeakMap;function Sy(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=xy.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=ay();switch(r.state){case`active`:case`hover`:{let e=by({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}xy.set(e,{prevStyle:t,styleSheet:n})}function Cy({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=Jv({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(Yv(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?fy:py;break;case`vertical`:s|=d<0?my:hy;break}}else Av(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&gy:c|=s&gy,t.movementY===0?c|=o&_y:c|=s&_y,sy(c),Sy(e)}function wy(e){let t=Ov(),n=ay();switch(n.state){case`active`:Cy({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function Ty(e){if(e.defaultPrevented)return;let t=ay(),n=Ov();switch(t.state){case`active`:if(e.buttons===0){cy({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=Dv(e.group.id,!0);Av(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}Cy({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=Uv(e,n);r.length===0?t.state!==`inactive`&&cy({cursorFlags:0,state:`inactive`}):cy({cursorFlags:0,hitRegions:r,state:`hover`}),Sy(e.currentTarget);break}}}function Ey(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(ay().state){case`hover`:cy({cursorFlags:0,state:`inactive`})}}function Dy(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=ay();switch(t.state){case`active`:cy({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(Sy(e.currentTarget),t.hitRegions.forEach(e=>{let t=Dv(e.group.id,!0);Av(e.group,t)}),e.preventDefault())}}function Oy(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=lv(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=lv((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function ky(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=uv({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:lv(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function Ay(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function jy({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=lv(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=lv((r[e]??0)/a*l);else{let e=lv(l/c.length);for(let t of c)u[t]=e}return u}function My(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var Ny=new Map;function Py(e){let t=!0;fv(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=uv({group:e});if(t===0)return;let n=Dv(e.id);if(!n)return;let r=dv(e),i=n.defaultLayoutDeferred?Oy(r):n.layout,a=Xv({layout:jy({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&Yv(n.layout,a)&&Ay(n.derivedPanelConstraints,r)&&n.groupSize===t)return;Av(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else ky(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{fv(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=uv({group:e}),s=dv(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(My(e.panels,l)||(l=void 0));let u=Xv({layout:e.mutableState.layouts[c]??l??Oy(s),panelConstraints:s}),d=e.element.ownerDocument;Ny.set(d,(Ny.get(d)??0)+1);let f=new Map;return xv(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),Av(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{fv(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,ny)}),Ny.get(d)===1&&(d.addEventListener(`dblclick`,Qv,!0),d.addEventListener(`pointerdown`,ly,!0),d.addEventListener(`pointerleave`,wy),d.addEventListener(`pointermove`,Ty),d.addEventListener(`pointerout`,Ey),d.addEventListener(`pointerup`,Dy,!0)),function(){t=!1,Ny.set(d,Math.max(0,(Ny.get(d)??0)-1)),Tv(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,ny)}),Ny.get(d)||(d.removeEventListener(`dblclick`,Qv,!0),d.removeEventListener(`pointerdown`,ly,!0),d.removeEventListener(`pointerleave`,wy),d.removeEventListener(`pointermove`,Ty),d.removeEventListener(`pointerout`,Ey),d.removeEventListener(`pointerup`,Dy,!0)),a.disconnect()}}function Fy(){let[e,t]=(0,Q.useState)({});return[e,(0,Q.useCallback)(()=>t({}),[])]}function Iy(e){let t=(0,Q.useId)();return`${e??t}`}var Ly=typeof window<`u`?Q.useLayoutEffect:Q.useEffect;function Ry(e){let t=(0,Q.useRef)(e);return Ly(()=>{t.current=e},[e]),(0,Q.useCallback)((...e)=>t.current?.(...e),[t])}function zy(...e){return Ry(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function By(e){let t=(0,Q.useRef)({...e});return Ly(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var Vy=(0,Q.createContext)(null);function Hy(e,t){let n=(0,Q.useRef)({getLayout:()=>({}),setLayout:uy});(0,Q.useImperativeHandle)(t,()=>n.current,[]),Ly(()=>{Object.assign(n.current,ey({groupId:e}))})}function Uy({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,Q.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=Ry(e=>{Yv(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=Ry(e=>{Yv(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=Iy(s),v=(0,Q.useRef)(null),[y,b]=Fy(),x=(0,Q.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=zy(v,a);Hy(_,o);let C=Ry((e,t)=>{let r=ay(),i=Ev(e),a=Dv(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=By({defaultLayout:n,disableCursor:r}),T=(0,Q.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=pv(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=pv(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=Ev(_),i=Dv(_);r&&i&&Av(r,{...i,derivedPanelConstraints:dv(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,Q.useRef)(null);return Ly(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=Py(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=Dv(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=kv(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=Gv(t.collapsedSize,i[t.panelId]),a=Gv(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=ay().state!==`active`;h(i),o&&g(i)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,Q.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Z.jsx)(Vy.Provider,{value:T,children:(0,Z.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}Uy.displayName=`Group`;function Wy(){let e=(0,Q.useContext)(Vy);return fv(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Gy(e,t){let{id:n}=Wy(),r=(0,Q.useRef)({collapse:dy,expand:dy,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:dy});(0,Q.useImperativeHandle)(t,()=>r.current,[]),Ly(()=>{Object.assign(r.current,Zv({groupId:n,panelId:e}))})}function Ky({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=Iy(c),_=By({disabled:a}),v=(0,Q.useRef)(null),y=zy(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=Wy(),T=d!==null,E=Ry((e,t,n)=>{d?.(e,c,n)});Ly(()=>{let e=v.current;if(e!==null)return C({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,Q.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),Gy(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,Q.useSyncExternalStore)(e=>kv(x,e),D,D),k;return k=O?JSON.parse(O):i?{flexGrow:void 0,flexShrink:void 0,flexBasis:i}:{flexGrow:1},(0,Z.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...qy,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,Z.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}Ky.displayName=`Panel`;var qy={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function Jy(){return(0,Q.useRef)(null)}function Yy({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=Xv({layout:Jv({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=Xv({layout:Jv({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function Xy({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=Iy(a),l=By({disabled:n,disableDoubleClick:r}),[u,d]=(0,Q.useState)({}),[f,p]=(0,Q.useState)(`inactive`),m=(0,Q.useRef)(null),h=zy(m,i),{disableCursor:g,id:_,orientation:v,registerSeparator:y,updateSeparatorProps:b}=Wy(),x=v===`horizontal`?`vertical`:`horizontal`;Ly(()=>{let e=m.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=y(t),r=oy(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=kv(_,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(Yy({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[_,c,y,l]),(0,Q.useEffect)(()=>{b(c,{disabled:n,disableDoubleClick:r})},[n,r,c,b]);let S;return n&&!g&&(S=`not-allowed`),(0,Z.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":x,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":n?`disabled`:f,"data-testid":c,id:c,ref:h,role:`separator`,style:{flexBasis:`auto`,cursor:S,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}Xy.displayName=`Separator`;function Zy(e){return`/api/asset?path=${encodeURIComponent(e)}`}function Qy(e){let t=(0,$.c)(14),{assetPath:n,mediaKind:r}=e,i;t[0]===n?i=t[1]:(i=Zy(n),t[0]=n,t[1]=i);let a=i,o;t[2]===n?o=t[3]:(o=n.split(`/`).pop()??n,t[2]=n,t[3]=o);let s=o,c;t[4]===s?c=t[5]:(c=s.includes(`.`)?s.split(`.`).pop()?.toUpperCase()??`FILE`:`FILE`,t[4]=s,t[5]=c);let l=c,u;t[6]!==l||t[7]!==s||t[8]!==r||t[9]!==a?(u=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:r===`image`?(0,Z.jsx)(`img`,{src:a,alt:s,className:`max-h-full max-w-full object-contain`,draggable:!1}):r===`video`?(0,Z.jsx)(`video`,{src:a,controls:!0,className:`max-h-full max-w-full`}):(0,Z.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-3 text-center`,children:[(0,Z.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-md border bg-muted font-medium text-muted-foreground text-sm`,children:l}),(0,Z.jsx)(`div`,{className:`max-w-full break-words font-medium text-sm`,children:s}),(0,Z.jsx)(`a`,{href:a,className:`rounded-md border px-3 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground`,children:`Open file`})]})}),t[6]=l,t[7]=s,t[8]=r,t[9]=a,t[10]=u):u=t[10];let d;return t[11]!==s||t[12]!==u?(d=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":s,children:u}),t[11]=s,t[12]=u,t[13]=d):d=t[13],d}function $y(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`div`,{className:`tiptap-editor pt-10`,role:`status`,"aria-busy":`true`,"aria-label":`Loading document`,children:(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(Br,{className:`h-9 w-2/5 mt-6 mb-5`}),(0,Z.jsx)(Br,{className:`h-4 w-full`}),(0,Z.jsx)(Br,{className:`h-4 w-3/4`})]})}),e[0]=t):t=e[0],t}var eb=1700,tb=3;function nb(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??tb;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var rb={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:250,durationMin:620,durationMax:1400}},ib=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function ab(e,t={}){let n=t.rng??Math.random,r=t.colors??ib,i=rb[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var ob=1.8,sb=90,cb=16,lb=380,ub=.025,db=.1,fb=.18,pb=400,mb=9.2736,hb=18.1799,gb=14.5244,_b={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function vb(e,t){let{halfWidth:n,apexLift:r}=_b[t];return`M${e-n} ${gb+.3} Q${e} ${gb-r}, ${e+n} ${gb+.3}`}function yb(e){let t=1.5,n=.3;return`M${e-t} ${gb-n} Q${e} ${gb+1.4}, ${e+t} ${gb-n}`}var bb=15,xb=15;function Sb(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function Cb(e){let t=(0,$.c)(71),{size:n,className:r,trackMouse:i,variant:a,celebrateSignal:o}=e,s=n===void 0?48:n,c=i===void 0?!0:i,l=a===void 0?`default`:a,u=o===void 0?0:o,d=(0,Q.useRef)(null),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={x:0,y:0},t[0]=m):m=t[0];let h=(0,Q.useRef)(m),[g,_]=(0,Q.useState)(0),[v,y]=(0,Q.useState)(0),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[1]=b):b=t[1];let[x,S]=(0,Q.useState)(b),C=(0,Q.useRef)(0),w=(0,Q.useRef)(void 0),T=l===`sleeping`,E;t[2]!==g||t[3]!==T?(E=function(){if(T)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=C.current===0?1/0:e-C.current;C.current=e;let n=nb(g,t);_(n),y(Db),S(ab(n)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},eb)},t[2]=g,t[3]=T,t[4]=E):E=t[4];let D=E,O,k;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>()=>clearTimeout(w.current),k=[],t[5]=O,t[6]=k):(O=t[5],k=t[6]),(0,Q.useEffect)(O,k);let A,j;t[7]!==u||t[8]!==T?(A=()=>{u===0||T||(_(3),y(Eb),S(ab(3)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},eb))},j=[u,T],t[7]=u,t[8]=T,t[9]=A,t[10]=j):(A=t[9],j=t[10]),(0,Q.useEffect)(A,j);let M,N;t[11]!==T||t[12]!==c?(M=()=>{if(!c||T||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,l=function(r){e=r.clientX,t=r.clientY,n=!0};function u(){if(s=requestAnimationFrame(u),!n)return;let c=f.current,l=d.current;if(!c||!l)return;let m=c.getBoundingClientRect(),g=m.left+m.width/2,_=m.top+m.height*.48,v=e-g,y=t-_,b=Math.hypot(v,y),x=Math.max(-1,Math.min(1,v/lb)),S=Math.max(-1,Math.min(1,y/lb)),C=x*cb,w=-S*cb;r+=(w-r)*db,i+=(C-i)*db,l.style.transform=`perspective(${pb}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`;let T=0,E=0;if(b>=1){let e=Math.min(b/sb,1)*ob;T=v/b*e,E=y/b*e}a+=(T-a)*fb,o+=(E-o)*fb;let D=i*ub,O=-r*ub,k=a+D,A=o+O;h.current.x=k,h.current.y=A,p.current?.setAttribute(`transform`,`translate(${k.toFixed(3)} ${A.toFixed(3)})`)}return document.addEventListener(`mousemove`,l,{passive:!0}),s=requestAnimationFrame(u),()=>{document.removeEventListener(`mousemove`,l),cancelAnimationFrame(s),d.current&&(d.current.style.transform=``),h.current={x:0,y:0},p.current?.removeAttribute(`transform`)}},N=[c,T],t[11]=T,t[12]=c,t[13]=M,t[14]=N):(M=t[13],N=t[14]),(0,Q.useEffect)(M,N);let P;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{let e=p.current;if(!e)return;let{x:t,y:n}=h.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[15]=P):P=t[15],(0,Q.useLayoutEffect)(P);let F=g>0,I=F?g:1,L=F?`ok-blob-clicked-${g}`:null,R;t[16]===r?R=t[17]:(R=J(`ok-blob-3d-wrapper`,r),t[16]=r,t[17]=R);let z=T?`cursor-default`:`cursor-pointer`,B=`body-${v}`,V=T&&`ok-blob-sleeping`,H;t[18]!==L||t[19]!==V?(H=J(`ok-blob-group`,V,L),t[18]=L,t[19]=V,t[20]=H):H=t[20];let U;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`path`,{d:`M25.2339 6.78134C25.5199 7.35734 25.8179 8.47234 26.0179 9.07834C26.0189 9.08234 26.0209 9.08634 26.0219 9.09134C26.0229 9.09534 26.0249 9.10034 26.0259 9.10434C26.0539 9.19734 26.0949 9.29533 26.1519 9.41633C26.2919 9.71133 26.5269 10.1173 27.1299 11.1683C27.3259 11.4643 27.5209 11.7693 27.7119 12.0903C29.9739 15.1623 29.3259 20.1913 27.0469 22.9153C26.7779 23.2953 26.4869 23.6043 26.1889 23.8863C26.1519 23.9253 26.1129 23.9643 26.0729 24.0033C25.3159 24.7543 24.2949 25.4673 23.6129 25.8323C22.7469 26.2983 22.1349 26.5483 21.6299 26.7463C20.3649 27.3063 19.0609 27.7733 17.6569 28.0423C15.9649 28.3513 14.1939 28.4433 12.4569 28.1373C11.4779 27.9663 10.5119 27.6663 9.60891 27.2493C8.77491 26.8663 7.99192 26.3853 7.26992 25.8403C6.83592 25.5393 6.43893 25.2343 6.08093 24.9383C5.57893 24.5223 5.15993 24.1263 4.83493 23.7793C4.04993 22.9443 3.31593 21.8893 2.80893 21.0953C2.72593 20.9663 2.64792 20.8433 2.57592 20.7293C2.56192 20.7093 2.54793 20.6893 2.53393 20.6703C2.08593 20.0263 1.71892 19.3293 1.43792 18.5993C1.42892 18.5453 1.42093 18.4903 1.41293 18.4353C1.32093 17.7443 1.08292 16.9423 1.01092 15.6333C0.984921 15.0653 0.998928 14.4013 1.12393 13.6353C1.20693 13.1413 1.31993 12.9023 1.40893 12.7113C1.43593 12.6543 1.46193 12.6023 1.48593 12.5483C1.56793 12.3653 1.59392 12.1563 1.63592 11.9083C1.68992 11.5883 1.76992 11.1943 2.04592 10.7553C2.94392 9.37934 3.36792 8.81934 3.66592 8.33934C3.75592 8.20334 3.84292 8.08134 3.94192 7.96634C4.21592 7.64634 4.67693 7.29534 5.10293 7.05734C5.16693 7.02234 5.23093 6.98834 5.29193 6.95534C5.62993 6.77834 6.22592 6.30135 6.66992 5.92035C6.83692 5.77635 7.08193 5.60735 7.37393 5.40935C7.67393 5.20535 8.02593 4.96934 8.39193 4.70234C9.32093 4.02634 9.84091 3.69134 10.2599 3.42334C10.3799 3.34734 10.4919 3.27734 10.6049 3.20834C10.9609 2.98834 11.4149 2.73034 11.8869 2.48634C12.4519 2.19334 13.0469 1.92133 13.5089 1.72233C14.7399 1.30233 16.0539 1.01333 17.4169 1.00033C18.1169 0.991333 18.7939 1.16534 19.2389 1.43034C19.6869 1.69534 19.8689 2.00335 19.8039 2.23935C19.7379 2.47835 19.4399 2.63634 19.0109 2.74734C18.5789 2.85634 18.0469 2.92035 17.4889 2.96135C16.3639 3.04235 15.2399 3.36435 14.1499 3.80835C12.8199 4.35135 11.5379 5.07133 10.2719 5.84733C9.38691 6.39133 8.51192 6.97334 7.63592 7.56834C7.54492 7.63034 7.45492 7.69135 7.36492 7.75235C6.97392 8.06635 6.58293 8.38134 6.22293 8.66334C5.97893 8.85734 5.76793 9.04834 5.59393 9.21434C5.26893 9.52334 5.02393 9.74334 4.81893 9.93934C4.67793 10.0753 4.55793 10.2013 4.45593 10.3443C4.40093 10.4213 4.32992 10.5273 4.24792 10.6593C3.90492 11.1933 3.44493 12.1693 3.15393 13.1173C3.01893 13.5363 2.87991 14.0343 2.79391 14.5253C2.66591 15.2253 2.65594 15.9053 2.71994 16.2373C2.82794 16.8193 2.95593 17.4833 3.14093 18.0553C3.31293 18.6003 3.52991 19.0583 3.70791 19.2823C3.81591 19.4183 3.90394 19.5473 3.99594 19.6913C4.09394 19.8413 4.19191 20.0073 4.31091 20.2033C4.47891 20.4803 4.68592 20.8163 5.00192 21.2493C5.36492 21.7463 5.61793 22.1043 5.83493 22.4023C6.14493 22.8243 6.38591 23.1343 6.83691 23.5033C7.33891 23.9113 7.86593 24.3113 8.26693 24.6393C8.44893 24.7883 8.66993 24.9443 8.90493 25.0963C9.21593 25.2963 9.55192 25.4893 9.85592 25.6703C10.1059 25.8203 10.3059 25.9633 10.4869 26.0863C10.5429 26.1243 10.5979 26.1603 10.6519 26.1943C10.8699 26.2803 11.0929 26.3593 11.3159 26.4283C11.3539 26.4323 11.3949 26.4353 11.4369 26.4393C11.6509 26.4573 11.9089 26.4733 12.2209 26.5133C12.7169 26.5753 13.1399 26.6603 13.6019 26.7243C13.9589 26.7733 14.3409 26.8083 14.7729 26.7893C15.0729 26.7753 15.4069 26.7353 15.7389 26.6813C16.2349 26.6023 16.7179 26.4943 17.0569 26.4473C17.1499 26.4343 17.2359 26.4343 17.3209 26.4373C17.3489 26.4393 17.3799 26.4413 17.4109 26.4433C17.4119 26.4433 17.4119 26.4433 17.4129 26.4433C17.4199 26.4433 17.4279 26.4443 17.4349 26.4443C18.2329 26.2413 19.0259 25.9433 19.7959 25.5983C19.8609 25.5633 19.9259 25.5273 19.9899 25.4913C20.3059 25.3173 20.6049 25.1383 20.7869 24.9943C20.9829 24.8393 21.5189 24.5373 22.0579 24.1853C22.4109 23.9553 22.7649 23.7053 23.0369 23.4833C23.1949 23.3553 23.3689 23.2693 23.5479 23.1773C23.7129 23.0923 23.8809 23.0013 24.0349 22.8653C24.1109 22.7983 24.1869 22.7173 24.2639 22.6303C24.3309 22.5563 24.4039 22.4723 24.4759 22.3923C24.5459 22.3153 24.7199 22.1723 24.9139 21.9793C25.0079 21.8863 25.1059 21.7783 25.1909 21.6713C25.2199 21.6323 25.2489 21.5943 25.2769 21.5553C25.5919 21.0403 25.8779 20.5003 26.1019 19.9653C26.1299 19.8403 26.1379 19.7293 26.1279 19.6373C26.1199 19.5703 26.1029 19.5113 26.0839 19.4503C26.0599 19.3643 26.0329 19.2773 26.0239 19.1723C26.0169 19.0893 26.0309 19.0043 26.0629 18.9543C26.0779 18.9323 26.0969 18.9143 26.1129 18.8993C26.1329 18.8823 26.1499 18.8673 26.1569 18.8443C26.1609 18.8273 26.1579 18.8073 26.1529 18.7833C26.1459 18.7443 26.1369 18.6943 26.1539 18.6293C26.2189 18.3853 26.2869 18.1103 26.3319 17.8383C26.3829 17.5393 26.4049 17.2433 26.3949 17.0123C26.3849 16.7493 26.3909 16.3823 26.3469 16.0003C26.3179 15.7343 26.2659 15.4663 26.1979 15.2383C26.1319 15.0143 26.0219 14.7913 25.9039 14.5783C25.7629 14.3223 25.6119 14.0783 25.5169 13.8453C25.4969 13.7983 25.4999 13.7263 25.4999 13.6323C25.5009 13.5673 25.4999 13.4913 25.4919 13.4083C25.3239 13.1243 25.1459 12.8423 24.9589 12.5483C24.9479 12.5413 24.9369 12.5333 24.9249 12.5263C24.6689 12.3503 24.3139 12.1173 24.0769 11.5503C24.0179 11.4063 24.0069 11.2983 23.9969 11.1993C23.9859 11.1013 23.9799 11.0183 23.9289 10.9093C23.8709 10.7853 23.7759 10.6583 23.6709 10.4993C23.5849 10.3703 23.4899 10.2133 23.4199 10.0423C23.3819 9.95134 23.3509 9.85734 23.3329 9.75934C23.3299 9.74334 23.3269 9.72534 23.3229 9.70634C23.2899 9.52734 23.2439 9.26534 23.2409 8.98634C23.0209 8.24434 22.8339 7.48833 22.6519 6.77633C22.3429 5.57133 22.0519 4.54234 21.3329 3.95434C20.9839 3.65334 20.5689 3.35433 20.2459 3.05433C19.9259 2.75633 19.7449 2.47534 19.8019 2.23834C19.8639 2.00634 20.1589 1.82934 20.6659 1.80534C21.1699 1.78334 21.8699 1.93235 22.5209 2.39235C23.6159 3.14235 24.2029 4.38334 24.5599 5.35734C24.5829 5.40834 24.6049 5.46034 24.6259 5.51234C24.7849 5.89434 24.9529 6.22834 25.1199 6.55534C25.1579 6.63034 25.1969 6.70834 25.2339 6.78134Z`,className:`ok-blob-body`}),t[21]=U):U=t[21];let W=(F||T)&&`ok-blob-eye-hidden`,G;t[22]===W?G=t[23]:(G=J(`ok-blob-eye`,W),t[22]=W,t[23]=G);let ee;t[24]===G?ee=t[25]:(ee=(0,Z.jsx)(`ellipse`,{cx:mb,cy:gb,rx:1.2722,ry:1.9083,className:G}),t[24]=G,t[25]=ee);let te=(F||T)&&`ok-blob-eye-hidden`,ne;t[26]===te?ne=t[27]:(ne=J(`ok-blob-eye ok-blob-eye-right`,te),t[26]=te,t[27]=ne);let re;t[28]===ne?re=t[29]:(re=(0,Z.jsx)(`ellipse`,{cx:hb,cy:gb,rx:1.2722,ry:1.9083,className:ne}),t[28]=ne,t[29]=re);let ie;t[30]===I?ie=t[31]:(ie=vb(mb,I),t[30]=I,t[31]=ie);let ae=(!F||T)&&`ok-blob-eye-hidden`,oe;t[32]===ae?oe=t[33]:(oe=J(`ok-blob-happy-eye`,ae),t[32]=ae,t[33]=oe);let se;t[34]!==ie||t[35]!==oe?(se=(0,Z.jsx)(`path`,{d:ie,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:oe}),t[34]=ie,t[35]=oe,t[36]=se):se=t[36];let ce;t[37]===I?ce=t[38]:(ce=vb(hb,I),t[37]=I,t[38]=ce);let le=(!F||T)&&`ok-blob-eye-hidden`,ue;t[39]===le?ue=t[40]:(ue=J(`ok-blob-happy-eye`,le),t[39]=le,t[40]=ue);let K;t[41]!==ce||t[42]!==ue?(K=(0,Z.jsx)(`path`,{d:ce,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ue}),t[41]=ce,t[42]=ue,t[43]=K):K=t[43];let q;t[44]===T?q=t[45]:(q=T?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{d:yb(mb),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Z.jsx)(`path`,{d:yb(hb),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[44]=T,t[45]=q);let de;t[46]!==ee||t[47]!==re||t[48]!==se||t[49]!==K||t[50]!==q?(de=(0,Z.jsxs)(`g`,{ref:p,children:[ee,re,se,K,q]}),t[46]=ee,t[47]=re,t[48]=se,t[49]=K,t[50]=q,t[51]=de):de=t[51];let fe;t[52]!==B||t[53]!==H||t[54]!==de?(fe=(0,Z.jsxs)(`g`,{className:H,children:[U,de]},B),t[52]=B,t[53]=H,t[54]=de,t[55]=fe):fe=t[55];let pe;t[56]===T?pe=t[57]:(pe=T?(0,Z.jsxs)(`g`,{children:[(0,Z.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Z.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[56]=T,t[57]=pe);let me;t[58]!==v||t[59]!==x?(me=x.length>0&&(0,Z.jsx)(`g`,{children:x.map(wb)},`firework-${v}`),t[58]=v,t[59]=x,t[60]=me):me=t[60];let he;t[61]!==D||t[62]!==s||t[63]!==z||t[64]!==fe||t[65]!==pe||t[66]!==me?(he=(0,Z.jsxs)(`svg`,{ref:f,width:s,height:s,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:z,"aria-hidden":`true`,onClick:D,onMouseDown:Tb,children:[fe,pe,me]}),t[61]=D,t[62]=s,t[63]=z,t[64]=fe,t[65]=pe,t[66]=me,t[67]=he):he=t[67];let ge;return t[68]!==R||t[69]!==he?(ge=(0,Z.jsx)(`span`,{ref:d,className:R,children:he}),t[68]=R,t[69]=he,t[70]=ge):ge=t[70],ge}function wb(e){return(0,Z.jsx)(`circle`,{cx:bb+e.originDx,cy:xb+e.originDy,r:e.size,className:`ok-blob-firework`,style:Sb(e)},e.id)}function Tb(e){return e.preventDefault()}function Eb(e){return e+1}function Db(e){return e+1}function Ob(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`field-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var kb=yt(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function Ab(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,o;t[4]!==n||t[5]!==a?(o=J(kb({orientation:a}),n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Z.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":a,className:o,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function jb(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`group/field-content flex flex-1 flex-col gap-0.5 leading-snug`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`field-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Mb(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Jr,{"data-slot":`field-label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Nb(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`field-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Pb(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`p`,{"data-slot":`field-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Fb(e){let t=(0,$.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,errors:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;bb0:{if(n){o=n;break bb0}if(!i?.length){o=null;break bb0}let e;t[5]===i?e=t[6]:(e=[...new Map(i.map(Lb)).values()],t[5]=i,t[6]=e);let r=e;if(r?.length===1){o=r[0]?.message;break bb0}let a;t[7]===r?a=t[8]:(a=(0,Z.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:r.map(Ib)}),t[7]=r,t[8]=a),o=a}let s=o;if(!s)return null;let c;t[9]===r?c=t[10]:(c=J(`text-sm font-normal text-destructive`,r),t[9]=r,t[10]=c);let l;return t[11]!==s||t[12]!==a||t[13]!==c?(l=(0,Z.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:c,...a,children:s}),t[11]=s,t[12]=a,t[13]=c,t[14]=l):l=t[14],l}function Ib(e){return e?.message&&(0,Z.jsx)(`li`,{children:e.message},e.message)}function Lb(e){return[e?.message,e]}function Rb(){let e=typeof window<`u`?window.okDesktop:void 0;return e?.seed?{plan:t=>e.seed.plan(t),apply:t=>e.seed.apply(t)}:{plan:async e=>{let t=e?`?rootDir=${encodeURIComponent(e)}`:``;return await(await fetch(`/api/seed/plan${t}`)).json()},apply:async e=>await(await fetch(`/api/seed/apply`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({plan:e})})).json()}}function zb(e){let t=(0,$.c)(45),{open:n,onOpenChange:r,onSeedApplied:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={kind:`loading`},t[0]=a):a=t[0];let[o,s]=(0,Q.useState)(a),[c,l]=(0,Q.useState)(`project-root`),[u,d]=(0,Q.useState)(`brain`),f=(0,Q.useRef)(!0),p,m;t[1]===n?(p=t[2],m=t[3]):(p=()=>{n&&(l(`project-root`),d(`brain`),f.current=!0)},m=[n],t[1]=n,t[2]=p,t[3]=m),(0,Q.useEffect)(p,m);let h;t[4]===u?h=t[5]:(h=u.trim(),t[4]=u,t[5]=h);let g=h,_=c===`subfolder`&&g===``,v,y;t[6]!==n||t[7]!==c||t[8]!==_||t[9]!==g?(v=()=>{if(!n)return;if(_){s({kind:`error`,message:`Enter a folder name (e.g. brain).`});return}let e=c===`project-root`?void 0:g,t=f.current?0:200;f.current=!1;let r=!1,i=setTimeout(()=>{r||(s(Bb),Rb().plan(e).then(e=>{if(!r){if(!e.ok){s({kind:`error`,message:e.error.message});return}s(e.plan.created.length>0?{kind:`plan`,plan:e.plan}:{kind:`already-seeded`,plan:e.plan})}}).catch(e=>{r||s({kind:`error`,message:e instanceof Error?e.message:String(e)})}))},t);return()=>{r=!0,clearTimeout(i)}},y=[n,c,g,_],t[6]=n,t[7]=c,t[8]=_,t[9]=g,t[10]=v,t[11]=y):(v=t[10],y=t[11]),(0,Q.useEffect)(v,y);let b;t[12]!==r||t[13]!==i||t[14]!==o.kind||t[15]!==o.plan?(b=async function(){if(o.kind!==`plan`)return;s({kind:`applying`,plan:o.plan});let e=await Rb().apply(o.plan);e.ok?(X.success(`LLM brain initialized (${e.result.applied} ${e.result.applied===1?`entry`:`entries`})`),i?.(),r(!1)):(X.error(`Initialize failed: ${e.error.message}`),s({kind:`error`,message:e.error.message}))},t[12]=r,t[13]=i,t[14]=o.kind,t[15]=o.plan,t[16]=b):b=t[16];let x=b,S;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsxs)(vi,{children:[(0,Z.jsxs)(si,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(kr,{"aria-hidden":`true`,className:`h-4 w-4 text-foreground opacity-70`}),`Initialize LLM brain`]}),(0,Z.jsx)(ai,{children:`Three layers designed so AI agents can navigate naturally: raw sources, working drafts, and canonical articles.`})]}),t[17]=S):S=t[17];let C;t[18]!==c||t[19]!==u?(C=(0,Z.jsx)(Vb,{choice:c,subfolder:u,onChoiceChange:l,onSubfolderChange:d}),t[18]=c,t[19]=u,t[20]=C):C=t[20];let w;t[21]===o?w=t[22]:(w=(0,Z.jsx)(Hb,{phase:o}),t[21]=o,t[22]=w);let T;t[23]!==w||t[24]!==C?(T=(0,Z.jsxs)(mi,{className:`space-y-6`,children:[C,w]}),t[23]=w,t[24]=C,t[25]=T):T=t[25];let E;t[26]===r?E=t[27]:(E=()=>r(!1),t[26]=r,t[27]=E);let D=o.kind===`already-seeded`||o.kind===`error`?`Close`:`Cancel`,O;t[28]!==E||t[29]!==D?(O=(0,Z.jsx)(Y,{className:`uppercase font-mono`,variant:`ghost`,onClick:E,children:D}),t[28]=E,t[29]=D,t[30]=O):O=t[30];let k;t[31]!==x||t[32]!==o.kind||t[33]!==_?(k=o.kind===`plan`?(0,Z.jsx)(Y,{onClick:x,disabled:_,children:`Initialize`}):o.kind===`applying`?(0,Z.jsxs)(Y,{disabled:!0,children:[(0,Z.jsx)(Jt,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),`Setting up…`]}):null,t[31]=x,t[32]=o.kind,t[33]=_,t[34]=k):k=t[34];let A;t[35]!==O||t[36]!==k?(A=(0,Z.jsxs)(hi,{children:[O,k]}),t[35]=O,t[36]=k,t[37]=A):A=t[37];let j;t[38]!==T||t[39]!==A?(j=(0,Z.jsxs)(di,{className:`sm:max-w-2xl`,"data-ok-layer-spawned":``,children:[S,T,A]}),t[38]=T,t[39]=A,t[40]=j):j=t[40];let M;return t[41]!==r||t[42]!==n||t[43]!==j?(M=(0,Z.jsx)(yi,{open:n,onOpenChange:r,children:j}),t[41]=r,t[42]=n,t[43]=j,t[44]=M):M=t[44],M}function Bb(e){return e.kind===`plan`||e.kind===`already-seeded`?e:{kind:`loading`}}function Vb(e){let t=(0,$.c)(21),{choice:n,subfolder:r,onChoiceChange:i,onSubfolderChange:a}=e,o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:`Where should the brain live?`}),t[0]=o):o=t[0];let s;t[1]===i?s=t[2]:(s=e=>i(e),t[1]=i,t[2]=s);let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Mb,{htmlFor:`seed-root-project-root`,children:(0,Z.jsxs)(Ab,{orientation:`horizontal`,children:[(0,Z.jsxs)(jb,{children:[(0,Z.jsx)(Nb,{children:`Project root`}),(0,Z.jsx)(Pb,{children:`Scaffold the three folders directly under this project.`})]}),(0,Z.jsx)(Gr,{value:`project-root`,id:`seed-root-project-root`})]})}),t[3]=c):c=t[3];let l,u;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Nb,{children:`In a subfolder`}),u=(0,Z.jsx)(Pb,{className:`nth-last-2:mt-0`,children:`Created if missing. Reuses the folder if it already exists.`}),t[4]=l,t[5]=u):(l=t[4],u=t[5]);let d;t[6]===a?d=t[7]:(d=e=>a(e.target.value),t[6]=a,t[7]=d);let f;t[8]===i?f=t[9]:(f=()=>i(`subfolder`),t[8]=i,t[9]=f);let p;t[10]!==r||t[11]!==d||t[12]!==f?(p=(0,Z.jsxs)(jb,{children:[l,u,(0,Z.jsx)(Jn,{value:r,onChange:d,onFocus:f,placeholder:`brain`,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,className:`mt-1.5 font-mono text-xs bg-background`})]}),t[10]=r,t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(Gr,{value:`subfolder`,id:`seed-root-subfolder`}),t[14]=m):m=t[14];let h;t[15]===p?h=t[16]:(h=(0,Z.jsx)(Mb,{htmlFor:`seed-root-subfolder`,children:(0,Z.jsxs)(Ab,{orientation:`horizontal`,children:[p,m]})}),t[15]=p,t[16]=h);let g;return t[17]!==n||t[18]!==h||t[19]!==s?(g=(0,Z.jsxs)(`div`,{className:`space-y-2 py-1`,children:[o,(0,Z.jsxs)(Fr,{className:`sm:flex`,value:n,onValueChange:s,children:[c,h]})]}),t[17]=n,t[18]=h,t[19]=s,t[20]=g):g=t[20],g}function Hb(e){let t=(0,$.c)(11),{phase:n}=e;if(n.kind===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-4 text-sm text-muted-foreground`,children:[(0,Z.jsx)(Jt,{"aria-hidden":`true`,className:`h-4 w-4 animate-spin`}),`Computing scaffold plan…`]}),t[0]=e):e=t[0],e}if(n.kind===`error`){let e;return t[1]===n.message?e=t[2]:(e=(0,Z.jsx)(`div`,{className:`rounded-md bg-destructive/10 p-3 text-sm text-destructive`,children:n.message}),t[1]=n.message,t[2]=e),e}if(n.kind===`already-seeded`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`div`,{className:`py-2 text-sm`,children:[(0,Z.jsx)(`p`,{className:`font-medium`,children:`This LLM brain is already set up.`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`The three-layer structure is in place — there's nothing left to scaffold.`})]}),t[3]=e):e=t[3],e}let r=n.plan,i;t[4]===r?i=t[5]:(i=(0,Z.jsx)(Jb,{plan:r}),t[4]=r,t[5]=i);let a;t[6]===r.warnings?a=t[7]:(a=r.warnings.length>0?(0,Z.jsx)(`div`,{className:`rounded-md bg-warning/10 p-3 text-xs text-warning-foreground`,children:r.warnings.map(Ub)}):null,t[6]=r.warnings,t[7]=a);let o;return t[8]!==i||t[9]!==a?(o=(0,Z.jsxs)(`div`,{className:`space-y-6 py-1 text-sm`,children:[i,a]}),t[8]=i,t[9]=a,t[10]=o):o=t[10],o}function Ub(e){return(0,Z.jsx)(`p`,{children:e},e)}var Wb=[{name:`external-sources`,blurb:`Raw sources saved verbatim — full text of URLs and PDFs, not just citations. Every claim traces back to preserved evidence.`},{name:`research`,blurb:`Provisional analysis synthesizing sources. Every claim cites a doc; promotes to articles/ once the team trusts the findings.`},{name:`articles`,blurb:`Canonical decisions. Each links back through research/ to its sources — no dead links, full evidence chain in repo.`}],Gb={"log.md":`Append-only timeline`};function Kb(e){return e.split(`/`).pop()??e}function qb(e){let t=new Map(Wb.map(e=>[e.name,e.blurb])),n=e.created.filter(e=>e.kind===`folder`).map(e=>({kind:`folder`,name:`${e.path}/`,description:t.get(Kb(e.path))??``})),r=e.created.filter(e=>e.kind===`file`).map(e=>({kind:`file`,name:e.path,description:Gb[Kb(e.path)]??``}));return[...n,...r]}function Jb(e){let t=(0,$.c)(13),{plan:n}=e,r,i,a,o;if(t[0]!==n){let e=qb(n);a=`space-y-3`,t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsxs)(`h3`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-primary`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`flex items-center justify-center`,children:`◇`}),`What gets created`]}),t[5]=o):o=t[5],r=`space-y-3 overflow-y-auto subtle-scrollbar max-h-full`,i=e.map(Yb),t[0]=n,t[1]=r,t[2]=i,t[3]=a,t[4]=o}else r=t[1],i=t[2],a=t[3],o=t[4];let s;t[6]!==r||t[7]!==i?(s=(0,Z.jsx)(`ul`,{className:r,children:i}),t[6]=r,t[7]=i,t[8]=s):s=t[8];let c;return t[9]!==a||t[10]!==o||t[11]!==s?(c=(0,Z.jsxs)(`section`,{className:a,children:[o,s]}),t[9]=a,t[10]=o,t[11]=s,t[12]=c):c=t[12],c}function Yb(e){return(0,Z.jsxs)(`li`,{className:`flex items-start gap-3 rounded-md border border-border/60 bg-muted/20 p-3`,children:[e.kind===`folder`?(0,Z.jsx)(Va,{"aria-hidden":`true`,className:`mt-1 h-4 w-4 shrink-0 text-muted-foreground`,strokeWidth:1.5}):(0,Z.jsx)(Ia,{"aria-hidden":`true`,className:`mt-0.5 h-4 w-4 shrink-0 text-muted-foreground`,strokeWidth:1.5}),(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[(0,Z.jsx)(`code`,{className:`font-mono text-1sm`,children:e.name}),e.description?(0,Z.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:e.description}):null]})]},e.name)}function Xb(){let e=(0,$.c)(15),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(`loading`),[s,c]=(0,Q.useState)(0),l=(0,Q.useRef)(!1),u=(0,Q.useRef)(void 0),d,f;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=!1,t=async function(){let t=fetch(`/api/documents`).then(async t=>{let n=await t.json().catch(tx);e||(t.ok&&n?.ok&&Array.isArray(n.documents)?(i(n.documents.length),l.current=!0):l.current||=(i(1),!0))}).catch(()=>{!e&&!l.current&&(i(1),l.current=!0)}),n=(async()=>{let t=typeof window<`u`?window.okDesktop:void 0;try{let n=t?.seed?await t.seed.plan():await fetch(`/api/seed/plan`).then(ex);if(e)return;if(!n?.ok){o(`error`);return}o(n.plan.created.length>0?`has-work`:`seeded`)}catch{e||o(`error`)}})();await Promise.all([t,n])};t();let n=Ue(e=>{e.includes(`files`)&&t()});return()=>{e=!0,n(),clearTimeout(u.current)}},f=[],e[0]=d,e[1]=f):(d=e[0],f=e[1]),(0,Q.useEffect)(d,f);let p;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=function(){clearTimeout(u.current),u.current=setTimeout(()=>c($b),250),o(`seeded`),fetch(`/api/documents`).then(async e=>{let t=await e.json().catch(Qb);e.ok&&t?.ok&&Array.isArray(t.documents)&&i(t.documents.length)}).catch(Zb)},e[2]=p):p=e[2];let m=p,h=a===`has-work`,g=r!==null&&a!==`loading`,_=r===0,v;e[3]===s?v=e[4]:(v=(0,Z.jsx)(Cb,{size:80,celebrateSignal:s}),e[3]=s,e[4]=v);let y;e[5]!==_||e[6]!==g||e[7]!==h?(y=g?_?(0,Z.jsx)(nx,{onCtaClick:()=>n(!0),showCta:h}):(0,Z.jsx)(rx,{onCtaClick:()=>n(!0),showCta:h}):null,e[5]=_,e[6]=g,e[7]=h,e[8]=y):y=e[8];let b;e[9]===t?b=e[10]:(b=(0,Z.jsx)(zb,{open:t,onOpenChange:n,onSeedApplied:m}),e[9]=t,e[10]=b);let x;return e[11]!==v||e[12]!==y||e[13]!==b?(x=(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-6 px-6`,children:[v,y,b]}),e[11]=v,e[12]=y,e[13]=b,e[14]=x):x=e[14],x}function Zb(){}function Qb(){return null}function $b(e){return e+1}function ex(e){return e.json()}function tx(){return null}function nx(e){let t=(0,$.c)(7),{onCtaClick:n,showCta:r}=e,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`h2`,{className:`text-base font-medium`,children:`Welcome to your LLM brain`}),a=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`A space for working with AI agents. Start with a curated layer structure — or create your own files in the sidebar.`}),t[0]=i,t[1]=a):(i=t[0],a=t[1]);let o;t[2]!==n||t[3]!==r?(o=r?(0,Z.jsxs)(Y,{className:`mt-1`,onClick:n,children:[(0,Z.jsx)(kr,{"aria-hidden":`true`,className:`h-4 w-4`}),`Initialize LLM brain`]}):null,t[2]=n,t[3]=r,t[4]=o):o=t[4];let s;return t[5]===o?s=t[6]:(s=(0,Z.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-3 text-center`,children:[i,a,o]}),t[5]=o,t[6]=s),s}function rx(e){let t=(0,$.c)(6),{onCtaClick:n,showCta:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`span`,{className:`select-none text-sm text-muted-foreground`,children:`Select a document to edit`}),t[0]=i):i=t[0];let a;t[1]!==n||t[2]!==r?(a=r?(0,Z.jsxs)(Y,{variant:`ghost`,size:`sm`,className:`uppercase font-mono text-xs`,onClick:n,children:[(0,Z.jsx)(kr,{"aria-hidden":`true`,className:`h-3.5 w-3.5`}),`Initialize LLM brain`]}):null,t[1]=n,t[2]=r,t[3]=a):a=t[3];let o;return t[4]===a?o=t[5]:(o=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[i,a]}),t[4]=a,t[5]=o),o}function ix(){var e=[...arguments];return(0,Q.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var ax=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function ox(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function sx(e){return`nodeType`in e}function cx(e){return e?ox(e)?e:sx(e)?e.ownerDocument?.defaultView??window:window:window}function lx(e){let{Document:t}=cx(e);return e instanceof t}function ux(e){return ox(e)?!1:e instanceof cx(e).HTMLElement}function dx(e){return e instanceof cx(e).SVGElement}function fx(e){return e?ox(e)?e.document:sx(e)?lx(e)?e:ux(e)||dx(e)?e.ownerDocument:document:document:document}var px=ax?Q.useLayoutEffect:Q.useEffect;function mx(e){let t=(0,Q.useRef)(e);return px(()=>{t.current=e}),(0,Q.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function hx(){let e=(0,Q.useRef)(null);return[(0,Q.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,Q.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function gx(e,t){t===void 0&&(t=[e]);let n=(0,Q.useRef)(e);return px(()=>{n.current!==e&&(n.current=e)},t),n}function _x(e,t){let n=(0,Q.useRef)();return(0,Q.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function vx(e){let t=mx(e),n=(0,Q.useRef)(null);return[n,(0,Q.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function yx(e){let t=(0,Q.useRef)();return(0,Q.useEffect)(()=>{t.current=e},[e]),t.current}var bx={};function xx(e,t){return(0,Q.useMemo)(()=>{if(t)return t;let n=bx[e]==null?0:bx[e]+1;return bx[e]=n,e+`-`+n},[e,t])}function Sx(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>{let r=Object.entries(n);for(let[n,i]of r){let r=t[n];r!=null&&(t[n]=r+e*i)}return t},{...t})}}var Cx=Sx(1),wx=Sx(-1);function Tx(e){return`clientX`in e&&`clientY`in e}function Ex(e){if(!e)return!1;let{KeyboardEvent:t}=cx(e.target);return t&&e instanceof t}function Dx(e){if(!e)return!1;let{TouchEvent:t}=cx(e.target);return t&&e instanceof t}function Ox(e){if(Dx(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Tx(e)?{x:e.clientX,y:e.clientY}:null}var kx=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return`translate3d(`+(t?Math.round(t):0)+`px, `+(n?Math.round(n):0)+`px, 0)`}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return`scaleX(`+t+`) scaleY(`+n+`)`}},Transform:{toString(e){if(e)return[kx.Translate.toString(e),kx.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),Ax=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function jx(e){return e.matches(Ax)?e:e.querySelector(Ax)}var Mx={display:`none`};function Nx(e){let{id:t,value:n}=e;return Q.createElement(`div`,{id:t,style:Mx},n)}function Px(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return Q.createElement(`div`,{id:t,style:{position:`fixed`,top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0 0 0 0)`,clipPath:`inset(100%)`,whiteSpace:`nowrap`},role:`status`,"aria-live":r,"aria-atomic":!0},n)}function Fx(){let[e,t]=(0,Q.useState)(``);return{announce:(0,Q.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var Ix=(0,Q.createContext)(null);function Lx(e){let t=(0,Q.useContext)(Ix);(0,Q.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function Rx(){let[e]=(0,Q.useState)(()=>new Set),t=(0,Q.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,Q.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var zx={draggable:`
|
|
28
|
-
To pick up a draggable item, press the space bar.
|
|
29
|
-
While dragging, use the arrow keys to move the item.
|
|
30
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
31
|
-
`},Bx={onDragStart(e){let{active:t}=e;return`Picked up draggable item `+t.id+`.`},onDragOver(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was moved over droppable area `+n.id+`.`:`Draggable item `+t.id+` is no longer over a droppable area.`},onDragEnd(e){let{active:t,over:n}=e;return n?`Draggable item `+t.id+` was dropped over droppable area `+n.id:`Draggable item `+t.id+` was dropped.`},onDragCancel(e){let{active:t}=e;return`Dragging was cancelled. Draggable item `+t.id+` was dropped.`}};function Vx(e){let{announcements:t=Bx,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=zx}=e,{announce:a,announcement:o}=Fx(),s=xx(`DndLiveRegion`),[c,l]=(0,Q.useState)(!1);if((0,Q.useEffect)(()=>{l(!0)},[]),Lx((0,Q.useMemo)(()=>({onDragStart(e){let{active:n}=e;a(t.onDragStart({active:n}))},onDragMove(e){let{active:n,over:r}=e;t.onDragMove&&a(t.onDragMove({active:n,over:r}))},onDragOver(e){let{active:n,over:r}=e;a(t.onDragOver({active:n,over:r}))},onDragEnd(e){let{active:n,over:r}=e;a(t.onDragEnd({active:n,over:r}))},onDragCancel(e){let{active:n,over:r}=e;a(t.onDragCancel({active:n,over:r}))}}),[a,t])),!c)return null;let u=Q.createElement(Q.Fragment,null,Q.createElement(Nx,{id:r,value:i.draggable}),Q.createElement(Px,{id:s,announcement:o}));return n?(0,_a.createPortal)(u,n):u}var Hx;(function(e){e.DragStart=`dragStart`,e.DragMove=`dragMove`,e.DragEnd=`dragEnd`,e.DragCancel=`dragCancel`,e.DragOver=`dragOver`,e.RegisterDroppable=`registerDroppable`,e.SetDroppableDisabled=`setDroppableDisabled`,e.UnregisterDroppable=`unregisterDroppable`})(Hx||={});function Ux(){}function Wx(e,t){return(0,Q.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function Gx(){var e=[...arguments];return(0,Q.useMemo)(()=>[...e].filter(e=>e!=null),[...e])}var Kx=Object.freeze({x:0,y:0});function qx(e,t){return Math.sqrt((e.x-t.x)**2+(e.y-t.y)**2)}function Jx(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Yx(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Xx(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Zx(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function Qx(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var $x=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Qx(t,t.left,t.top),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=qx(Qx(r),i);a.push({id:t,data:{droppableContainer:e,value:n}})}}return a.sort(Jx)},eS=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=Xx(t),a=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=Xx(r),o=i.reduce((e,t,r)=>e+qx(n[r],t),0),s=Number((o/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:s}})}}return a.sort(Jx)};function tS(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),a=Math.min(t.top+t.height,e.top+e.height),o=i-r,s=a-n;if(r<i&&n<a){let n=t.width*t.height,r=e.width*e.height,i=o*s,a=i/(n+r-i);return Number(a.toFixed(4))}return 0}var nS=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,i=[];for(let e of r){let{id:r}=e,a=n.get(r);if(a){let n=tS(a,t);n>0&&i.push({id:r,data:{droppableContainer:e,value:n}})}}return i.sort(Yx)};function rS(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function iS(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Kx}function aS(e){return function(t){return[...arguments].slice(1).reduce((t,n)=>({...t,top:t.top+e*n.y,bottom:t.bottom+e*n.y,left:t.left+e*n.x,right:t.right+e*n.x}),{...t})}}var oS=aS(1);function sS(e){if(e.startsWith(`matrix3d(`)){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith(`matrix(`)){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function cS(e,t,n){let r=sS(t);if(!r)return e;let{scaleX:i,scaleY:a,x:o,y:s}=r,c=e.left-o-(1-i)*parseFloat(n),l=e.top-s-(1-a)*parseFloat(n.slice(n.indexOf(` `)+1)),u=i?e.width/i:e.width,d=a?e.height/a:e.height;return{width:u,height:d,top:l,right:c+u,bottom:l+d,left:c}}var lS={ignoreTransform:!1};function uS(e,t){t===void 0&&(t=lS);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=cx(e).getComputedStyle(e);t&&(n=cS(n,t,r))}let{top:r,left:i,width:a,height:o,bottom:s,right:c}=n;return{top:r,left:i,width:a,height:o,bottom:s,right:c}}function dS(e){return uS(e,{ignoreTransform:!0})}function fS(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function pS(e,t){return t===void 0&&(t=cx(e).getComputedStyle(e)),t.position===`fixed`}function mS(e,t){t===void 0&&(t=cx(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return[`overflow`,`overflowX`,`overflowY`].some(e=>{let r=t[e];return typeof r==`string`?n.test(r):!1})}function hS(e,t){let n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(lx(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!ux(i)||dx(i)||n.includes(i))return n;let a=cx(e).getComputedStyle(i);return i!==e&&mS(i,a)&&n.push(i),pS(i,a)?n:r(i.parentNode)}return e?r(e):n}function gS(e){let[t]=hS(e,1);return t??null}function _S(e){return!ax||!e?null:ox(e)?e:sx(e)?lx(e)||e===fx(e).scrollingElement?window:ux(e)?e:null:null}function vS(e){return ox(e)?e.scrollX:e.scrollLeft}function yS(e){return ox(e)?e.scrollY:e.scrollTop}function bS(e){return{x:vS(e),y:yS(e)}}var xS;(function(e){e[e.Forward=1]=`Forward`,e[e.Backward=-1]=`Backward`})(xS||={});function SS(e){return!ax||!e?!1:e===document.scrollingElement}function CS(e){let t={x:0,y:0},n=SS(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height};return{isTop:e.scrollTop<=t.y,isLeft:e.scrollLeft<=t.x,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}var wS={x:.2,y:.2};function TS(e,t,n,r,i){let{top:a,left:o,right:s,bottom:c}=n;r===void 0&&(r=10),i===void 0&&(i=wS);let{isTop:l,isBottom:u,isLeft:d,isRight:f}=CS(e),p={x:0,y:0},m={x:0,y:0},h={height:t.height*i.y,width:t.width*i.x};return!l&&a<=t.top+h.height?(p.y=xS.Backward,m.y=r*Math.abs((t.top+h.height-a)/h.height)):!u&&c>=t.bottom-h.height&&(p.y=xS.Forward,m.y=r*Math.abs((t.bottom-h.height-c)/h.height)),!f&&s>=t.right-h.width?(p.x=xS.Forward,m.x=r*Math.abs((t.right-h.width-s)/h.width)):!d&&o<=t.left+h.width&&(p.x=xS.Backward,m.x=r*Math.abs((t.left+h.width-o)/h.width)),{direction:p,speed:m}}function ES(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function DS(e){return e.reduce((e,t)=>Cx(e,bS(t)),Kx)}function OS(e){return e.reduce((e,t)=>e+vS(t),0)}function kS(e){return e.reduce((e,t)=>e+yS(t),0)}function AS(e,t){if(t===void 0&&(t=uS),!e)return;let{top:n,left:r,bottom:i,right:a}=t(e);gS(e)&&(i<=0||a<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:`center`,inline:`center`})}var jS=[[`x`,[`left`,`right`],OS],[`y`,[`top`,`bottom`],kS]],MS=class{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let n=hS(t),r=DS(n);this.rect={...e},this.width=e.width,this.height=e.height;for(let[e,t,i]of jS)for(let a of t)Object.defineProperty(this,a,{get:()=>{let t=i(n),o=r[e]-t;return this.rect[a]+o},enumerable:!0});Object.defineProperty(this,`rect`,{enumerable:!1})}},NS=class{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>this.target?.removeEventListener(...e))},this.target=e}add(e,t,n){var r;(r=this.target)==null||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}};function PS(e){let{EventTarget:t}=cx(e);return e instanceof t?e:fx(e)}function FS(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return typeof t==`number`?Math.sqrt(n**2+r**2)>t:`x`in t&&`y`in t?n>t.x&&r>t.y:`x`in t?n>t.x:`y`in t?r>t.y:!1}var IS;(function(e){e.Click=`click`,e.DragStart=`dragstart`,e.Keydown=`keydown`,e.ContextMenu=`contextmenu`,e.Resize=`resize`,e.SelectionChange=`selectionchange`,e.VisibilityChange=`visibilitychange`})(IS||={});function LS(e){e.preventDefault()}function RS(e){e.stopPropagation()}var zS;(function(e){e.Space=`Space`,e.Down=`ArrowDown`,e.Right=`ArrowRight`,e.Left=`ArrowLeft`,e.Up=`ArrowUp`,e.Esc=`Escape`,e.Enter=`Enter`,e.Tab=`Tab`})(zS||={});var BS={start:[zS.Space,zS.Enter],cancel:[zS.Esc],end:[zS.Space,zS.Enter,zS.Tab]},VS=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case zS.Right:return{...n,x:n.x+25};case zS.Left:return{...n,x:n.x-25};case zS.Down:return{...n,y:n.y+25};case zS.Up:return{...n,y:n.y-25}}},HS=class{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;let{event:{target:t}}=e;this.props=e,this.listeners=new NS(fx(t)),this.windowListeners=new NS(cx(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(IS.Resize,this.handleCancel),this.windowListeners.add(IS.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(IS.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&AS(n),t(Kx)}handleKeyDown(e){if(Ex(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:i=BS,coordinateGetter:a=VS,scrollBehavior:o=`smooth`}=r,{code:s}=e;if(i.end.includes(s)){this.handleEnd(e);return}if(i.cancel.includes(s)){this.handleCancel(e);return}let{collisionRect:c}=n.current,l=c?{x:c.left,y:c.top}:Kx;this.referenceCoordinates||=l;let u=a(e,{active:t,context:n.current,currentCoordinates:l});if(u){let t=wx(u,l),r={x:0,y:0},{scrollableAncestors:i}=n.current;for(let n of i){let i=e.code,{isTop:a,isRight:s,isLeft:c,isBottom:l,maxScroll:d,minScroll:f}=CS(n),p=ES(n),m={x:Math.min(i===zS.Right?p.right-p.width/2:p.right,Math.max(i===zS.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(i===zS.Down?p.bottom-p.height/2:p.bottom,Math.max(i===zS.Down?p.top:p.top+p.height/2,u.y))},h=i===zS.Right&&!s||i===zS.Left&&!c,g=i===zS.Down&&!l||i===zS.Up&&!a;if(h&&m.x!==u.x){let e=n.scrollLeft+t.x,a=i===zS.Right&&e<=d.x||i===zS.Left&&e>=f.x;if(a&&!t.y){n.scrollTo({left:e,behavior:o});return}a?r.x=n.scrollLeft-e:r.x=i===zS.Right?n.scrollLeft-d.x:n.scrollLeft-f.x,r.x&&n.scrollBy({left:-r.x,behavior:o});break}else if(g&&m.y!==u.y){let e=n.scrollTop+t.y,a=i===zS.Down&&e<=d.y||i===zS.Up&&e>=f.y;if(a&&!t.x){n.scrollTo({top:e,behavior:o});return}a?r.y=n.scrollTop-e:r.y=i===zS.Down?n.scrollTop-d.y:n.scrollTop-f.y,r.y&&n.scrollBy({top:-r.y,behavior:o});break}}this.handleMove(e,Cx(wx(u,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};HS.activators=[{eventName:`onKeyDown`,handler:(e,t,n)=>{let{keyboardCodes:r=BS,onActivation:i}=t,{active:a}=n,{code:o}=e.nativeEvent;if(r.start.includes(o)){let t=a.activatorNode.current;return t&&e.target!==t?!1:(e.preventDefault(),i?.({event:e.nativeEvent}),!0)}return!1}}];function US(e){return!!(e&&`distance`in e)}function WS(e){return!!(e&&`delay`in e)}var GS=class{constructor(e,t,n){n===void 0&&(n=PS(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;let{event:r}=e,{target:i}=r;this.props=e,this.events=t,this.document=fx(i),this.documentListeners=new NS(this.document),this.listeners=new NS(n),this.windowListeners=new NS(cx(i)),this.initialCoordinates=Ox(r)??Kx,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(IS.Resize,this.handleCancel),this.windowListeners.add(IS.DragStart,LS),this.windowListeners.add(IS.VisibilityChange,this.handleCancel),this.windowListeners.add(IS.ContextMenu,LS),this.documentListeners.add(IS.Keydown,this.handleKeydown),t){if(n!=null&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(WS(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(US(t)){this.handlePending(t);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(IS.Click,RS,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(IS.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){let{activated:t,initialCoordinates:n,props:r}=this,{onMove:i,options:{activationConstraint:a}}=r;if(!n)return;let o=Ox(e)??Kx,s=wx(n,o);if(!t&&a){if(US(a)){if(a.tolerance!=null&&FS(s,a.tolerance))return this.handleCancel();if(FS(s,a.distance))return this.handleStart()}if(WS(a)&&FS(s,a.tolerance))return this.handleCancel();this.handlePending(a,s);return}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===zS.Esc&&this.handleCancel()}removeTextSelection(){var e;(e=this.document.getSelection())==null||e.removeAllRanges()}},KS={cancel:{name:`pointercancel`},move:{name:`pointermove`},end:{name:`pointerup`}},qS=class extends GS{constructor(e){let{event:t}=e,n=fx(t.target);super(e,KS,n)}};qS.activators=[{eventName:`onPointerDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r?.({event:n}),!0)}}];var JS={move:{name:`mousemove`},end:{name:`mouseup`}},YS;(function(e){e[e.RightClick=2]=`RightClick`})(YS||={});var XS=class extends GS{constructor(e){super(e,JS,fx(e.event.target))}};XS.activators=[{eventName:`onMouseDown`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===YS.RightClick?!1:(r?.({event:n}),!0)}}];var ZS={cancel:{name:`touchcancel`},move:{name:`touchmove`},end:{name:`touchend`}},QS=class extends GS{constructor(e){super(e,ZS)}static setup(){return window.addEventListener(ZS.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(ZS.move.name,e)};function e(){}}};QS.activators=[{eventName:`onTouchStart`,handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:i}=n;return i.length>1?!1:(r?.({event:n}),!0)}}];var $S;(function(e){e[e.Pointer=0]=`Pointer`,e[e.DraggableRect=1]=`DraggableRect`})($S||={});var eC;(function(e){e[e.TreeOrder=0]=`TreeOrder`,e[e.ReversedTreeOrder=1]=`ReversedTreeOrder`})(eC||={});function tC(e){let{acceleration:t,activator:n=$S.Pointer,canScroll:r,draggingRect:i,enabled:a,interval:o=5,order:s=eC.TreeOrder,pointerCoordinates:c,scrollableAncestors:l,scrollableAncestorRects:u,delta:d,threshold:f}=e,p=rC({delta:d,disabled:!a}),[m,h]=hx(),g=(0,Q.useRef)({x:0,y:0}),_=(0,Q.useRef)({x:0,y:0}),v=(0,Q.useMemo)(()=>{switch(n){case $S.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case $S.DraggableRect:return i}},[n,i,c]),y=(0,Q.useRef)(null),b=(0,Q.useCallback)(()=>{let e=y.current;if(!e)return;let t=g.current.x*_.current.x,n=g.current.y*_.current.y;e.scrollBy(t,n)},[]),x=(0,Q.useMemo)(()=>s===eC.TreeOrder?[...l].reverse():l,[s,l]);(0,Q.useEffect)(()=>{if(!a||!l.length||!v){h();return}for(let e of x){if(r?.(e)===!1)continue;let n=u[l.indexOf(e)];if(!n)continue;let{direction:i,speed:a}=TS(e,n,v,t,f);for(let e of[`x`,`y`])p[e][i[e]]||(a[e]=0,i[e]=0);if(a.x>0||a.y>0){h(),y.current=e,m(b,o),g.current=a,_.current=i;return}}g.current={x:0,y:0},_.current={x:0,y:0},h()},[t,b,r,h,a,o,JSON.stringify(v),JSON.stringify(p),m,l,x,u,JSON.stringify(f)])}var nC={x:{[xS.Backward]:!1,[xS.Forward]:!1},y:{[xS.Backward]:!1,[xS.Forward]:!1}};function rC(e){let{delta:t,disabled:n}=e,r=yx(t);return _x(e=>{if(n||!r||!e)return nC;let i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[xS.Backward]:e.x[xS.Backward]||i.x===-1,[xS.Forward]:e.x[xS.Forward]||i.x===1},y:{[xS.Backward]:e.y[xS.Backward]||i.y===-1,[xS.Forward]:e.y[xS.Forward]||i.y===1}}},[n,t,r])}function iC(e,t){let n=t==null?void 0:e.get(t),r=n?n.node.current:null;return _x(e=>t==null?null:r??e??null,[r,t])}function aC(e,t){return(0,Q.useMemo)(()=>e.reduce((e,n)=>{let{sensor:r}=n,i=r.activators.map(e=>({eventName:e.eventName,handler:t(e.handler,n)}));return[...e,...i]},[]),[e,t])}var oC;(function(e){e[e.Always=0]=`Always`,e[e.BeforeDragging=1]=`BeforeDragging`,e[e.WhileDragging=2]=`WhileDragging`})(oC||={});var sC;(function(e){e.Optimized=`optimized`})(sC||={});var cC=new Map;function lC(e,t){let{dragging:n,dependencies:r,config:i}=t,[a,o]=(0,Q.useState)(null),{frequency:s,measure:c,strategy:l}=i,u=(0,Q.useRef)(e),d=g(),f=gx(d),p=(0,Q.useCallback)(function(e){e===void 0&&(e=[]),!f.current&&o(t=>t===null?e:t.concat(e.filter(e=>!t.includes(e))))},[f]),m=(0,Q.useRef)(null),h=_x(t=>{if(d&&!n)return cC;if(!t||t===cC||u.current!==e||a!=null){let t=new Map;for(let n of e){if(!n)continue;if(a&&a.length>0&&!a.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new MS(c(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,a,n,d,c]);return(0,Q.useEffect)(()=>{u.current=e},[e]),(0,Q.useEffect)(()=>{d||p()},[n,d]),(0,Q.useEffect)(()=>{a&&a.length>0&&o(null)},[JSON.stringify(a)]),(0,Q.useEffect)(()=>{d||typeof s!=`number`||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,d,p,...r]),{droppableRects:h,measureDroppableContainers:p,measuringScheduled:a!=null};function g(){switch(l){case oC.Always:return!1;case oC.BeforeDragging:return n;default:return!n}}}function uC(e,t){return _x(n=>e?n||(typeof t==`function`?t(e):e):null,[t,e])}function dC(e,t){return uC(e,t)}function fC(e){let{callback:t,disabled:n}=e,r=mx(t),i=(0,Q.useMemo)(()=>{if(n||typeof window>`u`||window.MutationObserver===void 0)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,Q.useEffect)(()=>()=>i?.disconnect(),[i]),i}function pC(e){let{callback:t,disabled:n}=e,r=mx(t),i=(0,Q.useMemo)(()=>{if(n||typeof window>`u`||window.ResizeObserver===void 0)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,Q.useEffect)(()=>()=>i?.disconnect(),[i]),i}function mC(e){return new MS(uS(e),e)}function hC(e,t,n){t===void 0&&(t=mC);let[r,i]=(0,Q.useState)(null);function a(){i(r=>{if(!e)return null;if(e.isConnected===!1)return r??n??null;let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let o=fC({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if(t===`childList`&&r instanceof HTMLElement&&r.contains(e)){a();break}}}}),s=pC({callback:a});return px(()=>{a(),e?(s?.observe(e),o?.observe(document.body,{childList:!0,subtree:!0})):(s?.disconnect(),o?.disconnect())},[e]),r}function gC(e){return iS(e,uC(e))}var _C=[];function vC(e){let t=(0,Q.useRef)(e),n=_x(n=>e?n&&n!==_C&&e&&t.current&&e.parentNode===t.current.parentNode?n:hS(e):_C,[e]);return(0,Q.useEffect)(()=>{t.current=e},[e]),n}function yC(e){let[t,n]=(0,Q.useState)(null),r=(0,Q.useRef)(e),i=(0,Q.useCallback)(e=>{let t=_S(e.target);t&&n(e=>e?(e.set(t,bS(t)),new Map(e)):null)},[]);return(0,Q.useEffect)(()=>{let t=r.current;if(e!==t){a(t);let o=e.map(e=>{let t=_S(e);return t?(t.addEventListener(`scroll`,i,{passive:!0}),[t,bS(t)]):null}).filter(e=>e!=null);n(o.length?new Map(o):null),r.current=e}return()=>{a(e),a(t)};function a(e){e.forEach(e=>{_S(e)?.removeEventListener(`scroll`,i)})}},[i,e]),(0,Q.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>Cx(e,t),Kx):DS(e):Kx,[e,t])}function bC(e,t){t===void 0&&(t=[]);let n=(0,Q.useRef)(null);return(0,Q.useEffect)(()=>{n.current=null},t),(0,Q.useEffect)(()=>{let t=e!==Kx;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?wx(e,n.current):Kx}function xC(e){(0,Q.useEffect)(()=>{if(!ax)return;let t=e.map(e=>{let{sensor:t}=e;return t.setup==null?void 0:t.setup()});return()=>{for(let e of t)e?.()}},e.map(e=>{let{sensor:t}=e;return t}))}function SC(e,t){return(0,Q.useMemo)(()=>e.reduce((e,n)=>{let{eventName:r,handler:i}=n;return e[r]=e=>{i(e,t)},e},{}),[e,t])}function CC(e){return(0,Q.useMemo)(()=>e?fS(e):null,[e])}var wC=[];function TC(e,t){t===void 0&&(t=uS);let[n]=e,r=CC(n?cx(n):null),[i,a]=(0,Q.useState)(wC);function o(){a(()=>e.length?e.map(e=>SS(e)?r:new MS(t(e),e)):wC)}let s=pC({callback:o});return px(()=>{s?.disconnect(),o(),e.forEach(e=>s?.observe(e))},[e]),i}function EC(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return ux(t)?t:e}function DC(e){let{measure:t}=e,[n,r]=(0,Q.useState)(null),i=pC({callback:(0,Q.useCallback)(e=>{for(let{target:n}of e)if(ux(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),[a,o]=vx((0,Q.useCallback)(e=>{let n=EC(e);i?.disconnect(),n&&i?.observe(n),r(n?t(n):null)},[t,i]));return(0,Q.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}var OC=[{sensor:qS,options:{}},{sensor:HS,options:{}}],kC={current:{}},AC={draggable:{measure:dS},droppable:{measure:dS,strategy:oC.WhileDragging,frequency:sC.Optimized},dragOverlay:{measure:uS}},jC=class extends Map{get(e){return e==null?void 0:super.get(e)??void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){return this.get(e)?.node.current??void 0}},MC={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new jC,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ux},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:AC,measureDroppableContainers:Ux,windowRect:null,measuringScheduled:!1},NC={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:``},dispatch:Ux,draggableNodes:new Map,over:null,measureDroppableContainers:Ux},PC=(0,Q.createContext)(NC),FC=(0,Q.createContext)(MC);function IC(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new jC}}}function LC(e,t){switch(t.type){case Hx.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case Hx.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case Hx.DragEnd:case Hx.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case Hx.RegisterDroppable:{let{element:n}=t,{id:r}=n,i=new jC(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case Hx.SetDroppableDisabled:{let{id:n,key:r,disabled:i}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;let o=new jC(e.droppable.containers);return o.set(n,{...a,disabled:i}),{...e,droppable:{...e.droppable,containers:o}}}case Hx.UnregisterDroppable:{let{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new jC(e.droppable.containers);return a.delete(n),{...e,droppable:{...e.droppable,containers:a}}}default:return e}}function RC(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:i}=(0,Q.useContext)(PC),a=yx(r),o=yx(n?.id);return(0,Q.useEffect)(()=>{if(!t&&!r&&a&&o!=null){if(!Ex(a)||document.activeElement===a.target)return;let e=i.get(o);if(!e)return;let{activatorNode:t,node:n}=e;if(!t.current&&!n.current)return;requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=jx(e);if(t){t.focus();break}}})}},[r,t,i,o,a]),null}function zC(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}function BC(e){return(0,Q.useMemo)(()=>({draggable:{...AC.draggable,...e?.draggable},droppable:{...AC.droppable,...e?.droppable},dragOverlay:{...AC.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function VC(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e,a=(0,Q.useRef)(!1),{x:o,y:s}=typeof i==`boolean`?{x:i,y:i}:i;px(()=>{if(!o&&!s||!t){a.current=!1;return}if(a.current||!r)return;let e=t?.node.current;if(!e||e.isConnected===!1)return;let i=iS(n(e),r);if(o||(i.x=0),s||(i.y=0),a.current=!0,Math.abs(i.x)>0||Math.abs(i.y)>0){let t=gS(e);t&&t.scrollBy({top:i.y,left:i.x})}},[t,o,s,r,n])}var HC=(0,Q.createContext)({...Kx,scaleX:1,scaleY:1}),UC;(function(e){e[e.Uninitialized=0]=`Uninitialized`,e[e.Initializing=1]=`Initializing`,e[e.Initialized=2]=`Initialized`})(UC||={});var WC=(0,Q.memo)(function(e){let{id:t,accessibility:n,autoScroll:r=!0,children:i,sensors:a=OC,collisionDetection:o=nS,measuring:s,modifiers:c,...l}=e,[u,d]=(0,Q.useReducer)(LC,void 0,IC),[f,p]=Rx(),[m,h]=(0,Q.useState)(UC.Uninitialized),g=m===UC.Initialized,{draggable:{active:_,nodes:v,translate:y},droppable:{containers:b}}=u,x=_==null?null:v.get(_),S=(0,Q.useRef)({initial:null,translated:null}),C=(0,Q.useMemo)(()=>_==null?null:{id:_,data:x?.data??kC,rect:S},[_,x]),w=(0,Q.useRef)(null),[T,E]=(0,Q.useState)(null),[D,O]=(0,Q.useState)(null),k=gx(l,Object.values(l)),A=xx(`DndDescribedBy`,t),j=(0,Q.useMemo)(()=>b.getEnabled(),[b]),M=BC(s),{droppableRects:N,measureDroppableContainers:P,measuringScheduled:F}=lC(j,{dragging:g,dependencies:[y.x,y.y],config:M.droppable}),I=iC(v,_),L=(0,Q.useMemo)(()=>D?Ox(D):null,[D]),R=xe(),z=dC(I,M.draggable.measure);VC({activeNode:_==null?null:v.get(_),config:R.layoutShiftCompensation,initialRect:z,measure:M.draggable.measure});let B=hC(I,M.draggable.measure,z),V=hC(I?I.parentElement:null),H=(0,Q.useRef)({activatorEvent:null,active:null,activeNode:I,collisionRect:null,collisions:null,droppableRects:N,draggableNodes:v,draggingNode:null,draggingNodeRect:null,droppableContainers:b,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),U=b.getNodeFor(H.current.over?.id),W=DC({measure:M.dragOverlay.measure}),G=W.nodeRef.current??I,ee=g?W.rect??B:null,te=!!(W.nodeRef.current&&W.rect),ne=gC(te?null:B),re=CC(G?cx(G):null),ie=vC(g?U??I:null),ae=TC(ie),oe=zC(c,{transform:{x:y.x-ne.x,y:y.y-ne.y,scaleX:1,scaleY:1},activatorEvent:D,active:C,activeNodeRect:B,containerNodeRect:V,draggingNodeRect:ee,over:H.current.over,overlayNodeRect:W.rect,scrollableAncestors:ie,scrollableAncestorRects:ae,windowRect:re}),se=L?Cx(L,y):null,ce=yC(ie),le=bC(ce),ue=bC(ce,[B]),K=Cx(oe,le),q=ee?oS(ee,oe):null,de=C&&q?o({active:C,collisionRect:q,droppableRects:N,droppableContainers:j,pointerCoordinates:se}):null,fe=Zx(de,`id`),[pe,me]=(0,Q.useState)(null),he=rS(te?oe:Cx(oe,ue),pe?.rect??null,B),ge=(0,Q.useRef)(null),_e=(0,Q.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(w.current==null)return;let i=v.get(w.current);if(!i)return;let a=e.nativeEvent;ge.current=new n({active:w.current,activeNode:i,event:a,options:r,context:H,onAbort(e){if(!v.get(e))return;let{onDragAbort:t}=k.current,n={id:e};t?.(n),f({type:`onDragAbort`,event:n})},onPending(e,t,n,r){if(!v.get(e))return;let{onDragPending:i}=k.current,a={id:e,constraint:t,initialCoordinates:n,offset:r};i?.(a),f({type:`onDragPending`,event:a})},onStart(e){let t=w.current;if(t==null)return;let n=v.get(t);if(!n)return;let{onDragStart:r}=k.current,i={activatorEvent:a,active:{id:t,data:n.data,rect:S}};(0,_a.unstable_batchedUpdates)(()=>{r?.(i),h(UC.Initializing),d({type:Hx.DragStart,initialCoordinates:e,active:t}),f({type:`onDragStart`,event:i}),E(ge.current),O(a)})},onMove(e){d({type:Hx.DragMove,coordinates:e})},onEnd:o(Hx.DragEnd),onCancel:o(Hx.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:i}=H.current,o=null;if(t&&i){let{cancelDrop:s}=k.current;o={activatorEvent:a,active:t,collisions:n,delta:i,over:r},e===Hx.DragEnd&&typeof s==`function`&&await Promise.resolve(s(o))&&(e=Hx.DragCancel)}w.current=null,(0,_a.unstable_batchedUpdates)(()=>{d({type:e}),h(UC.Uninitialized),me(null),E(null),O(null),ge.current=null;let t=e===Hx.DragEnd?`onDragEnd`:`onDragCancel`;if(o){let e=k.current[t];e?.(o),f({type:t,event:o})}})}}},[v]),ve=aC(a,(0,Q.useCallback)((e,t)=>(n,r)=>{let i=n.nativeEvent,a=v.get(r);if(w.current!==null||!a||i.dndKit||i.defaultPrevented)return;let o={active:a};e(n,t.options,o)===!0&&(i.dndKit={capturedBy:t.sensor},w.current=r,_e(n,t))},[v,_e]));xC(a),px(()=>{B&&m===UC.Initializing&&h(UC.Initialized)},[B,m]),(0,Q.useEffect)(()=>{let{onDragMove:e}=k.current,{active:t,activatorEvent:n,collisions:r,over:i}=H.current;if(!t||!n)return;let a={active:t,activatorEvent:n,collisions:r,delta:{x:K.x,y:K.y},over:i};(0,_a.unstable_batchedUpdates)(()=>{e?.(a),f({type:`onDragMove`,event:a})})},[K.x,K.y]),(0,Q.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:i}=H.current;if(!e||w.current==null||!t||!i)return;let{onDragOver:a}=k.current,o=r.get(fe),s=o&&o.rect.current?{id:o.id,rect:o.rect.current,data:o.data,disabled:o.disabled}:null,c={active:e,activatorEvent:t,collisions:n,delta:{x:i.x,y:i.y},over:s};(0,_a.unstable_batchedUpdates)(()=>{me(s),a?.(c),f({type:`onDragOver`,event:c})})},[fe]),px(()=>{H.current={activatorEvent:D,active:C,activeNode:I,collisionRect:q,collisions:de,droppableRects:N,draggableNodes:v,draggingNode:G,draggingNodeRect:ee,droppableContainers:b,over:pe,scrollableAncestors:ie,scrollAdjustedTranslate:K},S.current={initial:ee,translated:q}},[C,I,de,q,v,G,ee,N,b,pe,ie,K]),tC({...R,delta:y,draggingRect:q,pointerCoordinates:se,scrollableAncestors:ie,scrollableAncestorRects:ae});let ye=(0,Q.useMemo)(()=>({active:C,activeNode:I,activeNodeRect:B,activatorEvent:D,collisions:de,containerNodeRect:V,dragOverlay:W,draggableNodes:v,droppableContainers:b,droppableRects:N,over:pe,measureDroppableContainers:P,scrollableAncestors:ie,scrollableAncestorRects:ae,measuringConfiguration:M,measuringScheduled:F,windowRect:re}),[C,I,B,D,de,V,W,v,b,N,pe,P,ie,ae,M,F,re]),be=(0,Q.useMemo)(()=>({activatorEvent:D,activators:ve,active:C,activeNodeRect:B,ariaDescribedById:{draggable:A},dispatch:d,draggableNodes:v,over:pe,measureDroppableContainers:P}),[D,ve,C,B,d,A,v,pe,P]);return Q.createElement(Ix.Provider,{value:p},Q.createElement(PC.Provider,{value:be},Q.createElement(FC.Provider,{value:ye},Q.createElement(HC.Provider,{value:he},i)),Q.createElement(RC,{disabled:n?.restoreFocus===!1})),Q.createElement(Vx,{...n,hiddenTextDescribedById:A}));function xe(){let e=T?.autoScrollEnabled===!1,t=typeof r==`object`?r.enabled===!1:r===!1,n=g&&!e&&!t;return typeof r==`object`?{...r,enabled:n}:{enabled:n}}}),GC=(0,Q.createContext)(null),KC=`button`,qC=`Draggable`;function JC(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e,a=xx(qC),{activators:o,activatorEvent:s,active:c,activeNodeRect:l,ariaDescribedById:u,draggableNodes:d,over:f}=(0,Q.useContext)(PC),{role:p=KC,roleDescription:m=`draggable`,tabIndex:h=0}=i??{},g=c?.id===t,_=(0,Q.useContext)(g?HC:GC),[v,y]=vx(),[b,x]=vx(),S=SC(o,t),C=gx(n);return px(()=>(d.set(t,{id:t,key:a,node:v,activatorNode:b,data:C}),()=>{let e=d.get(t);e&&e.key===a&&d.delete(t)}),[d,t]),{active:c,activatorEvent:s,activeNodeRect:l,attributes:(0,Q.useMemo)(()=>({role:p,tabIndex:h,"aria-disabled":r,"aria-pressed":g&&p===KC?!0:void 0,"aria-roledescription":m,"aria-describedby":u.draggable}),[r,p,h,g,m,u.draggable]),isDragging:g,listeners:r?void 0:S,node:v,over:f,setNodeRef:y,setActivatorNodeRef:x,transform:_}}function YC(){return(0,Q.useContext)(FC)}var XC=`Droppable`,ZC={timeout:25};function QC(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e,a=xx(XC),{active:o,dispatch:s,over:c,measureDroppableContainers:l}=(0,Q.useContext)(PC),u=(0,Q.useRef)({disabled:n}),d=(0,Q.useRef)(!1),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),{disabled:m,updateMeasurementsFor:h,timeout:g}={...ZC,...i},_=gx(h??r),v=pC({callback:(0,Q.useCallback)(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{l(Array.isArray(_.current)?_.current:[_.current]),p.current=null},g)},[g]),disabled:m||!o}),[y,b]=vx((0,Q.useCallback)((e,t)=>{v&&(t&&(v.unobserve(t),d.current=!1),e&&v.observe(e))},[v])),x=gx(t);return(0,Q.useEffect)(()=>{!v||!y.current||(v.disconnect(),d.current=!1,v.observe(y.current))},[y,v]),(0,Q.useEffect)(()=>(s({type:Hx.RegisterDroppable,element:{id:r,key:a,disabled:n,node:y,rect:f,data:x}}),()=>s({type:Hx.UnregisterDroppable,key:a,id:r})),[r]),(0,Q.useEffect)(()=>{n!==u.current.disabled&&(s({type:Hx.SetDroppableDisabled,id:r,key:a,disabled:n}),u.current.disabled=n)},[r,a,n,s]),{active:o,rect:f,isOver:c?.id===r,node:y,over:c,setNodeRef:b}}function $C(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function ew(e,t){return e.reduce((e,n,r)=>{let i=t.get(n);return i&&(e[r]=i),e},Array(e.length))}function tw(e){return e!==null&&e>=0}function nw(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function rw(e){return typeof e==`boolean`?{draggable:e,droppable:e}:e}var iw=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e,a=$C(t,r,n),o=t[i],s=a[i];return!s||!o?null:{x:s.left-o.left,y:s.top-o.top,scaleX:s.width/o.width,scaleY:s.height/o.height}},aw={scaleX:1,scaleY:1},ow=e=>{let{activeIndex:t,activeNodeRect:n,index:r,rects:i,overIndex:a}=e,o=i[t]??n;if(!o)return null;if(r===t){let e=i[a];return e?{x:0,y:t<a?e.top+e.height-(o.top+o.height):e.top-o.top,...aw}:null}let s=sw(i,r,t);return r>t&&r<=a?{x:0,y:-o.height-s,...aw}:r<t&&r>=a?{x:0,y:o.height+s,...aw}:{x:0,y:0,...aw}};function sw(e,t,n){let r=e[t],i=e[t-1],a=e[t+1];return r?n<t?i?r.top-(i.top+i.height):a?a.top-(r.top+r.height):0:a?a.top-(r.top+r.height):i?r.top-(i.top+i.height):0:0}var cw=`Sortable`,lw=Q.createContext({activeIndex:-1,containerId:cw,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:iw,disabled:{draggable:!1,droppable:!1}});function uw(e){let{children:t,id:n,items:r,strategy:i=iw,disabled:a=!1}=e,{active:o,dragOverlay:s,droppableRects:c,over:l,measureDroppableContainers:u}=YC(),d=xx(cw,n),f=s.rect!==null,p=(0,Q.useMemo)(()=>r.map(e=>typeof e==`object`&&`id`in e?e.id:e),[r]),m=o!=null,h=o?p.indexOf(o.id):-1,g=l?p.indexOf(l.id):-1,_=(0,Q.useRef)(p),v=!nw(p,_.current),y=g!==-1&&h===-1||v,b=rw(a);px(()=>{v&&m&&u(p)},[v,p,m,u]),(0,Q.useEffect)(()=>{_.current=p},[p]);let x=(0,Q.useMemo)(()=>({activeIndex:h,containerId:d,disabled:b,disableTransforms:y,items:p,overIndex:g,useDragOverlay:f,sortedRects:ew(p,c),strategy:i}),[h,d,b.draggable,b.droppable,y,p,g,c,f,i]);return Q.createElement(lw.Provider,{value:x},t)}var dw=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return $C(n,r,i).indexOf(t)},fw=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:a,newIndex:o,previousItems:s,previousContainerId:c,transition:l}=e;return!l||!r||s!==a&&i===o?!1:n?!0:o!==i&&t===c},pw={duration:200,easing:`ease`},mw=`transform`,hw=kx.Transition.toString({property:mw,duration:0,easing:`linear`}),gw={roleDescription:`sortable`};function _w(e){let{disabled:t,index:n,node:r,rect:i}=e,[a,o]=(0,Q.useState)(null),s=(0,Q.useRef)(n);return px(()=>{if(!t&&n!==s.current&&r.current){let e=i.current;if(e){let t=uS(r.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&o(n)}}n!==s.current&&(s.current=n)},[t,n,r,i]),(0,Q.useEffect)(()=>{a&&o(null)},[a]),a}function vw(e){let{animateLayoutChanges:t=fw,attributes:n,disabled:r,data:i,getNewIndex:a=dw,id:o,strategy:s,resizeObserverConfig:c,transition:l=pw}=e,{items:u,containerId:d,activeIndex:f,disabled:p,disableTransforms:m,sortedRects:h,overIndex:g,useDragOverlay:_,strategy:v}=(0,Q.useContext)(lw),y=yw(r,p),b=u.indexOf(o),x=(0,Q.useMemo)(()=>({sortable:{containerId:d,index:b,items:u},...i}),[d,i,b,u]),S=(0,Q.useMemo)(()=>u.slice(u.indexOf(o)),[u,o]),{rect:C,node:w,isOver:T,setNodeRef:E}=QC({id:o,data:x,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...c}}),{active:D,activatorEvent:O,activeNodeRect:k,attributes:A,setNodeRef:j,listeners:M,isDragging:N,over:P,setActivatorNodeRef:F,transform:I}=JC({id:o,data:x,attributes:{...gw,...n},disabled:y.draggable}),L=ix(E,j),R=!!D,z=R&&!m&&tw(f)&&tw(g),B=!_&&N,V=z?(B&&z?I:null)??(s??v)({rects:h,activeNodeRect:k,activeIndex:f,overIndex:g,index:b}):null,H=tw(f)&&tw(g)?a({id:o,items:u,activeIndex:f,overIndex:g}):b,U=D?.id,W=(0,Q.useRef)({activeId:U,items:u,newIndex:H,containerId:d}),G=u!==W.current.items,ee=t({active:D,containerId:d,isDragging:N,isSorting:R,id:o,index:b,items:u,newIndex:W.current.newIndex,previousItems:W.current.items,previousContainerId:W.current.containerId,transition:l,wasDragging:W.current.activeId!=null}),te=_w({disabled:!ee,index:b,node:w,rect:C});return(0,Q.useEffect)(()=>{R&&W.current.newIndex!==H&&(W.current.newIndex=H),d!==W.current.containerId&&(W.current.containerId=d),u!==W.current.items&&(W.current.items=u)},[R,H,d,u]),(0,Q.useEffect)(()=>{if(U===W.current.activeId)return;if(U!=null&&W.current.activeId==null){W.current.activeId=U;return}let e=setTimeout(()=>{W.current.activeId=U},50);return()=>clearTimeout(e)},[U]),{active:D,activeIndex:f,attributes:A,data:x,rect:C,index:b,newIndex:H,items:u,isOver:T,isSorting:R,isDragging:N,listeners:M,node:w,overIndex:g,over:P,setNodeRef:L,setActivatorNodeRef:F,setDroppableNodeRef:E,setDraggableNodeRef:j,transform:te??V,transition:ne()};function ne(){if(te||G&&W.current.newIndex===b)return hw;if(!(B&&!Ex(O)||!l)&&(R||ee))return kx.Transition.toString({...l,property:mw})}}function yw(e,t){return typeof e==`boolean`?{draggable:e,droppable:!1}:{draggable:e?.draggable??t.draggable,droppable:e?.droppable??t.droppable}}function bw(e){if(!e)return!1;let t=e.data.current;return!!(t&&`sortable`in t&&typeof t.sortable==`object`&&`containerId`in t.sortable&&`items`in t.sortable&&`index`in t.sortable)}var xw=[zS.Down,zS.Right,zS.Up,zS.Left],Sw=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:a,over:o,scrollableAncestors:s}}=t;if(xw.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];a.getEnabled().forEach(n=>{if(!n||n!=null&&n.disabled)return;let a=i.get(n.id);if(a)switch(e.code){case zS.Down:r.top<a.top&&t.push(n);break;case zS.Up:r.top>a.top&&t.push(n);break;case zS.Left:r.left>a.left&&t.push(n);break;case zS.Right:r.left<a.left&&t.push(n);break}});let c=eS({active:n,collisionRect:r,droppableRects:i,droppableContainers:t,pointerCoordinates:null}),l=Zx(c,`id`);if(l===o?.id&&c.length>1&&(l=c[1].id),l!=null){let e=a.get(n.id),t=a.get(l),o=t?i.get(t.id):null,c=t?.node.current;if(c&&o&&e&&t){let n=hS(c).some((e,t)=>s[t]!==e),i=Cw(e,t),a=ww(e,t),l=n||!i?{x:0,y:0}:{x:a?r.width-o.width:0,y:a?r.height-o.height:0},u={x:o.left,y:o.top};return l.x&&l.y?u:wx(u,l)}}}};function Cw(e,t){return!bw(e)||!bw(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function ww(e,t){return!bw(e)||!bw(t)||!Cw(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}var Tw=365.2425,Ew=6048e5,Dw=864e5,Ow=6e4,kw=36e5,Aw=1e3,jw=3600*24;jw*7,jw*Tw/12*3;var Mw=Symbol.for(`constructDateFrom`);function Nw(e,t){return typeof e==`function`?e(t):e&&typeof e==`object`&&Mw in e?e[Mw](t):e instanceof Date?new e.constructor(t):new Date(t)}function Pw(e,t){return Nw(t||e,e)}function Fw(e,t,n){let r=Pw(e,n?.in);return isNaN(t)?Nw(n?.in||e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Iw(e,t,n){let r=Pw(e,n?.in);if(isNaN(t))return Nw(n?.in||e,NaN);if(!t)return r;let i=r.getDate(),a=Nw(n?.in||e,r.getTime());return a.setMonth(r.getMonth()+t+1,0),i>=a.getDate()?a:(r.setFullYear(a.getFullYear(),a.getMonth(),i),r)}var Lw={};function Rw(){return Lw}function zw(e,t){let n=Rw(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Pw(e,t?.in),a=i.getDay(),o=(a<r?7:0)+a-r;return i.setDate(i.getDate()-o),i.setHours(0,0,0,0),i}function Bw(e,t){return zw(e,{...t,weekStartsOn:1})}function Vw(e,t){let n=Pw(e,t?.in),r=n.getFullYear(),i=Nw(n,0);i.setFullYear(r+1,0,4),i.setHours(0,0,0,0);let a=Bw(i),o=Nw(n,0);o.setFullYear(r,0,4),o.setHours(0,0,0,0);let s=Bw(o);return n.getTime()>=a.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function Hw(e){let t=Pw(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),e-+n}function Uw(e,...t){let n=Nw.bind(null,e||t.find(e=>typeof e==`object`));return t.map(n)}function Ww(e,t){let n=Pw(e,t?.in);return n.setHours(0,0,0,0),n}function Gw(e,t,n){let[r,i]=Uw(n?.in,e,t),a=Ww(r),o=Ww(i),s=+a-Hw(a),c=+o-Hw(o);return Math.round((s-c)/Dw)}function Kw(e,t){let n=Vw(e,t),r=Nw(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Bw(r)}function qw(e,t,n){return Fw(e,t*7,n)}function Jw(e,t,n){return Iw(e,t*12,n)}function Yw(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=Nw.bind(null,e));let t=Pw(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),Nw(r,n||NaN)}function Xw(e,t){let n,r=t?.in;return e.forEach(e=>{!r&&typeof e==`object`&&(r=Nw.bind(null,e));let t=Pw(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),Nw(r,n||NaN)}function Zw(e,t,n){let[r,i]=Uw(n?.in,e,t);return+Ww(r)==+Ww(i)}function Qw(e){return e instanceof Date||typeof e==`object`&&Object.prototype.toString.call(e)===`[object Date]`}function $w(e){return!(!Qw(e)&&typeof e!=`number`||isNaN(+Pw(e)))}function eT(e,t,n){let[r,i]=Uw(n?.in,e,t),a=r.getFullYear()-i.getFullYear(),o=r.getMonth()-i.getMonth();return a*12+o}function tT(e,t){let n=Pw(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function nT(e,t){let[n,r]=Uw(e,t.start,t.end);return{start:n,end:r}}function rT(e,t){let{start:n,end:r}=nT(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setDate(1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(Nw(n,o)),o.setMonth(o.getMonth()+s);return i?c.reverse():c}function iT(e,t){let n=Pw(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function aT(e,t){let n=Pw(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}function oT(e,t){let n=Pw(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function sT(e,t){let{start:n,end:r}=nT(t?.in,e),i=+n>+r,a=i?+n:+r,o=i?r:n;o.setHours(0,0,0,0),o.setMonth(0,1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,i=!i);let c=[];for(;+o<=a;)c.push(Nw(n,o)),o.setFullYear(o.getFullYear()+s);return i?c.reverse():c}function cT(e,t){let n=Rw(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,i=Pw(e,t?.in),a=i.getDay(),o=(a<r?-7:0)+6-(a-r);return i.setDate(i.getDate()+o),i.setHours(23,59,59,999),i}function lT(e,t){return cT(e,{...t,weekStartsOn:1})}var uT={lessThanXSeconds:{one:`less than a second`,other:`less than {{count}} seconds`},xSeconds:{one:`1 second`,other:`{{count}} seconds`},halfAMinute:`half a minute`,lessThanXMinutes:{one:`less than a minute`,other:`less than {{count}} minutes`},xMinutes:{one:`1 minute`,other:`{{count}} minutes`},aboutXHours:{one:`about 1 hour`,other:`about {{count}} hours`},xHours:{one:`1 hour`,other:`{{count}} hours`},xDays:{one:`1 day`,other:`{{count}} days`},aboutXWeeks:{one:`about 1 week`,other:`about {{count}} weeks`},xWeeks:{one:`1 week`,other:`{{count}} weeks`},aboutXMonths:{one:`about 1 month`,other:`about {{count}} months`},xMonths:{one:`1 month`,other:`{{count}} months`},aboutXYears:{one:`about 1 year`,other:`about {{count}} years`},xYears:{one:`1 year`,other:`{{count}} years`},overXYears:{one:`over 1 year`,other:`over {{count}} years`},almostXYears:{one:`almost 1 year`,other:`almost {{count}} years`}},dT=(e,t,n)=>{let r,i=uT[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r};function fT(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var pT={date:fT({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:fT({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:fT({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},mT={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},hT=(e,t,n,r)=>mT[e];function gT(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}var _T={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:gT({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:gT({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:gT({values:{narrow:[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`],abbreviated:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],wide:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},defaultWidth:`wide`}),day:gT({values:{narrow:[`S`,`M`,`T`,`W`,`T`,`F`,`S`],short:[`Su`,`Mo`,`Tu`,`We`,`Th`,`Fr`,`Sa`],abbreviated:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],wide:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},defaultWidth:`wide`}),dayPeriod:gT({values:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`}},defaultWidth:`wide`,formattingValues:{narrow:{am:`a`,pm:`p`,midnight:`mi`,noon:`n`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},abbreviated:{am:`AM`,pm:`PM`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`},wide:{am:`a.m.`,pm:`p.m.`,midnight:`midnight`,noon:`noon`,morning:`in the morning`,afternoon:`in the afternoon`,evening:`in the evening`,night:`at night`}},defaultFormattingWidth:`wide`})};function vT(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?bT(s,e=>e.test(o)):yT(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function yT(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function bT(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function xT(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var ST={code:`en-US`,formatDistance:dT,formatLong:pT,formatRelative:hT,localize:_T,match:{ordinalNumber:xT({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:vT({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:vT({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:vT({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:`any`}),day:vT({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:`wide`,parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:`any`}),dayPeriod:vT({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:`any`,parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:`any`})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function CT(e,t){let n=Pw(e,t?.in);return Gw(n,oT(n))+1}function wT(e,t){let n=Pw(e,t?.in),r=Bw(n)-+Kw(n);return Math.round(r/Ew)+1}function TT(e,t){let n=Pw(e,t?.in),r=n.getFullYear(),i=Rw(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,o=Nw(t?.in||e,0);o.setFullYear(r+1,0,a),o.setHours(0,0,0,0);let s=zw(o,t),c=Nw(t?.in||e,0);c.setFullYear(r,0,a),c.setHours(0,0,0,0);let l=zw(c,t);return+n>=+s?r+1:+n>=+l?r:r-1}function ET(e,t){let n=Rw(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=TT(e,t),a=Nw(t?.in||e,0);return a.setFullYear(i,0,r),a.setHours(0,0,0,0),zw(a,t)}function DT(e,t){let n=Pw(e,t?.in),r=zw(n,t)-+ET(n,t);return Math.round(r/Ew)+1}function OT(e,t){return(e<0?`-`:``)+Math.abs(e).toString().padStart(t,`0`)}var kT={y(e,t){let n=e.getFullYear(),r=n>0?n:1-n;return OT(t===`yy`?r%100:r,t.length)},M(e,t){let n=e.getMonth();return t===`M`?String(n+1):OT(n+1,2)},d(e,t){return OT(e.getDate(),t.length)},a(e,t){let n=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.toUpperCase();case`aaa`:return n;case`aaaaa`:return n[0];default:return n===`am`?`a.m.`:`p.m.`}},h(e,t){return OT(e.getHours()%12||12,t.length)},H(e,t){return OT(e.getHours(),t.length)},m(e,t){return OT(e.getMinutes(),t.length)},s(e,t){return OT(e.getSeconds(),t.length)},S(e,t){let n=t.length,r=e.getMilliseconds();return OT(Math.trunc(r*10**(n-3)),t.length)}},AT={am:`am`,pm:`pm`,midnight:`midnight`,noon:`noon`,morning:`morning`,afternoon:`afternoon`,evening:`evening`,night:`night`},jT={G:function(e,t,n){let r=+(e.getFullYear()>0);switch(t){case`G`:case`GG`:case`GGG`:return n.era(r,{width:`abbreviated`});case`GGGGG`:return n.era(r,{width:`narrow`});default:return n.era(r,{width:`wide`})}},y:function(e,t,n){if(t===`yo`){let t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:`year`})}return kT.y(e,t)},Y:function(e,t,n,r){let i=TT(e,r),a=i>0?i:1-i;return t===`YY`?OT(a%100,2):t===`Yo`?n.ordinalNumber(a,{unit:`year`}):OT(a,t.length)},R:function(e,t){return OT(Vw(e),t.length)},u:function(e,t){return OT(e.getFullYear(),t.length)},Q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`Q`:return String(r);case`QQ`:return OT(r,2);case`Qo`:return n.ordinalNumber(r,{unit:`quarter`});case`QQQ`:return n.quarter(r,{width:`abbreviated`,context:`formatting`});case`QQQQQ`:return n.quarter(r,{width:`narrow`,context:`formatting`});default:return n.quarter(r,{width:`wide`,context:`formatting`})}},q:function(e,t,n){let r=Math.ceil((e.getMonth()+1)/3);switch(t){case`q`:return String(r);case`qq`:return OT(r,2);case`qo`:return n.ordinalNumber(r,{unit:`quarter`});case`qqq`:return n.quarter(r,{width:`abbreviated`,context:`standalone`});case`qqqqq`:return n.quarter(r,{width:`narrow`,context:`standalone`});default:return n.quarter(r,{width:`wide`,context:`standalone`})}},M:function(e,t,n){let r=e.getMonth();switch(t){case`M`:case`MM`:return kT.M(e,t);case`Mo`:return n.ordinalNumber(r+1,{unit:`month`});case`MMM`:return n.month(r,{width:`abbreviated`,context:`formatting`});case`MMMMM`:return n.month(r,{width:`narrow`,context:`formatting`});default:return n.month(r,{width:`wide`,context:`formatting`})}},L:function(e,t,n){let r=e.getMonth();switch(t){case`L`:return String(r+1);case`LL`:return OT(r+1,2);case`Lo`:return n.ordinalNumber(r+1,{unit:`month`});case`LLL`:return n.month(r,{width:`abbreviated`,context:`standalone`});case`LLLLL`:return n.month(r,{width:`narrow`,context:`standalone`});default:return n.month(r,{width:`wide`,context:`standalone`})}},w:function(e,t,n,r){let i=DT(e,r);return t===`wo`?n.ordinalNumber(i,{unit:`week`}):OT(i,t.length)},I:function(e,t,n){let r=wT(e);return t===`Io`?n.ordinalNumber(r,{unit:`week`}):OT(r,t.length)},d:function(e,t,n){return t===`do`?n.ordinalNumber(e.getDate(),{unit:`date`}):kT.d(e,t)},D:function(e,t,n){let r=CT(e);return t===`Do`?n.ordinalNumber(r,{unit:`dayOfYear`}):OT(r,t.length)},E:function(e,t,n){let r=e.getDay();switch(t){case`E`:case`EE`:case`EEE`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`EEEEE`:return n.day(r,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},e:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`e`:return String(a);case`ee`:return OT(a,2);case`eo`:return n.ordinalNumber(a,{unit:`day`});case`eee`:return n.day(i,{width:`abbreviated`,context:`formatting`});case`eeeee`:return n.day(i,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(i,{width:`short`,context:`formatting`});default:return n.day(i,{width:`wide`,context:`formatting`})}},c:function(e,t,n,r){let i=e.getDay(),a=(i-r.weekStartsOn+8)%7||7;switch(t){case`c`:return String(a);case`cc`:return OT(a,t.length);case`co`:return n.ordinalNumber(a,{unit:`day`});case`ccc`:return n.day(i,{width:`abbreviated`,context:`standalone`});case`ccccc`:return n.day(i,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(i,{width:`short`,context:`standalone`});default:return n.day(i,{width:`wide`,context:`standalone`})}},i:function(e,t,n){let r=e.getDay(),i=r===0?7:r;switch(t){case`i`:return String(i);case`ii`:return OT(i,t.length);case`io`:return n.ordinalNumber(i,{unit:`day`});case`iii`:return n.day(r,{width:`abbreviated`,context:`formatting`});case`iiiii`:return n.day(r,{width:`narrow`,context:`formatting`});case`iiiiii`:return n.day(r,{width:`short`,context:`formatting`});default:return n.day(r,{width:`wide`,context:`formatting`})}},a:function(e,t,n){let r=e.getHours()/12>=1?`pm`:`am`;switch(t){case`a`:case`aa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`});case`aaa`:return n.dayPeriod(r,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`aaaaa`:return n.dayPeriod(r,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(r,{width:`wide`,context:`formatting`})}},b:function(e,t,n){let r=e.getHours(),i;switch(i=r===12?AT.noon:r===0?AT.midnight:r/12>=1?`pm`:`am`,t){case`b`:case`bb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`bbb`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`}).toLowerCase();case`bbbbb`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},B:function(e,t,n){let r=e.getHours(),i;switch(i=r>=17?AT.evening:r>=12?AT.afternoon:r>=4?AT.morning:AT.night,t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(i,{width:`abbreviated`,context:`formatting`});case`BBBBB`:return n.dayPeriod(i,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(i,{width:`wide`,context:`formatting`})}},h:function(e,t,n){if(t===`ho`){let t=e.getHours()%12;return t===0&&(t=12),n.ordinalNumber(t,{unit:`hour`})}return kT.h(e,t)},H:function(e,t,n){return t===`Ho`?n.ordinalNumber(e.getHours(),{unit:`hour`}):kT.H(e,t)},K:function(e,t,n){let r=e.getHours()%12;return t===`Ko`?n.ordinalNumber(r,{unit:`hour`}):OT(r,t.length)},k:function(e,t,n){let r=e.getHours();return r===0&&(r=24),t===`ko`?n.ordinalNumber(r,{unit:`hour`}):OT(r,t.length)},m:function(e,t,n){return t===`mo`?n.ordinalNumber(e.getMinutes(),{unit:`minute`}):kT.m(e,t)},s:function(e,t,n){return t===`so`?n.ordinalNumber(e.getSeconds(),{unit:`second`}):kT.s(e,t)},S:function(e,t){return kT.S(e,t)},X:function(e,t,n){let r=e.getTimezoneOffset();if(r===0)return`Z`;switch(t){case`X`:return NT(r);case`XXXX`:case`XX`:return PT(r);default:return PT(r,`:`)}},x:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`x`:return NT(r);case`xxxx`:case`xx`:return PT(r);default:return PT(r,`:`)}},O:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`O`:case`OO`:case`OOO`:return`GMT`+MT(r,`:`);default:return`GMT`+PT(r,`:`)}},z:function(e,t,n){let r=e.getTimezoneOffset();switch(t){case`z`:case`zz`:case`zzz`:return`GMT`+MT(r,`:`);default:return`GMT`+PT(r,`:`)}},t:function(e,t,n){return OT(Math.trunc(e/1e3),t.length)},T:function(e,t,n){return OT(+e,t.length)}};function MT(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=Math.trunc(r/60),a=r%60;return a===0?n+String(i):n+String(i)+t+OT(a,2)}function NT(e,t){return e%60==0?(e>0?`-`:`+`)+OT(Math.abs(e)/60,2):PT(e,t)}function PT(e,t=``){let n=e>0?`-`:`+`,r=Math.abs(e),i=OT(Math.trunc(r/60),2),a=OT(r%60,2);return n+i+t+a}var FT=(e,t)=>{switch(e){case`P`:return t.date({width:`short`});case`PP`:return t.date({width:`medium`});case`PPP`:return t.date({width:`long`});default:return t.date({width:`full`})}},IT=(e,t)=>{switch(e){case`p`:return t.time({width:`short`});case`pp`:return t.time({width:`medium`});case`ppp`:return t.time({width:`long`});default:return t.time({width:`full`})}},LT={p:IT,P:(e,t)=>{let n=e.match(/(P+)(p+)?/)||[],r=n[1],i=n[2];if(!i)return FT(e,t);let a;switch(r){case`P`:a=t.dateTime({width:`short`});break;case`PP`:a=t.dateTime({width:`medium`});break;case`PPP`:a=t.dateTime({width:`long`});break;default:a=t.dateTime({width:`full`});break}return a.replace(`{{date}}`,FT(r,t)).replace(`{{time}}`,IT(i,t))}},RT=/^D+$/,zT=/^Y+$/,BT=[`D`,`DD`,`YY`,`YYYY`];function VT(e){return RT.test(e)}function HT(e){return zT.test(e)}function UT(e,t,n){let r=WT(e,t,n);if(console.warn(r),BT.includes(e))throw RangeError(r)}function WT(e,t,n){let r=e[0]===`Y`?`years`:`days of the month`;return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var GT=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,KT=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,qT=/^'([^]*?)'?$/,JT=/''/g,YT=/[a-zA-Z]/;function XT(e,t,n){let r=Rw(),i=n?.locale??r.locale??ST,a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,o=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=Pw(e,n?.in);if(!$w(s))throw RangeError(`Invalid time value`);let c=t.match(KT).map(e=>{let t=e[0];if(t===`p`||t===`P`){let n=LT[t];return n(e,i.formatLong)}return e}).join(``).match(GT).map(e=>{if(e===`''`)return{isToken:!1,value:`'`};let t=e[0];if(t===`'`)return{isToken:!1,value:ZT(e)};if(jT[t])return{isToken:!0,value:e};if(t.match(YT))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});i.localize.preprocessor&&(c=i.localize.preprocessor(s,c));let l={firstWeekContainsDate:a,weekStartsOn:o,locale:i};return c.map(r=>{if(!r.isToken)return r.value;let a=r.value;(!n?.useAdditionalWeekYearTokens&&HT(a)||!n?.useAdditionalDayOfYearTokens&&VT(a))&&UT(a,t,String(e));let o=jT[a[0]];return o(s,a,i.localize,l)}).join(``)}function ZT(e){let t=e.match(qT);return t?t[1].replace(JT,`'`):e}function QT(e,t){let n=Pw(e,t?.in),r=n.getFullYear(),i=n.getMonth(),a=Nw(n,0);return a.setFullYear(r,i+1,0),a.setHours(0,0,0,0),a.getDate()}function $T(){return Object.assign({},Rw())}function eE(e,t){let n=Pw(e,t?.in).getDay();return n===0?7:n}function tE(e,t){return Pw(e,t?.in).getMonth()}function nE(e,t){return Pw(e,t?.in).getFullYear()}function rE(e,t){return+Pw(e)>+Pw(t)}function iE(e,t){return+Pw(e)<+Pw(t)}function aE(e,t){let n=oE(t)?new t(0):Nw(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}function oE(e){return typeof e==`function`&&e.prototype?.constructor===e}var sE=10,cE=class{subPriority=0;validate(e,t){return!0}},lE=class extends cE{constructor(e,t,n,r,i){super(),this.value=e,this.validateValue=t,this.setValue=n,this.priority=r,i&&(this.subPriority=i)}validate(e,t){return this.validateValue(e,this.value,t)}set(e,t,n){return this.setValue(e,t,this.value,n)}},uE=class extends cE{priority=sE;subPriority=-1;constructor(e,t){super(),this.context=e||(e=>Nw(t,e))}set(e,t){return t.timestampIsSet?e:Nw(e,aE(e,this.context))}},dE=class{run(e,t,n,r){let i=this.parse(e,t,n,r);return i?{setter:new lE(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,t,n){return!0}},fE=class extends dE{priority=140;parse(e,t,n){switch(t){case`G`:case`GG`:case`GGG`:return n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`});case`GGGGG`:return n.era(e,{width:`narrow`});default:return n.era(e,{width:`wide`})||n.era(e,{width:`abbreviated`})||n.era(e,{width:`narrow`})}}set(e,t,n){return t.era=n,e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`R`,`u`,`t`,`T`]},pE={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},mE={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function hE(e,t){return e&&{value:t(e.value),rest:e.rest}}function gE(e,t){let n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function _E(e,t){let n=t.match(e);if(!n)return null;if(n[0]===`Z`)return{value:0,rest:t.slice(1)};let r=n[1]===`+`?1:-1,i=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,o=n[5]?parseInt(n[5],10):0;return{value:r*(i*kw+a*Ow+o*Aw),rest:t.slice(n[0].length)}}function vE(e){return gE(pE.anyDigitsSigned,e)}function yE(e,t){switch(e){case 1:return gE(pE.singleDigit,t);case 2:return gE(pE.twoDigits,t);case 3:return gE(pE.threeDigits,t);case 4:return gE(pE.fourDigits,t);default:return gE(RegExp(`^\\d{1,`+e+`}`),t)}}function bE(e,t){switch(e){case 1:return gE(pE.singleDigitSigned,t);case 2:return gE(pE.twoDigitsSigned,t);case 3:return gE(pE.threeDigitsSigned,t);case 4:return gE(pE.fourDigitsSigned,t);default:return gE(RegExp(`^-?\\d{1,`+e+`}`),t)}}function xE(e){switch(e){case`morning`:return 4;case`evening`:return 17;case`pm`:case`noon`:case`afternoon`:return 12;default:return 0}}function SE(e,t){let n=t>0,r=n?t:1-t,i;if(r<=50)i=e||100;else{let t=r+50,n=Math.trunc(t/100)*100,a=e>=t%100;i=e+n-(a?100:0)}return n?i:1-i}function CE(e){return e%400==0||e%4==0&&e%100!=0}var wE=class extends dE{priority=130;incompatibleTokens=[`Y`,`R`,`u`,`w`,`I`,`i`,`e`,`c`,`t`,`T`];parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`yy`});switch(t){case`y`:return hE(yE(4,e),r);case`yo`:return hE(n.ordinalNumber(e,{unit:`year`}),r);default:return hE(yE(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n){let r=e.getFullYear();if(n.isTwoDigitYear){let t=SE(n.year,r);return e.setFullYear(t,0,1),e.setHours(0,0,0,0),e}let i=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(i,0,1),e.setHours(0,0,0,0),e}},TE=class extends dE{priority=130;parse(e,t,n){let r=e=>({year:e,isTwoDigitYear:t===`YY`});switch(t){case`Y`:return hE(yE(4,e),r);case`Yo`:return hE(n.ordinalNumber(e,{unit:`year`}),r);default:return hE(yE(t.length,e),r)}}validate(e,t){return t.isTwoDigitYear||t.year>0}set(e,t,n,r){let i=TT(e,r);if(n.isTwoDigitYear){let t=SE(n.year,i);return e.setFullYear(t,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),zw(e,r)}let a=!(`era`in t)||t.era===1?n.year:1-n.year;return e.setFullYear(a,0,r.firstWeekContainsDate),e.setHours(0,0,0,0),zw(e,r)}incompatibleTokens=[`y`,`R`,`u`,`Q`,`q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]},EE=class extends dE{priority=130;parse(e,t){return bE(t===`R`?4:t.length,e)}set(e,t,n){let r=Nw(e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),Bw(r)}incompatibleTokens=[`G`,`y`,`Y`,`u`,`Q`,`q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},DE=class extends dE{priority=130;parse(e,t){return bE(t===`u`?4:t.length,e)}set(e,t,n){return e.setFullYear(n,0,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`G`,`y`,`Y`,`R`,`w`,`I`,`i`,`e`,`c`,`t`,`T`]},OE=class extends dE{priority=120;parse(e,t,n){switch(t){case`Q`:case`QQ`:return yE(t.length,e);case`Qo`:return n.ordinalNumber(e,{unit:`quarter`});case`QQQ`:return n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`});case`QQQQQ`:return n.quarter(e,{width:`narrow`,context:`formatting`});default:return n.quarter(e,{width:`wide`,context:`formatting`})||n.quarter(e,{width:`abbreviated`,context:`formatting`})||n.quarter(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},kE=class extends dE{priority=120;parse(e,t,n){switch(t){case`q`:case`qq`:return yE(t.length,e);case`qo`:return n.ordinalNumber(e,{unit:`quarter`});case`qqq`:return n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`});case`qqqqq`:return n.quarter(e,{width:`narrow`,context:`standalone`});default:return n.quarter(e,{width:`wide`,context:`standalone`})||n.quarter(e,{width:`abbreviated`,context:`standalone`})||n.quarter(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=1&&t<=4}set(e,t,n){return e.setMonth((n-1)*3,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`Q`,`M`,`L`,`w`,`I`,`d`,`D`,`i`,`e`,`c`,`t`,`T`]},AE=class extends dE{incompatibleTokens=[`Y`,`R`,`q`,`Q`,`L`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`];priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`M`:return hE(gE(pE.month,e),r);case`MM`:return hE(yE(2,e),r);case`Mo`:return hE(n.ordinalNumber(e,{unit:`month`}),r);case`MMM`:return n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`});case`MMMMM`:return n.month(e,{width:`narrow`,context:`formatting`});default:return n.month(e,{width:`wide`,context:`formatting`})||n.month(e,{width:`abbreviated`,context:`formatting`})||n.month(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}},jE=class extends dE{priority=110;parse(e,t,n){let r=e=>e-1;switch(t){case`L`:return hE(gE(pE.month,e),r);case`LL`:return hE(yE(2,e),r);case`Lo`:return hE(n.ordinalNumber(e,{unit:`month`}),r);case`LLL`:return n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`});case`LLLLL`:return n.month(e,{width:`narrow`,context:`standalone`});default:return n.month(e,{width:`wide`,context:`standalone`})||n.month(e,{width:`abbreviated`,context:`standalone`})||n.month(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.setMonth(n,1),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]};function ME(e,t,n){let r=Pw(e,n?.in),i=DT(r,n)-t;return r.setDate(r.getDate()-i*7),Pw(r,n?.in)}var NE=class extends dE{priority=100;parse(e,t,n){switch(t){case`w`:return gE(pE.week,e);case`wo`:return n.ordinalNumber(e,{unit:`week`});default:return yE(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n,r){return zw(ME(e,n,r),r)}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`i`,`t`,`T`]};function PE(e,t,n){let r=Pw(e,n?.in),i=wT(r,n)-t;return r.setDate(r.getDate()-i*7),r}var FE=class extends dE{priority=100;parse(e,t,n){switch(t){case`I`:return gE(pE.week,e);case`Io`:return n.ordinalNumber(e,{unit:`week`});default:return yE(t.length,e)}}validate(e,t){return t>=1&&t<=53}set(e,t,n){return Bw(PE(e,n))}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`e`,`c`,`t`,`T`]},IE=[31,28,31,30,31,30,31,31,30,31,30,31],LE=[31,29,31,30,31,30,31,31,30,31,30,31],RE=class extends dE{priority=90;subPriority=1;parse(e,t,n){switch(t){case`d`:return gE(pE.date,e);case`do`:return n.ordinalNumber(e,{unit:`date`});default:return yE(t.length,e)}}validate(e,t){let n=CE(e.getFullYear()),r=e.getMonth();return n?t>=1&&t<=LE[r]:t>=1&&t<=IE[r]}set(e,t,n){return e.setDate(n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`w`,`I`,`D`,`i`,`e`,`c`,`t`,`T`]},zE=class extends dE{priority=90;subpriority=1;parse(e,t,n){switch(t){case`D`:case`DD`:return gE(pE.dayOfYear,e);case`Do`:return n.ordinalNumber(e,{unit:`date`});default:return yE(t.length,e)}}validate(e,t){return CE(e.getFullYear())?t>=1&&t<=366:t>=1&&t<=365}set(e,t,n){return e.setMonth(0,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`Y`,`R`,`q`,`Q`,`M`,`L`,`w`,`I`,`d`,`E`,`i`,`e`,`c`,`t`,`T`]};function BE(e,t,n){let r=Rw(),i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,a=Pw(e,n?.in),o=a.getDay(),s=(t%7+7)%7,c=7-i;return Fw(a,t<0||t>6?t-(o+c)%7:(s+c)%7-(o+c)%7,n)}var VE=class extends dE{priority=90;parse(e,t,n){switch(t){case`E`:case`EE`:case`EEE`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`EEEEE`:return n.day(e,{width:`narrow`,context:`formatting`});case`EEEEEE`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=BE(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`D`,`i`,`e`,`c`,`t`,`T`]},HE=class extends dE{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`e`:case`ee`:return hE(yE(t.length,e),i);case`eo`:return hE(n.ordinalNumber(e,{unit:`day`}),i);case`eee`:return n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});case`eeeee`:return n.day(e,{width:`narrow`,context:`formatting`});case`eeeeee`:return n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`});default:return n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=BE(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`c`,`t`,`T`]},UE=class extends dE{priority=90;parse(e,t,n,r){let i=e=>{let t=Math.floor((e-1)/7)*7;return(e+r.weekStartsOn+6)%7+t};switch(t){case`c`:case`cc`:return hE(yE(t.length,e),i);case`co`:return hE(n.ordinalNumber(e,{unit:`day`}),i);case`ccc`:return n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});case`ccccc`:return n.day(e,{width:`narrow`,context:`standalone`});case`cccccc`:return n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`});default:return n.day(e,{width:`wide`,context:`standalone`})||n.day(e,{width:`abbreviated`,context:`standalone`})||n.day(e,{width:`short`,context:`standalone`})||n.day(e,{width:`narrow`,context:`standalone`})}}validate(e,t){return t>=0&&t<=6}set(e,t,n,r){return e=BE(e,n,r),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`R`,`u`,`q`,`Q`,`M`,`L`,`I`,`d`,`D`,`E`,`i`,`e`,`t`,`T`]};function WE(e,t,n){let r=Pw(e,n?.in);return Fw(r,t-eE(r,n),n)}var GE=class extends dE{priority=90;parse(e,t,n){let r=e=>e===0?7:e;switch(t){case`i`:case`ii`:return yE(t.length,e);case`io`:return n.ordinalNumber(e,{unit:`day`});case`iii`:return hE(n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiii`:return hE(n.day(e,{width:`narrow`,context:`formatting`}),r);case`iiiiii`:return hE(n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r);default:return hE(n.day(e,{width:`wide`,context:`formatting`})||n.day(e,{width:`abbreviated`,context:`formatting`})||n.day(e,{width:`short`,context:`formatting`})||n.day(e,{width:`narrow`,context:`formatting`}),r)}}validate(e,t){return t>=1&&t<=7}set(e,t,n){return e=WE(e,n),e.setHours(0,0,0,0),e}incompatibleTokens=[`y`,`Y`,`u`,`q`,`Q`,`M`,`L`,`w`,`d`,`D`,`E`,`e`,`c`,`t`,`T`]},KE=class extends dE{priority=80;parse(e,t,n){switch(t){case`a`:case`aa`:case`aaa`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`aaaaa`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(xE(n),0,0,0),e}incompatibleTokens=[`b`,`B`,`H`,`k`,`t`,`T`]},qE=class extends dE{priority=80;parse(e,t,n){switch(t){case`b`:case`bb`:case`bbb`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`bbbbb`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(xE(n),0,0,0),e}incompatibleTokens=[`a`,`B`,`H`,`k`,`t`,`T`]},JE=class extends dE{priority=80;parse(e,t,n){switch(t){case`B`:case`BB`:case`BBB`:return n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`});case`BBBBB`:return n.dayPeriod(e,{width:`narrow`,context:`formatting`});default:return n.dayPeriod(e,{width:`wide`,context:`formatting`})||n.dayPeriod(e,{width:`abbreviated`,context:`formatting`})||n.dayPeriod(e,{width:`narrow`,context:`formatting`})}}set(e,t,n){return e.setHours(xE(n),0,0,0),e}incompatibleTokens=[`a`,`b`,`t`,`T`]},YE=class extends dE{priority=70;parse(e,t,n){switch(t){case`h`:return gE(pE.hour12h,e);case`ho`:return n.ordinalNumber(e,{unit:`hour`});default:return yE(t.length,e)}}validate(e,t){return t>=1&&t<=12}set(e,t,n){let r=e.getHours()>=12;return r&&n<12?e.setHours(n+12,0,0,0):!r&&n===12?e.setHours(0,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`H`,`K`,`k`,`t`,`T`]},XE=class extends dE{priority=70;parse(e,t,n){switch(t){case`H`:return gE(pE.hour23h,e);case`Ho`:return n.ordinalNumber(e,{unit:`hour`});default:return yE(t.length,e)}}validate(e,t){return t>=0&&t<=23}set(e,t,n){return e.setHours(n,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`K`,`k`,`t`,`T`]},ZE=class extends dE{priority=70;parse(e,t,n){switch(t){case`K`:return gE(pE.hour11h,e);case`Ko`:return n.ordinalNumber(e,{unit:`hour`});default:return yE(t.length,e)}}validate(e,t){return t>=0&&t<=11}set(e,t,n){return e.getHours()>=12&&n<12?e.setHours(n+12,0,0,0):e.setHours(n,0,0,0),e}incompatibleTokens=[`h`,`H`,`k`,`t`,`T`]},QE=class extends dE{priority=70;parse(e,t,n){switch(t){case`k`:return gE(pE.hour24h,e);case`ko`:return n.ordinalNumber(e,{unit:`hour`});default:return yE(t.length,e)}}validate(e,t){return t>=1&&t<=24}set(e,t,n){let r=n<=24?n%24:n;return e.setHours(r,0,0,0),e}incompatibleTokens=[`a`,`b`,`h`,`H`,`K`,`t`,`T`]},$E=class extends dE{priority=60;parse(e,t,n){switch(t){case`m`:return gE(pE.minute,e);case`mo`:return n.ordinalNumber(e,{unit:`minute`});default:return yE(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setMinutes(n,0,0),e}incompatibleTokens=[`t`,`T`]},eD=class extends dE{priority=50;parse(e,t,n){switch(t){case`s`:return gE(pE.second,e);case`so`:return n.ordinalNumber(e,{unit:`second`});default:return yE(t.length,e)}}validate(e,t){return t>=0&&t<=59}set(e,t,n){return e.setSeconds(n,0),e}incompatibleTokens=[`t`,`T`]},tD=class extends dE{priority=30;parse(e,t){return hE(yE(t.length,e),e=>Math.trunc(e*10**(-t.length+3)))}set(e,t,n){return e.setMilliseconds(n),e}incompatibleTokens=[`t`,`T`]},nD=class extends dE{priority=10;parse(e,t){switch(t){case`X`:return _E(mE.basicOptionalMinutes,e);case`XX`:return _E(mE.basic,e);case`XXXX`:return _E(mE.basicOptionalSeconds,e);case`XXXXX`:return _E(mE.extendedOptionalSeconds,e);default:return _E(mE.extended,e)}}set(e,t,n){return t.timestampIsSet?e:Nw(e,e.getTime()-Hw(e)-n)}incompatibleTokens=[`t`,`T`,`x`]},rD=class extends dE{priority=10;parse(e,t){switch(t){case`x`:return _E(mE.basicOptionalMinutes,e);case`xx`:return _E(mE.basic,e);case`xxxx`:return _E(mE.basicOptionalSeconds,e);case`xxxxx`:return _E(mE.extendedOptionalSeconds,e);default:return _E(mE.extended,e)}}set(e,t,n){return t.timestampIsSet?e:Nw(e,e.getTime()-Hw(e)-n)}incompatibleTokens=[`t`,`T`,`X`]},iD=class extends dE{priority=40;parse(e){return vE(e)}set(e,t,n){return[Nw(e,n*1e3),{timestampIsSet:!0}]}incompatibleTokens=`*`},aD=class extends dE{priority=20;parse(e){return vE(e)}set(e,t,n){return[Nw(e,n),{timestampIsSet:!0}]}incompatibleTokens=`*`},oD={G:new fE,y:new wE,Y:new TE,R:new EE,u:new DE,Q:new OE,q:new kE,M:new AE,L:new jE,w:new NE,I:new FE,d:new RE,D:new zE,E:new VE,e:new HE,c:new UE,i:new GE,a:new KE,b:new qE,B:new JE,h:new YE,H:new XE,K:new ZE,k:new QE,m:new $E,s:new eD,S:new tD,X:new nD,x:new rD,t:new iD,T:new aD},sD=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cD=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,lD=/^'([^]*?)'?$/,uD=/''/g,dD=/\S/,fD=/[a-zA-Z]/;function pD(e,t,n,r){let i=()=>Nw(r?.in||n,NaN),a=$T(),o=r?.locale??a.locale??ST,s=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,c=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0;if(!t)return e?i():Pw(n,r?.in);let l={firstWeekContainsDate:s,weekStartsOn:c,locale:o},u=[new uE(r?.in,n)],d=t.match(cD).map(e=>{let t=e[0];if(t in LT){let n=LT[t];return n(e,o.formatLong)}return e}).join(``).match(sD),f=[];for(let n of d){!r?.useAdditionalWeekYearTokens&&HT(n)&&UT(n,t,e),!r?.useAdditionalDayOfYearTokens&&VT(n)&&UT(n,t,e);let a=n[0],s=oD[a];if(s){let{incompatibleTokens:t}=s;if(Array.isArray(t)){let e=f.find(e=>t.includes(e.token)||e.token===a);if(e)throw RangeError(`The format string mustn't contain \`${e.fullToken}\` and \`${n}\` at the same time`)}else if(s.incompatibleTokens===`*`&&f.length>0)throw RangeError(`The format string mustn't contain \`${n}\` and any other token at the same time`);f.push({token:a,fullToken:n});let r=s.run(e,n,o.match,l);if(!r)return i();u.push(r.setter),e=r.rest}else{if(a.match(fD))throw RangeError("Format string contains an unescaped latin alphabet character `"+a+"`");if(n===`''`?n=`'`:a===`'`&&(n=mD(n)),e.indexOf(n)===0)e=e.slice(n.length);else return i()}}if(e.length>0&&dD.test(e))return i();let p=u.map(e=>e.priority).sort((e,t)=>t-e).filter((e,t,n)=>n.indexOf(e)===t).map(e=>u.filter(t=>t.priority===e).sort((e,t)=>t.subPriority-e.subPriority)).map(e=>e[0]),m=Pw(n,r?.in);if(isNaN(+m))return i();let h={};for(let e of p){if(!e.validate(m,l))return i();let t=e.set(m,h,l);Array.isArray(t)?(m=t[0],Object.assign(h,t[1])):m=t}return m}function mD(e){return e.match(lD)[1].replace(uD,`'`)}function hD(e,t,n){let[r,i]=Uw(n?.in,e,t);return r.getFullYear()===i.getFullYear()&&r.getMonth()===i.getMonth()}function gD(e,t,n){let[r,i]=Uw(n?.in,e,t);return r.getFullYear()===i.getFullYear()}function _D(e,t){let n=()=>Nw(t?.in,NaN),r=t?.additionalDigits??2,i=SD(e),a;if(i.date){let e=CD(i.date,r);a=wD(e.restDateString,e.year)}if(!a||isNaN(+a))return n();let o=+a,s=0,c;if(i.time&&(s=ED(i.time),isNaN(s)))return n();if(i.timezone){if(c=OD(i.timezone),isNaN(c))return n()}else{let e=new Date(o+s),n=Pw(0,t?.in);return n.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),n.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),n}return Pw(o+s+c,t?.in)}var vD={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},yD=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,bD=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,xD=/^([+-])(\d{2})(?::?(\d{2}))?$/;function SD(e){let t={},n=e.split(vD.dateTimeDelimiter),r;if(n.length>2)return t;if(/:/.test(n[0])?r=n[0]:(t.date=n[0],r=n[1],vD.timeZoneDelimiter.test(t.date)&&(t.date=e.split(vD.timeZoneDelimiter)[0],r=e.substr(t.date.length,e.length))),r){let e=vD.timezone.exec(r);e?(t.time=r.replace(e[1],``),t.timezone=e[1]):t.time=r}return t}function CD(e,t){let n=RegExp(`^(?:(\\d{4}|[+-]\\d{`+(4+t)+`})|(\\d{2}|[+-]\\d{`+(2+t)+`})$)`),r=e.match(n);if(!r)return{year:NaN,restDateString:``};let i=r[1]?parseInt(r[1]):null,a=r[2]?parseInt(r[2]):null;return{year:a===null?i:a*100,restDateString:e.slice((r[1]||r[2]).length)}}function wD(e,t){if(t===null)return new Date(NaN);let n=e.match(yD);if(!n)return new Date(NaN);let r=!!n[4],i=TD(n[1]),a=TD(n[2])-1,o=TD(n[3]),s=TD(n[4]),c=TD(n[5])-1;if(r)return PD(t,s,c)?kD(t,s,c):new Date(NaN);{let e=new Date(0);return!MD(t,a,o)||!ND(t,i)?new Date(NaN):(e.setUTCFullYear(t,a,Math.max(i,o)),e)}}function TD(e){return e?parseInt(e):1}function ED(e){let t=e.match(bD);if(!t)return NaN;let n=DD(t[1]),r=DD(t[2]),i=DD(t[3]);return FD(n,r,i)?n*kw+r*Ow+i*1e3:NaN}function DD(e){return e&&parseFloat(e.replace(`,`,`.`))||0}function OD(e){if(e===`Z`)return 0;let t=e.match(xD);if(!t)return 0;let n=t[1]===`+`?-1:1,r=parseInt(t[2]),i=t[3]&&parseInt(t[3])||0;return ID(r,i)?n*(r*kw+i*Ow):NaN}function kD(e,t,n){let r=new Date(0);r.setUTCFullYear(e,0,4);let i=r.getUTCDay()||7,a=(t-1)*7+n+1-i;return r.setUTCDate(r.getUTCDate()+a),r}var AD=[31,null,31,30,31,30,31,31,30,31,30,31];function jD(e){return e%400==0||e%4==0&&e%100!=0}function MD(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(AD[t]||(jD(e)?29:28))}function ND(e,t){return t>=1&&t<=(jD(e)?366:365)}function PD(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function FD(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function ID(e,t){return t>=0&&t<=59}function LD(e,t,n){let r=Pw(e,n?.in),i=r.getFullYear(),a=r.getDate(),o=Nw(n?.in||e,0);o.setFullYear(i,t,15),o.setHours(0,0,0,0);let s=QT(o);return r.setMonth(t,Math.min(a,s)),r}function RD(e,t,n){let r=Pw(e,n?.in);return isNaN(+r)?Nw(n?.in||e,NaN):(r.setFullYear(t),r)}function zD(e,t,n=`long`){return new Intl.DateTimeFormat(`en-US`,{hour:`numeric`,timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(` `)}var BD={},VD={};function HD(e,t){try{let n=(BD[e]||=new Intl.DateTimeFormat(`en-US`,{timeZone:e,timeZoneName:`longOffset`}).format)(t).split(`GMT`)[1];return n in VD?VD[n]:WD(n,n.split(`:`))}catch{if(e in VD)return VD[e];let t=e?.match(UD);return t?WD(e,t.slice(1)):NaN}}var UD=/([+-]\d\d):?(\d\d)?/;function WD(e,t){let n=+(t[0]||0),r=+(t[1]||0),i=(t[2]||0)/60;return VD[e]=n*60+r>0?n*60+r+i:n*60-r-i}var GD=class e extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]==`string`&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(HD(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]==`number`&&(e.length===1||e.length===2&&typeof e[1]!=`number`)?this.setTime(e[0]):typeof e[0]==`string`?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),YD(this,NaN),qD(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){let e=-HD(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),qD(this),+this}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},KD=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!KD.test(e))return;let t=e.replace(KD,`$1UTC`);GD.prototype[t]&&(e.startsWith(`get`)?GD.prototype[e]=function(){return this.internal[t]()}:(GD.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),JD(this),+this},GD.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),qD(this),+this}))});function qD(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-HD(e.timeZone,e)*60))}function JD(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),YD(e)}function YD(e){let t=HD(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let i=-new Date(+e).getTimezoneOffset(),a=i- -new Date(+r).getTimezoneOffset(),o=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&o&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let s=i-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let c=new Date(+e);c.setUTCSeconds(0);let l=i>0?c.getSeconds():(c.getSeconds()-60)%60,u=Math.round(-(HD(e.timeZone,e)*60))%60;(u||l)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+l));let d=HD(e.timeZone,e),f=d>0?Math.floor(d):Math.ceil(d),p=-new Date(+e).getTimezoneOffset()-f,m=f!==n,h=p-s;if(m&&h){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+h);let t=HD(e.timeZone,e),n=f-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}var XD=class e extends GD{static tz(t,...n){return n.length?new e(...n,t):new e(Date.now(),t)}toISOString(){let[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){let[e,t,n,r]=this.internal.toUTCString().split(` `);return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){let e=this.internal.toUTCString().split(` `)[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${zD(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){let e=this.getTimezoneOffset();return[e>0?`-`:`+`,String(Math.floor(Math.abs(e)/60)).padStart(2,`0`),String(Math.abs(e)%60).padStart(2,`0`)]}withTimeZone(t){return new e(+this,t)}[Symbol.for(`constructDateFrom`)](t){return new e(+new Date(t),this.timeZone)}},ZD=5,QD=4;function $D(e,t){let n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,i=t.addDays(e,-r+1),a=t.addDays(i,ZD*7-1);return t.getMonth(e)===t.getMonth(a)?ZD:QD}function eO(e,t){let n=t.startOfMonth(e),r=n.getDay();return r===1?n:r===0?t.addDays(n,-6):t.addDays(n,-1*(r-1))}function tO(e,t){let n=eO(e,t),r=$D(e,t);return t.addDays(n,r*7-1)}var nO={...ST,labels:{labelDayButton:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>XT(e,t,{locale:ST,...n});let a=i(e,`PPPP`);return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a},labelMonthDropdown:`Choose the Month`,labelNext:`Go to the Next Month`,labelPrevious:`Go to the Previous Month`,labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:`Choose the Year`,labelGrid:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>XT(e,n,{locale:ST,...t}),r(e,`LLLL yyyy`)},labelGridcell:(e,t,n,r)=>{let i;i=r&&typeof r.format==`function`?r.format.bind(r):(e,t)=>XT(e,t,{locale:ST,...n});let a=i(e,`PPPP`);return t?.today&&(a=`Today, ${a}`),a},labelNav:`Navigation bar`,labelWeekNumberHeader:`Week Number`,labelWeekday:(e,t,n)=>{let r;return r=n&&typeof n.format==`function`?n.format.bind(n):(e,n)=>XT(e,n,{locale:ST,...t}),r(e,`cccc`)}}},rO=class e{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?XD.tz(this.options.timeZone):new this.Date,this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new XD(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):Fw(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):Iw(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):qw(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):Jw(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):Gw(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):eT(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):rT(e),this.eachYearOfInterval=e=>{let t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):sT(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;let r=[];return n.forEach(e=>{r.push(new Date(e,0,1))}),r},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):tO(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):lT(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):tT(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):cT(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):aT(e),this.format=(e,t,n)=>{let r=this.overrides?.format?this.overrides.format(e,t,this.options):XT(e,t,this.options);return this.options.numerals&&this.options.numerals!==`latn`?this.replaceDigits(r):r},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):wT(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):tE(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):nE(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):DT(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):rE(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):iE(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):Qw(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):Zw(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):hD(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):gD(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):Yw(e),this.min=e=>this.overrides?.min?this.overrides.min(e):Xw(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):LD(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):RD(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):eO(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):Ww(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):Bw(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):iT(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):zw(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):oT(e),this.options={locale:nO,...e},this.overrides=t}getDigitMap(){let{numerals:e=`latn`}=this.options,t=new Intl.NumberFormat(`en-US`,{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){let t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){let t=this.options.locale?.code;return t&&e.yearFirstLocales.has(t)?`year-first`:`month-first`}formatMonthYear(t){let{locale:n,timeZone:r,numerals:i}=this.options,a=n?.code;if(a&&e.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:`long`,year:`numeric`,timeZone:r,numberingSystem:i}).format(t)}catch{}let o=this.getMonthYearOrder()===`year-first`?`y LLLL`:`LLLL y`;return this.format(t,o)}};rO.yearFirstLocales=new Set([`eu`,`hu`,`ja`,`ja-Hira`,`ja-JP`,`ko`,`ko-KR`,`lt`,`lt-LT`,`lv`,`lv-LV`,`mn`,`mn-MN`,`zh`,`zh-CN`,`zh-HK`,`zh-TW`]);var iO=new rO,aO=class{constructor(e,t,n=iO){this.date=e,this.displayMonth=t,this.outside=!!(t&&!n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,`yyyy-MM-dd`),this.displayMonthId=n.format(t,`yyyy-MM`),this.dateMonthId=n.format(e,`yyyy-MM`)}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}},oO=class{constructor(e,t){this.date=e,this.weeks=t}},sO=class{constructor(e,t){this.days=t,this.weekNumber=e}};function cO(e){return Q.createElement(`button`,{...e})}function lO(e){return Q.createElement(`span`,{...e})}function uO(e){let{size:t=24,orientation:n=`left`,className:r}=e;return Q.createElement(`svg`,{className:r,width:t,height:t,viewBox:`0 0 24 24`},n===`up`&&Q.createElement(`polygon`,{points:`6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28`}),n===`down`&&Q.createElement(`polygon`,{points:`6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72`}),n===`left`&&Q.createElement(`polygon`,{points:`16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20`}),n===`right`&&Q.createElement(`polygon`,{points:`8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20`}))}function dO(e){let{day:t,modifiers:n,...r}=e;return Q.createElement(`td`,{...r})}function fO(e){let{day:t,modifiers:n,...r}=e,i=Q.useRef(null);return Q.useEffect(()=>{n.focused&&i.current?.focus()},[n.focused]),Q.createElement(`button`,{ref:i,...r})}var pO;(function(e){e.Root=`root`,e.Chevron=`chevron`,e.Day=`day`,e.DayButton=`day_button`,e.CaptionLabel=`caption_label`,e.Dropdowns=`dropdowns`,e.Dropdown=`dropdown`,e.DropdownRoot=`dropdown_root`,e.Footer=`footer`,e.MonthGrid=`month_grid`,e.MonthCaption=`month_caption`,e.MonthsDropdown=`months_dropdown`,e.Month=`month`,e.Months=`months`,e.Nav=`nav`,e.NextMonthButton=`button_next`,e.PreviousMonthButton=`button_previous`,e.Week=`week`,e.Weeks=`weeks`,e.Weekday=`weekday`,e.Weekdays=`weekdays`,e.WeekNumber=`week_number`,e.WeekNumberHeader=`week_number_header`,e.YearsDropdown=`years_dropdown`})(pO||={});var mO;(function(e){e.disabled=`disabled`,e.hidden=`hidden`,e.outside=`outside`,e.focused=`focused`,e.today=`today`})(mO||={});var hO;(function(e){e.range_end=`range_end`,e.range_middle=`range_middle`,e.range_start=`range_start`,e.selected=`selected`})(hO||={});var gO;(function(e){e.weeks_before_enter=`weeks_before_enter`,e.weeks_before_exit=`weeks_before_exit`,e.weeks_after_enter=`weeks_after_enter`,e.weeks_after_exit=`weeks_after_exit`,e.caption_after_enter=`caption_after_enter`,e.caption_after_exit=`caption_after_exit`,e.caption_before_enter=`caption_before_enter`,e.caption_before_exit=`caption_before_exit`})(gO||={});function _O(e){let{options:t,className:n,components:r,classNames:i,...a}=e,o=[i[pO.Dropdown],n].join(` `),s=t?.find(({value:e})=>e===a.value);return Q.createElement(`span`,{"data-disabled":a.disabled,className:i[pO.DropdownRoot]},Q.createElement(r.Select,{className:o,...a},t?.map(({value:e,label:t,disabled:n})=>Q.createElement(r.Option,{key:e,value:e,disabled:n},t))),Q.createElement(`span`,{className:i[pO.CaptionLabel],"aria-hidden":!0},s?.label,Q.createElement(r.Chevron,{orientation:`down`,size:18,className:i[pO.Chevron]})))}function vO(e){return Q.createElement(`div`,{...e})}function yO(e){return Q.createElement(`div`,{...e})}function bO(e){let{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement(`div`,{...r},e.children)}function xO(e){let{calendarMonth:t,displayIndex:n,...r}=e;return Q.createElement(`div`,{...r})}function SO(e){return Q.createElement(`table`,{...e})}function CO(e){return Q.createElement(`div`,{...e})}var wO=(0,Q.createContext)(void 0);function TO(){let e=(0,Q.useContext)(wO);if(e===void 0)throw Error(`useDayPicker() must be used within a custom component.`);return e}function EO(e){let{components:t}=TO();return Q.createElement(t.Dropdown,{...e})}function DO(e){let{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:i,...a}=e,{components:o,classNames:s,labels:{labelPrevious:c,labelNext:l}}=TO(),u=(0,Q.useCallback)(e=>{i&&n?.(e)},[i,n]),d=(0,Q.useCallback)(e=>{r&&t?.(e)},[r,t]);return Q.createElement(`nav`,{...a},Q.createElement(o.PreviousMonthButton,{type:`button`,className:s[pO.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":c(r),onClick:d},Q.createElement(o.Chevron,{disabled:r?void 0:!0,className:s[pO.Chevron],orientation:`left`})),Q.createElement(o.NextMonthButton,{type:`button`,className:s[pO.NextMonthButton],tabIndex:i?void 0:-1,"aria-disabled":i?void 0:!0,"aria-label":l(i),onClick:u},Q.createElement(o.Chevron,{disabled:i?void 0:!0,orientation:`right`,className:s[pO.Chevron]})))}function OO(e){let{components:t}=TO();return Q.createElement(t.Button,{...e})}function kO(e){return Q.createElement(`option`,{...e})}function AO(e){let{components:t}=TO();return Q.createElement(t.Button,{...e})}function jO(e){let{rootRef:t,...n}=e;return Q.createElement(`div`,{...n,ref:t})}function MO(e){return Q.createElement(`select`,{...e})}function NO(e){let{week:t,...n}=e;return Q.createElement(`tr`,{...n})}function PO(e){return Q.createElement(`th`,{...e})}function FO(e){return Q.createElement(`thead`,{"aria-hidden":!0},Q.createElement(`tr`,{...e}))}function IO(e){let{week:t,...n}=e;return Q.createElement(`th`,{...n})}function LO(e){return Q.createElement(`th`,{...e})}function RO(e){return Q.createElement(`tbody`,{...e})}function zO(e){let{components:t}=TO();return Q.createElement(t.Dropdown,{...e})}var BO=t({Button:()=>cO,CaptionLabel:()=>lO,Chevron:()=>uO,Day:()=>dO,DayButton:()=>fO,Dropdown:()=>_O,DropdownNav:()=>vO,Footer:()=>yO,Month:()=>bO,MonthCaption:()=>xO,MonthGrid:()=>SO,Months:()=>CO,MonthsDropdown:()=>EO,Nav:()=>DO,NextMonthButton:()=>OO,Option:()=>kO,PreviousMonthButton:()=>AO,Root:()=>jO,Select:()=>MO,Week:()=>NO,WeekNumber:()=>IO,WeekNumberHeader:()=>LO,Weekday:()=>PO,Weekdays:()=>FO,Weeks:()=>RO,YearsDropdown:()=>zO});function VO(e,t,n=!1,r=iO){let{from:i,to:a}=e,{differenceInCalendarDays:o,isSameDay:s}=r;return i&&a?(o(a,i)<0&&([i,a]=[a,i]),o(t,i)>=+!!n&&o(a,t)>=+!!n):!n&&a?s(a,t):!n&&i?s(i,t):!1}function HO(e){return!!(e&&typeof e==`object`&&`before`in e&&`after`in e)}function UO(e){return!!(e&&typeof e==`object`&&`from`in e)}function WO(e){return!!(e&&typeof e==`object`&&`after`in e)}function GO(e){return!!(e&&typeof e==`object`&&`before`in e)}function KO(e){return!!(e&&typeof e==`object`&&`dayOfWeek`in e)}function qO(e,t){return Array.isArray(e)&&e.every(t.isDate)}function JO(e,t,n=iO){let r=Array.isArray(t)?t:[t],{isSameDay:i,differenceInCalendarDays:a,isAfter:o}=n;return r.some(t=>{if(typeof t==`boolean`)return t;if(n.isDate(t))return i(e,t);if(qO(t,n))return t.some(t=>i(e,t));if(UO(t))return VO(t,e,!1,n);if(KO(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(HO(t)){let n=a(t.before,e),r=a(t.after,e),i=n>0,s=r<0;return o(t.before,t.after)?s&&i:i||s}return WO(t)?a(e,t.after)>0:GO(t)?a(t.before,e)>0:typeof t==`function`?t(e):!1})}function YO(e,t,n,r,i){let{disabled:a,hidden:o,modifiers:s,showOutsideDays:c,broadcastCalendar:l,today:u=i.today()}=t,{isSameDay:d,isSameMonth:f,startOfMonth:p,isBefore:m,endOfMonth:h,isAfter:g}=i,_=n&&p(n),v=r&&h(r),y={[mO.focused]:[],[mO.outside]:[],[mO.disabled]:[],[mO.hidden]:[],[mO.today]:[]},b={};for(let t of e){let{date:e,displayMonth:n}=t,r=!!(n&&!f(e,n)),p=!!(_&&m(e,_)),h=!!(v&&g(e,v)),x=!!(a&&JO(e,a,i)),S=!!(o&&JO(e,o,i))||p||h||!l&&!c&&r||l&&c===!1&&r,C=d(e,u);r&&y.outside.push(t),x&&y.disabled.push(t),S&&y.hidden.push(t),C&&y.today.push(t),s&&Object.keys(s).forEach(n=>{let r=s?.[n];r&&JO(e,r,i)&&(b[n]?b[n].push(t):b[n]=[t])})}return e=>{let t={[mO.focused]:!1,[mO.disabled]:!1,[mO.hidden]:!1,[mO.outside]:!1,[mO.today]:!1},n={};for(let n in y)t[n]=y[n].some(t=>t===e);for(let t in b)n[t]=b[t].some(t=>t===e);return{...t,...n}}}function XO(e,t,n={}){return Object.entries(e).filter(([,e])=>e===!0).reduce((e,[r])=>(n[r]?e.push(n[r]):t[mO[r]]?e.push(t[mO[r]]):t[hO[r]]&&e.push(t[hO[r]]),e),[t[pO.Day]])}function ZO(e){return{...BO,...e}}function QO(e){let t={"data-mode":e.mode??void 0,"data-required":`required`in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith(`data-`)&&(t[e]=n)}),t}function $O(){let e={};for(let t in pO)e[pO[t]]=`rdp-${pO[t]}`;for(let t in mO)e[mO[t]]=`rdp-${mO[t]}`;for(let t in hO)e[hO[t]]=`rdp-${hO[t]}`;for(let t in gO)e[gO[t]]=`rdp-${gO[t]}`;return e}function ek(e,t,n){return(n??new rO(t)).formatMonthYear(e)}var tk=ek;function nk(e,t,n){return(n??new rO(t)).format(e,`d`)}function rk(e,t=iO){return t.format(e,`LLLL`)}function ik(e,t,n){return(n??new rO(t)).format(e,`cccccc`)}function ak(e,t=iO){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function ok(){return``}function sk(e,t=iO){return t.format(e,`yyyy`)}var ck=sk,lk=t({formatCaption:()=>ek,formatDay:()=>nk,formatMonthCaption:()=>tk,formatMonthDropdown:()=>rk,formatWeekNumber:()=>ak,formatWeekNumberHeader:()=>ok,formatWeekdayName:()=>ik,formatYearCaption:()=>ck,formatYearDropdown:()=>sk});function uk(e){return e?.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e?.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...lk,...e}}function dk(e,t,n,r){let i=(r??new rO(n)).format(e,`PPPP`);return t.today&&(i=`Today, ${i}`),t.selected&&(i=`${i}, selected`),i}var fk=dk;function pk(e,t,n){return(n??new rO(t)).formatMonthYear(e)}var mk=pk;function hk(e,t,n,r){let i=(r??new rO(n)).format(e,`PPPP`);return t?.today&&(i=`Today, ${i}`),i}function gk(e){return`Choose the Month`}function _k(){return``}var vk=`Go to the Next Month`;function yk(e,t){return vk}function bk(e){return`Go to the Previous Month`}function xk(e,t,n){return(n??new rO(t)).format(e,`cccc`)}function Sk(e,t){return`Week ${e}`}function Ck(e){return`Week Number`}function wk(e){return`Choose the Year`}var Tk=t({labelCaption:()=>mk,labelDay:()=>fk,labelDayButton:()=>dk,labelGrid:()=>pk,labelGridcell:()=>hk,labelMonthDropdown:()=>gk,labelNav:()=>_k,labelNext:()=>yk,labelPrevious:()=>bk,labelWeekNumber:()=>Sk,labelWeekNumberHeader:()=>Ck,labelWeekday:()=>xk,labelYearDropdown:()=>wk}),Ek=(e,t,n)=>t||(n?typeof n==`function`?n:(...e)=>n:e);function Dk(e,t){let n=t.locale?.labels??{};return{...Tk,...e??{},labelDayButton:Ek(dk,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:Ek(gk,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:Ek(yk,e?.labelNext,n.labelNext),labelPrevious:Ek(bk,e?.labelPrevious,n.labelPrevious),labelWeekNumber:Ek(Sk,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:Ek(wk,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:Ek(pk,e?.labelGrid,n.labelGrid),labelGridcell:Ek(hk,e?.labelGridcell,n.labelGridcell),labelNav:Ek(_k,e?.labelNav,n.labelNav),labelWeekNumberHeader:Ek(Ck,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:Ek(xk,e?.labelWeekday,n.labelWeekday)}}function Ok(e,t,n,r,i){let{startOfMonth:a,startOfYear:o,endOfYear:s,eachMonthOfInterval:c,getMonth:l}=i;return c({start:o(e),end:s(e)}).map(e=>{let o=r.formatMonthDropdown(e,i);return{value:l(e),label:o,disabled:t&&e<a(t)||n&&e>a(n)||!1}})}function kk(e,t={},n={}){let r={...t?.[pO.Day]};return Object.entries(e).filter(([,e])=>e===!0).forEach(([e])=>{r={...r,...n?.[e]}}),r}function Ak(e,t,n,r){let i=r??e.today(),a=n?e.startOfBroadcastWeek(i,e):t?e.startOfISOWeek(i):e.startOfWeek(i),o=[];for(let t=0;t<7;t++){let n=e.addDays(a,t);o.push(n)}return o}function jk(e,t,n,r,i=!1){if(!e||!t)return;let{startOfYear:a,endOfYear:o,eachYearOfInterval:s,getYear:c}=r,l=s({start:a(e),end:o(t)});return i&&l.reverse(),l.map(e=>{let t=n.formatYearDropdown(e,r);return{value:c(e),label:t,disabled:!1}})}function Mk(e,t={}){let{weekStartsOn:n,locale:r}=t,i=n??r?.options?.weekStartsOn??0,a=t=>{let n=typeof t==`number`||typeof t==`string`?new Date(t):t;return new XD(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},o=e=>{let t=a(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>a(XD.tz(e)),newDate:(t,n,r)=>new XD(t,n,r,12,0,0,e),startOfDay:e=>a(e),startOfWeek:(e,t)=>{let n=a(e),r=t?.weekStartsOn??i,o=(n.getDay()-r+7)%7;return n.setDate(n.getDate()-o),n},startOfISOWeek:e=>{let t=a(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{let t=a(e);return t.setDate(1),t},startOfYear:e=>{let t=a(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{let n=a(e),r=(((t?.weekStartsOn??i)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+r),n},endOfISOWeek:e=>{let t=a(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{let t=a(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{let t=a(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new XD(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=r.getFullYear()*12+r.getMonth();for(;o.getFullYear()*12+o.getMonth()<=s;)i.push(new XD(o,e)),o.setMonth(o.getMonth()+1,1);return i},addDays:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{let n=a(e);return n.setDate(n.getDate()+t*7),n},addMonths:(e,t)=>{let n=a(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{let n=a(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{let n=a(t.start),r=a(t.end),i=[],o=new XD(n.getFullYear(),0,1,12,0,0,e);for(;o.getFullYear()<=r.getFullYear();)i.push(new XD(o,e)),o.setFullYear(o.getFullYear()+1,0,1);return i},getWeek:(e,t)=>DT(o(e),{weekStartsOn:t?.weekStartsOn??i,firstWeekContainsDate:t?.firstWeekContainsDate??r?.options?.firstWeekContainsDate??1}),getISOWeek:e=>wT(o(e)),differenceInCalendarDays:(e,t)=>Gw(o(e),o(t)),differenceInCalendarMonths:(e,t)=>eT(o(e),o(t))}}var Nk=e=>e instanceof HTMLElement?e:null,Pk=e=>[...e.querySelectorAll(`[data-animated-month]`)??[]],Fk=e=>Nk(e.querySelector(`[data-animated-month]`)),Ik=e=>Nk(e.querySelector(`[data-animated-caption]`)),Lk=e=>Nk(e.querySelector(`[data-animated-weeks]`)),Rk=e=>Nk(e.querySelector(`[data-animated-nav]`)),zk=e=>Nk(e.querySelector(`[data-animated-weekdays]`));function Bk(e,t,{classNames:n,months:r,focused:i,dateLib:a}){let o=(0,Q.useRef)(null),s=(0,Q.useRef)(r),c=(0,Q.useRef)(!1);(0,Q.useLayoutEffect)(()=>{let l=s.current;if(s.current=r,!t||!e.current||!(e.current instanceof HTMLElement)||r.length===0||l.length===0||r.length!==l.length)return;let u=a.isSameMonth(r[0].date,l[0].date),d=a.isAfter(r[0].date,l[0].date),f=d?n[gO.caption_after_enter]:n[gO.caption_before_enter],p=d?n[gO.weeks_after_enter]:n[gO.weeks_before_enter],m=o.current,h=e.current.cloneNode(!0);if(h instanceof HTMLElement?(Pk(h).forEach(e=>{if(!(e instanceof HTMLElement))return;let t=Fk(e);t&&e.contains(t)&&e.removeChild(t);let n=Ik(e);n&&n.classList.remove(f);let r=Lk(e);r&&r.classList.remove(p)}),o.current=h):o.current=null,c.current||u||i)return;let g=m instanceof HTMLElement?Pk(m):[],_=Pk(e.current);if(_?.every(e=>e instanceof HTMLElement)&&g&&g.every(e=>e instanceof HTMLElement)){c.current=!0;let t=[];e.current.style.isolation=`isolate`;let r=Rk(e.current);r&&(r.style.zIndex=`1`),_.forEach((i,a)=>{let o=g[a];if(!o)return;i.style.position=`relative`,i.style.overflow=`hidden`;let s=Ik(i);s&&s.classList.add(f);let l=Lk(i);l&&l.classList.add(p);let u=()=>{c.current=!1,e.current&&(e.current.style.isolation=``),r&&(r.style.zIndex=``),s&&s.classList.remove(f),l&&l.classList.remove(p),i.style.position=``,i.style.overflow=``,i.contains(o)&&i.removeChild(o)};t.push(u),o.style.pointerEvents=`none`,o.style.position=`absolute`,o.style.overflow=`hidden`,o.setAttribute(`aria-hidden`,`true`);let m=zk(o);m&&(m.style.opacity=`0`);let h=Ik(o);h&&(h.classList.add(d?n[gO.caption_before_exit]:n[gO.caption_after_exit]),h.addEventListener(`animationend`,u));let _=Lk(o);_&&_.classList.add(d?n[gO.weeks_before_exit]:n[gO.weeks_after_exit]),i.insertBefore(o,i.firstChild)})}})}function Vk(e,t,n,r){let i=e[0],a=e[e.length-1],{ISOWeek:o,fixedWeeks:s,broadcastCalendar:c}=n??{},{addDays:l,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:p,endOfMonth:m,endOfWeek:h,isAfter:g,startOfBroadcastWeek:_,startOfISOWeek:v,startOfWeek:y}=r,b=c?_(i,r):o?v(i):y(i),x=c?f(a):o?p(m(a)):h(m(a)),S=t&&(c?f(t):o?p(t):h(t)),C=u(S&&g(x,S)?S:x,b),w=d(a,i)+1,T=[];for(let e=0;e<=C;e++){let t=l(b,e);T.push(t)}let E=(c?35:42)*w;if(s&&T.length<E){let e=E-T.length;for(let t=0;t<e;t++){let e=l(T[T.length-1],1);T.push(e)}}return T}function Hk(e){let t=[];return e.reduce((e,n)=>{let r=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(r.slice())},t.slice())}function Uk(e,t,n,r){let{numberOfMonths:i=1}=n,a=[];for(let n=0;n<i;n++){let i=r.addMonths(e,n);if(t&&i>t)break;a.push(i)}return a}function Wk(e,t,n,r){let{month:i,defaultMonth:a,today:o=r.today(),numberOfMonths:s=1}=e,c=i||a||o,{differenceInCalendarMonths:l,addMonths:u,startOfMonth:d}=r;return n&&l(n,c)<s-1&&(c=u(n,-1*(s-1))),t&&l(c,t)<0&&(c=t),d(c)}function Gk(e,t,n,r){let{addDays:i,endOfBroadcastWeek:a,endOfISOWeek:o,endOfMonth:s,endOfWeek:c,getISOWeek:l,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:p}=r,m=e.reduce((e,m)=>{let h=n.broadcastCalendar?d(m,r):n.ISOWeek?f(m):p(m),g=n.broadcastCalendar?a(m):n.ISOWeek?o(s(m)):c(s(m)),_=t.filter(e=>e>=h&&e<=g),v=n.broadcastCalendar?35:42;if(n.fixedWeeks&&_.length<v){let e=t.filter(e=>{let t=v-_.length;return e>g&&e<=i(g,t)});_.push(...e)}let y=new oO(m,_.reduce((e,t)=>{let i=n.ISOWeek?l(t):u(t),a=e.find(e=>e.weekNumber===i),o=new aO(t,m,r);return a?a.days.push(o):e.push(new sO(i,[o])),e},[]));return e.push(y),e},[]);return n.reverseMonths?m.reverse():m}function Kk(e,t){let{startMonth:n,endMonth:r}=e,{startOfYear:i,startOfDay:a,startOfMonth:o,endOfMonth:s,addYears:c,endOfYear:l,newDate:u,today:d}=t,{fromYear:f,toYear:p,fromMonth:m,toMonth:h}=e;!n&&m&&(n=m),!n&&f&&(n=t.newDate(f,0,1)),!r&&h&&(r=h),!r&&p&&(r=u(p,11,31));let g=e.captionLayout===`dropdown`||e.captionLayout===`dropdown-years`;return n?n=o(n):f?n=u(f,0,1):!n&&g&&(n=i(c(e.today??d(),-100))),r?r=s(r):p?r=u(p,11,31):!r&&g&&(r=l(e.today??d())),[n&&a(n),r&&a(r)]}function qk(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a=1}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a:1,u=o(e);if(!t||!(c(t,e)<a))return s(u,l)}function Jk(e,t,n,r){if(n.disableNavigation)return;let{pagedNavigation:i,numberOfMonths:a}=n,{startOfMonth:o,addMonths:s,differenceInCalendarMonths:c}=r,l=i?a??1:1,u=o(e);if(!t||!(c(u,t)<=0))return s(u,-l)}function Yk(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}function Xk(e,t){let[n,r]=(0,Q.useState)(e);return[t===void 0?n:t,r]}function Zk(e,t){let[n,r]=Kk(e,t),{startOfMonth:i,endOfMonth:a}=t,o=Wk(e,n,r,t),[s,c]=Xk(o,e.month?o:void 0);(0,Q.useEffect)(()=>{c(Wk(e,n,r,t))},[e.timeZone]);let{months:l,weeks:u,days:d,previousMonth:f,nextMonth:p}=(0,Q.useMemo)(()=>{let i=Uk(s,r,{numberOfMonths:e.numberOfMonths},t),o=Gk(i,Vk(i,e.endMonth?a(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t);return{months:o,weeks:Yk(o),days:Hk(o),previousMonth:Jk(s,n,e,t),nextMonth:qk(s,r,e,t)}},[t,s.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:m,onMonthChange:h}=e,g=e=>u.some(t=>t.days.some(t=>t.isEqualTo(e))),_=e=>{if(m)return;let t=i(e);n&&t<i(n)&&(t=i(n)),r&&t>i(r)&&(t=i(r)),c(t),h?.(t)};return{months:l,weeks:u,days:d,navStart:n,navEnd:r,previousMonth:f,nextMonth:p,goToMonth:_,goToDay:e=>{g(e)||_(e.date)}}}var Qk;(function(e){e[e.Today=0]=`Today`,e[e.Selected=1]=`Selected`,e[e.LastFocused=2]=`LastFocused`,e[e.FocusedModifier=3]=`FocusedModifier`})(Qk||={});function $k(e){return!e[mO.disabled]&&!e[mO.hidden]&&!e[mO.outside]}function eA(e,t,n,r){let i,a=-1;for(let o of e){let e=t(o);$k(e)&&(e[mO.focused]&&a<Qk.FocusedModifier?(i=o,a=Qk.FocusedModifier):r?.isEqualTo(o)&&a<Qk.LastFocused?(i=o,a=Qk.LastFocused):n(o.date)&&a<Qk.Selected?(i=o,a=Qk.Selected):e[mO.today]&&a<Qk.Today&&(i=o,a=Qk.Today))}return i||=e.find(e=>$k(t(e))),i}function tA(e,t,n,r,i,a,o){let{ISOWeek:s,broadcastCalendar:c}=a,{addDays:l,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:p,endOfISOWeek:m,endOfWeek:h,max:g,min:_,startOfBroadcastWeek:v,startOfISOWeek:y,startOfWeek:b}=o,x={day:l,week:d,month:u,year:f,startOfWeek:e=>c?v(e,o):s?y(e):b(e),endOfWeek:e=>c?p(e):s?m(e):h(e)}[e](n,t===`after`?1:-1);return t===`before`&&r?x=g([r,x]):t===`after`&&i&&(x=_([i,x])),x}function nA(e,t,n,r,i,a,o,s=0){if(s>365)return;let c=tA(e,t,n.date,r,i,a,o),l=!!(a.disabled&&JO(c,a.disabled,o)),u=!!(a.hidden&&JO(c,a.hidden,o)),d=new aO(c,c,o);return!l&&!u?d:nA(e,t,d,r,i,a,o,s+1)}function rA(e,t,n,r,i){let{autoFocus:a}=e,[o,s]=(0,Q.useState)(),c=eA(t.days,n,r||(()=>!1),o),[l,u]=(0,Q.useState)(a?c:void 0);return{isFocusTarget:e=>!!c?.isEqualTo(e),setFocused:u,focused:l,blur:()=>{s(l),u(void 0)},moveFocus:(n,r)=>{if(!l)return;let a=nA(n,r,l,t.navStart,t.navEnd,e,i);a&&(e.disableNavigation&&!t.days.some(e=>e.isEqualTo(a))||(t.goToDay(a),u(a)))}}}function iA(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=Xk(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t,l=e=>s?.some(t=>c(t,e))??!1,{min:u,max:d}=e;return{selected:s,select:(e,t,n)=>{let a=[...s??[]];if(l(e)){if(s?.length===u||r&&s?.length===1)return;a=s?.filter(t=>!c(t,e))}else a=s?.length===d?[e]:[...a,e];return i||o(a),i?.(a,e,t,n),a},isSelected:l}}function aA(e,t,n=0,r=0,i=!1,a=iO){let{from:o,to:s}=t||{},{isSameDay:c,isAfter:l,isBefore:u}=a,d;if(!o&&!s)d={from:e,to:n>0?void 0:e};else if(o&&!s)d=c(o,e)?n===0?{from:o,to:e}:i?{from:o,to:void 0}:void 0:u(e,o)?{from:e,to:o}:{from:o,to:e};else if(o&&s)if(c(o,e)&&c(s,e))d=i?{from:o,to:s}:void 0;else if(c(o,e))d={from:o,to:n>0?void 0:e};else if(c(s,e))d={from:e,to:n>0?void 0:e};else if(u(e,o))d={from:e,to:s};else if(l(e,o))d={from:o,to:e};else if(l(e,s))d={from:o,to:e};else throw Error(`Invalid range`);if(d?.from&&d?.to){let t=a.differenceInCalendarDays(d.to,d.from);(r>0&&t>r||n>1&&t<n)&&(d={from:e,to:void 0})}return d}function oA(e,t,n=iO){let r=Array.isArray(t)?t:[t],i=e.from,a=n.differenceInCalendarDays(e.to,e.from),o=Math.min(a,6);for(let e=0;e<=o;e++){if(r.includes(i.getDay()))return!0;i=n.addDays(i,1)}return!1}function sA(e,t,n=iO){return VO(e,t.from,!1,n)||VO(e,t.to,!1,n)||VO(t,e.from,!1,n)||VO(t,e.to,!1,n)}function cA(e,t,n=iO){let r=Array.isArray(t)?t:[t];if(r.filter(e=>typeof e!=`function`).some(t=>typeof t==`boolean`?t:n.isDate(t)?VO(e,t,!1,n):qO(t,n)?t.some(t=>VO(e,t,!1,n)):UO(t)?t.from&&t.to?sA(e,{from:t.from,to:t.to},n):!1:KO(t)?oA(e,t.dayOfWeek,n):HO(t)?n.isAfter(t.before,t.after)?sA(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):JO(e.from,t,n)||JO(e.to,t,n):WO(t)||GO(t)?JO(e.from,t,n)||JO(e.to,t,n):!1))return!0;let i=r.filter(e=>typeof e==`function`);if(i.length){let t=e.from,r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(i.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}function lA(e,t){let{disabled:n,excludeDisabled:r,resetOnSelect:i,selected:a,required:o,onSelect:s}=e,[c,l]=Xk(a,s?a:void 0),u=s?a:c;return{selected:u,select:(a,c,d)=>{let{min:f,max:p}=e,m;if(a){let e=u?.from,n=u?.to,r=!!e&&!!n,s=!!e&&!!n&&t.isSameDay(e,n)&&t.isSameDay(a,e);m=i&&(r||!u?.from)?!o&&s?void 0:{from:a,to:void 0}:aA(a,u,f,p,o,t)}return r&&n&&m?.from&&m.to&&cA({from:m.from,to:m.to},n,t)&&(m.from=a,m.to=void 0),s||l(m),s?.(m,a,c,d),m},isSelected:e=>u&&VO(u,e,!1,t)}}function uA(e,t){let{selected:n,required:r,onSelect:i}=e,[a,o]=Xk(n,i?n:void 0),s=i?n:a,{isSameDay:c}=t;return{selected:s,select:(e,t,n)=>{let a=e;return!r&&s&&s&&c(e,s)&&(a=void 0),i||o(a),i?.(a,e,t,n),a},isSelected:e=>s?c(s,e):!1}}function dA(e,t){let n=uA(e,t),r=iA(e,t),i=lA(e,t);switch(e.mode){case`single`:return n;case`multiple`:return r;case`range`:return i;default:return}}function fA(e,t){return e instanceof XD&&e.timeZone===t?e:new XD(e,t)}function pA(e,t,n){if(!n)return fA(e,t);let r=fA(e,t),i=new XD(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0,t);return new Date(i.getTime())}function mA(e,t,n){return typeof e==`boolean`||typeof e==`function`?e:e instanceof Date?pA(e,t,n):Array.isArray(e)?e.map(e=>e instanceof Date?pA(e,t,n):e):UO(e)?{...e,from:e.from?fA(e.from,t):e.from,to:e.to?fA(e.to,t):e.to}:HO(e)?{before:pA(e.before,t,n),after:pA(e.after,t,n)}:WO(e)?{after:pA(e.after,t,n)}:GO(e)?{before:pA(e.before,t,n)}:e}function hA(e,t,n){return e&&(Array.isArray(e)?e.map(e=>mA(e,t,n)):mA(e,t,n))}function gA(e){let t=e,n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&=fA(t.today,n),t.month&&=fA(t.month,n),t.defaultMonth&&=fA(t.defaultMonth,n),t.startMonth&&=fA(t.startMonth,n),t.endMonth&&=fA(t.endMonth,n),t.mode===`single`&&t.selected?t.selected=fA(t.selected,n):t.mode===`multiple`&&t.selected?t.selected=t.selected?.map(e=>fA(e,n)):t.mode===`range`&&t.selected&&(t.selected={from:t.selected.from?fA(t.selected.from,n):t.selected.from,to:t.selected.to?fA(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=hA(t.disabled,n)),t.hidden!==void 0&&(t.hidden=hA(t.hidden,n)),t.modifiers)){let e={};Object.keys(t.modifiers).forEach(r=>{e[r]=hA(t.modifiers?.[r],n)}),t.modifiers=e}let{components:r,formatters:i,labels:a,dateLib:o,locale:s,classNames:c}=(0,Q.useMemo)(()=>{let e={...nO,...t.locale},n=t.broadcastCalendar?1:t.weekStartsOn,r=t.noonSafe&&t.timeZone?Mk(t.timeZone,{weekStartsOn:n,locale:e}):void 0,i=t.dateLib&&r?{...r,...t.dateLib}:t.dateLib??r,a=new rO({locale:e,weekStartsOn:n,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},i);return{dateLib:a,components:ZO(t.components),formatters:uk(t.formatters),labels:Dk(t.labels,a.options),locale:e,classNames:{...$O(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.noonSafe,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:o.today()});let{captionLayout:l,mode:u,navLayout:d,numberOfMonths:f=1,onDayBlur:p,onDayClick:m,onDayFocus:h,onDayKeyDown:g,onDayMouseEnter:_,onDayMouseLeave:v,onNextClick:y,onPrevClick:b,showWeekNumber:x,styles:S}=t,{formatCaption:C,formatDay:w,formatMonthDropdown:T,formatWeekNumber:E,formatWeekNumberHeader:D,formatWeekdayName:O,formatYearDropdown:k}=i,A=Zk(t,o),{days:j,months:M,navStart:N,navEnd:P,previousMonth:F,nextMonth:I,goToMonth:L}=A,R=YO(j,t,N,P,o),{isSelected:z,select:B,selected:V}=dA(t,o)??{},{blur:H,focused:U,isFocusTarget:W,moveFocus:G,setFocused:ee}=rA(t,A,R,z??(()=>!1),o),{labelDayButton:te,labelGridcell:ne,labelGrid:re,labelMonthDropdown:ie,labelNav:ae,labelPrevious:oe,labelNext:se,labelWeekday:ce,labelWeekNumber:le,labelWeekNumberHeader:ue,labelYearDropdown:K}=a,q=(0,Q.useMemo)(()=>Ak(o,t.ISOWeek,t.broadcastCalendar,t.today),[o,t.ISOWeek,t.broadcastCalendar,t.today]),de=u!==void 0||m!==void 0,fe=(0,Q.useCallback)(()=>{F&&(L(F),b?.(F))},[F,L,b]),pe=(0,Q.useCallback)(()=>{I&&(L(I),y?.(I))},[L,I,y]),me=(0,Q.useCallback)((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),ee(e),!t.disabled&&(B?.(e.date,t,n),m?.(e.date,t,n))},[B,m,ee]),he=(0,Q.useCallback)((e,t)=>n=>{ee(e),h?.(e.date,t,n)},[h,ee]),ge=(0,Q.useCallback)((e,t)=>n=>{H(),p?.(e.date,t,n)},[H,p]),_e=(0,Q.useCallback)((e,n)=>r=>{let i={ArrowLeft:[r.shiftKey?`month`:`day`,t.dir===`rtl`?`after`:`before`],ArrowRight:[r.shiftKey?`month`:`day`,t.dir===`rtl`?`before`:`after`],ArrowDown:[r.shiftKey?`year`:`week`,`after`],ArrowUp:[r.shiftKey?`year`:`week`,`before`],PageUp:[r.shiftKey?`year`:`month`,`before`],PageDown:[r.shiftKey?`year`:`month`,`after`],Home:[`startOfWeek`,`before`],End:[`endOfWeek`,`after`]};if(i[r.key]){r.preventDefault(),r.stopPropagation();let[e,t]=i[r.key];G(e,t)}g?.(e.date,n,r)},[G,g,t.dir]),ve=(0,Q.useCallback)((e,t)=>n=>{_?.(e.date,t,n)},[_]),ye=(0,Q.useCallback)((e,t)=>n=>{v?.(e.date,t,n)},[v]),be=(0,Q.useCallback)(e=>t=>{let n=Number(t.target.value);L(o.setMonth(o.startOfMonth(e),n))},[o,L]),xe=(0,Q.useCallback)(e=>t=>{let n=Number(t.target.value);L(o.setYear(o.startOfMonth(e),n))},[o,L]),{className:Se,style:Ce}=(0,Q.useMemo)(()=>({className:[c[pO.Root],t.className].filter(Boolean).join(` `),style:{...S?.[pO.Root],...t.style}}),[c,t.className,t.style,S]),we=QO(t),Te=(0,Q.useRef)(null);Bk(Te,!!t.animate,{classNames:c,months:M,focused:U,dateLib:o});let Ee={dayPickerProps:t,selected:V,select:B,isSelected:z,months:M,nextMonth:I,previousMonth:F,goToMonth:L,getModifiers:R,components:r,classNames:c,styles:S,labels:a,formatters:i};return Q.createElement(wO.Provider,{value:Ee},Q.createElement(r.Root,{rootRef:t.animate?Te:void 0,className:Se,style:Ce,dir:t.dir,id:t.id,lang:t.lang??s.code,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t[`aria-label`],"aria-labelledby":t[`aria-labelledby`],...we},Q.createElement(r.Months,{className:c[pO.Months],style:S?.[pO.Months]},!t.hideNavigation&&!d&&Q.createElement(r.Nav,{"data-animated-nav":t.animate?`true`:void 0,className:c[pO.Nav],style:S?.[pO.Nav],"aria-label":ae(),onPreviousClick:fe,onNextClick:pe,previousMonth:F,nextMonth:I}),M.map((e,n)=>Q.createElement(r.Month,{"data-animated-month":t.animate?`true`:void 0,className:c[pO.Month],style:S?.[pO.Month],key:n,displayIndex:n,calendarMonth:e},d===`around`&&!t.hideNavigation&&n===0&&Q.createElement(r.PreviousMonthButton,{type:`button`,className:c[pO.PreviousMonthButton],tabIndex:F?void 0:-1,"aria-disabled":F?void 0:!0,"aria-label":oe(F),onClick:fe,"data-animated-button":t.animate?`true`:void 0},Q.createElement(r.Chevron,{disabled:F?void 0:!0,className:c[pO.Chevron],orientation:t.dir===`rtl`?`right`:`left`})),Q.createElement(r.MonthCaption,{"data-animated-caption":t.animate?`true`:void 0,className:c[pO.MonthCaption],style:S?.[pO.MonthCaption],calendarMonth:e,displayIndex:n},l?.startsWith(`dropdown`)?Q.createElement(r.DropdownNav,{className:c[pO.Dropdowns],style:S?.[pO.Dropdowns]},(()=>{let n=l===`dropdown`||l===`dropdown-months`?Q.createElement(r.MonthsDropdown,{key:`month`,className:c[pO.MonthsDropdown],"aria-label":ie(),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:be(e.date),options:Ok(e.date,N,P,i,o),style:S?.[pO.Dropdown],value:o.getMonth(e.date)}):Q.createElement(`span`,{key:`month`},T(e.date,o)),a=l===`dropdown`||l===`dropdown-years`?Q.createElement(r.YearsDropdown,{key:`year`,className:c[pO.YearsDropdown],"aria-label":K(o.options),classNames:c,components:r,disabled:!!t.disableNavigation,onChange:xe(e.date),options:jk(N,P,i,o,!!t.reverseYears),style:S?.[pO.Dropdown],value:o.getYear(e.date)}):Q.createElement(`span`,{key:`year`},k(e.date,o));return o.getMonthYearOrder()===`year-first`?[a,n]:[n,a]})(),Q.createElement(`span`,{role:`status`,"aria-live":`polite`,style:{border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`absolute`,width:`1px`,whiteSpace:`nowrap`,wordWrap:`normal`}},C(e.date,o.options,o))):Q.createElement(r.CaptionLabel,{className:c[pO.CaptionLabel],role:`status`,"aria-live":`polite`},C(e.date,o.options,o))),d===`around`&&!t.hideNavigation&&n===f-1&&Q.createElement(r.NextMonthButton,{type:`button`,className:c[pO.NextMonthButton],tabIndex:I?void 0:-1,"aria-disabled":I?void 0:!0,"aria-label":se(I),onClick:pe,"data-animated-button":t.animate?`true`:void 0},Q.createElement(r.Chevron,{disabled:I?void 0:!0,className:c[pO.Chevron],orientation:t.dir===`rtl`?`left`:`right`})),n===f-1&&d===`after`&&!t.hideNavigation&&Q.createElement(r.Nav,{"data-animated-nav":t.animate?`true`:void 0,className:c[pO.Nav],style:S?.[pO.Nav],"aria-label":ae(),onPreviousClick:fe,onNextClick:pe,previousMonth:F,nextMonth:I}),Q.createElement(r.MonthGrid,{role:`grid`,"aria-multiselectable":u===`multiple`||u===`range`,"aria-label":re(e.date,o.options,o)||void 0,className:c[pO.MonthGrid],style:S?.[pO.MonthGrid]},!t.hideWeekdays&&Q.createElement(r.Weekdays,{"data-animated-weekdays":t.animate?`true`:void 0,className:c[pO.Weekdays],style:S?.[pO.Weekdays]},x&&Q.createElement(r.WeekNumberHeader,{"aria-label":ue(o.options),className:c[pO.WeekNumberHeader],style:S?.[pO.WeekNumberHeader],scope:`col`},D()),q.map(e=>Q.createElement(r.Weekday,{"aria-label":ce(e,o.options,o),className:c[pO.Weekday],key:String(e),style:S?.[pO.Weekday],scope:`col`},O(e,o.options,o)))),Q.createElement(r.Weeks,{"data-animated-weeks":t.animate?`true`:void 0,className:c[pO.Weeks],style:S?.[pO.Weeks]},e.weeks.map(e=>Q.createElement(r.Week,{className:c[pO.Week],key:e.weekNumber,style:S?.[pO.Week],week:e},x&&Q.createElement(r.WeekNumber,{week:e,style:S?.[pO.WeekNumber],"aria-label":le(e.weekNumber,{locale:s}),className:c[pO.WeekNumber],scope:`row`,role:`rowheader`},E(e.weekNumber,o)),e.days.map(e=>{let{date:n}=e,i=R(e);if(i[mO.focused]=!i.hidden&&!!U?.isEqualTo(e),i[hO.selected]=z?.(n)||i.selected,UO(V)){let{from:e,to:t}=V;i[hO.range_start]=!!(e&&t&&o.isSameDay(n,e)),i[hO.range_end]=!!(e&&t&&o.isSameDay(n,t)),i[hO.range_middle]=VO(V,n,!0,o)}let a=kk(i,S,t.modifiersStyles),s=XO(i,c,t.modifiersClassNames),l=!de&&!i.hidden?ne(n,i,o.options,o):void 0;return Q.createElement(r.Day,{key:`${e.isoDate}_${e.displayMonthId}`,day:e,modifiers:i,className:s.join(` `),style:a,role:`gridcell`,"aria-selected":i.selected||void 0,"aria-label":l,"data-day":e.isoDate,"data-month":e.outside?e.dateMonthId:void 0,"data-selected":i.selected||void 0,"data-disabled":i.disabled||void 0,"data-hidden":i.hidden||void 0,"data-outside":e.outside||void 0,"data-focused":i.focused||void 0,"data-today":i.today||void 0},!i.hidden&&de?Q.createElement(r.DayButton,{className:c[pO.DayButton],style:S?.[pO.DayButton],type:`button`,day:e,modifiers:i,disabled:!i.focused&&i.disabled||void 0,"aria-disabled":i.focused&&i.disabled||void 0,tabIndex:W(e)?0:-1,"aria-label":te(n,i,o.options,o),onClick:me(e,i),onBlur:ge(e,i),onFocus:he(e,i),onKeyDown:_e(e,i),onMouseEnter:ve(e,i),onMouseLeave:ye(e,i)},w(n,o.options,o)):!i.hidden&&w(e.date,o.options,o))})))))))),t.footer&&Q.createElement(r.Footer,{className:c[pO.Footer],style:S?.[pO.Footer],role:`status`,"aria-live":`polite`},t.footer)))}function _A(e){let t=(0,$.c)(97),n,r,i,a,o,s,c,l,u;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8],u=t[9]):({className:n,classNames:r,showOutsideDays:c,captionLayout:l,buttonVariant:u,locale:o,formatters:a,components:i,...s}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l,t[9]=u);let d=c===void 0?!0:c,f=l===void 0?`label`:l,p=u===void 0?`ghost`:u,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M,N,P,F,I,L,R,z,B,V,H,U,W;if(t[10]!==p||t[11]!==f||t[12]!==n||t[13]!==a||t[14]!==o||t[15]!==s.showWeekNumber||t[16]!==d){let e=$O();m=gA,P=d,t[48]===n?F=t[49]:(F=J(`group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent`,`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,n),t[48]=n,t[49]=F),I=f,L=o;let r;t[50]===o?.code?r=t[51]:(r=e=>e.toLocaleString(o?.code,{month:`short`}),t[50]=o?.code,t[51]=r),t[52]!==a||t[53]!==r?(R={formatMonthDropdown:r,...a},t[52]=a,t[53]=r,t[54]=R):R=t[54],z=J(`w-fit`,e.root),B=J(`relative flex flex-col gap-4 md:flex-row`,e.months),V=J(`flex w-full flex-col gap-4`,e.month),H=J(`absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1`,e.nav),U=J(At({variant:p}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,e.button_previous),W=J(At({variant:p}),`size-(--cell-size) p-0 select-none aria-disabled:opacity-50`,e.button_next),h=J(`flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)`,e.month_caption),g=J(`flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium`,e.dropdowns),_=J(`relative rounded-(--cell-radius)`,e.dropdown_root),v=J(`absolute inset-0 bg-popover opacity-0`,e.dropdown),y=J(`font-medium select-none`,f===`label`?`text-sm`:`flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground`,e.caption_label),b=`w-full border-collapse`,x=J(`flex`,e.weekdays),S=J(`flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none`,e.weekday),C=J(`mt-2 flex w-full`,e.week),w=J(`w-(--cell-size) select-none`,e.week_number_header),T=J(`text-[0.8rem] text-muted-foreground select-none`,e.week_number),E=J(`group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)`,s.showWeekNumber?`[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)`:`[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)`,e.day),D=J(`relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted`,e.range_start),O=J(`rounded-none`,e.range_middle),k=J(`relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted`,e.range_end),A=J(`rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none`,e.today),j=J(`text-muted-foreground aria-selected:text-muted-foreground`,e.outside),M=J(`text-muted-foreground opacity-50`,e.disabled),N=J(`invisible`,e.hidden),t[10]=p,t[11]=f,t[12]=n,t[13]=a,t[14]=o,t[15]=s.showWeekNumber,t[16]=d,t[17]=m,t[18]=h,t[19]=g,t[20]=_,t[21]=v,t[22]=y,t[23]=b,t[24]=x,t[25]=S,t[26]=C,t[27]=w,t[28]=T,t[29]=E,t[30]=D,t[31]=O,t[32]=k,t[33]=A,t[34]=j,t[35]=M,t[36]=N,t[37]=P,t[38]=F,t[39]=I,t[40]=L,t[41]=R,t[42]=z,t[43]=B,t[44]=V,t[45]=H,t[46]=U,t[47]=W}else m=t[17],h=t[18],g=t[19],_=t[20],v=t[21],y=t[22],b=t[23],x=t[24],S=t[25],C=t[26],w=t[27],T=t[28],E=t[29],D=t[30],O=t[31],k=t[32],A=t[33],j=t[34],M=t[35],N=t[36],P=t[37],F=t[38],I=t[39],L=t[40],R=t[41],z=t[42],B=t[43],V=t[44],H=t[45],U=t[46],W=t[47];let G;t[55]!==r||t[56]!==h||t[57]!==g||t[58]!==_||t[59]!==v||t[60]!==y||t[61]!==b||t[62]!==x||t[63]!==S||t[64]!==C||t[65]!==w||t[66]!==T||t[67]!==E||t[68]!==D||t[69]!==O||t[70]!==k||t[71]!==A||t[72]!==j||t[73]!==M||t[74]!==N||t[75]!==z||t[76]!==B||t[77]!==V||t[78]!==H||t[79]!==U||t[80]!==W?(G={root:z,months:B,month:V,nav:H,button_previous:U,button_next:W,month_caption:h,dropdowns:g,dropdown_root:_,dropdown:v,caption_label:y,table:b,weekdays:x,weekday:S,week:C,week_number_header:w,week_number:T,day:E,range_start:D,range_middle:O,range_end:k,today:A,outside:j,disabled:M,hidden:N,...r},t[55]=r,t[56]=h,t[57]=g,t[58]=_,t[59]=v,t[60]=y,t[61]=b,t[62]=x,t[63]=S,t[64]=C,t[65]=w,t[66]=T,t[67]=E,t[68]=D,t[69]=O,t[70]=k,t[71]=A,t[72]=j,t[73]=M,t[74]=N,t[75]=z,t[76]=B,t[77]=V,t[78]=H,t[79]=U,t[80]=W,t[81]=G):G=t[81];let ee;t[82]===o?ee=t[83]:(ee=e=>{let{...t}=e;return(0,Z.jsx)(xA,{locale:o,...t})},t[82]=o,t[83]=ee);let te;t[84]!==i||t[85]!==ee?(te={Root:bA,Chevron:yA,DayButton:ee,WeekNumber:vA,...i},t[84]=i,t[85]=ee,t[86]=te):te=t[86];let ne;return t[87]!==m||t[88]!==s||t[89]!==P||t[90]!==F||t[91]!==I||t[92]!==L||t[93]!==R||t[94]!==G||t[95]!==te?(ne=(0,Z.jsx)(m,{showOutsideDays:P,className:F,captionLayout:I,locale:L,formatters:R,classNames:G,components:te,...s}),t[87]=m,t[88]=s,t[89]=P,t[90]=F,t[91]=I,t[92]=L,t[93]=R,t[94]=G,t[95]=te,t[96]=ne):ne=t[96],ne}function vA(e){let{children:t,...n}=e;return(0,Z.jsx)(`td`,{...n,children:(0,Z.jsx)(`div`,{className:`flex size-(--cell-size) items-center justify-center text-center`,children:t})})}function yA(e){let{className:t,orientation:n,...r}=e;return n===`left`?(0,Z.jsx)(Sa,{className:J(`size-4`,t),...r}):n===`right`?(0,Z.jsx)(An,{className:J(`size-4`,t),...r}):(0,Z.jsx)(Mn,{className:J(`size-4`,t),...r})}function bA(e){let{className:t,rootRef:n,...r}=e;return(0,Z.jsx)(`div`,{"data-slot":`calendar`,ref:n,className:J(t),...r})}function xA(e){let t=(0,$.c)(21),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,day:r,modifiers:a,locale:i,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=$O(),c=Q.useRef(null),l,u;t[6]===a.focused?(l=t[7],u=t[8]):(l=()=>{a.focused&&c.current?.focus()},u=[a.focused],t[6]=a.focused,t[7]=l,t[8]=u),Q.useEffect(l,u);let d=Y,f;t[9]!==r.date||t[10]!==i?.code?(f=r.date.toLocaleDateString(i?.code),t[9]=r.date,t[10]=i?.code,t[11]=f):f=t[11];let p=a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,m=a.range_start,h=a.range_end,g=a.range_middle,_=J(`relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70`,s.day,n),v;return t[12]!==d||t[13]!==a.range_end||t[14]!==a.range_middle||t[15]!==a.range_start||t[16]!==o||t[17]!==_||t[18]!==f||t[19]!==p?(v=(0,Z.jsx)(d,{ref:c,variant:`ghost`,size:`icon`,"data-day":f,"data-selected-single":p,"data-range-start":m,"data-range-end":h,"data-range-middle":g,className:_,...o}),t[12]=d,t[13]=a.range_end,t[14]=a.range_middle,t[15]=a.range_start,t[16]=o,t[17]=_,t[18]=f,t[19]=p,t[20]=v):v=t[20],v}function SA(e){let t=(0,$.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`peer relative flex size-4 shrink-0 items-center justify-center rounded-[4px] border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(ts,{"data-slot":`checkbox-indicator`,className:`grid place-content-center text-current transition-none [&>svg]:size-3.5`,children:(0,Z.jsx)(_n,{})}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,Z.jsx)($o,{"data-slot":`checkbox`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function CA(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Tl,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function wA(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(El,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function TA(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,align:i,sideOffset:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`start`:i,s=a===void 0?4:a,c;t[5]===n?c=t[6]:(c=J(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:overflow-hidden data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[5]=n,t[6]=c);let l;return t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,Z.jsx)(Dl,{children:(0,Z.jsx)(Ol,{"data-slot":`dropdown-menu-content`,sideOffset:s,align:o,className:c,...r})}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function EA(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=J(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Z.jsx)(Al,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function DA(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(jl,{"data-slot":`dropdown-menu-radio-group`,...n}),t[2]=n,t[3]=r),r}function OA(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,inset:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=J(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,Z.jsx)(Nl,{children:(0,Z.jsx)(_n,{})})}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Z.jsxs)(Ml,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:o,...a,children:[s,n]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function kA(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=J(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(kl,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function AA(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Pl,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function jA(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Fl,{"data-slot":`dropdown-menu-sub`,...n}),t[2]=n,t[3]=r),r}function MA(e){let t=(0,$.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=J(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(An,{className:`ml-auto`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Z.jsxs)(Il,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":i,className:o,...a,children:[n,s]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function NA(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`z-50 min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Ll,{"data-slot":`dropdown-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function PA(e){let t=(0,$.c)(16),{keyName:n,value:r,onCommit:i}=e,[a,o]=(0,Q.useState)(r),s=(0,Q.useRef)(!1),c=(0,Q.useRef)(!1),l,u;t[0]===r?(l=t[1],u=t[2]):(l=()=>{s.current||o(r)},u=[r],t[0]=r,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d=`${n} value`,f,p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>o(e.target.value),p=()=>{s.current=!0},t[3]=f,t[4]=p):(f=t[3],p=t[4]);let m,h;t[5]!==a||t[6]!==i||t[7]!==r?(m=()=>{if(s.current=!1,c.current){c.current=!1;return}a!==r&&i(a)},h=e=>{e.key===`Enter`&&!e.shiftKey&&!e.metaKey&&!e.ctrlKey?(e.preventDefault(),a!==r&&i(a),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),c.current=!0,o(r),e.currentTarget.blur())},t[5]=a,t[6]=i,t[7]=r,t[8]=m,t[9]=h):(m=t[8],h=t[9]);let g;return t[10]!==a||t[11]!==n||t[12]!==d||t[13]!==m||t[14]!==h?(g=(0,Z.jsx)(`textarea`,{"data-testid":`text-widget`,"data-key":n,rows:1,value:a,placeholder:`Empty`,"aria-label":d,onChange:f,onFocus:p,onBlur:m,onKeyDown:h,className:`block w-full min-h-7 resize-none field-sizing-content border-transparent bg-transparent px-2 py-1 text-sm leading-tight shadow-none placeholder:text-muted-foreground/60 focus-visible:border-transparent focus-visible:bg-muted focus-visible:outline-none focus-visible:ring-0 rounded-sm dark:bg-transparent dark:focus-visible:bg-muted`}),t[10]=a,t[11]=n,t[12]=d,t[13]=m,t[14]=h,t[15]=g):g=t[15],g}function FA(e){let t=(0,$.c)(17),{keyName:n,value:r,onCommit:i}=e,[a,o]=(0,Q.useState)(String(r)),s=(0,Q.useRef)(!1),c=(0,Q.useRef)(!1),l,u;t[0]===r?(l=t[1],u=t[2]):(l=()=>{s.current||o(String(r))},u=[r],t[0]=r,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d=`${n} value`,f,p;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(f=e=>o(e.target.value),p=()=>{s.current=!0},t[3]=f,t[4]=p):(f=t[3],p=t[4]);let m;t[5]!==a||t[6]!==i||t[7]!==r?(m=()=>{if(s.current=!1,c.current){c.current=!1,o(String(r));return}let e=Number.parseFloat(a),t=Number.isFinite(e)?e:0;t===r?o(String(r)):i(t)},t[5]=a,t[6]=i,t[7]=r,t[8]=m):m=t[8];let h;t[9]===r?h=t[10]:(h=e=>{e.key===`Enter`?(e.preventDefault(),e.currentTarget.blur()):e.key===`Escape`&&(e.preventDefault(),c.current=!0,o(String(r)),e.currentTarget.blur())},t[9]=r,t[10]=h);let g;return t[11]!==a||t[12]!==n||t[13]!==d||t[14]!==m||t[15]!==h?(g=(0,Z.jsx)(Jn,{"data-testid":`number-widget`,"data-key":n,type:`number`,value:a,"aria-label":d,onChange:f,onFocus:p,onBlur:m,onKeyDown:h,className:`h-7 border-transparent bg-transparent dark:bg-transparent px-2 text-sm shadow-none focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm dark:focus-visible:bg-muted`}),t[11]=a,t[12]=n,t[13]=d,t[14]=m,t[15]=h,t[16]=g):g=t[16],g}function IA(e){let t=(0,$.c)(7),{keyName:n,value:r,onCommit:i}=e,a;t[0]===i?a=t[1]:(a=e=>i(e===!0),t[0]=i,t[1]=a);let o=`${n} value`,s;return t[2]!==n||t[3]!==a||t[4]!==o||t[5]!==r?(s=(0,Z.jsx)(`div`,{className:`flex h-7 items-center px-2`,children:(0,Z.jsx)(SA,{"data-testid":`boolean-widget`,"data-key":n,checked:r,onCheckedChange:a,"aria-label":o,className:`size-5 rounded-full`})}),t[2]=n,t[3]=a,t[4]=o,t[5]=r,t[6]=s):s=t[6],s}function LA(e){let t=(0,$.c)(42),{keyName:n,value:r,onCommit:i}=e,a,o,s;t[0]===r?(a=t[1],o=t[2],s=t[3]):(a=zA(r),o=Q.useState,s=BA(a),t[0]=r,t[1]=a,t[2]=o,t[3]=s);let[c,l]=o(s),[u,d]=(0,Q.useState)(a),[f,p]=(0,Q.useState)(!1),m=(0,Q.useRef)(!1),h=(0,Q.useRef)(!1),g,_;t[4]===r?(g=t[5],_=t[6]):(g=()=>{if(!m.current){let e=zA(r);l(BA(e)),d(e)}},_=[r],t[4]=r,t[5]=g,t[6]=_),(0,Q.useEffect)(g,_);let v;t[7]!==a||t[8]!==c||t[9]!==i||t[10]!==r?(v=function(){let e=HA(c);if(e){let t=XT(e,`yyyy-MM-dd`);t!==r&&i(t),l(BA(e)),d(e)}else l(BA(a)),d(a)},t[7]=a,t[8]=c,t[9]=i,t[10]=r,t[11]=v):v=t[11];let y=v,b;t[12]!==i||t[13]!==r?(b=function(e){if(!e)return;let t=XT(e,`yyyy-MM-dd`);t!==r&&i(t),l(BA(e)),d(e),p(!1)},t[12]=i,t[13]=r,t[14]=b):b=t[14];let x=b,S=`${n} value`,C,w;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{l(e.target.value);let t=HA(e.target.value);t&&d(t)},w=()=>{m.current=!0},t[15]=C,t[16]=w):(C=t[15],w=t[16]);let T;t[17]===y?T=t[18]:(T=()=>{if(m.current=!1,h.current){h.current=!1;return}y()},t[17]=y,t[18]=T);let E;t[19]!==y||t[20]!==a?(E=e=>{e.key===`Enter`?(e.preventDefault(),y(),e.currentTarget.blur()):e.key===`Escape`?(e.preventDefault(),h.current=!0,l(BA(a)),e.currentTarget.blur()):e.key===`ArrowDown`&&(e.preventDefault(),p(!0))},t[19]=y,t[20]=a,t[21]=E):E=t[21];let D;t[22]!==c||t[23]!==T||t[24]!==E||t[25]!==S?(D=(0,Z.jsx)(Jn,{type:`text`,value:c,placeholder:`Empty`,"aria-label":S,onChange:C,onFocus:w,onBlur:T,onKeyDown:E,className:`h-7 border-transparent bg-transparent dark:bg-transparent pr-7 pl-2 text-sm shadow-none placeholder:text-muted-foreground/60 focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm dark:focus-visible:bg-muted`}),t[22]=c,t[23]=T,t[24]=E,t[25]=S,t[26]=D):D=t[26];let O=`Open date picker for ${n}`,k;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsx)(ba,{className:`size-3.5`}),t[27]=k):k=t[27];let A;t[28]===O?A=t[29]:(A=(0,Z.jsx)(un,{asChild:!0,children:(0,Z.jsx)(Y,{type:`button`,variant:`ghost`,size:`sm`,"aria-label":O,className:`absolute right-0 size-6 p-0 text-muted-foreground hover:bg-muted hover:text-foreground`,children:k})}),t[28]=O,t[29]=A);let j;t[30]!==a||t[31]!==x||t[32]!==u?(j=(0,Z.jsx)(cn,{className:`w-auto overflow-hidden p-0`,align:`end`,children:(0,Z.jsx)(_A,{mode:`single`,selected:a,month:u,onMonthChange:d,onSelect:x,captionLayout:`dropdown`})}),t[30]=a,t[31]=x,t[32]=u,t[33]=j):j=t[33];let M;t[34]!==f||t[35]!==A||t[36]!==j?(M=(0,Z.jsxs)(Gn,{open:f,onOpenChange:p,children:[A,j]}),t[34]=f,t[35]=A,t[36]=j,t[37]=M):M=t[37];let N;return t[38]!==n||t[39]!==D||t[40]!==M?(N=(0,Z.jsxs)(`div`,{"data-testid":`date-widget`,"data-key":n,className:`relative flex h-7 items-center`,children:[D,M]}),t[38]=n,t[39]=D,t[40]=M,t[41]=N):N=t[41],N}var RA=`MMM d, yyyy`;function zA(e){if(!e)return;let t=_D(e);return Number.isNaN(t.getTime())?void 0:t}function BA(e){return e?XT(e,RA):``}var VA=[`MMM d, yyyy`,`MMMM d, yyyy`,`yyyy-MM-dd`,`M/d/yyyy`,`MM/dd/yyyy`];function HA(e){let t=e.trim();if(!t)return;let n=new Date;for(let e of VA){let r=pD(t,e,n);if(!Number.isNaN(r.getTime()))return r}}function UA(e){let t=(0,$.c)(32),{keyName:n,value:r,onCommit:i}=e,[a,o]=(0,Q.useState)(``),s;t[0]!==i||t[1]!==r?(s=function(e){let t=e.trim();t&&(i([...r,t]),o(``))},t[0]=i,t[1]=r,t[2]=s):s=t[2];let c=s,l;t[3]!==i||t[4]!==r?(l=function(e){let t=r.slice();t.splice(e,1),i(t)},t[3]=i,t[4]=r,t[5]=l):l=t[5];let u=l,d=n===`tags`,f;if(t[6]!==d||t[7]!==u||t[8]!==r){let e;t[10]!==d||t[11]!==u?(e=(e,t)=>{let n=d&&H.test(e);return(0,Z.jsxs)(`span`,{"data-testid":`list-chip`,"data-index":t,className:J(`inline-flex items-center text-1sm gap-0.5 rounded-full py-0.5 pl-2 pr-1.5 transition-colors`,n?`bg-primary/10 font-medium text-primary has-[button[data-tag]:hover]:bg-primary/20 has-[button[data-tag]:active]:bg-primary/25`:`bg-muted `),children:[n?(0,Z.jsxs)(`button`,{type:`button`,"data-tag":e,"aria-label":`Open documents tagged #${e}`,onClick:()=>Zn(e),className:`cursor-pointer rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[`#`,e]}):(0,Z.jsx)(`span`,{children:e}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e}`,onClick:()=>u(t),className:J(`inline-flex items-center justify-center rounded-sm p-0.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,n?`text-primary opacity-70 hover:text-primary hover:opacity-100`:`text-muted-foreground hover:text-foreground`),children:(0,Z.jsx)(ri,{className:`size-3`,"aria-hidden":`true`})})]},`${t}-${e}`)},t[10]=d,t[11]=u,t[12]=e):e=t[12],f=r.map(e),t[6]=d,t[7]=u,t[8]=r,t[9]=f}else f=t[9];let p=r.length===0?`Empty`:``,m=`${n} value`,h;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(h=e=>o(e.target.value),t[13]=h):h=t[13];let g;t[14]!==c||t[15]!==a||t[16]!==u||t[17]!==r.length?(g=e=>{e.key===`Enter`?(e.preventDefault(),c(a)):e.key===`Backspace`&&a===``&&r.length>0?(e.preventDefault(),u(r.length-1)):e.key===`Escape`&&(e.preventDefault(),o(``),e.currentTarget.blur())},t[14]=c,t[15]=a,t[16]=u,t[17]=r.length,t[18]=g):g=t[18];let _;t[19]!==c||t[20]!==a?(_=()=>{a&&c(a)},t[19]=c,t[20]=a,t[21]=_):_=t[21];let v;t[22]!==a||t[23]!==p||t[24]!==m||t[25]!==g||t[26]!==_?(v=(0,Z.jsx)(`input`,{"data-testid":`list-chip-input`,type:`text`,value:a,placeholder:p,"aria-label":m,onChange:h,onKeyDown:g,onBlur:_,className:`min-w-16 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground/60`}),t[22]=a,t[23]=p,t[24]=m,t[25]=g,t[26]=_,t[27]=v):v=t[27];let y;return t[28]!==n||t[29]!==f||t[30]!==v?(y=(0,Z.jsxs)(`div`,{"data-testid":`list-widget`,"data-key":n,className:`flex min-h-7 w-full min-w-0 flex-wrap items-center gap-1 rounded-md px-2 py-1 focus-within:bg-background`,children:[f,v]}),t[28]=n,t[29]=f,t[30]=v,t[31]=y):y=t[31],y}var WA={text:Do,number:wn,boolean:yo,date:ba,list:en},GA={text:`Text`,number:`Number`,boolean:`Checkbox`,date:`Date`,list:`List`};function KA(e){let t=(0,$.c)(27),{keyName:n,type:r,onChangeType:i,disabled:a}=e,o=a===void 0?!1:a,s=WA[r];if(o){let e=`${n} type: ${GA[r]} (inherited from folder defaults; not editable here)`,i;t[0]===s?i=t[1]:(i=(0,Z.jsx)(s,{className:`size-3.5`}),t[0]=s,t[1]=i);let a;t[2]!==n||t[3]!==e||t[4]!==i||t[5]!==r?(a=(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(`span`,{tabIndex:0,className:`inline-flex`,children:(0,Z.jsx)(`button`,{type:`button`,disabled:!0,"data-testid":`type-icon-button`,"data-key":n,"data-type":r,"aria-label":e,className:`flex size-7 shrink-0 items-center justify-center rounded text-muted-foreground disabled:cursor-default`,children:i})})}),t[2]=n,t[3]=e,t[4]=i,t[5]=r,t[6]=a):a=t[6];let o;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(wi,{children:`Inherited — set a value to override.`}),t[7]=o):o=t[7];let c;return t[8]===a?c=t[9]:(c=(0,Z.jsxs)(Ei,{children:[a,o]}),t[8]=a,t[9]=c),c}let c=`${n} type: ${GA[r]}. Click to change.`,l;t[10]===s?l=t[11]:(l=(0,Z.jsx)(s,{className:`size-3.5`}),t[10]=s,t[11]=l);let u;t[12]!==n||t[13]!==c||t[14]!==l||t[15]!==r?(u=(0,Z.jsx)(wA,{"data-testid":`type-icon-button`,"data-key":n,"data-type":r,"aria-label":c,className:`flex size-7 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:l}),t[12]=n,t[13]=c,t[14]=l,t[15]=r,t[16]=u):u=t[16];let d;t[17]===i?d=t[18]:(d=e=>i(e),t[17]=i,t[18]=d);let f;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(f=Object.keys(WA),t[19]=f):f=t[19];let p;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(p=f.map(qA),t[20]=p):p=t[20];let m;t[21]!==d||t[22]!==r?(m=(0,Z.jsx)(TA,{align:`start`,"data-testid":`type-picker-menu`,children:(0,Z.jsx)(DA,{value:r,onValueChange:d,children:p})}),t[21]=d,t[22]=r,t[23]=m):m=t[23];let h;return t[24]!==u||t[25]!==m?(h=(0,Z.jsxs)(CA,{children:[u,m]}),t[24]=u,t[25]=m,t[26]=h):h=t[26],h}function qA(e){let t=WA[e];return(0,Z.jsxs)(OA,{value:e,"data-testid":`type-picker-item`,"data-type":e,children:[(0,Z.jsx)(t,{className:`size-3.5 text-muted-foreground`}),(0,Z.jsx)(`span`,{children:GA[e]})]},e)}function JA(e,t){switch(t){case`text`:return Array.isArray(e)?e.join(`, `):String(e);case`number`:{if(typeof e==`number`)return e;let t=Array.isArray(e)?e[0]:String(e),n=Number.parseFloat(t??``);return Number.isFinite(n)?n:0}case`boolean`:return typeof e==`boolean`?e:typeof e==`number`?e!==0:((Array.isArray(e)?e[0]:String(e))??``).toLowerCase()===`true`;case`date`:return typeof e==`string`&&/^\d{4}-\d{2}-\d{2}$/.test(e)?e:new Date().toISOString().slice(0,10);case`list`:{if(Array.isArray(e))return e;let t=String(e);return t?[t]:[]}}}function YA(e,t){return Array.isArray(e)?`list`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:t===`list`?`text`:t}function XA(e){let t=(0,$.c)(21),{keyName:n,value:r,declared:i,error:a,resetCounter:o,sortableId:s,rename:c,isDuplicate:l,badge:u,isInherited:d,onCommit:f,onChangeType:p,onRemove:m}=e,h=o===void 0?0:o,g=l===void 0?!1:l,_=d===void 0?!1:d,v;t[0]!==u||t[1]!==i||t[2]!==a||t[3]!==g||t[4]!==_||t[5]!==n||t[6]!==p||t[7]!==f||t[8]!==m||t[9]!==c||t[10]!==h||t[11]!==r?(v=e=>(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`flex items-start gap-1`,children:[e,(0,Z.jsxs)(`div`,{className:`flex items-center gap-1${_?` opacity-60`:``}`,"data-testid":`property-row-identity`,children:[(0,Z.jsx)(KA,{keyName:n,type:i,onChangeType:p,disabled:_}),(0,Z.jsx)(`div`,{className:`w-32 shrink-0`,children:c?.state?(0,Z.jsx)($A,{keyName:n,draft:c.state.draft,error:c.state.error,onChangeDraft:c.onChangeDraft,onCommit:c.onCommit,onCancel:c.onCancel}):(0,Z.jsx)(ej,{keyName:n,onBegin:c?.onBegin,disabled:!c,isInherited:_})})]}),g?(0,Z.jsx)(`span`,{"data-testid":`property-duplicate-marker`,"data-key":n,title:`Duplicate name "${n}"`,className:`flex size-4 items-center justify-center text-amber-600`,children:(0,Z.jsx)(Oe,{className:`size-3.5`})}):null,(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:_&&i===`list`?(0,Z.jsx)(ij,{keyName:n,value:Array.isArray(r)?r:[]}):(0,Z.jsx)(nj,{keyName:n,value:r,widgetType:i,onCommit:f},`widget-${h}`)}),u?(0,Z.jsx)(`div`,{className:`shrink-0 min-h-7 flex items-center`,children:u}):null,m?(0,Z.jsx)(Y,{type:`button`,"data-testid":`property-remove-button`,"data-key":n,"aria-label":`Remove ${n}`,onClick:m,variant:`ghost`,size:`icon-sm`,className:`flex shrink-0 items-center justify-center rounded text-muted-foreground/0 hover:bg-muted hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-hover:text-muted-foreground`,children:(0,Z.jsx)(Kn,{className:`size-3.5`})}):null]}),a?(0,Z.jsx)(`div`,{role:`alert`,"data-testid":`property-error`,"data-key":n,className:`pl-9 text-[10px] text-destructive`,children:a}):null]}),t[0]=u,t[1]=i,t[2]=a,t[3]=g,t[4]=_,t[5]=n,t[6]=p,t[7]=f,t[8]=m,t[9]=c,t[10]=h,t[11]=r,t[12]=v):v=t[12];let y;return t[13]!==i||t[14]!==a||t[15]!==g||t[16]!==_||t[17]!==n||t[18]!==s||t[19]!==v?(y=(0,Z.jsx)(ZA,{sortableId:s,keyName:n,declared:i,error:a,isDuplicate:g,isInherited:_,children:v}),t[13]=i,t[14]=a,t[15]=g,t[16]=_,t[17]=n,t[18]=s,t[19]=v,t[20]=y):y=t[20],y}function ZA(e){let t=(0,$.c)(19),{sortableId:n,keyName:r,declared:i,error:a,isDuplicate:o,isInherited:s,children:c}=e;if(n){let e;return t[0]!==c||t[1]!==i||t[2]!==a||t[3]!==o||t[4]!==r||t[5]!==n?(e=(0,Z.jsx)(QA,{sortableId:n,keyName:r,declared:i,error:a,isDuplicate:o,children:c}),t[0]=c,t[1]=i,t[2]=a,t[3]=o,t[4]=r,t[5]=n,t[6]=e):e=t[6],e}let l;t[7]===s?l=t[8]:(l=s?(0,Z.jsx)(`span`,{"aria-hidden":!0,className:`h-7 w-4 shrink-0`}):null,t[7]=s,t[8]=l);let u=l,d=a??void 0,f=o||void 0,p=s||void 0,m;t[9]!==c||t[10]!==u?(m=c(u),t[9]=c,t[10]=u,t[11]=m):m=t[11];let h;return t[12]!==i||t[13]!==r||t[14]!==d||t[15]!==f||t[16]!==p||t[17]!==m?(h=(0,Z.jsx)(`div`,{className:`group py-0.5`,"data-testid":`property-row`,"data-key":r,"data-widget-type":i,"data-error":d,"data-duplicate":f,"data-inherited":p,children:m}),t[12]=i,t[13]=r,t[14]=d,t[15]=f,t[16]=p,t[17]=m,t[18]=h):h=t[18],h}function QA(e){let t=(0,$.c)(27),{sortableId:n,keyName:r,declared:i,error:a,isDuplicate:o,children:s}=e,c;t[0]===n?c=t[1]:(c={id:n},t[0]=n,t[1]=c);let{attributes:l,listeners:u,setNodeRef:d,transform:f,transition:p,isDragging:m}=vw(c),h;t[2]===f?h=t[3]:(h=kx.Transform.toString(f),t[2]=f,t[3]=h);let g=m?.5:void 0,_=m?1:void 0,v;t[4]!==h||t[5]!==g||t[6]!==_||t[7]!==p?(v={transform:h,transition:p,opacity:g,zIndex:_},t[4]=h,t[5]=g,t[6]=_,t[7]=p,t[8]=v):v=t[8];let y=v,b=`Drag ${r} to reorder`,x;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(Wa,{className:`size-3.5`}),t[9]=x):x=t[9];let S;t[10]!==l||t[11]!==r||t[12]!==u||t[13]!==b?(S=(0,Z.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`property-drag-handle`,"data-key":r,"aria-label":b,...l,...u,className:`h-7 w-4 shrink-0 cursor-grab touch-none px-0 text-muted-foreground/0 hover:text-foreground focus-visible:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing group-hover:text-muted-foreground/60`,children:x}),t[10]=l,t[11]=r,t[12]=u,t[13]=b,t[14]=S):S=t[14];let C=S,w=a??void 0,T=o||void 0,E=m||void 0,D;t[15]!==s||t[16]!==C?(D=s(C),t[15]=s,t[16]=C,t[17]=D):D=t[17];let O;return t[18]!==i||t[19]!==r||t[20]!==d||t[21]!==y||t[22]!==T||t[23]!==E||t[24]!==D||t[25]!==w?(O=(0,Z.jsx)(`div`,{ref:d,style:y,className:`group py-0.5`,"data-testid":`property-row`,"data-key":r,"data-widget-type":i,"data-error":w,"data-duplicate":T,"data-dragging":E,children:D}),t[18]=i,t[19]=r,t[20]=d,t[21]=y,t[22]=T,t[23]=E,t[24]=D,t[25]=w,t[26]=O):O=t[26],O}function $A(e){let t=(0,$.c)(20),{keyName:n,draft:r,error:i,onChangeDraft:a,onCommit:o,onCancel:s}=e,c=i?`property-rename-error-${n}`:void 0,l=`Rename ${n}`,u=i?!0:void 0,d;t[0]===a?d=t[1]:(d=e=>a(e.target.value),t[0]=a,t[1]=d);let f;t[2]!==s||t[3]!==o?(f=e=>{e.key===`Enter`?(e.preventDefault(),o()):e.key===`Escape`&&(e.preventDefault(),s())},t[2]=s,t[3]=o,t[4]=f):f=t[4];let p;t[5]!==r||t[6]!==c||t[7]!==n||t[8]!==o||t[9]!==l||t[10]!==u||t[11]!==d||t[12]!==f?(p=(0,Z.jsx)(Jn,{"data-testid":`property-name-rename-input`,"data-key":n,type:`text`,value:r,autoFocus:!0,"aria-label":l,"aria-invalid":u,"aria-describedby":c,onChange:d,onBlur:o,onKeyDown:f,className:`h-7 border-transparent bg-transparent dark:bg-transparent px-2 text-sm shadow-none focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm dark:focus-visible:bg-muted`}),t[5]=r,t[6]=c,t[7]=n,t[8]=o,t[9]=l,t[10]=u,t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;t[14]!==i||t[15]!==c?(m=i?(0,Z.jsx)(`div`,{id:c,"data-testid":`property-name-rename-error`,className:`text-[10px] text-destructive`,children:i}):null,t[14]=i,t[15]=c,t[16]=m):m=t[16];let h;return t[17]!==p||t[18]!==m?(h=(0,Z.jsxs)(`div`,{children:[p,m]}),t[17]=p,t[18]=m,t[19]=h):h=t[19],h}function ej(e){let t=(0,$.c)(9),{keyName:n,onBegin:r,disabled:i,isInherited:a}=e,o;t[0]!==i||t[1]!==n||t[2]!==r?(o=(0,Z.jsx)(Y,{type:`button`,variant:`ghost`,"data-testid":`property-name-button`,"data-key":n,onClick:r,disabled:i,className:`block h-7 w-full truncate px-2 py-0.5 text-left text-sm rounded-sm font-normal text-muted-foreground hover:bg-transparent hover:text-foreground disabled:opacity-100 disabled:cursor-default`,children:n}),t[0]=i,t[1]=n,t[2]=r,t[3]=o):o=t[3];let s=o;if(!a)return s;let c;t[4]===s?c=t[5]:(c=(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(`span`,{tabIndex:0,className:`block w-full`,children:s})}),t[4]=s,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(wi,{children:`Inherited — set a value to override.`}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,Z.jsxs)(Ei,{children:[c,l]}),t[7]=c,t[8]=u),u}function tj(e){let t=(0,$.c)(35),{draft:n,onChangeName:r,onChangeType:i,onChangeValue:a,onCommit:o,onCancel:s}=e,c=n.error?`add-property-error-id`:void 0,l;t[0]!==n.type||t[1]!==i?(l=(0,Z.jsx)(KA,{keyName:`__add__`,type:n.type,onChangeType:i}),t[0]=n.type,t[1]=i,t[2]=l):l=t[2];let u=n.error?!0:void 0,d;t[3]===r?d=t[4]:(d=e=>r(e.target.value),t[3]=r,t[4]=d);let f;t[5]!==s||t[6]!==o?(f=e=>{e.key===`Enter`?(e.preventDefault(),o()):e.key===`Escape`&&(e.preventDefault(),s())},t[5]=s,t[6]=o,t[7]=f):f=t[7];let p;t[8]!==n.name||t[9]!==c||t[10]!==u||t[11]!==d||t[12]!==f?(p=(0,Z.jsx)(Jn,{"data-testid":`add-property-name-input`,type:`text`,value:n.name,autoFocus:!0,placeholder:`Property name`,"aria-label":`New property name`,"aria-invalid":u,"aria-describedby":c,onChange:d,onKeyDown:f,className:`h-7 w-32 border-transparent bg-transparent px-2 text-sm shadow-none placeholder:text-muted-foreground/60 focus-visible:border-transparent focus-visible:bg-muted focus-visible:ring-0 rounded-sm`}),t[8]=n.name,t[9]=c,t[10]=u,t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;t[14]!==n.type||t[15]!==n.value||t[16]!==a?(m=(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,Z.jsx)(nj,{keyName:`__add__`,value:n.value,widgetType:n.type,onCommit:a})}),t[14]=n.type,t[15]=n.value,t[16]=a,t[17]=m):m=t[17];let h;t[18]===o?h=t[19]:(h=(0,Z.jsx)(Y,{type:`button`,"data-testid":`add-property-commit`,onClick:o,size:`sm`,className:`rounded bg-primary text-xs text-primary-foreground hover:bg-primary/90`,children:`Add`}),t[18]=o,t[19]=h);let g;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(ri,{className:`size-3.5`}),t[20]=g):g=t[20];let _;t[21]===s?_=t[22]:(_=(0,Z.jsx)(Y,{type:`button`,variant:`ghost`,size:`icon-sm`,"data-testid":`add-property-cancel`,onClick:s,"aria-label":`Cancel`,className:`rounded px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground`,children:g}),t[21]=s,t[22]=_);let v;t[23]!==l||t[24]!==p||t[25]!==m||t[26]!==h||t[27]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex items-start gap-1`,children:[l,p,m,h,_]}),t[23]=l,t[24]=p,t[25]=m,t[26]=h,t[27]=_,t[28]=v):v=t[28];let y;t[29]!==n.error||t[30]!==c?(y=n.error?(0,Z.jsx)(`div`,{id:c,role:`alert`,"data-testid":`add-property-error`,className:`mt-0.5 pl-7 text-[10px] text-destructive`,children:n.error}):null,t[29]=n.error,t[30]=c,t[31]=y):y=t[31];let b;return t[32]!==v||t[33]!==y?(b=(0,Z.jsxs)(`div`,{className:`mt-1 rounded border border-dashed bg-background/40 p-1`,"data-testid":`add-property-row`,children:[v,y]}),t[32]=v,t[33]=y,t[34]=b):b=t[34],b}function nj(e){let t=(0,$.c)(24),{keyName:n,value:r,widgetType:i,onCommit:a}=e;if(i===`list`){let e;t[0]===r?e=t[1]:(e=Array.isArray(r)?r:[],t[0]=r,t[1]=e);let i=e,o;return t[2]!==i||t[3]!==n||t[4]!==a?(o=(0,Z.jsx)(UA,{keyName:n,value:i,onCommit:a}),t[2]=i,t[3]=n,t[4]=a,t[5]=o):o=t[5],o}if(i===`boolean`){let e=typeof r==`boolean`?r:!1,i;return t[6]!==e||t[7]!==n||t[8]!==a?(i=(0,Z.jsx)(IA,{keyName:n,value:e,onCommit:a}),t[6]=e,t[7]=n,t[8]=a,t[9]=i):i=t[9],i}if(i===`number`){let e=typeof r==`number`?r:0,i;return t[10]!==n||t[11]!==e||t[12]!==a?(i=(0,Z.jsx)(FA,{keyName:n,value:e,onCommit:a}),t[10]=n,t[11]=e,t[12]=a,t[13]=i):i=t[13],i}if(i===`date`){let e=typeof r==`string`?r:``,i;return t[14]!==n||t[15]!==a||t[16]!==e?(i=(0,Z.jsx)(LA,{keyName:n,value:e,onCommit:a}),t[14]=n,t[15]=a,t[16]=e,t[17]=i):i=t[17],i}let o;t[18]===r?o=t[19]:(o=typeof r==`string`?r:Array.isArray(r)?r.join(`, `):String(r),t[18]=r,t[19]=o);let s=o,c;return t[20]!==n||t[21]!==a||t[22]!==s?(c=(0,Z.jsx)(PA,{keyName:n,value:s,onCommit:a}),t[20]=n,t[21]=a,t[22]=s,t[23]=c):c=t[23],c}function rj(e){let t=(0,$.c)(2),{source:n}=e,r=`Inherited from ${n===``?`.ok/frontmatter.yml`:`${n}/.ok/frontmatter.yml`}`,i;return t[0]===r?i=t[1]:(i=(0,Z.jsx)(pn,{variant:`gray`,"data-testid":`property-inherited-badge`,title:r,className:`text-2xs`,children:`inherited`}),t[0]=r,t[1]=i),i}function ij(e){let t=(0,$.c)(5),{keyName:n,value:r}=e,i;t[0]===r?i=t[1]:(i=r.length===0?(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground/60`,children:`Empty`}):r.map(aj),t[0]=r,t[1]=i);let a;return t[2]!==n||t[3]!==i?(a=(0,Z.jsx)(`div`,{"data-testid":`list-widget-readonly`,"data-key":n,className:`flex min-h-7 w-full min-w-0 flex-wrap items-center gap-1 rounded-md px-2`,children:i}),t[2]=n,t[3]=i,t[4]=a):a=t[4],a}function aj(e,t){return(0,Z.jsx)(`span`,{"data-testid":`list-chip-readonly`,"data-index":t,className:`inline-flex items-center text-1sm rounded-full bg-muted py-0.5 px-2`,children:String(e)},`${t}-${String(e)}`)}function oj(e,t){let n=e?.error;return typeof n==`string`?n:n&&typeof n==`object`?n.message:`HTTP ${t}`}async function sj(e,t){try{let n=await fetch(`/api/folder-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e,frontmatter:t})}),r=await n.json().catch(()=>null);return!n.ok||!r?.ok?{ok:!1,error:oj(r,n.status)}:{ok:!0}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function cj(e){try{let t=await fetch(`/api/template`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)}),n=await t.json().catch(()=>null);return!t.ok||!n?.ok?{ok:!1,error:oj(n,t.status)}:{ok:!0,created:n.created??!1,warnings:n.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function lj(e,t){try{let n=`?folder=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`,r=await fetch(`/api/template${n}`,{method:`DELETE`}),i=await r.json().catch(()=>null);return!r.ok||!i?.ok?{ok:!1,error:oj(i,r.status)}:{ok:!0,existed:i.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}function uj(e){return e===``?`.ok/frontmatter.yml`:`${e}/.ok/frontmatter.yml`}function dj(e,t){return e===``?`.ok/templates/${t}.md`:`${e}/.ok/templates/${t}.md`}var fj={text:``,number:0,boolean:!1,date:``,list:[]};function pj(e){let t=(0,$.c)(74),{folderPath:n,state:r,onChange:i}=e,[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(null);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card p-4 space-y-3`,children:[(0,Z.jsx)(hj,{}),(0,Z.jsx)(Br,{className:`h-7 w-full`}),(0,Z.jsx)(Br,{className:`h-7 w-full`}),(0,Z.jsx)(Br,{className:`h-7 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let e;return t[1]===r.message?e=t[2]:(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:[`Failed to load folder defaults: `,r.message]}),t[1]=r.message,t[2]=e),e}let d;t[3]===r.data.folder.frontmatter_defaults?d=t[4]:(d=r.data.folder.frontmatter_defaults??{},t[3]=r.data.folder.frontmatter_defaults,t[4]=d);let f=d,p;t[5]===r.data.frontmatterLocal?p=t[6]:(p=r.data.frontmatterLocal??{},t[5]=r.data.frontmatterLocal,t[6]=p);let m=p,h=r.data.frontmatterSources,g;t[7]===r.data.folder.path?g=t[8]:(g=uj(r.data.folder.path),t[7]=r.data.folder.path,t[8]=g);let _=g,v,y,b,x,S,C,w,T,E,D,O,k,A;if(t[9]!==s||t[10]!==a||t[11]!==_||t[12]!==n||t[13]!==m||t[14]!==f||t[15]!==i||t[16]!==l||t[17]!==h){let e=Object.keys(f),r=async function(e,t){let r=await sj(n,{[e]:t});if(!r.ok){X.error(`Save failed: ${r.error}`);return}i()},d=async function(e){let t=await sj(n,{[e]:null});if(!t.ok){X.error(`Remove failed: ${t.error}`);return}i()},p=function(e,t){let n=f[e];r(e,JA(n,t))},g;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(g=function(){c({name:``,type:`text`,value:``,error:null}),o(!1)},t[31]=g):g=t[31],b=g;let j;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(e){c(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):fj[e];return{...t,type:e,value:n,error:null}})},t[32]=j):j=t[32],S=j;let M;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(M=function(e){c(t=>t&&{...t,value:e})},t[33]=M):M=t[33],C=M;let N;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(N=function(e){c(t=>t&&{...t,name:e,error:null})},t[34]=N):N=t[34],x=N;let P;t[35]!==s||t[36]!==n||t[37]!==f||t[38]!==i?(P=async function(){if(!s)return;let e=s.name.trim();if(!e){c({...s,error:`Name is required`});return}if(Object.hasOwn(f,e)){c({...s,error:`Key "${e}" already resolves here`});return}let t=await sj(n,{[e]:s.value});if(!t.ok){c({...s,error:t.error});return}c(null),i()},t[35]=s,t[36]=n,t[37]=f,t[38]=i,t[39]=P):P=t[39],w=P;let F=function(e){u({key:e,draft:e,error:null})},I=function(e){u(t=>t&&{...t,draft:e,error:null})},L=async function(){if(!l)return;let e=l.draft.trim();if(!e){u({...l,error:`Name is required`});return}if(e===l.key){u(null);return}if(Object.hasOwn(f,e)){u({...l,error:`Key "${e}" already resolves here`});return}let t=f[l.key],r=await sj(n,{[l.key]:null,[e]:t});if(!r.ok){u({...l,error:r.error});return}u(null),i()},R=function(){u(null)};A=`rounded-lg border bg-card`,y=fn,D=!a,t[40]===Symbol.for(`react.memo_cache_sentinel`)?(O=e=>o(!e),t[40]=O):O=t[40];let z=`size-3 transition-transform ${a?``:`rotate-90`}`,B;t[41]===z?B=t[42]:(B=(0,Z.jsx)(An,{className:z,"aria-hidden":!0}),t[41]=z,t[42]=B);let V;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(`span`,{children:`Folder defaults`}),t[43]=V):V=t[43];let H;t[44]===B?H=t[45]:(H=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:[B,V]}),t[44]=B,t[45]=H);let U;t[46]===_?U=t[47]:(U=(0,Z.jsx)(`code`,{className:`text-xs text-muted-foreground font-mono cursor-text select-text`,onClick:mj,children:_}),t[46]=_,t[47]=U),t[48]!==H||t[49]!==U?(k=(0,Z.jsxs)(Rt,{className:`flex w-full cursor-pointer items-center justify-between gap-2 px-3 py-2.5 data-[state=open]:border-b border-border`,children:[H,U]}),t[48]=H,t[49]=U,t[50]=k):k=t[50],v=qn,T=`px-2 py-2`,E=e.length===0&&!s?(0,Z.jsx)(`p`,{className:`px-1 py-1 text-sm text-muted-foreground`,children:`No defaults declared. Add a property to set a value every doc in this folder inherits.`}):e.map(e=>{let t=f[e],n=Object.hasOwn(m,e);return(0,Z.jsx)(XA,{keyName:e,value:t,declared:YA(t,le(t)),rename:n?{state:l?.key===e?l:null,onBegin:()=>F(e),onChangeDraft:I,onCommit:L,onCancel:R}:void 0,badge:n?null:(0,Z.jsx)(rj,{source:h[e]??``}),isInherited:!n,onCommit:t=>void r(e,t),onChangeType:t=>p(e,t),onRemove:n?()=>void d(e):void 0},e)}),t[9]=s,t[10]=a,t[11]=_,t[12]=n,t[13]=m,t[14]=f,t[15]=i,t[16]=l,t[17]=h,t[18]=v,t[19]=y,t[20]=b,t[21]=x,t[22]=S,t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=D,t[28]=O,t[29]=k,t[30]=A}else v=t[18],y=t[19],b=t[20],x=t[21],S=t[22],C=t[23],w=t[24],T=t[25],E=t[26],D=t[27],O=t[28],k=t[29],A=t[30];let j;t[51]!==s||t[52]!==b||t[53]!==x||t[54]!==S||t[55]!==C||t[56]!==w?(j=s?(0,Z.jsx)(tj,{draft:s,onChangeName:x,onChangeType:S,onChangeValue:C,onCommit:()=>void w(),onCancel:()=>c(null)}):(0,Z.jsxs)(Y,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:b,className:`mt-1 flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(co,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:`Add property`})]}),t[51]=s,t[52]=b,t[53]=x,t[54]=S,t[55]=C,t[56]=w,t[57]=j):j=t[57];let M;t[58]!==j||t[59]!==T||t[60]!==E?(M=(0,Z.jsxs)(`div`,{className:T,children:[E,j]}),t[58]=j,t[59]=T,t[60]=E,t[61]=M):M=t[61];let N;t[62]!==v||t[63]!==M?(N=(0,Z.jsx)(v,{children:M}),t[62]=v,t[63]=M,t[64]=N):N=t[64];let P;t[65]!==y||t[66]!==N||t[67]!==D||t[68]!==O||t[69]!==k?(P=(0,Z.jsxs)(y,{open:D,onOpenChange:O,children:[k,N]}),t[65]=y,t[66]=N,t[67]=D,t[68]=O,t[69]=k,t[70]=P):P=t[70];let F;return t[71]!==P||t[72]!==A?(F=(0,Z.jsx)(`section`,{className:A,children:P}),t[71]=P,t[72]=A,t[73]=F):F=t[73],F}function mj(e){return e.stopPropagation()}function hj(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(za,{className:`size-4 text-muted-foreground`,"aria-hidden":!0}),(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:`Folder defaults`})]}),e[0]=t):t=e[0],t}function gj(e){let t=e.split(`/`).pop();return t?`${e}/${t}`:null}function _j(e,t){let n=t.get(`${e}/index`);if(n)return n;let r=gj(e);if(r){let e=t.get(r);if(e)return e}return e.split(`/`).pop()??e}function vj(e,t,n){let r=n.get(e);return r&&r!==e?r:t}function yj(e,t){let n=`${e}/`,r=[...t.folderPaths].filter(e=>e.startsWith(n)).map(e=>({path:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({path:e,rel:n})=>({kind:`folder`,path:e,name:n,title:_j(e,t.pageTitles)})),i=[...t.pages].filter(e=>e.startsWith(n)).map(e=>({docName:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({docName:e,rel:n})=>{let r=t.pageMeta.get(e);return{kind:`file`,path:e,name:n,title:vj(e,n,t.pageTitles),size:r?.size??0,modified:r?.modified??``}}),a=[...r,...i].sort((e,t)=>e.kind===t.kind?e.title.localeCompare(t.title)||e.name.localeCompare(t.name):e.kind===`folder`?-1:1);return{title:_j(e,t.pageTitles),children:a}}function bj(e){let t=(0,$.c)(22),{itemName:n,isSubmitting:r,onDelete:i,customTitle:a,customDescription:o,children:s}=e,c=n===void 0?`this item`:n,l=a??`Delete ${c}`,u;t[0]===l?u=t[1]:(u=(0,Z.jsx)(si,{children:l}),t[0]=l,t[1]=u);let d=o??`Are you sure you want to delete ${c}? This action cannot be undone.`,f;t[2]===d?f=t[3]:(f=(0,Z.jsx)(ai,{className:`whitespace-pre-wrap`,children:d}),t[2]=d,t[3]=f);let p;t[4]===s?p=t[5]:(p=s?(0,Z.jsx)(mi,{children:s}):null,t[4]=s,t[5]=p);let m;t[6]===r?m=t[7]:(m=(0,Z.jsx)(_i,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`outline`,disabled:r,children:`Cancel`})}),t[6]=r,t[7]=m);let h;t[8]===r?h=t[9]:(h=r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Jt,{className:`size-4 animate-spin`}),` Deleting...`]}):`Delete`,t[8]=r,t[9]=h);let g;t[10]!==r||t[11]!==i||t[12]!==h?(g=(0,Z.jsx)(Y,{variant:`destructive`,onClick:i,disabled:r,children:h}),t[10]=r,t[11]=i,t[12]=h,t[13]=g):g=t[13];let _;t[14]!==m||t[15]!==g?(_=(0,Z.jsxs)(hi,{children:[m,g]}),t[14]=m,t[15]=g,t[16]=_):_=t[16];let v;return t[17]!==_||t[18]!==u||t[19]!==f||t[20]!==p?(v=(0,Z.jsxs)(di,{children:[u,f,p,_]}),t[17]=_,t[18]=u,t[19]=f,t[20]=p,t[21]=v):v=t[21],v}function xj(e){let t=(0,$.c)(40),{value:n,onChange:r,onBlur:i,placeholder:a,id:o,disabled:s,"aria-describedby":c,"aria-invalid":l,ref:u}=e,d=a===void 0?`Add tag…`:a,[f,p]=(0,Q.useState)(``),m;t[0]!==r||t[1]!==n?(m=e=>{let t=e.trim();if(t){if(n.includes(t)){p(``);return}r([...n,t]),p(``)}},t[0]=r,t[1]=n,t[2]=m):m=t[2];let h=m,g;t[3]!==r||t[4]!==n?(g=e=>{r(n.filter((t,n)=>n!==e))},t[3]=r,t[4]=n,t[5]=g):g=t[5];let _=g,v=s&&`pointer-events-none opacity-60`,y;t[6]===v?y=t[7]:(y=J(`flex min-h-8 w-full flex-wrap items-center gap-1.5 rounded-lg border border-input bg-transparent px-2 py-1 text-sm transition-colors`,`focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,`aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20`,`dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,v),t[6]=v,t[7]=y);let b;if(t[8]!==s||t[9]!==_||t[10]!==n){let e;t[12]!==s||t[13]!==_?(e=(e,t)=>(0,Z.jsxs)(pn,{variant:`secondary`,className:`gap-1 pl-2 pr-1`,children:[(0,Z.jsx)(`span`,{className:`font-mono`,children:e}),(0,Z.jsx)(`button`,{type:`button`,onClick:()=>_(t),"aria-label":`Remove ${e}`,className:`rounded-sm p-0.5 hover:bg-background/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,disabled:s,children:(0,Z.jsx)(ri,{className:`size-3`,"aria-hidden":`true`})})]},e),t[12]=s,t[13]=_,t[14]=e):e=t[14],b=n.map(e),t[8]=s,t[9]=_,t[10]=n,t[11]=b}else b=t[11];let x;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>p(e.target.value),t[15]=x):x=t[15];let S;t[16]!==h||t[17]!==f||t[18]!==_||t[19]!==n.length?(S=e=>{e.key===`Enter`?f.trim()&&(e.preventDefault(),h(f)):e.key===`,`?(e.preventDefault(),f.trim()&&h(f)):e.key===`Tab`?f.trim()&&(e.preventDefault(),h(f)):e.key===`Backspace`&&f===``&&n.length>0&&(e.preventDefault(),_(n.length-1))},t[16]=h,t[17]=f,t[18]=_,t[19]=n.length,t[20]=S):S=t[20];let C;t[21]!==h||t[22]!==f||t[23]!==i?(C=()=>{f.trim()&&h(f),i?.()},t[21]=h,t[22]=f,t[23]=i,t[24]=C):C=t[24];let w=n.length===0?d:``,T;t[25]!==c||t[26]!==l||t[27]!==s||t[28]!==f||t[29]!==o||t[30]!==u||t[31]!==w||t[32]!==S||t[33]!==C?(T=(0,Z.jsx)(`input`,{id:o,ref:u,type:`text`,value:f,onChange:x,onKeyDown:S,onBlur:C,placeholder:w,"aria-describedby":c,"aria-invalid":l,disabled:s,className:`min-w-[8ch] flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed`}),t[25]=c,t[26]=l,t[27]=s,t[28]=f,t[29]=o,t[30]=u,t[31]=w,t[32]=S,t[33]=C,t[34]=T):T=t[34];let E;return t[35]!==l||t[36]!==T||t[37]!==y||t[38]!==b?(E=(0,Z.jsxs)(`div`,{"data-slot":`tag-pill-input`,"aria-invalid":l,className:y,children:[b,T]}),t[35]=l,t[36]=T,t[37]=y,t[38]=b,t[39]=E):E=t[39],E}function Sj(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`textarea`,{"data-slot":`textarea`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Cj(e){let t=(0,$.c)(49),{title:n,description:r,tags:i,onTitleChange:a,onDescriptionChange:o,onTagsChange:s,requireTitle:c,disabled:l}=e,u=c===void 0?!1:c,d=l===void 0?!1:l,f=(0,Q.useId)(),p=(0,Q.useId)(),m=(0,Q.useId)(),[h,g]=(0,Q.useState)(!1),_;t[0]!==u||t[1]!==n?(_=u&&n.trim()===``,t[0]=u,t[1]=n,t[2]=_):_=t[2];let v=_&&h,y;t[3]===u?y=t[4]:(y=u?(0,Z.jsx)(`span`,{className:`text-destructive`,children:`*`}):null,t[3]=u,t[4]=y);let b;t[5]!==y||t[6]!==f?(b=(0,Z.jsxs)(Mb,{htmlFor:f,children:[`Title`,y]}),t[5]=y,t[6]=f,t[7]=b):b=t[7];let x;t[8]===a?x=t[9]:(x=e=>a(e.target.value),t[8]=a,t[9]=x);let S;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=()=>g(!0),t[10]=S):S=t[10];let C;t[11]!==d||t[12]!==v||t[13]!==x||t[14]!==n||t[15]!==f?(C=(0,Z.jsx)(Jn,{id:f,value:n,onChange:x,onBlur:S,disabled:d,"aria-invalid":v}),t[11]=d,t[12]=v,t[13]=x,t[14]=n,t[15]=f,t[16]=C):C=t[16];let w;t[17]===v?w=t[18]:(w=v?(0,Z.jsx)(Fb,{children:`Required — title is the agent menu surface.`}):null,t[17]=v,t[18]=w);let T;t[19]!==b||t[20]!==C||t[21]!==w?(T=(0,Z.jsxs)(Ab,{children:[b,C,w]}),t[19]=b,t[20]=C,t[21]=w,t[22]=T):T=t[22];let E;t[23]===p?E=t[24]:(E=(0,Z.jsx)(Mb,{htmlFor:p,children:`Description`}),t[23]=p,t[24]=E);let D;t[25]===o?D=t[26]:(D=e=>o(e.target.value),t[25]=o,t[26]=D);let O;t[27]!==r||t[28]!==p||t[29]!==d||t[30]!==D?(O=(0,Z.jsx)(Sj,{id:p,value:r,onChange:D,disabled:d,rows:2}),t[27]=r,t[28]=p,t[29]=d,t[30]=D,t[31]=O):O=t[31];let k;t[32]!==E||t[33]!==O?(k=(0,Z.jsxs)(Ab,{children:[E,O]}),t[32]=E,t[33]=O,t[34]=k):k=t[34];let A;t[35]===m?A=t[36]:(A=(0,Z.jsx)(Mb,{htmlFor:m,children:`Tags`}),t[35]=m,t[36]=A);let j;t[37]!==d||t[38]!==s||t[39]!==i||t[40]!==m?(j=(0,Z.jsx)(xj,{id:m,value:i,onChange:s,disabled:d}),t[37]=d,t[38]=s,t[39]=i,t[40]=m,t[41]=j):j=t[41];let M;t[42]!==A||t[43]!==j?(M=(0,Z.jsxs)(Ab,{children:[A,j]}),t[42]=A,t[43]=j,t[44]=M):M=t[44];let N;return t[45]!==T||t[46]!==k||t[47]!==M?(N=(0,Z.jsxs)(Z.Fragment,{children:[T,k,M]}),t[45]=T,t[46]=k,t[47]=M,t[48]=N):N=t[48],N}function wj(e){let t={},n=e.title.trim();n&&(t.title=n);let r=e.description.trim();r&&(t.description=r);let i=e.tags.map(e=>e.trim()).filter(e=>e.length>0);return i.length>0&&(t.tags=i),t}function Tj(e){let t=(0,$.c)(17),{value:n,onChange:r,disabled:i,placeholder:a,rows:o}=e,s=i===void 0?!1:i,c=o===void 0?12:o,l=(0,Q.useId)(),u;t[0]===l?u=t[1]:(u=(0,Z.jsx)(Mb,{htmlFor:l,children:`Body`}),t[0]=l,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/70`,children:[`Allowed substitutions: `,`{{date}}`,`, `,`{{user}}`]}),t[2]=d):d=t[2];let f;t[3]===u?f=t[4]:(f=(0,Z.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[u,d]}),t[3]=u,t[4]=f);let p;t[5]===r?p=t[6]:(p=e=>r(e.target.value),t[5]=r,t[6]=p);let m;t[7]!==s||t[8]!==l||t[9]!==a||t[10]!==c||t[11]!==p||t[12]!==n?(m=(0,Z.jsx)(Sj,{id:l,value:n,onChange:p,disabled:s,rows:c,spellCheck:!1,placeholder:a,className:`font-mono text-xs leading-relaxed min-h-72`}),t[7]=s,t[8]=l,t[9]=a,t[10]=c,t[11]=p,t[12]=n,t[13]=m):m=t[13];let h;return t[14]!==f||t[15]!==m?(h=(0,Z.jsxs)(Ab,{children:[f,m]}),t[14]=f,t[15]=m,t[16]=h):h=t[16],h}var Ej=/^[A-Za-z0-9_-]+$/;function Dj(e){let t=(0,$.c)(34),{mode:n,folderPath:r,initial:i,existingNames:a,onCommitted:o}=e,[s,c]=(0,Q.useState)(i.name),[l,u]=(0,Q.useState)(i.title),[d,f]=(0,Q.useState)(i.description),[p,m]=(0,Q.useState)(i.tags),[h,g]=(0,Q.useState)(i.body),[_,v]=(0,Q.useState)(!1),y,b,x,S;if(t[0]!==a||t[1]!==n||t[2]!==s||t[3]!==l){x=s.trim();let e;t[8]===l?e=t[9]:(e=l.trim(),t[8]=l,t[9]=e),S=e,y=n===`create`&&(x===``||!Ej.test(x)),b=n===`create`&&!y&&(a?.has(x)??!1),t[0]=a,t[1]=n,t[2]=s,t[3]=l,t[4]=y,t[5]=b,t[6]=x,t[7]=S}else y=t[4],b=t[5],x=t[6],S=t[7];let C=b,w=!_&&!y&&S!==``,T;t[10]!==h||t[11]!==w||t[12]!==d||t[13]!==r||t[14]!==i.name||t[15]!==n||t[16]!==o||t[17]!==p||t[18]!==l||t[19]!==x?(T=async function(){if(!w)return;v(!0);let e=wj({title:l,description:d,tags:p}),t=await cj({folder:r,name:n===`create`?x:i.name,frontmatter:e,body:h});if(v(!1),!t.ok){X.error(`${n===`create`?`Create`:`Save`} failed: ${t.error}`);return}t.warnings.length>0?X.warning(t.warnings.join(` `)):n===`create`?X.success(`Template "${x}" created`):X.success(`Template saved`),o()},t[10]=h,t[11]=w,t[12]=d,t[13]=r,t[14]=i.name,t[15]=n,t[16]=o,t[17]=p,t[18]=l,t[19]=x,t[20]=T):T=t[20];let E=T,D;return t[21]!==h||t[22]!==w||t[23]!==d||t[24]!==n||t[25]!==s||t[26]!==y||t[27]!==C||t[28]!==_||t[29]!==E||t[30]!==p||t[31]!==l||t[32]!==x?(D={mode:n,name:s,title:l,description:d,tags:p,body:h,setName:c,setTitle:u,setDescription:f,setTags:m,setBody:g,isSaving:_,canSubmit:w,nameInvalid:y,nameShadows:C,trimmedName:x,submit:E},t[21]=h,t[22]=w,t[23]=d,t[24]=n,t[25]=s,t[26]=y,t[27]=C,t[28]=_,t[29]=E,t[30]=p,t[31]=l,t[32]=x,t[33]=D):D=t[33],D}function Oj(e){let t=(0,$.c)(21),{form:n,bodyPlaceholder:r}=e,i=(0,Q.useId)(),a=n.mode===`create`&&n.trimmedName!==``&&n.nameInvalid,o;t[0]!==n||t[1]!==i||t[2]!==a?(o=n.mode===`create`?(0,Z.jsxs)(Ab,{children:[(0,Z.jsxs)(Mb,{htmlFor:i,children:[`Name`,(0,Z.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,Z.jsx)(Jn,{id:i,value:n.name,onChange:e=>n.setName(e.target.value),placeholder:`article`,disabled:n.isSaving,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":a}),a?(0,Z.jsxs)(Fb,{children:[`Letters, digits, `,(0,Z.jsx)(`code`,{className:`font-mono`,children:`_`}),`,`,` `,(0,Z.jsx)(`code`,{className:`font-mono`,children:`-`}),` only — no slashes, dots, spaces, or`,` `,(0,Z.jsx)(`code`,{className:`font-mono`,children:`.md`}),`.`]}):n.nameShadows?(0,Z.jsxs)(Pb,{className:`text-yellow-600 dark:text-yellow-500`,children:[`A template named `,(0,Z.jsx)(`code`,{className:`font-mono`,children:n.trimmedName}),` already resolves here (likely inherited). Saving creates a`,` `,(0,Z.jsx)(`code`,{className:`font-mono`,children:`local`}),` shadow that supersedes it for this folder.`]}):null]}):null,t[0]=n,t[1]=i,t[2]=a,t[3]=o):o=t[3];let s;t[4]!==n.description||t[5]!==n.isSaving||t[6]!==n.setDescription||t[7]!==n.setTags||t[8]!==n.setTitle||t[9]!==n.tags||t[10]!==n.title?(s=(0,Z.jsx)(Cj,{title:n.title,description:n.description,tags:n.tags,onTitleChange:n.setTitle,onDescriptionChange:n.setDescription,onTagsChange:n.setTags,requireTitle:!0,disabled:n.isSaving}),t[4]=n.description,t[5]=n.isSaving,t[6]=n.setDescription,t[7]=n.setTags,t[8]=n.setTitle,t[9]=n.tags,t[10]=n.title,t[11]=s):s=t[11];let c;t[12]!==r||t[13]!==n.body||t[14]!==n.isSaving||t[15]!==n.setBody?(c=(0,Z.jsx)(Tj,{value:n.body,onChange:n.setBody,disabled:n.isSaving,placeholder:r}),t[12]=r,t[13]=n.body,t[14]=n.isSaving,t[15]=n.setBody,t[16]=c):c=t[16];let l;return t[17]!==o||t[18]!==s||t[19]!==c?(l=(0,Z.jsxs)(Ob,{children:[o,s,c]}),t[17]=o,t[18]=s,t[19]=c,t[20]=l):l=t[20],l}var kj={name:``,title:``,description:``,tags:[],body:``},Aj=`## Summary
|
|
32
|
-
|
|
33
|
-
(One-paragraph summary. Edit later via edit_document.)
|
|
34
|
-
`;function jj(e){let t=(0,$.c)(12),{folderPath:n,existingNames:r,open:i,onOpenChange:a,onCreated:o}=e,s;t[0]!==r||t[1]!==n||t[2]!==o||t[3]!==a||t[4]!==i?(s=i?(0,Z.jsx)(Mj,{folderPath:n,existingNames:r,onOpenChange:a,onCreated:o}):null,t[0]=r,t[1]=n,t[2]=o,t[3]=a,t[4]=i,t[5]=s):s=t[5];let c;t[6]===s?c=t[7]:(c=(0,Z.jsx)(di,{className:`sm:max-w-3xl max-h-[85vh] flex flex-col`,children:s}),t[6]=s,t[7]=c);let l;return t[8]!==a||t[9]!==i||t[10]!==c?(l=(0,Z.jsx)(yi,{open:i,onOpenChange:a,children:c}),t[8]=a,t[9]=i,t[10]=c,t[11]=l):l=t[11],l}function Mj(e){let t=(0,$.c)(32),{folderPath:n,existingNames:r,onOpenChange:i,onCreated:a}=e,o;t[0]===n?o=t[1]:(o=dj(n,`<name>`),t[0]=n,t[1]=o);let s=o,c;t[2]!==a||t[3]!==i?(c=()=>{a(),i(!1)},t[2]=a,t[3]=i,t[4]=c):c=t[4];let l;t[5]!==r||t[6]!==n||t[7]!==c?(l={mode:`create`,folderPath:n,initial:kj,existingNames:r,onCommitted:c},t[5]=r,t[6]=n,t[7]=c,t[8]=l):l=t[8];let u=Dj(l),d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(si,{children:`New template`}),t[9]=d):d=t[9];let f;t[10]===s?f=t[11]:(f=(0,Z.jsxs)(vi,{children:[d,(0,Z.jsxs)(ai,{children:[`Lands at `,(0,Z.jsx)(`code`,{className:`font-mono`,children:s}),`. Agents resolve it via leaf → root walk-up — closest-wins on filename collision.`]})]}),t[10]=s,t[11]=f);let p;t[12]===u?p=t[13]:(p=(0,Z.jsx)(mi,{children:(0,Z.jsx)(Oj,{form:u,bodyPlaceholder:Aj})}),t[12]=u,t[13]=p);let m;t[14]===i?m=t[15]:(m=()=>i(!1),t[14]=i,t[15]=m);let h;t[16]!==u.isSaving||t[17]!==m?(h=(0,Z.jsx)(Y,{variant:`outline`,className:`font-mono uppercase`,onClick:m,disabled:u.isSaving,children:`Cancel`}),t[16]=u.isSaving,t[17]=m,t[18]=h):h=t[18];let g;t[19]===u?g=t[20]:(g=()=>void u.submit(),t[19]=u,t[20]=g);let _=!u.canSubmit,v=u.isSaving?`Creating…`:`Create template`,y;t[21]!==_||t[22]!==v||t[23]!==g?(y=(0,Z.jsx)(Y,{onClick:g,disabled:_,children:v}),t[21]=_,t[22]=v,t[23]=g,t[24]=y):y=t[24];let b;t[25]!==y||t[26]!==h?(b=(0,Z.jsxs)(hi,{children:[h,y]}),t[25]=y,t[26]=h,t[27]=b):b=t[27];let x;return t[28]!==b||t[29]!==f||t[30]!==p?(x=(0,Z.jsxs)(Z.Fragment,{children:[f,p,b]}),t[28]=b,t[29]=f,t[30]=p,t[31]=x):x=t[31],x}function Nj(e){let t=(0,$.c)(9),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`idle`},t[0]=n):n=t[0];let[r,i]=(0,Q.useState)(n),[a,o]=(0,Q.useState)(0),s;t[1]===e?s=t[2]:(s=()=>{if(e===null){i({status:`idle`});return}let t=!1;i({status:`loading`});let n=e?`?path=${encodeURIComponent(e)}`:``;return fetch(`/api/folder-config${n}`).then(Fj).then(e=>{if(!t){if(!e.ok||!e.folder){i({status:`error`,message:e.error??`Unknown error`});return}i({status:`ready`,data:{folder:e.folder,frontmatterLocal:e.frontmatter_local??null,frontmatterSources:e.frontmatter_sources??{}}})}}).catch(e=>{t||i({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},t[1]=e,t[2]=s);let c;t[3]!==e||t[4]!==a?(c=[e,a],t[3]=e,t[4]=a,t[5]=c):c=t[5],(0,Q.useEffect)(s,c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>o(Pj),t[6]=l):l=t[6];let u;return t[7]===r?u=t[8]:(u={state:r,refresh:l},t[7]=r,t[8]=u),u}function Pj(e){return e+1}async function Fj(e){if(!e.ok){let t=await e.text().catch(Ij);throw Error(`HTTP ${e.status}${t?`: ${t.slice(0,200)}`:``}`)}return e.json()}function Ij(){return``}function Lj(e,t){let n=(0,$.c)(5),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`idle`},n[0]=r):r=n[0];let[i,a]=(0,Q.useState)(r),o,s;return n[1]!==e||n[2]!==t?(o=()=>{if(e===null||!t){a({status:`idle`});return}let n=!1;a({status:`loading`});let r=`?folder=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`;return fetch(`/api/template${r}`).then(Rj).then(e=>{if(!n){if(!e.ok||!e.template){a({status:`error`,message:e.error??`Unknown error`});return}a({status:`ready`,data:e.template})}}).catch(e=>{n||a({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{n=!0}},s=[e,t],n[1]=e,n[2]=t,n[3]=o,n[4]=s):(o=n[3],s=n[4]),(0,Q.useEffect)(o,s),i}async function Rj(e){if(!e.ok){let t=await e.text().catch(zj);throw Error(`HTTP ${e.status}${t?`: ${t.slice(0,200)}`:``}`)}return e.json()}function zj(){return``}function Bj(e){let t=(0,$.c)(29),{folderPath:n,template:r,onOpenChange:i,onSaved:a}=e,o=r!==null,s;t[0]===i?s=t[1]:(s=function(){i(!1)},t[0]=i,t[1]=s);let c=s,l;t[2]!==c||t[3]!==a?(l=function(){a(),c()},t[2]=c,t[3]=a,t[4]=l):l=t[4];let u=l,d;t[5]===c?d=t[6]:(d=e=>e?null:c(),t[5]=c,t[6]=d);let f=r?.title??r?.name??`Template`,p;t[7]===r?.scope?p=t[8]:(p=r?.scope===`inherited`?(0,Z.jsx)(pn,{variant:`gray`,className:`text-2xs`,children:`inherited`}):null,t[7]=r?.scope,t[8]=p);let m;t[9]!==f||t[10]!==p?(m=(0,Z.jsxs)(si,{className:`flex items-center gap-2`,children:[`Edit `,f,p]}),t[9]=f,t[10]=p,t[11]=m):m=t[11];let h=r?.description??`Edit template`,g;t[12]===h?g=t[13]:(g=(0,Z.jsx)(ai,{className:`sr-only`,children:h}),t[12]=h,t[13]=g);let _;t[14]!==m||t[15]!==g?(_=(0,Z.jsxs)(vi,{children:[m,g]}),t[14]=m,t[15]=g,t[16]=_):_=t[16];let v;t[17]!==n||t[18]!==c||t[19]!==u||t[20]!==r?(v=r?(0,Z.jsx)(Vj,{folderPath:n,template:r,onCancel:c,onSaved:u},`${r.source_folder}::${r.name}`):null,t[17]=n,t[18]=c,t[19]=u,t[20]=r,t[21]=v):v=t[21];let y;t[22]!==v||t[23]!==_?(y=(0,Z.jsxs)(di,{className:`sm:max-w-3xl max-h-[85vh] flex flex-col`,children:[_,v]}),t[22]=v,t[23]=_,t[24]=y):y=t[24];let b;return t[25]!==o||t[26]!==y||t[27]!==d?(b=(0,Z.jsx)(yi,{open:o,onOpenChange:d,children:y}),t[25]=o,t[26]=y,t[27]=d,t[28]=b):b=t[28],b}function Vj(e){let t=(0,$.c)(7),{folderPath:n,template:r,onCancel:i,onSaved:a}=e,o=Lj(n,r.name);if(o.status===`loading`||o.status===`idle`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(mi,{className:`overflow-y-auto subtle-scrollbar`,children:(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(Br,{className:`h-32 w-full`}),(0,Z.jsx)(Br,{className:`h-48 w-full`})]})}),t[0]=e):e=t[0],e}if(o.status===`error`){let e;return t[1]===o.message?e=t[2]:(e=(0,Z.jsx)(mi,{className:`overflow-y-auto subtle-scrollbar`,children:(0,Z.jsxs)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:[`Failed to load template: `,o.message]})}),t[1]=o.message,t[2]=e),e}let s;return t[3]!==i||t[4]!==a||t[5]!==o.data?(s=(0,Z.jsx)(Hj,{detail:o.data,onCancel:i,onSaved:a}),t[3]=i,t[4]=a,t[5]=o.data,t[6]=s):s=t[6],s}function Hj(e){let t=(0,$.c)(39),{detail:n,onCancel:r,onSaved:i}=e,a=n.frontmatter,o=typeof a.title==`string`?a.title:``,s=typeof a.description==`string`?a.description:``,c;t[0]===a.tags?c=t[1]:(c=Array.isArray(a.tags)?a.tags.filter(Uj):[],t[0]=a.tags,t[1]=c);let l;t[2]!==n.body||t[3]!==n.name||t[4]!==o||t[5]!==s||t[6]!==c?(l={name:n.name,title:o,description:s,tags:c,body:n.body},t[2]=n.body,t[3]=n.name,t[4]=o,t[5]=s,t[6]=c,t[7]=l):l=t[7];let u;t[8]!==n.folder||t[9]!==i||t[10]!==l?(u={mode:`edit`,folderPath:n.folder,initial:l,onCommitted:i},t[8]=n.folder,t[9]=i,t[10]=l,t[11]=u):u=t[11];let d=Dj(u),f;t[12]===n.name?f=t[13]:(f=(0,Z.jsxs)(`code`,{className:`font-mono`,children:[`write_document({ template: "`,n.name,`" })`]}),t[12]=n.name,t[13]=f);let p;t[14]===n.path?p=t[15]:(p=(0,Z.jsx)(`code`,{className:`font-mono`,children:n.path}),t[14]=n.path,t[15]=p);let m;t[16]!==f||t[17]!==p?(m=(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Instantiate as`,` `,f,`. This template is located at `,p,`.`]}),t[16]=f,t[17]=p,t[18]=m):m=t[18];let h;t[19]===d?h=t[20]:(h=(0,Z.jsx)(Oj,{form:d}),t[19]=d,t[20]=h);let g;t[21]!==m||t[22]!==h?(g=(0,Z.jsx)(mi,{className:`overflow-y-auto subtle-scrollbar`,children:(0,Z.jsxs)(`div`,{className:`space-y-4`,children:[m,h]})}),t[21]=m,t[22]=h,t[23]=g):g=t[23];let _;t[24]!==d.isSaving||t[25]!==r?(_=(0,Z.jsx)(Y,{variant:`outline`,className:`font-mono uppercase`,onClick:r,disabled:d.isSaving,children:`Cancel`}),t[24]=d.isSaving,t[25]=r,t[26]=_):_=t[26];let v;t[27]===d?v=t[28]:(v=()=>void d.submit(),t[27]=d,t[28]=v);let y=!d.canSubmit,b=d.isSaving?`Saving…`:`Save`,x;t[29]!==v||t[30]!==y||t[31]!==b?(x=(0,Z.jsx)(Y,{onClick:v,disabled:y,children:b}),t[29]=v,t[30]=y,t[31]=b,t[32]=x):x=t[32];let S;t[33]!==_||t[34]!==x?(S=(0,Z.jsxs)(hi,{children:[_,x]}),t[33]=_,t[34]=x,t[35]=S):S=t[35];let C;return t[36]!==g||t[37]!==S?(C=(0,Z.jsxs)(Z.Fragment,{children:[g,S]}),t[36]=g,t[37]=S,t[38]=C):C=t[38],C}function Uj(e){return typeof e==`string`}function Wj(e){let t=(0,$.c)(45),{folderPath:n,state:r,onChange:i}=e,[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(!1),[d,f]=(0,Q.useState)(!1),p;t[0]===i?p=t[1]:(p=async function(e){u(!0);let t=await lj(e.source_folder,e.name);if(u(!1),!t.ok){X.error(`Delete failed: ${t.error}`);return}X.success(`Template "${e.name}" deleted`),c(null),i()},t[0]=i,t[1]=p);let m=p;if(r.status===`idle`||r.status===`loading`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card px-3 py-2.5 space-y-3`,children:[(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:`Templates available`})}),(0,Z.jsx)(Br,{className:`h-12 w-full`}),(0,Z.jsx)(Br,{className:`h-12 w-full`})]}),t[2]=e):e=t[2],e}if(r.status===`error`){let e;return t[3]===r.message?e=t[4]:(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:[`Failed to load templates: `,r.message]}),t[3]=r.message,t[4]=e),e}let h;t[5]===r.data.folder.templates_available?h=t[6]:(h=r.data.folder.templates_available??[],t[5]=r.data.folder.templates_available,t[6]=h);let g=h,_;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:`Templates available`}),t[7]=_):_=t[7];let v;t[8]===g.length?v=t[9]:(v=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[_,(0,Z.jsx)(pn,{className:`text-xs`,variant:`secondary`,children:g.length})]}),t[8]=g.length,t[9]=v);let y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsxs)(Y,{variant:`ghost`,className:`font-mono uppercase`,size:`sm`,onClick:()=>f(!0),children:[(0,Z.jsx)(co,{className:`size-3.5`,"aria-hidden":!0}),`New template`]}),t[10]=y):y=t[10];let b;t[11]===v?b=t[12]:(b=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-1`,children:[v,y]}),t[11]=v,t[12]=b);let x;t[13]===g?x=t[14]:(x=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:g.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No templates resolve here. Add one to seed new docs in this folder.`}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:g.map(e=>(0,Z.jsx)(Kj,{template:e,onEdit:()=>o(e),onDelete:()=>c(e)},e.path))})}),t[13]=g,t[14]=x);let S;t[15]!==b||t[16]!==x?(S=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,children:[b,x]}),t[15]=b,t[16]=x,t[17]=S):S=t[17];let C;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{e||o(null)},t[18]=C):C=t[18];let w;t[19]!==a||t[20]!==n||t[21]!==i?(w=(0,Z.jsx)(Bj,{folderPath:n,template:a,onOpenChange:C,onSaved:i}),t[19]=a,t[20]=n,t[21]=i,t[22]=w):w=t[22];let T=!!s,E;t[23]===l?E=t[24]:(E=e=>{!e&&!l&&c(null)},t[23]=l,t[24]=E);let D;t[25]!==s||t[26]!==l||t[27]!==m?(D=s&&(0,Z.jsx)(bj,{itemName:`template "${s.name}"`,isSubmitting:l,onDelete:()=>m(s),customDescription:`This permanently removes ${s.path}. Agents that reference this template by name will fail until it's recreated or shadowed by an ancestor.${s.scope===`inherited`?`
|
|
35
|
-
|
|
36
|
-
This template lives at an ancestor folder — deleting affects every folder under that ancestor that does not shadow it locally.`:``}`}),t[25]=s,t[26]=l,t[27]=m,t[28]=D):D=t[28];let O;t[29]!==T||t[30]!==E||t[31]!==D?(O=(0,Z.jsx)(yi,{open:T,onOpenChange:E,children:D}),t[29]=T,t[30]=E,t[31]=D,t[32]=O):O=t[32];let k;t[33]===g?k=t[34]:(k=new Set(g.map(Gj)),t[33]=g,t[34]=k);let A;t[35]!==n||t[36]!==d||t[37]!==i||t[38]!==k?(A=(0,Z.jsx)(jj,{folderPath:n,existingNames:k,open:d,onOpenChange:f,onCreated:i}),t[35]=n,t[36]=d,t[37]=i,t[38]=k,t[39]=A):A=t[39];let j;return t[40]!==w||t[41]!==O||t[42]!==A||t[43]!==S?(j=(0,Z.jsxs)(Z.Fragment,{children:[S,w,O,A]}),t[40]=w,t[41]=O,t[42]=A,t[43]=S,t[44]=j):j=t[44],j}function Gj(e){return e.name}function Kj(e){let t=(0,$.c)(35),{template:n,onEdit:r,onDelete:i}=e,a=n.title&&n.title!==n.name,o=n.title??n.name,s;t[0]===o?s=t[1]:(s=(0,Z.jsx)(`span`,{className:`font-medium truncate`,children:o}),t[0]=o,t[1]=s);let c;t[2]!==a||t[3]!==n.name?(c=a?(0,Z.jsx)(`code`,{className:`font-mono text-xs text-muted-foreground shrink-0`,children:n.name}):null,t[2]=a,t[3]=n.name,t[4]=c):c=t[4];let l;t[5]===n.scope?l=t[6]:(l=n.scope===`inherited`?(0,Z.jsx)(pn,{variant:`gray`,className:`ml-auto shrink-0 text-2xs`,children:`inherited`}):null,t[5]=n.scope,t[6]=l);let u;t[7]!==s||t[8]!==c||t[9]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[s,c,l]}),t[7]=s,t[8]=c,t[9]=l,t[10]=u):u=t[10];let d;t[11]===n.description?d=t[12]:(d=n.description?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground truncate mt-0.5`,children:n.description}):null,t[11]=n.description,t[12]=d);let f;t[13]!==r||t[14]!==u||t[15]!==d?(f=(0,Z.jsxs)(`button`,{type:`button`,onClick:r,className:`min-w-0 flex-1 text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm`,children:[u,d]}),t[13]=r,t[14]=u,t[15]=d,t[16]=f):f=t[16];let p=`Actions for ${n.title??n.name}`,m;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(Pa,{className:`size-4`,"aria-hidden":!0}),t[17]=m):m=t[17];let h;t[18]===p?h=t[19]:(h=(0,Z.jsx)(wA,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0 opacity-0 group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100`,"aria-label":p,children:m})}),t[18]=p,t[19]=h);let g;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(dn,{"aria-hidden":!0}),t[20]=g):g=t[20];let _;t[21]===r?_=t[22]:(_=(0,Z.jsxs)(EA,{onSelect:r,children:[g,`Edit`]}),t[21]=r,t[22]=_);let v;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(Kn,{"aria-hidden":!0}),t[23]=v):v=t[23];let y;t[24]===i?y=t[25]:(y=(0,Z.jsxs)(EA,{variant:`destructive`,onSelect:i,children:[v,`Delete`]}),t[24]=i,t[25]=y);let b;t[26]!==_||t[27]!==y?(b=(0,Z.jsxs)(TA,{align:`end`,children:[_,y]}),t[26]=_,t[27]=y,t[28]=b):b=t[28];let x;t[29]!==h||t[30]!==b?(x=(0,Z.jsxs)(CA,{children:[h,b]}),t[29]=h,t[30]=b,t[31]=x):x=t[31];let S;return t[32]!==x||t[33]!==f?(S=(0,Z.jsxs)(`li`,{className:`group flex items-center gap-2 rounded-md px-2 py-2 hover:bg-muted/50 text-sm`,children:[f,x]}),t[32]=x,t[33]=f,t[34]=S):S=t[34],S}function qj(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,containerClassName:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=J(`relative w-full overflow-x-auto subtle-scrollbar`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=J(`w-full caption-bottom text-sm`,n),t[6]=n,t[7]=o);let s;t[8]!==i||t[9]!==o?(s=(0,Z.jsx)(`table`,{"data-slot":`table`,className:o,...i}),t[8]=i,t[9]=o,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==s?(c=(0,Z.jsx)(`div`,{"data-slot":`table-container`,className:a,children:s}),t[11]=a,t[12]=s,t[13]=c):c=t[13],c}function Jj(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Yj(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Xj(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,noHover:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?!1:i)&&`hover:bg-transparent`,o;t[4]!==n||t[5]!==a?(o=J(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,a,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(`tr`,{"data-slot":`table-row`,className:o,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function Zj(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scope:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`col`:i,o;t[4]===n?o=t[5]:(o=J(`font-mono uppercase text-xs text-muted-foreground h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`th`,{"data-slot":`table-head`,scope:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Qj(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`py-3 px-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $j(e){if(!e)return`—`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return`just now`;if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let a=Math.floor(i/24);return a<30?`${a}d ago`:t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function eM(e,t,n){return[...e].sort((e,r)=>{if(e.kind!==r.kind)return e.kind===`folder`?-1:1;let i=0;switch(t){case`name`:i=e.title.localeCompare(r.title)||e.name.localeCompare(r.name);break;case`modified`:{let t=e.kind===`file`?e.modified:``,n=r.kind===`file`?r.modified:``;i=t.localeCompare(n);break}}return n===`asc`?i:-i})}function tM(e){let t=(0,$.c)(10),{label:n,sortKey:r,activeKey:i,activeDir:a,onSort:o}=e,s=i===r,c;t[0]!==o||t[1]!==r?(c=()=>o(r),t[0]=o,t[1]=r,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==s?(l=s?a===`asc`?(0,Z.jsx)(Bn,{className:`ml-1 size-3`}):(0,Z.jsx)(ur,{className:`ml-1 size-3`}):(0,Z.jsx)(ma,{className:`ml-1 size-3 text-muted-foreground/50`}),t[3]=a,t[4]=s,t[5]=l):l=t[5];let u;return t[6]!==n||t[7]!==c||t[8]!==l?(u=(0,Z.jsxs)(Y,{variant:`ghost`,size:`sm`,className:`-ml-3 h-8 uppercase font-mono`,onClick:c,children:[n,l]}),t[6]=n,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function nM(e){let t=(0,$.c)(98),{folderPath:n}=e,{addPage:r,folderPaths:i,loading:a,pages:o,pageTitles:s,pageMeta:c}=Ee(),{state:l,refresh:u}=Nj(n),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(`name`),[y,b]=(0,Q.useState)(`asc`);if(a){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Br,{className:`size-5 rounded`}),(0,Z.jsx)(Br,{className:`h-7 w-48`})]}),(0,Z.jsx)(Br,{className:`h-9 w-20 rounded-md`})]}),t[0]=e):e=t[0];let n;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(Br,{className:`h-4 w-16`}),t[1]=n):n=t[1];let r;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,role:`status`,"aria-busy":`true`,"aria-label":`Loading folder contents`,children:(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`,children:[e,(0,Z.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-4 border-b px-4 py-3`,children:[n,(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Br,{className:`h-4 w-20`})})]}),[`a`,`b`,`c`,`d`].map(oM)]})]})}),t[2]=r):r=t[2],r}let x,S,C,w,T,E,D,O,k,A;if(t[3]!==r||t[4]!==h||t[5]!==p||t[6]!==l||t[7]!==n||t[8]!==i||t[9]!==c||t[10]!==s||t[11]!==o||t[12]!==u||t[13]!==y||t[14]!==_){let e=yj(n,{pages:o,pageTitles:s,pageMeta:c,folderPaths:i}),a=eM(e.children,_,y),d;t[25]===_?d=t[26]:(d=function(e){e===_?b(aM):(v(e),b(`asc`))},t[25]=_,t[26]=d);let j=d,M;t[27]!==r||t[28]!==n?(M=async function(){m(!0),g(null);try{let e=`${n}/index.md`,t=await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),i=await t.json().catch(iM);if(!t.ok||!i?.ok){g(i?.error??`Server error (HTTP ${t.status})`),m(!1);return}let a=i.docName??`${n}/index`;r(a),Ze([`files`,`backlinks`,`graph`]),window.location.hash=Ie(a)}catch(e){console.warn(`[FolderOverview] create index note failed:`,e),g(`Network error — please try again`)}m(!1)},t[27]=r,t[28]=n,t[29]=M):M=t[29];let N=M;A=`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,E=`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`;let P;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(On,{className:`size-5 text-muted-foreground`}),t[30]=P):P=t[30];let F=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[P,(0,Z.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:e.title})]}),I;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(co,{className:`size-4`}),t[31]=I):I=t[31];let L;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(wA,{asChild:!0,children:(0,Z.jsxs)(Y,{children:[I,`New`,(0,Z.jsx)(Mn,{className:`size-3`})]})}),t[32]=L):L=t[32];let R;t[33]===N?R=t[34]:(R=()=>void N(),t[33]=N,t[34]=R);let z;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`font-medium`,children:`Index note`}),(0,Z.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Landing page for this folder`})]}),t[35]=z):z=t[35];let B;t[36]!==p||t[37]!==R?(B=(0,Z.jsx)(EA,{disabled:p,onSelect:R,children:z}),t[36]=p,t[37]=R,t[38]=B):B=t[38];let V;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(EA,{onSelect:()=>f(!0),children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`font-medium`,children:`Note`}),(0,Z.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`New note inside this folder`})]})}),t[39]=V):V=t[39];let H;t[40]===B?H=t[41]:(H=(0,Z.jsxs)(CA,{children:[L,(0,Z.jsxs)(TA,{align:`end`,children:[B,V]})]}),t[40]=B,t[41]=H);let U;t[42]!==F||t[43]!==H?(U=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[F,H]}),t[42]=F,t[43]=H,t[44]=U):U=t[44];let W;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This folder has no landing note yet. Choose an explicit action to add one or open a note inside the folder.`}),t[45]=W):W=t[45];let G;t[46]===h?G=t[47]:(G=h?(0,Z.jsx)(`span`,{role:`alert`,className:`text-sm text-destructive`,children:h}):null,t[46]=h,t[47]=G),t[48]!==U||t[49]!==G?(D=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[U,W,G]}),t[48]=U,t[49]=G,t[50]=D):D=t[50],t[51]!==l||t[52]!==n||t[53]!==u?(O=(0,Z.jsx)(pj,{folderPath:n,state:l,onChange:u}),k=(0,Z.jsx)(Wj,{folderPath:n,state:l,onChange:u}),t[51]=l,t[52]=n,t[53]=u,t[54]=O,t[55]=k):(O=t[54],k=t[55]),T=`rounded-lg border`,S=qj;let ee=_===`name`?y===`asc`?`ascending`:`descending`:`none`,te;t[56]!==j||t[57]!==y||t[58]!==_?(te=(0,Z.jsx)(tM,{label:`Name`,sortKey:`name`,activeKey:_,activeDir:y,onSort:j}),t[56]=j,t[57]=y,t[58]=_,t[59]=te):te=t[59];let ne;t[60]!==ee||t[61]!==te?(ne=(0,Z.jsx)(Zj,{"aria-sort":ee,children:te}),t[60]=ee,t[61]=te,t[62]=ne):ne=t[62];let re=_===`modified`?y===`asc`?`ascending`:`descending`:`none`,ie;t[63]!==j||t[64]!==y||t[65]!==_?(ie=(0,Z.jsx)(tM,{label:`Modified`,sortKey:`modified`,activeKey:_,activeDir:y,onSort:j}),t[63]=j,t[64]=y,t[65]=_,t[66]=ie):ie=t[66];let ae;t[67]!==re||t[68]!==ie?(ae=(0,Z.jsx)(Zj,{className:`w-32`,"aria-sort":re,children:ie}),t[67]=re,t[68]=ie,t[69]=ae):ae=t[69],t[70]!==ne||t[71]!==ae?(w=(0,Z.jsx)(Jj,{children:(0,Z.jsxs)(Xj,{children:[ne,ae]})}),t[70]=ne,t[71]=ae,t[72]=w):w=t[72],x=Yj,C=a.length?a.map(rM):(0,Z.jsx)(Xj,{children:(0,Z.jsx)(Qj,{colSpan:2,className:`h-24 text-center text-muted-foreground`,children:`This folder is empty.`})}),t[3]=r,t[4]=h,t[5]=p,t[6]=l,t[7]=n,t[8]=i,t[9]=c,t[10]=s,t[11]=o,t[12]=u,t[13]=y,t[14]=_,t[15]=x,t[16]=S,t[17]=C,t[18]=w,t[19]=T,t[20]=E,t[21]=D,t[22]=O,t[23]=k,t[24]=A}else x=t[15],S=t[16],C=t[17],w=t[18],T=t[19],E=t[20],D=t[21],O=t[22],k=t[23],A=t[24];let j;t[73]!==x||t[74]!==C?(j=(0,Z.jsx)(x,{children:C}),t[73]=x,t[74]=C,t[75]=j):j=t[75];let M;t[76]!==S||t[77]!==w||t[78]!==j?(M=(0,Z.jsxs)(S,{children:[w,j]}),t[76]=S,t[77]=w,t[78]=j,t[79]=M):M=t[79];let N;t[80]!==M||t[81]!==T?(N=(0,Z.jsx)(`div`,{className:T,children:M}),t[80]=M,t[81]=T,t[82]=N):N=t[82];let P;t[83]!==N||t[84]!==E||t[85]!==D||t[86]!==O||t[87]!==k?(P=(0,Z.jsxs)(`div`,{className:E,children:[D,O,k,N]}),t[83]=N,t[84]=E,t[85]=D,t[86]=O,t[87]=k,t[88]=P):P=t[88];let F;t[89]!==P||t[90]!==A?(F=(0,Z.jsx)(`div`,{className:A,children:P}),t[89]=P,t[90]=A,t[91]=F):F=t[91];let I;t[92]!==d||t[93]!==n?(I=(0,Z.jsx)(Pn,{open:d,onOpenChange:f,kind:`file`,initialDir:n}),t[92]=d,t[93]=n,t[94]=I):I=t[94];let L;return t[95]!==F||t[96]!==I?(L=(0,Z.jsxs)(Z.Fragment,{children:[F,I]}),t[95]=F,t[96]=I,t[97]=L):L=t[97],L}function rM(e){return(0,Z.jsxs)(Xj,{children:[(0,Z.jsx)(Qj,{children:(0,Z.jsxs)(`a`,{href:Ie(e.path),className:`flex items-center gap-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[e.kind===`folder`?(0,Z.jsx)(Va,{className:`size-4 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Xt,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.title})]})}),(0,Z.jsx)(Qj,{className:`text-muted-foreground`,children:e.kind===`file`?$j(e.modified):`—`})]},e.path)}function iM(){return null}function aM(e){return e===`asc`?`desc`:`asc`}function oM(e){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-3 last:border-b-0`,children:[(0,Z.jsx)(Br,{className:`size-4 rounded`}),(0,Z.jsx)(Br,{className:`h-4 w-40`}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Br,{className:`h-4 w-16`})})]},e)}var sM=(0,Q.createContext)(null);function cM(e){let t=(0,$.c)(7),{children:n}=e,[r,i]=(0,Q.useState)(lM),a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=e=>{i(t=>{let n=new Map(t);return n.set(e,(t.get(e)??0)+1),n})},t[0]=a):a=t[0];let o=a,s;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=e=>{i(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},t[1]=s):s=t[1];let c=s,l;t[2]===r?l=t[3]:(l={addPropertySignal:r,requestAddProperty:o,clearAddProperty:c},t[2]=r,t[3]=l);let u=l,d;return t[4]!==n||t[5]!==u?(d=(0,Z.jsx)(sM,{value:u,children:n}),t[4]=n,t[5]=u,t[6]=d):d=t[6],d}function lM(){return new Map}function uM(){let e=(0,Q.use)(sM);if(e===null)throw Error(`useProperties must be used within <PropertyProvider />`);return e}var dM=yt(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function fM(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=J(dM({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==i||t[9]!==a?(o=(0,Z.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":r,className:a,...i}),t[7]=r,t[8]=i,t[9]=a,t[10]=o):o=t[10],o}function pM(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`flex h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Uy,{"data-slot":`resizable-panel-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function mM(e){let t=(0,$.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Ky,{"data-slot":`resizable-panel`,...n}),t[2]=n,t[3]=r),r}function hM(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({withHandle:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=J(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),t[4]=n,t[5]=a);let o;t[6]===i?o=t[7]:(o=i&&(0,Z.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`}),t[6]=i,t[7]=o);let s;return t[8]!==r||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(Xy,{"data-slot":`resizable-handle`,className:a,...r,children:o}),t[8]=r,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}var gM=960,_M=1024;function vM(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(bM),[r,i]=(0,Q.useState)(yM),a,o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=window.matchMedia(`(max-width: ${gM-1}px)`),t=window.matchMedia(`(max-width: ${_M-1}px)`),r=()=>{let r=e.matches;n(r?`sheet`:`panel`),i(!r&&t.matches)};return e.addEventListener(`change`,r),t.addEventListener(`change`,r),()=>{e.removeEventListener(`change`,r),t.removeEventListener(`change`,r)}},o=[],e[0]=a,e[1]=o):(a=e[0],o=e[1]),(0,Q.useEffect)(a,o);let s;return e[2]!==r||e[3]!==t?(s={layout:t,autoCollapse:r},e[2]=r,e[3]=t,e[4]=s):s=e[4],s}function yM(){return window.innerWidth>=gM&&window.innerWidth<_M}function bM(){return window.innerWidth<gM?`sheet`:`panel`}var xM={words:0,chars:0,tokens:0},SM=/[ -〿-ゟ゠-ヿ㐀-䶿一-鿿豈---ក-]/,CM=/[\p{L}\p{N}]/u,wM=new Set([`text`,`inlineCode`,`code`,`tag`]),TM=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),EM=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function DM(e,t){if(!e)return;let n=e.type;if(!TM.has(n)){if(wM.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
|
|
37
|
-
`));return}if(n===`wikiLink`||n===`wikiLinkEmbed`){let n=e.data?.alias??e.value??``;n&&t.push(n);return}if(Array.isArray(e.children)){for(let n of e.children)DM(n,t);if(EM.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
|
|
38
|
-
`)&&t.push(`
|
|
39
|
-
`)}}}}function OM(e){try{let t=bn().parseToMdast(e),n=[];return DM(t,n),n.join(``).trim()}catch(t){return console.warn(`[document-stats] mdast parse failed, falling back to raw text`,t),e.trim()}}function kM(e){if(!e)return 0;let t=0;for(let n of e.split(/\s+/))CM.test(n)&&t++;return t}function AM(e){let t=globalThis.Intl.Segmenter;if(!t)return kM(e);let n=new t(void 0,{granularity:`word`}),r=0;for(let t of n.segment(e))t.isWordLike&&r++;return r}function jM(e){let t=SM.test(e)?1.5:4;return Math.ceil(e.length/t)}function MM(e){if(!e)return{words:0,chars:0,tokens:0};let{body:t}=Ae(e);if(!t.trim())return{words:0,chars:0,tokens:0};let n=OM(t);return n?{words:SM.test(n)?AM(n):kM(n),chars:n.length,tokens:jM(n)}:{words:0,chars:0,tokens:0}}var NM=300;function PM(e,t){let n=(0,$.c)(4),[r,i]=(0,Q.useState)(xM),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!e||!t){i(xM);return}let n=e.document.getText(`source`),r=!1,a=null,o=function(){r||i(MM(n.toString()))};o();let s=function(){a&&clearTimeout(a),a=setTimeout(o,NM)};return n.observe(s),()=>{r=!0,n.unobserve(s),a&&clearTimeout(a)}},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,Q.useEffect)(a,o),r}function FM(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(`connecting`),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e){r(`connecting`);return}let t=e.configuration.websocketProvider.status;e.isSynced?r(`synced`):r(t===`connected`?`connected`:t===`disconnected`?`disconnected`:`connecting`);let n=e=>{let{status:t}=e;r(t===`connected`?IM:t===`disconnected`?`disconnected`:`connecting`)},i=e=>{let{state:t}=e;r(t?`synced`:`connected`)},a=()=>r(`disconnected`);return e.on(`status`,n),e.on(`synced`,i),e.on(`disconnect`,a),()=>{e.off(`status`,n),e.off(`synced`,i),e.off(`disconnect`,a)}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a),n}function IM(e){return e===`synced`?`synced`:`connected`}var LM=Le;function RM(e,t={}){let n=rr(e.componentName);return n.name===`*`?t.unregisteredSuffix?`${e.componentName} (unregistered)`:e.componentName:n.displayName??n.name}var zM=4;function BM(e){let t=(0,$.c)(8),{editor:n}=e,r=mr(n),i=!!(n&&r&&r.ancestorChain.length>0),a=i?void 0:`true`,o=`jsx-component-breadcrumb flex items-center gap-1 min-h-[28px] px-3 py-1.5 text-xs font-mono text-muted-foreground overflow-hidden ${i?`border-t border-border`:``}`,s;t[0]!==r||t[1]!==n||t[2]!==i?(s=i&&r?(0,Z.jsx)(HM,{editor:n,blockSelection:r}):null,t[0]=r,t[1]=n,t[2]=i,t[3]=s):s=t[3];let c;return t[4]!==a||t[5]!==o||t[6]!==s?(c=(0,Z.jsx)(`nav`,{"aria-label":`Block ancestor navigation`,"aria-hidden":a,className:o,children:s}),t[4]=a,t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function VM(e,t){let n=rn.getState(e.state)?.posToId;if(!n)return t.pos;for(let[e,r]of n)if(r===t.bridgeId)return e;return null}function HM(e){let t=(0,$.c)(9),{editor:n,blockSelection:r}=e,{ancestorChain:i,selectedBlockId:a}=r,o;if(t[0]!==i||t[1]!==n||t[2]!==a){let e=GM(i),r;t[4]===n?r=t[5]:(r=(0,Z.jsx)(`button`,{type:`button`,className:`opacity-60 hover:opacity-100 hover:text-foreground transition-opacity outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm`,onClick:()=>{n.chain().focus().setTextSelection(0).command(WM).run()},children:Gt}),t[4]=n,t[5]=r);let s;t[6]!==n||t[7]!==a?(s=e=>{if(e.kind===`ellipsis`)return(0,Z.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,Z.jsx)(An,{size:12,className:`opacity-50`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{role:`img`,"aria-label":`${e.hiddenCount} hidden ancestors`,title:`${e.hiddenCount} hidden ancestors`,className:`opacity-60`,children:`…`})]},`ellipsis`);let t=RM(e.entry),r=e.entry.bridgeId===a;return(0,Z.jsxs)(`span`,{className:`flex items-center gap-1 min-w-0`,children:[(0,Z.jsx)(An,{size:12,className:`opacity-50 shrink-0`,"aria-hidden":`true`}),r?(0,Z.jsx)(`span`,{"aria-current":`location`,className:`text-foreground truncate`,children:t}):(0,Z.jsx)(`button`,{type:`button`,className:`hover:text-foreground transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm truncate`,onClick:()=>{let t=VM(n,e.entry);t!==null&&n.chain().focus().setNodeSelection(t).command(UM).run()},children:t})]},e.entry.bridgeId)},t[6]=n,t[7]=a,t[8]=s):s=t[8],o=(0,Z.jsxs)(Z.Fragment,{children:[r,e.map(s)]}),t[0]=i,t[1]=n,t[2]=a,t[3]=o}else o=t[3];return o}function UM(e){let{tr:t}=e;return t.setMeta(xn,`programmatic`),!0}function WM(e){let{tr:t}=e;return t.setMeta(xn,`programmatic`),!0}function GM(e){if(e.length<=zM)return e.map(e=>({kind:`entry`,entry:e}));let t=e[0],n=e.slice(-2),r=e.length-1-n.length;return[{kind:`entry`,entry:t},{kind:`ellipsis`,hiddenCount:r},...n.map(e=>({kind:`entry`,entry:e}))]}var KM=200,qM=`Outside any block`;function JM(e){let t=(0,$.c)(5),{editor:n}=e,r=mr(n),i=(0,Q.useRef)(null),a=(0,Q.useRef)(null),o=(0,Q.useRef)(!1),s,c;t[0]!==r||t[1]!==n?(s=()=>{if(a.current!==null&&(window.clearTimeout(a.current),a.current=null),!n||!i.current)return;let e=r!==null&&r.ancestorChain.length>0,t;return t=e?YM(n,r):o.current?qM:``,a.current=window.setTimeout(()=>{i.current&&(i.current.textContent=``,i.current.textContent=t),o.current=e,a.current=null},KM),()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null)}},c=[n,r],t[0]=r,t[1]=n,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,Q.useEffect)(s,c);let l;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`div`,{ref:i,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`sr-only`}),t[4]=l):l=t[4],l}function YM(e,t){if(!t||t.ancestorChain.length===0)return``;let n=t.ancestorChain,r=n[n.length-1],i=RM(r,{unregisteredSuffix:!0});if(n.length===1)return`Selected: ${i}`;let a=n[n.length-2],o=RM(a);try{let t=e.state.doc.resolve(r.pos),n=t.index(t.depth),a=t.parent.childCount;return`Selected: ${i}, ${n+1} of ${a} in ${o}`}catch{return`Selected: ${i} in ${o}`}}function XM(){let[e]=(0,Q.useState)(K);return e}function ZM({principal:e,identity:t}){return e&&e.source===`git-config`?{type:`human`,name:z(e.display_name),color:ke(e.id,ee),coeditor:t.coeditor,tabId:t.tabId,principalId:e.id}:e&&e.source===`synthesized`?{type:`human`,name:t.name,color:ke(e.id,ee),coeditor:t.coeditor,tabId:t.tabId}:{type:`human`,name:t.name,color:t.color,coeditor:t.coeditor,tabId:t.tabId}}function QM(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var $M=class{constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&pt(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(je(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(Re(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(it(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(pe(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Se(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(_e(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(lt(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(Ke(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){let{selection:e}=this.editor.state,t=this.getReferencedVirtualElement?.call(this);if(t)return t;if(!this.view?.dom?.parentNode)return;let n=V(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof Be){let t=this.view.nodeDOM(e.from),n=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);n&&(t=n),t&&(r={getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>[t.getBoundingClientRect()]})}if(e instanceof xe){let{$anchorCell:t,$headCell:n}=e,i=t?t.pos:n.pos,a=n?n.pos:t.pos,o=this.view.nodeDOM(i),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():QM(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&I(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},eN=e=>new ie({key:typeof e.pluginKey==`string`?new ae(e.pluginKey):e.pluginKey,view:t=>new $M({view:t,...e})});Qe.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[eN({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var tN=class{constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return Te(e,{textSerializers:ht(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(je(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(Re(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(it(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(pe(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Se(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(_e(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(lt(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(Ke(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){let{selection:e}=this.editor.state,t=V(this.view,e.from,e.to);I({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},nN=e=>new ie({key:typeof e.pluginKey==`string`?new ae(e.pluginKey):e.pluginKey,view:t=>new tN({view:t,...e})});Qe.create({name:`floatingMenu`,addOptions(){return{element:null,options:{},pluginKey:`floatingMenu`,updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,`updatePosition`),!0)}},addProseMirrorPlugins(){return this.options.element?[nN({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function rN(e,t){return e??new ae(t)}var iN=typeof window<`u`?Q.useLayoutEffect:Q.useEffect,aN=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),oN=new Set(`animationIterationCount.aspectRatio.borderImageOutset.borderImageSlice.borderImageWidth.columnCount.columns.fillOpacity.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineClamp.lineHeight.opacity.order.orphans.scale.stopOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeOpacity.strokeWidth.tabSize.widows.zIndex.zoom`.split(`.`)),sN=new Set([`children`,`className`,`style`]),cN=new Set([`tabIndex`]),lN=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),uN={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function dN(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function fN(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function pN(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||lN.has(e)}function mN(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function hN(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:uN[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function gN(e,t){let n=t.defaultPrevented,r=!1,i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{r=!0,t.stopPropagation()}}}),i}function _N(e){return cN.has(e)}function vN(e,t,n){if(t===`tabIndex`){e.tabIndex=Number(n);return}e[t]=n}function yN(e,t){if(t===`tabIndex`){e.removeAttribute(`tabindex`);return}let n=e[t];if(typeof n==`boolean`){e[t]=!1;return}if(typeof n==`number`){e[t]=0;return}e[t]=``}function bN(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||oN.has(e)?String(t):`${t}px`}function xN(e,t){aN.has(t)||e.style.removeProperty(mN(t))}function SN(e,t,n){aN.has(t)||e.style.setProperty(mN(t),bN(t,n))}function CN(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(sN.has(r)||!pN(r)||dN(r,t[r])||dN(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=fN(r);if(a==null||a===!1){_N(r)&&yN(e,r),e.removeAttribute(o);return}if(a===!0){_N(r)&&vN(e,r,!0),e.setAttribute(o,``);return}if(_N(r)){vN(e,r,a);return}e.setAttribute(o,String(a))})}function wN(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute(`class`)}}function TN(e,t,n){let r=t??{},i=n??{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let n=r[t],a=i[t];if(n!==a){if(a==null){xN(e,t);return}SN(e,t,a)}})}function EN(e,t,n){t.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)});let r=[];return Object.entries(n).forEach(([t,n])=>{if(!dN(t,n))return;let{eventName:i,options:a}=hN(t),o=t=>{n(gN(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function DN(e,t){let n=(0,Q.useRef)({}),r=(0,Q.useRef)([]);iN(()=>{let i=n.current;return wN(e,i.className,t.className),TN(e,i.style,t.style),CN(e,i,t),r.current=EN(e,r.current,t),n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var ON=Q.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:c,...l},u)=>{let d=(0,Q.useRef)(document.createElement(`div`)),f=(0,Q.useRef)(rN(e,`bubbleMenu`)).current;DN(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:p}=hr(),m=t||p,h={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:f,shouldShow:a,getReferencedVirtualElement:o,options:s},g=(0,Q.useRef)(h);g.current=h;let[_,v]=(0,Q.useState)(!1),y=(0,Q.useRef)(!0);return(0,Q.useEffect)(()=>{if(m?.isDestroyed)return;if(!m){console.warn(`BubbleMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=d.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=eN({...g.current,editor:m,element:e});m.registerPlugin(t);let n=g.current.pluginKey;return y.current=!0,v(!0),()=>{v(!1),m.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[m]),(0,Q.useEffect)(()=>{if(!(!_||!m||m.isDestroyed)){if(y.current){y.current=!1;return}m.view.dispatch(m.state.tr.setMeta(f,{type:`updateOptions`,options:g.current}))}},[_,m,n,r,a,s,i,o,f]),(0,_a.createPortal)(c,d.current)});Q.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,options:o,children:s,...c},l)=>{let u=(0,Q.useRef)(document.createElement(`div`)),d=(0,Q.useRef)(rN(e,`floatingMenu`)).current;DN(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:f}=hr(),p=t||f,m={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:d,shouldShow:a,options:o},h=(0,Q.useRef)(m);h.current=m;let[g,_]=(0,Q.useState)(!1),v=(0,Q.useRef)(!0);return(0,Q.useEffect)(()=>{if(p?.isDestroyed)return;if(!p){console.warn(`FloatingMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=u.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=nN({...h.current,editor:p,element:e});p.registerPlugin(t);let n=h.current.pluginKey;return v.current=!0,_(!0),()=>{_(!1),p.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[p]),(0,Q.useEffect)(()=>{if(!(!g||!p||p.isDestroyed)){if(v.current){v.current=!1;return}p.view.dispatch(p.state.tr.setMeta(d,{type:`updateOptions`,options:h.current}))}},[g,p,n,r,a,o,i,d]),(0,_a.createPortal)(s,u.current)});var kN=[{name:`paragraph`,label:`Text`,icon:so,isActive:e=>e.isActive(`paragraph`)&&!e.isActive(`list`),command:e=>e.chain().focus().setParagraph().run()},{name:`heading1`,label:`Heading 1`,icon:Qt,isActive:e=>e.isActive(`heading`,{level:1}),command:e=>e.chain().focus().toggleHeading({level:1}).run()},{name:`heading2`,label:`Heading 2`,icon:En,isActive:e=>e.isActive(`heading`,{level:2}),command:e=>e.chain().focus().toggleHeading({level:2}).run()},{name:`heading3`,label:`Heading 3`,icon:Bt,isActive:e=>e.isActive(`heading`,{level:3}),command:e=>e.chain().focus().toggleHeading({level:3}).run()},{name:`bulletList`,label:`Bullet List`,icon:en,isActive:e=>e.isActive(`list`,{ordered:!1})&&!e.isActive(`listItem`,{checked:!0})&&!e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleBulletList().run()},{name:`orderedList`,label:`Ordered List`,icon:yn,isActive:e=>e.isActive(`list`,{ordered:!0}),command:e=>e.chain().focus().toggleOrderedList().run()},{name:`taskList`,label:`Task List`,icon:sn,isActive:e=>e.isActive(`listItem`,{checked:!0})||e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleTaskList().run()},{name:`blockquote`,label:`Quote`,icon:ln,isActive:e=>e.isActive(`blockquote`),command:e=>e.chain().focus().toggleBlockquote().run()},{name:`codeBlock`,label:`Code Block`,icon:bo,isActive:e=>e.isActive(`codeBlock`),command:e=>e.chain().focus().toggleCodeBlock().run()}];function AN(e){let t=(0,$.c)(18),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:jN},t[0]=n,t[1]=r);let{current:i,activeStates:a}=Sn(r),o=i.icon,s;t[2]===o?s=t[3]:(s=(0,Z.jsx)(o,{className:`size-3.5`}),t[2]=o,t[3]=s);let c;t[4]===i.label?c=t[5]:(c=(0,Z.jsx)(`span`,{children:i.label}),t[4]=i.label,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Mn,{className:`size-3 opacity-50`}),t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c?(u=(0,Z.jsx)(wA,{asChild:!0,children:(0,Z.jsxs)(Y,{variant:`ghost`,size:`sm`,className:`gap-1 px-2 text-sm font-medium text-accent-foreground/80`,children:[s,c,l]})}),t[7]=s,t[8]=c,t[9]=u):u=t[9];let d;t[10]!==a||t[11]!==n?(d=kN.map(e=>{let t=e.icon,r=a[e.name];return(0,Z.jsxs)(EA,{className:r?`bg-accent text-accent-foreground`:``,onSelect:()=>{e.command(n)},children:[(0,Z.jsx)(t,{className:`size-4`}),(0,Z.jsx)(`span`,{children:e.label})]},e.name)}),t[10]=a,t[11]=n,t[12]=d):d=t[12];let f;t[13]===d?f=t[14]:(f=(0,Z.jsx)(TA,{align:`start`,sideOffset:8,className:`w-44 max-h-(--radix-dropdown-menu-content-available-height) overflow-y-auto subtle-scrollbar`,children:d}),t[13]=d,t[14]=f);let p;return t[15]!==u||t[16]!==f?(p=(0,Z.jsxs)(CA,{children:[u,f]}),t[15]=u,t[16]=f,t[17]=p):p=t[17],p}function jN(e){let t=Object.fromEntries(kN.map(t=>[t.name,t.isActive(e.editor)]));return{current:kN.find(e=>t[e.name])??kN[0],activeStates:t}}var MN=[{name:`bold`,icon:ga,command:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive(`strong`),shortcut:`⌘B`},{name:`italic`,icon:qa,command:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive(`emphasis`),shortcut:`⌘I`},{name:`underline`,icon:Oo,command:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive(`underline`),shortcut:`⌘U`},{name:`strikethrough`,icon:Co,command:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive(`strike`),shortcut:`⌘⇧X`},{name:`code`,icon:Da,command:e=>e.chain().focus().toggleCode().run(),isActive:e=>e.isActive(`code`),shortcut:`⌘E`},{name:`highlight`,icon:Ka,command:e=>e.chain().focus().toggleHighlight().run(),isActive:e=>e.isActive(`highlight`),shortcut:`⌘⇧H`}];function NN(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:PN},t[0]=n,t[1]=r);let i=Sn(r),a;t[2]!==i||t[3]!==n?(a=MN.map(e=>{let t=e.icon,r=i[e.name];return(0,Z.jsxs)(Ei,{children:[(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":e.name,className:r?`bg-accent text-primary`:`text-accent-foreground`,onMouseDown:t=>{t.preventDefault(),e.command(n)},children:(0,Z.jsx)(t,{className:`size-3.5`})})}),(0,Z.jsxs)(wi,{side:`bottom`,sideOffset:8,children:[(0,Z.jsx)(`span`,{className:`capitalize`,children:e.name}),(0,Z.jsx)(`kbd`,{className:`ml-1.5 text-[10px] opacity-60`,children:e.shortcut})]})]},e.name)}),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;return t[5]===a?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:a}),t[5]=a,t[6]=o),o}function PN(e){return Object.fromEntries(MN.map(t=>[t.name,t.isActive(e.editor)]))}function FN(e){let t=(0,$.c)(46),{editor:n}=e,[r,i]=(0,Q.useState)(!1),[a,o]=(0,Q.useState)(``),s=(0,Q.useRef)(null),c;t[0]===n?c=t[1]:(c=n.isActive(`link`),t[0]=n,t[1]=c);let l=c,u;t[2]===n?u=t[3]:(u=n.getAttributes(`link`).href??``,t[2]=n,t[3]=u);let d=u,f,p;t[4]===n?(f=t[5],p=t[6]):(f=()=>{let e=function(){n.state.selection.empty&&i(!1)};return n.on(`selectionUpdate`,e),()=>{n.off(`selectionUpdate`,e)}},p=[n],t[4]=n,t[5]=f,t[6]=p),(0,Q.useEffect)(f,p);let m,h;t[7]!==d||t[8]!==r?(m=()=>{r&&(o(d),requestAnimationFrame(()=>s.current?.focus()))},h=[r,d],t[7]=d,t[8]=r,t[9]=m,t[10]=h):(m=t[9],h=t[10]),(0,Q.useEffect)(m,h);let g;t[11]!==n||t[12]!==l||t[13]!==a?(g=function(){a.trim()?n.chain().focus().setLink({href:a.trim()}).run():l&&n.chain().focus().unsetLink().run(),i(!1)},t[11]=n,t[12]=l,t[13]=a,t[14]=g):g=t[14];let _=g,v;t[15]===n?v=t[16]:(v=function(){n.chain().focus().unsetLink().run(),i(!1)},t[15]=n,t[16]=v);let y=v,b;t[17]!==_||t[18]!==n?(b=function(e){e.key===`Enter`&&(e.preventDefault(),_()),e.key===`Escape`&&(e.preventDefault(),i(!1),n.chain().focus().run())},t[17]=_,t[18]=n,t[19]=b):b=t[19];let x=b;if(r){let e;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>o(e.target.value),t[20]=e):e=t[20];let n;t[21]!==x||t[22]!==a?(n=(0,Z.jsx)(`input`,{ref:s,type:`url`,placeholder:`Paste link...`,value:a,onChange:e,onKeyDown:x,"aria-label":`Link URL`,className:`h-5 w-44 bg-transparent text-sm border-none outline-none placeholder:text-muted-foreground`}),t[21]=x,t[22]=a,t[23]=n):n=t[23];let r;t[24]===_?r=t[25]:(r=()=>{_()},t[24]=_,t[25]=r);let i;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(ja,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[26]=i):i=t[26];let c;t[27]===r?c=t[28]:(c=(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":`Apply link`,onClick:r,children:i}),t[27]=r,t[28]=c);let u;t[29]!==n||t[30]!==c?(u=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border bg-background px-2 py-1`,children:[n,c]}),t[29]=n,t[30]=c,t[31]=u):u=t[31];let f;t[32]!==d||t[33]!==l||t[34]!==y?(f=l&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Ei,{children:[(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":`Open link in new tab`,onMouseDown:e=>{e.preventDefault(),vr(d)},children:(0,Z.jsx)(ti,{className:`size-3.5`})})}),(0,Z.jsx)(wi,{side:`bottom`,sideOffset:8,children:`Open link in new tab`})]}),(0,Z.jsxs)(Ei,{children:[(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":`Remove link`,onMouseDown:e=>{e.preventDefault(),y()},children:(0,Z.jsx)(Kn,{className:`size-3.5`})})}),(0,Z.jsx)(wi,{side:`bottom`,sideOffset:8,children:`Remove link`})]})]}),t[32]=d,t[33]=l,t[34]=y,t[35]=f):f=t[35];let p;return t[36]!==u||t[37]!==f?(p=(0,Z.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[u,f]}),t[36]=u,t[37]=f,t[38]=p):p=t[38],p}let S=l?`bg-accent text-primary`:`text-accent-foreground`,C,w;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(C=e=>{e.preventDefault(),i(!0)},w=(0,Z.jsx)(Za,{className:`size-3.5`}),t[39]=C,t[40]=w):(C=t[39],w=t[40]);let T;t[41]===S?T=t[42]:(T=(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":`Insert link`,className:S,onMouseDown:C,children:w})}),t[41]=S,t[42]=T);let E;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsxs)(wi,{side:`bottom`,sideOffset:8,children:[`Link`,(0,Z.jsx)(`kbd`,{className:`ml-1.5 text-[10px] opacity-60`,children:`⌘K`})]}),t[43]=E):E=t[43];let D;return t[44]===T?D=t[45]:(D=(0,Z.jsxs)(Ei,{children:[T,E]}),t[44]=T,t[45]=D),D}function IN({editor:e}){if(e.state.selection.empty||e.isActive(`codeBlock`))return!1;let{from:t,to:n}=e.state.selection;return!!e.state.doc.textBetween(t,n,` `).trim()}function LN(e){let t=(0,$.c)(25),{editor:n}=e,r=(0,Q.useRef)(null),[i,a]=(0,Q.useState)(0),o=(0,Q.useRef)(null),s;t[0]!==n.state||t[1]!==n.view?(s=()=>{try{let{from:e,to:t}=n.state.selection;return V(n.view,e,t)}catch{return new DOMRect}},t[0]=n.state,t[1]=n.view,t[2]=s):s=t[2];let c;if(t[3]!==n.view.dom||t[4]!==s){let e={getBoundingClientRect:s,contextElement:n.view.dom};c=()=>{let t=r.current;t&&(o.current?.(),o.current=se(e,t,()=>{I(e,t,{placement:`top`,strategy:`fixed`,middleware:[it(8),je(),Re({padding:8})]}).then(e=>{let{x:n,y:r}=e;t.isConnected&&(t.style.position=`fixed`,t.style.left=`${n}px`,t.style.top=`${r}px`)}).catch(BN)}))},t[3]=n.view.dom,t[4]=s,t[5]=c}else c=t[5];let l=c,u;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>{o.current?.(),o.current=null,a(zN)},t[6]=u):u=t[6];let d=u,f;t[7]===l?f=t[8]:(f={onShow:l,onHide:d,strategy:`fixed`},t[7]=l,t[8]=f);let p;t[9]===n?p=t[10]:(p=(0,Z.jsx)(AN,{editor:n}),t[9]=n,t[10]=p);let m;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(Ng,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),t[11]=m):m=t[11];let h;t[12]!==n||t[13]!==i?(h=(0,Z.jsx)(NN,{editor:n},i),t[12]=n,t[13]=i,t[14]=h):h=t[14];let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(Ng,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),t[15]=g):g=t[15];let _=`${i}-link`,v;t[16]!==n||t[17]!==_?(v=(0,Z.jsx)(FN,{editor:n},_),t[16]=n,t[17]=_,t[18]=v):v=t[18];let y;return t[19]!==n||t[20]!==v||t[21]!==f||t[22]!==p||t[23]!==h?(y=(0,Z.jsxs)(ON,{ref:r,editor:n,appendTo:RN,shouldShow:IN,updateDelay:250,options:f,className:`z-50 flex items-center gap-0.5 rounded-lg border bg-background p-1 shadow-md`,children:[p,m,h,g,v]}),t[19]=n,t[20]=v,t[21]=f,t[22]=p,t[23]=h,t[24]=y):y=t[24],y}function RN(){return document.body}function zN(e){return e+1}function BN(){}var VN=[{name:`addRowBefore`,icon:Bn,label:`Add row above`,command:e=>e.chain().focus().addRowBefore().run()},{name:`addRowAfter`,icon:ur,label:`Add row below`,command:e=>e.chain().focus().addRowAfter().run()},{name:`deleteRow`,icon:Kn,label:`Delete row`,command:e=>e.chain().focus().deleteRow().run()}],HN=[{name:`addColumnBefore`,icon:Er,label:`Add column left`,command:e=>e.chain().focus().addColumnBefore().run()},{name:`addColumnAfter`,icon:Qr,label:`Add column right`,command:e=>e.chain().focus().addColumnAfter().run()},{name:`deleteColumn`,icon:Kn,label:`Delete column`,command:e=>e.chain().focus().deleteColumn().run()}],UN=[{name:`toggleHeaderRow`,icon:To,label:`Toggle header row`,command:e=>e.chain().focus().toggleHeaderRow().run()},{name:`toggleHeaderColumn`,icon:ka,label:`Toggle header column`,command:e=>e.chain().focus().toggleHeaderColumn().run()},{name:`deleteTable`,icon:Ua,label:`Delete table`,command:e=>e.chain().focus().deleteTable().run()}];function WN({editor:e}){return e.isActive(`table`)}function GN(e){let t=(0,$.c)(14),{action:n,editor:r}=e,i=n.icon,a;t[0]!==n||t[1]!==r?(a=e=>{e.preventDefault(),n.command(r)},t[0]=n,t[1]=r,t[2]=a):a=t[2];let o;t[3]===i?o=t[4]:(o=(0,Z.jsx)(i,{className:`size-3.5`}),t[3]=i,t[4]=o);let s;t[5]!==n.label||t[6]!==a||t[7]!==o?(s=(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-xs`,"aria-label":n.label,className:`text-muted-foreground`,onMouseDown:a,children:o})}),t[5]=n.label,t[6]=a,t[7]=o,t[8]=s):s=t[8];let c;t[9]===n.label?c=t[10]:(c=(0,Z.jsx)(wi,{side:`bottom`,sideOffset:8,children:n.label}),t[9]=n.label,t[10]=c);let l;return t[11]!==s||t[12]!==c?(l=(0,Z.jsxs)(Ei,{children:[s,c]}),t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function KN(e){let t=(0,$.c)(13),{editor:n}=e,r;t[0]===n?r=t[1]:(r=VN.map(e=>(0,Z.jsx)(GN,{action:e,editor:n},e.name)),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Ng,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),t[2]=i):i=t[2];let a;t[3]===n?a=t[4]:(a=HN.map(e=>(0,Z.jsx)(GN,{action:e,editor:n},e.name)),t[3]=n,t[4]=a);let o;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Ng,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),t[5]=o):o=t[5];let s;t[6]===n?s=t[7]:(s=UN.map(e=>(0,Z.jsx)(GN,{action:e,editor:n},e.name)),t[6]=n,t[7]=s);let c;return t[8]!==n||t[9]!==r||t[10]!==a||t[11]!==s?(c=(0,Z.jsxs)(ON,{editor:n,shouldShow:WN,updateDelay:100,className:`flex items-center gap-0.5 rounded-lg border bg-background p-1 shadow-md`,children:[r,i,a,o,s]}),t[8]=n,t[9]=r,t[10]=a,t[11]=s,t[12]=c):c=t[12],c}var qN=new WeakMap;function JN(e){let t=document.createElement(`span`);t.classList.add(`collaboration-cursor__caret`),t.style.borderColor=e.color;let n=document.createElement(`div`);return n.classList.add(`collaboration-cursor__label`),n.style.backgroundColor=e.color,n.style.color=ft(e.color),n.textContent=e.name,t.append(n),t}var YN={state:`idle`,count:0,lastFiredAt:null,position:`append`,lastAgentId:null},XN=e=>{let t=(0,$.c)(66),{provider:n,placeholder:r,isSourceMode:i}=e,a=(0,Q.useRef)(null),o=(0,Q.useRef)(YN),s=XM(),{principal:c,activeDocName:l}=Qn(),u=n.configuration.name??``,[d]=(0,Q.useState)(ZN),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null);if(m)throw m;let g=(0,Q.useRef)(null),_;t[0]!==d||t[1]!==u||t[2]!==r||t[3]!==n?(_=()=>{let e;try{let t={viewCount:0,bytes:n.document.getText(`source`).length};e=gn({docName:u,container:document.createElement(`div`),sizeStats:t,factory:e=>{let t=performance.now();return{editor:new Me({element:e,onBeforeCreate:e=>{let{editor:n}=e;qN.set(n,t)},onCreate:e=>{let{editor:t}=e;d.html.setView(t.view);let r=qN.get(t);if(qN.delete(t),r==null)return;let i=performance.now();Wt(`ok/editor/create-tiptap`,{docName:n.configuration.name??`unknown`,ytextLength:n.document.getText(`source`).length},{startTime:r,duration:Math.max(0,i-r)})},editorProps:{attributes:{class:`pt-4 pb-4 h-full`},clipboardTextParser:(e,t,n,r)=>{let i=d.mdManager.parse(e);return r.state.schema.nodeFromJSON(i).content},clipboardTextSerializer:(e,t)=>d.text(e,t),clipboardSerializer:d.html.serializer,handlePaste:(e,t)=>d.paste(e,t),handleDrop:(e,t)=>d.drop(e,t)},extensions:xu([...Hn.map(e=>e.name===`link`||e.name===`wikiLink`?e.configure({docName:n.configuration.name??``}):e),LM.configure({placeholder:r??`Type '/' for commands`,showOnlyCurrent:!0}),Yt.configure({document:n.document}),Qe.create({name:`imageUploadDecoration`,addProseMirrorPlugins(){return[tn]}}),Qe.create({name:`collaborationCursor`,addProseMirrorPlugins(){let e=n.awareness;if(!e)throw Error(`[TiptapEditor] HocuspocusProvider has no awareness instance — cursor plugin cannot initialize`);return[Xn(e,{cursorBuilder:JN})]}})])}),ydoc:n.document,ytext:n.document.getText(`source`),provider:n}}}),g.current=e,p(e.editor)}catch(e){let t=e;console.error(`[TiptapEditor] mountTiptapEditor failed`,t),g.current=null,p(null),h(t instanceof Error?t:Error(String(t)))}return()=>{let e=g.current;e&&Vn(e),g.current=null,p(null)}},t[0]=d,t[1]=u,t[2]=r,t[3]=n,t[4]=_):_=t[4];let v;t[5]!==d||t[6]!==u||t[7]!==n?(v=[u,n,d],t[5]=d,t[6]=u,t[7]=n,t[8]=v):v=t[8],(0,Q.useEffect)(_,v);let y;t[9]!==f||t[10]!==n.configuration.name?(y=()=>{if(f)return jn(f,n.configuration.name??null),()=>{jn(f,null)}},t[9]=f,t[10]=n.configuration.name,t[11]=y):y=t[11];let b;t[12]!==f||t[13]!==n?(b=[f,n],t[12]=f,t[13]=n,t[14]=b):b=t[14],(0,Q.useEffect)(y,b);let x;t[15]!==f||t[16]!==n.configuration.name?(x=()=>{},t[15]=f,t[16]=n.configuration.name,t[17]=x):x=t[17];let S;t[18]!==f||t[19]!==n?(S=[f,n],t[18]=f,t[19]=n,t[20]=S):S=t[20],(0,Q.useEffect)(x,S);let C,w;t[21]===f?(C=t[22],w=t[23]):(C=()=>{if(!f)return;let e=QN,t=null,n=()=>{if(t||!f||f.isDestroyed)return;let n=gr(f);n&&(t=n.dom,t.addEventListener(`keydown`,e),t.addEventListener(`paste`,e),t.addEventListener(`drop`,e),t.addEventListener(`cut`,e))},r=()=>{t&&=(t.removeEventListener(`keydown`,e),t.removeEventListener(`paste`,e),t.removeEventListener(`drop`,e),t.removeEventListener(`cut`,e),null)};return gr(f)?n():f.on(`create`,n),()=>{f.off(`create`,n),r()}},w=[f],t[21]=f,t[22]=C,t[23]=w),(0,Q.useEffect)(C,w);let T,E;t[24]!==f||t[25]!==n.document?(E=()=>{if(!f)return;let e=n.document.getMap(`agent-flash`),t=Date.now(),r=0,i=null,s=null,c=null,l=()=>{let t=null;for(let[,n]of e.entries()){let e=n;e.timestamp&&(!t||e.timestamp>t.timestamp)&&(t={agentId:e.agentId??`unknown`,timestamp:e.timestamp,type:e.type??`insert`,description:e.description})}return t},u=e=>{o.current=e;let t=a.current;t&&(t.setAttribute(`data-agent-flash-state`,e.state),t.setAttribute(`data-agent-flash-count`,String(e.count)),t.setAttribute(`data-agent-flash-position`,e.position),t.setAttribute(`data-agent-flash-agent-id`,e.lastAgentId??``))},d=()=>{let e=l(),t=e?.description?.toLowerCase().includes(`prepend`)?`prepend`:`append`,n={state:`editing`,count:(o.current?.count??0)+1,lastFiredAt:Date.now(),position:t,lastAgentId:e?.agentId??null};u(n),document.dispatchEvent(new CustomEvent(`agent-flash`,{detail:n})),s&&clearTimeout(s),c&&clearTimeout(c),s=window.setTimeout(()=>{let e={...n,state:`settled`};u(e),document.dispatchEvent(new CustomEvent(`agent-flash-end`,{detail:e})),c=window.setTimeout(()=>{u({...e,state:`idle`})},300)},oe)};u(YN);let p=()=>{if(_t(e),!B(e,t)||document.visibilityState!==`visible`)return;let n=Date.now();if(t=n,n-r<500){if(!i){let e=500-(n-r);i=window.setTimeout(()=>{i=null,r=Date.now(),d()},e)}return}r=n,d()};e.observe(p);let m=()=>{document.visibilityState===`visible`?B(e,t)&&(t=Date.now(),r=Date.now(),d()):t=Date.now()};return document.addEventListener(`visibilitychange`,m),()=>{e.unobserve(p),document.removeEventListener(`visibilitychange`,m),i&&clearTimeout(i),s&&clearTimeout(s),c&&clearTimeout(c)}},T=[f,n.document],t[24]=f,t[25]=n.document,t[26]=T,t[27]=E):(T=t[26],E=t[27]),(0,Q.useEffect)(E,T);let D,O;t[28]===n?(D=t[29],O=t[30]):(D=()=>{let e=window.location.hash,t=e.indexOf(`?`),r=t>=0?new URLSearchParams(e.slice(t+1)).get(`anchor`):null;if(!r)return;let i=r,a=0,o,s=!1;function c(){if(s)return;let e=document.getElementById(i);e?(e.scrollIntoView({behavior:`smooth`,block:`start`}),s=!0,n.off(`synced`,c)):a<20&&(a+=1,o=window.setTimeout(c,100))}return c(),n.on(`synced`,c),()=>{o!==void 0&&clearTimeout(o),n.off(`synced`,c)}},O=[n],t[28]=n,t[29]=D,t[30]=O),(0,Q.useEffect)(D,O);let k,A;t[31]===f?(k=t[32],A=t[33]):(k=()=>{if(!f)return;let e=function(e){let t=e.detail;if(!t||t.mode!==`wysiwyg`||!f||f.isDestroyed)return;let n=gr(f);if(!n)return;let r=n.dom.querySelectorAll(`h1, h2, h3, h4, h5, h6`)[t.index];r&&r.scrollIntoView({behavior:`smooth`,block:`start`})};return window.addEventListener(Qi,e),()=>window.removeEventListener(Qi,e)},A=[f],t[31]=f,t[32]=k,t[33]=A),(0,Q.useEffect)(k,A);let j;t[34]!==l||t[35]!==u||t[36]!==s||t[37]!==i||t[38]!==c||t[39]!==n.awareness?(j=()=>{let e=n.awareness;if(e){if(u!==l){e.setLocalState(null);return}e.setLocalState({user:ZM({principal:c,identity:s}),mode:i?`source`:`wysiwyg`})}},t[34]=l,t[35]=u,t[36]=s,t[37]=i,t[38]=c,t[39]=n.awareness,t[40]=j):j=t[40];let M;t[41]!==l||t[42]!==u||t[43]!==s||t[44]!==i||t[45]!==c||t[46]!==n?(M=[n,u,l,s,c,i],t[41]=l,t[42]=u,t[43]=s,t[44]=i,t[45]=c,t[46]=n,t[47]=M):M=t[47],(0,Q.useEffect)(j,M);let N;t[48]===f?N=t[49]:(N=f&&(0,Z.jsx)(LN,{editor:f}),t[48]=f,t[49]=N);let P;t[50]===f?P=t[51]:(P=f&&(0,Z.jsx)(KN,{editor:f}),t[50]=f,t[51]=P);let F,I;t[52]===f?(F=t[53],I=t[54]):(F=(0,Z.jsx)(Ht,{editor:f,className:`h-full`}),I=f&&(0,Z.jsx)(BM,{editor:f}),t[52]=f,t[53]=F,t[54]=I);let L;t[55]===f?L=t[56]:(L=f&&(0,Z.jsx)(JM,{editor:f}),t[55]=f,t[56]=L);let R;t[57]===f?R=t[58]:(R=f&&(0,Z.jsx)($t,{store:qt(f).store}),t[57]=f,t[58]=R);let z;return t[59]!==N||t[60]!==P||t[61]!==F||t[62]!==I||t[63]!==L||t[64]!==R?(z=(0,Z.jsxs)(`div`,{ref:a,className:`tiptap-editor h-full`,"data-agent-flash-state":`idle`,"data-agent-flash-count":`0`,"data-agent-flash-position":`append`,"data-agent-flash-agent-id":``,children:[N,P,F,I,L,R]}),t[59]=N,t[60]=P,t[61]=F,t[62]=I,t[63]=L,t[64]=R,t[65]=z):z=t[65],z};function ZN(){let e=new de({extensions:L});return{mdManager:e,text:Zt({mdManager:e}),html:Tn({mdManager:e}),paste:Dn({mdManager:e}),drop:Cn({mdManager:e})}}function QN(){return Vt()}function $N(e){let t=(0,$.c)(2),{docName:n,provider:r,children:i}=e;(0,Q.use)(fr(n,r));let a;return t[0]===i?a=t[1]:(a=(0,Z.jsx)(Z.Fragment,{children:i}),t[0]=i,t[1]=a),a}var eP=`__back-nav__`;function tP(e){return e instanceof In||e instanceof er||e instanceof Nn||e instanceof Un||e instanceof sr?e.docName:null}function nP(e){return e instanceof In?{title:`Couldn't load document`,summary:`"${e.docName}" took too long. Check your connection.`}:e instanceof er?{title:`Connection dropped`,summary:`Lost connection to "${e.docName}".`}:e instanceof Nn?{title:`Document not found`,summary:`"${e.docName}" doesn't exist.`}:e instanceof Un?{title:`Couldn't open document`,summary:`Something went wrong opening "${e.docName}".`}:e instanceof sr?{title:`Server can't open documents`,summary:`This project's running server doesn't support live editing. Restart Open Knowledge to fix.`}:{title:`Unknown error`,summary:e instanceof Error&&e.message?e.message:`An unexpected error occurred.`}}function rP(e){let t=(0,$.c)(27),{error:n,resetErrorBoundary:r,activeDocName:i,previousDocName:a,onNavigateBack:o}=e,s;t[0]===n?s=t[1]:(s=nP(n),t[0]=n,t[1]=s);let{title:c,summary:l}=s,u=!!a&&!!o,d=(0,Q.useRef)(null),f,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(f=()=>{d.current?.focus()},p=[],t[2]=f,t[3]=p):(f=t[2],p=t[3]),(0,Q.useEffect)(f,p);let m;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(Cb,{size:80,variant:`sleeping`}),t[4]=m):m=t[4];let h;t[5]===c?h=t[6]:(h=(0,Z.jsx)(`h2`,{id:`document-error-title`,className:`text-lg font-medium`,children:c}),t[5]=c,t[6]=h);let g;t[7]===l?g=t[8]:(g=(0,Z.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:l}),t[7]=l,t[8]=g);let _;t[9]!==h||t[10]!==g?(_=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[h,g]}),t[9]=h,t[10]=g,t[11]=_):_=t[11];let v;t[12]===r?v=t[13]:(v=(0,Z.jsx)(Y,{ref:d,variant:`default`,onClick:r,children:`Try again`}),t[12]=r,t[13]=v);let y;t[14]!==i||t[15]!==u||t[16]!==n||t[17]!==o||t[18]!==a||t[19]!==r?(y=u?(0,Z.jsx)(Y,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>{!a||!o||(Yn(tP(n)??i),o(a),r(eP))},children:`Go back`}):null,t[14]=i,t[15]=u,t[16]=n,t[17]=o,t[18]=a,t[19]=r,t[20]=y):y=t[20];let b;t[21]!==v||t[22]!==y?(b=(0,Z.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[v,y]}),t[21]=v,t[22]=y,t[23]=b):b=t[23];let x;return t[24]!==b||t[25]!==_?(x=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`document-error-title`,"data-slot":`document-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-8 p-8 text-center`,children:[m,_,b]}),t[24]=b,t[25]=_,t[26]=x):x=t[26],x}function iP(e){let t=(0,$.c)(17),{activeDocName:n,previousDocName:r,onNavigateBack:i,onRecycle:a,children:o}=e,s;t[0]!==n||t[1]!==i||t[2]!==r?(s=e=>(0,Z.jsx)(rP,{...e,activeDocName:n,previousDocName:r,onNavigateBack:i}),t[0]=n,t[1]=i,t[2]=r,t[3]=s):s=t[3];let c;t[4]===n?c=t[5]:(c=[n],t[4]=n,t[5]=c);let l;t[6]!==n||t[7]!==a?(l=e=>{if(e.reason===`imperative-api`){if(Array.isArray(e.args)&&e.args[0]===eP){console.warn(`[DocumentErrorBoundary] back-nav reset (no recycle)`);return}a(n),console.warn(`[DocumentErrorBoundary] retry recycled ${n}`)}else console.warn(`[DocumentErrorBoundary] reset by key change (${e.prev?.[0]} → ${e.next?.[0]})`)},t[6]=n,t[7]=a,t[8]=l):l=t[8];let u;t[9]===n?u=t[10]:(u=e=>{console.warn(`[DocumentErrorBoundary] rendered fallback for ${n}: ${nP(e).title}`)},t[9]=n,t[10]=u);let d;return t[11]!==o||t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,Z.jsx)(mn,{fallbackRender:s,resetKeys:c,onReset:l,onError:u,children:o}),t[11]=o,t[12]=s,t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}var aP={text:``,number:0,boolean:!1,date:``,list:[]};function oP(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=me(t);return{map:n,keys:ge(t),parseError:r}}function sP(e){let t=(0,$.c)(169),{provider:n}=e,[r,i]=(0,Q.useState)(null),a;t[0]===n?a=t[1]:(a=()=>oP(n),t[0]=n,t[1]=a);let[o,s]=(0,Q.useState)(a),c,l;t[2]===n?(c=t[3],l=t[4]):(c=()=>{let e=qe(n);i(e),s(e.current());let t=e.subscribe(e=>{s(e)});return()=>{t(),e.dispose(),i(t=>t===e?null:t)}},l=[n],t[2]=n,t[3]=c,t[4]=l),(0,Q.useEffect)(c,l);let u=o.map,d=o.keys,f=o.parseError,[p,m]=(0,Q.useState)(!1),h;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(h={},t[5]=h):h=t[5];let[g,_]=(0,Q.useState)(h),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(null),S;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S={},t[6]=S):S=t[6];let[C,w]=(0,Q.useState)(S),T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T={},t[7]=T):T=t[7];let[E,D]=(0,Q.useState)(T),O=n.configuration.name??``,k;t[8]===O?k=t[9]:(k=lP(O),t[8]=O,t[9]=k);let A=Nj(k),j;t[10]!==A.state.data||t[11]!==A.state.status?(j=A.state.status===`ready`?A.state.data.folder.frontmatter_defaults??{}:{},t[10]=A.state.data,t[11]=A.state.status,t[12]=j):j=t[12];let M=j,N;t[13]!==A.state.data||t[14]!==A.state.status?(N=A.state.status===`ready`?A.state.data.frontmatterSources:{},t[13]=A.state.data,t[14]=A.state.status,t[15]=N):N=t[15];let P=N,F;t[16]===r?F=t[17]:(F=function(e){if(!r)return{ok:!1,error:`Connecting…`};let t=r.patch(e);if(t.ok)return{ok:!0};if(t.error.code===`WRITE_ERROR`)return console.warn(`[PropertyPanel] binding write error:`,t.error.detail),{ok:!1,error:t.error.detail};let n=ue(t.error);return{ok:!1,error:t.error.issues[0]?.message??`Invalid patch payload`,fieldErrors:Object.keys(n).length>0?n:void 0}},t[16]=r,t[17]=F);let I=F,L;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(L=function(e){w(t=>{if(!Object.hasOwn(t,e))return t;let n={...t};return delete n[e],n})},t[18]=L):L=t[18];let R=L,z;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(z=function(e,t){if(e.ok)return;let n=e.error??`Failed to update property`,r=e.fieldErrors??{};w(e=>{let i={...e};for(let e of t)i[e]=r[e]??n;return i}),D(e=>{let n={...e};for(let e of t)n[e]=(n[e]??0)+1;return n})},t[19]=z):z=t[19];let B=z,V;t[20]===I?V=t[21]:(V=function(e,t){R(e),B(I({[e]:t}),[e])},t[20]=I,t[21]=V);let H=V,U;t[22]===I?U=t[23]:(U=function(e){R(e),B(I({[e]:null}),[e])},t[22]=I,t[23]=U);let W=U,G;t[24]===r?G=t[25]:(G=function(e,t){if(!r)return{ok:!1,error:`Connecting…`};if(e===t)return{ok:!0};let n=r.rename(e,t);if(n.ok)return{ok:!0};if(n.error.code===`WRITE_ERROR`)return{ok:!1,error:n.error.detail};let i=ue(n.error);return{ok:!1,error:n.error.issues[0]?.message??`Failed to rename`,fieldErrors:Object.keys(i).length>0?i:void 0}},t[24]=r,t[25]=G);let ee=G,te;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(te=function(e,t){return`${e} ${t}`},t[26]=te):te=t[26];let ne=te,re;t[27]!==r||t[28]!==d?(re=function(e){if(!r)return;let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let i=d.map((e,t)=>ne(e,t)),a=i.indexOf(t),o=i.indexOf(n);if(a<0||o<0)return;let s=d.slice(),[c]=s.splice(a,1);if(!c)return;s.splice(o,0,c);let l=r.reorder(s);l.ok||console.warn(`[PropertyPanel] reorder failed:`,l.error)},t[27]=r,t[28]=d,t[29]=re):re=t[29];let ie=re,ae;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(ae={activationConstraint:{distance:4}},t[30]=ae):ae=t[30];let oe;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(oe={coordinateGetter:Sw},t[31]=oe):oe=t[31];let se=Gx(Wx(qS,ae),Wx(HS,oe)),ce;t[32]!==M||t[33]!==H||t[34]!==u?(ce=function(e,t){let n=u[e]??uP(M[e]);if(n===void 0)return;_(n=>({...n,[e]:t}));let r=JA(n,t);(!Object.hasOwn(u,e)||!cP(n,r))&&H(e,r)},t[32]=M,t[33]=H,t[34]=u,t[35]=ce):ce=t[35];let K=ce,q;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(q=function(){y({name:``,type:`text`,value:``,error:null}),m(!1)},t[36]=q):q=t[36];let de=q,{addPropertySignal:fe,clearAddProperty:pe}=uM(),me;t[37]!==fe||t[38]!==O?(me=fe.get(O)??0,t[37]=fe,t[38]=O,t[39]=me):me=t[39];let he=me,ge,_e;t[40]===he?(ge=t[41],_e=t[42]):(ge=()=>{he>0&&(y({name:``,type:`text`,value:``,error:null}),m(!1))},_e=[he],t[40]=he,t[41]=ge,t[42]=_e),(0,Q.useEffect)(ge,_e);let ve,ye;t[43]!==pe||t[44]!==O?(ve=()=>()=>pe(O),ye=[O,pe],t[43]=pe,t[44]=O,t[45]=ve,t[46]=ye):(ve=t[45],ye=t[46]),(0,Q.useEffect)(ve,ye);let be;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(be=function(e){y(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):aP[e];return{...t,type:e,value:n,error:null}})},t[47]=be):be=t[47];let xe=be,Se;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(Se=function(e){y(t=>t&&{...t,value:e})},t[48]=Se):Se=t[48];let Ce=Se,we;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(we=function(e){y(t=>t&&{...t,name:e,error:null})},t[49]=we):we=t[49];let Te=we,Ee;t[50]!==v||t[51]!==I||t[52]!==u?(Ee=function(){if(!v)return;let e=v.name.trim();if(!e){y({...v,error:`Name is required`});return}if(e===`frontmatter`){y({...v,error:`"frontmatter" is a reserved property name`});return}if(Object.hasOwn(u,e)){y({...v,error:`Property "${e}" already exists`});return}let t=I({[e]:v.value});if(t.ok){y(null);return}let n=t.fieldErrors?.[e],r=t.error??`Failed to add property`;y({...v,error:n??r})},t[50]=v,t[51]=I,t[52]=u,t[53]=Ee):Ee=t[53];let De=Ee,ke;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(ke=function(){y(null)},t[54]=ke):ke=t[54];let Ae=ke,je;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(je=function(e){x({key:e,draft:e,error:null})},t[55]=je):je=t[55];let Me=je,Ne;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=function(e){x(t=>t&&{...t,draft:e,error:null})},t[56]=Ne):Ne=t[56];let Pe=Ne,Fe;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=function(){x(null)},t[57]=Fe):Fe=t[57];let Ie=Fe,Le;t[58]!==u||t[59]!==ee||t[60]!==b?(Le=function(){if(!b)return;let e=b.draft.trim();if(!e){x(null);return}if(e===b.key){x(null);return}if(e===`frontmatter`){x({...b,error:`"frontmatter" is a reserved property name`});return}if(Object.hasOwn(u,e)){x({...b,error:`Property "${e}" already exists`});return}let t=ee(b.key,e);if(t.ok){_(t=>{if(!Object.hasOwn(t,b.key))return t;let n={...t};return n[e]=n[b.key],delete n[b.key],n}),R(b.key),x(null);return}let n=t.fieldErrors?.[e]??t.fieldErrors?.[b.key]??t.error??`Failed to rename property`;x({...b,error:n})},t[58]=u,t[59]=ee,t[60]=b,t[61]=Le):Le=t[61];let Re=Le,ze;t[62]!==u||t[63]!==d?(ze=d.length>0?d:Object.keys(u),t[62]=u,t[63]=d,t[64]=ze):ze=t[64];let Be=ze,Ve;if(t[65]!==Be){Ve=new Map;for(let e of Be)Ve.set(e,(Ve.get(e)??0)+1);t[65]=Be,t[66]=Ve}else Ve=t[66];let He,Ue,We,Ge,Ke,Je,Ye,Xe,Ze,Qe,$e,et;if(t[67]!==v||t[68]!==M||t[69]!==P||t[70]!==p||t[71]!==H||t[72]!==Re||t[73]!==Ve||t[74]!==C||t[75]!==ie||t[76]!==u||t[77]!==g||t[78]!==f||t[79]!==W||t[80]!==b||t[81]!==Be||t[82]!==E||t[83]!==se||t[84]!==K){et=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Object.keys(M).filter(e=>!Object.hasOwn(u,e)).sort();if(Be.length===0&&e.length===0&&!v&&!f){et=null;break bb0}Qe=`property-panel editor-content-aligned pt-4 pb-4 text-sm`,$e=`property-panel`,Ue=fn,Ye=!p,t[97]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=e=>m(!e),t[97]=Xe):Xe=t[97];let n=!p,r;t[98]===n?r=t[99]:(r=(0,Z.jsx)(An,{"data-expanded":n,className:`size-3.5 shrink-0 text-muted-foreground transition-transform duration-150 ease-out data-[expanded=true]:rotate-90`}),t[98]=n,t[99]=r);let i;t[100]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`span`,{children:`Properties`}),t[100]=i):i=t[100],t[101]===r?Ze=t[102]:(Ze=(0,Z.jsx)(Rt,{asChild:!0,children:(0,Z.jsxs)(Y,{type:`button`,variant:`ghost`,className:`mb-1.5 flex h-auto w-fit bg-transparent! items-center gap-1 px-1 py-0.5 text-base font-medium text-foreground hover:bg-transparent hover:text-foreground`,children:[r,i]})}),t[101]=r,t[102]=Ze),He=qn,We=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in]`,t[103]===f?Ge=t[104]:(Ge=f?(0,Z.jsxs)(`div`,{role:`alert`,"data-testid":`property-panel-yaml-error`,className:`mb-1 flex items-start gap-1.5 rounded border border-destructive/30 bg-destructive/5 px-2 py-1.5 text-[11px] text-destructive`,children:[(0,Z.jsx)(Oe,{className:`size-3.5 shrink-0 mt-0.5`}),(0,Z.jsxs)(`div`,{children:[`Frontmatter YAML is malformed; fix in source mode to recover.`,(0,Z.jsx)(`span`,{className:`block text-[10px] opacity-80`,children:f})]})]}):null,t[103]=f,t[104]=Ge);let a;if(t[105]!==Be){let e;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(e=(e,t)=>ne(e,t),t[107]=e):e=t[107],a=Be.map(e),t[105]=Be,t[106]=a}else a=t[106];let o;if(t[108]!==M||t[109]!==P||t[110]!==H||t[111]!==Re||t[112]!==Ve||t[113]!==C||t[114]!==u||t[115]!==g||t[116]!==W||t[117]!==b||t[118]!==Be||t[119]!==E||t[120]!==K){let e;t[122]!==M||t[123]!==P||t[124]!==H||t[125]!==Re||t[126]!==Ve||t[127]!==C||t[128]!==u||t[129]!==g||t[130]!==W||t[131]!==b||t[132]!==E||t[133]!==K?(e=(e,t)=>{let n=u[e];if(n===void 0)return null;let r=g[e]??le(n),i=b?.key===e?b:null,a=(Ve.get(e)??0)>1,o=Object.hasOwn(M,e)?(0,Z.jsx)(dP,{source:P[e]??``}):void 0;return(0,Z.jsx)(XA,{sortableId:ne(e,t),keyName:e,value:n,declared:r,error:C[e]??null,resetCounter:E[e]??0,isDuplicate:a,badge:o,rename:{state:i,onBegin:()=>Me(e),onChangeDraft:Pe,onCommit:Re,onCancel:Ie},onCommit:t=>H(e,t),onChangeType:t=>K(e,t),onRemove:()=>W(e)},`${e}-${t}`)},t[122]=M,t[123]=P,t[124]=H,t[125]=Re,t[126]=Ve,t[127]=C,t[128]=u,t[129]=g,t[130]=W,t[131]=b,t[132]=E,t[133]=K,t[134]=e):e=t[134],o=Be.map(e),t[108]=M,t[109]=P,t[110]=H,t[111]=Re,t[112]=Ve,t[113]=C,t[114]=u,t[115]=g,t[116]=W,t[117]=b,t[118]=Be,t[119]=E,t[120]=K,t[121]=o}else o=t[121];let s;t[135]!==a||t[136]!==o?(s=(0,Z.jsx)(uw,{items:a,strategy:ow,children:o}),t[135]=a,t[136]=o,t[137]=s):s=t[137],t[138]!==ie||t[139]!==se||t[140]!==s?(Ke=(0,Z.jsx)(WC,{sensors:se,collisionDetection:$x,onDragEnd:ie,children:s}),t[138]=ie,t[139]=se,t[140]=s,t[141]=Ke):Ke=t[141];let c;t[142]!==M||t[143]!==P||t[144]!==H||t[145]!==C||t[146]!==E||t[147]!==K?(c=e=>{let t=M[e],n=uP(t),r=le(n),i=P[e]??``;return(0,Z.jsx)(XA,{keyName:e,value:n,declared:r,error:C[e]??null,resetCounter:E[e]??0,isInherited:!0,badge:(0,Z.jsx)(rj,{source:i}),onCommit:t=>H(e,t),onChangeType:t=>K(e,t)},`inherited-${e}`)},t[142]=M,t[143]=P,t[144]=H,t[145]=C,t[146]=E,t[147]=K,t[148]=c):c=t[148],Je=e.map(c)}t[67]=v,t[68]=M,t[69]=P,t[70]=p,t[71]=H,t[72]=Re,t[73]=Ve,t[74]=C,t[75]=ie,t[76]=u,t[77]=g,t[78]=f,t[79]=W,t[80]=b,t[81]=Be,t[82]=E,t[83]=se,t[84]=K,t[85]=He,t[86]=Ue,t[87]=We,t[88]=Ge,t[89]=Ke,t[90]=Je,t[91]=Ye,t[92]=Xe,t[93]=Ze,t[94]=Qe,t[95]=$e,t[96]=et}else He=t[85],Ue=t[86],We=t[87],Ge=t[88],Ke=t[89],Je=t[90],Ye=t[91],Xe=t[92],Ze=t[93],Qe=t[94],$e=t[95],et=t[96];if(et!==Symbol.for(`react.early_return_sentinel`))return et;let tt;t[149]!==v||t[150]!==De?(tt=v?(0,Z.jsx)(tj,{draft:v,onChangeName:Te,onChangeType:xe,onChangeValue:Ce,onCommit:De,onCancel:Ae}):(0,Z.jsxs)(Y,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:de,className:`mt-1 flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(co,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:`Add property`})]}),t[149]=v,t[150]=De,t[151]=tt):tt=t[151];let nt;t[152]!==He||t[153]!==We||t[154]!==Ge||t[155]!==Ke||t[156]!==Je||t[157]!==tt?(nt=(0,Z.jsxs)(He,{className:We,children:[Ge,Ke,Je,tt]}),t[152]=He,t[153]=We,t[154]=Ge,t[155]=Ke,t[156]=Je,t[157]=tt,t[158]=nt):nt=t[158];let rt;t[159]!==Ue||t[160]!==Ye||t[161]!==Xe||t[162]!==Ze||t[163]!==nt?(rt=(0,Z.jsxs)(Ue,{open:Ye,onOpenChange:Xe,children:[Ze,nt]}),t[159]=Ue,t[160]=Ye,t[161]=Xe,t[162]=Ze,t[163]=nt,t[164]=rt):rt=t[164];let it;return t[165]!==Qe||t[166]!==$e||t[167]!==rt?(it=(0,Z.jsx)(`div`,{className:Qe,"data-testid":$e,children:rt}),t[165]=Qe,t[166]=$e,t[167]=rt,t[168]=it):it=t[168],it}function cP(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length?e.every((e,n)=>e===t[n]):!1:e===t}function lP(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function uP(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`?e:Array.isArray(e)?e.map(e=>typeof e==`string`?e:JSON.stringify(e)):e==null?``:JSON.stringify(e)}function dP(e){let t=(0,$.c)(2),{source:n}=e,r=`Overrides default from ${n===``?`.ok/frontmatter.yml`:`${n}/.ok/frontmatter.yml`}. Remove to revert.`,i;return t[0]===r?i=t[1]:(i=(0,Z.jsx)(pn,{variant:`primary`,"data-testid":`property-override-badge`,title:r,className:`text-2xs`,children:`overrides`}),t[0]=r,t[1]=i),i}var fP=$n(`LARGE_DOC_CHAR_THRESHOLD`,5e5);function pP(e){let t=e.threshold??fP;return e.ytextLength>t?{renderSource:e.isSourceMode||e.visitedSource,renderVisual:!e.isSourceMode||e.visitedVisual,isLarge:!0}:{renderSource:!0,renderVisual:!0,isLarge:!1}}function mP(e){return e.hasEmittedFirstToggle||!e.isLarge?!1:e.renderSource&&e.renderVisual}var hP=$n(`ACTIVITY_MOUNT_LIMIT`,3);function gP(){return r(()=>import(`./SourceEditor-CR_7DOAH.js`),__vite__mapDeps([32,1,27,2,28,29,14,13,3,6,7,30,4,8,33,16]),import.meta.url)}var _P=(0,Q.lazy)(async()=>({default:(await gP()).SourceEditor}));function vP(e,t,n){if(n<=0)return[];let r=e.filter(e=>!Rn(e.docName)),i=[...r].sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt).slice(0,n);if(t===null||i.some(e=>e.docName===t))return i;let a=r.find(e=>e.docName===t);return a?[...i.slice(0,n-1),a]:i}function yP(e,t){return t.kind===`idle`?null:t.kind===`failed`&&t.failedDocNames.includes(e)?{kind:`failed`,title:`Couldn't reconnect after server restart`,summary:t.reason===`clear-data-timeout`?`Local collaboration data for "${e}" could not be cleared in time. Reload to retry.`:`Local collaboration data for "${e}" could not be cleared. Reload to retry.`,actionLabel:`Reload`}:t.kind===`recovering`&&t.docNames.includes(e)?{kind:`recovering`,title:`Reconnecting after server restart`,summary:t.phase===`clearing-local-cache`?`Clearing local collaboration data for "${e}" before reconnecting.`:`Reopening "${e}" with a fresh local collaboration cache.`}:null}function bP(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(Kt,{name:`activity-pool`,children:(0,Z.jsx)(xP,{...e})}),t[0]=e,t[1]=n),n}function xP(e){let t=(0,$.c)(12),{activeDocName:n,isSourceMode:r,editorPlaceholder:i,previousDocName:a,onNavigateBack:o,onRecycle:s}=e,{poolEntries:c,serverRestartRecovery:l}=Qn(),{pages:u,loading:d}=Ee(),f=vP(c,n,hP),p=(0,Q.useRef)(``),m=f.map(SP).join(`,`);(0,Q.useLayoutEffect)(()=>{if(p.current===m)return;let e=p.current?p.current.split(`,`):[],t=m?m.split(`,`):[];Wt(`ok/activity/mount-list-change`,{active:n,mounted:t,evicted:e.filter(e=>!t.includes(e))}),p.current=m,dr(t)},[m,n]);let h;t[0]!==n||t[1]!==i||t[2]!==r||t[3]!==d||t[4]!==o||t[5]!==s||t[6]!==u||t[7]!==a||t[8]!==l?(h=e=>(0,Z.jsx)(DP,{entry:e,isActive:e.docName===n,isSourceMode:r,editorPlaceholder:i,isNewDoc:!d&&!u.has(e.docName),previousDocName:a,onNavigateBack:o,onRecycle:s,serverRestartRecovery:l},e.docName),t[0]=n,t[1]=i,t[2]=r,t[3]=d,t[4]=o,t[5]=s,t[6]=u,t[7]=a,t[8]=l,t[9]=h):h=t[9];let g=f.map(h),_;return t[10]===g?_=t[11]:(_=(0,Z.jsx)(Z.Fragment,{children:g}),t[10]=g,t[11]=_),_}function SP(e){return e.docName}function CP(e){let t=(0,$.c)(8),{isActive:n,children:r}=e,i=(0,Q.useRef)(null),a=(0,Q.useRef)(0),o,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{let e=i.current;if(!e)return;let t=()=>{e.scrollTop>0&&(a.current=e.scrollTop)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},s=[],t[0]=o,t[1]=s):(o=t[0],s=t[1]),(0,Q.useEffect)(o,s);let c,l;t[2]===n?(c=t[3],l=t[4]):(c=()=>{if(!n)return;let e=i.current;if(!e)return;let t=a.current;if(t===0||(e.scrollTop=t,e.scrollTop===t))return;let r=!1,o=()=>{r||(r=!0,s.disconnect(),clearTimeout(c))},s=new ResizeObserver(()=>{r||!e||e.scrollHeight>t&&(e.scrollTop=t,e.scrollTop===t&&o())});s.observe(e);let c=setTimeout(o,500);return o},l=[n],t[2]=n,t[3]=c,t[4]=l),(0,Q.useLayoutEffect)(c,l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u={overflowAnchor:`auto`},t[5]=u):u=t[5];let d;return t[6]===r?d=t[7]:(d=(0,Z.jsx)(`div`,{ref:i,"data-testid":`editor-scroll-container`,className:`subtle-scrollbar h-full overflow-y-auto`,style:u,children:r}),t[6]=r,t[7]=d),d}function wP(e){let t=(0,$.c)(12),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a}=e,o=r&&i,[s,c]=(0,Q.useState)(o),l,u;if(t[0]===o?(l=t[1],u=t[2]):(l=()=>{o&&c(!0)},u=[o],t[0]=o,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u),!s&&!o)return null;let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)($y,{}),t[3]=d):d=t[3];let f=n.docName,p;t[4]===n.provider.document?p=t[5]:(p=n.provider.document.getText(`source`),t[4]=n.provider.document,t[5]=p);let m;return t[6]!==a||t[7]!==n.docName||t[8]!==n.provider||t[9]!==o||t[10]!==p?(m=(0,Z.jsx)(Q.Suspense,{fallback:d,children:(0,Z.jsx)(_P,{docName:f,ytext:p,provider:n.provider,placeholder:a,isSourceModeActive:o})}),t[6]=a,t[7]=n.docName,t[8]=n.provider,t[9]=o,t[10]=p,t[11]=m):m=t[11],m}function TP(e){let t=(0,$.c)(18),{view:n}=e,r=n.kind===`failed`,i=r?`alert`:`status`,a=!r,o;t[0]===r?o=t[1]:(o=(0,Z.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-full border bg-muted text-muted-foreground`,children:r?(0,Z.jsx)(fo,{className:`size-5`,"aria-hidden":`true`}):(0,Z.jsx)(Jt,{className:`size-5 animate-spin`,"aria-hidden":`true`})}),t[0]=r,t[1]=o);let s;t[2]===n.title?s=t[3]:(s=(0,Z.jsx)(`h2`,{className:`text-lg font-medium`,children:n.title}),t[2]=n.title,t[3]=s);let c;t[4]===n.summary?c=t[5]:(c=(0,Z.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:n.summary}),t[4]=n.summary,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==r||t[10]!==n.actionLabel?(u=r?(0,Z.jsxs)(Y,{type:`button`,onClick:EP,children:[(0,Z.jsx)(fo,{className:`size-4`,"aria-hidden":`true`}),n.actionLabel]}):null,t[9]=r,t[10]=n.actionLabel,t[11]=u):u=t[11];let d;return t[12]!==i||t[13]!==a||t[14]!==o||t[15]!==l||t[16]!==u?(d=(0,Z.jsxs)(`div`,{"data-slot":`server-restart-recovery`,role:i,"aria-busy":a,className:`flex h-full flex-col items-center justify-center gap-6 p-8 text-center`,children:[o,l,u]}),t[12]=i,t[13]=a,t[14]=o,t[15]=l,t[16]=u,t[17]=d):d=t[17],d}function EP(){return window.location.reload()}function DP(e){let t=(0,$.c)(45),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a,isNewDoc:o,previousDocName:s,onNavigateBack:c,onRecycle:l,serverRestartRecovery:u}=e,d;t[0]!==n.docName||t[1]!==u?(d=yP(n.docName,u),t[0]=n.docName,t[1]=u,t[2]=d):d=t[2];let f=d,p=n.provider.document.getText(`source`).length,[m,h]=(0,Q.useState)(i),[g,_]=(0,Q.useState)(!i),v,y;t[3]!==i||t[4]!==m||t[5]!==g?(v=()=>{i&&!m?h(!0):!i&&!g&&_(!0)},y=[i,m,g],t[3]=i,t[4]=m,t[5]=g,t[6]=v,t[7]=y):(v=t[6],y=t[7]),(0,Q.useEffect)(v,y);let b=pP({ytextLength:p,isSourceMode:i,visitedSource:m,visitedVisual:g}),x=(0,Q.useRef)(``),S=`${b.isLarge}-${b.renderSource}-${b.renderVisual}`,C,w;t[8]!==n.docName||t[9]!==b.isLarge||t[10]!==b.renderSource||t[11]!==b.renderVisual||t[12]!==S||t[13]!==i||t[14]!==p?(C=()=>{x.current!==S&&(x.current=S,b.isLarge&&Wt(`ok/activity/defer-mount`,{docName:n.docName,ytextLength:p,isSourceMode:i,renderSource:b.renderSource,renderVisual:b.renderVisual}))},w=[S,b.isLarge,b.renderSource,b.renderVisual,n.docName,p,i],t[8]=n.docName,t[9]=b.isLarge,t[10]=b.renderSource,t[11]=b.renderVisual,t[12]=S,t[13]=i,t[14]=p,t[15]=C,t[16]=w):(C=t[15],w=t[16]),(0,Q.useEffect)(C,w);let[T,E]=(0,Q.useState)(!1),D,O;t[17]!==n.docName||t[18]!==b.isLarge||t[19]!==b.renderSource||t[20]!==b.renderVisual||t[21]!==T||t[22]!==i||t[23]!==p?(D=()=>{mP({isLarge:b.isLarge,renderSource:b.renderSource,renderVisual:b.renderVisual,hasEmittedFirstToggle:T})&&(Wt(`ok/cold/first-toggle`,{docName:n.docName,ytextLength:p,modeEnteredFirst:i?`source`:`visual`}),E(!0))},O=[T,b.isLarge,b.renderSource,b.renderVisual,n.docName,p,i],t[17]=n.docName,t[18]=b.isLarge,t[19]=b.renderSource,t[20]=b.renderVisual,t[21]=T,t[22]=i,t[23]=p,t[24]=D,t[25]=O):(D=t[24],O=t[25]),(0,Q.useEffect)(D,O);let k=r?`visible`:`hidden`,A=`editor:${n.docName}`,j;t[26]!==a||t[27]!==n||t[28]!==b.renderSource||t[29]!==b.renderVisual||t[30]!==r||t[31]!==o||t[32]!==i||t[33]!==c||t[34]!==l||t[35]!==s||t[36]!==f?(j=f?(0,Z.jsx)(TP,{view:f}):(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(iP,{activeDocName:n.docName,previousDocName:s,onNavigateBack:c,onRecycle:l,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)($y,{}),children:(0,Z.jsx)($N,{docName:n.docName,provider:n.provider,children:(0,Z.jsxs)(`div`,{className:`flex h-full flex-col ${i?``:`pt-6`}`,children:[!i&&(0,Z.jsx)(sP,{provider:n.provider}),(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[b.renderSource?(0,Z.jsx)(`div`,{className:i?`h-full`:`ok-mode-hidden h-full`,children:(0,Z.jsx)(wP,{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a})}):null,b.renderVisual?(0,Z.jsx)(`div`,{className:i?`ok-mode-hidden h-full`:`h-full`,children:(0,Z.jsx)(XN,{provider:n.provider,placeholder:a,isSourceMode:i},`${n.docName}-${String(o)}`)}):null]})]})})})})}),t[26]=a,t[27]=n,t[28]=b.renderSource,t[29]=b.renderVisual,t[30]=r,t[31]=o,t[32]=i,t[33]=c,t[34]=l,t[35]=s,t[36]=f,t[37]=j):j=t[37];let M;t[38]!==r||t[39]!==j?(M=(0,Z.jsx)(CP,{isActive:r,children:j}),t[38]=r,t[39]=j,t[40]=M):M=t[40];let N;return t[41]!==M||t[42]!==k||t[43]!==A?(N=(0,Z.jsx)(Q.Activity,{mode:k,name:A,children:M}),t[41]=M,t[42]=k,t[43]=A,t[44]=N):N=t[44],N}function OP(e){let t=(0,$.c)(26),{stats:n}=e,r;t[0]===n.words?r=t[1]:(r=n.words.toLocaleString(),t[0]=n.words,t[1]=r);let i;t[2]===r?i=t[3]:(i=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:r}),t[2]=r,t[3]=i);let a=n.words===1?`word`:`words`,o;t[4]!==i||t[5]!==a?(o=(0,Z.jsxs)(`span`,{children:[i,` `,a]}),t[4]=i,t[5]=a,t[6]=o):o=t[6];let s;t[7]===n.chars?s=t[8]:(s=n.chars.toLocaleString(),t[7]=n.chars,t[8]=s);let c;t[9]===s?c=t[10]:(c=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:s}),t[9]=s,t[10]=c);let l=n.chars===1?`char`:`chars`,u;t[11]!==c||t[12]!==l?(u=(0,Z.jsxs)(`span`,{children:[c,` `,l]}),t[11]=c,t[12]=l,t[13]=u):u=t[13];let d=n.tokens>0?`~`:``,f;t[14]===n.tokens?f=t[15]:(f=n.tokens.toLocaleString(),t[14]=n.tokens,t[15]=f);let p;t[16]===f?p=t[17]:(p=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:f}),t[16]=f,t[17]=p);let m=n.tokens===1?`token`:`tokens`,h;t[18]!==p||t[19]!==m||t[20]!==d?(h=(0,Z.jsxs)(`span`,{children:[d,p,` `,m]}),t[18]=p,t[19]=m,t[20]=d,t[21]=h):h=t[21];let g;return t[22]!==h||t[23]!==o||t[24]!==u?(g=(0,Z.jsxs)(`section`,{"aria-label":`Document statistics`,className:`flex h-6 shrink-0 items-center justify-end gap-3 px-3 text-2xs text-muted-foreground`,children:[o,u,h]}),t[22]=h,t[23]=o,t[24]=u,t[25]=g):g=t[25],g}var kP={fill:`none`,height:24,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`},AP=e=>{let t=(0,$.c)(15),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({color:a,size:o,strokeWidth:s,absoluteStrokeWidth:n,className:c,children:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`currentColor`:a,u=o===void 0?24:o,d=s===void 0?2:s,f=c===void 0?``:c,p=n?Number(d)*24/Number(u):d,m;return t[8]!==r||t[9]!==f||t[10]!==l||t[11]!==i||t[12]!==u||t[13]!==p?(m=(0,Z.jsx)(`svg`,{"aria-hidden":`true`,...kP,className:f,height:u,stroke:l,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:p,width:u,...i,children:r}),t[8]=r,t[9]=f,t[10]=l,t[11]=i,t[12]=u,t[13]=p,t[14]=m):m=t[14],m},jP=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Markdown`}),r=(0,Z.jsx)(`path`,{d:`M232,48H24A16,16,0,0,0,8,64V192a16,16,0,0,0,16,16H232a16,16,0,0,0,16-16V64A16,16,0,0,0,232,48Zm0,144H24V64H232V192ZM128,104v48a8,8,0,0,1-16,0V123.31L93.66,141.66a8,8,0,0,1-11.32,0L64,123.31V152a8,8,0,0,1-16,0V104a8,8,0,0,1,13.66-5.66L88,124.69l26.34-26.35A8,8,0,0,1,128,104Zm77.66,18.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L168,132.69V104a8,8,0,0,1,16,0v28.69l10.34-10.35A8,8,0,0,1,205.66,122.34Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(AP,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},MP=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Textbox`}),r=(0,Z.jsx)(`path`,{d:`M112,40a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80v96a16,16,0,0,0,16,16h80v16a8,8,0,0,0,16,0V48A8,8,0,0,0,112,40ZM24,176V80h80v96ZM248,80v96a16,16,0,0,1-16,16H144a8,8,0,0,1,0-16h88V80H144a8,8,0,0,1,0-16h88A16,16,0,0,1,248,80ZM88,112a8,8,0,0,1-8,8H72v24a8,8,0,0,1-16,0V120H48a8,8,0,0,1,0-16H80A8,8,0,0,1,88,112Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(AP,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},NP=(0,Q.lazy)(()=>r(()=>import(`./SettingsPane-CtgbQZxP.js`).then(e=>({default:e.SettingsPane})),__vite__mapDeps([34,1,27,2,28,29,14,13,3,6,7,30,4,8,35,15]),import.meta.url));function PP(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(Kt,{name:`editor-area`,children:(0,Z.jsx)(cM,{children:(0,Z.jsx)(FP,{...e})})}),t[0]=e,t[1]=n),n}function FP(e){let t=(0,$.c)(127),{editorMode:n,onModeChange:r,activeTab:i,onActiveTabChange:a}=e,o=Yf(),{activeDocName:s,activeProvider:c,activeTarget:l,recycleDocument:u,docPanelMode:d,docPanelExpandSignal:f}=Qn(),{openDocumentTransition:p}=ar(),{requestAddProperty:m}=uM(),h=PM(c,s),g=FM(c),_=g===`connected`||g===`synced`,v=(0,Q.useDeferredValue)(s),y=l?.kind===`missing`,b=!!s&&l?.kind!==`folder`,x=y?`Start writing to create this page…`:void 0,S=Jy(),[C,w]=(0,Q.useState)(!1),{layout:T,autoCollapse:E}=vM(),D=T===`sheet`,[O,k]=(0,Q.useState)(!1),A=(0,Q.useRef)(!1),j,M;t[0]!==E||t[1]!==T||t[2]!==S?(j=()=>{T===`panel`&&(E?(A.current=!1,S.current?.collapse()):A.current||S.current?.expand())},M=[E,T,S],t[0]=E,t[1]=T,t[2]=S,t[3]=j,t[4]=M):(j=t[3],M=t[4]),(0,Q.useEffect)(j,M);let N,P;t[5]!==D||t[6]!==a||t[7]!==S?(N=()=>{let e=e=>{a(e),D?k(!0):(A.current=!1,S.current?.expand())},t=Fd();return t&&e(t),Ld(t=>{Fd(),e(t)})},P=[D,a,S],t[5]=D,t[6]=a,t[7]=S,t[8]=N,t[9]=P):(N=t[8],P=t[9]),(0,Q.useEffect)(N,P);let F,I;t[10]!==f||t[11]!==D||t[12]!==S?(F=()=>{f!==0&&(D?k(!0):(A.current=!1,S.current?.expand()))},I=[f,D,S],t[10]=f,t[11]=D,t[12]=S,t[13]=F,t[14]=I):(F=t[13],I=t[14]),(0,Q.useEffect)(F,I);let L=(0,Q.useRef)(null),[R,z]=(0,Q.useState)(null),B,V;if(t[15]===s?(B=t[16],V=t[17]):(B=()=>{if(s&&s!==L.current){let e=L.current;L.current=s,z(e)}},V=[s],t[15]=s,t[16]=B,t[17]=V),(0,Q.useEffect)(B,V),o.scope!==null){let e;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)($y,{}),t[18]=e):e=t[18];let n;return t[19]!==o.close||t[20]!==o.scope||t[21]!==o.setScope?(n=(0,Z.jsx)(Q.Suspense,{fallback:e,children:(0,Z.jsx)(NP,{scope:o.scope,onClose:o.close,onScopeChange:o.setScope})}),t[19]=o.close,t[20]=o.scope,t[21]=o.setScope,t[22]=n):n=t[22],n}if(l?.kind===`folder`){let e;return t[23]===l.folderPath?e=t[24]:(e=(0,Z.jsx)(nM,{folderPath:l.folderPath}),t[23]=l.folderPath,t[24]=e),e}if(l?.kind===`asset`){let e;return t[25]!==l.assetPath||t[26]!==l.mediaKind?(e=(0,Z.jsx)(Qy,{assetPath:l.assetPath,mediaKind:l.mediaKind}),t[25]=l.assetPath,t[26]=l.mediaKind,t[27]=e):e=t[27],e}if(!c||!s){if((typeof window<`u`?Ge(window.location.hash):null)!==null){let e;return t[28]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)($y,{}),t[28]=e):e=t[28],e}let e;return t[29]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Xb,{}),t[29]=e):e=t[29],e}let H=n===`source`,U=!_,W=D?!O:C,G;t[30]!==s||t[31]!==m?(G=function(){s&&m(s)},t[30]=s,t[31]=m,t[32]=G):G=t[32];let ee=G,te=H?`source`:`wysiwyg`,ne;t[33]===r?ne=t[34]:(ne=e=>{e&&r(e)},t[33]=r,t[34]=ne);let re;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsxs)(Ei,{children:[(0,Z.jsx)(Je,{value:`wysiwyg`,"aria-label":`Visual editor`,asChild:!0,children:(0,Z.jsx)(Ci,{children:(0,Z.jsx)(MP,{})})}),(0,Z.jsx)(wi,{side:`bottom`,children:`Visual`})]}),t[35]=re):re=t[35];let ie;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Z.jsx)(jP,{}),t[36]=ie):ie=t[36];let ae;t[37]===U?ae=t[38]:(ae=(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(`div`,{children:(0,Z.jsx)(Je,{value:`source`,"aria-label":`Markdown source`,disabled:U,className:`rounded-s-none! border-s-0!`,children:ie})})}),t[37]=U,t[38]=ae);let oe=U?`Source mode requires a live connection — your edits are saved and will appear when you reconnect.`:`Markdown`,se;t[39]===oe?se=t[40]:(se=(0,Z.jsx)(wi,{side:`bottom`,children:oe}),t[39]=oe,t[40]=se);let ce;t[41]!==ae||t[42]!==se?(ce=(0,Z.jsxs)(Ei,{children:[ae,se]}),t[41]=ae,t[42]=se,t[43]=ce):ce=t[43];let le;t[44]!==te||t[45]!==ne||t[46]!==ce?(le=(0,Z.jsxs)(be,{type:`single`,value:te,onValueChange:ne,"aria-label":`Editor mode`,variant:`outline`,className:`shrink-0 rounded-lg bg-background/90 p-0.5 shadow-sm backdrop-blur`,children:[re,ce]}),t[44]=te,t[45]=ne,t[46]=ce,t[47]=le):le=t[47];let ue;t[48]!==H||t[49]!==ee?(ue=!H&&(0,Z.jsxs)(Ei,{children:[(0,Z.jsx)(Y,{variant:`outline`,size:`icon`,"aria-label":`Add properties`,onClick:ee,"data-testid":`add-properties-button`,asChild:!0,children:(0,Z.jsx)(Ci,{children:(0,Z.jsx)($a,{})})}),(0,Z.jsx)(wi,{side:`bottom`,children:`Add properties`})]}),t[48]=H,t[49]=ee,t[50]=ue):ue=t[50];let K;t[51]!==C||t[52]!==D||t[53]!==S?(K=()=>{D?k(IP):C?(A.current=!1,S.current?.expand()):(A.current=!0,S.current?.collapse())},t[51]=C,t[52]=D,t[53]=S,t[54]=K):K=t[54];let q=W?`Show document panel`:`Hide document panel`,de;t[55]===W?de=t[56]:(de=(0,Z.jsx)(Ci,{children:W?(0,Z.jsx)(oo,{}):(0,Z.jsx)(ao,{})}),t[55]=W,t[56]=de);let fe;t[57]!==K||t[58]!==q||t[59]!==de?(fe=(0,Z.jsx)(Y,{variant:`outline`,size:`icon`,onClick:K,"aria-label":q,asChild:!0,children:de}),t[57]=K,t[58]=q,t[59]=de,t[60]=fe):fe=t[60];let pe=W?`Show panel`:`Hide panel`,me;t[61]===pe?me=t[62]:(me=(0,Z.jsx)(wi,{side:`bottom`,children:pe}),t[61]=pe,t[62]=me);let he;t[63]!==fe||t[64]!==me?(he=(0,Z.jsxs)(Ei,{children:[fe,me]}),t[63]=fe,t[64]=me,t[65]=he):he=t[65];let ge;t[66]!==ue||t[67]!==he?(ge=(0,Z.jsxs)(fM,{className:`shrink-0 rounded-lg bg-background/90 p-0.5 shadow-sm backdrop-blur`,children:[ue,he]}),t[66]=ue,t[67]=he,t[68]=ge):ge=t[68];let _e;t[69]!==le||t[70]!==ge?(_e=(0,Z.jsxs)(`div`,{className:`absolute top-2 right-2 z-10 flex items-center gap-1`,children:[le,ge]}),t[69]=le,t[70]=ge,t[71]=_e):_e=t[71];let ve=_e,ye=v??s,xe=R??void 0,Se;t[72]===p?Se=t[73]:(Se=e=>{let t=Ie(e);window.location.hash===t?p(e):window.location.hash=t},t[72]=p,t[73]=Se);let Ce;t[74]!==x||t[75]!==H||t[76]!==u||t[77]!==ye||t[78]!==xe||t[79]!==Se?(Ce=(0,Z.jsx)(bP,{activeDocName:ye,isSourceMode:H,editorPlaceholder:x,previousDocName:xe,onNavigateBack:Se,onRecycle:u}),t[74]=x,t[75]=H,t[76]=u,t[77]=ye,t[78]=xe,t[79]=Se,t[80]=Ce):Ce=t[80];let we;t[81]!==s||t[82]!==v?(we=s&&s!==v?(0,Z.jsx)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:(0,Z.jsx)($y,{})}):null,t[81]=s,t[82]=v,t[83]=we):we=t[83];let Te;t[84]!==Ce||t[85]!==we?(Te=(0,Z.jsxs)(`div`,{className:`relative h-full`,children:[Ce,we]}),t[84]=Ce,t[85]=we,t[86]=Te):Te=t[86];let Ee;t[87]!==Te||t[88]!==ve?(Ee=(0,Z.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[Te,ve]}),t[87]=Te,t[88]=ve,t[89]=Ee):Ee=t[89];let De;t[90]!==b||t[91]!==h?(De=b&&(0,Z.jsx)(OP,{stats:h}),t[90]=b,t[91]=h,t[92]=De):De=t[92];let Oe;t[93]!==Ee||t[94]!==De?(Oe=(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col`,children:[Ee,De]}),t[93]=Ee,t[94]=De,t[95]=Oe):Oe=t[95];let ke=Oe;if(D){let e;t[96]===ke?e=t[97]:(e=(0,Z.jsx)(`div`,{className:`min-w-0 flex-1`,children:ke}),t[96]=ke,t[97]=e);let n;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(wg,{className:`sr-only`,children:(0,Z.jsx)(Tg,{children:`Document panel`})}),t[98]=n):n=t[98];let r;t[99]!==s||t[100]!==i||t[101]!==d||t[102]!==H||t[103]!==a?(r=(0,Z.jsxs)(Cg,{side:`right`,className:`flex w-80 sm:w-96 flex-col gap-0 p-0`,children:[n,(0,Z.jsx)(tv,{docName:s,isSourceMode:H,activeTab:i,onActiveTabChange:a,mode:d})]}),t[99]=s,t[100]=i,t[101]=d,t[102]=H,t[103]=a,t[104]=r):r=t[104];let o;t[105]!==O||t[106]!==r?(o=(0,Z.jsx)(bg,{open:O,onOpenChange:k,children:r}),t[105]=O,t[106]=r,t[107]=o):o=t[107];let c;return t[108]!==e||t[109]!==o?(c=(0,Z.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[e,o]}),t[108]=e,t[109]=o,t[110]=c):c=t[110],c}let Ae;t[111]===ke?Ae=t[112]:(Ae=(0,Z.jsx)(mM,{minSize:`30%`,defaultSize:`75%`,children:ke}),t[111]=ke,t[112]=Ae);let je;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,Z.jsx)(hM,{withHandle:!0}),t[113]=je):je=t[113];let Me;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(Me=e=>w(e.asPercentage===0),t[114]=Me):Me=t[114];let Ne;t[115]!==s||t[116]!==i||t[117]!==d||t[118]!==H||t[119]!==a?(Ne=(0,Z.jsx)(tv,{docName:s,isSourceMode:H,activeTab:i,onActiveTabChange:a,mode:d}),t[115]=s,t[116]=i,t[117]=d,t[118]=H,t[119]=a,t[120]=Ne):Ne=t[120];let Pe;t[121]!==S||t[122]!==Ne?(Pe=(0,Z.jsx)(mM,{panelRef:S,defaultSize:`25%`,minSize:`300px`,maxSize:`40%`,collapsible:!0,collapsedSize:0,onResize:Me,className:`flex flex-col bg-muted/20`,children:Ne}),t[121]=S,t[122]=Ne,t[123]=Pe):Pe=t[123];let Fe;return t[124]!==Ae||t[125]!==Pe?(Fe=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1`,children:(0,Z.jsxs)(pM,{orientation:`horizontal`,children:[Ae,je,Pe]})}),t[124]=Ae,t[125]=Pe,t[126]=Fe):Fe=t[126],Fe}function IP(e){return!e}var LP=1280;function RP(){let e=(0,$.c)(2),[t,n]=(0,Q.useState)(zP),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(max-width: ${LP-1}px)`),t=()=>{n(window.innerWidth<LP)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i),t}function zP(){return window.innerWidth<LP}function BP(e){let t=e.endsWith(`rem`)?`rem`:`px`;return{value:Number.parseFloat(e),unit:t}}function VP(e){let{value:t,unit:n}=BP(e);return n===`rem`?t*16:t}function HP(e,t){return`${t===`rem`?e.toFixed(1):Math.round(e)}${t}`}var UP=3600*24*7;function WP(e){let t=(0,$.c)(28),{direction:n,currentWidth:r,onResize:i,onToggle:a,isCollapsed:o,minResizeWidth:s,maxResizeWidth:c,enableToggle:l,enableAutoCollapse:u,autoCollapseThreshold:d,expandThreshold:f,enableDrag:p,setIsDraggingRail:m,widthCookieName:h,widthCookieMaxAge:g,isNested:_}=e,v=n===void 0?`right`:n,y=o===void 0?!1:o,b=s===void 0?`14rem`:s,x=c===void 0?`24rem`:c,S=l===void 0?!0:l,C=u===void 0?!0:u,w=d===void 0?1.5:d,T=f===void 0?.2:f,E=p===void 0?!0:p,D=m===void 0?GP:m,O=g===void 0?UP:g,k=_===void 0?!1:_,A=(0,Q.useRef)(null),j=(0,Q.useRef)(0),M=(0,Q.useRef)(0),N=(0,Q.useRef)(!1),P=(0,Q.useRef)(!1),F=(0,Q.useRef)(null),I=(0,Q.useRef)(0),L=(0,Q.useRef)(!1),R=(0,Q.useRef)(0),z=(0,Q.useRef)(0),B=(0,Q.useRef)(null),V=(0,Q.useRef)(r),H=(0,Q.useRef)(y),U,W;t[0]===r?(U=t[1],W=t[2]):(U=()=>{V.current=r},W=[r],t[0]=r,t[1]=U,t[2]=W),(0,Q.useEffect)(U,W);let G,ee;t[3]===y?(G=t[4],ee=t[5]):(G=()=>{H.current=y},ee=[y],t[3]=y,t[4]=G,t[5]=ee),(0,Q.useEffect)(G,ee);let te=VP(b),ne;t[6]===x?ne=t[7]:(ne=VP(x),t[6]=x,t[7]=ne);let re=ne,ie;t[8]!==E||t[9]!==k?(ie=function(e){P.current=!0,E&&(j.current=H.current?0:VP(V.current),M.current=e.clientX,I.current=e.clientX,F.current=null,L.current=!1,R.current=0,z.current=0,B.current=k&&A.current?A.current.getBoundingClientRect():null,e.preventDefault())},t[8]=E,t[9]=k,t[10]=ie):ie=t[10];let ae=ie,oe,se;t[11]!==w||t[12]!==v||t[13]!==C||t[14]!==S||t[15]!==T||t[16]!==k||t[17]!==re||t[18]!==te||t[19]!==i||t[20]!==a||t[21]!==D||t[22]!==O||t[23]!==h?(oe=()=>{let e=function(e){h&&(document.cookie=`${h}=${e}; path=/; max-age=${O}`)},t=function(e,t){return v===`left`?e<t:e>t},n=function(e,t,n,r){if(k&&r){let r=e.clientX-t;return v===`left`?n-r:n+r}return v===`left`?window.innerWidth-e.clientX:e.clientX},r=function(r){if(!P.current)return;let o=Math.abs(r.clientX-M.current);if(!N.current&&o>5&&(N.current=!0,D(!0)),N.current){let{unit:o}=BP(V.current),s=B.current;k&&A.current&&(s=A.current.getBoundingClientRect());let c=t(r.clientX,I.current)?`expand`:`collapse`;F.current!==c&&(F.current=c),z.current=Math.abs(r.clientX-I.current);let l=Date.now();if(L.current&&l-R.current>200&&(L.current=!1),!L.current){if(C&&a&&!H.current){let e=n(r,M.current,j.current,s),t=!1;if(w<=1)t=e<=te*w;else if(e<=te){let n=te*(w-1);t=te-e>=n}if(c===`collapse`&&t){a(),I.current=r.clientX,L.current=!0,R.current=l;return}}if(a&&H.current&&c===`expand`&&z.current>te*T){a();let t=n(r,M.current,j.current,s),c=Math.max(te,Math.min(re,t)),u=HP(o===`rem`?c/16:c,o);i(u),e(u),I.current=r.clientX,L.current=!0,R.current=l;return}}if(H.current)return;let u=n(r,M.current,j.current,s),d=Math.max(te,Math.min(re,u)),f=HP(o===`rem`?d/16:d,o);i(f),e(f)}},o=function(){P.current&&(!N.current&&a&&S&&a(),N.current=!1,P.current=!1,F.current=null,I.current=0,L.current=!1,R.current=0,z.current=0,B.current=null,D(!1))};return document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,o),()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,o)}},se=[i,a,D,te,re,k,C,w,T,S,h,O,v],t[11]=w,t[12]=v,t[13]=C,t[14]=S,t[15]=T,t[16]=k,t[17]=re,t[18]=te,t[19]=i,t[20]=a,t[21]=D,t[22]=O,t[23]=h,t[24]=oe,t[25]=se):(oe=t[24],se=t[25]),(0,Q.useEffect)(oe,se);let ce;return t[26]===ae?ce=t[27]:(ce={dragRef:A,isDragging:N,handleMouseDown:ae},t[26]=ae,t[27]=ce),ce}function GP(){}var KP=`sidebar_state`,qP=3600*24*7,JP=`18rem`,YP=`3rem`,XP=`\\`,ZP=`app-file-sidebar`,QP=`14rem`,$P=`22rem`,eF=`sidebar_width`,tF=/^\d+(?:\.\d+)?(?:rem|px)$/,nF=Q.createContext(null);function rF(e){if(typeof document>`u`)return e;let t=document.cookie.split(`; `).find(e=>e.startsWith(`${eF}=`))?.split(`=`)[1];if(!t)return e;let n;try{n=decodeURIComponent(t)}catch{return e}return tF.test(n)?n:e}function iF(){let e=Q.use(nF);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function aF(e){let t=(0,$.c)(55),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({defaultOpen:c,open:i,onOpenChange:o,className:r,style:s,children:n,defaultWidth:l,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=c===void 0?!0:c,d=l===void 0?JP:l,f=RP(),p;t[9]===d?p=t[10]:(p=()=>rF(d),t[9]=d,t[10]=p);let[m,h]=Q.useState(p),[g,_]=Q.useState(!1),[v,y]=Q.useState(!1),[b,x]=Q.useState(!1),[S,C]=Q.useState(u),w=i??S,T;t[11]!==w||t[12]!==o?(T=e=>{let t=typeof e==`function`?e(w):e;o?o(t):C(t),document.cookie=`${KP}=${t}; path=/; max-age=${qP}`},t[11]=w,t[12]=o,t[13]=T):T=t[13];let E=T,D;t[14]!==f||t[15]!==E?(D=function(){return f?_(sF):E(oF)},t[14]=f,t[15]=E,t[16]=D):D=t[16];let O=D,k;t[17]!==f||t[18]!==g?(k=function(){!f||!g||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||x(!0)},t[17]=f,t[18]=g,t[19]=k):k=t[19];let A=k,j,M;t[20]===O?(j=t[21],M=t[22]):(j=()=>{let e=e=>{e.key===XP&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),O())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},M=[O],t[20]=O,t[21]=j,t[22]=M),Q.useEffect(j,M);let N,P;t[23]!==f||t[24]!==g?(P=()=>{if(!f||!g)return;let e=e=>{e.key===`Escape`&&(document.querySelector(`[data-state="open"][role="dialog"], [data-state="open"][role="alertdialog"], [data-state="open"][role="menu"], [data-state="open"][role="listbox"], [data-radix-popper-content-wrapper] [data-state="open"]`)||_(!1))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},N=[f,g],t[23]=f,t[24]=g,t[25]=N,t[26]=P):(N=t[25],P=t[26]),Q.useEffect(P,N);let F=Q.useRef(f),I,L;t[27]!==f||t[28]!==w?(I=()=>{!F.current&&f&&_(w),F.current=f},L=[f,w],t[27]=f,t[28]=w,t[29]=I,t[30]=L):(I=t[29],L=t[30]),Q.useEffect(I,L);let R=f?g?`expanded`:`collapsed`:w?`expanded`:`collapsed`,z;t[31]!==v||t[32]!==f||t[33]!==A||t[34]!==w||t[35]!==g||t[36]!==E||t[37]!==b||t[38]!==R||t[39]!==O||t[40]!==m?(z={state:R,open:w,setOpen:E,isMobile:f,openMobile:g,setOpenMobile:_,toggleSidebar:O,width:m,setWidth:h,isDraggingRail:v,setIsDraggingRail:y,showPushPulse:b,setShowPushPulse:x,notifySidebarFileSelected:A},t[31]=v,t[32]=f,t[33]=A,t[34]=w,t[35]=g,t[36]=E,t[37]=b,t[38]=R,t[39]=O,t[40]=m,t[41]=z):z=t[41];let B;t[42]!==s||t[43]!==m?(B={"--sidebar-width":m,"--sidebar-width-icon":YP,...s},t[42]=s,t[43]=m,t[44]=B):B=t[44];let V=B,H;t[45]===r?H=t[46]:(H=J(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),t[45]=r,t[46]=H);let U;t[47]!==n||t[48]!==a||t[49]!==V||t[50]!==H?(U=(0,Z.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:V,className:H,...a,children:n}),t[47]=n,t[48]=a,t[49]=V,t[50]=H,t[51]=U):U=t[51];let W;return t[52]!==z||t[53]!==U?(W=(0,Z.jsx)(nF.Provider,{value:z,children:U}),t[52]=z,t[53]=U,t[54]=W):W=t[54],W}function oF(e){return!e}function sF(e){return!e}function cF(e){let t=(0,$.c)(51),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({side:a,variant:o,collapsible:s,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`left`:a,l=o===void 0?`sidebar`:o,u=s===void 0?`offcanvas`:s,{isMobile:d,state:f,openMobile:p,isDraggingRail:m}=iF();if(u===`none`){let e;t[7]===r?e=t[8]:(e=J(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),t[7]=r,t[8]=e);let a;return t[9]!==n||t[10]!==i||t[11]!==e||t[12]!==l?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar`,"data-variant":l,className:e,...i,children:n}),t[9]=n,t[10]=i,t[11]=e,t[12]=l,t[13]=a):a=t[13],a}if(d){let e=p?`expanded`:`collapsed`,a=l===`floating`||l===`inset`?`p-2`:``,o;t[14]!==r||t[15]!==a?(o=J(`fixed inset-y-0 z-30 flex h-svh w-(--sidebar-width)`,`transition-transform duration-200 ease-linear motion-reduce:transition-none`,`data-[side=left]:left-0 data-[side=right]:right-0`,`group-data-[state=collapsed]:data-[side=left]:-translate-x-full`,`group-data-[state=collapsed]:data-[side=right]:translate-x-full`,a,r),t[14]=r,t[15]=a,t[16]=o):o=t[16];let s;t[17]===n?s=t[18]:(s=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:n}),t[17]=n,t[18]=s);let u;t[19]!==i||t[20]!==c||t[21]!==o||t[22]!==s?(u=(0,Z.jsx)(`nav`,{id:ZP,"aria-label":`File sidebar`,"data-slot":`sidebar-container`,"data-side":c,className:o,...i,children:s}),t[19]=i,t[20]=c,t[21]=o,t[22]=s,t[23]=u):u=t[23];let d;return t[24]!==e||t[25]!==c||t[26]!==u||t[27]!==l?(d=(0,Z.jsx)(`div`,{className:`group peer text-sidebar-foreground`,"data-state":e,"data-variant":l,"data-side":c,"data-slot":`sidebar`,"data-mobile":`true`,children:u}),t[24]=e,t[25]=c,t[26]=u,t[27]=l,t[28]=d):d=t[28],d}let h=f===`collapsed`?u:``,g=l===`floating`||l===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,_;t[29]===g?_=t[30]:(_=J(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,g,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`),t[29]=g,t[30]=_);let v;t[31]===_?v=t[32]:(v=(0,Z.jsx)(`div`,{"data-slot":`sidebar-gap`,className:_}),t[31]=_,t[32]=v);let y=l===`floating`||l===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,b;t[33]!==r||t[34]!==y?(b=J(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex`,y,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`,r),t[33]=r,t[34]=y,t[35]=b):b=t[35];let x;t[36]===n?x=t[37]:(x=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:n}),t[36]=n,t[37]=x);let S;t[38]!==i||t[39]!==c||t[40]!==x||t[41]!==b?(S=(0,Z.jsx)(`div`,{"data-slot":`sidebar-container`,"data-side":c,className:b,...i,children:x}),t[38]=i,t[39]=c,t[40]=x,t[41]=b,t[42]=S):S=t[42];let C;return t[43]!==m||t[44]!==c||t[45]!==f||t[46]!==S||t[47]!==h||t[48]!==v||t[49]!==l?(C=(0,Z.jsxs)(`div`,{className:`group peer hidden text-sidebar-foreground md:block`,"data-state":f,"data-collapsible":h,"data-variant":l,"data-side":c,"data-slot":`sidebar`,"data-dragging":m,children:[v,S]}),t[43]=m,t[44]=c,t[45]=f,t[46]=S,t[47]=h,t[48]=v,t[49]=l,t[50]=C):C=t[50],C}function lF(e){let t=(0,$.c)(16),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{toggleSidebar:a,state:o}=iF(),s=o===`expanded`,c;t[4]===n?c=t[5]:(c=J(n),t[4]=n,t[5]=c);let l;t[6]!==r||t[7]!==a?(l=e=>{r?.(e),a()},t[6]=r,t[7]=a,t[8]=l):l=t[8];let u,d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(hn,{}),d=(0,Z.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`}),t[9]=u,t[10]=d):(u=t[9],d=t[10]);let f;return t[11]!==i||t[12]!==s||t[13]!==c||t[14]!==l?(f=(0,Z.jsxs)(Y,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon-sm`,"aria-expanded":s,"aria-controls":ZP,className:c,onClick:l,...i,children:[u,d]}),t[11]=i,t[12]=s,t[13]=c,t[14]=l,t[15]=f):f=t[15],f}function uF(e){let t=(0,$.c)(22),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,enableDrag:a,onMouseDown:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?!0:a,{toggleSidebar:s,setWidth:c,state:l,width:u,setIsDraggingRail:d}=iF(),f=l===`collapsed`,p;t[5]!==o||t[6]!==d||t[7]!==c||t[8]!==f||t[9]!==s||t[10]!==u?(p={direction:`right`,enableDrag:o,onResize:c,onToggle:s,currentWidth:u,isCollapsed:f,minResizeWidth:QP,maxResizeWidth:$P,setIsDraggingRail:d,widthCookieName:eF,widthCookieMaxAge:qP},t[5]=o,t[6]=d,t[7]=c,t[8]=f,t[9]=s,t[10]=u,t[11]=p):p=t[11];let{dragRef:m,handleMouseDown:h}=WP(p),g;t[12]!==h||t[13]!==r?(g=e=>{r?.(e),e.defaultPrevented||h(e)},t[12]=h,t[13]=r,t[14]=g):g=t[14];let _;t[15]===n?_=t[16]:(_=J(`absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,n),t[15]=n,t[16]=_);let v;return t[17]!==m||t[18]!==i||t[19]!==g||t[20]!==_?(v=(0,Z.jsx)(`button`,{ref:m,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":`Toggle Sidebar`,tabIndex:-1,onMouseDown:g,title:`Toggle Sidebar`,className:_,...i}),t[17]=m,t[18]=i,t[19]=g,t[20]=_,t[21]=v):v=t[21],v}function dF(e){let t=(0,$.c)(21),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,onClick:i,onAnimationEnd:r,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{isMobile:o,openMobile:s,setOpenMobile:c,showPushPulse:l,setShowPushPulse:u}=iF(),d;t[5]!==o||t[6]!==i||t[7]!==s||t[8]!==c?(d=e=>{i?.(e),!e.defaultPrevented&&(!o||!s||e.target?.closest(`[data-sidebar="trigger"]`)||c(!1))},t[5]=o,t[6]=i,t[7]=s,t[8]=c,t[9]=d):d=t[9];let f=d,p;t[10]!==r||t[11]!==u?(p=e=>{r?.(e),e.animationName===`sidebar-push-pulse`&&u(!1)},t[10]=r,t[11]=u,t[12]=p):p=t[12];let m=p,h=l?``:void 0,g;t[13]===n?g=t[14]:(g=J(`relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,`transition-transform duration-200 ease-linear motion-reduce:transition-none`,`peer-data-[mobile=true]:peer-data-[state=expanded]:translate-x-(--sidebar-width)`,n),t[13]=n,t[14]=g);let _;return t[15]!==m||t[16]!==f||t[17]!==a||t[18]!==h||t[19]!==g?(_=(0,Z.jsx)(`main`,{"data-slot":`sidebar-inset`,"data-push-pulse":h,onClick:f,onAnimationEnd:m,className:g,...a}),t[15]=m,t[16]=f,t[17]=a,t[18]=h,t[19]=g,t[20]=_):_=t[20],_}function fF(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function pF(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function mF(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function hF(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`flex w-full min-w-0 flex-col gap-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function gF(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var _F=yt(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-hover hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-hover active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-hover data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground data-active:hover:bg-sidebar-accent [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-hover hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-hover hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function vF(e){let t=(0,$.c)(28),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({asChild:i,isActive:a,variant:o,size:s,tooltip:c,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=i===void 0?!1:i,u=a===void 0?!1:a,d=o===void 0?`default`:o,f=s===void 0?`default`:s,p=l?bt:`button`,{isMobile:m,state:h}=iF(),g;t[8]!==n||t[9]!==f||t[10]!==d?(g=J(_F({variant:d,size:f}),n),t[8]=n,t[9]=f,t[10]=d,t[11]=g):g=t[11];let _;t[12]!==p||t[13]!==u||t[14]!==r||t[15]!==f||t[16]!==g?(_=(0,Z.jsx)(p,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":f,"data-active":u,className:g,...r}),t[12]=p,t[13]=u,t[14]=r,t[15]=f,t[16]=g,t[17]=_):_=t[17];let v=_;if(!c)return v;if(typeof c==`string`){let e;t[18]===c?e=t[19]:(e={children:c},t[18]=c,t[19]=e),c=e}let y;t[20]===v?y=t[21]:(y=(0,Z.jsx)(Ci,{asChild:!0,children:v}),t[20]=v,t[21]=y);let b=h!==`collapsed`||m,x;t[22]!==b||t[23]!==c?(x=(0,Z.jsx)(wi,{side:`right`,align:`center`,hidden:b,...c}),t[22]=b,t[23]=c,t[24]=x):x=t[24];let S;return t[25]!==y||t[26]!==x?(S=(0,Z.jsxs)(Ei,{children:[y,x]}),t[25]=y,t[26]=x,t[27]=S):S=t[27],S}function yF(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.kind!==i.kind)return!1;if(r.kind===`human`&&i.kind===`human`){if(r.clientId!==i.clientId||r.mode!==i.mode||r.tabCount!==i.tabCount)return!1;let e=r.user,t=i.user;if(e.name!==t.name||e.color!==t.color||e.icon!==t.icon)return!1}else if(r.kind===`agent`&&i.kind===`agent`){if(r.agentId!==i.agentId)return!1;let e=r.presence,t=i.presence;if(e.displayName!==t.displayName||e.icon!==t.icon||e.color!==t.color||e.currentDoc!==t.currentDoc||e.mode!==t.mode)return!1}}return!0}function bF(e){let t=new Map;for(let n of e){let e=n.user.principalId;if(typeof e==`string`&&e.length>0){let r=t.get(e);r?r.push(n):t.set(e,[n])}}let n=new Map;for(let[e,r]of t){let t=r.reduce((e,t)=>Math.min(e,t.clientId),1/0);n.set(e,{repClientId:t,count:r.length})}let r=[];for(let t of e){let e=t.user.principalId;if(typeof e==`string`&&e.length>0){let i=n.get(e);i&&i.repClientId===t.clientId&&r.push({...t,tabCount:i.count})}else r.push({...t,tabCount:1})}return r}var xF=1e3,SF=!1;function CF(e,t,n){let r=(0,$.c)(9),i;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={current:[],crossDoc:[]},r[0]=i):i=r[0];let[a,o]=(0,Q.useState)(i),s;r[1]!==n||r[2]!==e?.awareness||r[3]!==t?.awareness?(s=()=>{let r=e?.awareness,i=t?.awareness,a;i==null?a=void 0:Mr(i)?a=i:(a=void 0,SF||(SF=!0,console.warn(`[agent-presence] __system__ provider awareness missing getStates() — presence bar will render without agent peers`)));let s=()=>{let e=[];if(r)for(let[t,n]of r.getStates().entries()){let r=n;if(!r.user||typeof r.user!=`object`)continue;let i=r.user;i.type===`human`&&e.push({kind:`human`,clientId:t,user:i,mode:r.mode??`wysiwyg`,tabCount:1})}let t=bF(e),{current:i,crossDoc:s}=a?Dr(a,n,Date.now()):{current:[],crossDoc:[]},c=wF,l=i.map(c),u=s.map(c),d=[...t,...l],f=u;o(e=>yF(e.current,d)&&yF(e.crossDoc,f)?e:{current:d,crossDoc:f})};s();let c=()=>s(),l=()=>s();r?.on(`change`,c),t?.awareness?.on(`change`,l);let u=setInterval(s,xF);return()=>{r?.off(`change`,c),t?.awareness?.off(`change`,l),clearInterval(u)}},r[1]=n,r[2]=e?.awareness,r[3]=t?.awareness,r[4]=s):s=r[4];let c;return r[5]!==n||r[6]!==e||r[7]!==t?(c=[e,t,n],r[5]=n,r[6]=e,r[7]=t,r[8]=c):c=r[8],(0,Q.useEffect)(s,c),a}function wF(e){let{agentId:t,entry:n}=e;return{kind:`agent`,agentId:t,presence:n}}var TF=`sync-status`;function EF(e,t){let n=(0,$.c)(4),r=(0,Q.useRef)(!1),i=(0,Q.useRef)(!1),a=(0,Q.useRef)(t),o,s;n[0]!==t||n[1]!==e?(o=()=>{a.current!==t&&(a.current=t,r.current=!1,i.current=!1),t&&(e===`synced`&&(r.current=!0),e===`disconnected`&&r.current?(i.current=!0,X.warning(`Connection lost — keep this tab open, your edits will sync when reconnected`,{id:TF,duration:1/0})):i.current&&e===`synced`&&(i.current=!1,X.success(`Reconnected`,{id:TF,duration:3e3})))},s=[e,t],n[0]=t,n[1]=e,n[2]=o,n[3]=s):(o=n[2],s=n[3]),(0,Q.useEffect)(o,s)}var DF=4,OF=3,kF={Bird:ha,Cat:xa,Dog:Na,Fish:La,Mouse:uo,Rabbit:lo,Shrimp:_o,Snail:vo,Squirrel:So,Turtle:Eo};Object.freeze([...Object.keys(kF)]);function AF(e){if(typeof e.principalId==`string`&&e.principalId.length>0)return{kind:`initials`};let t=e.name.split(` `)[1];return t&&Object.hasOwn(kF,t)?{kind:`animal`,animal:t}:{kind:`initials`}}var jF={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`,bot:`Agent`};function MF(e){let t=(0,$.c)(20),{user:n,mode:r,tabCount:i}=e,a=AF(n),o=a.kind===`animal`?kF[a.animal]:void 0,s;t[0]===n.name?s=t[1]:(s=et(n.name),t[0]=n.name,t[1]=s);let c=s,l;t[2]===n.color?l=t[3]:(l=ft(n.color),t[2]=n.color,t[3]=l);let u=l,d=i>1?`${n.name} · ${i} tabs`:n.name,f=i>1?`${n.name}, ${i} concurrent tabs`:n.name,p;t[4]===n.color?p=t[5]:(p={backgroundColor:n.color},t[4]=n.color,t[5]=p);let m;t[6]!==o||t[7]!==u||t[8]!==c?(m=o?(0,Z.jsx)(o,{size:18,color:u,strokeWidth:1.5}):(0,Z.jsx)(`span`,{className:`font-mono text-2xs font-semibold leading-none`,style:{color:u},children:c}),t[6]=o,t[7]=u,t[8]=c,t[9]=m):m=t[9];let h;t[10]!==f||t[11]!==r||t[12]!==p||t[13]!==m?(h=(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(`div`,{"data-presence-badge":`human`,"data-presence-mode":r,role:`img`,"aria-label":f,className:`inline-flex size-7 shrink-0 cursor-default items-center justify-center rounded-full ring-2 ring-background`,style:p,children:m})}),t[10]=f,t[11]=r,t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]===d?g=t[16]:(g=(0,Z.jsx)(wi,{children:d}),t[15]=d,t[16]=g);let _;return t[17]!==h||t[18]!==g?(_=(0,Z.jsxs)(Ei,{children:[h,g]}),t[17]=h,t[18]=g,t[19]=_):_=t[19],_}function NF(e){let t=jF[e.icon];return e.displayName||t||`Agent`}function PF(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(e===`writing`),i=(0,Q.useRef)(null),a,o;return t[0]===e?(a=t[1],o=t[2]):(a=()=>{if(e===`writing`){i.current!==null&&(clearTimeout(i.current),i.current=null),r(!0);return}return i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,r(!1)},600),()=>{i.current!==null&&(clearTimeout(i.current),i.current=null)}},o=[e],t[0]=e,t[1]=a,t[2]=o),(0,Q.useEffect)(a,o),n}function FF(e){let t=(0,$.c)(36),{participant:n,crossDoc:r,scoped:i,onClickAgent:a}=e,{presence:o,agentId:s}=n,c;t[0]===o?c=t[1]:(c=NF(o),t[0]=o,t[1]=c);let l=c,u=PF(o.mode),d=!r&&u,f=i?`ring-primary ring-offset-2 ring-offset-background`:`ring-background`,p=d&&!i?`ring-primary/40 animate-pulse`:``,m;t[2]!==f||t[3]!==p?(m=[`inline-flex size-7 shrink-0 items-center justify-center rounded-full ring-2 cursor-pointer`,f,p].filter(Boolean),t[2]=f,t[3]=p,t[4]=m):m=t[4];let h=m.join(` `),g=r?`true`:void 0,_=i?`true`:void 0,v;t[5]!==o.mode||t[6]!==g||t[7]!==_?(v={"data-presence-badge":`agent`,"data-presence-mode":o.mode,"data-presence-crossdoc":g,"data-presence-scoped":_},t[5]=o.mode,t[6]=g,t[7]=_,t[8]=v):v=t[8];let y=v,b=r&&o.currentDoc?`Open activity panel for ${l}, editing ${o.currentDoc}`:`Open activity panel for ${l}`,x;t[9]===o.color?x=t[10]:(x={backgroundColor:o.color},t[9]=o.color,t[10]=x);let S;t[11]!==s||t[12]!==a?(S=()=>a(s),t[11]=s,t[12]=a,t[13]=S):S=t[13];let C;t[14]===o.icon?C=t[15]:(C=(0,Z.jsx)(Ar,{icon:o.icon,width:16,height:16,className:`text-white`}),t[14]=o.icon,t[15]=C);let w;t[16]!==b||t[17]!==y||t[18]!==h||t[19]!==C||t[20]!==x||t[21]!==S?(w=(0,Z.jsx)(`button`,{type:`button`,...y,"aria-label":b,className:h,style:x,onClick:S,children:C}),t[16]=b,t[17]=y,t[18]=h,t[19]=C,t[20]=x,t[21]=S,t[22]=w):w=t[22];let T=w,E;t[23]===T?E=t[24]:(E=(0,Z.jsx)(Ci,{asChild:!0,children:T}),t[23]=T,t[24]=E);let D;t[25]===l?D=t[26]:(D=(0,Z.jsx)(`span`,{className:`font-medium`,children:l}),t[25]=l,t[26]=D);let O;t[27]!==r||t[28]!==o.currentDoc?(O=r&&o.currentDoc?(0,Z.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[`editing [[`,o.currentDoc,`]]`]}):null,t[27]=r,t[28]=o.currentDoc,t[29]=O):O=t[29];let k;t[30]!==D||t[31]!==O?(k=(0,Z.jsxs)(wi,{className:`flex flex-col gap-0.5`,children:[D,O]}),t[30]=D,t[31]=O,t[32]=k):k=t[32];let A;return t[33]!==E||t[34]!==k?(A=(0,Z.jsxs)(Ei,{children:[E,k]}),t[33]=E,t[34]=k,t[35]=A):A=t[35],A}function IF(e){let t=(0,$.c)(18),{count:n,remainder:r,crossDoc:i,scopedAgentId:a,onClickAgent:o}=e,s=i?`true`:void 0,c=`${n} more ${i?`cross-doc `:``}${n===1?`participant`:`participants`}`,l;t[0]!==n||t[1]!==s||t[2]!==c?(l=(0,Z.jsx)(un,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`presence-overflow`,"data-presence-crossdoc":s,className:`inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full bg-muted font-medium text-muted-foreground text-xs ring-2 ring-background hover:bg-muted/80`,"aria-label":c,children:[`+`,n]})}),t[0]=n,t[1]=s,t[2]=c,t[3]=l):l=t[3];let u;if(t[4]!==i||t[5]!==o||t[6]!==r||t[7]!==a){let e;t[9]!==i||t[10]!==o||t[11]!==a?(e=e=>e.kind===`human`?(0,Z.jsx)(MF,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(FF,{participant:e,crossDoc:i,scoped:a===e.agentId,onClickAgent:o},e.agentId),t[9]=i,t[10]=o,t[11]=a,t[12]=e):e=t[12],u=r.map(e),t[4]=i,t[5]=o,t[6]=r,t[7]=a,t[8]=u}else u=t[8];let d;t[13]===u?d=t[14]:(d=(0,Z.jsx)(cn,{align:`end`,className:`w-auto max-w-xs p-2`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:u})}),t[13]=u,t[14]=d);let f;return t[15]!==l||t[16]!==d?(f=(0,Z.jsxs)(Gn,{children:[l,d]}),t[15]=l,t[16]=d,t[17]=f):f=t[17],f}function LF(e,t,n,r){return e.kind===`human`?(0,Z.jsx)(MF,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(FF,{participant:e,crossDoc:n,scoped:r===e.agentId,onClickAgent:t},e.agentId)}function RF(){let e=(0,$.c)(20),{activeProvider:t,activeDocName:n,systemProvider:r,openActivityPanel:i,docPanelMode:a,docPanelAgentId:o}=Qn(),{current:s,crossDoc:c}=CF(t,r,n);EF(FM(t),n);let l;if(e[0]!==c||e[1]!==s||e[2]!==o||e[3]!==a||e[4]!==i){let t=s.slice(0,DF),n;e[6]===s?n=e[7]:(n=s.slice(DF),e[6]=s,e[7]=n);let r=n,u=c.slice(0,OF),d;e[8]===c?d=e[9]:(d=c.slice(OF),e[8]=c,e[9]=d);let f=d,p=i,m=a===`agent`?o:null,h;e[10]!==p||e[11]!==m?(h=e=>LF(e,p,!1,m),e[10]=p,e[11]=m,e[12]=h):h=e[12];let g=t.map(h),_;e[13]!==r||e[14]!==p||e[15]!==m?(_=r.length>0?(0,Z.jsx)(IF,{count:r.length,remainder:r,crossDoc:!1,scopedAgentId:m,onClickAgent:p}):null,e[13]=r,e[14]=p,e[15]=m,e[16]=_):_=e[16];let v;e[17]!==g||e[18]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,"data-presence-section":`current`,children:[g,_]}),e[17]=g,e[18]=_,e[19]=v):v=e[19],l=(0,Z.jsxs)(`div`,{"data-slot":`presence-bar`,className:`flex items-center px-1 py-1.5`,children:[v,c.length>0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`mx-2 h-4 w-px bg-border`,"aria-hidden":!0,"data-slot":`presence-divider`}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 opacity-60 grayscale`,"data-presence-section":`crossdoc`,children:[u.map(e=>LF(e,p,!0,m)),f.length>0?(0,Z.jsx)(IF,{count:f.length,remainder:f,crossDoc:!0,scopedAgentId:m,onClickAgent:p}):null]})]}):null]}),e[0]=c,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l}else l=e[5];return l}function zF(e,t){return t.trim()}function BF(e){return![``,`.`,`..`].includes(e)&&!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`\0`)}function VF(e,t){let n=zF(e.kind,t),r=e.path.split(`/`);return r[r.length-1]=n,r.join(`/`)}function HF(e){return typeof e==`object`&&!!e&&typeof e.fromDocName==`string`&&typeof e.toDocName==`string`}function UF(e){return typeof e==`object`&&!!e&&typeof e.docName==`string`&&typeof e.rewrites==`number`}function WF(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.ok===!0?Array.isArray(t.renamed)&&t.renamed.every(HF)&&Array.isArray(t.rewrittenDocs)&&t.rewrittenDocs.every(UF):t.ok===!1?typeof t.error==`string`:!1}function GF(e,t){if(t.length===0)return e;let n=new Map(t.map(e=>[e.fromDocName,e.toDocName]));return e.map(e=>dt(e)?e:{...e,docName:n.get(e.docName)??e.docName})}function KF(e,t){if(t.length===0)return e;let n=new Set(t);return e.filter(e=>dt(e)||!n.has(e.docName))}function qF(e,t){return e?t.find(t=>t.fromDocName===e)?.toDocName??e:null}function JF(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`input-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var YF=yt(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function XF(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=J(YF({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Z.jsx)(`div`,{"data-slot":`input-group-addon`,"data-align":a,className:o,onMouseDown:ZF,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function ZF(e){e.target.closest(`button`)||(e.preventDefault(),e.currentTarget.parentElement?.querySelector(`input`)?.focus())}yt(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function QF(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $F(e){let t=(0,$.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=J(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Jn,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var eI=[`.md`,`.mdx`];function tI(e,t){let n=e.lastIndexOf(`/`),r=n<0?e:e.slice(n+1),i=`${r}${t}`;return n<0?{baseName:r,extension:t,label:i,prefix:``}:{baseName:r,extension:t,label:i,prefix:`${e.slice(0,n)}/`}}function nI(e){return e.replace(/[^A-Za-z0-9_-]/g,`-`)}function rI(e){let t=Ie(e);window.location.hash!==t&&(window.location.hash=t)}function iI(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}function aI(e,t){let n=[t,...eI].filter((e,t,n)=>e&&n.indexOf(e)===t),r=e.toLowerCase(),i=n.find(t=>e.length>t.length&&r.endsWith(t.toLowerCase()));return i?e.slice(0,-i.length):e}function oI(){let e=(0,$.c)(36),{activeDocName:t,closeAndClearForRename:n,closeTab:r,openTabs:i,remapTabsForRename:a}=Qn(),{pageMeta:o}=Ee(),s=(0,Q.useRef)(null),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(``),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(!1),g=(0,Q.useRef)(null),_=(0,Q.useRef)(!1),v=(0,Q.useRef)(!1),y=(0,Q.useRef)(null),b=(0,Q.useRef)(t),x;e[0]!==t||e[1]!==i?(x=t?`${t}\u0000${i.join(`\0`)}`:``,e[0]=t,e[1]=i,e[2]=x):x=e[2];let S=x,C,w;e[3]===t?(C=e[4],w=e[5]):(C=()=>{b.current=t},w=[t],e[3]=t,e[4]=C,e[5]=w),(0,Q.useEffect)(C,w);let T,E;e[6]===S?(T=e[7],E=e[8]):(T=()=>{S&&(s.current?.querySelector(`[data-active-tab="true"]`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},E=[S],e[6]=S,e[7]=T,e[8]=E),(0,Q.useEffect)(T,E);let D,O;e[9]===c?(D=e[10],O=e[11]):(D=()=>{c&&(g.current?.focus(),g.current?.select())},O=[c],e[9]=c,e[10]=D,e[11]=O),(0,Q.useEffect)(D,O);let k,A;e[12]!==i||e[13]!==c?(k=()=>{!c||i.includes(c)||(v.current=!0,y.current=null,l(null),d(``),p(null),h(!1))},A=[i,c],e[12]=i,e[13]=c,e[14]=k,e[15]=A):(k=e[14],A=e[15]),(0,Q.useEffect)(k,A);let j,M,N,P,F;if(e[16]!==t||e[17]!==n||e[18]!==r||e[19]!==m||e[20]!==i||e[21]!==o||e[22]!==a||e[23]!==f||e[24]!==u||e[25]!==c){P=Symbol.for(`react.early_return_sentinel`);bb0:{let e=function(e){let t=e.split(`/`);v.current=!1,y.current=null,l(e),d(t[t.length-1]),p(null)},x=function(){v.current=!0,y.current=null,l(null),d(``),p(null),h(!1)},S=async function(){if(v.current){v.current=!1;return}if(_.current)return;let e=c;if(!e){x();return}let t=zF(`file`,aI(u,o.get(e)?.docExt??`.md`)),r=e.split(`/`),i=r[r.length-1];if(t===i){x();return}if(t===y.current){g.current?.focus();return}if(!BF(t)){p(`Name can’t be empty, ".", "..", or contain / or \\`),g.current?.focus();return}let s=VF({kind:`file`,path:e,name:i},t);_.current=!0,h(!0),p(null);try{let r=await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:`file`,fromPath:e,toPath:s})});if(v.current){h(!1),_.current=!1;return}let i;try{i=await r.json()}catch(n){console.warn(`[EditorTabs] rename response JSON parse failed`,{parseErr:n,status:r.status,docName:e,newDocName:s}),p(`Server error (HTTP ${r.status})`),h(!1),_.current=!1,y.current=t,g.current?.focus();return}if(!WF(i)){console.warn(`[EditorTabs] rename failed`,{status:r.status,docName:e,newDocName:s}),p(`Server error (HTTP ${r.status})`),h(!1),_.current=!1,y.current=t,g.current?.focus();return}if(!r.ok||!i.ok){p(i.ok?`Server error (HTTP ${r.status})`:i.error),h(!1),_.current=!1,y.current=t,g.current?.focus();return}let o=i.renamed,c=b.current,u=qF(c,o);await Promise.all(o.flatMap(e=>[n(e.fromDocName),n(e.toDocName)])),a(o),Ze([`files`,`backlinks`,`graph`]),v.current=!0,l(null),d(``),p(null),h(!1),_.current=!1,y.current=null,u&&u!==c&&rI(u)}catch(n){console.warn(`[EditorTabs] rename failed`,{err:n,docName:e,newDocName:s,normalized:t}),p(`Network error — please try again`),h(!1),_.current=!1,y.current=t,g.current?.focus()}};if(i.length===0){P=null;break bb0}F=s,j=`ml-2 flex h-8 min-w-0 touch-manipulation flex-1 items-center gap-1 overflow-x-auto overflow-y-hidden overscroll-x-contain subtle-scrollbar`,M=iI,N=i.map(n=>{let i=n===t,a=o.get(n)?.docExt??`.md`,{baseName:s,extension:l,label:h,prefix:_}=tI(n,a),v=`${_}${h}`,b=c===n,C=`editor-tab-rename-error-${nI(n)}`;return(0,Z.jsx)(`div`,{role:`presentation`,"data-active-tab":i?`true`:void 0,className:J(`group flex h-7 min-w-28 max-w-64 shrink-0 items-center overflow-hidden rounded-md border`,i?`border-border bg-background text-foreground`:`border-transparent text-muted-foreground hover:bg-muted/70 hover:text-foreground`,b&&f&&`border-destructive`),onAuxClick:e=>{e.button===1&&(e.preventDefault(),r(n))},children:b?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(JF,{className:`h-full min-w-0 flex-1 rounded-none border-0 bg-transparent`,children:[(0,Z.jsx)($F,{ref:g,value:u,disabled:m,"aria-label":`Rename ${h}`,"aria-invalid":f?!0:void 0,"aria-describedby":f?C:void 0,"aria-busy":m||void 0,title:f??n,className:`h-full min-w-0 px-2 py-0 text-xs`,onChange:e=>{d(aI(e.target.value,a)),p(null),y.current=null},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),S()):e.key===`Escape`&&(e.preventDefault(),x())},onBlur:S}),(0,Z.jsx)(XF,{align:`inline-end`,"aria-hidden":`true`,className:`pr-2 text-xs`,children:(0,Z.jsx)(QF,{className:`text-xs text-muted-foreground/60`,children:a})})]}),f?(0,Z.jsx)(`span`,{id:C,role:`alert`,className:`sr-only`,children:f}):null]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":v,title:v,className:`flex h-full min-w-0 flex-1 items-center gap-1.5 overflow-hidden px-2 text-left text-xs outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,onClick:()=>{rI(n)},onDoubleClick:t=>{t.preventDefault(),t.stopPropagation(),e(n)},children:[_?(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-muted-foreground/60`,children:_}):null,(0,Z.jsxs)(`span`,{className:J(`flex min-w-0 items-center font-medium`,_?`max-w-[70%] shrink-0`:`flex-1`),children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:l})]})]}),(0,Z.jsx)(`button`,{type:`button`,"aria-label":`Close ${h}`,className:`mr-1 flex size-5 shrink-0 items-center justify-center rounded-sm text-muted-foreground opacity-70 outline-none transition hover:bg-muted hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50 group-hover:opacity-100`,onClick:e=>{e.stopPropagation(),r(n)},children:(0,Z.jsx)(ri,{"aria-hidden":`true`,className:`size-3.5`})})]})},n)})}e[16]=t,e[17]=n,e[18]=r,e[19]=m,e[20]=i,e[21]=o,e[22]=a,e[23]=f,e[24]=u,e[25]=c,e[26]=j,e[27]=M,e[28]=N,e[29]=P,e[30]=F}else j=e[26],M=e[27],N=e[28],P=e[29],F=e[30];if(P!==Symbol.for(`react.early_return_sentinel`))return P;let I;return e[31]!==j||e[32]!==M||e[33]!==N||e[34]!==F?(I=(0,Z.jsx)(`div`,{ref:F,className:j,onWheel:M,children:N}),e[31]=j,e[32]=M,e[33]=N,e[34]=F,e[35]=I):I=e[35],I}function sI(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`LinkedIn`}),r=(0,Z.jsx)(`path`,{d:`M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function cI(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`X (Twitter)`}),r=(0,Z.jsx)(`path`,{d:`M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var lI=[{label:`Documentation`,href:`https://openknowledge.ai/docs`,icon:Lt},{label:`Homepage`,href:`https://openknowledge.ai/`,icon:ei},{label:`Twitter / X`,href:`https://x.com/inkeep`,icon:cI},{label:`LinkedIn`,href:`https://www.linkedin.com/company/inkeep/`,icon:sI}],uI=()=>{let e=(0,$.c)(15),[t,n]=(0,Q.useState)(!1),[r,i]=(0,Q.useState)(!1),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(Ei,{children:[(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(un,{asChild:!0,children:(0,Z.jsxs)(Y,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,children:[(0,Z.jsx)(nn,{className:`size-4`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:`Help & resources`})]})})}),(0,Z.jsx)(wi,{children:`Help & resources`})]}),e[0]=a):a=e[0];let o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(`p`,{className:`font-mono tracking-wide uppercase text-muted-foreground text-xs mb-1`,children:`Setup`}),e[1]=o):o=e[1];let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{i(!1),window.location.hash!==`#settings`&&(window.location.hash=Wf)},e[2]=s):s=e[2];let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,"data-testid":`help-popover-settings`,onClick:s,className:`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left text-sm text-muted-foreground transition-colors hover:bg-azure-900/5 dark:hover:bg-white/20 hover:text-primary`,children:[(0,Z.jsx)(go,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,Z.jsx)(`span`,{children:`Settings…`})]})}),e[3]=c):c=e[3];let l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>{i(!1),n(!0)},e[4]=l):l=e[4];let u,d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsxs)(`ul`,{className:`mb-3 space-y-0.5`,children:[c,(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`button`,{type:`button`,onClick:l,className:`flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left text-sm text-muted-foreground transition-colors hover:bg-azure-900/5 dark:hover:bg-white/20 hover:text-primary`,children:[(0,Z.jsx)($r,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,Z.jsx)(`span`,{children:`Install for Claude Chat & Cowork…`})]})})]}),d=(0,Z.jsx)(`p`,{className:`font-mono tracking-wide uppercase text-muted-foreground text-xs mb-1`,children:`Resources`}),e[5]=u,e[6]=d):(u=e[5],d=e[6]);let f;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsxs)(cn,{align:`end`,className:`w-64 p-3`,children:[o,u,d,(0,Z.jsx)(`nav`,{"aria-label":`Help and resources`,children:(0,Z.jsx)(`ul`,{className:`space-y-0.5`,children:lI.map(dI)})})]}),e[7]=f):f=e[7];let p;e[8]===r?p=e[9]:(p=(0,Z.jsxs)(Gn,{open:r,onOpenChange:i,children:[a,f]}),e[8]=r,e[9]=p);let m;e[10]===t?m=e[11]:(m=(0,Z.jsx)(Hr,{open:t,onOpenChange:n}),e[10]=t,e[11]=m);let h;return e[12]!==p||e[13]!==m?(h=(0,Z.jsxs)(Z.Fragment,{children:[p,m]}),e[12]=p,e[13]=m,e[14]=h):h=e[14],h};function dI(e){let{label:t,href:n,icon:r}=e;return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>Pr(e,n),onAuxClick:e=>Pr(e,n),className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-azure-900/5 dark:hover:bg-white/20 hover:text-primary`,children:[(0,Z.jsx)(r,{"aria-hidden":`true`,className:`size-4 shrink-0`}),t]})},n)}var fI={"claude-cowork":`claude`,"claude-code":`claude`,codex:`openai`,cursor:`cursor`};function pI(e){let t=(0,$.c)(23),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({id:r,style:a,className:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let{resolvedTheme:o}=We(),s=fI[r],c=s?(o===`dark`?mt[s]:void 0)??we[s]:void 0,l;t[5]!==c||t[6]!==a?(l=c?{...a,"--ok-brand-color":c}:a,t[5]=c,t[6]=a,t[7]=l):l=t[7];let u=l,d=c&&`[&_*]:![color:var(--ok-brand-color)]`,f;t[8]!==n||t[9]!==d?(f=J(d,n),t[8]=n,t[9]=d,t[10]=f):f=t[10];let p=f;if(r===`claude-cowork`||r===`claude-code`){let e;return t[11]!==p||t[12]!==u||t[13]!==i?(e=(0,Z.jsx)(Sr,{style:u,className:p,...i}),t[11]=p,t[12]=u,t[13]=i,t[14]=e):e=t[14],e}if(r===`codex`){let e;return t[15]!==p||t[16]!==u||t[17]!==i?(e=(0,Z.jsx)(xr,{style:u,className:p,...i}),t[15]=p,t[16]=u,t[17]=i,t[18]=e):e=t[18],e}if(r===`cursor`){let e;return t[19]!==p||t[20]!==u||t[21]!==i?(e=(0,Z.jsx)(Or,{style:u,className:p,...i}),t[19]=p,t[20]=u,t[21]=i,t[22]=e):e=t[22],e}return null}var mI=`https://github.com/inkeep/open-knowledge/releases`;function hI(e){let{target:t,installState:n,isElectronHost:r}=e;return t.id===`cursor`&&!r?`Desktop only`:n.installed===null?`Detecting…`:n.installed===!1?`Not installed`:null}function gI(e){let{target:t,installState:n,isElectronHost:r}=e;if(t.id===`cursor`&&!r)return{enabled:!1,tooltip:{message:`Cursor handoff requires the desktop build.`,installAction:{label:`Install the Open Knowledge desktop app →`,url:mI}}};if(n.installed===null)return{enabled:!1,tooltip:null};if(n.installed===!1){let e=t.appBrandName??t.displayName;return{enabled:!1,tooltip:{message:`Requires ${e}.`,installAction:{label:`Install ${e} →`,url:t.installUrl},...t.hasWebFallback?{webFallback:{label:`Open in claude.ai →`,url:``}}:{}}}}return{enabled:!0,tooltip:null}}function _I(e){return at(e)}function vI(e){return`Opened ${e} in your browser.`}var yI=`claude.ai`;async function bI(e,t=bp){(await t(at(e))).ok?X.success(vI(yI)):X.error(`Couldn't open ${yI} in your browser.`)}function xI(e){let t=(0,$.c)(73),{target:n,installState:r,isElectronHost:i,prompt:a,onSelect:o}=e,s=e.openExternal??bp,c=e.onWebFallbackSuccess??CI,l=e.onWebFallbackError??SI,u;t[0]!==r||t[1]!==i||t[2]!==n?(u=gI({target:n,installState:r,isElectronHost:i}),t[0]=r,t[1]=i,t[2]=n,t[3]=u):u=t[3];let d=u,f;t[4]!==r||t[5]!==i||t[6]!==n?(f=hI({target:n,installState:r,isElectronHost:i}),t[4]=r,t[5]=i,t[6]=n,t[7]=f):f=t[7];let p=f,m;t[8]!==s||t[9]!==d.tooltip?(m=()=>{d.tooltip&&s(d.tooltip.installAction.url)},t[8]=s,t[9]=d.tooltip,t[10]=m):m=t[10];let h=m,g;t[11]!==l||t[12]!==c||t[13]!==s||t[14]!==a||t[15]!==n?(g=()=>{(async()=>{let e=await s(_I(a));e.ok?c(n):l(n,e.detail??e.reason)})()},t[11]=l,t[12]=c,t[13]=s,t[14]=a,t[15]=n,t[16]=g):g=t[16];let _=g;if(d.enabled){let e=`open-in-agent-item-${n.id}`,r=`Open in ${n.displayName}`,i;t[17]===n.id?i=t[18]:(i=(0,Z.jsx)(pI,{id:n.id,"aria-hidden":`true`}),t[17]=n.id,t[18]=i);let a;t[19]===n.displayName?a=t[20]:(a=(0,Z.jsx)(`span`,{children:n.displayName}),t[19]=n.displayName,t[20]=a);let s;return t[21]!==o||t[22]!==e||t[23]!==r||t[24]!==i||t[25]!==a?(s=(0,Z.jsxs)(EA,{onSelect:o,"data-testid":e,"aria-label":r,children:[i,a]}),t[21]=o,t[22]=e,t[23]=r,t[24]=i,t[25]=a,t[26]=s):s=t[26],s}if(!d.tooltip){let e=p?`Open in ${n.displayName}, ${p}`:`Open in ${n.displayName}`,r=`open-in-agent-item-${n.id}`,i;t[27]===n.id?i=t[28]:(i=(0,Z.jsx)(pI,{id:n.id,"aria-hidden":`true`}),t[27]=n.id,t[28]=i);let a;t[29]===n.displayName?a=t[30]:(a=(0,Z.jsx)(`span`,{className:`flex-1`,children:n.displayName}),t[29]=n.displayName,t[30]=a);let o;t[31]===p?o=t[32]:(o=p?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:p}):null,t[31]=p,t[32]=o);let s;return t[33]!==e||t[34]!==r||t[35]!==i||t[36]!==a||t[37]!==o?(s=(0,Z.jsxs)(EA,{disabled:!0,"data-testid":r,"aria-label":e,children:[i,a,o]}),t[33]=e,t[34]=r,t[35]=i,t[36]=a,t[37]=o,t[38]=s):s=t[38],s}let v=p?`Open in ${n.displayName}, ${p}`:`Open in ${n.displayName}`,y=`open-in-agent-item-${n.id}`,b;t[39]===n.id?b=t[40]:(b=(0,Z.jsx)(pI,{id:n.id,"aria-hidden":`true`,className:`mr-2`}),t[39]=n.id,t[40]=b);let x;t[41]===n.displayName?x=t[42]:(x=(0,Z.jsx)(`span`,{className:`flex-1`,children:n.displayName}),t[41]=n.displayName,t[42]=x);let S;t[43]===p?S=t[44]:(S=p?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:p}):null,t[43]=p,t[44]=S);let C;t[45]!==v||t[46]!==y||t[47]!==b||t[48]!==x||t[49]!==S?(C=(0,Z.jsxs)(MA,{"data-testid":y,"data-row-disabled":``,"aria-label":v,children:[b,x,S]}),t[45]=v,t[46]=y,t[47]=b,t[48]=x,t[49]=S,t[50]=C):C=t[50];let w=`open-in-agent-submenu-${n.id}`,T=`open-in-agent-message-${n.id}`,E;t[51]!==d.tooltip.message||t[52]!==T?(E=(0,Z.jsx)(kA,{className:`font-normal text-muted-foreground text-xs`,"data-testid":T,children:d.tooltip.message}),t[51]=d.tooltip.message,t[52]=T,t[53]=E):E=t[53];let D;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(AA,{}),t[54]=D):D=t[54];let O=`open-in-agent-install-${n.id}`,k;t[55]===d.tooltip.installAction.label?k=t[56]:(k=(0,Z.jsx)(`span`,{children:d.tooltip.installAction.label}),t[55]=d.tooltip.installAction.label,t[56]=k);let A;t[57]!==h||t[58]!==O||t[59]!==k?(A=(0,Z.jsx)(EA,{onSelect:h,"data-testid":O,children:k}),t[57]=h,t[58]=O,t[59]=k,t[60]=A):A=t[60];let j;t[61]!==_||t[62]!==d.tooltip.webFallback||t[63]!==n.id?(j=d.tooltip.webFallback?(0,Z.jsxs)(EA,{onSelect:_,"data-testid":`open-in-agent-web-fallback-${n.id}`,"aria-label":`${d.tooltip.webFallback.label}, opens in browser with prompt pre-filled`,children:[(0,Z.jsx)(`span`,{className:`flex-1`,children:d.tooltip.webFallback.label}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`opens in browser with prompt pre-filled`})]}):null,t[61]=_,t[62]=d.tooltip.webFallback,t[63]=n.id,t[64]=j):j=t[64];let M;t[65]!==E||t[66]!==A||t[67]!==j||t[68]!==w?(M=(0,Z.jsxs)(NA,{className:`min-w-[260px]`,"data-testid":w,children:[E,D,A,j]}),t[65]=E,t[66]=A,t[67]=j,t[68]=w,t[69]=M):M=t[69];let N;return t[70]!==M||t[71]!==C?(N=(0,Z.jsxs)(jA,{children:[C,M]}),t[70]=M,t[71]=C,t[72]=N):N=t[72],N}function SI(){}function CI(){}function wI(e){let t=(0,$.c)(60),{input:n}=e,{states:r,refresh:i}=Zp(),{dispatch:a}=Bp(),[o,s]=(0,Q.useState)(!1),c=typeof window<`u`&&window.okDesktop!=null,l;t[0]===i?l=t[1]:(l=e=>{s(e),e&&i()},t[0]=i,t[1]=l);let u=l,d=n===null,f;t[2]===n?f=t[3]:(f=n===null?``:Pe(n.docContext),t[2]=n,t[3]=f);let p=f,m;t[4]!==a||t[5]!==n?(m=e=>{n!==null&&a(e.id,n)},t[4]=a,t[5]=n,t[6]=m):m=t[6];let h=m,g,_,v,y,b,x,S,C,w,T,E,D;if(t[7]!==u||t[8]!==h||t[9]!==n||t[10]!==o||t[11]!==p||t[12]!==r||t[13]!==d){let e;t[26]===r?e=t[27]:(e=e=>r[e.id]?.installed===!0,t[26]=r,t[27]=e);let i=Uf.filter(e);v=r[`claude-cowork`]?.installed===!0;let a;t[28]!==n||t[29]!==p?(a=()=>{n!==null&&bI(p)},t[28]=n,t[29]=p,t[30]=a):a=t[30],y=a,_=CA,D=o,b=u;let s;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(kr,{className:`size-4`}),t[31]=s):s=t[31];let l;t[32]===d?l=t[33]:(l=(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(wA,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-sm`,"aria-label":`Edit with AI`,disabled:d,className:`text-muted-foreground`,"data-testid":`open-in-agent-trigger`,children:s})})}),t[32]=d,t[33]=l);let f;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(wi,{children:`Edit with AI`}),t[34]=f):f=t[34],t[35]===l?x=t[36]:(x=(0,Z.jsxs)(Ei,{children:[l,f]}),t[35]=l,t[36]=x),g=TA,S=`end`,C=`min-w-[220px]`,w=`open-in-agent-menu`,t[37]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(kA,{className:`font-mono font-normal tracking-wide uppercase text-muted-foreground text-xs`,children:`Open in…`}),t[37]=T):T=t[37];let m;t[38]!==h||t[39]!==p||t[40]!==r?(m=e=>{let t=r[e.id];return(0,Z.jsx)(xI,{target:e,installState:t,isElectronHost:c,prompt:p,onSelect:()=>h(e)},e.id)},t[38]=h,t[39]=p,t[40]=r,t[41]=m):m=t[41],E=i.map(m),t[7]=u,t[8]=h,t[9]=n,t[10]=o,t[11]=p,t[12]=r,t[13]=d,t[14]=g,t[15]=_,t[16]=v,t[17]=y,t[18]=b,t[19]=x,t[20]=S,t[21]=C,t[22]=w,t[23]=T,t[24]=E,t[25]=D}else g=t[14],_=t[15],v=t[16],y=t[17],b=t[18],x=t[19],S=t[20],C=t[21],w=t[22],T=t[23],E=t[24],D=t[25];let O;t[42]!==v||t[43]!==y||t[44]!==n?(O=v?null:(0,Z.jsxs)(EA,{onSelect:y,disabled:n===null,"data-testid":`open-in-agent-claude-web-fallback`,"aria-label":`Open in claude.ai, opens in browser with prompt pre-filled`,children:[(0,Z.jsx)(ir,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:`Open in claude.ai →`}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`opens in browser`})]}),t[42]=v,t[43]=y,t[44]=n,t[45]=O):O=t[45];let k;t[46]!==g||t[47]!==O||t[48]!==S||t[49]!==C||t[50]!==w||t[51]!==T||t[52]!==E?(k=(0,Z.jsxs)(g,{align:S,className:C,"data-testid":w,children:[T,E,O]}),t[46]=g,t[47]=O,t[48]=S,t[49]=C,t[50]=w,t[51]=T,t[52]=E,t[53]=k):k=t[53];let A;return t[54]!==_||t[55]!==b||t[56]!==x||t[57]!==k||t[58]!==D?(A=(0,Z.jsxs)(_,{open:D,onOpenChange:b,children:[x,k]}),t[54]=_,t[55]=b,t[56]=x,t[57]=k,t[58]=D,t[59]=A):A=t[59],A}function TI(e){if(!e)return`never`;let t=Date.now()-new Date(e).getTime();return t<6e4?`just now`:t<36e5?`${Math.floor(t/6e4)} min ago`:t<864e5?`${Math.floor(t/36e5)}h ago`:new Date(e).toLocaleDateString()}async function EI(e){await fetch(`/api/sync/trigger`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({op:e})})}function DI(e){let t=(0,$.c)(9),{status:n}=e;switch(n.state){case`dormant`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ea,{className:`size-3.5 text-muted-foreground`}),t[0]=e):e=t[0],e}case`idle`:{if(n.ahead>0||n.behind>0){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(fo,{className:`size-3.5 text-muted-foreground`}),t[1]=e):e=t[1],e}let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ea,{className:`size-3.5 text-emerald-500`}),t[2]=e):e=t[2],e}case`fetching`:case`pulling`:case`pushing`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(fo,{className:`size-3.5 text-muted-foreground animate-spin`}),t[3]=e):e=t[3],e}case`conflict`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Oe,{className:`size-3.5 text-amber-500`}),t[4]=e):e=t[4],e}case`offline`:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ta,{className:`size-3.5 text-muted-foreground`}),t[5]=e):e=t[5],e}case`auth-error`:{let e;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(to,{className:`size-3.5 text-destructive`}),t[6]=e):e=t[6],e}case`disabled`:{let e;return t[7]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Oe,{className:`size-3.5 text-amber-500`}),t[7]=e):e=t[7],e}default:{let e;return t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ea,{className:`size-3.5 text-muted-foreground`}),t[8]=e):e=t[8],e}}}function OI(e){switch(e.state){case`idle`:return e.ahead>0?`↑${e.ahead}`:e.behind>0?`↓${e.behind}`:``;case`fetching`:case`pulling`:case`pushing`:return``;case`conflict`:return e.conflictCount>0?`${e.conflictCount}`:``;case`offline`:return``;case`auth-error`:return``;default:return``}}function kI(e){switch(e){case`dormant`:return`No git remote`;case`idle`:return`Synced`;case`fetching`:return`Fetching…`;case`pulling`:return`Pulling…`;case`pushing`:return`Pushing…`;case`conflict`:return`Conflict`;case`offline`:return`Offline`;case`auth-error`:return`Sign in required`;case`disabled`:return`Sync disabled`;default:return e}}function AI(e){switch(e){case`external-changes-pending`:return`External changes pending`;case`dirty-tree`:return`Working tree has uncommitted changes`;case`detached-head`:return`Detached HEAD — checkout a branch to resume`;case`auth-error`:return`Sign in required`;case`protected-branch`:return`Protected branch — cannot push`;default:return e}}function jI(e){return e.syncEnabled?e.state===`idle`?e.ahead>0&&e.behind>0?`${e.ahead} ahead, ${e.behind} behind`:e.ahead>0?`${e.ahead} ahead`:e.behind>0?`${e.behind} behind`:`Synced`:e.state===`conflict`&&e.conflictCount>0?`${e.conflictCount} conflict${e.conflictCount===1?``:`s`}`:kI(e.state):`Sync off`}function MI(e){let t=(0,$.c)(75),{status:n,onSignIn:r,onOpenConflictResolver:i,onSetIdentity:a}=e,o=n.syncEnabled,{confirmOpen:s,setConfirmOpen:c,onToggleRequest:l,onConfirm:u}=Lr(Ur()),d;t[0]===n?d=t[1]:(d=(0,Z.jsx)(DI,{status:n}),t[0]=n,t[1]=d);let f;t[2]===n.state?f=t[3]:(f=kI(n.state),t[2]=n.state,t[3]=f);let p;t[4]===f?p=t[5]:(p=(0,Z.jsx)(`span`,{className:`text-sm font-medium truncate`,children:f}),t[4]=f,t[5]=p);let m;t[6]!==d||t[7]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[d,p]}),t[6]=d,t[7]=p,t[8]=m):m=t[8];let h=o?`Disable sync`:`Enable sync`,g;t[9]!==o||t[10]!==l||t[11]!==h?(g=(0,Z.jsx)(Ut,{checked:o,onCheckedChange:l,"aria-label":h}),t[9]=o,t[10]=l,t[11]=h,t[12]=g):g=t[12];let _;t[13]!==m||t[14]!==g?(_=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[m,g]}),t[13]=m,t[14]=g,t[15]=_):_=t[15];let v;t[16]!==s||t[17]!==u||t[18]!==c?(v=(0,Z.jsx)(qr,{open:s,onOpenChange:c,onConfirm:u}),t[16]=s,t[17]=u,t[18]=c,t[19]=v):v=t[19];let y;t[20]===n.error?y=t[21]:(y=n.error&&(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:n.error}),t[20]=n.error,t[21]=y);let b;t[22]===n.pausedReason?b=t[23]:(b=n.pausedReason&&(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:AI(n.pausedReason)}),t[22]=n.pausedReason,t[23]=b);let x;t[24]===n.state?x=t[25]:(x=n.state===`conflict`&&(0,Z.jsx)(`p`,{className:`text-xs text-amber-700 dark:text-amber-400`,children:`Sync paused — resolve conflicts to resume.`}),t[24]=n.state,t[25]=x);let S;t[26]!==o||t[27]!==n.lastSyncUtc||t[28]!==n.state?(S=o&&n.state!==`dormant`&&(0,Z.jsxs)(`div`,{children:[`Last synced: `,TI(n.lastSyncUtc)]}),t[26]=o,t[27]=n.lastSyncUtc,t[28]=n.state,t[29]=S):S=t[29];let C;t[30]===n.ahead?C=t[31]:(C=n.ahead>0&&(0,Z.jsxs)(`div`,{children:[n.ahead,` commit`,n.ahead===1?``:`s`,` ahead`]}),t[30]=n.ahead,t[31]=C);let w;t[32]===n.behind?w=t[33]:(w=n.behind>0&&(0,Z.jsxs)(`div`,{children:[n.behind,` commit`,n.behind===1?``:`s`,` behind`]}),t[32]=n.behind,t[33]=w);let T;t[34]===n.conflictCount?T=t[35]:(T=n.conflictCount>0&&(0,Z.jsxs)(`div`,{children:[n.conflictCount,` file`,n.conflictCount===1?``:`s`,` conflicted`]}),t[34]=n.conflictCount,t[35]=T);let E;t[36]===o?E=t[37]:(E=!o&&(0,Z.jsx)(`div`,{children:`Sync is off — your edits will not sync to the remote repository.`}),t[36]=o,t[37]=E);let D;t[38]!==S||t[39]!==C||t[40]!==w||t[41]!==T||t[42]!==E?(D=(0,Z.jsxs)(`div`,{className:`text-xs text-muted-foreground space-y-0.5`,children:[S,C,w,T,E]}),t[38]=S,t[39]=C,t[40]=w,t[41]=T,t[42]=E,t[43]=D):D=t[43];let O;t[44]!==a||t[45]!==n.identityUnresolved?(O=n.identityUnresolved&&a&&(0,Z.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-dashed p-2`,children:[(0,Z.jsx)(Ao,{className:`size-3.5 mt-0.5 text-muted-foreground shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1.5 min-w-0`,children:[(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground leading-snug`,children:`Git identity isn't set — commits use a default author. Set yours so teammates see your name.`}),(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,className:`self-start`,onClick:a,children:`Set identity`})]})]}),t[44]=a,t[45]=n.identityUnresolved,t[46]=O):O=t[46];let k;t[47]!==o||t[48]!==n.state?(k=o&&n.state!==`dormant`&&n.state!==`disabled`&&n.state!==`auth-error`&&n.state!==`conflict`&&(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,onClick:PI,children:`Sync now`}),t[47]=o,t[48]=n.state,t[49]=k):k=t[49];let A;t[50]!==o||t[51]!==r||t[52]!==n.state?(A=o&&n.state===`auth-error`&&(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,onClick:r,children:`Sign in`}),t[50]=o,t[51]=r,t[52]=n.state,t[53]=A):A=t[53];let j;t[54]!==o||t[55]!==n.state?(j=o&&n.state===`offline`&&(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,onClick:NI,children:`Retry`}),t[54]=o,t[55]=n.state,t[56]=j):j=t[56];let M;t[57]!==o||t[58]!==i||t[59]!==n.state?(M=o&&n.state===`conflict`&&i&&(0,Z.jsx)(Y,{variant:`outline`,size:`xs`,onClick:i,children:`Review conflicts`}),t[57]=o,t[58]=i,t[59]=n.state,t[60]=M):M=t[60];let N;t[61]!==k||t[62]!==A||t[63]!==j||t[64]!==M?(N=(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-1 pt-1`,children:[k,A,j,M]}),t[61]=k,t[62]=A,t[63]=j,t[64]=M,t[65]=N):N=t[65];let P;return t[66]!==b||t[67]!==x||t[68]!==D||t[69]!==O||t[70]!==N||t[71]!==_||t[72]!==v||t[73]!==y?(P=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[_,v,y,b,x,D,O,N]}),t[66]=b,t[67]=x,t[68]=D,t[69]=O,t[70]=N,t[71]=_,t[72]=v,t[73]=y,t[74]=P):P=t[74],P}function NI(){EI(`sync`)}function PI(){EI(`sync`)}function FI(e){let t=(0,$.c)(36),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{onSignIn:r,onOpenConflictResolver:i,onSetIdentity:a}=n,{status:o,fetchError:s}=Vr();if(!o){if(s){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground`,"aria-label":`Sync status unavailable`,disabled:!0,children:(0,Z.jsx)(Ta,{className:`size-3.5`})})}),t[2]=e):e=t[2];let n=s===`network`?`Sync status unavailable — server unreachable.`:`Sync status unavailable — server error.`,r;return t[3]===n?r=t[4]:(r=(0,Z.jsxs)(Ei,{children:[e,(0,Z.jsx)(wi,{children:n})]}),t[3]=n,t[4]=r),r}return null}if(o.state===`dormant`&&!o.hasRemote||o.state===`disabled`&&!o.pausedReason)return null;let c;t[5]===o?c=t[6]:(c=OI(o),t[5]=o,t[6]=c);let l=c,u=!!o.identityUnresolved,d;t[7]===o.state?d=t[8]:(d=kI(o.state),t[7]=o.state,t[8]=d);let f=`Sync status: ${d}${u?` — git identity unset`:``}`,p;t[9]===o?p=t[10]:(p=(0,Z.jsx)(DI,{status:o}),t[9]=o,t[10]=p);let m;t[11]===l?m=t[12]:(m=l&&(0,Z.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 text-[9px] leading-none font-medium bg-background border rounded-full px-0.5`,children:l}),t[11]=l,t[12]=m);let h;t[13]!==l||t[14]!==u?(h=!l&&u&&(0,Z.jsx)(`span`,{className:`absolute -top-0.5 -right-0.5 size-1.5 rounded-full bg-amber-500 ring-2 ring-background`,"aria-hidden":!0}),t[13]=l,t[14]=u,t[15]=h):h=t[15];let g;t[16]!==f||t[17]!==p||t[18]!==m||t[19]!==h?(g=(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(un,{asChild:!0,children:(0,Z.jsxs)(Y,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground relative`,"aria-label":f,children:[p,m,h]})})}),t[16]=f,t[17]=p,t[18]=m,t[19]=h,t[20]=g):g=t[20];let _;t[21]===o?_=t[22]:(_=jI(o),t[21]=o,t[22]=_);let v;t[23]===_?v=t[24]:(v=(0,Z.jsx)(wi,{children:_}),t[23]=_,t[24]=v);let y;t[25]!==v||t[26]!==g?(y=(0,Z.jsxs)(Ei,{children:[g,v]}),t[25]=v,t[26]=g,t[27]=y):y=t[27];let b;t[28]!==i||t[29]!==a||t[30]!==r||t[31]!==o?(b=(0,Z.jsx)(cn,{align:`end`,className:`w-64 p-3`,children:(0,Z.jsx)(MI,{status:o,onSignIn:r,onOpenConflictResolver:i,onSetIdentity:a})}),t[28]=i,t[29]=a,t[30]=r,t[31]=o,t[32]=b):b=t[32];let x;return t[33]!==y||t[34]!==b?(x=(0,Z.jsxs)(Gn,{children:[y,b]}),t[33]=y,t[34]=b,t[35]=x):x=t[35],x}var II=[{value:`light`,label:`Light`,icon:wo},{value:`dark`,label:`Dark`,icon:no},{value:`system`,label:`System`,icon:Aa}],LI=()=>{let e=(0,$.c)(16),{theme:t}=We(),{merged:n,userBinding:r}=Kr(),i=n?.appearance?.theme??t??`system`,a;e[0]===r?a=e[1]:(a=e=>{if(e!==`light`&&e!==`dark`&&e!==`system`||!r)return;let t=r.patch({appearance:{theme:e}});t.ok||X.error(Ve(t.error))},e[0]=r,e[1]=a);let o=a,s=i===`system`?Aa:i===`dark`?no:wo,c;e[2]===s?c=e[3]:(c=(0,Z.jsx)(s,{}),e[2]=s,e[3]=c);let l;e[4]===i?l=e[5]:(l=(0,Z.jsxs)(`span`,{className:`sr-only`,children:[`Toggle theme (current: `,i,`)`]}),e[4]=i,e[5]=l);let u;e[6]!==c||e[7]!==l?(u=(0,Z.jsx)(wA,{asChild:!0,children:(0,Z.jsxs)(Y,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,children:[c,l]})}),e[6]=c,e[7]=l,e[8]=u):u=e[8];let d;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=II.map(RI),e[9]=d):d=e[9];let f;e[10]!==i||e[11]!==o?(f=(0,Z.jsx)(TA,{align:`end`,children:(0,Z.jsx)(DA,{value:i,onValueChange:o,children:d})}),e[10]=i,e[11]=o,e[12]=f):f=e[12];let p;return e[13]!==u||e[14]!==f?(p=(0,Z.jsxs)(CA,{children:[u,f]}),e[13]=u,e[14]=f,e[15]=p):p=e[15],p};function RI(e){let{value:t,label:n,icon:r}=e;return(0,Z.jsxs)(OA,{value:t,className:`capitalize`,children:[(0,Z.jsx)(r,{className:`text-muted-foreground`}),n]},t)}function zI(e){let t=(0,$.c)(47),{onSaveVersion:n,saving:r,onSignIn:i,onSetIdentity:a,onOpenConflictResolver:o}=e,{activeDocName:s,activeTarget:c}=Qn(),{state:l}=iF(),u=Qf(),d;t[0]!==s||t[1]!==u?(d=jp({docName:s,workspace:u}),t[0]=s,t[1]=u,t[2]=d):d=t[2];let f=d,p=c?.kind===`folder`,m=c?.kind===`asset`,h=p?`${c.folderPath}/`:``,g=m?c.assetPath:``,_,v;t[3]===g?(_=t[4],v=t[5]):(_=g.lastIndexOf(`/`),v=_===-1?``:g.slice(0,_),t[3]=g,t[4]=_,t[5]=v);let y=v,b;t[6]!==g||t[7]!==_?(b=_===-1?g:g.slice(_+1),t[6]=g,t[7]=_,t[8]=b):b=t[8];let x=b,S;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(lF,{className:`-ml-1 shrink-0 text-muted-foreground`})}),t[9]=S):S=t[9];let C=l===`expanded`?`Hide Files`:`Show Files`,w;t[10]===C?w=t[11]:(w=(0,Z.jsxs)(Ei,{children:[S,(0,Z.jsx)(wi,{children:C})]}),t[10]=C,t[11]=w);let T;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(Ng,{orientation:`vertical`,className:`mr-1 h-4 shrink-0 data-vertical:self-center`}),t[12]=T):T=t[12];let E;t[13]!==s||t[14]!==x||t[15]!==y||t[16]!==h||t[17]!==m||t[18]!==p?(E=p?(0,Z.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2 text-sm text-muted-foreground`,children:[(0,Z.jsx)(On,{className:`size-4 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:h})]}):m?(0,Z.jsx)(`div`,{className:`flex min-w-0 items-center gap-2 overflow-hidden text-sm`,children:(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center overflow-hidden`,children:[y&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground/60`,children:y}),(0,Z.jsx)(`span`,{className:`shrink-0 px-2 text-muted-foreground/60`,children:`/`})]}),(0,Z.jsx)(`span`,{className:`shrink-0 font-medium text-foreground`,children:x})]})}):s?null:(0,Z.jsx)(`span`,{className:`text-sm text-muted-foreground truncate min-w-0`,children:h}),t[13]=s,t[14]=x,t[15]=y,t[16]=h,t[17]=m,t[18]=p,t[19]=E):E=t[19];let D;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(oI,{}),t[20]=D):D=t[20];let O;t[21]!==w||t[22]!==E?(O=(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 px-3`,children:[w,T,E,D]}),t[21]=w,t[22]=E,t[23]=O):O=t[23];let k;t[24]!==s||t[25]!==n||t[26]!==r?(k=s&&(0,Z.jsxs)(Ei,{children:[(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-sm`,"aria-label":`Checkpoint version`,onClick:n,disabled:r,className:`text-muted-foreground`,children:(0,Z.jsx)(mo,{className:`size-3.5`})})}),(0,Z.jsx)(wi,{children:r?`Saving…`:`Checkpoint version`})]}),t[24]=s,t[25]=n,t[26]=r,t[27]=k):k=t[27];let A;t[28]!==s||t[29]!==f?(A=s&&(0,Z.jsx)(wI,{input:f}),t[28]=s,t[29]=f,t[30]=A):A=t[30];let j;t[31]!==o||t[32]!==a||t[33]!==i?(j=(0,Z.jsx)(FI,{onSignIn:i,onSetIdentity:a,onOpenConflictResolver:o}),t[31]=o,t[32]=a,t[33]=i,t[34]=j):j=t[34];let M,N,P,F,I;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(RF,{}),N=(0,Z.jsx)(Ng,{orientation:`vertical`,className:`h-4 shrink-0 data-vertical:self-center`}),P=(0,Z.jsx)($l,{}),F=(0,Z.jsx)(uI,{}),I=(0,Z.jsx)(LI,{}),t[35]=M,t[36]=N,t[37]=P,t[38]=F,t[39]=I):(M=t[35],N=t[36],P=t[37],F=t[38],I=t[39]);let L;t[40]!==k||t[41]!==A||t[42]!==j?(L=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-2 px-3`,children:[k,A,j,M,N,P,F,I]}),t[40]=k,t[41]=A,t[42]=j,t[43]=L):L=t[43];let R;return t[44]!==O||t[45]!==L?(R=(0,Z.jsxs)(`header`,{className:`flex h-12 shrink-0 items-center border-b`,children:[O,L]}),t[44]=O,t[45]=L,t[46]=R):R=t[46],R}function BI(){let e=(0,$.c)(32),[t,n]=Em(),[r,i]=(0,Q.useState)(t),[a,o]=(0,Q.useState)(!1),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(`auth`),[d,f]=(0,Q.useState)(Z_[0].id),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(!1),_=Wr(),{projectLocalConfig:v,projectLocalSynced:y}=Kr(),{activeDocName:b}=Qn(),x=!h&&_?.hasRemote===!0&&y===!0&&v!==null&&v.autoSync?.enabled===null,S,C;e[0]===b?(S=e[1],C=e[2]):(S=()=>{let e=function(e){let t=e.detail;t&&b&&Zi(b,{kind:`raw-mdx`,detail:t}),i(`source`)};return window.addEventListener(vm,e),()=>window.removeEventListener(vm,e)},C=[b],e[0]=b,e[1]=S,e[2]=C),(0,Q.useEffect)(S,C);let w;e[3]===n?w=e[4]:(w=function(e){i(e),n(e)},e[3]=n,e[4]=w);let T=w,E;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(E=async function(){m(!0);try{let e=await fetch(`/api/save-version`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})});e.ok?X.success(`Checkpoint saved`):(console.error(`[save-version] failed:`,await e.text()),X.error(`Checkpoint failed — try again`))}catch(e){console.error(`[save-version] failed:`,e),X.error(`Checkpoint failed — try again`)}m(!1)},e[5]=E):E=e[5];let D=E,O;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(km,{onOpenResolver:()=>o(!0)}),e[6]=O):O=e[6];let k,A,j;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(k=()=>{u(`auth`),c(!0)},A=()=>{u(`identity`),c(!0)},j=()=>o(!0),e[7]=k,e[8]=A,e[9]=j):(k=e[7],A=e[8],j=e[9]);let M;e[10]===p?M=e[11]:(M=(0,Z.jsx)(zI,{onSaveVersion:D,saving:p,onSignIn:k,onSetIdentity:A,onOpenConflictResolver:j}),e[10]=p,e[11]=M);let N;e[12]!==d||e[13]!==r||e[14]!==T?(N=(0,Z.jsx)(PP,{editorMode:r,onModeChange:T,activeTab:d,onActiveTabChange:f}),e[12]=d,e[13]=r,e[14]=T,e[15]=N):N=e[15];let P;e[16]===a?P=e[17]:(P=(0,Z.jsx)(jg,{open:a,onOpenChange:o}),e[16]=a,e[17]=P);let F=l===`identity`,I;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>{c(!1)},e[18]=I):I=e[18];let L;e[19]!==s||e[20]!==F?(L=(0,Z.jsx)(Zl,{open:s,onOpenChange:c,identityPrompt:F,onSuccess:I}),e[19]=s,e[20]=F,e[21]=L):L=e[21];let R;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>g(!0),e[22]=R):R=e[22];let z;e[23]===x?z=e[24]:(z=(0,Z.jsx)(Dm,{open:x,onResolved:R}),e[23]=x,e[24]=z);let B;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsx)(hm,{}),e[25]=B):B=e[25];let V;return e[26]!==P||e[27]!==L||e[28]!==z||e[29]!==M||e[30]!==N?(V=(0,Z.jsxs)(Z.Fragment,{children:[O,M,N,P,L,z,B]}),e[26]=P,e[27]=L,e[28]=z,e[29]=M,e[30]=N,e[31]=V):V=e[31],V}var VI=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
40
|
-
<symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
|
|
41
|
-
<path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06" fill="currentcolor"/>
|
|
42
|
-
</symbol>
|
|
43
|
-
<symbol id="file-tree-icon-dot" viewBox="0 0 6 6">
|
|
44
|
-
<circle cx="3" cy="3" r="3" />
|
|
45
|
-
</symbol>
|
|
46
|
-
<symbol id="file-tree-icon-file" viewBox="0 0 16 16">
|
|
47
|
-
<path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".5"/>
|
|
48
|
-
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
49
|
-
</symbol>
|
|
50
|
-
<symbol id="file-tree-icon-lock" viewBox="0 0 16 16">
|
|
51
|
-
<path fill="currentcolor" d="M4 5.336V4a4 4 0 1 1 8 0v1.336c1.586.54 2 1.843 2 4.664v1c0 4.118-.883 5-5 5H7c-4.117 0-5-.883-5-5v-1c0-2.821.414-4.124 2-4.664M5.5 4v1.054Q6.166 4.998 7 5h2q.834-.002 1.5.054V4a2.5 2.5 0 0 0-5 0m-2 6v1c0 .995.055 1.692.167 2.193.107.483.246.686.35.79s.307.243.79.35c.5.112 1.198.167 2.193.167h2c.995 0 1.692-.055 2.193-.166.483-.108.686-.247.79-.35.104-.105.243-.308.35-.791.112-.5.167-1.198.167-2.193v-1c0-.995-.055-1.692-.166-2.193-.108-.483-.247-.686-.35-.79-.105-.104-.308-.243-.791-.35C10.693 6.555 9.995 6.5 9 6.5H7c-.995 0-1.692.055-2.193.167-.483.107-.686.246-.79.35s-.243.307-.35.79C3.555 8.307 3.5 9.005 3.5 10" />
|
|
52
|
-
</symbol>
|
|
53
|
-
<symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
|
|
54
|
-
<path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
|
|
55
|
-
</symbol>
|
|
56
|
-
</svg>`,HI=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
|
|
57
|
-
<path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
|
|
58
|
-
<path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
|
|
59
|
-
</symbol>`,UI=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
|
|
60
|
-
<path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
|
|
61
|
-
</symbol>`,WI=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
|
|
62
|
-
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
63
|
-
<path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
|
|
64
|
-
</symbol>`,GI=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
|
|
65
|
-
<path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
|
|
66
|
-
</symbol>`,KI=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
|
|
67
|
-
<path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
|
|
68
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
|
|
69
|
-
</symbol>`,qI=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
|
|
70
|
-
<path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
|
|
71
|
-
<path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
|
|
72
|
-
<path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
|
|
73
|
-
</symbol>`,JI=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
|
|
74
|
-
<path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
|
|
75
|
-
</symbol>`,YI=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
|
|
76
|
-
<path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
|
|
77
|
-
</symbol>`,XI=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
|
|
78
|
-
<path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
|
|
79
|
-
<path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
|
|
80
|
-
</symbol>`,ZI=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
|
|
81
|
-
<path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
|
|
82
|
-
<path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
|
|
83
|
-
<path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
|
|
84
|
-
</symbol>`,QI=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
|
|
85
|
-
<path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
|
|
86
|
-
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
87
|
-
</symbol>`,$I=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
|
|
88
|
-
<path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
|
|
89
|
-
<path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
|
|
90
|
-
</symbol>`,eL=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
|
|
91
|
-
<path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
|
|
92
|
-
<path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
|
|
93
|
-
</symbol>`,tL=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
|
|
94
|
-
<path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
|
|
95
|
-
</symbol>`,nL=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
|
|
96
|
-
<path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
|
|
97
|
-
</symbol>`,rL=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
|
|
98
|
-
<path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
|
|
99
|
-
</symbol>`,iL=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
|
|
100
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
|
|
101
|
-
</symbol>`,aL=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
|
|
102
|
-
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
103
|
-
<path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
|
|
104
|
-
</symbol>`,oL=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
|
|
105
|
-
<path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
|
|
106
|
-
<path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
|
|
107
|
-
</symbol>`,sL=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
|
|
108
|
-
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
109
|
-
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
|
|
110
|
-
</symbol>`,cL=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
|
|
111
|
-
<path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
|
|
112
|
-
</symbol>`,lL=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
|
|
113
|
-
<path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
|
|
114
|
-
</symbol>`,uL=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
|
|
115
|
-
<path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
|
|
116
|
-
<path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
|
|
117
|
-
</symbol>`,dL=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
|
|
118
|
-
<defs>
|
|
119
|
-
<linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
|
|
120
|
-
<stop stop-color="currentColor"/>
|
|
121
|
-
<stop offset="1" stop-color="currentColor" stop-opacity="0"/>
|
|
122
|
-
</linearGradient>
|
|
123
|
-
</defs>
|
|
124
|
-
<path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
|
|
125
|
-
<path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
|
|
126
|
-
<path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
|
|
127
|
-
</symbol>`,fL=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
|
|
128
|
-
<path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
|
|
129
|
-
<path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
|
|
130
|
-
</symbol>`,pL=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
|
|
131
|
-
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
|
|
132
|
-
</symbol>`,mL=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
|
|
133
|
-
<path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
|
|
134
|
-
</symbol>`,hL=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
|
|
135
|
-
<path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
|
|
136
|
-
<path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
|
|
137
|
-
<path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
|
|
138
|
-
<path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
|
|
139
|
-
</symbol>`,gL=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
|
|
140
|
-
<path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
|
|
141
|
-
<path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
|
|
142
|
-
</symbol>`,_L=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
|
|
143
|
-
<path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
|
|
144
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
|
|
145
|
-
</symbol>`,vL=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
|
|
146
|
-
<path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
|
|
147
|
-
</symbol>`,yL=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
|
|
148
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
|
|
149
|
-
</symbol>`,bL=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
|
|
150
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
|
|
151
|
-
</symbol>`,xL=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
|
|
152
|
-
<path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
|
|
153
|
-
<path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
|
|
154
|
-
</symbol>`,SL=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
|
|
155
|
-
<path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
|
|
156
|
-
</symbol>`,CL=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
|
|
157
|
-
<path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
|
|
158
|
-
<path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
|
|
159
|
-
</symbol>`,wL=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
|
|
160
|
-
<path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
|
|
161
|
-
<path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
|
|
162
|
-
</symbol>`,TL=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
|
|
163
|
-
<path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
|
|
164
|
-
</symbol>`,EL=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
|
|
165
|
-
<path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
|
|
166
|
-
<path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
167
|
-
</symbol>`,DL=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
|
|
168
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
|
|
169
|
-
</symbol>`,OL=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
|
|
170
|
-
<path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
|
|
171
|
-
</symbol>`,kL=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
|
|
172
|
-
<path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
|
|
173
|
-
<path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
|
|
174
|
-
</symbol>`,AL=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
|
|
175
|
-
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
176
|
-
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
|
|
177
|
-
</symbol>`,jL=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
|
|
178
|
-
<path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
|
|
179
|
-
</symbol>`,ML=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
|
|
180
|
-
<path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
|
|
181
|
-
<path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
|
|
182
|
-
<path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
|
|
183
|
-
</symbol>`,NL=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
|
|
184
|
-
<path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
|
|
185
|
-
<path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
|
|
186
|
-
</symbol>`,PL=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
|
|
187
|
-
<path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
|
|
188
|
-
<path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
|
|
189
|
-
<path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
|
|
190
|
-
</symbol>`,FL=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
|
|
191
|
-
<path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
|
|
192
|
-
<path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
|
|
193
|
-
</symbol>`,IL=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
|
|
194
|
-
<path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
|
|
195
|
-
</symbol>`,LL=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
|
|
196
|
-
<path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
|
|
197
|
-
<path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
|
|
198
|
-
</symbol>`,RL=[WI,XI,ZI,QI,tL,nL,rL,aL,oL,sL,cL,lL,uL,gL,vL,yL,TL,EL,kL,AL,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
|
|
199
|
-
<path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
|
|
200
|
-
<path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
|
|
201
|
-
</symbol>`],zL=[HI,UI,GI,KI,qI,JI,YI,$I,eL,iL,dL,fL,pL,mL,hL,_L,bL,xL,SL,CL,wL,DL,OL,jL,ML,NL,PL,FL,IL,LL];function BL(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
|
|
202
|
-
`)}\n</svg>`)}var VL=BL(VI,RL),HL={minimal:VI,standard:VL,complete:BL(VL,zL)},UL={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},WL={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,htm:`html`,html:`html`,icns:`image`,ico:`image`,ini:`text`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},GL={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},KL=new Set([`bash`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),qL=new Set([`complete`]);function JL(e){return HL[e===`none`?`minimal`:e]}function YL(e){return`file-tree-builtin-${e}`}function XL(e){return e!==`none`&&qL.has(e)}function ZL(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=UL[t.toLowerCase()];if(i!=null&&(r||KL.has(i)))return i;for(let e of n){if(r){let t=GL[e];if(t!=null)return t}let t=WL[e];if(t!=null&&(r||KL.has(t)))return t}return`default`}var QL=`file-tree-container`,$L=`data-file-tree-style`,eR=`data-file-tree-unsafe-css`,tR=`data-file-tree-scrollbar-measure`,nR=`data-file-tree-scrollbar-gutter-measured`,rR=`--trees-scrollbar-gutter-measured`,iR=`header`,aR=`context-menu`,oR=`context-menu-trigger`;function sR(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function cR(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(sR(e)?`none`:`complete`),colored:e.colored??!0}}var lR=e=>e.trim().toLowerCase(),uR=e=>e.split(`/`).at(-1)??e,dR=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function fR(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function pR(e){let t=cR(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(lR(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let n=uR(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return fR(c,e);for(let[t,n]of a)if(s.includes(t))return fR(n,e);let l=dR(n);for(let t of l){let n=i.get(t);if(n!=null)return fR(n,e)}let u=ZL(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:YL(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:fR(s,e)}}}var mR=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,hR=/^0(?:\.0+)?%?$/;function gR(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function _R(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||mR.test(t))return!0;let n=gR(t);return n!=null&&hR.test(n)}function vR(e){return _R(e)?void 0:e}function yR(e){let t=e.colors??{},n=t[`sideBar.background`]??t[`editor.background`]??e.bg,r=t[`sideBar.foreground`]??t[`editor.foreground`]??e.fg,i=t[`sideBar.border`],a=t[`list.activeSelectionForeground`]??t[`sideBar.foreground`],o=n?.toLowerCase(),s=t[`list.hoverBackground`],c=s?.toLowerCase()===o?void 0:s,l=t[`list.activeSelectionBackground`],u=l?.toLowerCase()===o?t[`list.focusBackground`]??t[`editor.selectionBackground`]:l??t[`editor.selectionBackground`],d=vR(t[`list.focusOutline`])??vR(t.focusBorder),f=t[`input.background`]??n,p=t[`input.border`],m=t[`scrollbarSlider.background`],h=t[`sideBarSectionHeader.foreground`]??r,g=t[`gitDecoration.addedResourceForeground`]??t[`terminal.ansiGreen`]??t[`editorGutter.addedBackground`],_=t[`gitDecoration.modifiedResourceForeground`]??t[`terminal.ansiBlue`]??t[`editorGutter.modifiedBackground`],v=t[`gitDecoration.deletedResourceForeground`]??t[`terminal.ansiRed`]??t[`editorGutter.deletedBackground`],y=e.type===`dark`,b={colorScheme:y?`dark`:`light`,backgroundColor:n??``,color:r??``,borderColor:`var(--trees-theme-sidebar-border, light-dark(oklch(0% 0 0 / 0.15), oklch(100% 0 0 / 0.15)))`,"--trees-theme-sidebar-bg":n??``,"--trees-theme-sidebar-fg":r??``,"--trees-theme-sidebar-header-fg":h??``,"--trees-theme-list-active-selection-fg":a??r??``,"--trees-theme-list-hover-bg":c??(y?`rgba(255,255,255,0.08)`:`rgba(0,0,0,0.06)`),"--trees-theme-list-active-selection-bg":u??`transparent`,"--trees-theme-focus-ring":d??r??``,"--trees-theme-input-bg":f??``};return i!=null&&i!==``&&(b[`--trees-theme-sidebar-border`]=i),p!=null&&p!==``&&(b[`--trees-theme-input-border`]=p),m!=null&&m!==``&&(b[`--trees-theme-scrollbar-thumb`]=m),g!=null&&g!==``&&(b[`--trees-theme-git-added-fg`]=g),_!=null&&_!==``&&(b[`--trees-theme-git-modified-fg`]=_),v!=null&&v!==``&&(b[`--trees-theme-git-deleted-fg`]=v),b}var bR=5,xR=1<<bR,SR=xR*4;function CR(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function wR(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function TR(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function ER(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function DR(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function OR(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function kR(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,NR(e,t)}function AR(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=ER(e).get(t);if(i===void 0)return;let a=i>>bR;e.childVisibleChunkSums[a]+=r}function jR(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=PR(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=xR}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function MR(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>bR;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<bR}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function NR(e,t){if(t.childIds.length<SR){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/xR),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>bR]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function PR(e,t,n,r){let i=Math.min(t.childIds.length,n+xR),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var FR=7,IR=3,LR=1<<IR,RR=4;function zR(e,t,n=0){return e<<RR|n<<IR|t}function BR(e){return e.depthAndFlags>>>RR}function VR(e){return(e.depthAndFlags&LR)>>IR}function HR(e){return(e.depthAndFlags&LR)!==0}function UR(e){return e.depthAndFlags&FR}function WR(e,t){return(UR(e)&t)!==0}function GR(e,t){e.depthAndFlags|=t}function KR(e,t){e.depthAndFlags=zR(t,UR(e),VR(e))}var qR=Symbol(`benchmarkInstrumentation`);function JR(e,t){return t==null||Object.defineProperty(e,qR,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function YR(e){return e==null?null:e[qR]??null}function XR(e,t,n){return e==null?n():e.measurePhase(t,n)}function ZR(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function QR(e){return e>=48&&e<=57}function $R(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!QR(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&QR(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function ez(e){let t=e.toLowerCase();return{lowerValue:t,tokens:$R(t)}}function tz(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function nz(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=tz(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function rz(e,t,n){let r=nz(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function iz(e,t){return rz(e,t,ez)}function az(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function oz(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=az(e,r);return a===az(t,r)?iz(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function sz(e,t){return oz(e,t)}function cz(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=ez(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=az(e,n);return o===az(t,n)?rz(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function lz(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=ez(r);return e.sortKeyById[t]=i,i}function uz(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function dz(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function fz(e){let{hasTrailingSlash:t,segments:n}=dz(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function pz(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=dz(e);return{requiresDirectory:t,segments:n}}var mz=``;function hz(){let e=new Map;return e.set(mz,0),{idByValue:e,valueById:[mz],sortKeyById:[ez(mz)]}}function gz(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function _z(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var vz=Symbol(`pathStorePreparedInputKind`);function yz(e,t){return e[vz]=t,e}function bz(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function xz(e,t,n){return n===`default`?sz(e,t):n(bz(e),bz(t))}function Sz(){return{depthAndFlags:zR(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function Cz(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function wz(e){return e.isDirectory?e.segments.length:e.segments.length-1}function Tz(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function Ez(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Dz(e,t={}){return Nz(e,t).map(e=>e.path)}function Oz(e,t={}){let n=Nz(e,t);return yz({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function kz(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return yz({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function Az(e){let t=e,n=t.preparedPaths;if(t[vz]===`prepared`&&n!=null)return n;if(!Tz(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function jz(e){let t=e;return t[vz]===`presorted`&&t.presortedPaths!=null||Ez(t.presortedPaths)?t.presortedPaths:null}function Mz(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function Nz(e,t={}){let n=uz(t),r=YR(t);ZR(r,`workload.inputFiles`,e.length);let i=XR(r,`store.preparePathEntries.parse`,()=>e.map(e=>fz(e)));return XR(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>xz(e,t,n.sort))),i}var Pz=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[Sz()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=hz();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=YR(e),this.options=uz(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,CR())}appendPaths(e){return XR(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>fz(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,XR(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return XR(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:zR(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:zR(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:zR(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=fz(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:zR(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:zR(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=fz(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(XR(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||XR(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort===`default`?cz(this.lastPreparedPath,e,this.segmentSortKeyCache):xz(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=wz(e),i=n==null?0:wz(n),a=n==null?0:Cz(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=gz(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:zR(BR(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),DR(i,s),s}createFileChildUnchecked(e,t){let n=gz(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:zR(BR(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),DR(r,a),a}getOrCreateDirectoryChild(e,t){let n=gz(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!HR(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:zR(BR(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),DR(r,a),this.directories.set(a,CR()),a}createDirectoryChild(e,t){let n=gz(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:zR(BR(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),DR(r,a),this.directories.set(a,CR()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!HR(n))throw Error(`Path is not a directory: "${t}"`);if(WR(n,1))throw Error(`Duplicate path: "${t}"`);GR(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,wR());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(HR(a)){let t=wR();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;HR(n)&&this.directories.set(t,CR());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),DR(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!HR(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return kR(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function Fz(e,t=`closed`,n=null){let r=Lz(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function Iz(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function Lz(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function Rz(e,t){return WR(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:BR(t)<=e.defaultExpansion}function zz(e,t,n=e.snapshot.nodes[t]){return n==null||!HR(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:Rz(e,n)}function Bz(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!HR(r))return;let i=Rz(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function Vz(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function Hz(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function Uz(e,t){let n=Vz(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function Wz(e,t){let n=Vz(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function Gz(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function Kz(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function qz(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function Jz(e,t){e.directoryLoadInfoById.delete(t)}function Yz(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Xz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Zz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Qz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function $z(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function eB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function tB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function nB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function rB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function iB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function aB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function oB(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function sB(e,t,n){return{...n,visibleCountDelta:vB(e)-t}}function cB(e,t){let n=vB(e),r=Iz();e.transactionStack.push(r);try{t()}catch(t){throw dB(e,r,!1),t}dB(e,r,!0,vB(e)-n)}function lB(e,t){let n=e.instrumentation;if(n==null){uB(e,t);return}XR(n,`store.events.record`,()=>uB(e,t))}function uB(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){gB(e,t);return}n.events.push(t),hB(n,t)}function dB(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?mB(i,t):XR(n,`store.events.batch.merge`,()=>mB(i,t));return}let a=fB(t,r),o=e.instrumentation;if(o==null){gB(e,a);return}XR(o,`store.events.batch.commit`,()=>gB(e,a))}function fB(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function pB(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function mB(e,t){for(let n of t.events)e.events.push(n);pB(e,t)}function hB(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function gB(e,t){let n=e.instrumentation;if(n==null){_B(e,t);return}XR(n,`store.events.emit`,()=>_B(e,t))}function _B(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function vB(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function yB(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!HR(n)||WR(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!HR(a)?null:i}function bB(e,t){let n=t;for(;;){let t=yB(e,n);if(t==null)return n;n=t}}function xB(e,t){let n=[t],r=t;for(;;){let t=yB(e,r);if(t==null)return n;n.push(t),r=t}}function SB(e,t){let n=t==null?e.snapshot.rootId:MB(e,t);return n==null?[]:IB(e,n)}function CB(e,t){let n=fz(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=ZB(e,XB(e,r)),{createdNodeIds:a,directoryId:o}=LB(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=FB(e,o);if(WR(n,1))throw Error(`Path already exists: "${t}"`);GR(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=zB(e,o,n.basename),s.add(c);kB(e,o);let l=ZB(e,o);return Xz({affectedAncestorIds:jB(e,c),affectedNodeIds:[...s],path:t,projectionChanged:QB(i,l)})}function wB(e,t,n){let r=MB(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=FB(e,r);if(WR(i,2))throw Error(`The root node cannot be removed`);if(HR(i)&&PB(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=ZB(e,a),s=JB(e,r);HB(e,a,r,i.nameId),YB(e,a),kB(e,a);let c=ZB(e,a);return Zz({affectedAncestorIds:jB(e,a),affectedNodeIds:s,path:t,projectionChanged:QB(o,c),recursive:n.recursive===!0})}function TB(e,t,n,r){let i=MB(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=FB(e,i);if(WR(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=KB(e,i,n),c=ZB(e,a.parentId),l=ZB(e,s.parentId),u=_z(e.snapshot.segmentTable,a.nameId),d=gz(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(HR(a)&&nV(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=TR(e.snapshot.nodes,PB(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&qB(e,p,o,VR(a))===`skip`)return null;let m=a.parentId;HB(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),tV(e,i),VB(e,s.parentId,i),YB(e,m),e.pathCacheVersion++,kB(e,m),s.parentId!==m&&kB(e,s.parentId);let h=ZB(e,m),g=ZB(e,s.parentId);return Qz({affectedAncestorIds:[...new Set([...jB(e,m),...jB(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:$B([c,l],[h,g]),to:OB(e,i)})}function EB(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function DB(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function OB(e,t){let n=FB(e,t),r=EB(e,t);if(r!=null)return r;if(WR(n,2))return DB(e,t,``);let i=OB(e,n.parentId),a=_z(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return DB(e,t,HR(n)?`${o}/`:o)}function kB(e,t){let n=e.instrumentation;if(n==null){iV(e,t);return}XR(n,`store.recomputeCountsUpwardFrom`,()=>iV(e,t))}function AB(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!HR(o)){rV(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){rV(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function jB(e,t){let n=[],r=t;for(;r!=null;){let t=FB(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function MB(e,t){if(t.length===0)return e.snapshot.rootId;let n=pz(t);return NB(e,n.segments,n.requiresDirectory)}function NB(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=PB(e,r),a=TR(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=FB(e,r);return n&&!HR(i)?null:r}function PB(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function FB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||WR(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function IB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||WR(n,4))return[];if(!HR(n))return[OB(e,t)];if(PB(e,t).childIds.length===0)return WR(n,1)&&!WR(n,2)?[OB(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||WR(n,4)){i.pop();continue}if(!HR(n)){r.push(OB(e,t.nodeId)),i.pop();continue}let a=PB(e,t.nodeId);if(a.childIds.length===0){WR(n,1)&&!WR(n,2)&&r.push(OB(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function LB(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=gz(e.snapshot.segmentTable,i),a=PB(e,r),o=TR(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!HR(FB(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=RB(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function RB(e,t,n){let r=FB(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:zR(BR(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,CR()),VB(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function zB(e,t,n){let r=gz(e.snapshot.segmentTable,n),i=PB(e,t);if(TR(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${oV(e,t,n)}"`);let a=FB(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:zR(BR(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),VB(e,t,o),e.activeNodeCount++,o}function BB(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}UB(e,n,o)<0?i=a:r=a+1}return r}function VB(e,t,n){let r=PB(e,t),i=FB(e,n);TR(e.snapshot.nodes,r).set(i.nameId,n),AR(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=BB(e,r,n);r.childIds.splice(a,0,n),OR(r,a),NR(e.snapshot.nodes,r)}function HB(e,t,n,r){let i=PB(e,t),a=ER(i),o=a.get(n)??-1;TR(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&AR(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),OR(i,o),NR(e.snapshot.nodes,i))}function UB(e,t,n){let r=e.snapshot.options.sort;return r===`default`?WB(e,t,n):r(GB(e,t),GB(e,n))}function WB(e,t,n){let r=FB(e,t),i=FB(e,n),a=HR(r);if(a!==HR(i))return a?-1:1;let o=nz(lz(e.snapshot.segmentTable,r.nameId),lz(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=_z(e.snapshot.segmentTable,r.nameId),c=_z(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function GB(e,t){let n=FB(e,t),r=OB(e,t),i=HR(n),a=i?r.slice(0,-1):r;return{basename:_z(e.snapshot.segmentTable,n.nameId),depth:BR(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function KB(e,t,n){let r=FB(e,t),i=MB(e,n);if(i!=null){let t=FB(e,i);if(HR(t))return{basename:_z(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=pz(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=pz(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:NB(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function qB(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${OB(e,t)}"`);let i=FB(e,t);if(VR(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(HR(i)&&PB(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return JB(e,t),HB(e,a,t,o),YB(e,a),kB(e,a),`handled`}function JB(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=FB(e,t.nodeId);if(t.visitedChildren||!HR(i)){HR(i)&&e.snapshot.directories.delete(t.nodeId),GR(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),Jz(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=PB(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function YB(e,t){let n=t;for(;n!=null;){let t=FB(e,n);if(!HR(t)||WR(t,2)||PB(e,n).childIds.length>0)return;GR(t,1),n=t.parentId===n?null:t.parentId}}function XB(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=TR(e.snapshot.nodes,PB(e,n)).get(t);if(i==null||!HR(FB(e,i)))break;n=i}return n}function ZB(e,t){let n=eV(e,t);if(n==null)return null;let r=bB(e,n),i=FB(e,r),a=n===r?null:xB(e,n).map(t=>OB(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:PB(e,r).childIds.length>0,path:OB(e,r),terminalKind:VR(i)})}function QB(e,t){return $B([e],[t])}function $B(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function eV(e,t){let n=t;for(;n!=null;){let t=FB(e,n);if(!HR(t)||WR(t,2))return null;if(!zz(e,n,t))return n;n=t.parentId}return null}function tV(e,t){let n=FB(e,t);if(KR(n,(t===e.snapshot.rootId?-1:BR(FB(e,n.parentId)))+1),!HR(n))return;let r=PB(e,t);for(let t of r.childIds)tV(e,t)}function nV(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=FB(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function rV(e,t,n=FB(e,t),r=!1){let i=e.instrumentation;if(i==null){aV(e,t,n,r);return}XR(i,`store.recomputeNodeCounts`,()=>aV(e,t,n,r))}function iV(e,t){let n=t;for(;n!=null;){let t=FB(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(rV(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&AR(PB(e,s),n,a,o),n=s}}function aV(e,t,n,r){if(!HR(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=PB(e,t);if(r){let t=e.instrumentation;t==null?kR(e.snapshot.nodes,i):XR(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>kR(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,WR(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=yB(e,t)==null?zz(e,t,n)?1+o:1:o}function oV(e,t,n){let r=OB(e,t);return r.length===0?n:`${r}${n}`}function sV(e){return e!=null&&!WR(e,4)}function cV(e,t){let n=e.snapshot.nodes[t];return!sV(n)||!HR(n)||WR(n,2)?null:n}function lV(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&sV(e.snapshot.nodes[n])&&(t+=1);return t}function uV(e){return Math.max(0,e.valueById.length-1)}function dV(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:lV(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:uV(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function fV(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function pV(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)cV(e,n)!=null&&t.push(OB(e,n));for(let t of e.expandedDirectoryIds)cV(e,t)!=null&&n.push(OB(e,t));return{collapsedPaths:t,expandedPaths:n}}function mV(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)cV(e,n)==null||Hz(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:OB(e,n)});return t}function hV(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=MB(e,n);t!=null&&Bz(e,t,!0,FB(e,t))}for(let n of t.collapsedPaths){let t=MB(e,n);t!=null&&Bz(e,t,!1,FB(e,t))}}function gV(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=MB(e,n.path);t!=null&&cV(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function _V(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function vV(e){let t=e.snapshot.segmentTable,n=hz();for(let r of e.snapshot.nodes)if(sV(r)){if(WR(r,2)){r.nameId=0;continue}r.nameId=gz(n,_z(t,r.nameId))}e.snapshot.segmentTable=n}function yV(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!sV(r)||!HR(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return sV(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[FB(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),kR(e.snapshot.nodes,n)}}function bV(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(sV(n))break;--t}e.snapshot.nodes.length=t+1}function xV(e){let t=pV(e),n=mV(e);XR(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>_V(e)),XR(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>vV(e)),XR(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>yV(e)),XR(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>bV(e)),XR(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>hV(e,t)),XR(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>gV(e,n)),XR(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>AB(e,e.snapshot.rootId))}function SV(e){let t=pV(e),n=mV(e),r=XR(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>SB(e)),i=JR({...e.snapshot.options},e.instrumentation),a=XR(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new Pz(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,XR(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>hV(e,t)),XR(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>gV(e,n)),XR(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>AB(e,e.snapshot.rootId))}function CV(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function wV(e,t){let n=dV(e);t===`stable`?XR(e.instrumentation,`store.cleanup.stable`,()=>xV(e)):XR(e.instrumentation,`store.cleanup.aggressive`,()=>SV(e));let r=dV(e);return fV(t,t===`stable`,n,r)}var TV=64;function EV(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function DV(e){return FB(e,e.snapshot.rootId).visibleSubtreeCount}function OV(e,t,n,r){let i=FB(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function kV(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:JV(e,t.cursor),setSize:t.setSize,subtreeEndIndex:OV(e,t.cursor,t.index,n)}}function AV(e,t,n,r,i,a){let o=PB(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=jR(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return jV(e,u,l,r+c,i+1,s,o.childIds.length,a)}function jV(e,t,n,r,i,a,o,s){if(!HR(FB(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=HV(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=FB(e,c.terminalNodeId);if(!HR(l)||!zz(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return AV(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function MV(e,t){let n=DV(e);if(t<0||t>=n)return null;let r=AV(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>OB(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=kV(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:JV(e,r.cursor),setSize:r.setSize,subtreeEndIndex:OV(e,r.cursor,r.index,n)}}function NV(e,t,n){let r=e.instrumentation,i=DV(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return qV(e,o+1);let t=[],n=zV(e,a);for(let r=a;r<=o&&n!=null;r++){let r=JV(e,n);t.push(r),n=WV(e,n)}return t}let s=[],c=0,l=0,u=XR(r,`store.getVisibleSlice.selectFirstRow`,()=>zV(e,a));for(let t=a;t<=o&&u!=null;t++){let t=XR(r,`store.getVisibleSlice.materializeRow`,()=>JV(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=XR(r,`store.getVisibleSlice.advanceCursor`,()=>WV(e,u))}return ZR(r,`workload.visibleRowsRead`,s.length),ZR(r,`workload.flattenedRowsRead`,c),ZR(r,`workload.flattenedSegmentsRead`,l),s}function PV(e,t=DV(e)){let n=e.instrumentation;return n==null?KV(e,t):XR(n,`store.getVisibleTreeProjection`,()=>KV(e,t))}function FV(e){return GV(PV(e))}function IV(e,t){let n=MB(e,t);if(n==null||n===e.snapshot.rootId||HR(FB(e,n))&&bB(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=FB(e,i).parentId,n=PB(e,t),s=ER(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=MR(a,n,s),t!==o){let n=FB(e,t),a=yB(e,t);if(!zz(e,t,n)&&a!==i)return null;bB(e,t)===t&&(r+=1)}i=t}return r}function LV(e,t){let n=MB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=FB(e,n);if(!HR(r))throw Error(`Path is not a directory: "${t}"`);return zz(e,n,r)?null:(Bz(e,n,!0,r),kB(e,n),$z({affectedAncestorIds:jB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function RV(e,t){let n=MB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=FB(e,n);if(!HR(r))throw Error(`Path is not a directory: "${t}"`);return zz(e,n,r)?(Bz(e,n,!1,r),kB(e,n),eB({affectedAncestorIds:jB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function zV(e,t){return t<0||t>=DV(e)?null:BV(e,e.snapshot.rootId,t,-1)}function BV(e,t,n,r){let i=PB(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?jR(e.snapshot.nodes,i,n):XR(a,`store.getVisibleSlice.selectChildIndex`,()=>jR(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return VV(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function VV(e,t,n,r){if(!HR(FB(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=HV(e,t,r);if(n===0)return i;let a=FB(e,i.terminalNodeId);if(!HR(a)||!zz(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return BV(e,i.terminalNodeId,n-1,i.visibleDepth)}function HV(e,t,n){return HR(FB(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:bB(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:XR(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>bB(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function UV(e,t){let n=FB(e,t);if(!HR(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:yB(e,r)!==t}function WV(e,t){let n=FB(e,t.terminalNodeId);if(HR(n)){let r=PB(e,t.terminalNodeId);if(zz(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:VV(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=FB(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=PB(e,n),o=ER(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return VV(e,s,0,i);UV(e,r)&&i--,r=n}}function GV(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function KV(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(TV);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=EV(o,y);let x,S=_;if(HR(v))S=f?bB(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:OB(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&HR(C)&&zz(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function qV(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!HR(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:OB(e,f)};continue}let h=l?bB(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=JV(e,g);let _=i[h];_!=null&&HR(_)&&zz(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function JV(e,t){let n=FB(e,t.terminalNodeId),r=HR(n)?YV(e,t):null,i=OB(e,t.terminalNodeId),a=_z(e.snapshot.segmentTable,n.nameId),o=HR(n)&&PB(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?xB(e,t.headNodeId).map(n=>{let r=FB(e,n);return{isTerminal:n===t.terminalNodeId,name:_z(e.snapshot.segmentTable,r.nameId),nodeId:n,path:OB(e,n)}}):XR(c,`store.getVisibleSlice.flatten.collectSegments`,()=>xB(e,t.headNodeId).map(n=>{let r=FB(e,n);return{isTerminal:n===t.terminalNodeId,name:_z(e.snapshot.segmentTable,r.nameId),nodeId:n,path:OB(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:HR(n)&&zz(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:HR(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function YV(e,t){if(t.headNodeId===t.terminalNodeId)return Hz(e,t.terminalNodeId);let n=xB(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=Hz(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function XV(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!HR(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&NR(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&HR(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,NR(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function ZV(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var QV=class e{#e;constructor(e={}){let t=YR(e),n=XR(t,`store.builder.create`,()=>new Pz(e));if(e.preparedInput!=null){let t=jz(e.preparedInput);t==null?n.appendPreparedPaths(Az(e.preparedInput),!1):n.appendPresortedPaths(t,Mz(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(XR(t,`store.preparePathEntries`,()=>Nz(r,e)))}let r=XR(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=XR(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=XR(t,`store.state.create`,()=>Fz(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:XR(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||ZV(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&XR(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?XR(t,`store.state.initializeOpenVisibleCounts`,()=>XV(this.#e)):XR(t,`store.state.recomputeCounts`,()=>AB(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return Dz(e,t)}static prepareInput(e,t={}){return Oz(e,t)}static preparePresortedInput(e){return kz(e)}list(e){return XR(this.#e.instrumentation,`store.list`,()=>SB(this.#e,e))}add(e){XR(this.#e.instrumentation,`store.add`,()=>{let t=DV(this.#e);lB(this.#e,sB(this.#e,t,CB(this.#e,e)))})}remove(e,t={}){XR(this.#e.instrumentation,`store.remove`,()=>{let n=DV(this.#e);lB(this.#e,sB(this.#e,n,wB(this.#e,e,t)))})}move(e,t,n={}){XR(this.#e.instrumentation,`store.move`,()=>{let r=DV(this.#e),i=TB(this.#e,e,t,n);i!=null&&lB(this.#e,sB(this.#e,r,i))})}batch(e){cB(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return XR(this.#e.instrumentation,`store.getVisibleCount`,()=>DV(this.#e))}getVisibleSlice(e,t){return XR(this.#e.instrumentation,`store.getVisibleSlice`,()=>NV(this.#e,e,t))}getVisibleRowContext(e){return XR(this.#e.instrumentation,`store.getVisibleRowContext`,()=>MV(this.#e,e))}getVisibleTreeProjection(){return FV(this.#e)}getVisibleTreeProjectionData(e){return PV(this.#e,e)}getVisibleIndex(e){return XR(this.#e.instrumentation,`store.getVisibleIndex`,()=>IV(this.#e,e))}getPathInfo(e){return XR(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=MB(this.#e,e);if(t==null)return null;let n=FB(this.#e,t);return{depth:BR(n),kind:HR(n)?`directory`:`file`,path:OB(this.#e,t)}})}isExpanded(e){return XR(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=FB(this.#e,t);return zz(this.#e,t,n)})}expand(e){XR(this.#e.instrumentation,`store.expand`,()=>{let t=DV(this.#e),n=LV(this.#e,e);n!=null&&lB(this.#e,sB(this.#e,t,n))})}collapse(e){XR(this.#e.instrumentation,`store.collapse`,()=>{let t=DV(this.#e),n=RV(this.#e,e);n!=null&&lB(this.#e,sB(this.#e,t,n))})}on(e,t){return Yz(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return Hz(this.#e,t)}markDirectoryUnloaded(e){XR(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(PB(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=DV(this.#e);Wz(this.#e,t),lB(this.#e,sB(this.#e,n,tB({affectedAncestorIds:jB(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return XR(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=DV(this.#e),r=Uz(this.#e,t);return lB(this.#e,sB(this.#e,n,nB({affectedAncestorIds:jB(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return XR(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||Hz(this.#e,n)!==`loading`||!Kz(this.#e,n,e.attemptId))return!1;let r=OB(this.#e,n);this.validateChildPatch(r,t);let i=DV(this.#e),a=[];for(let e of t.operations){$V(r,e);let t=DV(this.#e);switch(e.type){case`add`:a.push(sB(this.#e,t,CB(this.#e,e.path)));break;case`remove`:a.push(sB(this.#e,t,wB(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=TB(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(sB(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return lB(this.#e,sB(this.#e,i,rB({affectedAncestorIds:jB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:OB(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return XR(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=DV(this.#e),r=Gz(this.#e,t,e.attemptId);return lB(this.#e,sB(this.#e,n,iB({affectedAncestorIds:jB(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:OB(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return XR(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=DV(this.#e),i=qz(this.#e,n,e.attemptId,t);return lB(this.#e,sB(this.#e,r,aB({affectedAncestorIds:jB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:OB(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return XR(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(CV(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=DV(this.#e),n=wV(this.#e,e.mode??`stable`);return lB(this.#e,sB(this.#e,t,oB({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=PB(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??ez(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=nz(lz(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!HR(FB(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=FB(this.#e,n);zz(this.#e,n,i)||(Bz(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=FB(this.#e,e);if(!zz(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=MB(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!HR(FB(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!HR(FB(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=FB(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=FB(this.#e,e),r=yB(this.#e,e);if(!zz(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function $V(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var eH={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function tH(e,t){if(typeof e==`number`)return{itemHeight:t??eH.default.itemHeight,factor:e};let n=eH[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var nH=eH.default.itemHeight,rH=`@layer base, theme, unsafe;
|
|
203
|
-
|
|
204
|
-
@layer base {
|
|
205
|
-
:host {
|
|
206
|
-
/*
|
|
207
|
-
CSS variables use a fallback stack to ensure user and theme colors slot
|
|
208
|
-
in with ease. User colors take precedence over theme colors, which take
|
|
209
|
-
precedence over defaults.
|
|
210
|
-
|
|
211
|
-
Fallback order:
|
|
212
|
-
|
|
213
|
-
1. --trees-*-override (explicit)
|
|
214
|
-
2. --trees-theme-* (e.g. Shiki/VS Code tokens)
|
|
215
|
-
3. defaults
|
|
216
|
-
|
|
217
|
-
Theme variable names mirror Shiki/VS Code theme file JSON tokens.
|
|
218
|
-
|
|
219
|
-
// Available CSS Color Overrides
|
|
220
|
-
--trees-fg-override
|
|
221
|
-
--trees-fg-muted-override
|
|
222
|
-
--trees-bg-override
|
|
223
|
-
--trees-bg-muted-override
|
|
224
|
-
--trees-accent-override
|
|
225
|
-
--trees-border-color-override
|
|
226
|
-
|
|
227
|
-
--trees-focus-ring-color-override
|
|
228
|
-
--trees-focus-ring-width-override
|
|
229
|
-
--trees-focus-ring-offset-override
|
|
230
|
-
|
|
231
|
-
--trees-search-fg-override
|
|
232
|
-
--trees-search-font-weight-override
|
|
233
|
-
--trees-search-bg-override
|
|
234
|
-
|
|
235
|
-
--trees-selected-fg-override
|
|
236
|
-
--trees-selected-bg-override
|
|
237
|
-
--trees-selected-focused-border-color-override
|
|
238
|
-
|
|
239
|
-
// Git Status Color Overrides
|
|
240
|
-
--trees-status-added-override
|
|
241
|
-
--trees-status-ignored-override
|
|
242
|
-
--trees-status-modified-override
|
|
243
|
-
--trees-status-renamed-override
|
|
244
|
-
--trees-status-untracked-override
|
|
245
|
-
--trees-status-deleted-override
|
|
246
|
-
--trees-git-added-color-override
|
|
247
|
-
--trees-git-ignored-color-override
|
|
248
|
-
--trees-git-modified-color-override
|
|
249
|
-
--trees-git-renamed-color-override
|
|
250
|
-
--trees-git-untracked-color-override
|
|
251
|
-
--trees-git-deleted-color-override
|
|
252
|
-
|
|
253
|
-
// Built-in File Icon Color Overrides
|
|
254
|
-
--trees-file-icon-color
|
|
255
|
-
--trees-file-icon-color-astro
|
|
256
|
-
--trees-file-icon-color-babel
|
|
257
|
-
--trees-file-icon-color-bash
|
|
258
|
-
--trees-file-icon-color-biome
|
|
259
|
-
--trees-file-icon-color-bootstrap
|
|
260
|
-
--trees-file-icon-color-browserslist
|
|
261
|
-
--trees-file-icon-color-bun
|
|
262
|
-
--trees-file-icon-color-claude
|
|
263
|
-
--trees-file-icon-color-css
|
|
264
|
-
--trees-file-icon-color-database
|
|
265
|
-
--trees-file-icon-color-default
|
|
266
|
-
--trees-file-icon-color-docker
|
|
267
|
-
--trees-file-icon-color-eslint
|
|
268
|
-
--trees-file-icon-color-git
|
|
269
|
-
--trees-file-icon-color-go
|
|
270
|
-
--trees-file-icon-color-graphql
|
|
271
|
-
--trees-file-icon-color-html
|
|
272
|
-
--trees-file-icon-color-image
|
|
273
|
-
--trees-file-icon-color-javascript
|
|
274
|
-
--trees-file-icon-color-json
|
|
275
|
-
--trees-file-icon-color-markdown
|
|
276
|
-
--trees-file-icon-color-mcp
|
|
277
|
-
--trees-file-icon-color-npm
|
|
278
|
-
--trees-file-icon-color-oxc
|
|
279
|
-
--trees-file-icon-color-postcss
|
|
280
|
-
--trees-file-icon-color-prettier
|
|
281
|
-
--trees-file-icon-color-python
|
|
282
|
-
--trees-file-icon-color-react
|
|
283
|
-
--trees-file-icon-color-ruby
|
|
284
|
-
--trees-file-icon-color-rust
|
|
285
|
-
--trees-file-icon-color-sass
|
|
286
|
-
--trees-file-icon-color-svg
|
|
287
|
-
--trees-file-icon-color-svelte
|
|
288
|
-
--trees-file-icon-color-svgo
|
|
289
|
-
--trees-file-icon-color-swift
|
|
290
|
-
--trees-file-icon-color-table
|
|
291
|
-
--trees-file-icon-color-text
|
|
292
|
-
--trees-file-icon-color-tailwind
|
|
293
|
-
--trees-file-icon-color-terraform
|
|
294
|
-
--trees-file-icon-color-typescript
|
|
295
|
-
--trees-file-icon-color-vite
|
|
296
|
-
--trees-file-icon-color-vscode
|
|
297
|
-
--trees-file-icon-color-vue
|
|
298
|
-
--trees-file-icon-color-wasm
|
|
299
|
-
--trees-file-icon-color-webpack
|
|
300
|
-
--trees-file-icon-color-yml
|
|
301
|
-
--trees-file-icon-color-zig
|
|
302
|
-
--trees-file-icon-color-zip
|
|
303
|
-
|
|
304
|
-
// Density
|
|
305
|
-
//
|
|
306
|
-
// A unitless scale factor for padding, gaps, and indentation. Usually
|
|
307
|
-
// set via \`density\` on useFileTree. Individual overrides take precedence.
|
|
308
|
-
//
|
|
309
|
-
// Compact: 0.8
|
|
310
|
-
// Default: 1
|
|
311
|
-
// Relaxed: 1.2
|
|
312
|
-
//
|
|
313
|
-
--trees-density-override
|
|
314
|
-
|
|
315
|
-
// Available CSS Layout Overrides
|
|
316
|
-
--trees-gap-override
|
|
317
|
-
--trees-border-radius-override
|
|
318
|
-
--trees-font-family-override
|
|
319
|
-
--trees-font-size-override
|
|
320
|
-
--trees-font-weight-regular-override
|
|
321
|
-
--trees-font-weight-semibold-override
|
|
322
|
-
--trees-level-gap-override
|
|
323
|
-
--trees-item-padding-x-override
|
|
324
|
-
--trees-item-margin-x-override
|
|
325
|
-
--trees-item-row-gap-override
|
|
326
|
-
--trees-icon-width-override
|
|
327
|
-
--trees-icon-nudge-override
|
|
328
|
-
--trees-scrollbar-gutter-override
|
|
329
|
-
--trees-padding-inline-override
|
|
330
|
-
*/
|
|
331
|
-
|
|
332
|
-
--trees-accent: var(--trees-accent-override, #009fff);
|
|
333
|
-
--trees-fg: var(
|
|
334
|
-
--trees-fg-override,
|
|
335
|
-
var(--trees-theme-sidebar-fg, light-dark(#6c6c71, #adadb1))
|
|
336
|
-
);
|
|
337
|
-
--trees-fg-muted: var(
|
|
338
|
-
--trees-fg-muted-override,
|
|
339
|
-
var(--trees-theme-sidebar-header-fg, light-dark(#84848a, #84848a))
|
|
340
|
-
);
|
|
341
|
-
--trees-bg: var(
|
|
342
|
-
--trees-bg-override,
|
|
343
|
-
var(--trees-theme-sidebar-bg, light-dark(#f8f8f8, #141415))
|
|
344
|
-
);
|
|
345
|
-
/* var(--trees-theme-list-hover-bg, light-dark(#dfebff59, #19283c59)) */
|
|
346
|
-
--trees-bg-muted: var(
|
|
347
|
-
--trees-bg-muted-override,
|
|
348
|
-
var(
|
|
349
|
-
--trees-theme-list-hover-bg,
|
|
350
|
-
light-dark(
|
|
351
|
-
color-mix(
|
|
352
|
-
in lab,
|
|
353
|
-
var(--trees-accent) var(--trees-bg-alpha-light, 8%),
|
|
354
|
-
var(--trees-bg)
|
|
355
|
-
),
|
|
356
|
-
color-mix(
|
|
357
|
-
in lab,
|
|
358
|
-
var(--trees-accent) var(--trees-bg-alpha-dark, 10%),
|
|
359
|
-
var(--trees-bg)
|
|
360
|
-
)
|
|
361
|
-
)
|
|
362
|
-
)
|
|
363
|
-
);
|
|
364
|
-
--trees-input-bg: var(
|
|
365
|
-
--trees-input-bg-override,
|
|
366
|
-
light-dark(#f8f8f8, #070707)
|
|
367
|
-
);
|
|
368
|
-
|
|
369
|
-
--trees-added-light: #16a994;
|
|
370
|
-
--trees-added-dark: #00cab1;
|
|
371
|
-
--trees-ignored-light: #adadb1;
|
|
372
|
-
--trees-ignored-dark: #4a4a4e;
|
|
373
|
-
--trees-modified-light: #1ca1c7;
|
|
374
|
-
--trees-modified-dark: #08c0ef;
|
|
375
|
-
--trees-renamed-light: #d5a910;
|
|
376
|
-
--trees-renamed-dark: #ffd452;
|
|
377
|
-
--trees-untracked-light: #16a994;
|
|
378
|
-
--trees-untracked-dark: #00cab1;
|
|
379
|
-
--trees-deleted-light: #ff2e3f;
|
|
380
|
-
--trees-deleted-dark: #ff6762;
|
|
381
|
-
|
|
382
|
-
--trees-border-color: var(
|
|
383
|
-
--trees-border-color-override,
|
|
384
|
-
var(--trees-theme-sidebar-border, light-dark(#eeeeef, #070707))
|
|
385
|
-
);
|
|
386
|
-
--trees-indent-guide-bg: var(
|
|
387
|
-
--trees-indent-guide-bg-override,
|
|
388
|
-
color-mix(in lab, var(--trees-fg-muted) 25%, transparent)
|
|
389
|
-
);
|
|
390
|
-
--trees-density: var(--trees-density-override, 1);
|
|
391
|
-
--trees-border-radius: var(
|
|
392
|
-
--trees-border-radius-override,
|
|
393
|
-
calc(6px * var(--trees-density))
|
|
394
|
-
);
|
|
395
|
-
|
|
396
|
-
--trees-font-family: var(--trees-font-family-override, system-ui);
|
|
397
|
-
--trees-font-size: var(--trees-font-size-override, 13px);
|
|
398
|
-
--trees-font-weight-regular: var(--trees-font-weight-regular-override, 400);
|
|
399
|
-
--trees-font-weight-semibold: var(
|
|
400
|
-
--trees-font-weight-semibold-override,
|
|
401
|
-
600
|
|
402
|
-
);
|
|
403
|
-
|
|
404
|
-
--trees-focus-ring-color: var(
|
|
405
|
-
--trees-focus-ring-color-override,
|
|
406
|
-
var(--trees-theme-focus-ring, var(--trees-accent))
|
|
407
|
-
);
|
|
408
|
-
--trees-focus-ring-width: var(--trees-focus-ring-width-override, 1px);
|
|
409
|
-
--trees-focus-ring-offset: var(--trees-focus-ring-offset-override, -1px);
|
|
410
|
-
|
|
411
|
-
--trees-search-fg: var(
|
|
412
|
-
--trees-search-fg-override,
|
|
413
|
-
var(--trees-theme-input-fg, var(--trees-fg))
|
|
414
|
-
);
|
|
415
|
-
--trees-search-font-weight: var(--trees-search-font-weight-override, 600);
|
|
416
|
-
--trees-search-bg: var(
|
|
417
|
-
--trees-search-bg-override,
|
|
418
|
-
var(--trees-theme-input-bg, var(--trees-input-bg))
|
|
419
|
-
);
|
|
420
|
-
|
|
421
|
-
--trees-scrollbar-thumb: var(
|
|
422
|
-
--trees-scrollbar-thumb-override,
|
|
423
|
-
var(
|
|
424
|
-
--trees-theme-scrollbar-thumb,
|
|
425
|
-
color-mix(in lab, var(--trees-fg) 25%, var(--trees-bg))
|
|
426
|
-
)
|
|
427
|
-
);
|
|
428
|
-
|
|
429
|
-
--trees-selected-fg: var(
|
|
430
|
-
--trees-selected-fg-override,
|
|
431
|
-
var(--trees-theme-list-active-selection-fg, var(--trees-fg))
|
|
432
|
-
);
|
|
433
|
-
--trees-selected-bg: var(
|
|
434
|
-
--trees-selected-bg-override,
|
|
435
|
-
var(
|
|
436
|
-
--trees-theme-list-active-selection-bg,
|
|
437
|
-
light-dark(
|
|
438
|
-
color-mix(in lab, var(--trees-accent) 12%, var(--trees-bg)),
|
|
439
|
-
color-mix(in lab, var(--trees-accent) 15%, var(--trees-bg))
|
|
440
|
-
)
|
|
441
|
-
)
|
|
442
|
-
);
|
|
443
|
-
--trees-selected-focused-border-color: var(
|
|
444
|
-
--trees-selected-focused-border-color-override,
|
|
445
|
-
var(--trees-theme-focus-ring, var(--trees-accent))
|
|
446
|
-
);
|
|
447
|
-
|
|
448
|
-
/* Git status (e.g. from Shiki theme gitDecoration.*) */
|
|
449
|
-
--trees-status-added: var(
|
|
450
|
-
--trees-status-added-override,
|
|
451
|
-
var(
|
|
452
|
-
--trees-theme-git-added-fg,
|
|
453
|
-
light-dark(var(--trees-added-light), var(--trees-added-dark))
|
|
454
|
-
)
|
|
455
|
-
);
|
|
456
|
-
--trees-status-ignored: var(
|
|
457
|
-
--trees-status-ignored-override,
|
|
458
|
-
var(
|
|
459
|
-
--trees-theme-git-ignored-fg,
|
|
460
|
-
light-dark(var(--trees-ignored-light), var(--trees-ignored-dark))
|
|
461
|
-
)
|
|
462
|
-
);
|
|
463
|
-
--trees-status-modified: var(
|
|
464
|
-
--trees-status-modified-override,
|
|
465
|
-
var(
|
|
466
|
-
--trees-theme-git-modified-fg,
|
|
467
|
-
light-dark(var(--trees-modified-light), var(--trees-modified-dark))
|
|
468
|
-
)
|
|
469
|
-
);
|
|
470
|
-
--trees-status-renamed: var(
|
|
471
|
-
--trees-status-renamed-override,
|
|
472
|
-
var(
|
|
473
|
-
--trees-theme-git-renamed-fg,
|
|
474
|
-
light-dark(var(--trees-renamed-light), var(--trees-renamed-dark))
|
|
475
|
-
)
|
|
476
|
-
);
|
|
477
|
-
--trees-status-untracked: var(
|
|
478
|
-
--trees-status-untracked-override,
|
|
479
|
-
var(
|
|
480
|
-
--trees-theme-git-untracked-fg,
|
|
481
|
-
light-dark(var(--trees-untracked-light), var(--trees-untracked-dark))
|
|
482
|
-
)
|
|
483
|
-
);
|
|
484
|
-
--trees-status-deleted: var(
|
|
485
|
-
--trees-status-deleted-override,
|
|
486
|
-
var(
|
|
487
|
-
--trees-theme-git-deleted-fg,
|
|
488
|
-
light-dark(var(--trees-deleted-light), var(--trees-deleted-dark))
|
|
489
|
-
)
|
|
490
|
-
);
|
|
491
|
-
--trees-git-modified-color: var(
|
|
492
|
-
--trees-git-modified-color-override,
|
|
493
|
-
var(--trees-status-modified)
|
|
494
|
-
);
|
|
495
|
-
--trees-git-added-color: var(
|
|
496
|
-
--trees-git-added-color-override,
|
|
497
|
-
var(--trees-status-added)
|
|
498
|
-
);
|
|
499
|
-
--trees-git-ignored-color: var(
|
|
500
|
-
--trees-git-ignored-color-override,
|
|
501
|
-
var(--trees-status-ignored)
|
|
502
|
-
);
|
|
503
|
-
--trees-git-deleted-color: var(
|
|
504
|
-
--trees-git-deleted-color-override,
|
|
505
|
-
var(--trees-status-deleted)
|
|
506
|
-
);
|
|
507
|
-
--trees-git-renamed-color: var(
|
|
508
|
-
--trees-git-renamed-color-override,
|
|
509
|
-
var(--trees-status-renamed)
|
|
510
|
-
);
|
|
511
|
-
--trees-git-untracked-color: var(
|
|
512
|
-
--trees-git-untracked-color-override,
|
|
513
|
-
var(--trees-status-untracked)
|
|
514
|
-
);
|
|
515
|
-
|
|
516
|
-
--trees-icon-gray: light-dark(#84848a, #adadb1);
|
|
517
|
-
--trees-icon-red: light-dark(#d52c36, #ff6762);
|
|
518
|
-
--trees-icon-vermilion: light-dark(#ff8c5b, #d5512f);
|
|
519
|
-
--trees-icon-orange: light-dark(#d47628, #ffa359);
|
|
520
|
-
--trees-icon-yellow: light-dark(#d5a910, #ffd452);
|
|
521
|
-
--trees-icon-green: light-dark(#199f43, #5ecc71);
|
|
522
|
-
--trees-icon-teal: light-dark(#17a5af, #64d1db);
|
|
523
|
-
--trees-icon-cyan: light-dark(#1ca1c7, #68cdf2);
|
|
524
|
-
--trees-icon-blue: light-dark(#1a85d4, #69b1ff);
|
|
525
|
-
--trees-icon-indigo: light-dark(#693acf, #9d6afb);
|
|
526
|
-
--trees-icon-purple: light-dark(#a631be, #d568ea);
|
|
527
|
-
--trees-icon-pink: light-dark(#d32a61, #ff678d);
|
|
528
|
-
--trees-icon-mauve: light-dark(#594c5b, #79697b);
|
|
529
|
-
|
|
530
|
-
--trees-file-icon-color-default: var(
|
|
531
|
-
--trees-file-icon-color,
|
|
532
|
-
var(--trees-icon-gray)
|
|
533
|
-
);
|
|
534
|
-
--trees-file-icon-color-astro: var(
|
|
535
|
-
--trees-file-icon-color,
|
|
536
|
-
var(--trees-icon-purple)
|
|
537
|
-
);
|
|
538
|
-
--trees-file-icon-color-babel: var(
|
|
539
|
-
--trees-file-icon-color,
|
|
540
|
-
var(--trees-icon-yellow)
|
|
541
|
-
);
|
|
542
|
-
--trees-file-icon-color-bash: var(
|
|
543
|
-
--trees-file-icon-color,
|
|
544
|
-
var(--trees-icon-green)
|
|
545
|
-
);
|
|
546
|
-
--trees-file-icon-color-biome: var(
|
|
547
|
-
--trees-file-icon-color,
|
|
548
|
-
var(--trees-icon-blue)
|
|
549
|
-
);
|
|
550
|
-
--trees-file-icon-color-bootstrap: var(
|
|
551
|
-
--trees-file-icon-color,
|
|
552
|
-
var(--trees-icon-indigo)
|
|
553
|
-
);
|
|
554
|
-
--trees-file-icon-color-browserslist: var(
|
|
555
|
-
--trees-file-icon-color,
|
|
556
|
-
var(--trees-icon-yellow)
|
|
557
|
-
);
|
|
558
|
-
--trees-file-icon-color-bun: var(
|
|
559
|
-
--trees-file-icon-color,
|
|
560
|
-
var(--trees-icon-mauve)
|
|
561
|
-
);
|
|
562
|
-
--trees-file-icon-color-claude: var(
|
|
563
|
-
--trees-file-icon-color,
|
|
564
|
-
var(--trees-icon-orange)
|
|
565
|
-
);
|
|
566
|
-
--trees-file-icon-color-css: var(
|
|
567
|
-
--trees-file-icon-color,
|
|
568
|
-
var(--trees-icon-indigo)
|
|
569
|
-
);
|
|
570
|
-
--trees-file-icon-color-database: var(
|
|
571
|
-
--trees-file-icon-color,
|
|
572
|
-
var(--trees-icon-purple)
|
|
573
|
-
);
|
|
574
|
-
--trees-file-icon-color-docker: var(
|
|
575
|
-
--trees-file-icon-color,
|
|
576
|
-
var(--trees-icon-blue)
|
|
577
|
-
);
|
|
578
|
-
--trees-file-icon-color-eslint: var(
|
|
579
|
-
--trees-file-icon-color,
|
|
580
|
-
var(--trees-icon-indigo)
|
|
581
|
-
);
|
|
582
|
-
--trees-file-icon-color-git: var(
|
|
583
|
-
--trees-file-icon-vermilion,
|
|
584
|
-
var(--trees-icon-vermilion)
|
|
585
|
-
);
|
|
586
|
-
--trees-file-icon-color-go: var(
|
|
587
|
-
--trees-file-icon-color,
|
|
588
|
-
var(--trees-icon-cyan)
|
|
589
|
-
);
|
|
590
|
-
--trees-file-icon-color-graphql: var(
|
|
591
|
-
--trees-file-icon-color,
|
|
592
|
-
var(--trees-icon-pink)
|
|
593
|
-
);
|
|
594
|
-
--trees-file-icon-color-html: var(
|
|
595
|
-
--trees-file-icon-color,
|
|
596
|
-
var(--trees-icon-orange)
|
|
597
|
-
);
|
|
598
|
-
--trees-file-icon-color-image: var(
|
|
599
|
-
--trees-file-icon-color,
|
|
600
|
-
var(--trees-icon-pink)
|
|
601
|
-
);
|
|
602
|
-
--trees-file-icon-color-javascript: var(
|
|
603
|
-
--trees-file-icon-color,
|
|
604
|
-
var(--trees-icon-yellow)
|
|
605
|
-
);
|
|
606
|
-
--trees-file-icon-color-json: var(
|
|
607
|
-
--trees-file-icon-color,
|
|
608
|
-
var(--trees-icon-orange)
|
|
609
|
-
);
|
|
610
|
-
--trees-file-icon-color-markdown: var(
|
|
611
|
-
--trees-file-icon-color,
|
|
612
|
-
var(--trees-icon-green)
|
|
613
|
-
);
|
|
614
|
-
--trees-file-icon-color-mcp: var(
|
|
615
|
-
--trees-file-icon-color,
|
|
616
|
-
var(--trees-icon-teal)
|
|
617
|
-
);
|
|
618
|
-
--trees-file-icon-color-npm: var(
|
|
619
|
-
--trees-file-icon-color,
|
|
620
|
-
var(--trees-icon-red)
|
|
621
|
-
);
|
|
622
|
-
--trees-file-icon-color-oxc: var(
|
|
623
|
-
--trees-file-icon-cyan,
|
|
624
|
-
var(--trees-icon-cyan)
|
|
625
|
-
);
|
|
626
|
-
--trees-file-icon-color-postcss: var(
|
|
627
|
-
--trees-file-icon-color,
|
|
628
|
-
var(--trees-icon-red)
|
|
629
|
-
);
|
|
630
|
-
--trees-file-icon-color-prettier: var(
|
|
631
|
-
--trees-file-icon-color,
|
|
632
|
-
var(--trees-icon-teal)
|
|
633
|
-
);
|
|
634
|
-
--trees-file-icon-color-python: var(
|
|
635
|
-
--trees-file-icon-color,
|
|
636
|
-
var(--trees-icon-blue)
|
|
637
|
-
);
|
|
638
|
-
--trees-file-icon-color-react: var(
|
|
639
|
-
--trees-file-icon-color,
|
|
640
|
-
var(--trees-icon-cyan)
|
|
641
|
-
);
|
|
642
|
-
--trees-file-icon-color-ruby: var(
|
|
643
|
-
--trees-file-icon-color,
|
|
644
|
-
var(--trees-icon-red)
|
|
645
|
-
);
|
|
646
|
-
--trees-file-icon-color-rust: var(
|
|
647
|
-
--trees-file-icon-color,
|
|
648
|
-
var(--trees-icon-orange)
|
|
649
|
-
);
|
|
650
|
-
--trees-file-icon-color-sass: var(
|
|
651
|
-
--trees-file-icon-color,
|
|
652
|
-
var(--trees-icon-pink)
|
|
653
|
-
);
|
|
654
|
-
--trees-file-icon-color-svg: var(
|
|
655
|
-
--trees-file-icon-color,
|
|
656
|
-
var(--trees-icon-orange)
|
|
657
|
-
);
|
|
658
|
-
--trees-file-icon-color-svelte: var(
|
|
659
|
-
--trees-file-icon-color,
|
|
660
|
-
var(--trees-icon-red)
|
|
661
|
-
);
|
|
662
|
-
--trees-file-icon-color-svgo: var(
|
|
663
|
-
--trees-file-icon-color,
|
|
664
|
-
var(--trees-icon-green)
|
|
665
|
-
);
|
|
666
|
-
--trees-file-icon-color-swift: var(
|
|
667
|
-
--trees-file-icon-color,
|
|
668
|
-
var(--trees-icon-orange)
|
|
669
|
-
);
|
|
670
|
-
--trees-file-icon-color-table: var(
|
|
671
|
-
--trees-file-icon-color,
|
|
672
|
-
var(--trees-icon-teal)
|
|
673
|
-
);
|
|
674
|
-
--trees-file-icon-color-text: var(
|
|
675
|
-
--trees-file-icon-color,
|
|
676
|
-
var(--trees-icon-gray)
|
|
677
|
-
);
|
|
678
|
-
--trees-file-icon-color-tailwind: var(
|
|
679
|
-
--trees-file-icon-color,
|
|
680
|
-
var(--trees-icon-cyan)
|
|
681
|
-
);
|
|
682
|
-
--trees-file-icon-color-terraform: var(
|
|
683
|
-
--trees-file-icon-color,
|
|
684
|
-
var(--trees-icon-indigo)
|
|
685
|
-
);
|
|
686
|
-
--trees-file-icon-color-typescript: var(
|
|
687
|
-
--trees-file-icon-color,
|
|
688
|
-
var(--trees-icon-blue)
|
|
689
|
-
);
|
|
690
|
-
--trees-file-icon-color-vite: var(
|
|
691
|
-
--trees-file-icon-color,
|
|
692
|
-
var(--trees-icon-purple)
|
|
693
|
-
);
|
|
694
|
-
--trees-file-icon-color-vscode: var(
|
|
695
|
-
--trees-file-icon-color,
|
|
696
|
-
var(--trees-icon-blue)
|
|
697
|
-
);
|
|
698
|
-
--trees-file-icon-color-vue: var(
|
|
699
|
-
--trees-file-icon-color,
|
|
700
|
-
var(--trees-icon-green)
|
|
701
|
-
);
|
|
702
|
-
--trees-file-icon-color-wasm: var(
|
|
703
|
-
--trees-file-icon-color,
|
|
704
|
-
var(--trees-icon-indigo)
|
|
705
|
-
);
|
|
706
|
-
--trees-file-icon-color-webpack: var(
|
|
707
|
-
--trees-file-icon-color,
|
|
708
|
-
var(--trees-icon-blue)
|
|
709
|
-
);
|
|
710
|
-
--trees-file-icon-color-yml: var(
|
|
711
|
-
--trees-file-icon-color,
|
|
712
|
-
var(--trees-icon-red)
|
|
713
|
-
);
|
|
714
|
-
--trees-file-icon-color-zig: var(
|
|
715
|
-
--trees-file-icon-color,
|
|
716
|
-
var(--trees-icon-orange)
|
|
717
|
-
);
|
|
718
|
-
--trees-file-icon-color-zip: var(
|
|
719
|
-
--trees-file-icon-color,
|
|
720
|
-
var(--trees-icon-orange)
|
|
721
|
-
);
|
|
722
|
-
|
|
723
|
-
--trees-level-gap: var(
|
|
724
|
-
--trees-level-gap-override,
|
|
725
|
-
calc(8px * var(--trees-density))
|
|
726
|
-
);
|
|
727
|
-
--trees-item-padding-x: var(
|
|
728
|
-
--trees-item-padding-x-override,
|
|
729
|
-
calc(8px * var(--trees-density))
|
|
730
|
-
);
|
|
731
|
-
--trees-item-margin-x: var(
|
|
732
|
-
--trees-item-margin-x-override,
|
|
733
|
-
calc(2px * var(--trees-density))
|
|
734
|
-
);
|
|
735
|
-
--trees-item-row-gap: var(
|
|
736
|
-
--trees-item-row-gap-override,
|
|
737
|
-
calc(6px * var(--trees-density))
|
|
738
|
-
);
|
|
739
|
-
--trees-icon-width: var(--trees-icon-width-override, 16px);
|
|
740
|
-
--trees-icon-nudge: var(
|
|
741
|
-
--trees-icon-nudge-override,
|
|
742
|
-
calc(1px * var(--trees-density))
|
|
743
|
-
);
|
|
744
|
-
--trees-row-height: var(--trees-item-height, 30px);
|
|
745
|
-
--trees-git-lane-width: var(--trees-git-lane-width-override, 12px);
|
|
746
|
-
--trees-action-lane-width: var(
|
|
747
|
-
--trees-action-lane-width-override,
|
|
748
|
-
calc(var(--trees-icon-width) + 2px)
|
|
749
|
-
);
|
|
750
|
-
/* Keep the floating trigger aligned with the row's action lane. Going in
|
|
751
|
-
from the root's right edge: the scroll container reserves
|
|
752
|
-
\`--trees-padding-inline\` of effective inset on each side (its asymmetric
|
|
753
|
-
padding formula cancels the scrollbar gutter on the right), the row
|
|
754
|
-
sits inside that inset, and its trailing \`--trees-item-padding-x\` is the
|
|
755
|
-
action lane itself. The trigger's own focus-ring margin then trims one
|
|
756
|
-
pixel back so the button's visible right edge lines up with the lane. */
|
|
757
|
-
--trees-context-menu-trigger-inline-offset: calc(
|
|
758
|
-
var(--trees-padding-inline) + var(--trees-item-padding-x) -
|
|
759
|
-
var(--trees-focus-ring-width)
|
|
760
|
-
);
|
|
761
|
-
|
|
762
|
-
--trees-scrollbar-gutter: var(--trees-scrollbar-gutter-override, 6px);
|
|
763
|
-
--trees-padding-inline: var(--trees-padding-inline-override, 16px);
|
|
764
|
-
|
|
765
|
-
color-scheme: light dark;
|
|
766
|
-
display: flex;
|
|
767
|
-
flex-direction: column;
|
|
768
|
-
font-size: var(--trees-font-size);
|
|
769
|
-
color: var(--trees-fg);
|
|
770
|
-
background-color: var(--trees-bg);
|
|
771
|
-
--truncate-marker-background-color: var(--trees-bg);
|
|
772
|
-
--truncate-marker-background-overlay-color: transparent;
|
|
773
|
-
font-family: var(--trees-font-family);
|
|
774
|
-
font-weight: var(--trees-font-weight-regular);
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
:host([data-file-tree-virtualized='true']) {
|
|
778
|
-
height: 100%;
|
|
779
|
-
overflow: hidden;
|
|
780
|
-
}
|
|
781
|
-
|
|
782
|
-
[data-file-tree-virtualized-wrapper='true'] {
|
|
783
|
-
height: 100%;
|
|
784
|
-
overflow: hidden;
|
|
785
|
-
display: flex;
|
|
786
|
-
flex-direction: column;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
[data-file-tree-virtualized-root='true'] {
|
|
790
|
-
height: 100%;
|
|
791
|
-
display: flex;
|
|
792
|
-
flex-direction: column;
|
|
793
|
-
overflow: hidden;
|
|
794
|
-
}
|
|
795
|
-
|
|
796
|
-
[data-file-tree-virtualized-scroll='true'],
|
|
797
|
-
[data-file-tree-scrollbar-measure='true'] {
|
|
798
|
-
overflow-y: auto;
|
|
799
|
-
scrollbar-gutter: stable;
|
|
800
|
-
|
|
801
|
-
&::-webkit-scrollbar {
|
|
802
|
-
width: var(--trees-scrollbar-gutter);
|
|
803
|
-
height: var(--trees-scrollbar-gutter);
|
|
804
|
-
}
|
|
805
|
-
|
|
806
|
-
&::-webkit-scrollbar-track {
|
|
807
|
-
background: transparent;
|
|
808
|
-
}
|
|
809
|
-
|
|
810
|
-
&::-webkit-scrollbar-thumb {
|
|
811
|
-
background-color: var(--trees-scrollbar-thumb);
|
|
812
|
-
border: 1px solid transparent;
|
|
813
|
-
background-clip: content-box;
|
|
814
|
-
border-radius: calc(var(--trees-scrollbar-gutter) / 2);
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
&::-webkit-scrollbar-corner {
|
|
818
|
-
background-color: transparent;
|
|
819
|
-
}
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
/* These are styles for a temporarily generated element to measure the size
|
|
823
|
-
* of the scrollbar. It's intended to be somewhat similar in scrollbar style
|
|
824
|
-
* scope to the scrollable tree so \`--trees-scrollbar-gutter-measured\` is an
|
|
825
|
-
* accurate reflection of the size the scrollbar gutter takes up. */
|
|
826
|
-
[data-file-tree-scrollbar-measure='true'] {
|
|
827
|
-
position: absolute;
|
|
828
|
-
top: 0;
|
|
829
|
-
left: 0;
|
|
830
|
-
visibility: hidden;
|
|
831
|
-
pointer-events: none;
|
|
832
|
-
width: 100px;
|
|
833
|
-
height: 100px;
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
@supports (-moz-appearance: none) {
|
|
837
|
-
[data-file-tree-virtualized-scroll='true'],
|
|
838
|
-
[data-file-tree-scrollbar-measure='true'] {
|
|
839
|
-
scrollbar-width: thin;
|
|
840
|
-
scrollbar-color: var(--trees-scrollbar-thumb) transparent;
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
|
|
844
|
-
[data-file-tree-virtualized-scroll='true'] {
|
|
845
|
-
position: relative;
|
|
846
|
-
overflow-y: auto;
|
|
847
|
-
flex: 1 1 0;
|
|
848
|
-
min-height: 0;
|
|
849
|
-
padding-inline: max(
|
|
850
|
-
calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
|
|
851
|
-
0px
|
|
852
|
-
)
|
|
853
|
-
/* NOTE(amadeus): We can assume that all Webkit based browser gutters
|
|
854
|
-
* will align to the value of '--trees-scrollbar-gutter', however if not, then
|
|
855
|
-
* \`--trees-scrollbar-gutter-measured\` should correct it. Mostly we are
|
|
856
|
-
* hoping to avoid SSR alignment jumps if possible. In non-SSR'd environments
|
|
857
|
-
* \`--trees-scrollbar-gutter-measured\` should always be immediately available.
|
|
858
|
-
*/
|
|
859
|
-
max(
|
|
860
|
-
calc(
|
|
861
|
-
var(--trees-padding-inline) - var(--trees-item-margin-x) -
|
|
862
|
-
var(
|
|
863
|
-
--trees-scrollbar-gutter-measured,
|
|
864
|
-
var(--trees-scrollbar-gutter)
|
|
865
|
-
)
|
|
866
|
-
),
|
|
867
|
-
0px
|
|
868
|
-
);
|
|
869
|
-
}
|
|
870
|
-
|
|
871
|
-
@supports (-moz-appearance: none) {
|
|
872
|
-
[data-file-tree-virtualized-scroll='true'] {
|
|
873
|
-
padding-inline: max(
|
|
874
|
-
calc(var(--trees-padding-inline) - var(--trees-item-margin-x)),
|
|
875
|
-
0px
|
|
876
|
-
)
|
|
877
|
-
/* NOTE(amadeus): However on Firefox it can vary a little bit, but most
|
|
878
|
-
* likely the majority of cases will default to a 0px width scrollbar lets
|
|
879
|
-
* inherit that first to avoid SSR jumps. In non-SSR'd environments
|
|
880
|
-
* \`--trees-scrollbar-gutter-measured\` should always be immediately available.
|
|
881
|
-
*/
|
|
882
|
-
max(
|
|
883
|
-
calc(
|
|
884
|
-
var(--trees-padding-inline) - var(--trees-item-margin-x) -
|
|
885
|
-
var(--trees-scrollbar-gutter-measured, 0px)
|
|
886
|
-
),
|
|
887
|
-
0px
|
|
888
|
-
);
|
|
889
|
-
}
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
[data-file-tree-sticky-overlay='true'] {
|
|
893
|
-
position: sticky;
|
|
894
|
-
top: 0;
|
|
895
|
-
height: 0;
|
|
896
|
-
z-index: 4;
|
|
897
|
-
overflow: visible;
|
|
898
|
-
pointer-events: none;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
/* The overlay DOM is kept populated even at scrollTop=0 so the browser has
|
|
902
|
-
* the rendered rows on hand the moment scrolling begins — otherwise the
|
|
903
|
-
* compositor paints a scrolled frame before React can mount the overlay,
|
|
904
|
-
* and the topmost sticky folder jumps up by a couple of pixels before it
|
|
905
|
-
* "snaps" into its pinned position. We hide it via CSS whenever the scroll
|
|
906
|
-
* is at the top and no scroll is in progress, so the preview doesn't leak
|
|
907
|
-
* through at rest. \`data-overlay-reveal\` is stamped on the root only when
|
|
908
|
-
* the user initiates a scroll while already at the top — exactly the case
|
|
909
|
-
* where we need the pre-mounted overlay to be visible through the first
|
|
910
|
-
* compositor frame. It is deliberately distinct from the general
|
|
911
|
-
* \`data-is-scrolling\` flag so a scroll that ends at the top (e.g. ArrowUp
|
|
912
|
-
* navigation) re-hides the overlay the instant the scroll lands, rather
|
|
913
|
-
* than waiting for the hover-suppression timer to elapse. */
|
|
914
|
-
[data-file-tree-virtualized-root='true'][data-scroll-at-top='true']:not(
|
|
915
|
-
[data-overlay-reveal]
|
|
916
|
-
)
|
|
917
|
-
[data-file-tree-sticky-overlay='true'] {
|
|
918
|
-
visibility: hidden;
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
[data-file-tree-sticky-overlay-content='true'] {
|
|
922
|
-
background-color: var(--trees-bg);
|
|
923
|
-
position: relative;
|
|
924
|
-
pointer-events: none;
|
|
925
|
-
}
|
|
926
|
-
|
|
927
|
-
[data-file-tree-virtualized-list='true'] {
|
|
928
|
-
background-color: var(--trees-bg);
|
|
929
|
-
position: relative;
|
|
930
|
-
min-height: 100%;
|
|
931
|
-
width: 100%;
|
|
932
|
-
overflow-anchor: none;
|
|
933
|
-
|
|
934
|
-
&[data-is-scrolling] {
|
|
935
|
-
pointer-events: none;
|
|
936
|
-
}
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
[data-file-tree-virtualized-sticky-offset='true'] {
|
|
940
|
-
contain: layout size;
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
[data-file-tree-virtualized-sticky='true'] {
|
|
944
|
-
position: sticky;
|
|
945
|
-
top: 0;
|
|
946
|
-
width: 100%;
|
|
947
|
-
display: flex;
|
|
948
|
-
flex-direction: column;
|
|
949
|
-
isolation: isolate;
|
|
950
|
-
/* Promote to its own compositor layer so text inside the window is
|
|
951
|
-
* rasterized once and GPU-translated during scroll. Without this, the
|
|
952
|
-
* browser re-paints the window (and its text) at every scroll frame,
|
|
953
|
-
* which produces visible 1px shake / character tearing. */
|
|
954
|
-
will-change: transform;
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
[data-file-tree-search-container] {
|
|
958
|
-
display: flex;
|
|
959
|
-
padding: 0;
|
|
960
|
-
padding-inline: var(--trees-padding-inline);
|
|
961
|
-
margin-bottom: var(--trees-item-row-gap);
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
[data-file-tree-search-input] {
|
|
965
|
-
--trees-focus-ring-width: 2px;
|
|
966
|
-
font-family: var(--trees-font-family);
|
|
967
|
-
font-size: var(--trees-font-size);
|
|
968
|
-
flex: 1;
|
|
969
|
-
height: var(--trees-row-height);
|
|
970
|
-
/* 1px breathing room so the focus-visible outline isn't clipped when the
|
|
971
|
-
* input sits flush against the top of the scroll container. */
|
|
972
|
-
margin-block: 1px;
|
|
973
|
-
padding-inline: var(--trees-item-padding-x);
|
|
974
|
-
line-height: var(--trees-row-height);
|
|
975
|
-
color: var(--trees-search-fg);
|
|
976
|
-
background-color: var(--trees-search-bg);
|
|
977
|
-
border: 1px solid var(--trees-border-color);
|
|
978
|
-
border-radius: var(--trees-border-radius);
|
|
979
|
-
outline: none;
|
|
980
|
-
|
|
981
|
-
&::placeholder {
|
|
982
|
-
color: color-mix(
|
|
983
|
-
in lab,
|
|
984
|
-
var(--trees-search-fg) 65%,
|
|
985
|
-
var(--trees-search-bg)
|
|
986
|
-
);
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
&:focus-visible,
|
|
990
|
-
&[data-file-tree-search-input-fake-focus='true'] {
|
|
991
|
-
outline: var(--trees-focus-ring-width) solid var(--trees-focus-ring-color);
|
|
992
|
-
outline-offset: var(--trees-focus-ring-offset);
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
/* The wrapper for the tree items */
|
|
997
|
-
[role='tree'] {
|
|
998
|
-
position: relative;
|
|
999
|
-
display: flex;
|
|
1000
|
-
flex-direction: column;
|
|
1001
|
-
gap: var(--trees-gap-override, 0);
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
/* LIST ITEM */
|
|
1005
|
-
[data-type='item'] {
|
|
1006
|
-
color: inherit;
|
|
1007
|
-
font-family: var(--trees-font-family);
|
|
1008
|
-
font-size: var(--trees-font-size);
|
|
1009
|
-
text-align: start;
|
|
1010
|
-
outline: none;
|
|
1011
|
-
background-color: var(--trees-bg);
|
|
1012
|
-
border: none;
|
|
1013
|
-
position: relative;
|
|
1014
|
-
|
|
1015
|
-
padding: 0 var(--trees-item-padding-x);
|
|
1016
|
-
margin: 0 var(--trees-item-margin-x);
|
|
1017
|
-
cursor: pointer;
|
|
1018
|
-
-webkit-user-select: none;
|
|
1019
|
-
user-select: none;
|
|
1020
|
-
-webkit-touch-callout: none;
|
|
1021
|
-
touch-action: manipulation;
|
|
1022
|
-
display: flex;
|
|
1023
|
-
flex: 0 0 var(--trees-row-height);
|
|
1024
|
-
align-items: center;
|
|
1025
|
-
height: var(--trees-row-height);
|
|
1026
|
-
line-height: var(--trees-row-height);
|
|
1027
|
-
gap: var(--trees-item-row-gap);
|
|
1028
|
-
border-radius: var(--trees-border-radius);
|
|
1029
|
-
/* Row states may be translucent, so markers paint the tree background first
|
|
1030
|
-
* and then the state color on top to avoid compositing the same alpha twice. */
|
|
1031
|
-
--truncate-marker-background-color: var(--trees-bg);
|
|
1032
|
-
--truncate-marker-background-overlay-color: transparent;
|
|
1033
|
-
--truncate-marker-block-inset: 0px;
|
|
1034
|
-
|
|
1035
|
-
&:hover,
|
|
1036
|
-
&[data-item-context-hover='true'] {
|
|
1037
|
-
background-color: var(--trees-bg-muted);
|
|
1038
|
-
--truncate-marker-background-overlay-color: var(--trees-bg-muted);
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
&[data-item-focused='true'],
|
|
1042
|
-
&:focus-visible {
|
|
1043
|
-
z-index: 2;
|
|
1044
|
-
|
|
1045
|
-
/* Flattened segment markers sit high enough to cover the row outline unless
|
|
1046
|
-
* their painted background is inset by the focus ring width. */
|
|
1047
|
-
[data-item-flattened-subitems] {
|
|
1048
|
-
--truncate-marker-block-inset: var(--trees-focus-ring-width);
|
|
1049
|
-
}
|
|
1050
|
-
|
|
1051
|
-
&::before {
|
|
1052
|
-
position: absolute;
|
|
1053
|
-
inset: 0;
|
|
1054
|
-
content: '';
|
|
1055
|
-
display: block;
|
|
1056
|
-
border-radius: var(--trees-border-radius);
|
|
1057
|
-
outline: var(--trees-focus-ring-width) solid
|
|
1058
|
-
var(--trees-focus-ring-color);
|
|
1059
|
-
outline-offset: var(--trees-focus-ring-offset);
|
|
1060
|
-
pointer-events: none;
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
&[data-item-selected='true']::before {
|
|
1064
|
-
outline-color: var(--trees-selected-focused-border-color);
|
|
1065
|
-
}
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
&[data-item-selected='true'] {
|
|
1069
|
-
color: var(--trees-selected-fg);
|
|
1070
|
-
background-color: var(--trees-selected-bg);
|
|
1071
|
-
--truncate-marker-background-overlay-color: var(--trees-selected-bg);
|
|
1072
|
-
z-index: 3;
|
|
1073
|
-
|
|
1074
|
-
[data-item-section='icon'] {
|
|
1075
|
-
color: var(--trees-selected-fg);
|
|
1076
|
-
}
|
|
1077
|
-
}
|
|
1078
|
-
|
|
1079
|
-
&[data-item-search-match='true'] {
|
|
1080
|
-
font-weight: var(--trees-search-font-weight);
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
[data-type='item'][data-file-tree-sticky-row='true'] {
|
|
1085
|
-
pointer-events: auto;
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
/* Sticky rows opt back into pointer events because the overlay wrapper is
|
|
1089
|
-
* inert. During scroll, put them back under the same hover suppression as
|
|
1090
|
-
* the virtualized list so translucent hover states and menu triggers do not
|
|
1091
|
-
* paint over rows moving beneath the sticky stack. */
|
|
1092
|
-
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1093
|
-
[data-type='item'][data-file-tree-sticky-row='true'] {
|
|
1094
|
-
pointer-events: none;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1098
|
-
[data-type='item'][data-file-tree-sticky-row='true']:hover:not(
|
|
1099
|
-
[data-item-selected='true']
|
|
1100
|
-
),
|
|
1101
|
-
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1102
|
-
[data-type='item'][data-file-tree-sticky-row='true'][data-item-context-hover='true']:not(
|
|
1103
|
-
[data-item-selected='true']
|
|
1104
|
-
) {
|
|
1105
|
-
background-color: var(--trees-bg);
|
|
1106
|
-
--truncate-marker-background-overlay-color: transparent;
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
[data-item-selected='true']:has(+ [data-item-selected='true']) {
|
|
1110
|
-
border-bottom-left-radius: 0;
|
|
1111
|
-
border-bottom-right-radius: 0;
|
|
1112
|
-
}
|
|
1113
|
-
|
|
1114
|
-
[data-item-selected='true'] + [data-item-selected='true'] {
|
|
1115
|
-
border-top-left-radius: 0;
|
|
1116
|
-
border-top-right-radius: 0;
|
|
1117
|
-
}
|
|
1118
|
-
|
|
1119
|
-
/* Flattened Directory Parts */
|
|
1120
|
-
[data-item-flattened-subitems] {
|
|
1121
|
-
display: inline-flex;
|
|
1122
|
-
align-items: center;
|
|
1123
|
-
gap: 2px;
|
|
1124
|
-
}
|
|
1125
|
-
[data-item-flattened-subitem]:hover,
|
|
1126
|
-
[data-item-flattened-subitem-drag-target='true'] {
|
|
1127
|
-
text-decoration: underline;
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
/* Icon for each item */
|
|
1131
|
-
[data-item-section='icon'] {
|
|
1132
|
-
flex-shrink: 0;
|
|
1133
|
-
display: flex;
|
|
1134
|
-
align-items: center;
|
|
1135
|
-
justify-content: center;
|
|
1136
|
-
color: var(--trees-fg-muted);
|
|
1137
|
-
fill: currentColor;
|
|
1138
|
-
width: var(--trees-icon-width);
|
|
1139
|
-
}
|
|
1140
|
-
|
|
1141
|
-
:where([data-item-section='icon'] > [data-icon-token]) {
|
|
1142
|
-
color: var(--trees-fg-muted);
|
|
1143
|
-
}
|
|
1144
|
-
|
|
1145
|
-
[data-file-tree-colored-icons='true'] {
|
|
1146
|
-
[data-icon-token='astro'] {
|
|
1147
|
-
color: var(--trees-file-icon-color-astro);
|
|
1148
|
-
}
|
|
1149
|
-
[data-icon-token='babel'] {
|
|
1150
|
-
color: var(--trees-file-icon-color-babel);
|
|
1151
|
-
}
|
|
1152
|
-
[data-icon-token='bash'] {
|
|
1153
|
-
color: var(--trees-file-icon-color-bash);
|
|
1154
|
-
}
|
|
1155
|
-
[data-icon-token='biome'] {
|
|
1156
|
-
color: var(--trees-file-icon-color-biome);
|
|
1157
|
-
}
|
|
1158
|
-
[data-icon-token='bootstrap'] {
|
|
1159
|
-
color: var(--trees-file-icon-color-bootstrap);
|
|
1160
|
-
}
|
|
1161
|
-
[data-icon-token='browserslist'] {
|
|
1162
|
-
color: var(--trees-file-icon-color-browserslist);
|
|
1163
|
-
}
|
|
1164
|
-
[data-icon-token='bun'] {
|
|
1165
|
-
color: var(--trees-file-icon-color-bun);
|
|
1166
|
-
}
|
|
1167
|
-
[data-icon-token='claude'] {
|
|
1168
|
-
color: var(--trees-file-icon-color-claude);
|
|
1169
|
-
}
|
|
1170
|
-
[data-icon-token='css'] {
|
|
1171
|
-
color: var(--trees-file-icon-color-css);
|
|
1172
|
-
}
|
|
1173
|
-
[data-icon-token='database'] {
|
|
1174
|
-
color: var(--trees-file-icon-color-database);
|
|
1175
|
-
}
|
|
1176
|
-
[data-icon-token='default'] {
|
|
1177
|
-
color: var(--trees-file-icon-color-default);
|
|
1178
|
-
}
|
|
1179
|
-
[data-icon-token='docker'] {
|
|
1180
|
-
color: var(--trees-file-icon-color-docker);
|
|
1181
|
-
}
|
|
1182
|
-
[data-icon-token='eslint'] {
|
|
1183
|
-
color: var(--trees-file-icon-color-eslint);
|
|
1184
|
-
}
|
|
1185
|
-
[data-icon-token='git'] {
|
|
1186
|
-
color: var(--trees-file-icon-color-git);
|
|
1187
|
-
}
|
|
1188
|
-
[data-icon-token='go'] {
|
|
1189
|
-
color: var(--trees-file-icon-color-go);
|
|
1190
|
-
}
|
|
1191
|
-
[data-icon-token='graphql'] {
|
|
1192
|
-
color: var(--trees-file-icon-color-graphql);
|
|
1193
|
-
}
|
|
1194
|
-
[data-icon-token='html'] {
|
|
1195
|
-
color: var(--trees-file-icon-color-html);
|
|
1196
|
-
}
|
|
1197
|
-
[data-icon-token='image'] {
|
|
1198
|
-
color: var(--trees-file-icon-color-image);
|
|
1199
|
-
}
|
|
1200
|
-
[data-icon-token='javascript'] {
|
|
1201
|
-
color: var(--trees-file-icon-color-javascript);
|
|
1202
|
-
}
|
|
1203
|
-
[data-icon-token='json'] {
|
|
1204
|
-
color: var(--trees-file-icon-color-json);
|
|
1205
|
-
}
|
|
1206
|
-
[data-icon-token='markdown'] {
|
|
1207
|
-
color: var(--trees-file-icon-color-markdown);
|
|
1208
|
-
}
|
|
1209
|
-
[data-icon-token='mcp'] {
|
|
1210
|
-
color: var(--trees-file-icon-color-mcp);
|
|
1211
|
-
}
|
|
1212
|
-
[data-icon-token='npm'] {
|
|
1213
|
-
color: var(--trees-file-icon-color-npm);
|
|
1214
|
-
}
|
|
1215
|
-
[data-icon-token='oxc'] {
|
|
1216
|
-
color: var(--trees-file-icon-color-oxc);
|
|
1217
|
-
}
|
|
1218
|
-
[data-icon-token='postcss'] {
|
|
1219
|
-
color: var(--trees-file-icon-color-postcss);
|
|
1220
|
-
}
|
|
1221
|
-
[data-icon-token='prettier'] {
|
|
1222
|
-
color: var(--trees-file-icon-color-prettier);
|
|
1223
|
-
}
|
|
1224
|
-
[data-icon-token='python'] {
|
|
1225
|
-
color: var(--trees-file-icon-color-python);
|
|
1226
|
-
}
|
|
1227
|
-
[data-icon-token='react'] {
|
|
1228
|
-
color: var(--trees-file-icon-color-react);
|
|
1229
|
-
}
|
|
1230
|
-
[data-icon-token='ruby'] {
|
|
1231
|
-
color: var(--trees-file-icon-color-ruby);
|
|
1232
|
-
}
|
|
1233
|
-
[data-icon-token='rust'] {
|
|
1234
|
-
color: var(--trees-file-icon-color-rust);
|
|
1235
|
-
}
|
|
1236
|
-
[data-icon-token='sass'] {
|
|
1237
|
-
color: var(--trees-file-icon-color-sass);
|
|
1238
|
-
}
|
|
1239
|
-
[data-icon-token='svg'] {
|
|
1240
|
-
color: var(--trees-file-icon-color-svg);
|
|
1241
|
-
}
|
|
1242
|
-
[data-icon-token='svelte'] {
|
|
1243
|
-
color: var(--trees-file-icon-color-svelte);
|
|
1244
|
-
}
|
|
1245
|
-
[data-icon-token='svgo'] {
|
|
1246
|
-
color: var(--trees-file-icon-color-svgo);
|
|
1247
|
-
}
|
|
1248
|
-
[data-icon-token='swift'] {
|
|
1249
|
-
color: var(--trees-file-icon-color-swift);
|
|
1250
|
-
}
|
|
1251
|
-
[data-icon-token='table'] {
|
|
1252
|
-
color: var(--trees-file-icon-color-table);
|
|
1253
|
-
}
|
|
1254
|
-
[data-icon-token='text'] {
|
|
1255
|
-
color: var(--trees-file-icon-color-text);
|
|
1256
|
-
}
|
|
1257
|
-
[data-icon-token='tailwind'] {
|
|
1258
|
-
color: var(--trees-file-icon-color-tailwind);
|
|
1259
|
-
}
|
|
1260
|
-
[data-icon-token='terraform'] {
|
|
1261
|
-
color: var(--trees-file-icon-color-terraform);
|
|
1262
|
-
}
|
|
1263
|
-
[data-icon-token='typescript'] {
|
|
1264
|
-
color: var(--trees-file-icon-color-typescript);
|
|
1265
|
-
}
|
|
1266
|
-
[data-icon-token='vite'] {
|
|
1267
|
-
color: var(--trees-file-icon-color-vite);
|
|
1268
|
-
}
|
|
1269
|
-
[data-icon-token='vscode'] {
|
|
1270
|
-
color: var(--trees-file-icon-color-vscode);
|
|
1271
|
-
}
|
|
1272
|
-
[data-icon-token='vue'] {
|
|
1273
|
-
color: var(--trees-file-icon-color-vue);
|
|
1274
|
-
}
|
|
1275
|
-
[data-icon-token='wasm'] {
|
|
1276
|
-
color: var(--trees-file-icon-color-wasm);
|
|
1277
|
-
}
|
|
1278
|
-
[data-icon-token='webpack'] {
|
|
1279
|
-
color: var(--trees-file-icon-color-webpack);
|
|
1280
|
-
}
|
|
1281
|
-
[data-icon-token='yml'] {
|
|
1282
|
-
color: var(--trees-file-icon-color-yml);
|
|
1283
|
-
}
|
|
1284
|
-
[data-icon-token='zig'] {
|
|
1285
|
-
color: var(--trees-file-icon-color-zig);
|
|
1286
|
-
}
|
|
1287
|
-
[data-icon-token='zip'] {
|
|
1288
|
-
color: var(--trees-file-icon-color-zip);
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
|
|
1292
|
-
/* Chevron rotation and visual alignment */
|
|
1293
|
-
/* Chevron pointing down */
|
|
1294
|
-
[data-icon-name='file-tree-icon-chevron'] {
|
|
1295
|
-
&[data-align-capitals='false'] {
|
|
1296
|
-
transform: translate(0, var(--trees-icon-nudge));
|
|
1297
|
-
}
|
|
1298
|
-
&[data-align-capitals='true'] {
|
|
1299
|
-
transform: translate(0, 0);
|
|
1300
|
-
}
|
|
1301
|
-
}
|
|
1302
|
-
|
|
1303
|
-
[data-item-section='content'] {
|
|
1304
|
-
flex: 0 1 auto;
|
|
1305
|
-
text-align: start;
|
|
1306
|
-
min-width: 0;
|
|
1307
|
-
max-width: 100%;
|
|
1308
|
-
overflow: hidden;
|
|
1309
|
-
text-overflow: ellipsis;
|
|
1310
|
-
/* Breaks middle truncate component to also set this */
|
|
1311
|
-
/* white-space: nowrap; */
|
|
1312
|
-
}
|
|
1313
|
-
|
|
1314
|
-
[data-item-section='decoration'] {
|
|
1315
|
-
flex: 1 1 0;
|
|
1316
|
-
min-width: 0;
|
|
1317
|
-
display: flex;
|
|
1318
|
-
justify-content: flex-end;
|
|
1319
|
-
text-align: end;
|
|
1320
|
-
overflow: hidden;
|
|
1321
|
-
color: var(--trees-fg-muted);
|
|
1322
|
-
}
|
|
1323
|
-
|
|
1324
|
-
[data-item-section='decoration'] > span {
|
|
1325
|
-
min-width: 0;
|
|
1326
|
-
max-width: 100%;
|
|
1327
|
-
display: inline-flex;
|
|
1328
|
-
align-items: center;
|
|
1329
|
-
justify-content: flex-end;
|
|
1330
|
-
overflow: hidden;
|
|
1331
|
-
text-overflow: ellipsis;
|
|
1332
|
-
white-space: nowrap;
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
[data-item-section='git'],
|
|
1336
|
-
[data-item-section='action'] {
|
|
1337
|
-
flex: 0 0 auto;
|
|
1338
|
-
display: flex;
|
|
1339
|
-
align-items: center;
|
|
1340
|
-
justify-content: center;
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1343
|
-
[data-item-section='git'] {
|
|
1344
|
-
width: var(--trees-git-lane-width);
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
[data-item-section='action'] {
|
|
1348
|
-
width: var(--trees-action-lane-width);
|
|
1349
|
-
color: var(--trees-fg-muted);
|
|
1350
|
-
fill: currentColor;
|
|
1351
|
-
pointer-events: none;
|
|
1352
|
-
}
|
|
1353
|
-
|
|
1354
|
-
[data-item-section='git'] > span,
|
|
1355
|
-
[data-item-section='action'] > span {
|
|
1356
|
-
width: 100%;
|
|
1357
|
-
display: inline-flex;
|
|
1358
|
-
align-items: center;
|
|
1359
|
-
justify-content: center;
|
|
1360
|
-
}
|
|
1361
|
-
|
|
1362
|
-
[data-item-action-affordance='decorative'] {
|
|
1363
|
-
opacity: 0.85;
|
|
1364
|
-
}
|
|
1365
|
-
|
|
1366
|
-
[data-item-rename-input] {
|
|
1367
|
-
appearance: none;
|
|
1368
|
-
width: 100%;
|
|
1369
|
-
min-width: 0;
|
|
1370
|
-
height: calc(var(--trees-row-height) - 4px);
|
|
1371
|
-
font-family: inherit;
|
|
1372
|
-
font-size: inherit;
|
|
1373
|
-
/* line-height: calc(var(--trees-row-height) - 8px); */
|
|
1374
|
-
color: inherit;
|
|
1375
|
-
background-color: transparent;
|
|
1376
|
-
border: 0;
|
|
1377
|
-
padding-inline: 6px;
|
|
1378
|
-
outline: none;
|
|
1379
|
-
box-sizing: border-box;
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
[data-item-section='content']:has([data-item-rename-input])
|
|
1383
|
-
~ [data-item-section='action'],
|
|
1384
|
-
[data-item-section='content']:has([data-item-rename-input])
|
|
1385
|
-
~ [data-item-section='decoration'] {
|
|
1386
|
-
display: none;
|
|
1387
|
-
}
|
|
1388
|
-
|
|
1389
|
-
/* Chevron pointing right */
|
|
1390
|
-
[aria-expanded='false'][data-item-type='folder']
|
|
1391
|
-
> [data-item-section='icon']
|
|
1392
|
-
> [data-icon-name='file-tree-icon-chevron'] {
|
|
1393
|
-
&[data-align-capitals='true'] {
|
|
1394
|
-
transform: rotate(-90deg)
|
|
1395
|
-
translate(
|
|
1396
|
-
calc(var(--trees-icon-nudge) / 2),
|
|
1397
|
-
calc(var(--trees-icon-nudge) / 2)
|
|
1398
|
-
);
|
|
1399
|
-
}
|
|
1400
|
-
&[data-align-capitals='false'] {
|
|
1401
|
-
transform: rotate(-90deg)
|
|
1402
|
-
translate(
|
|
1403
|
-
calc(var(--trees-icon-nudge) / 2 * -1),
|
|
1404
|
-
calc(var(--trees-icon-nudge) / 2)
|
|
1405
|
-
);
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
|
|
1409
|
-
/* LIST IDENTATION */
|
|
1410
|
-
/* Spacing container */
|
|
1411
|
-
[data-item-section='spacing'] {
|
|
1412
|
-
display: flex;
|
|
1413
|
-
flex-direction: row;
|
|
1414
|
-
align-items: center;
|
|
1415
|
-
justify-content: center;
|
|
1416
|
-
height: var(--trees-row-height);
|
|
1417
|
-
padding-left: calc(calc(var(--trees-icon-width) / 2) - 0.5px);
|
|
1418
|
-
|
|
1419
|
-
&:empty {
|
|
1420
|
-
padding-left: 0;
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
|
|
1424
|
-
/* Spacing per level */
|
|
1425
|
-
[data-item-section='spacing-item'] {
|
|
1426
|
-
transform: translateX(-0.25px);
|
|
1427
|
-
display: inline-block;
|
|
1428
|
-
border-left: 1px solid var(--trees-indent-guide-bg);
|
|
1429
|
-
height: 100%;
|
|
1430
|
-
margin-right: calc(var(--trees-level-gap) - 1px);
|
|
1431
|
-
opacity: 0;
|
|
1432
|
-
transition: opacity 150ms ease;
|
|
1433
|
-
|
|
1434
|
-
& + & {
|
|
1435
|
-
margin-left: calc(
|
|
1436
|
-
var(--trees-item-row-gap) + calc(var(--trees-icon-width) / 2) - 0.5px
|
|
1437
|
-
);
|
|
1438
|
-
}
|
|
1439
|
-
}
|
|
1440
|
-
|
|
1441
|
-
:host(:hover) [data-item-section='spacing-item'] {
|
|
1442
|
-
opacity: 0.75;
|
|
1443
|
-
}
|
|
1444
|
-
|
|
1445
|
-
/* Git status indicator */
|
|
1446
|
-
|
|
1447
|
-
/* This is a folder that contains a git change */
|
|
1448
|
-
[data-item-contains-git-change='true'] > [data-item-section='git'] {
|
|
1449
|
-
color: var(--trees-git-modified-color);
|
|
1450
|
-
opacity: 0.5;
|
|
1451
|
-
fill: currentColor;
|
|
1452
|
-
}
|
|
1453
|
-
|
|
1454
|
-
/* These are files that have a git change */
|
|
1455
|
-
[data-item-git-status] {
|
|
1456
|
-
&
|
|
1457
|
-
> :where([data-item-section='icon'])
|
|
1458
|
-
> :where(:not([data-icon-name='file-tree-icon-chevron'])) {
|
|
1459
|
-
color: var(--trees-item-git-status-color);
|
|
1460
|
-
}
|
|
1461
|
-
& > [data-item-section='content'] {
|
|
1462
|
-
color: var(--trees-item-git-status-color);
|
|
1463
|
-
}
|
|
1464
|
-
& > [data-item-section='git'] {
|
|
1465
|
-
color: var(--trees-item-git-status-color);
|
|
1466
|
-
font-weight: var(--trees-font-weight-semibold);
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
|
|
1470
|
-
[data-item-git-status='added'] {
|
|
1471
|
-
--trees-item-git-status-color: var(--trees-git-added-color);
|
|
1472
|
-
}
|
|
1473
|
-
|
|
1474
|
-
[data-item-git-status='deleted'] {
|
|
1475
|
-
--trees-item-git-status-color: var(--trees-git-deleted-color);
|
|
1476
|
-
}
|
|
1477
|
-
|
|
1478
|
-
[data-item-git-status='ignored'] {
|
|
1479
|
-
--trees-item-git-status-color: var(--trees-git-ignored-color);
|
|
1480
|
-
|
|
1481
|
-
& > [data-item-section='icon'] {
|
|
1482
|
-
opacity: 0.5;
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
|
|
1486
|
-
[data-item-section='git'] [data-icon-name='file-tree-icon-dot'] {
|
|
1487
|
-
/* this is a nudge to align the dot with the likely lowercase text. it's slightly
|
|
1488
|
-
generalizable, but other fonts are gonna need other nudges i assume */
|
|
1489
|
-
transform: translateY(calc(0.65ex - 50%));
|
|
1490
|
-
}
|
|
1491
|
-
|
|
1492
|
-
[data-item-git-status='modified'] {
|
|
1493
|
-
--trees-item-git-status-color: var(--trees-git-modified-color);
|
|
1494
|
-
}
|
|
1495
|
-
|
|
1496
|
-
[data-item-git-status='renamed'] {
|
|
1497
|
-
--trees-item-git-status-color: var(--trees-git-renamed-color);
|
|
1498
|
-
}
|
|
1499
|
-
|
|
1500
|
-
[data-item-git-status='untracked'] {
|
|
1501
|
-
--trees-item-git-status-color: var(--trees-git-untracked-color);
|
|
1502
|
-
}
|
|
1503
|
-
|
|
1504
|
-
/* Drag and drop */
|
|
1505
|
-
[data-item-drag-target='true'] {
|
|
1506
|
-
background-color: var(--trees-selected-bg);
|
|
1507
|
-
}
|
|
1508
|
-
|
|
1509
|
-
[data-item-dragging='true'] {
|
|
1510
|
-
opacity: 0.5;
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
|
-
/* Lock icon for locked paths (sibling of content) */
|
|
1514
|
-
[data-item-section='lock'] {
|
|
1515
|
-
flex: 0 0 auto;
|
|
1516
|
-
margin-left: auto;
|
|
1517
|
-
display: flex;
|
|
1518
|
-
align-items: center;
|
|
1519
|
-
color: var(--trees-fg-muted);
|
|
1520
|
-
}
|
|
1521
|
-
[data-item-section='lock'] svg {
|
|
1522
|
-
display: block;
|
|
1523
|
-
}
|
|
1524
|
-
|
|
1525
|
-
[data-type='header-slot'] {
|
|
1526
|
-
display: block;
|
|
1527
|
-
flex: 0 0 auto;
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
[data-type='context-menu-wash'] {
|
|
1531
|
-
position: absolute;
|
|
1532
|
-
inset: 0;
|
|
1533
|
-
z-index: 3;
|
|
1534
|
-
background-color: transparent;
|
|
1535
|
-
touch-action: none;
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
[data-type='context-menu-anchor'] {
|
|
1539
|
-
position: absolute;
|
|
1540
|
-
top: 0;
|
|
1541
|
-
right: var(--trees-context-menu-trigger-inline-offset);
|
|
1542
|
-
z-index: 4;
|
|
1543
|
-
display: none;
|
|
1544
|
-
align-items: center;
|
|
1545
|
-
|
|
1546
|
-
&[data-visible='true'] {
|
|
1547
|
-
display: flex;
|
|
1548
|
-
}
|
|
1549
|
-
}
|
|
1550
|
-
|
|
1551
|
-
/* Hide the floating trigger while the scroll container is actively moving.
|
|
1552
|
-
* The anchor is positioned against the root, not the scroll content, so its
|
|
1553
|
-
* \`top\` follows the row via a React state update — one frame behind the
|
|
1554
|
-
* compositor. That delay is visible as the trigger hovering over the wrong
|
|
1555
|
-
* row during the first frame of a scroll. The \`data-is-scrolling\` flag on
|
|
1556
|
-
* the root is flipped synchronously on \`wheel\`/\`touchmove\`/\`keydown\` before
|
|
1557
|
-
* the compositor commits the next paint, so this selector hides the anchor
|
|
1558
|
-
* in the same frame the scroll begins. */
|
|
1559
|
-
[data-file-tree-virtualized-root='true'][data-is-scrolling]
|
|
1560
|
-
[data-type='context-menu-anchor'] {
|
|
1561
|
-
display: none;
|
|
1562
|
-
}
|
|
1563
|
-
|
|
1564
|
-
[data-type='context-menu-anchor'] > slot[name='context-menu'] {
|
|
1565
|
-
display: block;
|
|
1566
|
-
width: 0;
|
|
1567
|
-
min-width: 0;
|
|
1568
|
-
flex: 0 0 0;
|
|
1569
|
-
overflow: visible;
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
/* Single floating context menu trigger */
|
|
1573
|
-
[data-type='context-menu-trigger'] {
|
|
1574
|
-
all: unset;
|
|
1575
|
-
align-items: center;
|
|
1576
|
-
justify-content: center;
|
|
1577
|
-
width: var(--trees-action-lane-width);
|
|
1578
|
-
color: var(--trees-fg-muted);
|
|
1579
|
-
fill: currentColor;
|
|
1580
|
-
cursor: pointer;
|
|
1581
|
-
font-family: var(--trees-font-family);
|
|
1582
|
-
font-size: var(--trees-font-size);
|
|
1583
|
-
border-top-right-radius: var(--trees-border-radius);
|
|
1584
|
-
border-bottom-right-radius: var(--trees-border-radius);
|
|
1585
|
-
margin: var(--trees-focus-ring-width);
|
|
1586
|
-
height: calc(var(--trees-row-height) - var(--trees-focus-ring-width) * 2);
|
|
1587
|
-
border-width: 0;
|
|
1588
|
-
transition: color 120ms ease;
|
|
1589
|
-
|
|
1590
|
-
display: flex;
|
|
1591
|
-
}
|
|
1592
|
-
|
|
1593
|
-
[data-type='context-menu-trigger']:hover,
|
|
1594
|
-
[data-type='context-menu-trigger'][aria-expanded='true'] {
|
|
1595
|
-
color: var(--trees-fg);
|
|
1596
|
-
}
|
|
1597
|
-
|
|
1598
|
-
/** @pierre/truncate css here, manually copy pasted for now */
|
|
1599
|
-
[data-truncate-container] {
|
|
1600
|
-
/* CUSTOM TO TREES, TO SUPPORT THE OUTLINE */
|
|
1601
|
-
margin-top: -1px;
|
|
1602
|
-
margin-bottom: -1px;
|
|
1603
|
-
|
|
1604
|
-
/* Width of the fade from default marker to text */
|
|
1605
|
-
--truncate-internal-marker-fade-width: var(
|
|
1606
|
-
--truncate-marker-fade-width,
|
|
1607
|
-
2px
|
|
1608
|
-
);
|
|
1609
|
-
/* Width of the solid color between the fade from the default marker to the text */
|
|
1610
|
-
--truncate-internal-marker-gap: var(--truncate-marker-gap, 0px);
|
|
1611
|
-
/* Opacity of the marker 'color' property, not of the element itself */
|
|
1612
|
-
--truncate-internal-marker-opacity: var(--truncate-marker-opacity, 50%);
|
|
1613
|
-
/* Opacity of the marker 'color' property specifically for the middle truncate, not opacity of the element itself */
|
|
1614
|
-
--truncate-internal-middle-marker-opacity: var(
|
|
1615
|
-
--truncate-middle-marker-opacity,
|
|
1616
|
-
80%
|
|
1617
|
-
);
|
|
1618
|
-
/* Background color of the default marker */
|
|
1619
|
-
--truncate-internal-marker-background-color: var(
|
|
1620
|
-
--truncate-marker-background-color,
|
|
1621
|
-
light-dark(white, black)
|
|
1622
|
-
);
|
|
1623
|
-
--truncate-internal-marker-background-overlay-color: var(
|
|
1624
|
-
--truncate-marker-background-overlay-color,
|
|
1625
|
-
transparent
|
|
1626
|
-
);
|
|
1627
|
-
--truncate-internal-marker-block-inset: var(
|
|
1628
|
-
--truncate-marker-block-inset,
|
|
1629
|
-
0px
|
|
1630
|
-
);
|
|
1631
|
-
/* Duration of the fade out animation for the marker */
|
|
1632
|
-
--truncate-internal-marker-fade-out-duration: var(
|
|
1633
|
-
--truncate-marker-fade-out-duration,
|
|
1634
|
-
0ms
|
|
1635
|
-
);
|
|
1636
|
-
/* Duration of the fade in animation for the marker */
|
|
1637
|
-
--truncate-internal-marker-fade-in-duration: var(
|
|
1638
|
-
--truncate-marker-fade-in-duration,
|
|
1639
|
-
100ms
|
|
1640
|
-
);
|
|
1641
|
-
|
|
1642
|
-
/* FADE Variant specifics */
|
|
1643
|
-
--truncate-internal-fade-marker-color: var(
|
|
1644
|
-
--truncate-fade-marker-color,
|
|
1645
|
-
#000
|
|
1646
|
-
);
|
|
1647
|
-
--truncate-internal-fade-marker-width: var(
|
|
1648
|
-
--truncate-fade-marker-width,
|
|
1649
|
-
0.2lh
|
|
1650
|
-
);
|
|
1651
|
-
|
|
1652
|
-
/*
|
|
1653
|
-
In some special cases people might be adding spacing in other ways
|
|
1654
|
-
that would benefit from being able to override this, however the container
|
|
1655
|
-
query below can't use this and would need to be redeclared with the overridden
|
|
1656
|
-
value. It's a bad time, but better than nothing.
|
|
1657
|
-
*/
|
|
1658
|
-
--truncate-internal-single-line-height: 1lh;
|
|
1659
|
-
|
|
1660
|
-
height: var(--truncate-internal-single-line-height);
|
|
1661
|
-
min-width: 0;
|
|
1662
|
-
overflow: hidden;
|
|
1663
|
-
}
|
|
1664
|
-
|
|
1665
|
-
[data-truncate-marker] {
|
|
1666
|
-
display: flex;
|
|
1667
|
-
position: absolute;
|
|
1668
|
-
height: var(--truncate-internal-single-line-height);
|
|
1669
|
-
padding-block: var(--truncate-internal-marker-block-inset);
|
|
1670
|
-
box-sizing: border-box;
|
|
1671
|
-
align-items: center;
|
|
1672
|
-
background-clip: content-box;
|
|
1673
|
-
z-index: 2;
|
|
1674
|
-
color: color-mix(
|
|
1675
|
-
in srgb,
|
|
1676
|
-
currentColor var(--truncate-internal-marker-opacity),
|
|
1677
|
-
transparent
|
|
1678
|
-
);
|
|
1679
|
-
|
|
1680
|
-
/* Core trick for hiding the marker until overflow occurs */
|
|
1681
|
-
opacity: 0;
|
|
1682
|
-
transition: opacity var(--truncate-internal-marker-fade-out-duration)
|
|
1683
|
-
ease-in-out;
|
|
1684
|
-
}
|
|
1685
|
-
|
|
1686
|
-
@container measure (height > 1lh) {
|
|
1687
|
-
[data-truncate-marker] {
|
|
1688
|
-
opacity: 1;
|
|
1689
|
-
transition: opacity var(--truncate-internal-marker-fade-in-duration)
|
|
1690
|
-
ease-in-out;
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
|
|
1694
|
-
[data-truncate-grid] {
|
|
1695
|
-
display: grid;
|
|
1696
|
-
position: relative;
|
|
1697
|
-
}
|
|
1698
|
-
|
|
1699
|
-
[data-truncate-content='visible'] {
|
|
1700
|
-
white-space: nowrap;
|
|
1701
|
-
}
|
|
1702
|
-
|
|
1703
|
-
[data-truncate-content='overflow'] {
|
|
1704
|
-
opacity: 0;
|
|
1705
|
-
pointer-events: none;
|
|
1706
|
-
-webkit-user-select: none;
|
|
1707
|
-
user-select: none;
|
|
1708
|
-
word-break: break-all;
|
|
1709
|
-
margin-top: calc(-1 * var(--truncate-internal-single-line-height));
|
|
1710
|
-
}
|
|
1711
|
-
|
|
1712
|
-
[data-truncate-marker-cell] {
|
|
1713
|
-
container: measure / size;
|
|
1714
|
-
overflow: visible;
|
|
1715
|
-
-webkit-user-select: none;
|
|
1716
|
-
user-select: none;
|
|
1717
|
-
pointer-events: none;
|
|
1718
|
-
}
|
|
1719
|
-
|
|
1720
|
-
[data-truncate-container='truncate'] {
|
|
1721
|
-
& [data-truncate-grid] {
|
|
1722
|
-
grid-template-columns: minmax(0, max-content) 0;
|
|
1723
|
-
}
|
|
1724
|
-
& [data-truncate-marker] {
|
|
1725
|
-
right: 0;
|
|
1726
|
-
}
|
|
1727
|
-
& [data-truncate-fade] {
|
|
1728
|
-
margin-right: calc(-2 * var(--truncate-internal-fade-marker-width));
|
|
1729
|
-
}
|
|
1730
|
-
}
|
|
1731
|
-
|
|
1732
|
-
[data-truncate-container='fruncate'] {
|
|
1733
|
-
& [data-truncate-grid] {
|
|
1734
|
-
grid-template-columns: 0 minmax(0, max-content) auto;
|
|
1735
|
-
}
|
|
1736
|
-
& [data-truncate-content] {
|
|
1737
|
-
direction: rtl;
|
|
1738
|
-
}
|
|
1739
|
-
& [data-truncate-content] > span {
|
|
1740
|
-
unicode-bidi: plaintext;
|
|
1741
|
-
}
|
|
1742
|
-
& [data-truncate-fade] {
|
|
1743
|
-
margin-left: calc(-2 * var(--truncate-internal-fade-marker-width));
|
|
1744
|
-
}
|
|
1745
|
-
}
|
|
1746
|
-
|
|
1747
|
-
[data-truncate-variant='default'] {
|
|
1748
|
-
& [data-truncate-marker] {
|
|
1749
|
-
background-color: var(--truncate-internal-marker-background-color);
|
|
1750
|
-
background-image: linear-gradient(
|
|
1751
|
-
var(--truncate-internal-marker-background-overlay-color),
|
|
1752
|
-
var(--truncate-internal-marker-background-overlay-color)
|
|
1753
|
-
);
|
|
1754
|
-
}
|
|
1755
|
-
& [data-truncate-marker]::after,
|
|
1756
|
-
& [data-truncate-marker]::before {
|
|
1757
|
-
content: '';
|
|
1758
|
-
position: absolute;
|
|
1759
|
-
width: calc(
|
|
1760
|
-
var(--truncate-internal-marker-fade-width) +
|
|
1761
|
-
var(--truncate-internal-marker-gap)
|
|
1762
|
-
);
|
|
1763
|
-
inset-block-start: var(--truncate-internal-marker-block-inset);
|
|
1764
|
-
height: max(
|
|
1765
|
-
0px,
|
|
1766
|
-
calc(
|
|
1767
|
-
var(--truncate-internal-single-line-height) -
|
|
1768
|
-
var(--truncate-internal-marker-block-inset) * 2
|
|
1769
|
-
)
|
|
1770
|
-
);
|
|
1771
|
-
background-color: var(--truncate-internal-marker-background-color);
|
|
1772
|
-
background-image: linear-gradient(
|
|
1773
|
-
var(--truncate-internal-marker-background-overlay-color),
|
|
1774
|
-
var(--truncate-internal-marker-background-overlay-color)
|
|
1775
|
-
);
|
|
1776
|
-
mask-image: linear-gradient(
|
|
1777
|
-
var(--truncate-internal-fade-dir),
|
|
1778
|
-
#000 0%,
|
|
1779
|
-
#000 var(--truncate-internal-marker-gap),
|
|
1780
|
-
transparent 100%
|
|
1781
|
-
);
|
|
1782
|
-
}
|
|
1783
|
-
& [data-truncate-marker]::after {
|
|
1784
|
-
--truncate-internal-fade-dir: to right;
|
|
1785
|
-
right: calc(
|
|
1786
|
-
-1 *
|
|
1787
|
-
(
|
|
1788
|
-
var(--truncate-internal-marker-fade-width) +
|
|
1789
|
-
var(--truncate-internal-marker-gap)
|
|
1790
|
-
)
|
|
1791
|
-
);
|
|
1792
|
-
}
|
|
1793
|
-
& [data-truncate-marker]::before {
|
|
1794
|
-
--truncate-internal-fade-dir: to left;
|
|
1795
|
-
left: calc(
|
|
1796
|
-
-1 *
|
|
1797
|
-
(
|
|
1798
|
-
var(--truncate-internal-marker-fade-width) +
|
|
1799
|
-
var(--truncate-internal-marker-gap)
|
|
1800
|
-
)
|
|
1801
|
-
);
|
|
1802
|
-
}
|
|
1803
|
-
}
|
|
1804
|
-
|
|
1805
|
-
[data-truncate-variant='fade'] {
|
|
1806
|
-
& [data-truncate-marker] {
|
|
1807
|
-
background: transparent;
|
|
1808
|
-
}
|
|
1809
|
-
}
|
|
1810
|
-
|
|
1811
|
-
[data-truncate-fade] {
|
|
1812
|
-
box-shadow:
|
|
1813
|
-
0 0 calc(var(--truncate-internal-fade-marker-width) / 2)
|
|
1814
|
-
var(--truncate-internal-fade-marker-color),
|
|
1815
|
-
0 0 var(--truncate-internal-fade-marker-width)
|
|
1816
|
-
var(--truncate-internal-fade-marker-color);
|
|
1817
|
-
width: calc(var(--truncate-internal-fade-marker-width) * 2);
|
|
1818
|
-
height: calc(
|
|
1819
|
-
var(--truncate-internal-single-line-height) -
|
|
1820
|
-
(var(--truncate-internal-fade-marker-width) * 2)
|
|
1821
|
-
);
|
|
1822
|
-
margin: var(--truncate-internal-fade-marker-width) 0;
|
|
1823
|
-
}
|
|
1824
|
-
|
|
1825
|
-
[data-truncate-group-container='middle'] {
|
|
1826
|
-
& [data-truncate-container] {
|
|
1827
|
-
--truncate-marker-opacity: var(--truncate-internal-middle-marker-opacity);
|
|
1828
|
-
}
|
|
1829
|
-
|
|
1830
|
-
display: flex;
|
|
1831
|
-
min-width: 0;
|
|
1832
|
-
|
|
1833
|
-
& > div {
|
|
1834
|
-
min-width: 0;
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
& > div[data-truncate-segment-priority='1'] {
|
|
1838
|
-
flex: 0 1 max-content;
|
|
1839
|
-
}
|
|
1840
|
-
& > div[data-truncate-segment-priority='2'] {
|
|
1841
|
-
flex: 0 999999 max-content;
|
|
1842
|
-
}
|
|
1843
|
-
}
|
|
1844
|
-
}
|
|
1845
|
-
`,iH=`@layer base, unsafe;`;function aH(e){return`${iH}
|
|
1846
|
-
@layer base {
|
|
1847
|
-
${e}
|
|
1848
|
-
}`}function oH(e){return`${iH}
|
|
1849
|
-
@layer unsafe {
|
|
1850
|
-
${e}
|
|
1851
|
-
}`}var sH=new WeakMap;function cH(e){let t=sH.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(tR,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),sH.set(e,i),i}function lH(e,t){if(!e.isConnected)return;let n=cH(t);if(n==null)return;let r=t.querySelector(`style[${nR}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(nR,``),t.appendChild(i)),i.textContent=`:host { ${rR}: ${n}px; }`}var uH;function dH(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){uH??(uH=new CSSStyleSheet,uH.replaceSync(aH(rH)));let t=!1;try{e.adoptedStyleSheets=[uH],t=!0}catch{}if(t){e.querySelector(`style[${$L}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute($L,``),t.textContent=aH(rH),e.prepend(t)}}function fH(e,t){pH(e,t),dH(t),lH(e,t)}function pH(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});fH(this,e)}}if(customElements.define(QL,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(QL)))e instanceof HTMLElement&&fH(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var mH=e=>e.startsWith(`f::`)?e.slice(3):e;function hH(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function gH(e,t){return e===``?t:`${e}/${t}`}function _H({files:e,path:t,isFolder:n,nextBasename:r}){let i=mH(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=hH(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=gH(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function vH(e){return e.endsWith(`/`)}function yH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function bH(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function xH(e,t){return t.includes(e)?bH(t):[e]}function SH(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function CH(e,t){return{draggedPaths:e,target:t}}function wH(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(vH(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function TH(e,t){return t.kind===`root`||t.directoryPath==null?yH(e):t.directoryPath}function EH(e,t){let n=e.map(e=>{let n=TH(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}var DH=Symbol(`FILE_TREE_RENAME_VIEW`);function OH(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}var kH=512,AH=512;function jH(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function MH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function NH(e){return MH(e).at(-1)??null}function PH(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}var FH=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},IH=e=>e.toLowerCase();function LH(e){return e.endsWith(`/`)}function RH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function zH(e){return e.endsWith(`/`)?e.slice(0,-1):e}function BH(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}function VH(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function HH(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function UH(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return HH(e,t.path)?n?e:null:e;case`move`:return VH(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=UH(r,e,n),r==null)return null;return r}}}function WH(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function GH(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function KH(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!GH(QV.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function qH(e){switch(e.operation){case`add`:return{...WH(e),operation:`add`,path:e.path};case`remove`:return{...WH(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...WH(e),from:e.from,operation:`move`,to:e.to}}}function JH(e){return{...WH(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>qH(e)),operation:`batch`}}function YH(e){switch(e.operation){case`add`:case`remove`:case`move`:return qH(e);case`batch`:return JH(e);default:return null}}function XH(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=MH(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function ZH(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:XH(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var QH=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=new Set;#z=0;#B;#V=0;#H=!1;#U=0;#W;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=KH({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#B=this.#se(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ae(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#R=new Set(d),this.#L=f,this.#z=1),this.#Oe(f,!1),r!=null&&this.#Se(r,!1),this.#W=this.#Fe()}destroy(){this.#W?.(),this.#W=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#pe()}focusFirstItem(){this.#ve().length>0&&this.#Me(0)}focusLastItem(){this.#U<=0||(this.#Ne(),this.#Me(this.#U-1))}focusNextItem(){this.#De(1)}focusParentItem(){if(this.#c==null)return;let e=NH(this.#c);if(e==null)return;let t=this.#Y(e);t>=0&&this.#Me(t)}focusPath(e){let t=this.#B.getPathInfo(e)?.path??null;if(t==null)return;this.#Ne();let n=this.#Y(t);n>=0&&this.#Me(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Y(t);return n>=0?(this.#Me(n),this.#ve()[n]??t):null}focusPreviousItem(){this.#De(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#X(this.#c)}getFocusedPath(){return this.#c}resolveNearestVisiblePath(e){let t=this.#ve();if(this.#U===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#B.getPathInfo(e)?.path??e,r=this.#Y(n);return r>=0?t[r]??n:this.#J(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#R]}getSelectionVersion(){return this.#z}getVisibleCount(){return this.#U}getVisibleRows(e,t){if(t<e||this.#U===0)return[];let n=Math.max(0,e),r=Math.min(this.#U-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=AH){let e=[];for(let t=n;t<=r;t+=1){let n=this.#B.getVisibleRowContext(t);if(n==null)break;e.push(this.#Q(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ne(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#ye(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#B.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#ye(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#Z(o,i,a,{ancestorPaths:this.#te(a),path:s})})}return this.#B.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#Z(e,r,r,{ancestorPaths:this.#te(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#U===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#U;r+=1){let i=e+r*t,a=Math.min(this.#U-1,Math.floor(i/t)),o=this.#$(a,r)??(a>0?this.#$(a-1,r):void 0);if(o==null)break;n.push({row:this.#Q(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#B.getPathInfo(e);return t==null?null:this.#X(t.path,t)}selectAllVisiblePaths(){this.#Ne();let e=[...this.#ve()];this.#re(e,this.#c??this.#L)}selectOnlyPath(e){let t=this.#Ae(e);t!=null&&this.#re([t],t)}selectPath(e){let t=this.#Ae(e);t==null||this.#R.has(t)||this.#re([...this.#R,t])}deselectPath(e){let t=this.#Ae(e);t==null||!this.#R.has(t)||this.#re([...this.#R].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ae(e);if(t!=null){if(this.#R.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ae(e);if(t!=null){if(this.#R.has(t)){this.#re([...this.#R].filter(e=>e!==t),t);return}this.#re([...this.#R,t],t)}}selectPathRange(e,t){let n=this.#Ae(e);if(n==null)return;this.#Ne();let r=this.#L,i=r==null?-1:this.#be(r),a=this.#be(n);if(i===-1||a===-1){let e=t?[...this.#R,n]:[n];this.#re(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#ve().slice(o,s+1),l=t?[...this.#R,...c]:c;this.#re(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#U-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ne();let r=this.#ve(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#R);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#re([...o],this.#L??i,!1),this.#Me(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ae(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=xH(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#re([t],t,!1),this.#je(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#we(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=CH(t.draggedPaths,n);(wH(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}SH(t.target,n)||(this.#i={...t,target:n},this.#we())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#we())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#we(),!1;let n=CH(e.draggedPaths,t);if(wH(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#we(),!1;let r=EH(e.draggedPaths,t);if(r==null)return this.#we(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#B.move(e.from,e.to,{collision:e.collision})}else this.#oe(r.operations),this.#B.batch(r.operations)}catch(e){return this.#we(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#B.add(e)}remove(e,t={}){this.#B.remove(e,t)}move(e,t,n={}){this.#B.move(e,t,n)}batch(e){this.#B.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Se(e,!0)}openSearch(e=``){this.#Se(e,!0)}closeSearch(){this.#Se(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#xe(1)}focusPreviousSearchMatch(){this.#xe(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#B.getPathInfo(e);if(n==null)return!1;let r=n.path,i=LH(r),a=zH(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of MH(r))this.#B.isExpanded(e)||this.#B.expand(e);return this.#re([r],r,!1),this.#M!=null&&(this.#Se(null,!1),this.#y?.(this.#M)),this.#je(r),this.#T=r,this.#E=RH(r),this.#D=t.removeIfCanceled??!1,this.#we(),!0}[DH](){return{cancel:()=>{this.#G()},commit:()=>{this.#K()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#q(e)}}}#G(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,LH(e)?{recursive:!0}:void 0);return}this.#je(e),this.#we()}#K(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,LH(e)?{recursive:!0}:void 0);return}let t=LH(e),n=_H({files:this.#B.list(),isFolder:t,nextBasename:this.#E,path:zH(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#je(e),this.#v?.(n.error),this.#we();return}if(n.sourcePath===n.destinationPath){this.#je(e),this.#we();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(BH(n.sourcePath,t),BH(n.destinationPath,t))}#q(e){this.#T==null||this.#E===e||(this.#E=e,this.#we())}resetPaths(e,t={}){let n=this.#B.list().length,r=this.#U,i=KH({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#se(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#L;this.#W?.(),this.#B=a,this.#d.clear(),this.#pe();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!jH(this.#R,u);this.#R=new Set(u),d&&(this.#z+=1),this.#L=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#Oe(o,o!=null||u.length>0||this.#L!=null),this.#W=this.#Fe(),this.#we(),this.#Te({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#U-r})}#J(e){this.#Ne();let t=NH(e),n=PH(e,t),r=null,i=null;for(let e of this.#ve()){if(NH(e)!==t)continue;let a=PH(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Y(e){let t=this.#be(e);if(t!==-1)return t;let n=MH(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#be(t);if(r!==-1)return r}return this.#ve().length>0?0:-1}#X(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#B.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#ie(r.path):this.#ae(r.path);return this.#d.set(r.path,i),i}#Z(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#R.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#Q(e){return this.#Z(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#$(e,t){let n=this.#B.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ee(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ee(n),n];return this.#a.set(e,r),r}#te(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ee(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ne(e){this.#B.collapse(e)}#re(e,t=this.#L,n=!0){let r=[...new Set(e)],i=!jH(this.#R,r),a=this.#L!==t;!i&&!a||(this.#R=new Set(r),this.#L=t,i&&(this.#z+=1),n&&this.#we())}#ie(e){return{collapse:()=>{this.#ne(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#Ee(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#B.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#R.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#Ie(e)}}}#ae(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#R.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#oe(e){let t=this.#B.list();this.#se(t).batch(e)}#se(e,t,n){return new QV({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ce(){return this.#h??=this.#B.list(),this.#h}#le(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ce()){e.add(t);for(let n of MH(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#ue(){return this.#g??=this.#ce().map(IH),this.#g}#de(){return this.#f??=this.#le().filter(e=>e.endsWith(`/`)),this.#f}#fe(){return this.#p??=this.#de().map(IH),this.#p}#pe(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#me(){return this.#de().filter(e=>this.#B.isExpanded(e))}#he(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#R)for(let n of MH(e))t.add(n);this.#ge(t)}#ge(e){this.#H=!0;try{for(let t of this.#de()){let n=e.has(t),r=this.#B.isExpanded(t);n&&!r?this.#B.expand(t):!n&&r&&this.#B.collapse(t)}}finally{this.#H=!1}}#_e(){let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#M==null||this.#M.length===0||this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#U=this.#V;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#U=n.length}#ve(){return this.#I??this.#b}#ye(e){return this.#F?.[e]??e}#be(e){return this.#P?.get(e)??this.#B.getVisibleIndex(e)??-1}#xe(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Se(e,t){let n=e==null?null:FH(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#me()),this.#M=n,n==null)this.#he(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#Oe(this.#c,!0);else if(n.length===0)this.#he(!1),this.#O.clear(),this.#N=null,this.#Oe(this.#c,!0);else{let e=this.#Ce();this.#Oe(e,!0)}t&&(this.#y?.(this.#M),this.#we())}}#Ce(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ce(),n=this.#ue(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#de(),s=this.#fe();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of MH(e))l.add(t),c?.add(t)}return this.#ge(l),a??this.#c}#we(){for(let e of this.#t)e()}#Te(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#Ee(e){for(let t of MH(e))this.#B.isExpanded(t)||this.#B.expand(t);this.#B.isExpanded(e)||this.#B.expand(e)}#De(e){let t=this.#U;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ne(),this.#Me(r))}#Oe(e,t=!0){let n=this.#B.getVisibleCount();this.#V=n;let r=ZH(this.#B.getVisibleTreeProjectionData(t?void 0:Math.min(n,kH)),e,t?e=>this.#B.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#_e(),this.#s=e==null?this.#ve().length>0?0:-1:this.#Y(e),this.#c=this.#s<0?null:this.#ke(this.#s)}#ke(e){return this.#ve()[e]??(this.#F==null?this.#B.getVisibleRowContext(e)?.row.path??null:null)}#Ae(e){return this.#B.getPathInfo(e)?.path??null}#je(e){if(e==null)return;let t=this.#Y(e);t>=0&&this.#Me(t,!1)}#Me(e,t=!0){let n=this.#ke(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#we()))}#Ne(){this.#l||this.#Oe(this.#c,!0)}#Pe(e){let t=UH(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=UH(this.#c,e,!0),r=[...this.#R].map(t=>UH(t,e)).filter(e=>e!=null).map(e=>this.#B.getPathInfo(e)?.path??null).filter(e=>e!=null),i=UH(this.#L,e),a=i==null?null:this.#B.getPathInfo(i)?.path??null,o=[...new Set(r)];return jH(this.#R,o)||(this.#R=new Set(o),this.#z+=1),this.#L=a,n}#Fe(){return this.#B.on(`*`,e=>{if(this.#H)return;e.canonicalChanged&&(this.#d.clear(),this.#pe()),this.#i!=null&&OH(e)&&(this.#i=null);let t=OH(e)?this.#Pe(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ce():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#Oe(n,r),this.#we();let i=YH(e);i!=null&&this.#Te(i)})}#Ie(e){if(this.#B.isExpanded(e)){this.#ne(e);return}this.#Ee(e)}},$H=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function eU(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function tU(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function nU(e,t){return t?`${e}/`:e}function rU(e,t=null){let n=$H(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=eU(t.path);if(e==null)continue;let n=nU(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of tU(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var iU,aU,oU,sU,cU,lU,uU,dU,fU,pU,mU={},hU=[],gU=Array.isArray,_U=hU.slice,vU=Object.assign;function yU(e){e&&e.parentNode&&e.remove()}function bU(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?_U.call(arguments,2):n),xU(e,o,r,i,null)}function xU(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++aU,__i:-1,__u:0};return i==null&&iU.vnode!=null&&iU.vnode(a),a}function SU(e){return e.children}function CU(e,t){this.props=e,this.context=t,this.__g=0}function wU(e,t){if(t==null)return e.__?wU(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?wU(e):null}function TU(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return TU(e)}}function EU(e){(8&e.__g||!(e.__g|=8)||!oU.push(e)||cU++)&&sU==iU.debounceRendering||((sU=iU.debounceRendering)||queueMicrotask)(DU)}function DU(){for(var e,t,n,r,i,a,o,s,c=1;oU.length;)oU.length>c&&oU.sort(lU),e=oU.shift(),c=oU.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=vU({},r)).__v=r.__v+1,iU.vnode&&iU.vnode(n),FU(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??wU(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,LU(a,n,o),n.__e!=i&&TU(n)));cU=0}function OU(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||hU,b=t.length;for(c=kU(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?mU:y[m.__i]||mU,m.__i=f,_=FU(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&BU(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=AU(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function kU(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?xU(null,o,null,null,null):gU(o)?xU(SU,{children:o},null,null,null):o.constructor==null&&o.__b>0?xU(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=jU(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=wU(s)),VU(s,s));return r}function AU(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=AU(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=wU(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function jU(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function MU(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function NU(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||MU(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||MU(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(uU,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=dU,e.addEventListener(t,a?pU:fU,a)):e.removeEventListener(t,a?pU:fU,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function PU(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=dU++;else if(t.u<n.l)return;return n(iU.event?iU.event(t):t)}}}function FU(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=iU.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new CU(v,x),f.constructor=M,f.render=HU),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=vU({},f.__s)),vU(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=iU.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=vU({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===SU&&d.key==null&&(E=RU(d.props.children)),s=OU(e,gU(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)yU(a[j]);IU(t)}else t.__e=n.__e,t.__k=n.__k,e.then||IU(t);iU.__e(e,t,n)}else s=t.__e=zU(n.__e,t,n,r,i,a,o,c,l,u);return(d=iU.diffed)&&d(t),128&t.__u?void 0:s}function IU(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(IU)}function LU(e,t,n){for(var r=0;r<n.length;r++)BU(n[r],n[++r],n[++r]);iU.__c&&iU.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){iU.__e(e,t.__v)}})}function RU(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:gU(e)?e.map(RU):vU({},e)}function zU(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(iU.__m&&iU.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=_U.call(e.childNodes),v=n.props||mU,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;NU(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||NU(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),OU(b==`template`?e.content:e,gU(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&wU(n,0),s,c,l),a!=null)for(u=a.length;u--;)yU(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||NU(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&NU(e,u,g,v[u],i))}return e}function BU(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){iU.__e(e,n)}}function VU(e,t,n){var r,i;if(iU.unmount&&iU.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||BU(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){iU.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&VU(r[i],t,n||typeof e.type!=`function`);n||yU(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function HU(e,t,n){return this.constructor(e,n)}function UU(e,t){var n,r,i,a;t==document&&(t=document.documentElement),iU.__&&iU.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=bU(SU,null,[e]),i=[],a=[],FU(t,e,r||mU,mU,t.namespaceURI,r?null:t.firstChild?_U.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),LU(i,e,a)}function WU(e,t){e.__u|=32,UU(e,t)}iU={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw cU=0,e}},aU=0,CU.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=vU({},this.state);typeof e==`function`&&(e=e(vU({},n),this.props)),e&&vU(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),EU(this))},CU.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),EU(this))},CU.prototype.render=SU,oU=[],cU=0,lU=function(e,t){return e.__v.__b-t.__v.__b},uU=/(PointerCapture)$|Capture$/i,dU=0,fU=PU(!1),pU=PU(!0);var GU=0;Array.isArray;function KU(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--GU,__i:-1,__u:0,__source:i,__self:a};return iU.vnode&&iU.vnode(l),l}var qU=16,JU=16,YU={};function XU({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=YU[e]??{width:qU,height:JU},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return KU(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:KU(`use`,{href:c})})}var ZU=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},QU=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},$U=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},eW=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},tW=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},nW=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function rW({children:e,marker:t,variant:n=`default`}){"use no memo";return KU(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:KU(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?KU(`span`,{"data-truncate-fade":!0}):t})})}function iW(e){"use no memo";let{mode:t,children:n}=e;return KU(`div`,{children:[KU(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?KU(`span`,{children:n}):n}),KU(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?KU(`span`,{children:n}):n})]})}function aW({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=KU(iW,{mode:t,children:e},`content`),o=KU(rW,{marker:n,mode:t,variant:r},`marker`),s=KU(`div`,{"data-truncate-fill":!0},`fill`);return KU(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:KU(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function oW({children:e,...t}){"use no memo";return KU(aW,{mode:`truncate`,...t,children:e})}function sW({children:e,...t}){"use no memo";return KU(aW,{mode:`fruncate`,...t,children:e})}function cW({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=KU(oW,{...s,children:t[0]}),l=KU(sW,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return KU(`div`,{className:a,style:o});if(e.length<i)return KU(n===`end`?sW:oW,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=ZU:r===`extension`?t=QU:r===`leaf-path`&&(t=$U);else if(typeof r==`number`)t=eW,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=tW:e===`first`&&(t=nW)}else typeof r==`function`&&(t=r);t??=ZU;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=KU(oW,{...s,..._,children:f}),l=KU(sW,{...s,...v,children:p})}return KU(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[KU(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),KU(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var lW={endIndex:-1,startIndex:-1};function uW(e,t,n){return Math.min(Math.max(e,t),n)}function dW(e,t){return e<0||t<e?lW:{endIndex:t,startIndex:e}}function fW(e){return e.startIndex<0||e.endIndex<e.startIndex}function pW(e,t){return fW(e)?0:(e.endIndex-e.startIndex+1)*t}function mW(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function hW(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function gW(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function _W(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function vW(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function yW(e,t,n){if(e.length===0||t<=0)return[];let r=vW(e),i=gW(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=_W(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function bW(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=uW(t.scrollTop,0,o),c=t.stickyRows??yW(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=mW(s,n,t.itemHeight),m=mW(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?lW:dW(m,hW(u+d,n,t.itemHeight)),y=g+1,b=fW(v)?lW:dW(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=pW(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:fW(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var xW={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},SW={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},CW=`Contains git status items`;function wW(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function TW(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function EW(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}function DW(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function OW(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}var kW,AW,jW,MW,NW=Object.is,PW=0,FW=[],IW=iU,LW=IW.__b,RW=IW.__r,zW=IW.diffed,BW=IW.__c,VW=IW.unmount,HW=IW.__;function UW(e,t){IW.__h&&IW.__h(AW,e,PW||t),PW=0;var n=AW.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function WW(e){return PW=1,GW(rG,e)}function GW(e,t,n){var r=UW(kW++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):rG(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);NW(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=AW,!AW.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,NW(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};AW.__f=!0;var a=AW.shouldComponentUpdate,o=AW.componentWillUpdate;AW.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},AW.shouldComponentUpdate=i}return r.__N||r.__}function KW(e,t){var n=UW(kW++,3);!IW.__s&&nG(n.__H,t)&&(n.__=e,n.u=t,AW.__H.__h.push(n))}function qW(e,t){var n=UW(kW++,4);!IW.__s&&nG(n.__H,t)&&(n.__=e,n.u=t,AW.__h.push(n))}function JW(e){return PW=5,YW(function(){return{current:e}},[])}function YW(e,t){var n=UW(kW++,7);return nG(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function XW(e,t){return PW=8,YW(function(){return e},t)}function ZW(){for(var e;e=FW.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(eG),e.__H.__h.forEach(tG),e.__H.__h=[]}catch(t){e.__H.__h=[],IW.__e(t,e.__v)}}IW.__b=function(e){AW=null,LW&&LW(e)},IW.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),HW&&HW(e,t)},IW.__r=function(e){RW&&RW(e),kW=0;var t=(AW=e.__c).__H;t&&(jW===AW?(t.__h=[],AW.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(eG),t.__h.forEach(tG),t.__h=[],kW=0)),jW=AW},IW.diffed=function(e){zW&&zW(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(FW.push(t)!==1&&MW===IW.requestAnimationFrame||((MW=IW.requestAnimationFrame)||$W)(ZW)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),jW=AW=null},IW.__c=function(e,t){t.some(function(e){try{e.__h.forEach(eG),e.__h=e.__h.filter(function(e){return!e.__||tG(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],IW.__e(n,e.__v)}}),BW&&BW(e,t)},IW.unmount=function(e){VW&&VW(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{eG(e)}catch(e){t=e}}),n.__H=void 0,t&&IW.__e(t,n.__v))};var QW=typeof requestAnimationFrame==`function`;function $W(e){var t,n=function(){clearTimeout(r),QW&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);QW&&(t=requestAnimationFrame(n))}function eG(e){var t=AW,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),AW=t}function tG(e){var t=AW;e.__c=e.__(),AW=t}function nG(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!NW(t,e[n])})}function rG(e,t){return typeof t==`function`?t(e):t}function iG(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function aG(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function oG({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return KU(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function sG(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:KU(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return KU(SU,{children:[KU(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:KU(oW,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function cG(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function lG(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function uG(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function dG({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=bW(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:uG(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?uG(u,1,t,o):i&&r<=0&&c.length>0?yW(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var fG=400,pG=10,mG=40,hG=18;function gG(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?_G(e,t,n):a instanceof HTMLElement?a:null}function _G(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function vG(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function yG(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function bG(){return navigator.vendor!==`Apple Computer, Inc.`}function xG(e,t){let n=e-t.top;if(n<mG)return-Math.ceil((mG-Math.max(0,n))/mG*hG);let r=t.bottom-e;return r<mG?Math.ceil((mG-Math.max(0,r))/mG*hG):0}function SG(e,t){if(e!=null){let t=xW[e];return t==null?null:{text:t,title:SW[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:CW}:null}function CG(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function wG(e){return e!=null&&`toggle`in e}function TG(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function EG(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function DG(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function OG(e,t){return e!=null&&e>0?e:t}function kG(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function AG(e,t,n,r,i=0){let a=DW({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function jG(e,t,n,r,i,a){let o=OW({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function MG(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function NG(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function PG(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function FG(e,t){return t&&PG(e)||(e.ctrlKey||e.metaKey)&&TG(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var IG=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function LG(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function RG(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function zG(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function BG(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function VG(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function HG(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function UG(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function WG(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function GG(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=WG(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function KG(e,t){return{kind:e.kind,name:lG(e),path:t}}function qG(e){return e==null?void 0:`${e}__tree`}function JG(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function YG(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function XG(e,t){if(e==null)return null;if(`text`in e)return KU(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?YG(e.icon)?t(e.icon):{name:e.icon}:YG(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return KU(`span`,{title:e.title,children:KU(XU,{...n})})}function ZG(e){e!=null&&iG(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function QG(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=cG(e);return KU(SU,{children:[e.depth>0?KU(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>KU(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,KU(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?KU(XU,{...t(`file-tree-icon-chevron`)}):KU(XU,{...t(`file-tree-icon-file`,u)})}),KU(`div`,{"data-item-section":`content`,children:e.isFlattened?sG(e,c,a):c??KU(cW,{minimumLength:5,split:`extension`,children:e.name})}),i?KU(`div`,{"data-item-section":`decoration`,children:r==null?null:XG(r,t)}):null,s?KU(`div`,{"data-item-section":`git`,children:XG(o,t)}):null,n?KU(`div`,{"data-item-section":`action`,children:l?KU(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:KU(XU,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function $G(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=cG(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??CG(t.ancestorPaths,v,y),B=t.kind===`directory`&&(b?.has(P)??!1),V=A(t,P),H=SG(z,B),U=S&&w,W=V!=null||x||U,G=U&&T===`always`,ee=a.getPath()===P,te=ee?a.getValue():``,ne=R||!ee?null:KU(oG,{ref:D,ariaLabel:`Rename ${lG(t)}`,isFlattened:t.isFlattened,value:te,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),re=QG(t,k,{actionLaneEnabled:U,customDecoration:V,decorationLaneEnabled:W,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:H,gitLaneActive:x,renameInput:ne,showDecorativeActionAffordance:G}),ie={...TW({ariaLabel:lG(t),domId:t.isFocused?JG(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:U,contextMenuButtonVisibility:U?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:B,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusPath(P),j(t,P,{anchorRect:zG(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusPath(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&ee?KU(`div`,{...ie,children:re}):KU(`button`,{...ie,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:re})}function eK(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(cG(e))).map((n,r)=>$G(e,n,t.start+r))}function tK({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=nH,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=JW(null),v=JW(null),y=JW(!1),b=JW(null),x=JW(null),S=JW(null),C=JW(null),w=JW(null),T=JW(new Map),E=JW(new Map),D=JW(()=>{}),O=JW(null),k=JW(!1),A=JW(null),j=JW(null),M=JW(!1),N=JW(null),P=JW(null),F=JW(null),I=JW(null),L=JW(null),R=JW(null),z=JW(null),B=JW(null),V=JW(!1),H=JW(null),U=JW(null),W=JW(null),G=JW(null),ee=YW(()=>new Map,[]),[,te]=WW(0),[ne,re]=WW(null),[ie,ae]=WW(null),[oe,se]=WW(null),[ce,le]=WW(null),[ue,K]=WW(0),[q,de]=WW(null),fe=JW(q);fe.current=q;let pe=JW(null),me=JW(null),he=JW(null),ge=JW(null),_e=JW(null),ve=JW(!1),ye=()=>{me.current=null,he.current=null,ge.current=null},be=(e,t)=>{me.current=e,he.current=null,ge.current=t==null?null:{path:e,scrollTop:t}},xe=(e,t)=>{me.current=null,he.current={path:e,viewportOffset:t},ge.current=null},Se=JW(d===`retain`&&t.isSearchOpen()),[Ce,we]=WW(p);KW(()=>{p||we(!1)},[p]);let Te=JW(!1),Ee=XW(()=>{Te.current=!0,we(e=>e&&!1)},[]),[De,Oe]=WW(()=>dG({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[ke,Ae]=WW(!1);KW(()=>{Ae(!0)},[]);let je=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Me=e?.contextMenu?.triggerMode??(je?`right-click`:`both`),Ne=Me===`both`||Me===`button`,Pe=e?.contextMenu?.buttonVisibility??`when-needed`,Fe=Me===`both`||Me===`right-click`;qW(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;_e.current=t,ae(t),le(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(ve.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let Ie=XW((e,t)=>{VG(T.current,e,t)},[]),Le=XW((e,t)=>{VG(E.current,e,t)},[]),Re=XW(e=>{x.current=e},[]),ze=XW(e=>HG(e,E.current,T.current),[]),Be=n!=null||r!=null||i!=null,{resolveIcon:Ve}=YW(()=>pR(a),[a]),He=t[DH](),Ue=He.getPath(),We=Ue!=null,Ge=t.isSearchOpen(),Ke=t.getSearchValue(),qe=t.getFocusedPath(),Je=t.getFocusedIndex(),Ye=t.isDragAndDropEnabled(),Xe=t.getDragSession(),Ze=YW(()=>Xe==null?null:new Set(Xe.draggedPaths),[Xe]),Qe=Xe?.target??null,$e=Xe?.primaryPath??null,et=qG(o),{overlayHeight:tt,overlayRows:nt,snapshot:rt,visibleRows:it}=De,at=rt.physical.viewportHeight,ot=YW(()=>({end:rt.window.endIndex,start:rt.window.startIndex}),[rt.window.endIndex,rt.window.startIndex]),st=nt,ct=rt.sticky.rows,lt=rt.physical.totalHeight,ut=rt.sticky.height,dt=YW(()=>new Set(ct.map(e=>cG(e.row))),[ct]),ft=Je>=0&&Je>=ot.start&&Je<=ot.end,pt=XW((e,t)=>u?.({item:KG(e,t),row:e})??null,[u]),mt=XW(e=>iG(e==null?null:T.current.get(e)??null)?!0:iG(S.current),[]),ht=XW(e=>{mt(t.focusNearestPath(e))},[t,mt]),gt=JW(ht);gt.current=ht;let _t=JW(!0),vt=JW(()=>{}),yt=XW((t=!0)=>{let n=fe.current;n!=null&&(_t.current=_t.current&&t,de(null),e?.contextMenu?.onClose?.(),_t.current&&ht(n.path))},[e?.contextMenu,ht]);vt.current=yt;let bt=XW(e=>{let t=e==null?null:BG(S.current,e);se(e=>e===t?e:t)},[]),xt=XW((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=ze(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;be(n,e?.scrollTop??null),k.current=!0,re(e=>e===n?e:n)}i.focus(),bt(a),_t.current=!0,de({anchorRect:r?.anchorRect??null,item:KG(e,n),path:n,source:r?.source??`keyboard`})},[t,ze,bt]),St=XW(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=DG(e,at);N.current=Je<0||e==null?null:Math.max(0,Math.min(Je*s-e.scrollTop,Math.max(0,t-s))),M.current=!0}t.startRenaming(e)!==!1&&(le(`focus`),te(e=>e+1))}},[t,Je,s,l,at]),Ct=XW((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=DG(i,at),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:dG({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return k.current=!0,jG(i,a,s,l,u,d),D.current(),pe.current=n?e:null,!0},[t,s,c,at,h]),wt=()=>y.current===!0||G.current!=null||V.current===!0,Tt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),Et=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},Dt=()=>{I.current!=null&&(clearTimeout(I.current),I.current=null),F.current=null},Ot=()=>{R.current?.remove(),R.current=null},kt=()=>{Et(P.current),P.current=null,L.current=null},At=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},jt=()=>{B.current?.(),B.current=null,G.current!=null&&(clearTimeout(G.current),G.current=null),V.current=!1,H.current=null,W.current=null,U.current!=null&&(U.current.setAttribute(`draggable`,`true`),U.current.style.removeProperty(`touch-action`),U.current=null),Ot(),Dt(),kt(),z.current=null},J=(e,n)=>{let r=S.current?.getRootNode(),i=vG(gG(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Mt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){Dt();return}let r=t.getItem(e.directoryPath),i=wG(r)?r:null;if(i==null||i.isExpanded()){Dt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;F.current!==a&&(Dt(),F.current=a,I.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},Y=()=>{P.current=null;let e=L.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=xG(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Mt(J(e.clientX,e.clientY)),P.current=Tt(Y)},Nt=(e,t)=>{L.current={clientX:e,clientY:t},P.current??=Tt(Y)},Pt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(jt(),Ot(),Dt(),kt(),t.startDrag(r)===!1){e.preventDefault();return}if(z.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),bG())){let t=yG(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),At(t),R.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Ft=()=>{Ot(),Dt(),kt(),z.current=null,t.cancelDrag()},It=(e,n,r)=>{if(G.current!=null||V.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;W.current={clientX:i.clientX,clientY:i.clientY},U.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!V.current;G.current!=null&&(clearTimeout(G.current),G.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),B.current===o&&(B.current=null),t&&(a.setAttribute(`draggable`,`true`),U.current===a&&(U.current=null),W.current=null)},s=e=>{let t=e.touches[0],n=W.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=pG*pG||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),B.current=o,G.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),U.current===a&&(U.current=null),W.current=null;return}V.current=!0,U.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),z.current=n;let e=a.getBoundingClientRect(),s=yG(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),At(s),R.current=s,H.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=H.current;n!=null&&R.current!=null&&(R.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Mt(J(t.clientX,t.clientY)),Nt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&J(n.clientX,n.clientY),t.completeDrag(),jt()},u=()=>{t.cancelDrag(),jt()};B.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},fG)},Lt=e=>{if(q!=null){if(e.key===`Escape`){yt(),e.preventDefault(),e.stopPropagation();return}IG.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(He.isActive()){if(e.key===`Escape`)He.cancel();else if(e.key===`Enter`)He.commit();else return;le(`focus`),te(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){St(qe??void 0),e.preventDefault(),e.stopPropagation();return}if(Ge){if(e.key===`Escape`)M.current=!1,N.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=DG(n,at);N.current=Je<0||n==null?null:Math.max(0,Math.min(Je*s-n.scrollTop,Math.max(0,r-s))),M.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;le(`focus`),te(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&EG(e)){t.openSearch(e.key),te(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=je&&PG(e),r=FG(e,je),i=r&&S.current!=null?aG(S.current):null,a=r?new Set(UG(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==qe&&a.has(o)){let e=C.current;be(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=wG(p)?p:null,h=u!=null&&(dt.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=HG(u,E.current,T.current);e==null||n==null?y=!1:xt(e,u)}else if((e.ctrlKey||e.metaKey)&&TG(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;le(`focus`);let b=t.getFocusedPath(),x=b!=null&&(dt.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))be(b,v?.scrollTop??null),k.current=!0,re(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(xe(b,GG(S.current,v,i,u,s,ut,at)),k.current=!0,re(e=>e===b?e:b)):ye()}te(e=>e+1),e.preventDefault(),e.stopPropagation()};qW(()=>{if(!(!f||!Ge)){if(Se.current){Se.current=!1;return}iG(w.current)}},[Ge,f]),qW(()=>{let e=x.current;switch(wW({hasRenderedInput:e!=null,previousRenamingPath:j.current,renamingPath:Ue})){case`reset`:j.current=null;return;case`reveal-canonical`:Ue!=null&&Ct(Ue,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(pe.current=null,j.current=Ue,iG(e),e.select());return}},[ot.end,ot.start,Ue,Ct,dt]),qW(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=aG(e)?.dataset.itemPath??null;re(e=>e===t?e:t)},i=()=>{n(),k.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,aG(e)!=null){r();return}k.current=!1,re(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),k.current=!1,re(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;re(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),qW(()=>{let e=S.current;e!=null&&(rt.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[rt.physical.scrollTop]),qW(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=DG(n,g);let a=()=>{let e=t.getVisibleCount(),r=OG(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),Oe(dG({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};D.current=a;let o=!1,l=t.subscribe(()=>{o?te(e=>e+1):o=!0,a()}),u=()=>{ve.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,K(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||ve.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),fe.current!=null&&y.current&&vt.current(),ve.current===!0){y.current=!1;return}ae(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:kG(e[0]))??DG(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),qW(()=>{je||q==null||yt(!1)},[yt,je,q]);let Rt=YW(()=>q==null?null:`${q.path}::${q.source}`,[q]);qW(()=>{if(Rt==null){m?.clearSlotContent(aR);return}let t=fe.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??RG(n.getBoundingClientRect()),close:e=>{vt.current(e?.restoreFocus??!0)},restoreFocus:()=>{_t.current&>.current(fe.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(aR,i),e?.contextMenu?.onOpen?.(t.item,r),ZG(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&ZG(i)}),()=>{m?.clearSlotContent(aR)}},[Rt,e?.contextMenu,m]),qW(()=>{q!=null&&t.getItem(q.path)==null&&yt()},[yt,q,t]),qW(()=>{if(q==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(LG(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&yt())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),yt())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[yt,q]),qW(()=>{let e=C.current,t=S.current;if(e==null||t==null){A.current=qe;return}let n=qe==null?null:T.current.get(qe)??null,r=aG(t),i=r?.dataset.itemPath??null,a=We&&x.current===r,o=f&&w.current===r,c=M.current&&!Ge,l=N.current??0,u=pe.current,d=me.current,p=he.current,m=ge.current,h=r!=null,g=k.current||h,_=A.current!==qe,v=d!=null&&d===qe&&qe!=null,y=c&&jG(e,Je,s,at,lt,l),b=u!=null&&u===qe&&jG(e,Je,s,at,lt,ut),E=p!=null&&p.path===qe&&jG(e,Je,s,at,lt,p.viewportOffset),O=m!=null&&m.path===qe&&e.scrollTop!==m.scrollTop;if(O&&(e.scrollTop=m.scrollTop),(O||b||E||y||g&&_&&u!==qe&&!v&&AG(e,Je,s,at,ut))&&D.current(),!g){A.current=qe;return}if(a){A.current=qe;return}if(o&&!c){A.current=qe;return}if(n==null){c&&Je>=0&&(jG(e,Je,s,at,lt,l),D.current()),A.current=qe;return}(_||c||u===qe||d===qe||p?.path===qe||m?.path===qe||i==null||i!==qe)&&(iG(n),u===qe&&(pe.current=null),d===qe&&(me.current=null),p?.path===qe&&(he.current=null),m?.path===qe&&(ge.current=null),M.current=!1,N.current=null),A.current=qe},[t,Je,qe,ft,s,We,Ge,ot,at,f,ut,lt,it]);let zt=Je>=0&&Je>=rt.visible.startIndex&&Je<=rt.visible.endIndex,Bt=qe!=null&&st.some(e=>cG(e.row)===qe),Vt=zt||Bt,Ht=Ne&&k.current===!0&&Vt?qe:null,Ut=ce===`pointer`?ie:null,Wt=q?.path??_e.current??Ut??Ht??ie,Gt=q?.source===`right-click`;qW(()=>{y.current&&q==null||bt(ze(Wt))},[q,ze,ot,at,ue,st,Wt,bt,it]);let Kt=XW(e=>{if(y.current||LG(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&le(e=>e===`pointer`?e:`pointer`),ae(e=>e===i?e:i)},[]),qt=XW(()=>{ae(null)},[]);qW(()=>{if(!Ye)return;let e=()=>{jt(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),jt(),t.cancelDrag()}},[t,Ye]);let Jt=e=>{if(!Ye||t.getDragSession()==null||V.current)return;let n=vG(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Mt(t.getDragSession()?.target??null),Nt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},Yt=e=>{if(!Ye||t.getDragSession()==null||V.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(Dt(),kt(),t.setDragTarget(null))},Xt=e=>{!Ye||t.getDragSession()==null||V.current||(e.preventDefault(),J(e.clientX,e.clientY),t.completeDrag(),Ot(),Dt(),kt(),z.current=null)},Zt=rt.window.height,Qt=rt.window.offsetTop,$t=Math.min(0,at-Zt-ut),en=ne===qe||M.current,tn=qe!=null&&en&&!ft&&Je>=0?it[Je]??t.getVisibleRows(Je,Je)[0]??null:null,nn=tn==null?null:MG(Je,s,ot,Zt),rn=z.current,an=$e!=null&&rn!=null&&rn.path===$e&&rn.index>=ot.start&&rn.index<=ot.end,on=$e!=null&&rn!=null&&rn.path===$e&&!an&&rn.path!==tn?.path?rn:null,sn=on==null?null:MG(on.index,s,ot,Zt),cn=NG((Je>=0?it[Je]??t.getVisibleRows(Je,Je)[0]??null:null)?.ancestorPaths.at(-1)??null),ln=Ge&&qe!=null?JG(o,qe,!ft):void 0,un=q?.path??(Ge?qe:ne),dn=q?.path??ie,fn=ze(Wt),pn=je&&Ne&&!Gt&&!We&&fn!=null&&oe!=null&&Wt!=null,mn=je&&(pn||q!=null),hn=q?.anchorRect,gn=hn==null&&fn!=null&&oe!=null&&(q!=null||pn)?oe:null,_n=hn==null?gn==null?void 0:{top:`${gn}px`}:{left:`${hn.left}px`,position:`fixed`,right:`auto`,top:`${hn.top}px`},vn=Gt?{opacity:`0`}:void 0,yn=XW((e,n,r,i)=>{let a=t.getItem(r),o=EW({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:t.isSearchOpen(),mode:i});switch(o.selection.kind){case`range`:t.selectPathRange(r,o.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(r);break;case`single`:t.selectOnlyPath(r);break}let s=e.currentTarget instanceof HTMLElement?e.currentTarget:null,c=n.index>=rt.visible.startIndex&&n.index<=rt.visible.endIndex,l=i===`flow`&&c&&s!=null&&s.dataset.itemParked!==`true`;a?.focus(),l&&(k.current=!0,re(e=>e===r?e:r),le(`focus`)),o.toggleDirectory&&wG(a)&&a.toggle(),o.closeSearch&&t.closeSearch(),o.revealCanonical&&Ct(r,{targetOffset:`sticky-parents`})},[t,rt.visible.endIndex,rt.visible.startIndex,Ct]),bn=()=>{if(y.current||!Ne||Wt==null||fn==null)return;let e=t.getItem(Wt);e!=null&&(bt(fn),_t.current=!0,de({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:fn.getAttribute(`aria-label`)??Wt,path:e.getPath()},path:e.getPath(),source:`button`}))},xn={contextHoverPath:dn,contextMenuButtonTriggerEnabled:Ne,contextMenuButtonVisibility:Pe,contextMenuEnabled:je,contextMenuRightClickEnabled:Fe,contextMenuTriggerMode:Me,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:Ye,draggedPathSet:Ze,dragTarget:Qe,gitLaneActive:Be,gitStatusByPath:n,handleRowDragEnd:Ft,handleRowDragStart:Pt,handleRowTouchStart:It,ignoredGitDirectories:r,ignoredInheritanceCache:ee,instanceId:o,itemHeight:s,onKeyDown:Lt,onRowClick:yn,openContextMenuForRow:xt,registerButton:Ie,registerRenameInput:Re,renameView:He,renderDecorationForRow:pt,resolveIcon:Ve,shouldSuppressContextMenu:wt,visualFocusPath:un},Sn={...xn,registerButton:Le};return KU(`div`,{ref:S,id:et,"data-file-tree-context-menu-button-visibility":je&&Ne?Pe:void 0,"data-file-tree-context-menu-trigger-mode":je?Me:void 0,"data-file-tree-has-context-menu-action-lane":je&&Ne?`true`:void 0,"data-file-tree-has-git-lane":Be?`true`:void 0,"data-file-tree-virtualized-root":`true`,onDragLeave:Ye?Yt:void 0,onDragOver:Ye?Jt:void 0,onDrop:Ye?Xt:void 0,onKeyDown:Lt,onPointerLeave:je?qt:void 0,onPointerOver:je?Kt:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[KU(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:cn}}),KU(`slot`,{name:iR,"data-type":`header-slot`}),f?KU(`div`,{"data-file-tree-search-container":!0,"data-open":Ge?`true`:`false`,children:KU(`input`,{ref:w,"aria-activedescendant":ln,"aria-controls":et,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ce?`true`:void 0,value:Ke,onBlur:()=>{d===`retain`&&!Te.current||t.closeSearch()},onFocus:Ee,onPointerDown:Ee,onInput:e=>{Ee();let n=e.currentTarget;t.setSearch(n.value)}})}):null,KU(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&ke&&st.length>0?KU(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:KU(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${tt}px`},children:st.map((e,t)=>$G(Sn,e.row,`sticky:${cG(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${st.length-t}`}}))})}):null,KU(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${lt}px`},children:[KU(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${Qt}px`}}),KU(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${Zt}px`,top:`${$t}px`,bottom:`${$t}px`},children:[eK(xn,ot,dt),tn!=null&&nn!=null?$G(xn,tn,`parked:${tn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:$e===tn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${nn}px`}}):null,on!=null&&sn!=null?$G(xn,on,`parked-drag:${on.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${sn}px`}}):null]})]})]}),je?KU(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":mn?`true`:`false`,style:_n,children:[KU(`button`,{ref:v,type:`button`,"data-type":oR,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":q==null?`false`:`true`,"data-visible":pn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),q!=null){yt();return}bn()},tabIndex:-1,style:vn,children:KU(XU,{...Ve(`file-tree-icon-ellipsis`)})}),q==null?null:KU(`slot`,{name:aR})]}):null,q==null?null:KU(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),yt()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),yt()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var nK={hydrateRoot:(e,t)=>{WU(bU(tK,t),e)},renderRoot:(e,t)=>{UU(bU(tK,t),e)},unmountRoot:e=>{UU(null,e)}};function rK(e,t){nK.renderRoot(e,t)}function iK(e,t){nK.hydrateRoot(e,t)}function aK(e){nK.unmountRoot(e)}var oK=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},sK=`__c`,cK=`__k`,lK=`__d`,uK=`__s`,dK=/[\s\n\\/='"\0<>]/,fK=/^(xlink|xmlns|xml)([A-Z])/,pK=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,mK=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,hK=new Set([`draggable`,`spellcheck`]);function gK(e){e.__g===void 0?e[lK]=!0:e.__g|=8}function _K(e){e.__g===void 0?e[lK]=!1:e.__g&=-9}function vK(e){return e.__g===void 0?!0===e[lK]:!!(8&e.__g)}var yK=/["&<]/;function bK(e){if(e.length===0||!1===yK.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`"`;break;case 38:i=`&`;break;case 60:i=`<`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var xK={},SK=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),CK=/[A-Z]/g;function wK(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:xK[n]||(xK[n]=n.replace(CK,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||SK.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function TK(){this.__d=!0}function EK(e,t){return{__v:e,context:t,props:e.props,setState:TK,forceUpdate:TK,__d:!0,__h:[]}}function DK(e,t,n){if(!e.s){if(n instanceof OK){if(!n.s)return void(n.o=DK.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(DK.bind(null,e,t),DK.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var OK=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{DK(r,1,a(this.v))}catch(e){DK(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?DK(r,1,t?t(i):i):n?DK(r,1,n(i)):DK(r,2,i)}catch(e){DK(r,2,e)}},r},e}(),kK,AK,jK,MK,NK={},PK=Array.isArray,FK=Object.assign,IK=``,LK=`<!--$s-->`,RK=`<!--/$s-->`;function zK(e,t){var n,r=e.type,i=!0;return e[sK]?(i=!1,(n=e[sK]).state=n[uK]):n=new r(e.props,t),e[sK]=n,n.__v=e,n.props=e.props,n.context=t,gK(n),n.state??=NK,n[uK]??(n[uK]=n.state),r.getDerivedStateFromProps?n.state=FK({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[uK]===n.state?n.state:n[uK]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),jK&&jK(e),n.render(n.props,n.state,t)}function BK(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===IK)return IK;var s=typeof e;if(s!=`object`)return s==`function`?IK:s==`string`?bK(e):e+IK;if(PK(e)){var c,l=IK;i[cK]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=BK(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=IK,PK(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return IK;e.__=i,kK&&kK(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===SU){if(`tpl`in g){for(var x=IK,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!PK(C)?x+=C:x+=BK(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+bK(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=zK(e,b),y=e[sK];else{e[sK]=y=EK(e,b);for(var E=0;vK(y)&&E++<25;){_K(y),jK&&jK(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}gK(y)}if(y.getChildContext!=null&&(t=FK({},t,y.getChildContext())),T&&iU.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===SU&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return BK(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[uK]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,NK),vK(y)?(v=zK(e,t),(y=e[sK]).getChildContext!=null&&(t=FK({},t,y.getChildContext())),BK(v=v!=null&&v.type===SU&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):IK}finally{AK&&AK(e),MK&&MK(e)}}}v=v!=null&&v.type===SU&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=BK(v,t,n,r,e,a,o);return AK&&AK(e),iU.unmount&&iU.unmount(e),e._suspended?typeof D==`string`?LK+D+RK:PK(D)?(D.unshift(LK),D.push(RK),D):D.then(function(e){return LK+e+RK}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return BK(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=iU.__e;return k&&k(i,e),IK}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=BK(v,t,n,r,e,a,o);return e._suspended?LK+s+RK:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=IK;for(var N in g){var P=g[N];if(typeof(P=HK(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=wK(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(fK.test(N))N=N.replace(fK,`$1:$2`).toLowerCase();else{if(dK.test(N))continue;N[4]!==`-`&&!hK.has(N)||P==null?n?mK.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):pK.test(N)&&(N=N.toLowerCase()):P+=IK}}P!=null&&!1!==P&&(j=!0===P||P===IK?j+` `+N:j+` `+N+`="`+(typeof P==`string`?bK(P):P+IK)+`"`)}}if(dK.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=bK(A):A!=null&&!1!==A&&!0!==A&&(M=BK(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),AK&&AK(e),MK&&MK(e),!M&&VK.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return PK(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var VK=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function HK(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var UK=0;function WK(e){return e!=null&&e.length>0?e:(UK+=1,`pst_ft_${UK}`)}function GK({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??nH)}function KK(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function qK(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function JK(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var YK=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new oK;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=WK(a),this.#p=rU(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=tH(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new QH({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(aK(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),rK(t.wrapper,this.#w()))}setGitStatus(e){this.#p=rU(e,this.#p);let t=this.#T();t!=null&&rK(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),rK(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),iK(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),rK(r,this.#w())}#C(){return{initialViewportHeight:GK({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(iR,e());return}this.#l.setSlotHtml(iR,this.#e?.header?.html??null)}#k(e){let t=JK(e).find(e=>qK(e)),n=KK(JL(cR(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=JK(e),n=t.find(e=>qK(e)),r=t.filter(e=>e!==n),i=cR(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=KK(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=cR(this.#m);t.colored&&XL(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${eR}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(eR,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=oH(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return fH(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},XK=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function ZK(e,t,n){let r=e==null?null:(0,Z.jsx)(`div`,{slot:iR,children:e}),i=t!=null&&n!=null?(0,Z.jsx)(`div`,{slot:aR,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,Z.jsxs)(Z.Fragment,{children:[r,i]})}function QK(e,t){return typeof window>`u`&&t!=null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,Z.jsx)(Z.Fragment,{children:e})}function $K(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function eq(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function tq({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(n.getComposition()),d=(0,Q.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,Q.useCallback)(()=>{s(null)},[]),m=(0,Q.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,Q.useMemo)(()=>eq(h,e,f,p,m),[h,p,m,f,e]),_=(0,Q.useCallback)(e=>{l(e)},[]);(0,Q.useEffect)(()=>{f||s(null)},[f]),XK(()=>{n.setComposition(g)},[g,n]),XK(()=>{if(c!=null)return r!=null&&$K(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=QK(ZK(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,Z.jsx)(QL,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}function nq(e){let t=(0,Q.useRef)(null);return t.current??=new YK(e),(0,Q.useEffect)(()=>{let e=t.current;return()=>{e?.cleanUp(),t.current=null}},[]),{model:t.current}}var rq=`.md`,iq=/\.(md|mdx)$/i;function aq(e,t=rq){return`${e}${t}`}function oq(e){return wq(e).replace(iq,``)}function sq(e){return dt(e)?e.path:aq(e.docName,e.docExt)}function cq(e){let t=wq(e).match(iq);return t?`.${t[1].toLowerCase()}`:void 0}function lq(e){return wq(e)}function uq(e){let t=wq(e.trim());return t?`${t}/`:``}function dq(e){return e.endsWith(`/`)?lq(e):oq(e)}function fq(e){return e.map(sq)}function pq(e){return[...e].sort().join(`\0`)}function mq(e){return pq(fq(e))}function hq(e){let t=new Set;for(let n of e){let e=(dt(n)?n.path:n.docName).split(`/`).filter(Boolean);for(let n=1;n<e.length;n++)t.add(`${e.slice(0,n).join(`/`)}/`)}return[...t].sort()}function gq(e){if(!e)return[];let t=wq(e.replace(iq,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function _q(e){let t=e.kind===`directory`,n=t?lq(e.path):oq(e.path),r=t?void 0:cq(e.path);return{kind:t?`folder`:`file`,name:wq(Cq(e.path)).replace(iq,``),path:n,treePath:yq(e.path,t),docExt:r}}function vq(e){return e.kind===`directory`?lq(e.path):e.path}function yq(e,t){return t?uq(e):iq.test(e)?e:`${e}${rq}`}function bq(e,t,n){let r=uq(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${rq}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`,o=`${a}index${rq}`;if(!i.has(o)&&!i.has(a))return{addPath:o,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function xq(e,t){return e===`file`?yq(t,!1):`${lq(t)}/index${rq}`}function Sq(e,t){return t.kind===`root`||t.directoryPath==null?Cq(e):`${t.directoryPath}${Cq(e)}`}function Cq(e){let t=wq(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function wq(e){return e.endsWith(`/`)?e.slice(0,-1):e}function Tq(e){return{selectedFilePath:e,selectedFolderPath:null,navigationPath:e}}function Eq(e,t,n={}){if(!e)return Tq(t);let r=He(e);if(t&&r!==t)return Tq(t);switch(e.kind){case`doc`:return Tq(t??e.docName);case`folder`:case`folder-index`:return{selectedFilePath:null,selectedFolderPath:e.folderPath,navigationPath:e.folderPath};case`missing`:return t&&n.isKnownDocument?.(t)?Tq(t):{selectedFilePath:null,selectedFolderPath:null,navigationPath:null};case`asset`:return{selectedFilePath:null,selectedFolderPath:null,navigationPath:null}}}function Dq(e,t){if(!e)return{kind:`none`};let n=t.find(t=>sq(t)===e);if(n&&dt(n))return{kind:`asset`,hash:nt(n.path)};let r=dq(e);return e.endsWith(`/`)||t.some(e=>gt(e)&&e.docName===r)?{kind:`document-or-folder`,path:r}:{kind:`none`}}function Oq(e){let t=!1,n=!1,r=!1;async function i(){if(!r){t=!0;try{await e()}finally{t=!1,r?n=!1:n&&(n=!1,i())}}}return{request(){if(!r){if(t){n=!0;return}i()}},dispose(){r=!0,n=!1}}}function kq(e){return e?`No workspace`:null}function Aq(e){let t=(0,$.c)(38),{input:n,installStates:r,dispatch:i}=e,a=n===null,o;t[0]===a?o=t[1]:(o=kq(a),t[0]=a,t[1]=o);let s=o,c,l,u,d,f,p;if(t[2]!==i||t[3]!==s||t[4]!==n||t[5]!==a||t[6]!==r){let e;t[13]===r?e=t[14]:(e=e=>r[e.id]?.installed===!0,t[13]=r,t[14]=e);let o=Uf.filter(e);u=r[`claude-cowork`]?.installed===!0;let m;t[15]===n?m=t[16]:(m=n===null?``:Pe(n.docContext),t[15]=n,t[16]=m);let h=m,g;t[17]!==n||t[18]!==h?(g=()=>{n!==null&&bI(h)},t[17]=n,t[18]=h,t[19]=g):g=t[19],d=g,l=jA,t[20]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(MA,{children:[(0,Z.jsx)(kr,{"aria-hidden":`true`}),`Open in…`]}),t[20]=p):p=t[20],c=NA;let _;t[21]!==i||t[22]!==s||t[23]!==n||t[24]!==a?(_=e=>{let t=!a,r=s?`Open in ${e.displayName}, ${s}`:`Open in ${e.displayName}`;return(0,Z.jsxs)(EA,{disabled:!t,onSelect:()=>{!t||!n||i(e.id,n)},"data-testid":`file-tree-open-in-${e.id}`,"aria-label":r,children:[(0,Z.jsx)(pI,{id:e.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.displayName}),s?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:s}):null]},e.id)},t[21]=i,t[22]=s,t[23]=n,t[24]=a,t[25]=_):_=t[25],f=o.map(_),t[2]=i,t[3]=s,t[4]=n,t[5]=a,t[6]=r,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p}else c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12];let m;t[26]!==u||t[27]!==d||t[28]!==a?(m=u?null:(0,Z.jsxs)(EA,{onSelect:d,disabled:a,"data-testid":`file-tree-open-in-claude-web-fallback`,"aria-label":`Open in claude.ai, opens in browser with prompt pre-filled`,children:[(0,Z.jsx)(ir,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:`Open in claude.ai →`}),(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:`opens in browser`})]}),t[26]=u,t[27]=d,t[28]=a,t[29]=m):m=t[29];let h;t[30]!==c||t[31]!==f||t[32]!==m?(h=(0,Z.jsxs)(c,{children:[f,m]}),t[30]=c,t[31]=f,t[32]=m,t[33]=h):h=t[33];let g;return t[34]!==l||t[35]!==p||t[36]!==h?(g=(0,Z.jsxs)(l,{children:[p,h]}),t[34]=l,t[35]=p,t[36]=h,t[37]=g):g=t[37],g}var jq=80,Mq=3,Nq=20,Pq=new Map,Fq=new Set,Iq=[],Lq=new Map;function Rq(e){for(Lq.delete(e),Lq.set(e,!0);Lq.size>Nq;){let e=Lq.keys().next().value;if(e===void 0)break;Lq.delete(e)}}function zq(e){Fq.delete(e),Bq()}function Bq(){for(;Fq.size<Mq&&Iq.length>0;){let e=Iq.shift();if(!e)break;if(!Lq.has(e.docName)){Fq.add(e.docName),Rq(e.docName);try{e.prewarm(e.docName)}catch(t){Wt(`ok/sidebar/prewarm-failed`,{docName:e.docName,message:t instanceof Error?t.message:String(t)})}finally{zq(e.docName)}}}}function Vq(e,t){if(Rn(e)||Lq.has(e))return;let n=Pq.get(e);n&&clearTimeout(n.timer);let r=setTimeout(()=>{if(Pq.delete(e),Fq.size>=Mq){Iq.push({docName:e,prewarm:t});return}Rq(e),Fq.add(e);try{t(e)}catch(t){Wt(`ok/sidebar/prewarm-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}finally{zq(e)}},jq);Pq.set(e,{timer:r,prewarm:t})}function Hq(e){let t=Pq.get(e);t&&(clearTimeout(t.timer),Pq.delete(e))}function Uq(e){window.location.hash=Ie(e)}async function Wq(e,t){try{await navigator.clipboard.writeText(e),X.success(`Copied ${t}`,{description:e})}catch(e){console.warn(`[FileTree] clipboard write failed:`,e),X.error(`Could not copy ${t}`)}}var Gq=new Set([`agents`,`agent`,`claude`,`skill`]),Kq=`ok-file-tree-link-decoration`,qq=`ok-file-tree-agent-decoration`;function Jq(e){return e.map(([e,{key:t,...n}])=>`<${e} ${Object.entries(n).map(([e,t])=>`${e}="${t}"`).join(` `)} />`).join(``)}function Yq(e,t){return`<symbol id="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${Jq(t)}</symbol>`}var Xq=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
1852
|
-
${Yq(Kq,Ya)}
|
|
1853
|
-
${Yq(qq,ya)}
|
|
1854
|
-
</svg>`,Zq=`
|
|
1855
|
-
[data-item-selected='true'] [data-icon-token='markdown'] {
|
|
1856
|
-
color: var(--trees-selected-fg);
|
|
1857
|
-
}
|
|
1858
|
-
`;function Qq(e){return{...yR({type:e===`dark`?`dark`:`light`,colors:{"sideBar.background":`var(--sidebar)`,"sideBar.foreground":`var(--sidebar-foreground)`,"sideBar.border":`var(--sidebar-border)`,"list.activeSelectionBackground":`var(--sidebar-accent)`,"list.activeSelectionForeground":`var(--sidebar-accent-foreground)`,"list.hoverBackground":`var(--sidebar-hover)`,focusBorder:`var(--color-primary)`,"input.background":`var(--input)`,"input.border":`var(--border)`}}),"--trees-font-family-override":`var(--font-sans)`,"--trees-font-size-override":`0.875rem`,"--trees-item-padding-x-override":`0.5rem`,"--trees-padding-inline-override":`0.5rem`,"--trees-border-radius-override":`0.375rem`,"--trees-selected-fg":`var(--color-primary)`,"--truncate-marker-fade-in-duration":`0s`,"--trees-file-icon-color-markdown":`light-dark(var(--color-gray-400), var(--color-gray-500))`,"--trees-fg-muted":`light-dark(var(--color-gray-400), var(--color-gray-500))`}}function $q(e){let t=e.split(`/`).pop()?.replace(/\.md$/i,``).toLowerCase();return!!t&&Gq.has(t)}function eJ(e){return e===`darwin`?`Reveal in Finder`:e===`win32`?`Reveal in File Explorer`:`Open Containing Folder`}function tJ(e){let t=(0,$.c)(14),{item:n,workspace:r,onClose:i}=e,a=typeof window<`u`?window.okDesktop:void 0;if(!a)return null;let o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=eJ(a.platform),t[0]=o):o=t[0];let s=o,c=r?null:`No workspace`,l=!r,u;t[1]!==n||t[2]!==i||t[3]!==r?(u=()=>{if(!r)return;i();let e=kp(r.contentDir,vq(n),r.pathSeparator);a.shell.showItemInFolder(e)},t[1]=n,t[2]=i,t[3]=r,t[4]=u):u=t[4];let d=c?`${s}, ${c}`:s,f,p;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(On,{"aria-hidden":`true`}),p=(0,Z.jsx)(`span`,{className:`flex-1`,children:s}),t[5]=f,t[6]=p):(f=t[5],p=t[6]);let m;t[7]===c?m=t[8]:(m=c?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:c}):null,t[7]=c,t[8]=m);let h;return t[9]!==l||t[10]!==u||t[11]!==d||t[12]!==m?(h=(0,Z.jsxs)(EA,{disabled:l,onSelect:u,"aria-label":d,children:[f,p,m]}),t[9]=l,t[10]=u,t[11]=d,t[12]=m,t[13]=h):h=t[13],h}function nJ(e){return e?.isDirectory()?e:null}function rJ(e,t){let n=t.getPath();for(let t of e.getSelectedPaths())t!==n&&e.getItem(t)?.deselect();t.isSelected()||t.select()}function iJ(e){let t=(0,$.c)(68),{item:n,context:r,anyActionBusy:i,workspace:a,handoff:o,model:s,onStartCreating:c,onDelete:l,onExpandSubtree:u,onCollapseSubtree:d,isAsset:f}=e,p;t[0]===n?p=t[1]:(p=_q(n),t[0]=n,t[1]=p);let m=p,h=n.kind===`directory`,g;t[2]!==h||t[3]!==n.path||t[4]!==a?(g=h?null:jp({docName:oq(n.path),workspace:a}),t[2]=h,t[3]=n.path,t[4]=a,t[5]=g):g=t[5];let _=g,v;t[6]===r?v=t[7]:(v=()=>r.close({restoreFocus:!1}),t[6]=r,t[7]=v);let y=v,b;t[8]===r?b=t[9]:(b=()=>r.close(),t[8]=r,t[9]=b);let x=b,S;t[10]===x?S=t[11]:(S=e=>{e||x()},t[10]=x,t[11]=S);let C;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(wA,{asChild:!0,children:(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-file-tree-context-menu-root":`true`,className:`block size-px`})}),t[12]=C):C=t[12];let w;t[13]!==i||t[14]!==x||t[15]!==y||t[16]!==h||t[17]!==n.path||t[18]!==d||t[19]!==u||t[20]!==c?(w=h?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(EA,{disabled:i,onSelect:()=>{y(),c(`file`,lq(n.path))},children:[(0,Z.jsx)(xo,{"aria-hidden":`true`}),`New File`]}),(0,Z.jsxs)(EA,{disabled:i,onSelect:()=>{y(),c(`folder`,lq(n.path))},children:[(0,Z.jsx)(Ba,{"aria-hidden":`true`}),`New Folder`]}),(0,Z.jsx)(AA,{}),(0,Z.jsxs)(EA,{onSelect:()=>{x(),u(n.path)},children:[(0,Z.jsx)(ko,{"aria-hidden":`true`}),`Expand All`]}),(0,Z.jsxs)(EA,{onSelect:()=>{x(),d(n.path)},children:[(0,Z.jsx)(Ra,{"aria-hidden":`true`}),`Collapse All`]}),(0,Z.jsx)(AA,{})]}):null,t[13]=i,t[14]=x,t[15]=y,t[16]=h,t[17]=n.path,t[18]=d,t[19]=u,t[20]=c,t[21]=w):w=t[21];let T;t[22]!==i||t[23]!==y||t[24]!==f||t[25]!==n.path||t[26]!==s?(T=f?null:(0,Z.jsxs)(EA,{disabled:i,onSelect:()=>{y(),s.startRenaming(n.path)},children:[(0,Z.jsx)(dn,{"aria-hidden":`true`}),`Rename`]}),t[22]=i,t[23]=y,t[24]=f,t[25]=n.path,t[26]=s,t[27]=T):T=t[27];let E;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsxs)(MA,{children:[(0,Z.jsx)(Ir,{"aria-hidden":`true`}),`Copy Path`]}),t[28]=E):E=t[28];let D=!a,O;t[29]!==x||t[30]!==n||t[31]!==a?(O=()=>{a&&(x(),Wq(kp(a.contentDir,vq(n),a.pathSeparator),`full path`))},t[29]=x,t[30]=n,t[31]=a,t[32]=O):O=t[32];let k;t[33]!==D||t[34]!==O?(k=(0,Z.jsx)(EA,{disabled:D,onSelect:O,children:`Full Path`}),t[33]=D,t[34]=O,t[35]=k):k=t[35];let A;t[36]!==x||t[37]!==n?(A=(0,Z.jsx)(EA,{onSelect:()=>{x(),Wq(vq(n),`relative path`)},children:`Relative Path`}),t[36]=x,t[37]=n,t[38]=A):A=t[38];let j;t[39]!==k||t[40]!==A?(j=(0,Z.jsxs)(jA,{children:[E,(0,Z.jsxs)(NA,{children:[k,A]})]}),t[39]=k,t[40]=A,t[41]=j):j=t[41];let M;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(AA,{}),t[42]=M):M=t[42];let N;t[43]!==x||t[44]!==n||t[45]!==a?(N=(0,Z.jsx)(tJ,{item:n,workspace:a,onClose:x}),t[43]=x,t[44]=n,t[45]=a,t[46]=N):N=t[46];let P;t[47]!==o||t[48]!==_||t[49]!==f||t[50]!==h?(P=!h&&!f&&(0,Z.jsx)(Aq,{input:_,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),t[47]=o,t[48]=_,t[49]=f,t[50]=h,t[51]=P):P=t[51];let F;t[52]!==i||t[53]!==x||t[54]!==f||t[55]!==l||t[56]!==m?(F=f?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(AA,{}),(0,Z.jsxs)(EA,{variant:`destructive`,disabled:i,onSelect:()=>{x(),l(m)},children:[(0,Z.jsx)(Kn,{"aria-hidden":`true`}),`Delete`]})]}),t[52]=i,t[53]=x,t[54]=f,t[55]=l,t[56]=m,t[57]=F):F=t[57];let I;t[58]!==j||t[59]!==N||t[60]!==P||t[61]!==F||t[62]!==w||t[63]!==T?(I=(0,Z.jsxs)(TA,{sideOffset:0,align:`start`,"data-file-tree-context-menu-root":`true`,className:`min-w-52`,children:[w,T,j,M,N,P,F]}),t[58]=j,t[59]=N,t[60]=P,t[61]=F,t[62]=w,t[63]=T,t[64]=I):I=t[64];let L;return t[65]!==I||t[66]!==S?(L=(0,Z.jsxs)(CA,{open:!0,modal:!1,onOpenChange:S,children:[C,I]}),t[65]=I,t[66]=S,t[67]=L):L=t[67],L}function aJ(e){let t=(0,$.c)(118),{ref:n}=e,{activeDocName:r,activeTarget:i,closeDocument:a,closeAndClearForRename:o,prewarm:s,remapTabsForRename:c}=Qn(),{notifySidebarFileSelected:l}=iF(),{resolvedTheme:u}=We(),d;t[0]===l?d=t[1]:(d=function(e){Uq(e),l()},t[0]=l,t[1]=d);let f=d,p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=[],t[2]=p):p=t[2];let[m,h]=(0,Q.useState)(p),[g,_]=(0,Q.useState)(!0),[v,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(null),[S,C]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(null),E=(0,Q.useRef)(m),D=(0,Q.useRef)(r),O;t[3]===m?O=t[4]:(O=new Set(m.filter(dt).map(pJ)),t[3]=m,t[4]=O);let k=O,A=(0,Q.useRef)(k),j;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(j=[],t[5]=j):j=t[5];let M=(0,Q.useRef)(j),N=(0,Q.useRef)(null),P=(0,Q.useRef)(null),F=(0,Q.useRef)(null),I=(0,Q.useRef)(!1),L=(0,Q.useRef)(null),R=(0,Q.useRef)(fJ),z=(0,Q.useRef)(dJ),B=(0,Q.useRef)(uJ),V;t[6]===m?V=t[7]:(V=e=>m.some(t=>gt(t)&&t.docName===e),t[6]=m,t[7]=V);let{selectedFilePath:H,selectedFolderPath:U,navigationPath:W}=Eq(i,r,{isKnownDocument:V}),G=H?aq(H,m.find(e=>gt(e)&&e.docName===H)?.docExt):U?uq(U):i?.kind===`asset`?i.assetPath:null,ee=Zp().states,{dispatch:te}=Bp(),ne;t[8]!==te||t[9]!==ee?(ne={installStates:ee,isElectronHost:typeof window<`u`&&window.okDesktop!=null,dispatch:te},t[8]=te,t[9]=ee,t[10]=ne):ne=t[10];let re=ne,ie;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(ie=()=>L.current===null,t[11]=ie):ie=t[11];let ae=ie,oe;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(oe=[],t[12]=oe):oe=t[12];let se;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(se={set:`complete`,spriteSheet:Xq},t[13]=se):se=t[13];let ce;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(ce={contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`}},t[14]=ce):ce=t[14];let le;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(le={canDrag:ae,canDrop:ae,onDropComplete:e=>B.current(e),onDropError:lJ},t[15]=le):le=t[15];let ue;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(ue={paths:oe,flattenEmptyDirectories:!1,initialExpansion:`closed`,fileTreeSearchMode:`hide-non-matches`,initialVisibleRowCount:18,stickyFolders:!0,icons:se,unsafeCSS:Zq,composition:ce,dragAndDrop:le,renaming:{canRename:ae,onRename:e=>z.current(e),onError:X.error},onSelectionChange:e=>R.current(e),renderRowDecoration:e=>{let{item:t}=e;if(t.kind!==`file`)return null;let n=E.current.find(e=>gt(e)&&aq(e.docName,e.docExt)===t.path);return n?.isSymlink?{icon:Kq,title:n.targetPath?`Symlink to ${n.targetPath}`:`Symlink`}:$q(t.path)?{icon:qq,title:`Agent configuration file`}:null}},t[16]=ue):ue=t[16];let{model:K}=nq(ue),q,de;t[17]===m?(q=t[18],de=t[19]):(de=fq(m),q=pq(de),t[17]=m,t[18]=q,t[19]=de);let fe=q,pe=(0,Q.useRef)(de),me;t[20]===m?me=t[21]:(me=hq(m),t[20]=m,t[21]=me);let he=me,ge=(0,Q.useRef)(he),_e=U?gq(uq(U)).slice(0,-1):gq(G??W),ve=_e.join(`\0`),ye;t[22]===K?ye=t[23]:(ye=e=>{let t=fq(e??E.current);K.resetPaths(t,{initialExpandedPaths:M.current})},t[22]=K,t[23]=ye);let be=ye,xe;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(xe=e=>{P.current=mq(e)},t[24]=xe):xe=t[24];let Se=xe,Ce;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=e=>A.current.has(e),t[25]=Ce):Ce=t[25];let we=Ce,Te,Ee;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Te=()=>{let e=!0,t=Oq(async function(){try{let t=await fetch(`/api/documents`),n=await t.json().catch(cJ);if(!e)return;t.ok&&n?.ok?(h(n.documents),y(null)):y(n?.error??`Server error (HTTP ${t.status})`)}catch(t){let n=t;e&&y(`Could not reach server`),console.warn(`[FileTree] fetch failed:`,n)}e&&_(!1)});t.request();let n=()=>{document.visibilityState===`visible`&&t.request()};window.addEventListener(`focus`,n),window.addEventListener(`visibilitychange`,n);let r=Ue(e=>{e.includes(`files`)&&t.request()});return()=>{e=!1,t.dispose(),window.removeEventListener(`focus`,n),window.removeEventListener(`visibilitychange`,n),r()}},Ee=[],t[26]=Te,t[27]=Ee):(Te=t[26],Ee=t[27]),(0,Q.useEffect)(Te,Ee);let De,Oe;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(De=()=>{let e=!0;return fetch(`/api/workspace`).then(async t=>{let n=await t.json();e&&t.ok&&n?.ok&&typeof n.contentDir==`string`&&(n.pathSeparator===`/`||n.pathSeparator===`\\`)&&T({contentDir:n.contentDir,pathSeparator:n.pathSeparator})}).catch(sJ),()=>{e=!1}},Oe=[],t[28]=De,t[29]=Oe):(De=t[28],Oe=t[29]),(0,Q.useEffect)(De,Oe);let ke,Ae;t[30]!==K||t[31]!==fe?(ke=()=>{if(P.current===fe){P.current=null;return}K.resetPaths(pe.current,{initialExpandedPaths:M.current})},Ae=[K,fe],t[30]=K,t[31]=fe,t[32]=ke,t[33]=Ae):(ke=t[32],Ae=t[33]),(0,Q.useEffect)(ke,Ae);let je,Me;t[34]!==ve||t[35]!==G||t[36]!==K?(je=()=>{if(!G)return;let e=ve?ve.split(`\0`):[];for(let t of e){let e=nJ(K.getItem(t));e&&!e.isExpanded()&&e.expand()}let t=K.getItem(G);t&&(I.current=!0,rJ(K,t),t.focus(),queueMicrotask(()=>{I.current=!1}))},Me=[ve,G,K],t[34]=ve,t[35]=G,t[36]=K,t[37]=je,t[38]=Me):(je=t[37],Me=t[38]),(0,Q.useEffect)(je,Me);let Ne,Pe;t[39]===K?(Ne=t[40],Pe=t[41]):(Ne=()=>K.subscribe(()=>{if(!K.isSearchOpen())for(let e of M.current){let t=nJ(K.getItem(e));t&&!t.isExpanded()&&t.expand()}}),Pe=[K],t[39]=K,t[40]=Ne,t[41]=Pe),(0,Q.useEffect)(Ne,Pe);let Fe;t[42]!==o||t[43]!==c?(Fe=async e=>{let t=D.current,n=qF(t,e);await Promise.all(e.flatMap(e=>[o(e.fromDocName),o(e.toDocName)])),c(e),h(t=>{let n=GF(t,e);return Se(n),n}),Ze([`files`,`backlinks`,`graph`]),n&&n!==t&&(window.location.hash=Ie(n))},t[42]=o,t[43]=c,t[44]=Fe):Fe=t[44];let Le=Fe,Re;t[45]!==Le||t[46]!==be?(Re=async function(e){let t=e.isFolder?`folder`:`file`,n=yq(e.sourcePath,e.isFolder),r=yq(e.destinationPath,e.isFolder),i=N.current;x(n),y(null);try{if(i?.renamePath===n){let e=xq(t,r),n=await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),i=await n.json();if(!n.ok||!i?.ok){let e=i?.error??`Failed to create ${t}`;X.error(e),y(e),be(),N.current=null,x(null);return}let a=i.docName??e.replace(/\.md$/i,``);h(e=>{if(e.some(e=>!dt(e)&&e.docName===a))return e;let t=[...e,{kind:`document`,docName:a,modified:new Date().toISOString(),size:0}];return Se(t),t}),Uq(a),Ze([`files`,`backlinks`,`graph`]),N.current=null,x(null);return}if(!e.isFolder&&we(n)){X.error(`Assets cannot be renamed from the sidebar`),be(),N.current=null,x(null);return}let a=e.isFolder?{kind:`folder`,fromPath:lq(n),toPath:lq(r)}:{kind:`file`,fromPath:oq(n),toPath:oq(r)},o=await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(a)}),s=await o.json();if(!o.ok||!s.ok){let e=s.ok?`Failed to rename path`:s.error||`Failed to rename path`;X.error(e),y(e),be(),N.current=null,x(null);return}await Le(s.renamed),N.current=null,x(null)}catch(e){console.warn(`[FileTree] rename failed:`,e),X.error(`Network error — please try again`),y(`Network error — please try again`),be(),N.current=null,x(null)}},t[45]=Le,t[46]=be,t[47]=Re):Re=t[47];let ze=Re,Be;t[48]!==Le||t[49]!==be?(Be=async function(e){let t=e.draggedPaths.map(t=>{let n=Sq(t,e.target);return t===n?null:{sourcePath:t,destinationTreePath:n}}).filter(oJ);if(t.length!==0){if(t.some(e=>we(e.sourcePath))){X.error(`Assets cannot be moved from the sidebar`),be();return}x(t[0]?.sourcePath??null),y(null);try{let e=[];for(let n of t){let t=n.sourcePath.endsWith(`/`)?{kind:`folder`,fromPath:lq(n.sourcePath),toPath:lq(n.destinationTreePath)}:{kind:`file`,fromPath:oq(n.sourcePath),toPath:oq(n.destinationTreePath)},r=await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),i=await r.json();if(!r.ok||!i.ok){let e=i.ok?`Failed to move`:i.error||`Failed to move`;X.error(e),y(e),be(),x(null);return}e=e.concat(i.renamed)}await Le(e),x(null)}catch(e){console.warn(`[FileTree] move failed:`,e),X.error(`Network error — please try again`),be(),x(null)}}},t[48]=Le,t[49]=be,t[50]=Be):Be=t[50];let Ve=Be,He;t[51]!==K||t[52]!==de?(He=function(e,t){try{let n=bq(e,t,[...de,...ge.current]);N.current={kind:e,renamePath:n.renamePath},K.add(n.addPath),K.startRenaming(n.renamePath,{removeIfCanceled:!0})}catch(e){console.warn(`[FileTree] create placeholder failed:`,e),X.error(`Could not start creating a new item`)}},t[51]=K,t[52]=de,t[53]=He):He=t[53];let Ge=He,Ke;t[54]===K?Ke=t[55]:(Ke=function(e){let t=uq(e);(0,Q.startTransition)(()=>{for(let e of ge.current)if(e===t||e.startsWith(t)){let t=nJ(K.getItem(e));t&&t.expand()}})},t[54]=K,t[55]=Ke);let qe=Ke,Je;t[56]===K?Je=t[57]:(Je=function(e){let t=uq(e),n=new Set(M.current);(0,Q.startTransition)(()=>{for(let e of[...ge.current].reverse())if((e===t||e.startsWith(t))&&!n.has(e)){let t=nJ(K.getItem(e));t&&t.collapse()}})},t[56]=K,t[57]=Je);let Ye=Je,Xe;t[58]!==_e||t[59]!==r||t[60]!==k||t[61]!==b||t[62]!==m||t[63]!==he||t[64]!==Ve||t[65]!==ze||t[66]!==f||t[67]!==l||t[68]!==de?(Xe=()=>{E.current=m,D.current=r,A.current=k,L.current=b,pe.current=de,ge.current=he,M.current=_e,R.current=e=>{if(I.current)return;let t=Dq(e[0],E.current);if(t.kind===`none`){let t=e[0];t&&console.debug(`[FileTree] Dropped selection for unknown docName:`,dq(t));return}if(t.kind===`asset`){window.location.hash=t.hash,l();return}f(t.path)},z.current=ze,B.current=Ve},t[58]=_e,t[59]=r,t[60]=k,t[61]=b,t[62]=m,t[63]=he,t[64]=Ve,t[65]=ze,t[66]=f,t[67]=l,t[68]=de,t[69]=Xe):Xe=t[69],(0,Q.useLayoutEffect)(Xe);let Qe;t[70]!==K||t[71]!==Ge?(Qe=()=>({startCreating:Ge,expandAll(){(0,Q.startTransition)(()=>{for(let e of ge.current){let t=nJ(K.getItem(e));t&&t.expand()}})},collapseAll(){let e=new Set(M.current);(0,Q.startTransition)(()=>{for(let t of[...ge.current].reverse()){if(e.has(t))continue;let n=nJ(K.getItem(t));n&&n.collapse()}})}}),t[70]=K,t[71]=Ge,t[72]=Qe):Qe=t[72],(0,Q.useImperativeHandle)(n,Qe);let $e;t[73]!==a||t[74]!==K||t[75]!==be?($e=async function(e){x(e.path),C(null);try{let t=e.kind===`folder`?uq(e.path):aq(e.path,e.docExt),n=await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.path})}),r=await n.json();if(!n.ok||!r.ok){X.error(r.error??`Failed to delete path`),x(null);return}let i=Array.isArray(r.deletedDocNames)?r.deletedDocNames:[],o=new Set(i);for(let e of o)a(e);K.getItem(t)&&K.remove(t,e.kind===`folder`?{recursive:!0}:void 0),h(e=>{let t=KF(e,i);return Se(t),t}),Ze([`files`,`backlinks`,`graph`]);let s=D.current;s&&o.has(s)&&(window.location.hash=``),x(null)}catch(e){console.warn(`[FileTree] delete failed:`,e),X.error(`Network error — please try again`),x(null),be()}},t[73]=a,t[74]=K,t[75]=be,t[76]=$e):$e=t[76];let et=$e,tt;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(tt=function(){let e=F.current;e&&Hq(e),F.current=null},t[77]=tt):tt=t[77];let nt=tt,rt;t[78]===s?rt=t[79]:(rt=function(e){let t=mJ(e.nativeEvent);if(!t||t.endsWith(`/`)){nt();return}let n=oq(t),r=E.current.find(e=>sq(e)===t);if(r&&dt(r)){nt();return}F.current!==n&&(nt(),F.current=n,Vq(n,e=>{s(e)}))},t[78]=s,t[79]=rt);let it=rt;if(g){let e;return t[80]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{className:`select-none text-sidebar-foreground/30 text-sm`,children:`Loading...`})}),t[80]=e):e=t[80],e}if(m.length===0){if(v){let e;return t[81]===v?e=t[82]:(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{className:`select-none text-sidebar-foreground/50 text-sm`,children:v})}),t[81]=v,t[82]=e),e}let e;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`span`,{className:`select-none text-sidebar-foreground/30 text-sm`,children:`No files yet.`}),t[83]=e):e=t[83];let n;return t[84]===Ge?n=t[85]:(n=(0,Z.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center gap-3 py-8`,children:[e,(0,Z.jsx)(Y,{variant:`link`,size:`sm`,className:`font-mono uppercase`,onClick:()=>Ge(`file`,``),children:`Create your first file`})]}),t[84]=Ge,t[85]=n),n}let at=b!==null,ot;t[86]===v?ot=t[87]:(ot=v&&(0,Z.jsx)(`span`,{role:`alert`,className:`px-3 pb-1 text-destructive text-xs`,children:v}),t[86]=v,t[87]=ot);let st;t[88]===u?st=t[89]:(st=Qq(u),t[88]=u,t[89]=st);let ct;t[90]!==at||t[91]!==k||t[92]!==Ye||t[93]!==qe||t[94]!==re||t[95]!==K||t[96]!==Ge||t[97]!==w?(ct=(e,t)=>(0,Z.jsx)(iJ,{item:e,context:t,anyActionBusy:at,workspace:w,handoff:re,model:K,onStartCreating:Ge,onDelete:C,onExpandSubtree:qe,onCollapseSubtree:Ye,isAsset:k.has(e.path)}),t[90]=at,t[91]=k,t[92]=Ye,t[93]=qe,t[94]=re,t[95]=K,t[96]=Ge,t[97]=w,t[98]=ct):ct=t[98];let lt;t[99]!==it||t[100]!==K||t[101]!==ot||t[102]!==st||t[103]!==ct?(lt=(0,Z.jsx)(tq,{header:ot,model:K,style:st,onMouseMove:it,onMouseLeave:nt,renderContextMenu:ct}),t[99]=it,t[100]=K,t[101]=ot,t[102]=st,t[103]=ct,t[104]=lt):lt=t[104];let ut=!!S,ft;t[105]===b?ft=t[106]:(ft=e=>{!e&&!b&&C(null)},t[105]=b,t[106]=ft);let pt;t[107]!==b||t[108]!==S||t[109]!==et?(pt=S&&(0,Z.jsx)(bj,{itemName:`${S.name}${S.kind===`file`?S.docExt??`.md`:`/`}`,isSubmitting:b===S.path,onDelete:()=>et(S),customDescription:S.kind===`folder`?`Are you sure you want to delete ${S.name}/ and all files inside? This action cannot be undone.`:void 0}),t[107]=b,t[108]=S,t[109]=et,t[110]=pt):pt=t[110];let mt;t[111]!==ut||t[112]!==ft||t[113]!==pt?(mt=(0,Z.jsx)(yi,{open:ut,onOpenChange:ft,children:pt}),t[111]=ut,t[112]=ft,t[113]=pt,t[114]=mt):mt=t[114];let ht;return t[115]!==lt||t[116]!==mt?(ht=(0,Z.jsxs)(Z.Fragment,{children:[lt,mt]}),t[115]=lt,t[116]=mt,t[117]=ht):ht=t[117],ht}function oJ(e){return!!e}function sJ(e){console.warn(`[FileTree] /api/workspace fetch failed:`,e)}function cJ(){return null}function lJ(e){X.error(e)}function uJ(){}function dJ(){}function fJ(){}function pJ(e){return sq(e)}function mJ(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.dataset.itemPath)return t.dataset.itemPath;return null}var hJ=(e,t,n)=>Po(e,t,n,`ProjectSwitcher`);function gJ(e){let t=(0,$.c)(59),{bridge:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(!1),c;t[1]!==n.project||t[2]!==o?(c=()=>{if(!o)return;let e=!1;return hJ(async()=>{let t=await n.project.listRecent();e||a(t)},`Failed to load recent projects.`),()=>{e=!0}},t[1]=n.project,t[2]=o,t[3]=c):c=t[3];let l;t[4]!==n||t[5]!==o?(l=[o,n],t[4]=n,t[5]=o,t[6]=l):l=t[6],(0,Q.useEffect)(c,l);let u;t[7]===n.project?u=t[8]:(u=e=>{s(!1),hJ(()=>n.project.open({path:e,target:`new-window`}),`Failed to open project.`)},t[7]=n.project,t[8]=u);let d=u,f;t[9]!==n.dialog||t[10]!==n.project?(f=()=>{s(!1),hJ(async()=>{let e=await n.dialog.openFolder();e&&await n.project.open({path:e,target:`new-window`})},`Failed to open folder.`)},t[9]=n.dialog,t[10]=n.project,t[11]=f):f=t[11];let p=f,m;t[12]===n.navigator?m=t[13]:(m=()=>{s(!1),hJ(()=>n.navigator.open(),`Failed to open Project Navigator.`)},t[12]=n.navigator,t[13]=m);let h=m,g=n.config.projectPath,_,v,y,b,x,S,C,w,T,E,D;if(t[14]!==n.config.projectName||t[15]!==g||t[16]!==o||t[17]!==d||t[18]!==i){let e;t[30]===g?e=t[31]:(e=e=>e.path!==g,t[30]=g,t[31]=e);let r=i.filter(e);v=CA,S=o,C=s;let a;t[32]===n.config.projectName?a=t[33]:(a=(0,Z.jsx)(`span`,{className:`truncate`,children:n.config.projectName}),t[32]=n.config.projectName,t[33]=a);let c;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Ca,{"aria-hidden":`true`,className:`opacity-60`}),t[34]=c):c=t[34],t[35]===a?w=t[36]:(w=(0,Z.jsx)(wA,{asChild:!0,children:(0,Z.jsxs)(vF,{className:`justify-between text-sidebar-foreground/70`,"data-testid":`project-switcher-trigger`,title:`Open project menu`,children:[a,c]})}),t[35]=a,t[36]=w),_=TA,T=`start`,E=`top`,D=`min-w-[260px]`,y=`project-switcher-menu`,t[37]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(kA,{className:`font-mono font-normal tracking-wide uppercase text-muted-foreground text-xs`,children:`Recent projects`}),t[37]=b):b=t[37],x=r.length===0?(0,Z.jsx)(kA,{className:`font-normal text-muted-foreground text-xs`,children:`No other recent projects.`}):r.slice(0,10).map(e=>(0,Z.jsxs)(EA,{disabled:e.missing,onSelect:()=>d(e.path),className:`flex flex-col items-start gap-0.5`,"data-testid":`project-switcher-recent-${e.path}`,children:[(0,Z.jsx)(`span`,{className:`font-medium text-sm`,children:e.name}),(0,Z.jsxs)(`span`,{className:`max-w-[240px] truncate text-muted-foreground text-xs`,children:[e.path,e.missing?` (missing)`:``]})]},e.path)),t[14]=n.config.projectName,t[15]=g,t[16]=o,t[17]=d,t[18]=i,t[19]=_,t[20]=v,t[21]=y,t[22]=b,t[23]=x,t[24]=S,t[25]=C,t[26]=w,t[27]=T,t[28]=E,t[29]=D}else _=t[19],v=t[20],y=t[21],b=t[22],x=t[23],S=t[24],C=t[25],w=t[26],T=t[27],E=t[28],D=t[29];let O;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(O=(0,Z.jsx)(AA,{}),t[38]=O):O=t[38];let k;t[39]===p?k=t[40]:(k=(0,Z.jsx)(EA,{onSelect:p,"data-testid":`project-switcher-open-folder`,children:`Open folder…`}),t[39]=p,t[40]=k);let A;t[41]===h?A=t[42]:(A=(0,Z.jsx)(EA,{onSelect:h,"data-testid":`project-switcher-switch-project`,children:Hf}),t[41]=h,t[42]=A);let j;t[43]!==_||t[44]!==y||t[45]!==b||t[46]!==x||t[47]!==k||t[48]!==A||t[49]!==T||t[50]!==E||t[51]!==D?(j=(0,Z.jsxs)(_,{align:T,side:E,className:D,"data-testid":y,children:[b,x,O,k,A]}),t[43]=_,t[44]=y,t[45]=b,t[46]=x,t[47]=k,t[48]=A,t[49]=T,t[50]=E,t[51]=D,t[52]=j):j=t[52];let M;return t[53]!==v||t[54]!==S||t[55]!==C||t[56]!==w||t[57]!==j?(M=(0,Z.jsxs)(v,{open:S,onOpenChange:C,children:[w,j]}),t[53]=v,t[54]=S,t[55]=C,t[56]=w,t[57]=j,t[58]=M):M=t[58],M}function _J(e){let t=(0,$.c)(33),{notice:n,onDismiss:r}=e,i=n.variant===`error`?`border-destructive/60`:`border-sidebar-border`,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(ri,{"aria-hidden":`true`,className:`size-3`}),t[0]=a):a=t[0];let o;t[1]===r?o=t[2]:(o=(0,Z.jsx)(Y,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-sidebar-foreground`,"aria-label":`Dismiss notice`,onClick:r,children:a}),t[1]=r,t[2]=o);let s=o;if(n.secondaryAction){let e=`update-notice-${n.id}`,r=`flex flex-col gap-2 rounded-md border bg-sidebar-accent/30 px-2 py-2 text-xs text-muted-foreground ${i}`,a;t[3]===n.body?a=t[4]:(a=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[3]=n.body,t[4]=a);let o;t[5]!==s||t[6]!==a?(o=(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[a,s]}),t[5]=s,t[6]=a,t[7]=o):o=t[7];let c;t[8]===n.action?c=t[9]:(c=n.action?(0,Z.jsx)(`button`,{type:`button`,className:`shrink-0 text-xs font-medium underline underline-offset-2 decoration-muted-foreground/40 hover:text-sidebar-foreground hover:decoration-sidebar-foreground`,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[8]=n.action,t[9]=c);let l;t[10]===n.secondaryAction?l=t[11]:(l=()=>{n.secondaryAction?.onClick()},t[10]=n.secondaryAction,t[11]=l);let u;t[12]!==n.secondaryAction.label||t[13]!==l?(u=(0,Z.jsx)(`button`,{type:`button`,className:`shrink-0 text-xs font-medium underline underline-offset-2 decoration-muted-foreground/40 hover:text-sidebar-foreground hover:decoration-sidebar-foreground`,onClick:l,children:n.secondaryAction.label}),t[12]=n.secondaryAction.label,t[13]=l,t[14]=u):u=t[14];let d;t[15]!==c||t[16]!==u?(d=(0,Z.jsxs)(`div`,{className:`flex gap-3 pl-1`,children:[c,u]}),t[15]=c,t[16]=u,t[17]=d):d=t[17];let f;return t[18]!==d||t[19]!==e||t[20]!==r||t[21]!==o?(f=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":e,className:r,children:[o,d]}),t[18]=d,t[19]=e,t[20]=r,t[21]=o,t[22]=f):f=t[22],f}let c=`update-notice-${n.id}`,l=`flex items-center gap-2 rounded-md border bg-sidebar-accent/30 px-2 py-1.5 text-xs text-muted-foreground ${i}`,u;t[23]===n.body?u=t[24]:(u=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[23]=n.body,t[24]=u);let d;t[25]===n.action?d=t[26]:(d=n.action?(0,Z.jsx)(`button`,{type:`button`,className:`shrink-0 text-xs font-medium underline underline-offset-2 decoration-muted-foreground/40 hover:text-sidebar-foreground hover:decoration-sidebar-foreground`,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[25]=n.action,t[26]=d);let f;return t[27]!==s||t[28]!==c||t[29]!==l||t[30]!==u||t[31]!==d?(f=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":c,className:l,children:[u,d,s]}),t[27]=s,t[28]=c,t[29]=l,t[30]=u,t[31]=d,t[32]=f):f=t[32],f}function vJ(e){if(e.length===0)return null;let t=e[0];if(!t)return null;for(let n=1;n<e.length;n++){let r=e[n];r&&r.priority<t.priority&&(t=r)}return t}function yJ(){let e=(0,$.c)(7),t=(0,Q.useSyncExternalStore)($u,Qu,Qu),n;e[0]===t?n=e[1]:(n=vJ(t),e[0]=t,e[1]=n);let r=n;if(!r)return null;let i;e[2]===r.id?i=e[3]:(i=()=>{Zu(r.id)},e[2]=r.id,e[3]=i);let a;return e[4]!==r||e[5]!==i?(a=(0,Z.jsx)(`div`,{"data-testid":`update-notices-list`,children:(0,Z.jsx)(_J,{notice:r,onDismiss:i})}),e[4]=r,e[5]=i,e[6]=a):a=e[6],a}function bJ(e){let t=(0,$.c)(2),{onOpenSearch:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(Kt,{name:`file-sidebar`,children:(0,Z.jsx)(SJ,{onOpenSearch:n})}),t[0]=n,t[1]=r),r}var xJ=e=>{let t=(0,$.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({icon:n,label:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=(0,Z.jsx)(n,{"aria-hidden":`true`}),t[4]=n,t[5]=a);let o;t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(Ci,{asChild:!0,children:(0,Z.jsx)(Y,{variant:`ghost`,size:`icon-sm`,"aria-label":r,...i,children:a})}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9];let s;t[10]===r?s=t[11]:(s=(0,Z.jsx)(wi,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(Ei,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c};function SJ(e){let t=(0,$.c)(17),{onOpenSearch:n}=e,r=(0,Q.useRef)(null),i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`span`,{className:`font-mono text-sm uppercase tracking-wider text-sidebar-foreground/50`,children:`Files`}),t[0]=i):i=t[0];let a;t[1]===n?a=t[2]:(a=(0,Z.jsx)(xJ,{icon:ho,label:`Search`,onClick:n}),t[1]=n,t[2]=a);let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(wA,{asChild:!0,children:(0,Z.jsx)(xJ,{icon:Qa,label:`Tree View Options`})}),t[3]=o):o=t[3];let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsxs)(EA,{onSelect:()=>r.current?.expandAll(),children:[(0,Z.jsx)(ko,{"aria-hidden":`true`}),`Expand All`]}),t[4]=s):s=t[4];let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsxs)(TA,{align:`end`,children:[s,(0,Z.jsxs)(EA,{onSelect:()=>r.current?.collapseAll(),children:[(0,Z.jsx)(Ra,{"aria-hidden":`true`}),`Collapse All`]})]}),t[5]=c):c=t[5];let l;t[6]===a?l=t[7]:(l=(0,Z.jsxs)(CA,{children:[a,o,c]}),t[6]=a,t[7]=l);let u;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(xJ,{icon:xo,label:`New File`,onClick:()=>r.current?.startCreating(`file`,``)}),t[8]=u):u=t[8];let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(xJ,{icon:Ba,label:`New Folder`,onClick:()=>r.current?.startCreating(`folder`,``)}),t[9]=d):d=t[9];let f;t[10]===l?f=t[11]:(f=(0,Z.jsxs)(fF,{className:`flex-row items-center justify-between`,children:[i,(0,Z.jsxs)(`div`,{className:`flex items-center gap-1`,children:[l,u,d]})]}),t[10]=l,t[11]=f);let p;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(mF,{children:(0,Z.jsx)(aJ,{ref:r})}),t[12]=p):p=t[12];let m,h;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsxs)(pF,{className:`px-0`,children:[typeof window<`u`&&window.okDesktop?(0,Z.jsx)(hF,{children:(0,Z.jsx)(gF,{children:(0,Z.jsx)(gJ,{bridge:window.okDesktop})})}):null,(0,Z.jsx)(yJ,{})]}),h=(0,Z.jsx)(uF,{}),t[13]=m,t[14]=h):(m=t[13],h=t[14]);let g;return t[15]===f?g=t[16]:(g=(0,Z.jsxs)(cF,{variant:`inset`,children:[f,p,m,h]}),t[15]=f,t[16]=g),g}function CJ(){let e=(0,$.c)(17),t=j(),{collabUrl:n,setSystemProvider:r,updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}=Qn(),l;e[0]!==o||e[1]!==s||e[2]!==a||e[3]!==c||e[4]!==i?(l={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c},e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=i,e[5]=l):l=e[5];let u=(0,Q.useRef)(l),d;e[6]!==o||e[7]!==s||e[8]!==a||e[9]!==c||e[10]!==i?(d=()=>{u.current={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}},e[6]=o,e[7]=s,e[8]=a,e[9]=c,e[10]=i,e[11]=d):d=e[11],(0,Q.useEffect)(d);let f,p;return e[12]!==n||e[13]!==t||e[14]!==r?(f=()=>{if(n===null)return;let e=new zn,i=new kn({url:n,name:te,document:e,onStateless:e=>{let{payload:t}=e;or(t,{onServerInfo:e=>{u.current.updateServerInstanceId(e.serverInstanceId),e.currentBranch!==void 0&&u.current.observeBranch(e.currentBranch)},onBranchSwitched:e=>{u.current.onBranchSwitched(e.branch)},onDiskAck:e=>{u.current.observeDiskAck(e.docName,e.sv)},onDerivedView:OJ,onConfigValidationRejected:DJ,onUnknown:EJ})},onClose:TJ,onDisconnect:wJ}),a=Ue(e=>{(e.includes(`files`)||e.includes(`backlinks`))&&(t.invalidateQueries({queryKey:[`backlinks`]}),t.invalidateQueries({queryKey:[`forward-links`]})),(e.includes(`files`)||e.includes(`graph`))&&(t.invalidateQueries({queryKey:[`orphans`]}),t.invalidateQueries({queryKey:[`hubs`]}))}),o=Wn(()=>{u.current.refreshServerInfo()});i.on(`synced`,()=>{Ze([`files`,`backlinks`,`graph`]),o()});let s=new Set,c=()=>{if(i.awareness)for(let[e,t]of i.awareness.getStates().entries())s.has(e)||t.user?.type===`agent`&&(s.add(e),console.warn(`[agent-presence] observed stale AwarenessUser.type === 'agent' from clientID ${e} — probably a stale bundled client`))};return i.awareness?.on(`change`,c),r(i),()=>{a(),i.awareness?.off(`change`,c),r(null),i.destroy(),e.destroy()}},p=[t,n,r],e[12]=n,e[13]=t,e[14]=r,e[15]=f,e[16]=p):(f=e[15],p=e[16]),(0,Q.useEffect)(f,p),null}function wJ(){console.warn(`[CC1] __system__ disconnected - derived views may be stale`)}function TJ(e){let{event:t}=e;console.warn(`[CC1] __system__ connection closed:`,t.code,t.reason)}function EJ(e){console.warn(`[CC1] Unparseable stateless payload, skipping:`,e.slice(0,100))}function DJ(e){Yr(e)}function OJ(e){Ze([e.ch])}function kJ(){let e=(0,$.c)(7),{clearTarget:t}=Qn(),{openTargetTransition:n}=ar(),{folderPaths:r,loading:i,pages:a}=Ee(),o,s;return e[0]!==t||e[1]!==r||e[2]!==i||e[3]!==n||e[4]!==a?(o=()=>{e();function e(){let e=ct(window.location.hash);if(e){let t=W(e.split(`.`).pop()??``);Wt(`ok/nav/hash-change`,{docName:null,kind:`asset`}),n({kind:`asset`,target:e,assetPath:e,mediaKind:t});return}let o=Ge(window.location.hash);if(!o){Wt(`ok/nav/hash-change`,{docName:null,kind:`clear`}),t();return}if(i){Wt(`ok/nav/hash-change`,{docName:o,kind:`deferred-loading`});return}let s=ut(o,{pages:a,folderPaths:r});Wt(`ok/nav/hash-change`,{docName:o,kind:s.kind}),n(s)}return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},s=[t,r,i,n,a],e[0]=t,e[1]=r,e[2]=i,e[3]=n,e[4]=a,e[5]=o,e[6]=s):(o=e[5],s=e[6]),(0,Q.useEffect)(o,s),null}var AJ=`#install-claude-desktop`;function jJ(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(typeof window<`u`&&window.location.hash===AJ),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=function(){window.location.hash===AJ&&n(!0)};return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(e){if(n(e),!e&&window.location.hash===AJ){let{pathname:e,search:t}=window.location;window.history.replaceState(null,``,`${e}${t}`)}},e[2]=a):a=e[2];let o=a,s;return e[3]===t?s=e[4]:(s=(0,Z.jsx)(Hr,{open:t,onOpenChange:o}),e[3]=t,e[4]=s),s}function MJ(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Q.useEffect)(NJ,t),null}function NJ(){let e=function(e){let t=e.target;Gf({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),window.location.hash!==`#settings`&&(window.location.hash=Wf))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)}function PJ(){let e=(0,$.c)(8),{activeDocName:t,activeTarget:n}=Qn(),[r,i]=(0,Q.useState)(!1),a;e[0]!==t||e[1]!==n?(a=n?.kind===`folder`?n.folderPath:ve(t),e[0]=t,e[1]=n,e[2]=a):a=e[2];let o=a,s,c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=function(e){let t=e.target;tr({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),i(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},c=[],e[3]=s,e[4]=c):(s=e[3],c=e[4]),(0,Q.useEffect)(s,c);let l;return e[5]!==r||e[6]!==o?(l=(0,Z.jsx)(Pn,{open:r,onOpenChange:i,kind:`file`,initialDir:o}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function FJ(){let e=(0,$.c)(13),t=typeof window<`u`?window.okDesktop??null:null,[n,r]=(0,Q.useState)(!1),i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(pm,{}),e[0]=i):i=e[0];let a,o,s,c,l,u;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(CJ,{}),o=(0,Z.jsx)(kJ,{}),s=(0,Z.jsx)(PJ,{}),c=(0,Z.jsx)(MJ,{}),l=(0,Z.jsx)(jJ,{}),u=(0,Z.jsx)(ou,{}),e[1]=a,e[2]=o,e[3]=s,e[4]=c,e[5]=l,e[6]=u):(a=e[1],o=e[2],s=e[3],c=e[4],l=e[5],u=e[6]);let d;e[7]===n?d=e[8]:(d=(0,Z.jsx)(om,{bridge:t,open:n,onOpenChange:r}),e[7]=n,e[8]=d);let f;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(bJ,{onOpenSearch:()=>r(!0)}),e[9]=f):f=e[9];let p;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(aF,{className:`h-screen overflow-hidden`,children:[f,(0,Z.jsx)(dF,{className:`overflow-hidden h-[calc(100vh-var(--layout-inset-offset))]`,children:(0,Z.jsx)(BI,{})})]}),e[10]=p):p=e[10];let m;return e[11]===d?m=e[12]:(m=(0,Z.jsx)(Kt,{name:`app`,children:(0,Z.jsx)(lr,{children:(0,Z.jsxs)(zr,{children:[i,(0,Z.jsxs)(ot,{children:[a,o,s,c,l,u,d,p]})]})})}),e[11]=d,e[12]=m),m}$i(),typeof window<`u`&&window.okDesktop?.config.apiOrigin&&hu({apiOrigin:window.okDesktop.config.apiOrigin}),ed(),typeof window<`u`&&vu({bridge:window.okDesktop}),typeof window<`u`&&Oi({bridge:window.okDesktop});var IJ=new ca({defaultOptions:{queries:{retry:1,staleTime:1e4}}}),LJ=document.getElementById(`root`);if(!LJ)throw Error(`Root element not found`);var RJ=typeof window<`u`&&window.okDesktop?.config.mode===`navigator`;(0,va.createRoot)(LJ).render((0,Z.jsx)(Q.StrictMode,{children:(0,Z.jsx)(w,{client:IJ,children:(0,Z.jsxs)($e,{attribute:`class`,defaultTheme:`system`,enableSystem:!0,disableTransitionOnChange:!0,storageKey:`ok-theme-v1`,children:[(0,Z.jsx)(Ti,{children:RJ&&window.okDesktop?(0,Z.jsx)(uu,{bridge:window.okDesktop}):(0,Z.jsx)(FJ,{})}),(0,Z.jsx)(mu,{richColors:!0,closeButton:!0})]})})}));
|