@inkeep/open-knowledge 0.46.0-beta.24 → 0.46.0-beta.26
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/{acp-harness-probe-CNr_uL76.mjs → acp-harness-probe-CWSgVEXp.mjs} +2 -2
- package/dist/cli.mjs +7 -7
- package/dist/constants-DVpRelLO.mjs +2 -0
- package/dist/index.mjs +1 -1
- package/dist/init-BmRhHNNm.mjs +1 -0
- package/dist/{init-BJIgDJa3.mjs → init-Cp1cLnZk.mjs} +3 -3
- package/dist/{launch-json-removal-CJgXyPl3.mjs → launch-json-removal-DUge6f_e.mjs} +2 -2
- package/dist/loader-Bh_ZTHZc.mjs +1 -0
- package/dist/{loader-BVADW1fG.mjs → loader-CQZle2jn.mjs} +2 -2
- package/dist/{open-browser-DlO-Gsw_.mjs → open-browser-BGVZscyy.mjs} +2 -2
- package/dist/{preview-BwdVoUBB.mjs → preview-CVEIuiZH.mjs} +2 -2
- package/dist/preview-Cxdw_wal.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-DQJfhFeQ.js → ActivityModeContent-CZsut2kK.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-D9VDqMCh.js → AgentDiffPane-Glfn8BNa.js} +2 -2
- package/dist/public/assets/{AgentThreadClientBinder-D_oR-NzN.js → AgentThreadClientBinder-5Q_2wmdQ.js} +1 -1
- package/dist/public/assets/{BugReportHistory-DJY_ATlh.js → BugReportHistory-BV64CLFc.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-_HgchijV.js → BugReportHistoryDialog-CU6gVHpy.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-bIQSwxNT.js → ChangedOutsideBadge-D3NWhSWI.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-C21yk3-k.js → CodeMirrorPropInput-yJZmvoN3.js} +3 -3
- package/dist/public/assets/{ConsentDialogBody-C9wS0j09.js → ConsentDialogBody-BNMDXCOp.js} +1 -1
- package/dist/public/assets/{DiffView-DuPfWTAC.js → DiffView-ChmPu7VO.js} +1 -1
- package/dist/public/assets/{DocumentContext-Bhb-Rllg.js → DocumentContext-BYAIHlLG.js} +2 -2
- package/dist/public/assets/{EditorModeToggle-DYt4xV0B.js → EditorModeToggle-CHPv1W1o.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-D7Jzb7yA.js → EnableSyncConfirmDialog-B_PT2E6k.js} +1 -1
- package/dist/public/assets/FeedbackForm-CXjxL9--.js +1 -0
- package/dist/public/assets/{GraphPanel-BK4oU7K8.js → GraphPanel-BkBbXSSY.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-DT373DMA.js → ImportSkillDialog-BmK5Zi4Y.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-CKLpAwfC.js → LintConfigEditor-wjND6OMW.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-Cv2PfiCt.js +1 -0
- package/dist/public/assets/ManagedArtifactProperties-DX6VEhcK.js +8 -0
- package/dist/public/assets/{McpConsentDialogBody-BICQmO-R.js → McpConsentDialogBody-GFZy2Nx1.js} +1 -1
- package/dist/public/assets/{Mermaid-Ba_Bj7D1.js → Mermaid-aTkc_U2P.js} +2 -2
- package/dist/public/assets/{MermaidDocEditor-CwRVCqx7.js → MermaidDocEditor-ClsHMr-h.js} +1 -1
- package/dist/public/assets/{RegisteredAgentIcon-UInuA1Ei.js → RegisteredAgentIcon-CKpJ_hgB.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-COTMJPnc.js → ReportBugDialogBody-Blgf8Ql8.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-bkLxSHte.js → SchemaConfigEditor-CYPVCRe9.js} +1 -1
- package/dist/public/assets/{SessionsHost-Bw4MKgvL.js → SessionsHost-DfHGA3JK.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-DYh6a8hI.js → SettingsDialogBody-DKXJqt7T.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-BrnApKc6.js → ShareBranchSwitchDialog-VEk7nqm9.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-iTAeKpJM.js → ShareReceiveDialog-CohqkEQn.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-D4JlxFnU.js → ShareReceiveMissDialog-Dm_HJ-fk.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-B4YWkWzW.js → SkillEditBanner-Bb-ORdb8.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-Uo33TCpC.js → SkillOriginInline-BFexlLco.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-DjI3RNFS.js → SkillToolbarControls-B-dV8j9p.js} +1 -1
- package/dist/public/assets/{SourceEditor-BZSPCXoy.js → SourceEditor-CgLBpfga.js} +1 -1
- package/dist/public/assets/{TerminalPanel-CVHJq4Iu.js → TerminalPanel-DSHFfNWo.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-BITwxu5N.js → TerminalWindowApp-B3Nw6A9a.js} +1 -1
- package/dist/public/assets/{TextDocEditor-7FzBwfzQ.js → TextDocEditor-DzmAdiZe.js} +1 -1
- package/dist/public/assets/ThreadView-Di5TkV_e.js +6 -0
- package/dist/public/assets/{TimelineDiffPane-Cvmtozih.js → TimelineDiffPane-N5K-0E_Q.js} +2 -2
- package/dist/public/assets/{abnfDiagram-VRR7QNED-BR4MFhNI.js → abnfDiagram-VRR7QNED-DHJtI87X.js} +1 -1
- package/dist/public/assets/{agent-diff-store-CC8aPVHS.js → agent-diff-store-kv64r9C1.js} +1 -1
- package/dist/public/assets/{agent-visibility-XcypjuYX.js → agent-visibility-BiwwzWZK.js} +1 -1
- package/dist/public/assets/{arc-BLA1oiJE.js → arc-CcVRsw3e.js} +1 -1
- package/dist/public/assets/architecture-TIHT7OUA-B22-UzyM.js +1 -0
- package/dist/public/assets/{architectureDiagram-ZJ3FMSHR-BrnPZKqe.js → architectureDiagram-ZJ3FMSHR-CiwaxO5n.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DZEPs4Pt.js → auth-state-cache-CDJruLs7.js} +1 -1
- package/dist/public/assets/{blockDiagram-677ZJIJ3-CQbm0LEu.js → blockDiagram-677ZJIJ3-0zO7n7Sf.js} +1 -1
- package/dist/public/assets/{c4Diagram-LMCZKHZV-D4Y9FZQ4.js → c4Diagram-LMCZKHZV-C662qesx.js} +1 -1
- package/dist/public/assets/{calendar-C__xvB0F.js → calendar-T2ubnd-H.js} +1 -1
- package/dist/public/assets/channel-DfI0YSva.js +1 -0
- package/dist/public/assets/{checkbox-Cq1BnJ3x.js → checkbox-CgM6fL3A.js} +1 -1
- package/dist/public/assets/chunk-2Q5K7J3B-BSFIGC1j.js +1 -0
- package/dist/public/assets/{chunk-32BRIVSS-Nd1XGYMr.js → chunk-32BRIVSS-CydyM0Ml.js} +1 -1
- package/dist/public/assets/{chunk-52WLFC77-DngEZdpt.js → chunk-52WLFC77-cG-DvO_j.js} +1 -1
- package/dist/public/assets/{chunk-5FCAYU7R-CVOgng3o.js → chunk-5FCAYU7R-Bxw_oikr.js} +1 -1
- package/dist/public/assets/{chunk-5HE753X5-CD6gRM54.js → chunk-5HE753X5-DKXmxfLW.js} +1 -1
- package/dist/public/assets/{chunk-5JV3BV7I-C7ouju6I.js → chunk-5JV3BV7I-DvmJcvTR.js} +1 -1
- package/dist/public/assets/{chunk-5TONJI2A-BKisaZuR.js → chunk-5TONJI2A-DzotvxWN.js} +1 -1
- package/dist/public/assets/{chunk-5VM5RSS4-DldpLG4q.js → chunk-5VM5RSS4-BhXaeUUw.js} +1 -1
- package/dist/public/assets/{chunk-7BUUIJ7U-B8p2bGIc.js → chunk-7BUUIJ7U-nkQ2KUUq.js} +1 -1
- package/dist/public/assets/{chunk-BIQX33UG-B-IlaACl.js → chunk-BIQX33UG-dgZifYB8.js} +1 -1
- package/dist/public/assets/{chunk-BO2N2NFS-BmPFIuzT.js → chunk-BO2N2NFS-BgpjQQXT.js} +3 -3
- package/dist/public/assets/{chunk-C7G6YPKG-CTPk4N9r.js → chunk-C7G6YPKG-DeJ7KSfD.js} +1 -1
- package/dist/public/assets/{chunk-CQNSW5MT-BoHYZDmN.js → chunk-CQNSW5MT-WJU8lHxD.js} +1 -1
- package/dist/public/assets/{chunk-CYSBUYHQ-BtnyZlJv.js → chunk-CYSBUYHQ-5BxfdOgL.js} +1 -1
- package/dist/public/assets/{chunk-EMLP6XTP-D_CFM3mi.js → chunk-EMLP6XTP-mSjYkSCS.js} +1 -1
- package/dist/public/assets/{chunk-EX3LRPZG-9kHpIDAY.js → chunk-EX3LRPZG-BNd6Cxwo.js} +1 -1
- package/dist/public/assets/{chunk-FWX5IMBZ-A1C9veGN.js → chunk-FWX5IMBZ-CXQqiinv.js} +2 -2
- package/dist/public/assets/{chunk-HOUHSVGY-D2OO7RX0.js → chunk-HOUHSVGY-FQeseOdw.js} +1 -1
- package/dist/public/assets/{chunk-ICXQ74PX-CINPzArE.js → chunk-ICXQ74PX-QBz75RJe.js} +1 -1
- package/dist/public/assets/{chunk-JG7HCLWE-jpq6rFyK.js → chunk-JG7HCLWE-ClAPLVoN.js} +1 -1
- package/dist/public/assets/{chunk-JWPE2WC7-BUo8MoXj.js → chunk-JWPE2WC7-D00QuO4l.js} +1 -1
- package/dist/public/assets/{chunk-MOJQB5TN-INvVDa7M.js → chunk-MOJQB5TN-BHolK4Fc.js} +1 -1
- package/dist/public/assets/{chunk-MOZMSUNE-bwYn0Kww.js → chunk-MOZMSUNE-B2zrwpvW.js} +1 -1
- package/dist/public/assets/{chunk-OGEWGWER-Di8f25Zt.js → chunk-OGEWGWER-D9rNoxcC.js} +1 -1
- package/dist/public/assets/{chunk-OSBZ3O6U-CUc7n3PO.js → chunk-OSBZ3O6U-pMDQqwwa.js} +1 -1
- package/dist/public/assets/{chunk-PUDLZKDR-C9YcryH0.js → chunk-PUDLZKDR-zvmgn7x_.js} +1 -1
- package/dist/public/assets/{chunk-Q4XR5HBZ-DuA-1W6g.js → chunk-Q4XR5HBZ-FwXZQ9hY.js} +1 -1
- package/dist/public/assets/{chunk-QBLGF6JB-DOtavLb0.js → chunk-QBLGF6JB-gQMNwA9k.js} +1 -1
- package/dist/public/assets/{chunk-R7FJI6CG-CWhtEDe1.js → chunk-R7FJI6CG-4qEQ9dBZ.js} +1 -1
- package/dist/public/assets/{chunk-RYQCIY6F-D8KQw2wV.js → chunk-RYQCIY6F-BV0ikdQB.js} +1 -1
- package/dist/public/assets/{chunk-U6XO7XAA-CMfN73K7.js → chunk-U6XO7XAA-CaNmcaAV.js} +1 -1
- package/dist/public/assets/{chunk-V7JOEXUC-868ygkS5.js → chunk-V7JOEXUC-CsJjje8x.js} +1 -1
- package/dist/public/assets/chunk-VAUOI2AC-B_byVmRb.js +1 -0
- package/dist/public/assets/{chunk-VR4S4FIN-BZrd9pWi.js → chunk-VR4S4FIN-bcHVGPIL.js} +1 -1
- package/dist/public/assets/{chunk-WYO6CB5R-T4JOF4Cu.js → chunk-WYO6CB5R-BMZjhy31.js} +1 -1
- package/dist/public/assets/chunk-XXDRQBXY-BW_2kVvu.js +1 -0
- package/dist/public/assets/{chunk-YOTPTUD7-DzE2J0ru.js → chunk-YOTPTUD7-NNZ-Yv3s.js} +1 -1
- package/dist/public/assets/{chunk-ZGVPDNZ5-BtaLh1Pm.js → chunk-ZGVPDNZ5-DN7h9evR.js} +1 -1
- package/dist/public/assets/{chunk-ZIRB5QZD-DTzEX6O5.js → chunk-ZIRB5QZD-BUzL4gtl.js} +1 -1
- package/dist/public/assets/classDiagram-OUVF2IWQ-D-ugBPkQ.js +1 -0
- package/dist/public/assets/classDiagram-v2-EOCWNBFH-Bn6YRP9I.js +1 -0
- package/dist/public/assets/{cm-theme-BIKMj2KE.js → cm-theme-D_cRdFJy.js} +1 -1
- package/dist/public/assets/{config-provider-COjQaZZa.js → config-provider-CH2tG_0H.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-Dfdgm0c_.js → cose-bilkent-JH36ORCC-C3tuxXMJ.js} +1 -1
- package/dist/public/assets/cynefin-VYW2F7L2-g7Kr3o9e.js +1 -0
- package/dist/public/assets/{cynefinDiagram-TSTJHNR4-DRyLma_-.js → cynefinDiagram-TSTJHNR4-gF8dJ8RL.js} +1 -1
- package/dist/public/assets/{dagre-Bx2kZZfx.js → dagre-DqpVUR-3.js} +1 -1
- package/dist/public/assets/{dagre-VKFMJZFB-CWRpaHfL.js → dagre-VKFMJZFB-Bdh7Hq5O.js} +1 -1
- package/dist/public/assets/{diagram-FQU43EPY-BWhEolBl.js → diagram-FQU43EPY-BZ8uLueR.js} +1 -1
- package/dist/public/assets/{diagram-G47NLZAW-CtrwOhAm.js → diagram-G47NLZAW-QyYub_Y-.js} +1 -1
- package/dist/public/assets/{diagram-NH7WQ7WH-Bwg0orbY.js → diagram-NH7WQ7WH-BZmKErWp.js} +1 -1
- package/dist/public/assets/{diagram-OA4YK3LP-sK_x_R3w.js → diagram-OA4YK3LP-X4I0Ny_1.js} +1 -1
- package/dist/public/assets/{diagram-WEI45ONY-BGLea-AN.js → diagram-WEI45ONY-Dvn-EcwS.js} +1 -1
- package/dist/public/assets/{dialog-BRwYcDyc.js → dialog-C1XaLkpS.js} +1 -1
- package/dist/public/assets/{dist-DZQQflzj.js → dist-4KAJEfHq.js} +1 -1
- package/dist/public/assets/{dist-cmNR9Bbs.js → dist-9KHzlPis.js} +1 -1
- package/dist/public/assets/{dist-Cka1ipRf.js → dist-B6SsWR_R.js} +1 -1
- package/dist/public/assets/{dist-D14X-mK2.js → dist-BXU3IB1z.js} +1 -1
- package/dist/public/assets/{dist-B42mX0YC.js → dist-BawYG08a.js} +1 -1
- package/dist/public/assets/{dist-ChpE673Q.js → dist-BgGuqEY3.js} +1 -1
- package/dist/public/assets/{dist-B4xkxNpz.js → dist-BhBnufkS.js} +1 -1
- package/dist/public/assets/{dist-gVPIADKn2.js → dist-BqxgYl4M2.js} +1 -1
- package/dist/public/assets/{dist-Dp7TiZ5u2.js → dist-CqpwzCMe2.js} +1 -1
- package/dist/public/assets/{dist-DsE9X3Yz.js → dist-DhrsAcRJ.js} +1 -1
- package/dist/public/assets/{dist-2Zg1mqwY.js → dist-DmGGmoBk.js} +1 -1
- package/dist/public/assets/{dist-DjACJACU.js → dist-Dtdr1fU5.js} +1 -1
- package/dist/public/assets/{dist-BOFmnwXG.js → dist-Dum8FOZE.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-CCIWWBDH-LwDvRqCc.js → ebnfDiagram-CCIWWBDH-Bee-0Vsa.js} +1 -1
- package/dist/public/assets/{erDiagram-Q63AITRT-ZtP-do8Y.js → erDiagram-Q63AITRT-DxkcAaEh.js} +1 -1
- package/dist/public/assets/eventmodeling-45OFAUF4-DdR7ha8I.js +1 -0
- package/dist/public/assets/{file-tree-adapter-DESJhWoq.js → file-tree-adapter-CSa3dhgi.js} +1 -1
- package/dist/public/assets/flowDiagram-23GEKE2U-BAuyQn3U.js +1 -0
- package/dist/public/assets/{folder-config-api-DNrN753j.js → folder-config-api-DzuTtGJJ.js} +1 -1
- package/dist/public/assets/{ganttDiagram-NO4QXBWP-toql98c1.js → ganttDiagram-NO4QXBWP-CfKrR8t0.js} +1 -1
- package/dist/public/assets/gitGraph-TEB2WS4Q-B9_Hbzw_.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-IHSO6WYX-D7D6x-Xl.js → gitGraphDiagram-IHSO6WYX-l_eG9uKD.js} +1 -1
- package/dist/public/assets/{globals-BGbHjQJ2.js → globals-CLapcd3A.js} +2 -2
- package/dist/public/assets/{graphlib-BIjbwrWA.js → graphlib-2mbBufU8.js} +1 -1
- package/dist/public/assets/{highlighted-body-OFNGDK62-Ckmp4Uen.js → highlighted-body-OFNGDK62-BIipOt-U.js} +1 -1
- package/dist/public/assets/{index-DEksXdTO.js → index-Cp_NinKw.js} +13 -13
- package/dist/public/assets/info-DKCQHKI2-BQeDe2mR.js +1 -0
- package/dist/public/assets/{infoDiagram-FWYZ7A6U-D-w6lLUB.js → infoDiagram-FWYZ7A6U-DgvJ7Awn.js} +1 -1
- package/dist/public/assets/{input-group-Dw-FNINK.js → input-group-BrCQUQTG.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-FXEZZL3T-DiMtCb6J.js → ishikawaDiagram-FXEZZL3T-DQ4Gskk4.js} +1 -1
- package/dist/public/assets/{journeyDiagram-5HDEW3XC-BBd5InQB.js → journeyDiagram-5HDEW3XC-DPs0RcwQ.js} +1 -1
- package/dist/public/assets/{kanban-definition-HUTT4EX6-CA41_RYU.js → kanban-definition-HUTT4EX6-Ck2HSfan.js} +1 -1
- package/dist/public/assets/{line-DE139-H6.js → line-DWKLErsv.js} +1 -1
- package/dist/public/assets/{linear-HAqJanW2.js → linear-dbIThZWJ.js} +1 -1
- package/dist/public/assets/{map-CUyVBcsz.js → map-DCuMc749.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-DrFQPMJg.js → markdownlint-rule-browser-zRyV_kJO.js} +1 -1
- package/dist/public/assets/mermaid-GHXKKRXX-DE1vq5OK.js +1 -0
- package/dist/public/assets/{mermaid-parser.core-CAIoUhyF.js → mermaid-parser.core-B2uYfibA.js} +2 -2
- package/dist/public/assets/{mermaid.core-B8bL0otS.js → mermaid.core-BUTR3k00.js} +3 -3
- package/dist/public/assets/{mindmap-definition-LN4V7U3C-BG4thSqa.js → mindmap-definition-LN4V7U3C-CjuwnrRK.js} +1 -1
- package/dist/public/assets/{navigation-targets-0wZAeKrc.js → navigation-targets-CIvGC6UT.js} +1 -1
- package/dist/public/assets/{now-DrceMm81.js → now-D9M3Ys6o.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-BVeI_6BU.js → open-managed-artifact-tab-DvNiFkHO.js} +1 -1
- package/dist/public/assets/{ordinal-DOdOZcEj.js → ordinal-DdrNAXbu.js} +1 -1
- package/dist/public/assets/packet-7NZHBO7P-BW9abikZ.js +1 -0
- package/dist/public/assets/{pegDiagram-2B236MQR-LXeKNT9p.js → pegDiagram-2B236MQR-BbkSvB2I.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-iHnQtDVG.js → pending-receive-nav-store-DR1sAKXJ.js} +1 -1
- package/dist/public/assets/pie-RZYD4A2V-D86NaVqt.js +1 -0
- package/dist/public/assets/{pieDiagram-ENE6RG2P-CP834p3L.js → pieDiagram-ENE6RG2P-mC03ntFr.js} +1 -1
- package/dist/public/assets/{project-paths-DZoifJi3.js → project-paths-Cic76qJK.js} +1 -1
- package/dist/public/assets/{prop-types-CHOFqrri.js → prop-types-lRaJp2DY.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-ABIIQ3AL-CRH-DZR6.js → quadrantDiagram-ABIIQ3AL-C5Wf9EzX.js} +1 -1
- package/dist/public/assets/radar-I7S5WNFK-DQAd0dLq.js +1 -0
- package/dist/public/assets/railroad-3IZDKUUU-BpjxCYYP.js +1 -0
- package/dist/public/assets/railroad-abnf-AHOZXSZD-BVzINhcN.js +1 -0
- package/dist/public/assets/railroad-ebnf-EBAXGLYW-FAz3aWnD.js +1 -0
- package/dist/public/assets/railroad-peg-LSFZ7HO6-Smtu6BYl.js +1 -0
- package/dist/public/assets/{railroadDiagram-RFXS5EU6-B0y7CNEU.js → railroadDiagram-RFXS5EU6-D5k_b8X2.js} +1 -1
- package/dist/public/assets/{requirementDiagram-TGXJPOKE-CDOzFe2o.js → requirementDiagram-TGXJPOKE-sZXA_y1K.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-HTMAVEWB-8LYEe9RT.js → sankeyDiagram-HTMAVEWB-VaejSuXD.js} +1 -1
- package/dist/public/assets/{schema-fields-view-intent-DQNqHHeG.js → schema-fields-view-intent-TJtc4k-6.js} +1 -1
- package/dist/public/assets/{selection-context-CtO8dzXv.js → selection-context-BXUHt52S.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-DBY2YBRQ-DTI3lfyS.js → sequenceDiagram-DBY2YBRQ-nCH-USjy.js} +1 -1
- package/dist/public/assets/{sizeCapture-X5ZJPWSS-CdOK33Lp.js → sizeCapture-X5ZJPWSS-CyNe-U3Z.js} +1 -1
- package/dist/public/assets/{skill-actions-CKsFVZ7s.js → skill-actions-Dba4au8l.js} +1 -1
- package/dist/public/assets/{skills-api-YMCgcUab.js → skills-api-DF632dit.js} +1 -1
- package/dist/public/assets/{src-CprZUkQE.js → src-DFZupjZD.js} +1 -1
- package/dist/public/assets/{src-DKNcDpsX.js → src-HQ9jN5TM.js} +1 -1
- package/dist/public/assets/{stateDiagram-2N3HPSRC-Be5NtYCp.js → stateDiagram-2N3HPSRC-uY9Mif8t.js} +1 -1
- package/dist/public/assets/stateDiagram-v2-6OUMAXLB-BdS5vmc7.js +1 -0
- package/dist/public/assets/{swimlanes-5IMT3BWC-Cyw1mKbC.js → swimlanes-5IMT3BWC-cGipHfZ5.js} +2 -2
- package/dist/public/assets/swimlanesDiagram-G3AALYLV-Do_H-wCL.js +8 -0
- package/dist/public/assets/{tag-pill-input-BR-zZRy9.js → tag-pill-input-dMdZz7rQ.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-CTSKR5SK.js → target-navigation-intent-DJIHeKVE.js} +1 -1
- package/dist/public/assets/{telemetry-impl-BJK36lQF.js → telemetry-impl-wB4jlPUB.js} +2 -2
- package/dist/public/assets/{telemetry-startup-D8rFEM2d.js → telemetry-startup-VOUFAT7a.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-D7klM-xS.js → terminal-launch-events-DLrJMi-n.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-JwJxpal6.js → terminal-telemetry-tRSeGdHR.js} +1 -1
- package/dist/public/assets/{text-viewer-languages-BLSME92j.js → text-viewer-languages-fF8VNtRc.js} +2 -2
- package/dist/public/assets/{thread-client-DTPNoVs3.js → thread-client-CJRnPjEz.js} +1 -1
- package/dist/public/assets/{timeline-definition-FHXFAJF6-BlFXUexj.js → timeline-definition-FHXFAJF6-BaWSHiEf.js} +1 -1
- package/dist/public/assets/treeView-QDETBFTQ-BgORrhQ0.js +1 -0
- package/dist/public/assets/treemap-6X3UGDF4-Zr5ZEdj0.js +1 -0
- package/dist/public/assets/{typing-burst-detector-X0S33jis.js → typing-burst-detector-CC7bIjEV.js} +1 -1
- package/dist/public/assets/{uninstall-CgrheMqc.js → uninstall-CC6Bx6G7.js} +1 -1
- package/dist/public/assets/{use-activity-panel-BZ9nGQPH.js → use-activity-panel-D9D0qVT-.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-on3ebtaK.js → use-live-xterm-theme-CRmcqypM.js} +1 -1
- package/dist/public/assets/{use-open-skill-CI0ilwyX.js → use-open-skill-7MNEmyfe.js} +1 -1
- package/dist/public/assets/{use-skill-directory-BVbrNJTi.js → use-skill-directory-ByVFCtzx.js} +1 -1
- package/dist/public/assets/{use-skill-origin-CEQwPxVb.js → use-skill-origin-CiWSd5Bp.js} +1 -1
- package/dist/public/assets/{use-skills-DdHlTORK.js → use-skills-CjgBfNqJ.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-DVN1muEr.js → use-terminal-enabled-6lUTjD1J.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-Be73Nm0G.js → use-timeline-entry-diff-TOhNAiEO.js} +1 -1
- package/dist/public/assets/{vennDiagram-L72KCM5P-CbMxlzwT.js → vennDiagram-L72KCM5P-boRPAxOy.js} +1 -1
- package/dist/public/assets/wardley-OPB4EBWU-WeTAUrVk.js +1 -0
- package/dist/public/assets/{wardleyDiagram-EHGQE667-CVZ_1-Ob.js → wardleyDiagram-EHGQE667-vi90NC-5.js} +1 -1
- package/dist/public/assets/{xychartDiagram-FW5EYKEG-CiobWJYX.js → xychartDiagram-FW5EYKEG-Ckph0Tnv.js} +1 -1
- package/dist/public/index.html +101 -102
- package/dist/public/uninstall.html +8 -8
- package/dist/{repair-launch-json-kJ-N16X6.mjs → repair-launch-json-BLsGi3mb.mjs} +2 -2
- package/dist/{repair-mcp-configs-cRf1KHN2.mjs → repair-mcp-configs-BBKSodto.mjs} +2 -2
- package/dist/{repair-skills-CAgJh50Q.mjs → repair-skills-Bdq3MhBx.mjs} +2 -2
- package/dist/repair-skills-DzOXy3tC.mjs +1 -0
- package/dist/{src-K60Nfy_1.mjs → src-B3Ey-N80.mjs} +2 -2
- package/dist/{src-6SIlUA0g.mjs → src-BJlGFyAy.mjs} +1 -1
- package/dist/{src-DlAv53T2.mjs → src-CFTJ6mgL.mjs} +220 -220
- package/dist/start-9wytEH8K.mjs +1 -0
- package/dist/{start-fAsaQwEs.mjs → start-CKOa3i5A.mjs} +3 -3
- package/dist/{write-project-skill-Bn1Fo5lw.mjs → write-project-skill-KxnphNDZ.mjs} +2 -2
- package/package.json +4 -4
- package/dist/constants-Bi35H8-Y.mjs +0 -2
- package/dist/init-BHEUjCX8.mjs +0 -1
- package/dist/loader-DIKghq91.mjs +0 -1
- package/dist/preview-CRUQ2pHj.mjs +0 -1
- package/dist/public/assets/FeedbackForm-D46RvfHP.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-BijATHK9.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-CTw29aB4.js +0 -2
- package/dist/public/assets/ThreadView-1kpA4rse.js +0 -6
- package/dist/public/assets/architecture-TIHT7OUA-4xbw6BHT.js +0 -1
- package/dist/public/assets/channel-CEdybrh9.js +0 -1
- package/dist/public/assets/chunk-2Q5K7J3B-CTVQtWlX.js +0 -1
- package/dist/public/assets/chunk-VAUOI2AC-BPnCZl88.js +0 -1
- package/dist/public/assets/chunk-XXDRQBXY-AFNsmOQr.js +0 -1
- package/dist/public/assets/classDiagram-OUVF2IWQ-DJJ_lD6S.js +0 -1
- package/dist/public/assets/classDiagram-v2-EOCWNBFH-DU_c9B2S.js +0 -1
- package/dist/public/assets/comment-chips-tOHcZ7p1.js +0 -7
- package/dist/public/assets/cynefin-VYW2F7L2-PIqjqGI8.js +0 -1
- package/dist/public/assets/eventmodeling-45OFAUF4-BXfoXwmF.js +0 -1
- package/dist/public/assets/flowDiagram-23GEKE2U-FFa51yc6.js +0 -1
- package/dist/public/assets/gitGraph-TEB2WS4Q-CO_Nyook.js +0 -1
- package/dist/public/assets/info-DKCQHKI2-Qu4WNhHa.js +0 -1
- package/dist/public/assets/mermaid-GHXKKRXX-C0TBTYbW.js +0 -1
- package/dist/public/assets/packet-7NZHBO7P-DYoxmend.js +0 -1
- package/dist/public/assets/pie-RZYD4A2V-C5oywqmk.js +0 -1
- package/dist/public/assets/radar-I7S5WNFK-adGffv9k.js +0 -1
- package/dist/public/assets/railroad-3IZDKUUU-D4AY10Mc.js +0 -1
- package/dist/public/assets/railroad-abnf-AHOZXSZD-CSShZExy.js +0 -1
- package/dist/public/assets/railroad-ebnf-EBAXGLYW-Dl_rhwOm.js +0 -1
- package/dist/public/assets/railroad-peg-LSFZ7HO6-B2JvE7nW.js +0 -1
- package/dist/public/assets/stateDiagram-v2-6OUMAXLB-B6a4uvcW.js +0 -1
- package/dist/public/assets/swimlanesDiagram-G3AALYLV-D3egjuKf.js +0 -8
- package/dist/public/assets/treeView-QDETBFTQ-qMpkjbKi.js +0 -1
- package/dist/public/assets/treemap-6X3UGDF4-BW1Uc-Dj.js +0 -1
- package/dist/public/assets/wardley-OPB4EBWU-BBZU6-hF.js +0 -1
- package/dist/repair-skills-CXwfQm8m.mjs +0 -1
- package/dist/start-ak4kOBNH.mjs +0 -1
- /package/dist/public/assets/{ActivityPanelDiffView-BXFg3amj.js → ActivityPanelDiffView-DzcGG-3T.js} +0 -0
- /package/dist/public/assets/{AppMenubar-Cub3r1zs.js → AppMenubar-rFZzqUIz.js} +0 -0
- /package/dist/public/assets/{ConfigSharingInfoTooltip-OJruUI3H.js → ConfigSharingInfoTooltip-TcS6sVpd.js} +0 -0
- /package/dist/public/assets/{SkillModeBanner-BPmqGiVe.js → SkillModeBanner-BGvDA8_3.js} +0 -0
- /package/dist/public/assets/{__vite-browser-external-CVGzy5OC.js → __vite-browser-external-DRftbq1J.js} +0 -0
- /package/dist/public/assets/{agent-presence-Dn2bQ2Pn.js → agent-presence-DspgbUIJ.js} +0 -0
- /package/dist/public/assets/{array-CxykTcx8.js → array-BlR6RSqS.js} +0 -0
- /package/dist/public/assets/{auth-prompt-store-2KB0Hew5.js → auth-prompt-store-C7w8BqXG.js} +0 -0
- /package/dist/public/assets/{badge-DwfQ2IQa.js → badge-BTPyRUGW.js} +0 -0
- /package/dist/public/assets/{chunk-KEIR6QF5-DQW1nIEN.js → chunk-KEIR6QF5-Cvu_RfZc.js} +0 -0
- /package/dist/public/assets/{chunk-Y2CYZVJY-Dp_m2dHs.js → chunk-Y2CYZVJY-BavonG01.js} +0 -0
- /package/dist/public/assets/{client-version-DL1elh-R.js → client-version-DD_4w0Q_.js} +0 -0
- /package/dist/public/assets/{clike-D2Qtyj0W.js → clike-BTKURkAr.js} +0 -0
- /package/dist/public/assets/{clipboard-adapter-Brbch5VX.js → clipboard-adapter-DdkYoUY3.js} +0 -0
- /package/dist/public/assets/{colors-DxV0gzKw.js → colors-DThYSuj1.js} +0 -0
- /package/dist/public/assets/{config-context-CVWonKyE.js → config-context-7il4AXHf.js} +0 -0
- /package/dist/public/assets/{copilot-_tsUyzgD.js → copilot-CYbxld_I.js} +0 -0
- /package/dist/public/assets/{cursor-D_UKSHL6.js → cursor-CVuYJhcM.js} +0 -0
- /package/dist/public/assets/{cytoscape.esm-Yabh0yK_.js → cytoscape.esm-CcKBPOPz.js} +0 -0
- /package/dist/public/assets/{defaultLocale-BwEiHuJD.js → defaultLocale-Bj1aksfd.js} +0 -0
- /package/dist/public/assets/{desktop-bridge-types-cNTLS5xb.js → desktop-bridge-types-ByIs2Wy8.js} +0 -0
- /package/dist/public/assets/{diff-Dke_3Gcp.js → diff-CC9Zbhye.js} +0 -0
- /package/dist/public/assets/{dist-yoZDDKeY.js → dist-BKO-SihH.js} +0 -0
- /package/dist/public/assets/{dist-CPBLOoKm.js → dist-CublDHOR.js} +0 -0
- /package/dist/public/assets/{dist-D6euTqbb.js → dist-D1YpGD7x.js} +0 -0
- /package/dist/public/assets/{dist-BNVxnBBw.js → dist-Dr52ya0i.js} +0 -0
- /package/dist/public/assets/{dist-CJ0cwmiC.js → dist-pl6OT5yc.js} +0 -0
- /package/dist/public/assets/{doc-paths-CQTfUOZw.js → doc-paths-D9TaK83y.js} +0 -0
- /package/dist/public/assets/{documents-events-BwmrmAGX.js → documents-events-Bz6CFw_P.js} +0 -0
- /package/dist/public/assets/{documents-fetch-D4kwvrzo.js → documents-fetch-Ks0Eoaj3.js} +0 -0
- /package/dist/public/assets/{external-link-CKZFgCFq.js → external-link-CIs3ZL0b.js} +0 -0
- /package/dist/public/assets/{field-mSLytCEk.js → field-Cq66GDVw.js} +0 -0
- /package/dist/public/assets/{file-tree-rename-validation-BH8L3cc3.js → file-tree-rename-validation-D3F7wC1T.js} +0 -0
- /package/dist/public/assets/{file-tree-utils-BG34yBvw.js → file-tree-utils-DNgYWWaG.js} +0 -0
- /package/dist/public/assets/{follow-file-B9VBGXDD.js → follow-file-DbGZjgvx.js} +0 -0
- /package/dist/public/assets/{form-CDklsKOD.js → form-DipRd6xO.js} +0 -0
- /package/dist/public/assets/{format-DAPkd5Gj.js → format-B72MB8qy.js} +0 -0
- /package/dist/public/assets/{go-CcjpRIwm.js → go-BOoSlAXr.js} +0 -0
- /package/dist/public/assets/{init-c3-Nu4HJ.js → init-tTyHApSS.js} +0 -0
- /package/dist/public/assets/{input-DcoGZoTQ.js → input-CdGQDWjM.js} +0 -0
- /package/dist/public/assets/{isObject-cN229uXS.js → isObject-CS6pZNNk.js} +0 -0
- /package/dist/public/assets/{libesm-DXt8eMZu.js → libesm-COuF-Ycc.js} +0 -0
- /package/dist/public/assets/{lint-config-client-Bg_dSPOM.js → lint-config-client-C5EEYoJ7.js} +0 -0
- /package/dist/public/assets/{lint-plugin-meta-BxfSlkph.js → lint-plugin-meta-7A6ZrPoH.js} +0 -0
- /package/dist/public/assets/{lru-string-cache-Dvzy2WTu.js → lru-string-cache-DXyh0UqD.js} +0 -0
- /package/dist/public/assets/{lua-DxmBbMX2.js → lua-Dxo01oIG.js} +0 -0
- /package/dist/public/assets/{mcp-consent-store-BcrhbRwc.js → mcp-consent-store-BivjPpLe.js} +0 -0
- /package/dist/public/assets/{min-BZE3RIbd.js → min-B52VabRz.js} +0 -0
- /package/dist/public/assets/{minus-dDmjPbo4.js → minus-BqVmr9UG.js} +0 -0
- /package/dist/public/assets/{overlay-layers-DGwgwjHg.js → overlay-layers-gL_2dQqz.js} +0 -0
- /package/dist/public/assets/{panel-Bjv8raTx.js → panel-Boo96yEj.js} +0 -0
- /package/dist/public/assets/{panel-right-open-EPKoGQBE.js → panel-right-open-mOxBnqyo.js} +0 -0
- /package/dist/public/assets/{panzoom.es-BG-eqGqR.js → panzoom.es-JQqfaE6_.js} +0 -0
- /package/dist/public/assets/{paperclip-DSaV3jTp.js → paperclip-mdBEQ0WS.js} +0 -0
- /package/dist/public/assets/{parse-api-error-CGRziNbI.js → parse-api-error-9c-Rs5WJ.js} +0 -0
- /package/dist/public/assets/{path-C0vgPxDI.js → path-BTSnI4V0.js} +0 -0
- /package/dist/public/assets/{pdf-Cvbt6FaY.js → pdf-DDNlrbvd.js} +0 -0
- /package/dist/public/assets/{pdf.worker-D0hSc7ZI.js → pdf.worker-MgQT7Lb-.js} +0 -0
- /package/dist/public/assets/{perl-CTbv8SzR.js → perl-L_d0-K7D.js} +0 -0
- /package/dist/public/assets/{properties-CJVfsSwL.js → properties-B1mL7FEj.js} +0 -0
- /package/dist/public/assets/{r-DePwCFla.js → r-D1HJ6WJD.js} +0 -0
- /package/dist/public/assets/{receive-store-YZh_VQ02.js → receive-store-D_AGLfs3.js} +0 -0
- /package/dist/public/assets/{refresh-cw-DaKSQ-xL.js → refresh-cw-CsRXA9N2.js} +0 -0
- /package/dist/public/assets/{rough.esm-jZQkcmER.js → rough.esm-FREjYXwx.js} +0 -0
- /package/dist/public/assets/{ruby-CbNmqTQ7.js → ruby-BWJ7ZkjF.js} +0 -0
- /package/dist/public/assets/{share-metadata-rows-CuFlpaJB.js → share-metadata-rows-c17l05D6.js} +0 -0
- /package/dist/public/assets/{shell-PtNEZQbu.js → shell-ul8ysUs1.js} +0 -0
- /package/dist/public/assets/{skeleton-Zj40UZU5.js → skeleton-CD1oYYfF.js} +0 -0
- /package/dist/public/assets/{skill-scope-DNo7_4lO.js → skill-scope-C8db1Nmk.js} +0 -0
- /package/dist/public/assets/{sortable.esm-BuA5-2It.js → sortable.esm-Dngr9VJ1.js} +0 -0
- /package/dist/public/assets/{sql-DLytrKWQ.js → sql-BJVFbIWu.js} +0 -0
- /package/dist/public/assets/{square-pen-BETfUJNH.js → square-pen-BbETm_LZ.js} +0 -0
- /package/dist/public/assets/{src-D9TuoXKa.js → src-CIOeKeVw.js} +0 -0
- /package/dist/public/assets/{startup-marks-Bl-kvAXX.js → startup-marks-BFvG00Uu.js} +0 -0
- /package/dist/public/assets/{stex-7gT25hE_.js → stex-WCjgSIWy.js} +0 -0
- /package/dist/public/assets/{swift-BqNeJfD7.js → swift-BmJYIPlb.js} +0 -0
- /package/dist/public/assets/{textarea-Cl4IJ1LU.js → textarea-BzPGvj03.js} +0 -0
- /package/dist/public/assets/{thread-draft-staging-XfhEE_6X.js → thread-draft-staging-Df0IT4FR.js} +0 -0
- /package/dist/public/assets/{timeline-diff-store-B-Ea84Rl.js → timeline-diff-store-BYDskbwd.js} +0 -0
- /package/dist/public/assets/{toml-Cboq-aWW.js → toml-BOOm8Wvq.js} +0 -0
- /package/dist/public/assets/{trash-2-YBQNhePb.js → trash-2-4ZuuBm4P.js} +0 -0
- /package/dist/public/assets/{triangle-alert-Dk8dL1G6.js → triangle-alert-BB_1Bz59.js} +0 -0
- /package/dist/public/assets/{undo-2-1g5Fg6rD.js → undo-2-BxTugTzj.js} +0 -0
- /package/dist/public/assets/{use-collab-url-D8N5M2pl.js → use-collab-url-YV5mZB2Z.js} +0 -0
- /package/dist/public/assets/{use-installed-clis-BpdGnrVu.js → use-installed-clis-a0f5-upA.js} +0 -0
- /package/dist/public/assets/{use-settings-route-BiaOx7d8.js → use-settings-route-Cj3iyYQM.js} +0 -0
- /package/dist/public/assets/{use-workspace--dJVq1a4.js → use-workspace-DX49f8pU.js} +0 -0
- /package/dist/public/assets/{useLintConfigViewMode-DHyC74de.js → useLintConfigViewMode-15VleUG7.js} +0 -0
- /package/dist/public/assets/{wrench-86_Xzzag.js → wrench-BHZvMfZp.js} +0 -0
- /package/dist/public/assets/{x-M_y7ybHr.js → x-BL2rz544.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{n as r}from"./dist-BNVxnBBw.js";import{t as i}from"./dist-D6euTqbb.js";var a=e(t(),1),o=n(),s=`ok-acp-agent-settings-v1`;function c(e){return`${e.source}:${e.id}`}function l(){try{let e=localStorage.getItem(s);if(e===null)return{};let t=JSON.parse(e);return typeof t==`object`&&t?t:{}}catch{return{}}}function u(e){try{localStorage.setItem(s,JSON.stringify(e))}catch(e){console.warn(`[acp-settings] could not persist agent settings`,e)}}function d(e,t,n){let r=l(),i=r[e]??{};r[e]={...i,config:{...i.config,[t]:n}},u(r)}function f(e){let t=l()[e]?.config;if(typeof t!=`object`||!t)return;let n={};for(let[e,r]of Object.entries(t))(typeof r==`string`||typeof r==`boolean`)&&(n[e]=r);return Object.keys(n).length>0?n:void 0}function p(e,t){if(t===``)return;let n=l();n[e]={...n[e]??{},modeId:t},u(n)}function m(e){let t=l()[e]?.modeId;return typeof t==`string`&&t!==``?t:void 0}var h=64e3;function g(e){if(typeof e!=`object`||!e)return null;let t=e;return t.type===`text`&&typeof t.text==`string`?t.text:null}var _=class{items=[];plan=[];turnActive=!1;tokenUsage=null;terminals={};toolCallIndex=new Map;permissionIndex=new Map;permissionByToolCall=new Map;permissionsByToolCall={};messageIndex=new Map;runtimeConsentIndex=new Map;lastConsentIndex=null;appliedCount=0;dirty=!1;snapshot={items:[],plan:[],turnActive:!1,tokenUsage:null,terminals:{},permissionsByToolCall:{}};sync(e){e.length<this.appliedCount&&this.reset();for(let t=this.appliedCount;t<e.length;t++)this.applyEvent(e[t]);return this.appliedCount=e.length,this.dirty&&=(this.snapshot={items:[...this.items],plan:this.plan,turnActive:this.turnActive,tokenUsage:this.tokenUsage,terminals:{...this.terminals},permissionsByToolCall:{...this.permissionsByToolCall}},!1),this.snapshot}reset(){this.items=[],this.plan=[],this.turnActive=!1,this.tokenUsage=null,this.terminals={},this.toolCallIndex=new Map,this.permissionIndex=new Map,this.permissionByToolCall=new Map,this.permissionsByToolCall={},this.messageIndex=new Map,this.runtimeConsentIndex=new Map,this.lastConsentIndex=null,this.appliedCount=0,this.dirty=!0}applyEvent(e){switch(this.dirty=!0,e.kind){case`user_message`:this.items.push({kind:`message`,role:`user`,text:e.content,messageId:`user-${this.items.length}`}),this.messageIndex.clear();break;case`turn_started`:this.turnActive=!0;break;case`turn_ended`:this.turnActive=!1,this.messageIndex.clear();break;case`status`:if(e.status===`exited`&&(this.turnActive=!1),this.lastConsentIndex!==null){let t=this.items[this.lastConsentIndex];t?.kind===`runtime_consent`&&t.install===`running`&&(e.status===`spawning`||e.status===`ready`||e.status===`running`?this.items[this.lastConsentIndex]={...t,install:`done`}:(e.status===`error`||e.status===`exited`)&&(this.items[this.lastConsentIndex]={...t,install:`failed`}))}e.status===`error`&&e.detail?this.items.push({kind:`notice`,text:e.detail,tone:`error`}):e.status===`auth_required`&&e.detail&&this.items.push({kind:`notice`,text:e.detail,tone:`info`});break;case`permission_request`:{let t=e.toolCall.toolCallId??null,n={kind:`permission`,requestId:e.requestId,title:e.toolCall.title??`Permission required`,toolKind:e.toolCall.kind??`other`,options:e.options,resolved:null,toolCallId:t,mergedIntoToolCall:t!==null&&this.toolCallIndex.has(t)};this.permissionIndex.set(e.requestId,this.items.length),t!==null&&(this.permissionByToolCall.set(t,this.items.length),this.permissionsByToolCall[t]=n),this.items.push(n);break}case`permission_resolved`:{let t=this.permissionIndex.get(e.requestId);if(t===void 0)break;let n=this.items[t];if(n.kind!==`permission`)break;let r={...n,resolved:{optionId:e.optionId,auto:e.auto}};this.items[t]=r,r.toolCallId!==null&&(this.permissionsByToolCall[r.toolCallId]=r);break}case`runtime_consent_request`:this.runtimeConsentIndex.set(e.requestId,this.items.length),this.lastConsentIndex=this.items.length,this.items.push({kind:`runtime_consent`,requestId:e.requestId,runtime:e.runtime,displayName:e.displayName,provides:e.provides,version:e.version,approxSizeMB:e.approxSizeMB,sourceHost:e.sourceHost,agentName:e.agentName,resolved:null,install:null,progress:null});break;case`runtime_consent_resolved`:{let t=this.runtimeConsentIndex.get(e.requestId);if(t===void 0)break;let n=this.items[t];if(n.kind!==`runtime_consent`)break;this.items[t]={...n,resolved:e.decision,install:e.decision===`granted`?`running`:null};break}case`runtime_install_progress`:{if(this.lastConsentIndex===null)break;let t=this.items[this.lastConsentIndex];if(t===void 0||t.kind!==`runtime_consent`)break;this.items[this.lastConsentIndex]={...t,progress:{receivedBytes:e.receivedBytes??0,totalBytes:e.totalBytes??null}};break}case`terminal_created`:this.terminals[e.terminalId]={terminalId:e.terminalId,command:e.command,args:e.args,output:``,truncated:!1,exit:null};break;case`terminal_output`:{let t=this.terminals[e.terminalId];if(t===void 0)break;let n=t.output+e.chunk,r=t.truncated;n.length>h&&(n=n.slice(-h),r=!0),this.terminals[e.terminalId]={...t,output:n,truncated:r};break}case`terminal_exit`:{let t=this.terminals[e.terminalId];if(t===void 0)break;this.terminals[e.terminalId]={...t,exit:{exitCode:e.exitCode,signal:e.signal}};break}case`session_update`:this.applyUpdate(e.update);break;default:break}}mergePermissionInto(e){let t=this.permissionByToolCall.get(e);if(t===void 0)return;let n=this.items[t];if(n===void 0||n.kind!==`permission`||n.mergedIntoToolCall)return;let r={...n,mergedIntoToolCall:!0};this.items[t]=r,this.permissionsByToolCall[e]=r}pushMessageChunk(e,t,n){let r=`${e}:${t}`,i=this.messageIndex.get(r);if(i!==void 0&&i===this.items.length-1){let e=this.items[i];this.items[i]={...e,text:e.text+n};return}this.messageIndex.set(r,this.items.length),this.items.push({kind:`message`,role:e,text:n,messageId:t})}applyUpdate(e){switch(e.sessionUpdate){case`agent_message_chunk`:{let t=g(e.content);t!==null&&this.pushMessageChunk(`agent`,y(e),t);break}case`agent_thought_chunk`:{let t=g(e.content);t!==null&&this.pushMessageChunk(`thought`,y(e),t);break}case`user_message_chunk`:{let t=g(e.content);t!==null&&this.pushMessageChunk(`user`,y(e),t);break}case`tool_call`:{let t={kind:`tool_call`,toolCallId:e.toolCallId,title:e.title??`Tool call`,toolKind:e.kind??`other`,status:e.status??`pending`,diffs:[],terminalIds:[],content:[],locations:b(e.locations),rawInput:e.rawInput};x(t,e.content),this.toolCallIndex.set(e.toolCallId,this.items.length),this.items.push(t),this.mergePermissionInto(e.toolCallId);break}case`tool_call_update`:{let t=this.toolCallIndex.get(e.toolCallId);if(t===void 0)break;let n=this.items[t];if(n.kind!==`tool_call`)break;let r={...n,diffs:[...n.diffs],terminalIds:[...n.terminalIds],content:[...n.content]};e.status&&(r.status=e.status),e.title&&(r.title=e.title),e.locations&&(r.locations=b(e.locations));let i=e.rawInput;i!==void 0&&(r.rawInput=i),x(r,e.content),this.items[t]=r;break}case`plan`:{let t=e.entries;Array.isArray(t)&&(this.plan=t.map(e=>e).filter(e=>typeof e.content==`string`).map(e=>({content:e.content,priority:typeof e.priority==`string`?e.priority:void 0,status:typeof e.status==`string`?e.status:void 0})));break}case`usage_update`:{let t=e;this.tokenUsage={used:typeof t.used==`number`?t.used:void 0,size:typeof t.size==`number`?t.size:void 0};break}default:{let t=e.usage;t!==void 0&&(this.tokenUsage={used:t.used,size:t.size});break}}}};function v(e){let t=e.resolved;if(t===null)return null;if(t.optionId===null)return t.auto?{kind:`dismissed`}:{kind:`denied`,auto:!1,optionName:null};let n=e.options.find(e=>e.optionId===t.optionId);if(n===void 0)return{kind:`dismissed`};let r=n.kind.startsWith(`reject`),i=n.kind.startsWith(`allow`);return!r&&!i?{kind:`dismissed`}:{kind:r?`denied`:`approved`,auto:t.auto,optionName:n.name}}function y(e){let t=e.messageId;return typeof t==`string`?t:`default`}function b(e){return Array.isArray(e)?e.map(e=>e).filter(e=>typeof e.path==`string`).map(e=>({path:e.path,line:typeof e.line==`number`?e.line:void 0})):[]}function x(e,t){if(Array.isArray(t))for(let n of t){let t=n;if(t.type===`diff`&&typeof t.path==`string`&&typeof t.newText==`string`)e.diffs.push({path:t.path,oldText:typeof t.oldText==`string`?t.oldText:null,newText:t.newText});else if(t.type===`terminal`&&typeof t.terminalId==`string`)e.terminalIds.includes(t.terminalId)||e.terminalIds.push(t.terminalId);else if(t.type===`content`){let n=g(t.content);n!==null&&e.content.push(n)}else{let n=g(t);n!==null&&e.content.push(n)}}}var S=500,C=15e3,w=3e4,T=9e4,E=8e3,D=class extends Error{code;constructor(e,t){super(t),this.name=`ThreadResumeError`,this.code=e}},O=class extends Error{constructor(){super(`agent-thread channel is not connected`),this.name=`ThreadChannelUnavailableError`}},k=class{url=null;ws=null;reconnectDelay=S;reconnectTimer=null;threads=new Map;listeners=new Set;pendingCreates=new Map;pendingResumes=new Map;openedArchived=new Set;reqCounter=0;status=`idle`;version=0;setUrl(e){e!==this.url&&(this.url=e,this.teardownSocket(),e===null?this.setStatus(`idle`):this.connect())}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));threadsSnapshot=[];threadsSnapshotVersion=-1;getThreads=()=>(this.threadsSnapshotVersion!==this.version&&(this.threadsSnapshot=[...this.threads.values()].map(e=>e.info).sort((e,t)=>e.createdAt-t.createdAt),this.threadsSnapshotVersion=this.version),this.threadsSnapshot);openTabsSnapshot=[];openTabsSnapshotVersion=-1;getOpenTabs=()=>(this.openTabsSnapshotVersion!==this.version&&(this.openTabsSnapshot=[...this.threads.values()].map(e=>e.info).filter(e=>e.archived!==!0||this.openedArchived.has(e.threadId)).sort((e,t)=>e.createdAt-t.createdAt),this.openTabsSnapshotVersion=this.version),this.openTabsSnapshot);archivedSnapshot=[];archivedSnapshotVersion=-1;getArchivedThreads=()=>(this.archivedSnapshotVersion!==this.version&&(this.archivedSnapshot=[...this.threads.values()].map(e=>e.info).filter(e=>e.archived===!0).sort((e,t)=>t.lastActivityAt-e.lastActivityAt),this.archivedSnapshotVersion=this.version),this.archivedSnapshot);getThread=e=>this.threads.get(e)??null;modelBuilders=new Map;getThreadModel=e=>{let t=this.threads.get(e);if(t===void 0)return null;let n=this.modelBuilders.get(e);return n===void 0&&(n=new _,this.modelBuilders.set(e,n)),n.sync(t.events)};getConnectionStatus=()=>this.status;async createThread(e){this.connectNow(),await this.waitForOpen(E),this.reqCounter+=1;let t=`create-${this.reqCounter}`,n=new Promise((e,n)=>{let r=setTimeout(()=>{this.pendingCreates.delete(t),n(Error(`thread creation timed out`))},w);this.pendingCreates.set(t,{resolve:e,reject:n,timer:r})}),r=c(e.agent),i=f(r),a=m(r),o=i!==void 0||a!==void 0?{...i===void 0?{}:{config:i},...a===void 0?{}:{modeId:a}}:void 0;return this.send({op:`create`,reqId:t,...e,...o===void 0?{}:{settings:o}}),n}prompt(e,t){this.reqCounter+=1,this.send({op:`prompt`,threadId:e,reqId:`prompt-${this.reqCounter}`,content:t})}editQueued(e,t,n){let r=n.trim();r!==``&&this.send({op:`queue_edit`,threadId:e,id:t,content:r})}removeQueued(e,t){this.send({op:`queue_remove`,threadId:e,id:t})}respondPermission(e,t,n){this.send({op:`permission_response`,threadId:e,requestId:t,outcome:n})}respondRuntimeConsent(e,t,n){this.send({op:`runtime_consent_response`,threadId:e,requestId:t,outcome:n})}cancel(e){this.send({op:`cancel`,threadId:e})}setMode(e,t){this.send({op:`set_mode`,threadId:e,modeId:t})}renameThread(e,t){let n=t.trim();n!==``&&this.send({op:`rename`,threadId:e,title:n})}setConfigOption(e,t,n){this.send({op:`set_config_option`,threadId:e,configId:t,value:n})}closeThread(e){let t=this.threads.get(e);if(t?.info.archived===!0){this.send({op:`unsubscribe`,threadId:e}),this.openedArchived.delete(e),this.modelBuilders.delete(e),this.threads.set(e,{info:t.info,events:[],lastSeq:-1}),this.bump();return}this.send({op:`close`,threadId:e}),this.openedArchived.delete(e),this.modelBuilders.delete(e),this.threads.delete(e)&&this.bump()}openArchivedThread(e){let t=this.threads.get(e);t===void 0||t.info.archived!==!0||this.openedArchived.has(e)||(this.openedArchived.add(e),this.send({op:`subscribe`,threadId:e,sinceSeq:t.lastSeq+1}),this.bump())}deleteThread(e){this.send({op:`delete`,threadId:e}),this.openedArchived.delete(e),this.modelBuilders.delete(e),this.threads.delete(e)&&this.bump()}async resumeThread(e,t){this.connectNow(),await this.waitForOpen(E),this.reqCounter+=1;let n=`resume-${this.reqCounter}`,r=new Promise((e,t)=>{let r=setTimeout(()=>{this.pendingResumes.delete(n),t(new D(`timeout`,`resume timed out`))},T);this.pendingResumes.set(n,{resolve:e,reject:t,timer:r})});return this.send({op:`resume`,threadId:e,reqId:n,prompt:t}),r}connectNow(){this.url===null||this.ws!==null||(this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.reconnectDelay=S,this.connect())}waitForOpen(e){return this.ws!==null&&this.ws.readyState===WebSocket.OPEN?Promise.resolve():new Promise((t,n)=>{let r=e=>{clearTimeout(a),i(),e?t():n(new O)},i=this.subscribe(()=>{this.ws!==null&&this.ws.readyState===WebSocket.OPEN&&r(!0)}),a=setTimeout(()=>r(!1),e)})}connect(){if(this.url===null)return;this.setStatus(`connecting`);let e;try{e=new WebSocket(this.url)}catch{this.scheduleReconnect();return}this.ws=e,e.onopen=()=>{if(this.ws===e){this.reconnectDelay=S,this.setStatus(`open`),this.send({op:`list`});for(let[e,t]of this.threads)t.info.archived===!0&&!this.openedArchived.has(e)||this.send({op:`subscribe`,threadId:e,sinceSeq:t.lastSeq+1})}},e.onmessage=t=>{if(this.ws!==e||typeof t.data!=`string`)return;let n;try{n=JSON.parse(t.data)}catch{return}this.handleFrame(n)},e.onclose=()=>{this.ws===e&&(this.ws=null,this.setStatus(`closed`),this.scheduleReconnect())},e.onerror=()=>{}}teardownSocket(){this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);for(let e of this.pendingCreates.values())clearTimeout(e.timer),e.reject(new O);this.pendingCreates.clear();for(let e of this.pendingResumes.values())clearTimeout(e.timer),e.reject(new O);this.pendingResumes.clear();let e=this.ws;if(this.ws=null,e!==null)try{e.close()}catch{}}scheduleReconnect(){if(this.url===null||this.reconnectTimer!==null)return;let e=this.reconnectDelay;this.reconnectDelay=Math.min(this.reconnectDelay*2,C),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}send(e){let t=this.ws;if(!(t===null||t.readyState!==WebSocket.OPEN))try{t.send(JSON.stringify(e))}catch{}}handleFrame(e){switch(e.op){case`created`:{let t=this.pendingCreates.get(e.reqId);t!==void 0&&(this.pendingCreates.delete(e.reqId),clearTimeout(t.timer),t.resolve(e.info)),this.upsertInfo(e.info);return}case`threads`:{let t=new Set;for(let n of e.threads){t.add(n.threadId);let e=this.threads.has(n.threadId);this.upsertInfo(n),!e&&n.archived!==!0&&this.send({op:`subscribe`,threadId:n.threadId,sinceSeq:0})}let n=!1;for(let e of Array.from(this.threads.keys()))t.has(e)||(this.threads.delete(e),this.modelBuilders.delete(e),this.openedArchived.delete(e),n=!0);n&&this.bump();return}case`resumed`:{let t=this.pendingResumes.get(e.reqId);t!==void 0&&(this.pendingResumes.delete(e.reqId),clearTimeout(t.timer),t.resolve(e.info)),this.upsertInfo(e.info);return}case`subscribed`:this.upsertInfo(e.info);return;case`info`:this.upsertInfo(e.info);return;case`event`:this.appendEvents(e.threadId,e.seq,[e.event]);return;case`events`:this.appendEvents(e.threadId,e.fromSeq,e.events);return;case`error`:if(e.reqId!==void 0){let t=this.pendingCreates.get(e.reqId);if(t!==void 0){this.pendingCreates.delete(e.reqId),clearTimeout(t.timer),t.reject(Error(e.message));return}let n=this.pendingResumes.get(e.reqId);if(n!==void 0){this.pendingResumes.delete(e.reqId),clearTimeout(n.timer),n.reject(new D(e.code,e.message));return}if(e.reqId.startsWith(`prompt-`)){r.error(i._({id:`XNBGZw`,values:{0:e.message}}));return}}console.warn(`[agent-threads] server error frame:`,e.code,e.message);return;default:return}}appendEvents(e,t,n){let r=this.threads.get(e);if(r===void 0||n.length===0)return;let i=Math.max(r.lastSeq+1-t,0);if(i>=n.length)return;let a=i===0?n:n.slice(i),o=r.info;for(let e of a)o=A(o,e);this.threads.set(e,{info:o,events:[...r.events,...a],lastSeq:t+n.length-1}),this.bump()}upsertInfo(e){let t=this.threads.get(e.threadId);t===void 0?this.threads.set(e.threadId,{info:e,events:[],lastSeq:-1}):e.archived===!0&&t.info.archived!==!0?(this.openedArchived.delete(e.threadId),this.modelBuilders.delete(e.threadId),this.threads.set(e.threadId,{info:e,events:[],lastSeq:-1})):this.threads.set(e.threadId,{...t,info:e}),this.bump()}setStatus(e){this.status!==e&&(this.status=e,this.bump())}bump(){this.version+=1;for(let e of this.listeners)e()}};function A(e,t){switch(t.kind){case`status`:return{...e,status:t.status,lastActivityAt:t.ts};case`title_changed`:return{...e,title:t.title,lastActivityAt:t.ts};default:return{...e,lastActivityAt:t.ts}}}var j=new k;function M(){return j}function N(){return(0,a.useSyncExternalStore)(j.subscribe,j.getOpenTabs,j.getOpenTabs)}function P(){return(0,a.useSyncExternalStore)(j.subscribe,j.getArchivedThreads,j.getArchivedThreads)}function F(e){let t=(0,o.c)(2),n;t[0]===e?n=t[1]:(n=()=>j.getThread(e),t[0]=e,t[1]=n);let r=n;return(0,a.useSyncExternalStore)(j.subscribe,r,r)}function I(e){let t=(0,o.c)(2),n;t[0]===e?n=t[1]:(n=()=>j.getThreadModel(e),t[0]=e,t[1]=n);let r=n;return(0,a.useSyncExternalStore)(j.subscribe,r,r)}function L(){return(0,a.useSyncExternalStore)(j.subscribe,j.getConnectionStatus,j.getConnectionStatus)}function R(e){if(e===null)return null;try{let t=new URL(e);return t.pathname=`/collab/thread`,t.search=``,t.toString()}catch{return null}}export{F as a,P as c,c as d,d as f,R as i,N as l,D as n,L as o,p,M as r,I as s,O as t,v as u};
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{n as r}from"./dist-Dr52ya0i.js";import{t as i}from"./dist-D1YpGD7x.js";var a=e(t(),1),o=n(),s=`ok-acp-agent-settings-v1`;function c(e){return`${e.source}:${e.id}`}function l(){try{let e=localStorage.getItem(s);if(e===null)return{};let t=JSON.parse(e);return typeof t==`object`&&t?t:{}}catch{return{}}}function u(e){try{localStorage.setItem(s,JSON.stringify(e))}catch(e){console.warn(`[acp-settings] could not persist agent settings`,e)}}function d(e,t,n){let r=l(),i=r[e]??{};r[e]={...i,config:{...i.config,[t]:n}},u(r)}function f(e){let t=l()[e]?.config;if(typeof t!=`object`||!t)return;let n={};for(let[e,r]of Object.entries(t))(typeof r==`string`||typeof r==`boolean`)&&(n[e]=r);return Object.keys(n).length>0?n:void 0}function p(e,t){if(t===``)return;let n=l();n[e]={...n[e]??{},modeId:t},u(n)}function m(e){let t=l()[e]?.modeId;return typeof t==`string`&&t!==``?t:void 0}var h=64e3;function g(e){if(typeof e!=`object`||!e)return null;let t=e;return t.type===`text`&&typeof t.text==`string`?t.text:null}var _=class{items=[];plan=[];turnActive=!1;tokenUsage=null;terminals={};toolCallIndex=new Map;permissionIndex=new Map;permissionByToolCall=new Map;permissionsByToolCall={};messageIndex=new Map;runtimeConsentIndex=new Map;lastConsentIndex=null;appliedCount=0;dirty=!1;snapshot={items:[],plan:[],turnActive:!1,tokenUsage:null,terminals:{},permissionsByToolCall:{}};sync(e){e.length<this.appliedCount&&this.reset();for(let t=this.appliedCount;t<e.length;t++)this.applyEvent(e[t]);return this.appliedCount=e.length,this.dirty&&=(this.snapshot={items:[...this.items],plan:this.plan,turnActive:this.turnActive,tokenUsage:this.tokenUsage,terminals:{...this.terminals},permissionsByToolCall:{...this.permissionsByToolCall}},!1),this.snapshot}reset(){this.items=[],this.plan=[],this.turnActive=!1,this.tokenUsage=null,this.terminals={},this.toolCallIndex=new Map,this.permissionIndex=new Map,this.permissionByToolCall=new Map,this.permissionsByToolCall={},this.messageIndex=new Map,this.runtimeConsentIndex=new Map,this.lastConsentIndex=null,this.appliedCount=0,this.dirty=!0}applyEvent(e){switch(this.dirty=!0,e.kind){case`user_message`:this.items.push({kind:`message`,role:`user`,text:e.content,messageId:`user-${this.items.length}`}),this.messageIndex.clear();break;case`turn_started`:this.turnActive=!0;break;case`turn_ended`:this.turnActive=!1,this.messageIndex.clear();break;case`status`:if(e.status===`exited`&&(this.turnActive=!1),this.lastConsentIndex!==null){let t=this.items[this.lastConsentIndex];t?.kind===`runtime_consent`&&t.install===`running`&&(e.status===`spawning`||e.status===`ready`||e.status===`running`?this.items[this.lastConsentIndex]={...t,install:`done`}:(e.status===`error`||e.status===`exited`)&&(this.items[this.lastConsentIndex]={...t,install:`failed`}))}e.status===`error`&&e.detail?this.items.push({kind:`notice`,text:e.detail,tone:`error`}):e.status===`auth_required`&&e.detail&&this.items.push({kind:`notice`,text:e.detail,tone:`info`});break;case`permission_request`:{let t=e.toolCall.toolCallId??null,n={kind:`permission`,requestId:e.requestId,title:e.toolCall.title??`Permission required`,toolKind:e.toolCall.kind??`other`,options:e.options,resolved:null,toolCallId:t,mergedIntoToolCall:t!==null&&this.toolCallIndex.has(t)};this.permissionIndex.set(e.requestId,this.items.length),t!==null&&(this.permissionByToolCall.set(t,this.items.length),this.permissionsByToolCall[t]=n),this.items.push(n);break}case`permission_resolved`:{let t=this.permissionIndex.get(e.requestId);if(t===void 0)break;let n=this.items[t];if(n.kind!==`permission`)break;let r={...n,resolved:{optionId:e.optionId,auto:e.auto}};this.items[t]=r,r.toolCallId!==null&&(this.permissionsByToolCall[r.toolCallId]=r);break}case`runtime_consent_request`:this.runtimeConsentIndex.set(e.requestId,this.items.length),this.lastConsentIndex=this.items.length,this.items.push({kind:`runtime_consent`,requestId:e.requestId,runtime:e.runtime,displayName:e.displayName,provides:e.provides,version:e.version,approxSizeMB:e.approxSizeMB,sourceHost:e.sourceHost,agentName:e.agentName,resolved:null,install:null,progress:null});break;case`runtime_consent_resolved`:{let t=this.runtimeConsentIndex.get(e.requestId);if(t===void 0)break;let n=this.items[t];if(n.kind!==`runtime_consent`)break;this.items[t]={...n,resolved:e.decision,install:e.decision===`granted`?`running`:null};break}case`runtime_install_progress`:{if(this.lastConsentIndex===null)break;let t=this.items[this.lastConsentIndex];if(t===void 0||t.kind!==`runtime_consent`)break;this.items[this.lastConsentIndex]={...t,progress:{receivedBytes:e.receivedBytes??0,totalBytes:e.totalBytes??null}};break}case`terminal_created`:this.terminals[e.terminalId]={terminalId:e.terminalId,command:e.command,args:e.args,output:``,truncated:!1,exit:null};break;case`terminal_output`:{let t=this.terminals[e.terminalId];if(t===void 0)break;let n=t.output+e.chunk,r=t.truncated;n.length>h&&(n=n.slice(-h),r=!0),this.terminals[e.terminalId]={...t,output:n,truncated:r};break}case`terminal_exit`:{let t=this.terminals[e.terminalId];if(t===void 0)break;this.terminals[e.terminalId]={...t,exit:{exitCode:e.exitCode,signal:e.signal}};break}case`session_update`:this.applyUpdate(e.update);break;default:break}}mergePermissionInto(e){let t=this.permissionByToolCall.get(e);if(t===void 0)return;let n=this.items[t];if(n===void 0||n.kind!==`permission`||n.mergedIntoToolCall)return;let r={...n,mergedIntoToolCall:!0};this.items[t]=r,this.permissionsByToolCall[e]=r}pushMessageChunk(e,t,n){let r=`${e}:${t}`,i=this.messageIndex.get(r);if(i!==void 0&&i===this.items.length-1){let e=this.items[i];this.items[i]={...e,text:e.text+n};return}this.messageIndex.set(r,this.items.length),this.items.push({kind:`message`,role:e,text:n,messageId:t})}applyUpdate(e){switch(e.sessionUpdate){case`agent_message_chunk`:{let t=g(e.content);t!==null&&this.pushMessageChunk(`agent`,y(e),t);break}case`agent_thought_chunk`:{let t=g(e.content);t!==null&&this.pushMessageChunk(`thought`,y(e),t);break}case`user_message_chunk`:{let t=g(e.content);t!==null&&this.pushMessageChunk(`user`,y(e),t);break}case`tool_call`:{let t={kind:`tool_call`,toolCallId:e.toolCallId,title:e.title??`Tool call`,toolKind:e.kind??`other`,status:e.status??`pending`,diffs:[],terminalIds:[],content:[],locations:b(e.locations),rawInput:e.rawInput};x(t,e.content),this.toolCallIndex.set(e.toolCallId,this.items.length),this.items.push(t),this.mergePermissionInto(e.toolCallId);break}case`tool_call_update`:{let t=this.toolCallIndex.get(e.toolCallId);if(t===void 0)break;let n=this.items[t];if(n.kind!==`tool_call`)break;let r={...n,diffs:[...n.diffs],terminalIds:[...n.terminalIds],content:[...n.content]};e.status&&(r.status=e.status),e.title&&(r.title=e.title),e.locations&&(r.locations=b(e.locations));let i=e.rawInput;i!==void 0&&(r.rawInput=i),x(r,e.content),this.items[t]=r;break}case`plan`:{let t=e.entries;Array.isArray(t)&&(this.plan=t.map(e=>e).filter(e=>typeof e.content==`string`).map(e=>({content:e.content,priority:typeof e.priority==`string`?e.priority:void 0,status:typeof e.status==`string`?e.status:void 0})));break}case`usage_update`:{let t=e;this.tokenUsage={used:typeof t.used==`number`?t.used:void 0,size:typeof t.size==`number`?t.size:void 0};break}default:{let t=e.usage;t!==void 0&&(this.tokenUsage={used:t.used,size:t.size});break}}}};function v(e){let t=e.resolved;if(t===null)return null;if(t.optionId===null)return t.auto?{kind:`dismissed`}:{kind:`denied`,auto:!1,optionName:null};let n=e.options.find(e=>e.optionId===t.optionId);if(n===void 0)return{kind:`dismissed`};let r=n.kind.startsWith(`reject`),i=n.kind.startsWith(`allow`);return!r&&!i?{kind:`dismissed`}:{kind:r?`denied`:`approved`,auto:t.auto,optionName:n.name}}function y(e){let t=e.messageId;return typeof t==`string`?t:`default`}function b(e){return Array.isArray(e)?e.map(e=>e).filter(e=>typeof e.path==`string`).map(e=>({path:e.path,line:typeof e.line==`number`?e.line:void 0})):[]}function x(e,t){if(Array.isArray(t))for(let n of t){let t=n;if(t.type===`diff`&&typeof t.path==`string`&&typeof t.newText==`string`)e.diffs.push({path:t.path,oldText:typeof t.oldText==`string`?t.oldText:null,newText:t.newText});else if(t.type===`terminal`&&typeof t.terminalId==`string`)e.terminalIds.includes(t.terminalId)||e.terminalIds.push(t.terminalId);else if(t.type===`content`){let n=g(t.content);n!==null&&e.content.push(n)}else{let n=g(t);n!==null&&e.content.push(n)}}}var S=500,C=15e3,w=3e4,T=9e4,E=8e3,D=class extends Error{code;constructor(e,t){super(t),this.name=`ThreadResumeError`,this.code=e}},O=class extends Error{constructor(){super(`agent-thread channel is not connected`),this.name=`ThreadChannelUnavailableError`}},k=class{url=null;ws=null;reconnectDelay=S;reconnectTimer=null;threads=new Map;listeners=new Set;pendingCreates=new Map;pendingResumes=new Map;openedArchived=new Set;reqCounter=0;status=`idle`;version=0;setUrl(e){e!==this.url&&(this.url=e,this.teardownSocket(),e===null?this.setStatus(`idle`):this.connect())}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));threadsSnapshot=[];threadsSnapshotVersion=-1;getThreads=()=>(this.threadsSnapshotVersion!==this.version&&(this.threadsSnapshot=[...this.threads.values()].map(e=>e.info).sort((e,t)=>e.createdAt-t.createdAt),this.threadsSnapshotVersion=this.version),this.threadsSnapshot);openTabsSnapshot=[];openTabsSnapshotVersion=-1;getOpenTabs=()=>(this.openTabsSnapshotVersion!==this.version&&(this.openTabsSnapshot=[...this.threads.values()].map(e=>e.info).filter(e=>e.archived!==!0||this.openedArchived.has(e.threadId)).sort((e,t)=>e.createdAt-t.createdAt),this.openTabsSnapshotVersion=this.version),this.openTabsSnapshot);archivedSnapshot=[];archivedSnapshotVersion=-1;getArchivedThreads=()=>(this.archivedSnapshotVersion!==this.version&&(this.archivedSnapshot=[...this.threads.values()].map(e=>e.info).filter(e=>e.archived===!0).sort((e,t)=>t.lastActivityAt-e.lastActivityAt),this.archivedSnapshotVersion=this.version),this.archivedSnapshot);getThread=e=>this.threads.get(e)??null;modelBuilders=new Map;getThreadModel=e=>{let t=this.threads.get(e);if(t===void 0)return null;let n=this.modelBuilders.get(e);return n===void 0&&(n=new _,this.modelBuilders.set(e,n)),n.sync(t.events)};getConnectionStatus=()=>this.status;async createThread(e){this.connectNow(),await this.waitForOpen(E),this.reqCounter+=1;let t=`create-${this.reqCounter}`,n=new Promise((e,n)=>{let r=setTimeout(()=>{this.pendingCreates.delete(t),n(Error(`thread creation timed out`))},w);this.pendingCreates.set(t,{resolve:e,reject:n,timer:r})}),r=c(e.agent),i=f(r),a=m(r),o=i!==void 0||a!==void 0?{...i===void 0?{}:{config:i},...a===void 0?{}:{modeId:a}}:void 0;return this.send({op:`create`,reqId:t,...e,...o===void 0?{}:{settings:o}}),n}prompt(e,t){this.reqCounter+=1,this.send({op:`prompt`,threadId:e,reqId:`prompt-${this.reqCounter}`,content:t})}editQueued(e,t,n){let r=n.trim();r!==``&&this.send({op:`queue_edit`,threadId:e,id:t,content:r})}removeQueued(e,t){this.send({op:`queue_remove`,threadId:e,id:t})}respondPermission(e,t,n){this.send({op:`permission_response`,threadId:e,requestId:t,outcome:n})}respondRuntimeConsent(e,t,n){this.send({op:`runtime_consent_response`,threadId:e,requestId:t,outcome:n})}cancel(e){this.send({op:`cancel`,threadId:e})}setMode(e,t){this.send({op:`set_mode`,threadId:e,modeId:t})}renameThread(e,t){let n=t.trim();n!==``&&this.send({op:`rename`,threadId:e,title:n})}setConfigOption(e,t,n){this.send({op:`set_config_option`,threadId:e,configId:t,value:n})}closeThread(e){let t=this.threads.get(e);if(t?.info.archived===!0){this.send({op:`unsubscribe`,threadId:e}),this.openedArchived.delete(e),this.modelBuilders.delete(e),this.threads.set(e,{info:t.info,events:[],lastSeq:-1}),this.bump();return}this.send({op:`close`,threadId:e}),this.openedArchived.delete(e),this.modelBuilders.delete(e),this.threads.delete(e)&&this.bump()}openArchivedThread(e){let t=this.threads.get(e);t===void 0||t.info.archived!==!0||this.openedArchived.has(e)||(this.openedArchived.add(e),this.send({op:`subscribe`,threadId:e,sinceSeq:t.lastSeq+1}),this.bump())}deleteThread(e){this.send({op:`delete`,threadId:e}),this.openedArchived.delete(e),this.modelBuilders.delete(e),this.threads.delete(e)&&this.bump()}async resumeThread(e,t){this.connectNow(),await this.waitForOpen(E),this.reqCounter+=1;let n=`resume-${this.reqCounter}`,r=new Promise((e,t)=>{let r=setTimeout(()=>{this.pendingResumes.delete(n),t(new D(`timeout`,`resume timed out`))},T);this.pendingResumes.set(n,{resolve:e,reject:t,timer:r})});return this.send({op:`resume`,threadId:e,reqId:n,prompt:t}),r}connectNow(){this.url===null||this.ws!==null||(this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.reconnectDelay=S,this.connect())}waitForOpen(e){return this.ws!==null&&this.ws.readyState===WebSocket.OPEN?Promise.resolve():new Promise((t,n)=>{let r=e=>{clearTimeout(a),i(),e?t():n(new O)},i=this.subscribe(()=>{this.ws!==null&&this.ws.readyState===WebSocket.OPEN&&r(!0)}),a=setTimeout(()=>r(!1),e)})}connect(){if(this.url===null)return;this.setStatus(`connecting`);let e;try{e=new WebSocket(this.url)}catch{this.scheduleReconnect();return}this.ws=e,e.onopen=()=>{if(this.ws===e){this.reconnectDelay=S,this.setStatus(`open`),this.send({op:`list`});for(let[e,t]of this.threads)t.info.archived===!0&&!this.openedArchived.has(e)||this.send({op:`subscribe`,threadId:e,sinceSeq:t.lastSeq+1})}},e.onmessage=t=>{if(this.ws!==e||typeof t.data!=`string`)return;let n;try{n=JSON.parse(t.data)}catch{return}this.handleFrame(n)},e.onclose=()=>{this.ws===e&&(this.ws=null,this.setStatus(`closed`),this.scheduleReconnect())},e.onerror=()=>{}}teardownSocket(){this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);for(let e of this.pendingCreates.values())clearTimeout(e.timer),e.reject(new O);this.pendingCreates.clear();for(let e of this.pendingResumes.values())clearTimeout(e.timer),e.reject(new O);this.pendingResumes.clear();let e=this.ws;if(this.ws=null,e!==null)try{e.close()}catch{}}scheduleReconnect(){if(this.url===null||this.reconnectTimer!==null)return;let e=this.reconnectDelay;this.reconnectDelay=Math.min(this.reconnectDelay*2,C),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}send(e){let t=this.ws;if(!(t===null||t.readyState!==WebSocket.OPEN))try{t.send(JSON.stringify(e))}catch{}}handleFrame(e){switch(e.op){case`created`:{let t=this.pendingCreates.get(e.reqId);t!==void 0&&(this.pendingCreates.delete(e.reqId),clearTimeout(t.timer),t.resolve(e.info)),this.upsertInfo(e.info);return}case`threads`:{let t=new Set;for(let n of e.threads){t.add(n.threadId);let e=this.threads.has(n.threadId);this.upsertInfo(n),!e&&n.archived!==!0&&this.send({op:`subscribe`,threadId:n.threadId,sinceSeq:0})}let n=!1;for(let e of Array.from(this.threads.keys()))t.has(e)||(this.threads.delete(e),this.modelBuilders.delete(e),this.openedArchived.delete(e),n=!0);n&&this.bump();return}case`resumed`:{let t=this.pendingResumes.get(e.reqId);t!==void 0&&(this.pendingResumes.delete(e.reqId),clearTimeout(t.timer),t.resolve(e.info)),this.upsertInfo(e.info);return}case`subscribed`:this.upsertInfo(e.info);return;case`info`:this.upsertInfo(e.info);return;case`event`:this.appendEvents(e.threadId,e.seq,[e.event]);return;case`events`:this.appendEvents(e.threadId,e.fromSeq,e.events);return;case`error`:if(e.reqId!==void 0){let t=this.pendingCreates.get(e.reqId);if(t!==void 0){this.pendingCreates.delete(e.reqId),clearTimeout(t.timer),t.reject(Error(e.message));return}let n=this.pendingResumes.get(e.reqId);if(n!==void 0){this.pendingResumes.delete(e.reqId),clearTimeout(n.timer),n.reject(new D(e.code,e.message));return}if(e.reqId.startsWith(`prompt-`)){r.error(i._({id:`XNBGZw`,values:{0:e.message}}));return}}console.warn(`[agent-threads] server error frame:`,e.code,e.message);return;default:return}}appendEvents(e,t,n){let r=this.threads.get(e);if(r===void 0||n.length===0)return;let i=Math.max(r.lastSeq+1-t,0);if(i>=n.length)return;let a=i===0?n:n.slice(i),o=r.info;for(let e of a)o=A(o,e);this.threads.set(e,{info:o,events:[...r.events,...a],lastSeq:t+n.length-1}),this.bump()}upsertInfo(e){let t=this.threads.get(e.threadId);t===void 0?this.threads.set(e.threadId,{info:e,events:[],lastSeq:-1}):e.archived===!0&&t.info.archived!==!0?(this.openedArchived.delete(e.threadId),this.modelBuilders.delete(e.threadId),this.threads.set(e.threadId,{info:e,events:[],lastSeq:-1})):this.threads.set(e.threadId,{...t,info:e}),this.bump()}setStatus(e){this.status!==e&&(this.status=e,this.bump())}bump(){this.version+=1;for(let e of this.listeners)e()}};function A(e,t){switch(t.kind){case`status`:return{...e,status:t.status,lastActivityAt:t.ts};case`title_changed`:return{...e,title:t.title,lastActivityAt:t.ts};default:return{...e,lastActivityAt:t.ts}}}var j=new k;function M(){return j}function N(){return(0,a.useSyncExternalStore)(j.subscribe,j.getOpenTabs,j.getOpenTabs)}function P(){return(0,a.useSyncExternalStore)(j.subscribe,j.getArchivedThreads,j.getArchivedThreads)}function F(e){let t=(0,o.c)(2),n;t[0]===e?n=t[1]:(n=()=>j.getThread(e),t[0]=e,t[1]=n);let r=n;return(0,a.useSyncExternalStore)(j.subscribe,r,r)}function I(e){let t=(0,o.c)(2),n;t[0]===e?n=t[1]:(n=()=>j.getThreadModel(e),t[0]=e,t[1]=n);let r=n;return(0,a.useSyncExternalStore)(j.subscribe,r,r)}function L(){return(0,a.useSyncExternalStore)(j.subscribe,j.getConnectionStatus,j.getConnectionStatus)}function R(e){if(e===null)return null;try{let t=new URL(e);return t.pathname=`/collab/thread`,t.search=``,t.toString()}catch{return null}}export{F as a,P as c,c as d,d as f,R as i,N as l,D as n,L as o,p,M as r,I as s,O as t,v as u};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{n as e,t}from"./chunk-Y2CYZVJY-
|
|
1
|
+
import{n as e,t}from"./chunk-Y2CYZVJY-BavonG01.js";import{t as n}from"./src-DFZupjZD.js";import{J as r,a as i,b as a,et as o,o as s,rt as c,tt as l,x as u}from"./chunk-WYO6CB5R-BMZjhy31.js";import{C as d}from"./src-CIOeKeVw.js";import{t as f}from"./arc-CcVRsw3e.js";import{p}from"./chunk-ICXQ74PX-QBz75RJe.js";import{t as m}from"./chunk-VAUOI2AC-B_byVmRb.js";var h=(function(){var t=e(function(e,t,n,r){for(n||={},r=e.length;r--;n[e[r]]=t);return n},`o`),n=[6,11,13,14,15,17,19,20,23,24],r=[1,12],i=[1,13],a=[1,14],o=[1,15],s=[1,16],c=[1,19],l=[1,20],u={trace:e(function(){},`trace`),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:`error`,6:`EOF`,7:`timeline`,8:`timeline_lr`,9:`timeline_td`,11:`SPACE`,13:`NEWLINE`,14:`title`,15:`acc_title`,16:`acc_title_value`,17:`acc_descr`,18:`acc_descr_value`,19:`acc_descr_multiline_value`,20:`section`,23:`period`,24:`event`},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:e(function(e,t,n,r,i,a,o){var s=a.length-1;switch(i){case 1:return a[s-1];case 3:r.setDirection(`LR`);break;case 4:r.setDirection(`TD`);break;case 5:this.$=[];break;case 6:a[s-1].push(a[s]),this.$=a[s-1];break;case 7:case 8:this.$=a[s];break;case 9:case 10:this.$=[];break;case 11:r.getCommonDb().setDiagramTitle(a[s].substr(6)),this.$=a[s].substr(6);break;case 12:this.$=a[s].trim(),r.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=a[s].trim(),r.getCommonDb().setAccDescription(this.$);break;case 15:r.addSection(a[s].substr(8)),this.$=a[s].substr(8);break;case 18:r.addTask(a[s],0,``),this.$=a[s];break;case 19:r.addEvent(a[s].substr(2)),this.$=a[s];break}},`anonymous`),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},t(n,[2,5],{5:6}),t(n,[2,2]),t(n,[2,3]),t(n,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},t(n,[2,10],{1:[2,1]}),t(n,[2,6]),{12:21,14:r,15:i,17:a,19:o,20:s,21:17,22:18,23:c,24:l},t(n,[2,8]),t(n,[2,9]),t(n,[2,11]),{16:[1,22]},{18:[1,23]},t(n,[2,14]),t(n,[2,15]),t(n,[2,16]),t(n,[2,17]),t(n,[2,18]),t(n,[2,19]),t(n,[2,7]),t(n,[2,12]),t(n,[2,13])],defaultActions:{},parseError:e(function(e,t){if(t.recoverable)this.trace(e);else{var n=Error(e);throw n.hash=t,n}},`parseError`),parse:e(function(t){var n=this,r=[0],i=[],a=[null],o=[],s=this.table,c=``,l=0,u=0,d=0,f=2,p=1,m=o.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(g.yy[_]=this.yy[_]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,h.yylloc===void 0&&(h.yylloc={});var v=h.yylloc;o.push(v);var y=h.options&&h.options.ranges;typeof g.yy.parseError==`function`?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function b(e){r.length-=2*e,a.length-=e,o.length-=e}e(b,`popStack`);function x(){var e=i.pop()||h.lex()||p;return typeof e!=`number`&&(e instanceof Array&&(i=e,e=i.pop()),e=n.symbols_[e]||e),e}e(x,`lex`);for(var S,C,w,T,E,D={},O,k,A,j;;){if(w=r[r.length-1],this.defaultActions[w]?T=this.defaultActions[w]:(S??=x(),T=s[w]&&s[w][S]),T===void 0||!T.length||!T[0]){var M=``;for(O in j=[],s[w])this.terminals_[O]&&O>f&&j.push(`'`+this.terminals_[O]+`'`);M=h.showPosition?`Parse error on line `+(l+1)+`:
|
|
2
2
|
`+h.showPosition()+`
|
|
3
3
|
Expecting `+j.join(`, `)+`, got '`+(this.terminals_[S]||S)+`'`:`Parse error on line `+(l+1)+`: Unexpected `+(S==p?`end of input`:`'`+(this.terminals_[S]||S)+`'`),this.parseError(M,{text:h.match,token:this.terminals_[S]||S,line:h.yylineno,loc:v,expected:j})}if(T[0]instanceof Array&&T.length>1)throw Error(`Parse Error: multiple actions possible at state: `+w+`, token: `+S);switch(T[0]){case 1:r.push(S),a.push(h.yytext),o.push(h.yylloc),r.push(T[1]),S=null,C?(S=C,C=null):(u=h.yyleng,c=h.yytext,l=h.yylineno,v=h.yylloc,d>0&&d--);break;case 2:if(k=this.productions_[T[1]][1],D.$=a[a.length-k],D._$={first_line:o[o.length-(k||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(k||1)].first_column,last_column:o[o.length-1].last_column},y&&(D._$.range=[o[o.length-(k||1)].range[0],o[o.length-1].range[1]]),E=this.performAction.apply(D,[c,u,l,g.yy,T[1],a,o].concat(m)),E!==void 0)return E;k&&(r=r.slice(0,-1*k*2),a=a.slice(0,-1*k),o=o.slice(0,-1*k)),r.push(this.productions_[T[1]][0]),a.push(D.$),o.push(D._$),A=s[r[r.length-2]][r[r.length-1]],r.push(A);break;case 3:return!0}}return!0},`parse`)};u.lexer=(function(){return{EOF:1,parseError:e(function(e,t){if(this.yy.parser)this.yy.parser.parseError(e,t);else throw Error(e)},`parseError`),setInput:e(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match=``,this.conditionStack=[`INITIAL`],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},`setInput`),input:e(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},`input`),unput:e(function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var r=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===r.length?this.yylloc.first_column:0)+r[r.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},`unput`),more:e(function(){return this._more=!0,this},`more`),reject:e(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError(`Lexical error on line `+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:``,token:null,line:this.yylineno});return this},`reject`),less:e(function(e){this.unput(this.match.slice(e))},`less`),pastInput:e(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?`...`:``)+e.substr(-20).replace(/\n/g,``)},`pastInput`),upcomingInput:e(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?`...`:``)).replace(/\n/g,``)},`upcomingInput`),showPosition:e(function(){var e=this.pastInput(),t=Array(e.length+1).join(`-`);return e+this.upcomingInput()+`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-KEIR6QF5-Cvu_RfZc.js";import{n as e}from"./chunk-CQNSW5MT-WJU8lHxD.js";export{e as createTreeViewServices};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-KEIR6QF5-Cvu_RfZc.js";import{n as e}from"./chunk-R7FJI6CG-4qEQ9dBZ.js";export{e as createTreemapServices};
|
package/dist/public/assets/{typing-burst-detector-X0S33jis.js → typing-burst-detector-CC7bIjEV.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{$ as n,Ht as r,It as i,Pt as a,Tn as o,dt as s,et as c,gn as l,ht as u,i as d,lt as f,w as p,yt as m}from"./DocumentContext-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{$ as n,Ht as r,It as i,Pt as a,Tn as o,dt as s,et as c,gn as l,ht as u,i as d,lt as f,w as p,yt as m}from"./DocumentContext-BYAIHlLG.js";import{t as h}from"./react-f2sANaYj.js";import{n as g,r as _}from"./dist-Nvb76hAm.js";import{r as v,t as y}from"./useQuery-ZeEDLtxh.js";import{t as b}from"./compiler-runtime-BfE3aGVn.js";import{t as x}from"./utils-CPqDy6Hr.js";import{t as S}from"./button-D3xSRfT4.js";import{i as C,n as w,t as T}from"./tooltip-CtvLp_YK.js";import{n as E,r as D,t as O}from"./collapsible-BTn3nxAn.js";import{A as k,E as A,j,ot as M}from"./CodeMirrorPropInput-yJZmvoN3.js";import{n as N,t as P}from"./toggle-group-DpvWeoN9.js";import{Bt as F,En as I,Ma as L,P as R,Tn as z,Ua as B,Vr as V,Vt as H,_a as U,ct as W,ft as G}from"./dist-lf4nG52q2.js";import{t as ee}from"./chevron-right-COaV_K3r.js";import{r as te}from"./CopyButton-Dk8yDsPs.js";import{i as ne,r as re}from"./prop-types-lRaJp2DY.js";import{t as ie}from"./refresh-cw-CsRXA9N2.js";import{t as ae}from"./triangle-alert-BB_1Bz59.js";import{t as oe}from"./wrench-BHZvMfZp.js";import{n as se}from"./dist-Dr52ya0i.js";import{t as K}from"./dist-D1YpGD7x.js";import{f as ce,u as le}from"./doc-paths-D9TaK83y.js";import{o as ue}from"./use-settings-route-Cj3iyYQM.js";import{d as de}from"./documents-events-Bz6CFw_P.js";import{a as q,i as fe}from"./startup-marks-BFvG00Uu.js";import{t as J}from"./badge-BTPyRUGW.js";import{C as pe,y as me}from"./config-provider-CH2tG_0H.js";import{Dt as he,Ft as ge,It as _e,J as ve,Q as ye,X as be}from"./dist-pl6OT5yc.js";import{a as xe,c as Se,i as Ce,n as we,r as Te,s as Ee,t as De}from"./panel-Boo96yEj.js";import{t as Oe}from"./lint-plugin-meta-7A6ZrPoH.js";import{t as ke}from"./skeleton-CD1oYYfF.js";import{a as Ae,c as je,d as Me}from"./lint-config-client-C5EEYoJ7.js";var Ne=56,Pe=2,Fe=150,Ie=2e3;function Le(e,t,n){return e.top+e.height/2-(n+t)/2}function Re(e,t){let n=Math.max(0,t.scrollHeight-t.clientHeight);return Math.max(0,Math.min(e,n))}function ze(e){let{docName:t,container:n,measureTarget:r,placement:i,intent:a,grade:o,landedMode:c,transition:l,onOutcome:d,onDiscardQueuedTarget:f,toolbarOffset:p=Ne,driftThresholdPx:h=Pe,quietMs:g=Fe,abandonAfterMs:_=Ie}=e,v=e.contentColumn??n.firstElementChild,y=s(t),b=u(t,{yieldsToNavigation:a===`toggle`,supersede:()=>P(`superseded`)}),x=n.style.overflowAnchor;n.style.overflowAnchor=`none`,l&&q(`ok/mode-switch/transition`,{from:l.from,to:l.to,grade:o});let S=!1,C=null,w,T,E=0,D,O=()=>{let e=r();return e===null?null:Re(i===`center`?Le(e,n.clientHeight,p):e.top-p,n)},k=()=>{let e=O();if(e===null)return{measurable:!1,moved:!1};C=e;let t=Math.abs(n.scrollTop-e)>h;return t&&(n.scrollTop=e),{measurable:!0,moved:t}},A=()=>n.scrollTop-(O()??C??n.scrollTop),j=()=>{w&&clearTimeout(w),T&&clearTimeout(T),E&&cancelAnimationFrame(E),D?.disconnect(),n.removeEventListener(`wheel`,I),n.removeEventListener(`touchstart`,I),n.removeEventListener(`contentvisibilityautostatechange`,L,!0),n.style.overflowAnchor=x,y.release(),b.release()},M=()=>{if(S)return;S=!0;let e;try{k(),e=A(),C!==null&&m({docName:t,container:n,targetScrollTop:n.scrollTop,mode:c})}finally{j()}q(`ok/landing/land`,{grade:o,delta:e}),d?.({status:`landed`,delta:e})},N=()=>{if(S)return;S=!0;let e=C??n.scrollTop,t;try{t=A()}finally{j()}q(`ok/landing/abandoned`,{grade:o,target:e,delta:t}),d?.({status:`abandoned`,delta:t})},P=e=>{S||(S=!0,j(),e===`mode-flip`&&f?.(),d?.({status:`cancelled`,reason:e}))},F=()=>{w&&clearTimeout(w),w=setTimeout(M,g)};function I(){P(`user-scroll`)}function L(){if(S)return;let{measurable:e,moved:t}=k();e&&(t||w===void 0)&&F()}try{k().measurable&&F(),n.addEventListener(`contentvisibilityautostatechange`,L,!0),n.addEventListener(`wheel`,I,{passive:!0}),n.addEventListener(`touchstart`,I,{passive:!0}),typeof ResizeObserver<`u`&&v&&(D=new ResizeObserver(L),D.observe(v)),E=requestAnimationFrame(L),T=setTimeout(N,_)}catch(e){throw S=!0,j(),e}return{cancel:P}}function Be(e){switch(e){case`bulletList`:case`orderedList`:case`taskList`:case`list`:return`list`;case`codeBlock`:case`code`:return`code`;case`horizontalRule`:case`thematicBreak`:return`thematicBreak`;case`jsxComponent`:case`mdxJsxFlowElement`:case`mdxJsxTextElement`:return`jsx`;case`htmlBlock`:case`html`:return`html`;default:return e}}function Ve(e){return typeof e!=`object`||!e?``:`value`in e&&typeof e.value==`string`?e.value:`children`in e&&Array.isArray(e.children)?e.children.map(Ve).join(``):``}function He(e,t){let{frontmatter:n,body:r}=B(e),i=n===``?0:n.split(`
|
|
2
2
|
`).length-1;try{return{blocks:t.parseToEditorMdast(r).children.map(e=>({start:(e.position?.start.line??1/0)+i,end:(e.position?.end.line??-1/0)+i,kind:Be(e.type),text:Ve(e)})),fmLineCount:i}}catch{return performance.mark(`ok/block-spans/parse-failed`),{blocks:[],fmLineCount:i}}}function Ue(e,t){let{blocks:n,fmLineCount:r}=He(e,t);return{spans:n.map(e=>({start:e.start,end:e.end})),fmLineCount:r}}function We(e,t){if(e.length===0)return null;let n=0,r=e.length-1,i=e.length-1;for(;n<=r;){let a=n+r>>1,o=e[a];o!==void 0&&o.end>=t?(i=a,r=a-1):n=a+1}return i}function Ge(e){let t=e.childCount>0?e.child(e.childCount-1):null;return t!==null&&t.type.name===`paragraph`&&t.content.size===0?e.childCount-1:e.childCount}function Ke(e,t,n){let r=e.childCount,i=Math.max(0,Math.min(t,r)),a=Math.max(i,Math.min(n,r));if(a<=i)return null;let o=0;for(let t=0;t<i;t++)o+=e.child(t).nodeSize;let s=o;for(let t=i;t<a;t++)o+=e.child(t).nodeSize;let c=o,l=e.content.size,u=Math.max(0,Math.min(s,l)),d=Math.max(u,Math.min(c,l));return d<=u?null:{from:u,to:d}}function qe(e){let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
3
3
|
`&&t.push(n+1);return t}function Je(e,t,n){return t<=1?0:t-1>=e.length?n:e[t-1]??n}function Ye(e,t){let n=0,r=e.length-1,i=1;for(;n<=r;){let a=n+r>>1;(e[a]??0)<=t?(i=a+1,n=a+1):r=a-1}return i}function Xe(e,t,n){return Math.max(t,Math.min(e,n))}function Ze(e,t){let n=e=>e.replace(/\s+/g,` `).trim();return n(e)===n(t)}function Qe(e,t){return t.inRange?t.tripwireOk?Ze(e.content,t.text)?`exact`:e.kind===t.kind?`same-type-ordinal`:`ordinal`:`ordinal`:`clamped`}function $e(e){let t=null,n=null;function r(r){return n!==null&&t===r?n:(n={blocks:He(r,e).blocks,lineStarts:qe(r)},t=r,n)}return{captureFromWysiwyg(e,t,n){if(e.childCount===0)return null;let r=Xe(t,0,e.content.size),i=0,a=e.childCount-1,o=0;for(let t=0;t<e.childCount;t++){let n=e.child(t).nodeSize;if(r<i+n){a=t,o=i+1;break}i+=n,o=i+1}let s=e.child(a),c={blockIndex:a,kind:Be(s.type.name),content:s.textContent};return n?.refine&&(c.selectionInBlock=Math.max(0,r-o)),c},captureFromSource(e,t,n){let{blocks:i,lineStarts:a}=r(e);if(i.length===0)return null;let o=Xe(t,0,e.length),s=We(i,Ye(a,o));if(s===null)return null;let c=i[s];if(!c)return null;let l={blockIndex:s,kind:c.kind,content:c.text};if(n?.refine){let t=Je(a,c.start,e.length);l.selectionInBlock=Math.max(0,o-t)}return l},resolveInSource(e,{source:t,doc:n}){let{blocks:i,lineStarts:a}=r(t);if(i.length===0)return null;let o=e.blockIndex>=0&&e.blockIndex<i.length,s=Ge(n)===i.length,c=i[Xe(e.blockIndex,0,i.length-1)],l=Je(a,c.start,t.length),u=Math.min(Je(a,c.end+1,t.length),t.length),d=Qe(e,{inRange:o,tripwireOk:s,kind:c.kind,text:c.text}),f=l;return d===`exact`&&e.selectionInBlock!==void 0&&(f=Xe(l+e.selectionInBlock,l,u)),{blockStart:l,blockEnd:u,point:f,confidence:d}},resolveInWysiwyg(e,{source:t,doc:n}){let i=Ge(n);if(i===0)return null;let{blocks:a}=r(t),o=e.blockIndex>=0&&e.blockIndex<i,s=i===a.length,c=Xe(e.blockIndex,0,i-1),l=Ke(n,c,c+1);if(l===null)return null;let u=n.child(c),d=Qe(e,{inRange:o,tripwireOk:s,kind:Be(u.type.name),text:u.textContent});return{blockStart:l.from,blockEnd:l.to,point:l.from,confidence:d}}}}var et=ge.define(),tt=ge.define(),nt=ve.mark({class:n}),rt=_e.define({create(){return ve.none},update(e,t){let n=e.map(t.changes);for(let e of t.effects)e.is(et)?n=ve.set([nt.range(e.value.from,e.value.to)]):e.is(tt)&&(n=ve.none);return n},provide:e=>be.decorations.from(e)}),it=new WeakMap,at=ye.define(e=>({destroy(){let t=it.get(e);t!==void 0&&(clearTimeout(t),it.delete(e))}}));function ot(e,t,n,r){let i=c(e.state.doc.length,t,n,r);if(!i)return;e.dispatch({effects:et.of(i)});let a=it.get(e);a!==void 0&&clearTimeout(a);let o=setTimeout(()=>{it.delete(e),e.dispatch({effects:tt.of(null)})},R);it.set(e,o)}function st(){return[rt,at]}var ct=3e4;function lt(){let e=new Map,t=e=>e?Date.now()-e.rememberedAt>ct?null:e.navigation:null;return{remember(t,n){e.set(t,{navigation:n,rememberedAt:Date.now()})},peek(n){return t(e.get(n))},consume(n){let r=e.get(n);return e.delete(n),t(r)},clear(t){e.delete(t)},clearForTest(){e.clear()}}}var ut=lt(),dt=lt(),ft=ut.remember,pt=ut.peek,mt=ut.consume,ht=ut.clear;ut.clearForTest;var gt=dt.remember,_t=dt.peek,vt=dt.consume,yt=dt.clear;dt.clearForTest;function bt(e,t,n){return{start:pe(e,t),end:pe(e,n)}}function xt(e,t){let n=me(e.start,t),r=me(e.end,t);return n===null||r===null||r.index<=n.index?null:n.index}var St=`open-knowledge:view-in-source`,Y=56,Ct=null;function wt(){return Ct??=$e(k()),Ct}function Tt(e,t,n,r,i=`toggle`){let a=r.captureFromWysiwyg(e,t,{refine:i===`jump`});if(!a)return null;let o=r.resolveInSource(a,{source:n.toString(),doc:e});return{kind:`selection-offset`,intent:i,anchor:a,pin:o?bt(n,o.blockStart,o.blockEnd):void 0}}function Et(e){let{editor:t,docName:n,ytext:r}=e,i=A(t);if(!i)return;let a=i.state.selection.from,o=Tt(i.state.doc,a,r,wt(),`jump`);o&&ft(n,o),window.dispatchEvent(new CustomEvent(St,{detail:{docName:n}}))}function Dt(e,t,n,r,i){let a=r.captureFromSource(e,t);if(!a)return null;let o=i?r.resolveInSource(a,{source:e,doc:i}):null;return{kind:`selection-offset`,anchor:a,pin:o?bt(n,o.blockStart,o.blockEnd):void 0}}function Ot(e,t){let{source:n,pmDoc:r,ydoc:i,resolver:a}=t;if(e.pin){let t=xt(e.pin,i);if(t===null){let t=a.resolveInWysiwyg(e.anchor,{source:n,doc:r});return t?{...t,point:t.blockStart,confidence:`clamped`}:null}let o=a.captureFromSource(n,t);if(o)return a.resolveInWysiwyg(o,{source:n,doc:r})}return a.resolveInWysiwyg(e.anchor,{source:n,doc:r})}function kt(e,t){let{source:n,pmDoc:r,ydoc:i,resolver:a}=t;if(e.pin){let t=xt(e.pin,i);if(t===null){let t=a.resolveInSource(e.anchor,{source:n,doc:r});return t?{...t,point:t.blockStart,confidence:`clamped`}:null}let o=a.captureFromSource(n,t);if(o)return a.resolveInSource(o,{source:n,doc:r})}return a.resolveInSource(e.anchor,{source:n,doc:r})}function At(e,t){try{return e.coordsAtPos(t)}catch{return null}}function jt(e,t,n){let r=Math.max(0,Math.min(n,e.state.doc.length)),i=t.getBoundingClientRect().top,a=At(e,r);if(a)return{top:a.top-i+t.scrollTop,height:a.bottom-a.top};try{let n=e.lineBlockAt(r);return{top:e.documentTop-i+t.scrollTop+n.top,height:n.height}}catch{return null}}function Mt(e,t){if(e.isDestroyed)return null;try{let n=e.nodeDOM(t);if(n instanceof HTMLElement)return n;let{node:r}=e.domAtPos(t);return r instanceof HTMLElement?r:r.parentElement}catch{return null}}function Nt(e,t,n){if(e.isDestroyed)return null;let r=Mt(e,Math.max(0,Math.min(n,e.state.doc.content.size)));if(!r)return null;let i=r.getBoundingClientRect(),a=t.getBoundingClientRect().top;return{top:i.top-a+t.scrollTop,height:i.height}}function Pt(){return typeof document>`u`?null:f()}function Ft(e,t){let n=t.getBoundingClientRect(),r=n.left+n.width/2;for(let t of[Y+1,Y+12,Y+40]){let i=e.posAtCoords({left:r,top:n.top+t});if(i)return i.pos}return null}function It(e,t){let n=t.getBoundingClientRect(),r=n.left+n.width/2;for(let t of[Y+1,Y+12,Y+40]){let i=e.posAtCoords({x:r,y:n.top+t});if(i!==null)return i}return null}function Lt(e){let{from:t,to:n,docName:r,ytext:i}=e;t===`wysiwyg`&&n===`source`?Rt(r,i):t===`source`&&n===`wysiwyg`&&zt(r,i)}function Rt(e,t){let n=pt(e);if(n&&n.kind!==`selection-offset`)return;let i=r(e);if(!i)return;let a=A(i);if(!a)return;let o=Pt();if(!o)return;let s=Ft(a,o);if(s===null)return;let c=Tt(a.state.doc,s,t,wt());c&&ft(e,c)}function zt(e,t){let n=a(e);if(!n)return;let i=Pt();if(!i)return;let o=It(n,i);if(o===null)return;let s=r(e),c=s?A(s)?.state.doc:void 0,l=Dt(t.toString(),o,t,wt(),c);l&>(e,l)}function Bt(e){let{view:t,docName:n,navigation:i,ydoc:a,transition:o}=e,s=r(n),c=s?A(s)?.state.doc:void 0;if(!c)return null;let l=kt(i,{source:t.state.doc.toString(),pmDoc:c,ydoc:a,resolver:wt()});if(!l)return null;let d=Pt();if(!d)return null;let f=l,p=i.intent===`jump`,m=p?f.point:f.blockStart;t.dispatch({effects:be.scrollIntoView(m,{y:`start`})});let h=!1,g=null,_=u(n,{yieldsToNavigation:!p,supersede:()=>{h=!0,_.release()}}),v=e=>{if(!h){if(At(t,m)===null&&e<8){requestAnimationFrame(()=>v(e+1));return}try{p&&(t.dispatch({selection:he.cursor(m)}),t.focus())}finally{_.release()}g=ze({docName:n,container:d,contentColumn:t.contentDOM,measureTarget:()=>jt(t,d,m),placement:p?`center`:`top`,intent:p?`jump`:`toggle`,grade:f.confidence,landedMode:`source`,transition:o,toolbarOffset:Y,onOutcome:p?e=>{e.status===`landed`&&ot(t,f.blockStart,f.blockEnd,f.confidence)}:void 0,onDiscardQueuedTarget:()=>ht(n)})}};return v(0),{cancel:e=>{h=!0,_.release(),g?.cancel(e)}}}function Vt(e){let{editor:t,docName:n,navigation:r,ydoc:i,transition:a}=e,o=A(t);if(!o)return null;let s=Ot(r,{source:i.getText(`source`).toString(),pmDoc:o.state.doc,ydoc:i,resolver:wt()});if(!s)return null;let c=Pt();if(!c)return null;let l=s;return ze({docName:n,container:c,contentColumn:o.dom,measureTarget:()=>Nt(o,c,l.point),placement:`top`,intent:`toggle`,grade:l.confidence,landedMode:`wysiwyg`,transition:a,toolbarOffset:Y,onDiscardQueuedTarget:()=>yt(n)})}var X=e(h(),1),Z=b(),Q=t();function Ht(e){let t=(0,Z.c)(14),{scope:n,onScopeChange:r,projectLabel:i}=e,{_:a}=_(),o;t[0]===r?o=t[1]:(o=e=>{e&&r(e)},t[0]=r,t[1]=o);let s;t[2]===a?s=t[3]:(s=a({id:`aBgwis`}),t[2]=a,t[3]=s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(N,{value:`doc`,className:`flex-1`,"data-testid":`panel-scope-doc`,children:(0,Q.jsx)(g,{id:`UpCz01`})}),t[4]=c):c=t[4];let l;t[5]===i?l=t[6]:(l=i??(0,Q.jsx)(g,{id:`e0NrBM`}),t[5]=i,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,Q.jsx)(N,{value:`project`,className:`flex-1`,"data-testid":`panel-scope-project`,children:l}),t[7]=l,t[8]=u);let d;return t[9]!==n||t[10]!==o||t[11]!==s||t[12]!==u?(d=(0,Q.jsx)(`div`,{className:`shrink-0 px-4 pb-2`,children:(0,Q.jsxs)(P,{type:`single`,variant:`segmented`,size:`sm`,spacing:1,value:n,onValueChange:o,"aria-label":s,className:`w-full rounded-md bg-muted p-0.5 dark:bg-background`,children:[c,u]})}),t[9]=n,t[10]=o,t[11]=s,t[12]=u,t[13]=d):d=t[13],d}var Ut=null,Wt=[];function Gt(e){if(e===Ut)return Wt;let t=Kt(e);return Ut=e,Wt=t,t}function Kt(e){let t=[],n=new Map,r=I();for(let i=qt(e);i<=e.lines;i++){let a=e.line(i);if(r(a.text))continue;let o=V(a.text,n);o&&t.push({slug:o.slug,from:a.from})}return t}function qt(e){if(!Jt(e.line(1).text))return 1;for(let t=2;t<=e.lines;t++)if(Jt(e.line(t).text))return t+1;return 1}function Jt(e){return U.test(e.endsWith(`\r`)?e.slice(0,-1):e)}function Yt(e){let t=document.getElementById(e);return t?t.getBoundingClientRect().top:null}function Xt(e){let t=new Map;for(let n of Gt(e.state.doc))t.set(n.slug,n.from);let n=e.documentTop;return r=>{let i=t.get(r);return i===void 0?null:n+e.lineBlockAt(i).top}}function Zt(e,t){let n=(0,Z.c)(9),r;n[0]===t?r=n[1]:(r=t===void 0?{}:t,n[0]=t,n[1]=r);let{isSourceMode:o,docName:s}=r,c=o===void 0?!1:o,[l,u]=(0,X.useState)(void 0),d=(0,X.useRef)(null),f;n[2]===s?f=n[3]:(f=()=>s?a(s):null,n[2]=s,n[3]=f);let p=(0,X.useSyncExternalStore)(i,f,Qt),m,h;return n[4]!==c||n[5]!==e||n[6]!==p?(m=()=>{if(e.length===0||c&&!p){u(void 0);return}let t=function(){let t=c&&p?Xt(p):Yt,n=window.innerHeight/2,r,i;for(let a of e){let e=t(a);e!==null&&(e<0?r=a:i===void 0&&e<n&&(i=a))}u(i??r??e[0])},n=function(){d.current===null&&(d.current=requestAnimationFrame(()=>{d.current=null,t()}))};return document.addEventListener(`scroll`,n,{capture:!0,passive:!0}),t(),()=>{document.removeEventListener(`scroll`,n,{capture:!0}),d.current!==null&&(cancelAnimationFrame(d.current),d.current=null)}},h=[e,c,p],n[4]=c,n[5]=e,n[6]=p,n[7]=m,n[8]=h):(m=n[7],h=n[8]),(0,X.useEffect)(m,h),l}function Qt(){return null}var $t=300;async function en(e){let t=await fetch(`/api/page-headings?docName=${encodeURIComponent(e)}`),n;try{n=await t.json()}catch(e){throw new j(K._({id:`qAQVSD`}),{cause:e,status:t.status})}if(!t.ok){let e=G.safeParse(n);throw e.success?Error(e.data.title):new j(K._({id:`zlErBl`}),{status:t.status})}let r=W.safeParse(n);if(!r.success)throw new j(K._({id:`XW18jo`}),{status:t.status});return r.data.headings??[]}var tn=32,nn=12,rn=6,an=`open-knowledge:outline-nav`;function on(e){let t=(0,Z.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Q.jsx)(fe,{name:`outline-panel`,children:(0,Q.jsx)(sn,{...e})}),t[0]=e,t[1]=n),n}function sn(e){let t=(0,Z.c)(53),{docName:n,isSourceMode:r,className:i}=e,a=i===void 0?``:i,{_:o}=_(),{pages:s,loading:c}=ne(),l=v(),{activeProvider:u,activeDocName:f}=d(),p,m;t[0]===n?(p=t[1],m=t[2]):(p=[`page-headings`,n],m=()=>en(n),t[0]=n,t[1]=p,t[2]=m);let h;t[3]!==n||t[4]!==c||t[5]!==s?(h=!c&&(s.has(n)||L(n)),t[3]=n,t[4]=c,t[5]=s,t[6]=h):h=t[6];let b;t[7]!==p||t[8]!==m||t[9]!==h?(b={queryKey:p,queryFn:m,enabled:h,staleTime:1/0},t[7]=p,t[8]=m,t[9]=h,t[10]=b):b=t[10];let{data:S,isLoading:C,error:w}=y(b),T;t[11]===S?T=t[12]:(T=S===void 0?[]:S,t[11]=S,t[12]=T);let E=T,D,O;t[13]!==f||t[14]!==u||t[15]!==n||t[16]!==l?(D=()=>{if(!u||f!==n)return;let e=u.document,t=null,r=()=>{t!==null&&clearTimeout(t),t=setTimeout(()=>{t=null,l.invalidateQueries({queryKey:[`page-headings`,n]})},$t)};return e.on(`update`,r),()=>{e.off(`update`,r),t!==null&&clearTimeout(t)}},O=[u,f,n,l],t[13]=f,t[14]=u,t[15]=n,t[16]=l,t[17]=D,t[18]=O):(D=t[17],O=t[18]),(0,X.useEffect)(D,O);let k;t[19]===E?k=t[20]:(k=E.map(cn),t[19]=E,t[20]=k);let A=k,j;t[21]!==n||t[22]!==r?(j={isSourceMode:r,docName:n},t[21]=n,t[22]=r,t[23]=j):j=t[23];let M=Zt(A,j),N;t[24]!==M||t[25]!==E?(N=M?E.findIndex(e=>e.slug===M):-1,t[24]=M,t[25]=E,t[26]=N):N=t[26];let P=N,F;t[27]!==n||t[28]!==r?(F=function(e,t){let i={index:e,slug:t,mode:r?`source`:`wysiwyg`};i.mode===`source`&&ft(n,{kind:`outline`,detail:i}),window.dispatchEvent(new CustomEvent(an,{detail:i}))},t[27]=n,t[28]=r,t[29]=F):F=t[29];let I=F,R=((P>=0?E[P].level:1)-1)*nn+(nn-rn)/2,z=P*tn+(tn-rn)/2,B;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Q.jsx)(Se,{children:(0,Q.jsx)(g,{id:`dD7NPy`})}),t[30]=B):B=t[30];let V;t[31]!==E.length||t[32]!==C?(V=!C&&(0,Q.jsx)(Te,{children:E.length}),t[31]=E.length,t[32]=C,t[33]=V):V=t[33];let H;t[34]===V?H=t[35]:(H=(0,Q.jsxs)(Ee,{children:[B,V]}),t[34]=V,t[35]=H);let U;t[36]!==o||t[37]!==P||t[38]!==M||t[39]!==w||t[40]!==I||t[41]!==E||t[42]!==C||t[43]!==R||t[44]!==z?(U=w?(0,Q.jsx)(xe,{className:`px-2`,children:w instanceof Error?w.message:o({id:`GuqOb1`})}):E.length===0&&!C?(0,Q.jsx)(Ce,{className:`px-2`,children:(0,Q.jsx)(g,{id:`0BB9ID`})}):(0,Q.jsxs)(`nav`,{"aria-label":o({id:`BymzO4`}),className:`relative`,children:[P>=0&&(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`pointer-events-none absolute left-0 top-0 rounded-full bg-primary motion-safe:[transition:transform_0.25s_var(--ease-out-strong)]`,style:{width:rn,height:rn,transform:`translate(${R}px, ${z}px)`}}),E.map((e,t)=>{let n=e.slug===M;return(0,Q.jsx)(`button`,{type:`button`,"aria-current":n?`location`:void 0,onClick:()=>I(t,e.slug),className:x(`w-full cursor-pointer truncate py-1.5 pe-2 text-left text-sm transition-colors`,n?`font-medium text-primary`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${(e.level-1)*nn+20}px`},title:e.text,children:e.text},t)})]}),t[36]=o,t[37]=P,t[38]=M,t[39]=w,t[40]=I,t[41]=E,t[42]=C,t[43]=R,t[44]=z,t[45]=U):U=t[45];let W;t[46]!==C||t[47]!==U?(W=(0,Q.jsx)(we,{className:`px-3 py-2`,"aria-busy":C,children:U}),t[46]=C,t[47]=U,t[48]=W):W=t[48];let G;return t[49]!==a||t[50]!==H||t[51]!==W?(G=(0,Q.jsxs)(De,{className:a,children:[H,W]}),t[49]=a,t[50]=H,t[51]=W,t[52]=G):G=t[52],G}function cn(e){return e.slug}var ln=`audit-superseded`;async function un(e={kind:`project`}){return fn(e,H,!1)}async function dn(e={kind:`project`},t){return fn(e,F,!0,t)}async function fn(e,t,n,r){try{let i=new URLSearchParams;e.kind===`path`?i.set(`path`,e.path):e.kind===`doc`&&i.set(`doc`,e.docName),n&&i.set(`counts`,`1`);let a=i.size===0?``:`?${i}`,o=await fetch(`/api/audit${a}`,r===void 0?void 0:{signal:r});if(!o.ok)return o.status===409?ln:(console.warn(`[audit] request failed`,o.status,o.statusText),null);let s;try{s=await o.json()}catch{return r?.aborted===!0||console.warn(`[audit] response body is not valid JSON`),null}let c=t.safeParse(s);return c.success?c.data:(console.warn(`[audit] response failed schema validation`,c.error.issues),null)}catch(e){return r?.aborted===!0||console.warn(`[audit] fetch threw`,e),null}}function pn(e){let t=(0,Z.c)(4),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[],t[0]=n):n=t[0];let[r,i]=(0,X.useState)(n),a,o;return t[1]===e?(a=t[2],o=t[3]):(a=()=>{if(i(gn),e===null)return;let t=!1,n=()=>{un({kind:`doc`,docName:e}).then(e=>{if(t||e===null||e===`audit-superseded`)return;let n=e.files.flatMap(hn).filter(mn);i(e=>e.length===0&&n.length===0?e:n)})};n();let r=de(e=>{e.includes(`backlinks`)&&n()});return()=>{t=!0,r()}},o=[e],t[1]=e,t[2]=a,t[3]=o),(0,X.useEffect)(a,o),r}function mn(e){return e.source===`links`}function hn(e){return e.diagnostics}function gn(e){return e.length===0?e:[]}var _n={errorCount:0,warningCount:0},$=new Map,vn=new Set,yn=new Map;function bn(){let e=new Map;for(let[t,n]of $){let r=n.lint.errorCount+n.links.errorCount,i=n.lint.warningCount+n.links.warningCount;r===0&&i===0||e.set(t,{errorCount:r,warningCount:i})}yn=e;for(let e of vn)e()}var xn=z;function Sn(e){return vn.add(e),()=>{vn.delete(e)}}function Cn(){return yn}function wn(e){$.clear();for(let t of e)$.set(le(t.file),xn(t.diagnostics));bn()}function Tn(e){$.clear();for(let t of e)$.set(le(t.file),{lint:t.lint,links:t.links});bn()}function En(e,t){$.set(e,xn(t)),bn()}function Dn(e,t,n){let r=$.get(e)??{lint:_n,links:_n},i=r[t];i.errorCount===n.errorCount&&i.warningCount===n.warningCount||($.set(e,{...r,[t]:n}),bn())}var On=`open-knowledge:lint-nav`;function kn(e,t){return e.range.start.line-t.range.start.line||e.range.start.character-t.range.start.character}function An(e){return{line:e.range.start.line+1,column:e.range.start.character+1}}function jn(e){let t=(0,Z.c)(35),{diagnostic:n,instanceCount:r}=e,{_:i}=_(),a=n.severity===`error`?te:ae,s=n.range.start.line+1,c=n.source===`links`,l=r!==void 0&&r>1,u=n.severity===`error`?`text-destructive`:`text-amber-500`,d;t[0]===u?d=t[1]:(d=x(`mt-0.5 size-3.5 shrink-0`,u),t[0]=u,t[1]=d);let f;t[2]!==a||t[3]!==d?(f=(0,Q.jsx)(a,{"aria-hidden":`true`,className:d}),t[2]=a,t[3]=d,t[4]=f):f=t[4];let p;t[5]===n.message?p=t[6]:(p=(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 text-foreground`,children:n.message}),t[5]=n.message,t[6]=p);let m;t[7]!==l||t[8]!==r?(m=l?(0,Q.jsxs)(`span`,{className:`mt-0.5 flex shrink-0 items-center gap-1`,children:[(0,Q.jsx)(J,{variant:`gray`,"data-testid":`problems-instance-count`,className:`h-4 px-1 font-sans text-[10px] leading-none`,children:(0,Q.jsx)(g,{id:`iZCZmF`,values:{instanceCount:r}})}),(0,Q.jsx)(ee,{"aria-hidden":`true`,className:`size-3 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`})]}):null,t[7]=l,t[8]=r,t[9]=m):m=t[9];let h;t[10]!==f||t[11]!==p||t[12]!==m?(h=(0,Q.jsxs)(`span`,{className:`flex items-start gap-1.5 text-sm`,children:[f,p,m]}),t[10]=f,t[11]=p,t[12]=m,t[13]=h):h=t[13];let v=c&&`gap-0.5`,y;t[14]===v?y=t[15]:(y=x(`h-4 shrink-0 px-1 font-sans text-[10px] uppercase leading-none`,v),t[14]=v,t[15]=y);let b;t[16]===c?b=t[17]:(b=c?(0,Q.jsx)(o,{"aria-hidden":`true`,className:`size-2.5`}):null,t[16]=c,t[17]=b);let S;t[18]!==n.source||t[19]!==y||t[20]!==b?(S=(0,Q.jsxs)(J,{variant:`gray`,"data-testid":`problems-source-tag`,className:y,children:[b,n.source]}),t[18]=n.source,t[19]=y,t[20]=b,t[21]=S):S=t[21];let C;t[22]!==i||t[23]!==n.code||t[24]!==s||t[25]!==l?(C=l?n.code:`${n.code} · ${i({id:`enPTnx`,values:{displayLine:s}})}`,t[22]=i,t[23]=n.code,t[24]=s,t[25]=l,t[26]=C):C=t[26];let w;t[27]===C?w=t[28]:(w=(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,children:C}),t[27]=C,t[28]=w);let T;t[29]!==S||t[30]!==w?(T=(0,Q.jsxs)(`span`,{className:`flex items-center gap-1.5 ps-5 font-mono text-xs text-muted-foreground`,children:[S,w]}),t[29]=S,t[30]=w,t[31]=T):T=t[31];let E;return t[32]!==T||t[33]!==h?(E=(0,Q.jsxs)(Q.Fragment,{children:[h,T]}),t[32]=T,t[33]=h,t[34]=E):E=t[34],E}function Mn(e){let t=new Map;for(let n of e){let e=`${n.source}/${n.code}\u0000${n.linkTarget??``}\u0000${n.message}`,r=t.get(e);r===void 0?t.set(e,{key:e,instances:[n]}):r.instances.push(n)}return[...t.values()]}function Nn(e){let t=(0,Z.c)(43),{group:n,onNavigate:r,navTitle:i,renderActions:a}=e,{_:o}=_(),s=n.instances[0];if(n.instances.length===1){let e;t[0]!==s||t[1]!==a?(e=a(s),t[0]=s,t[1]=a,t[2]=e):e=t[2];let n=e,o;t[3]!==s||t[4]!==r?(o=()=>r(s),t[3]=s,t[4]=r,t[5]=o):o=t[5];let c;t[6]!==s||t[7]!==i?(c=i(s),t[6]=s,t[7]=i,t[8]=c):c=t[8];let l;t[9]===s?l=t[10]:(l=(0,Q.jsx)(jn,{diagnostic:s}),t[9]=s,t[10]=l);let u;t[11]!==o||t[12]!==c||t[13]!==l?(u=(0,Q.jsx)(`button`,{type:`button`,onClick:o,className:`flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left`,title:c,children:l}),t[11]=o,t[12]=c,t[13]=l,t[14]=u):u=t[14];let d;t[15]===n?d=t[16]:(d=n===null?null:(0,Q.jsx)(`div`,{className:`absolute bottom-1 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none`,children:n}),t[15]=n,t[16]=d);let f;return t[17]!==u||t[18]!==d?(f=(0,Q.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[u,d]}),t[17]=u,t[18]=d,t[19]=f):f=t[19],f}let c;t[20]!==s||t[21]!==n.instances.length?(c=(0,Q.jsx)(D,{className:`group flex w-full cursor-pointer flex-col gap-0.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,children:(0,Q.jsx)(jn,{diagnostic:s,instanceCount:n.instances.length})}),t[20]=s,t[21]=n.instances.length,t[22]=c):c=t[22];let l;t[23]!==o||t[24]!==s.message?(l=o({id:`EUiJEM`,values:{0:s.message}}),t[23]=o,t[24]=s.message,t[25]=l):l=t[25];let u;if(t[26]!==o||t[27]!==n.instances||t[28]!==i||t[29]!==r||t[30]!==a){let e;t[32]!==o||t[33]!==i||t[34]!==r||t[35]!==a?(e=e=>{let t=a(e),n=e.range.start.line+1;return(0,Q.jsxs)(`li`,{className:`group relative rounded transition-colors hover:bg-muted`,children:[(0,Q.jsx)(`button`,{type:`button`,onClick:()=>r(e),className:`flex w-full cursor-pointer rounded px-2 py-1 text-left font-mono text-xs text-muted-foreground`,title:i(e),"aria-label":o({id:`uCe4AX`,values:{0:e.message,displayLine:n}}),children:o({id:`enPTnx`,values:{displayLine:n}})}),t===null?null:(0,Q.jsx)(`div`,{className:`absolute bottom-0.5 right-1 flex items-center gap-1 rounded bg-muted opacity-0 transition-opacity focus-within:opacity-100 group-hover:opacity-100 motion-reduce:transition-none`,children:t})]},Pn(e))},t[32]=o,t[33]=i,t[34]=r,t[35]=a,t[36]=e):e=t[36],u=n.instances.map(e),t[26]=o,t[27]=n.instances,t[28]=i,t[29]=r,t[30]=a,t[31]=u}else u=t[31];let d;t[37]!==l||t[38]!==u?(d=(0,Q.jsx)(E,{className:`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in] motion-reduce:animate-none`,children:(0,Q.jsx)(`ul`,{"aria-label":l,className:`flex flex-col gap-0.5 pb-1 ps-5`,"data-testid":`problems-duplicate-instances`,children:u})}),t[37]=l,t[38]=u,t[39]=d):d=t[39];let f;return t[40]!==c||t[41]!==d?(f=(0,Q.jsx)(`li`,{className:`rounded`,"data-testid":`problems-duplicate-group`,children:(0,Q.jsxs)(O,{children:[c,d]})}),t[40]=c,t[41]=d,t[42]=f):f=t[42],f}function Pn(e){return`${e.source}/${e.code}-${e.range.start.line}-${e.range.start.character}-${e.message}`}function Fn(e){return e.reduce((e,t)=>e+ +((t.fixes?.length??0)>0),0)}function In(e){let t=(0,Z.c)(11),{target:n,creating:r,disabled:i,onCreate:a}=e,{_:o}=_(),s;t[0]!==o||t[1]!==n?(s=o({id:`oWsZk8`,values:{target:n}}),t[0]=o,t[1]=n,t[2]=s):s=t[2];let c;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(M,{"aria-hidden":`true`,className:`size-3`}),t[3]=c):c=t[3];let l;t[4]===r?l=t[5]:(l=r?(0,Q.jsx)(g,{id:`E9bKSA`}):(0,Q.jsx)(g,{id:`XRuL0i`}),t[4]=r,t[5]=l);let u;return t[6]!==i||t[7]!==a||t[8]!==s||t[9]!==l?(u=(0,Q.jsxs)(S,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:i,onClick:a,"aria-label":s,"data-testid":`problems-create-page`,children:[c,l]}),t[6]=i,t[7]=a,t[8]=s,t[9]=l,t[10]=u):u=t[10],u}function Ln(e){let t=(0,Z.c)(8),{tip:n,testId:r,children:i}=e,a;t[0]===i?a=t[1]:(a=(0,Q.jsx)(C,{asChild:!0,children:(0,Q.jsx)(`span`,{className:`inline-flex shrink-0`,children:i})}),t[0]=i,t[1]=a);let o;t[2]!==r||t[3]!==n?(o=(0,Q.jsx)(w,{"data-testid":r,children:n}),t[2]=r,t[3]=n,t[4]=o):o=t[4];let s;return t[5]!==a||t[6]!==o?(s=(0,Q.jsxs)(T,{children:[a,o]}),t[5]=a,t[6]=o,t[7]=s):s=t[7],s}function Rn(e){let t=(0,Z.c)(21),{count:n,problemCount:r,aiAvailable:i,disabled:a,onClick:o,children:s}=e,{_:c}=_(),l;t[0]!==i||t[1]!==n||t[2]!==r?(l=n>0?(0,Q.jsx)(g,{id:`vjwsDi`,values:{count:n}}):r===0?(0,Q.jsx)(g,{id:`gAhHu7`}):i?(0,Q.jsx)(g,{id:`zA9zRL`}):(0,Q.jsx)(g,{id:`X3MMeA`}),t[0]=i,t[1]=n,t[2]=r,t[3]=l):l=t[3];let u;t[4]!==c||t[5]!==s||t[6]!==n||t[7]!==r?(u=s===void 0?r===0?c({id:`4m-xuX`}):n===0?c({id:`SqIoy_`}):void 0:void 0,t[4]=c,t[5]=s,t[6]=n,t[7]=r,t[8]=u):u=t[8];let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Q.jsx)(oe,{"aria-hidden":`true`,className:`size-3`}),t[9]=d):d=t[9];let f;t[10]!==s||t[11]!==n?(f=s??(0,Q.jsx)(g,{id:`RZXTlY`,values:{count:n}}),t[10]=s,t[11]=n,t[12]=f):f=t[12];let p;t[13]!==a||t[14]!==o||t[15]!==u||t[16]!==f?(p=(0,Q.jsxs)(S,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:a,onClick:o,"aria-label":u,"data-testid":`problems-auto-fix`,children:[d,f]}),t[13]=a,t[14]=o,t[15]=u,t[16]=f,t[17]=p):p=t[17];let m;return t[18]!==l||t[19]!==p?(m=(0,Q.jsx)(Ln,{testId:`problems-auto-fix-tip`,tip:l,children:p}),t[18]=l,t[19]=p,t[20]=m):m=t[20],m}function zn(e){let t=(0,Z.c)(12),{count:n,disabled:r,onClick:i}=e,a;t[0]===n?a=t[1]:(a=(0,Q.jsx)(g,{id:`mgDKWS`,values:{count:n}}),t[0]=n,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Q.jsx)(l,{"aria-hidden":`true`,className:`size-3`}),t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,Q.jsx)(g,{id:`gyHDWC`,values:{count:n}}),t[3]=n,t[4]=s);let c;t[5]!==r||t[6]!==i||t[7]!==s?(c=(0,Q.jsxs)(S,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,disabled:r,onClick:i,"data-testid":`problems-fix-with-ai`,children:[o,s]}),t[5]=r,t[6]=i,t[7]=s,t[8]=c):c=t[8];let u;return t[9]!==a||t[10]!==c?(u=(0,Q.jsx)(Ln,{testId:`problems-fix-with-ai-tip`,tip:a,children:c}),t[9]=a,t[10]=c,t[11]=u):u=t[11],u}function Bn(e){let t=(0,Z.c)(18),{docName:n,diagnostics:r,onFix:i,onAutoFix:a,onAskAi:o,onFixWithAi:s}=e,{_:c}=_(),[u,d]=(0,X.useState)(`doc`),{data:f}=Me(),m=f===null?null:f.effective.enabled?Oe.filter(e=>f.effective.plugins[e.id].enabled):[],h=m!==null&&m.length===0,v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={status:`idle`},t[0]=v):v=t[0];let[y,b]=(0,X.useState)(v),[x,E]=(0,X.useState)(null),D=re(),[O,k]=(0,X.useState)(null),A=(0,X.useRef)(!0),j,M;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(j=()=>(A.current=!0,()=>{A.current=!1}),M=[],t[1]=j,t[2]=M):(j=t[1],M=t[2]),(0,X.useEffect)(j,M);let N=(0,X.useRef)(qn),P;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(P={status:`idle`},t[3]=P):P=t[3];let F=(0,X.useRef)(P),I;t[4]===y?I=t[5]:(I=()=>{y.status!==`loading`&&(F.current=y)},t[4]=y,t[5]=I),(0,X.useEffect)(I);let L=(0,X.useRef)(0),R=[...r].sort(kn),z=Fn(R),B=async function(e){let t=e.linkTarget;if(!(t===void 0||O!==null||D===null)){k(t);try{await p({initialDir:``,suggestedName:t},{addPage:D.addPage})}catch(e){let t=e;se.error(t instanceof Error?t.message:c({id:`tfi40B`})),A.current&&k(null);return}se.success(c({id:`EWCJFu`,values:{target:t}})),A.current&&k(null),A.current&&y.status===`loaded`&&await V()}};async function V(){L.current+=1;let e=L.current,t=F.current;b({status:`loading`});let n=await un();if(n===`audit-superseded`){L.current===e&&A.current&&b(t.status===`idle`?{status:`failed`}:t);return}n!==null&&wn(n.files),A.current&&b(n===null?{status:`failed`}:{status:`loaded`,result:n})}let H=y.status===`loaded`?y.result.files.filter(Gn):[],U=async function(){if(x!==null||H.length===0)return;E({done:0,total:H.length});let e=[];for(let t of H){let n=await Ae(le(t.file));if(!A.current)return;n.ok||e.push({file:t.file,detail:n.errorDetail}),E(Wn)}if(E(null),e.length>0){let t=e[0];se.error(c({id:`fru3T7`,values:{0:e.length,1:H.length}}),{description:t===void 0?void 0:`${t.file}${t.detail===null?``:` — ${t.detail}`}`})}try{await V()}catch{A.current&&b({status:`failed`})}},W=function(e){d(e),e===`project`&&y.status===`idle`&&V()};(0,X.useEffect)(()=>{N.current=()=>{y.status===`idle`||y.status===`failed`||V()}});let G;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(G=[],t[6]=G):G=t[6],(0,X.useEffect)(()=>je(()=>N.current()),G);let ee;t[7]===n?ee=t[8]:(ee=function(e){let t=An(e);ft(n,{kind:`lint`,detail:t}),window.dispatchEvent(new CustomEvent(On,{detail:t}))},t[7]=n,t[8]=ee);let te=ee,ne;t[9]!==n||t[10]!==te?(ne=function(e,t){let r=le(e);if(r===n){te(t);return}ft(r,{kind:`lint`,detail:An(t)}),window.location.hash=ce(r)},t[9]=n,t[10]=te,t[11]=ne):ne=t[11];let ie=ne,ae=function(e){let t=i!==void 0&&(e.fixes?.length??0)>0,n=e.linkTarget!==void 0&&D!==null;if(!t&&!n&&o===void 0)return null;let r=`${e.source}/${e.code}`;return(0,Q.jsxs)(Q.Fragment,{children:[n?(0,Q.jsx)(In,{target:e.linkTarget??``,creating:O===e.linkTarget,disabled:O!==null,onCreate:()=>void B(e)}):null,t?(0,Q.jsxs)(S,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>i?.(e),"aria-label":c({id:`fZj9em`,values:{flatId:r}}),"data-testid":`problems-fix`,children:[(0,Q.jsx)(oe,{"aria-hidden":`true`,className:`size-3`}),(0,Q.jsx)(g,{id:`c4fVUV`})]}):null,o===void 0?null:(0,Q.jsxs)(S,{size:`sm`,variant:`ghost`,className:`h-6 shrink-0 px-2 text-xs`,onClick:()=>o(e),"aria-label":c({id:`hh4mVC`,values:{flatId:r}}),"data-testid":`problems-ask-ai`,children:[(0,Q.jsx)(l,{"aria-hidden":`true`,className:`size-3`}),(0,Q.jsx)(g,{id:`xWEvuo`})]})]})},K;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Q.jsx)(Se,{children:(0,Q.jsx)(g,{id:`OXdGnd`})}),t[12]=K):K=t[12];let de=m!==null&&m.length>0&&(0,Q.jsxs)(T,{children:[(0,Q.jsx)(C,{className:`shrink-0 cursor-default rounded-md bg-muted-foreground/5 px-2 py-1 font-mono text-xs text-muted-foreground`,"data-testid":`problems-active-plugins`,children:(0,Q.jsx)(g,{id:`yxF19Y`,values:{0:m.length}})}),(0,Q.jsx)(w,{"data-testid":`problems-active-plugins-tooltip`,children:(0,Q.jsx)(g,{id:`ws5o1F`,values:{0:m.map(Un).join(`, `)}})})]}),q;t[13]===de?q=t[14]:(q=(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[K,de]}),t[13]=de,t[14]=q);let fe=u===`doc`&&R.length>0&&(0,Q.jsx)(Te,{children:R.length}),J;return t[15]!==q||t[16]!==fe?(J=(0,Q.jsxs)(Ee,{children:[q,fe]}),t[15]=q,t[16]=fe,t[17]=J):J=t[17],(0,Q.jsxs)(De,{children:[J,(0,Q.jsx)(Ht,{scope:u,onScopeChange:W}),u===`doc`?(0,Q.jsx)(we,{className:`px-2 py-2`,children:R.length===0?h?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Ce,{className:`px-2`,"data-testid":`problems-no-plugins`,children:(0,Q.jsx)(g,{id:`Hngy37`})}),(0,Q.jsx)(`div`,{className:`px-2 pt-2`,children:(0,Q.jsx)(S,{variant:`outline`,size:`sm`,onClick:ue,"data-testid":`problems-enable-plugins`,children:(0,Q.jsx)(g,{id:`rnX-1S`})})})]}):(0,Q.jsx)(Ce,{className:`px-2`,children:(0,Q.jsx)(g,{id:`ZI8uvA`})}):(0,Q.jsxs)(Q.Fragment,{children:[a!==void 0||s!==void 0?(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1 px-2 pb-1`,children:[a!==void 0&&(0,Q.jsx)(Rn,{count:z,problemCount:R.length,aiAvailable:s!==void 0,disabled:z===0,onClick:a}),s!==void 0&&(0,Q.jsx)(zn,{count:R.length,disabled:!1,onClick:()=>s(`doc`)})]}):null,(0,Q.jsx)(`ul`,{"aria-label":c({id:`OXdGnd`}),className:`flex flex-col gap-0.5`,children:Mn(R).map(e=>(0,Q.jsx)(Nn,{group:e,onNavigate:te,navTitle:e=>c({id:`vbMHjo`,values:{0:e.range.start.line+1}}),renderActions:ae},e.key))})]})}):(0,Q.jsx)(Jn,{audit:y,onRefresh:()=>void V(),onNavigate:ie,fixableCount:H.reduce(Hn,0),problemCount:y.status===`loaded`?y.result.files.reduce(Vn,0):0,fixing:x,onAutoFix:()=>void U(),onFixWithAi:s===void 0||y.status!==`loaded`?void 0:()=>s(`project`),onCreateTarget:D===null?void 0:e=>void B(e),creatingTarget:O})]})}function Vn(e,t){return e+t.diagnostics.length}function Hn(e,t){return e+Fn(t.diagnostics)}function Un(e){return e.label}function Wn(e){return e===null?e:{...e,done:e.done+1}}function Gn(e){return e.diagnostics.some(Kn)}function Kn(e){return(e.fixes?.length??0)>0}function qn(){}function Jn(e){let t=(0,Z.c)(57),{audit:n,onRefresh:r,onNavigate:i,fixableCount:a,problemCount:o,fixing:s,onAutoFix:c,onFixWithAi:l,onCreateTarget:u,creatingTarget:d}=e,{_:f}=_(),p=n.status===`loading`||n.status===`idle`,m;t[0]!==n.result||t[1]!==n.status?(m=n.status===`loaded`&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(g,{id:`DsDwR-`,values:{0:n.result.errorCount}}),` · `,(0,Q.jsx)(g,{id:`W1SI2K`,values:{0:n.result.warningCount}})]}),t[0]=n.result,t[1]=n.status,t[2]=m):m=t[2];let h;t[3]===m?h=t[4]:(h=(0,Q.jsx)(`p`,{className:`min-w-0 truncate text-xs text-muted-foreground`,"data-testid":`problems-audit-summary`,children:m}),t[3]=m,t[4]=h);let v;t[5]===f?v=t[6]:(v=f({id:`I7y_vn`}),t[5]=f,t[6]=v);let y=p||s!==null,b;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Q.jsx)(ie,{"aria-hidden":`true`,className:`size-3.5`}),t[7]=b):b=t[7];let x;t[8]!==r||t[9]!==v||t[10]!==y?(x=(0,Q.jsx)(C,{asChild:!0,children:(0,Q.jsx)(S,{variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground`,"aria-label":v,"data-testid":`problems-audit-refresh`,disabled:y,onClick:r,children:b})}),t[8]=r,t[9]=v,t[10]=y,t[11]=x):x=t[11];let E;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Q.jsx)(w,{"data-testid":`problems-audit-refresh-tooltip`,children:(0,Q.jsx)(g,{id:`I7y_vn`})}),t[12]=E):E=t[12];let D;t[13]===x?D=t[14]:(D=(0,Q.jsxs)(T,{children:[x,E]}),t[13]=x,t[14]=D);let O;t[15]!==h||t[16]!==D?(O=(0,Q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[h,D]}),t[15]=h,t[16]=D,t[17]=O):O=t[17];let k;t[18]!==f||t[19]!==s?(k=s===null?null:(0,Q.jsx)(`span`,{className:`sr-only`,role:`status`,children:f({id:`gZElfU`,values:{0:s.done,1:s.total}})}),t[18]=f,t[19]=s,t[20]=k):k=t[20];let A=l!==void 0,j=p||s!==null||a===0,M;t[21]===s?M=t[22]:(M=s===null?void 0:(0,Q.jsx)(g,{id:`S9t1PI`,values:{0:s.done,1:s.total}}),t[21]=s,t[22]=M);let N;t[23]!==a||t[24]!==c||t[25]!==o||t[26]!==A||t[27]!==j||t[28]!==M?(N=(0,Q.jsx)(Rn,{count:a,problemCount:o,aiAvailable:A,disabled:j,onClick:c,children:M}),t[23]=a,t[24]=c,t[25]=o,t[26]=A,t[27]=j,t[28]=M,t[29]=N):N=t[29];let P;t[30]!==s||t[31]!==l||t[32]!==o?(P=l!==void 0&&o>0?(0,Q.jsx)(zn,{count:o,disabled:s!==null,onClick:l}):null,t[30]=s,t[31]=l,t[32]=o,t[33]=P):P=t[33];let F;t[34]!==k||t[35]!==N||t[36]!==P?(F=(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-1`,children:[k,N,P]}),t[34]=k,t[35]=N,t[36]=P,t[37]=F):F=t[37];let I;t[38]!==F||t[39]!==O?(I=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1 px-2 pb-1`,children:[O,F]}),t[38]=F,t[39]=O,t[40]=I):I=t[40];let L;t[41]!==f||t[42]!==p?(L=p&&(0,Q.jsx)(`div`,{className:`flex flex-col gap-1`,role:`status`,"aria-busy":`true`,"aria-label":f({id:`dx-TwN`}),children:[1,2,3].map(Yn)}),t[41]=f,t[42]=p,t[43]=L):L=t[43];let R;t[44]===n.status?R=t[45]:(R=n.status===`failed`&&(0,Q.jsx)(xe,{className:`px-2 text-xs`,children:(0,Q.jsx)(g,{id:`IFezUv`})}),t[44]=n.status,t[45]=R);let z;t[46]!==n.result||t[47]!==n.status||t[48]!==d||t[49]!==u||t[50]!==i?(z=n.status===`loaded`&&(0,Q.jsx)(Xn,{result:n.result,onNavigate:i,onCreateTarget:u,creatingTarget:d}),t[46]=n.result,t[47]=n.status,t[48]=d,t[49]=u,t[50]=i,t[51]=z):z=t[51];let B;return t[52]!==I||t[53]!==L||t[54]!==R||t[55]!==z?(B=(0,Q.jsxs)(we,{className:`px-2 py-2`,"data-testid":`problems-project-scope`,children:[I,L,R,z]}),t[52]=I,t[53]=L,t[54]=R,t[55]=z,t[56]=B):B=t[56],B}function Yn(e){return(0,Q.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded px-2 py-1.5`,children:[(0,Q.jsx)(ke,{className:`mt-0.5 size-3.5 shrink-0 rounded`}),(0,Q.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Q.jsx)(ke,{className:`h-3 w-28`}),(0,Q.jsx)(ke,{className:`h-3 w-40`})]})]},e)}function Xn(e){let t=(0,Z.c)(12),{result:n,onNavigate:r,onCreateTarget:i,creatingTarget:a}=e,{_:o}=_(),s;t[0]!==o||t[1]!==n.warnings?(s=n.warnings.length>0&&(0,Q.jsx)(`ul`,{"aria-label":o({id:`Rsdhj9`}),className:`flex flex-col gap-0.5 pb-1`,children:n.warnings.map(Zn)}),t[0]=o,t[1]=n.warnings,t[2]=s):s=t[2];let c;t[3]!==a||t[4]!==i||t[5]!==r||t[6]!==n.fileCount||t[7]!==n.files?(c=n.files.length===0?(0,Q.jsx)(Ce,{className:`px-2`,children:(0,Q.jsx)(g,{id:`k_Dqw1`,values:{0:n.fileCount}})}):n.files.map(e=>(0,Q.jsx)(Qn,{file:e,onNavigate:r,onCreateTarget:i,creatingTarget:a},e.file)),t[3]=a,t[4]=i,t[5]=r,t[6]=n.fileCount,t[7]=n.files,t[8]=c):c=t[8];let l;return t[9]!==s||t[10]!==c?(l=(0,Q.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function Zn(e,t){return(0,Q.jsxs)(`li`,{className:`flex items-start gap-1.5 px-2 text-xs`,children:[(0,Q.jsx)(ae,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-500`}),(0,Q.jsx)(`span`,{className:`min-w-0 text-foreground`,children:e})]},`${t}-${e}`)}function Qn(e){let t=(0,Z.c)(41),{file:n,onNavigate:r,onCreateTarget:i,creatingTarget:a}=e,{_:o}=_(),s,c,l,u,d,f,p,m,h;if(t[0]!==o||t[1]!==a||t[2]!==n.diagnostics||t[3]!==n.file||t[4]!==i||t[5]!==r){let e=[...n.diagnostics].sort(kn);c=O,p=!0,m=`problems-audit-group`;let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Q.jsx)(ee,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90 motion-reduce:transition-none`}),t[15]=g):g=t[15];let _;t[16]===n.file?_=t[17]:(_=(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-foreground`,title:n.file,children:n.file}),t[16]=n.file,t[17]=_),h=(0,Q.jsxs)(D,{className:`group flex w-full cursor-pointer items-center gap-1.5 rounded px-2 py-1.5 text-left transition-colors hover:bg-muted`,children:[g,_,(0,Q.jsx)(J,{variant:`gray`,"data-testid":`problems-audit-file-count`,className:`shrink-0`,children:e.length})]}),s=E,f=`overflow-hidden data-[state=open]:animate-[collapsible-down_150ms_ease-out] data-[state=closed]:animate-[collapsible-up_150ms_ease-in] motion-reduce:animate-none`,t[18]!==o||t[19]!==n.file?(l=o({id:`zAJzIg`,values:{0:n.file}}),t[18]=o,t[19]=n.file,t[20]=l):l=t[20],u=`flex flex-col gap-0.5 pb-1 ps-3`;let v;t[21]!==o||t[22]!==a||t[23]!==n.file||t[24]!==i||t[25]!==r?(v=e=>(0,Q.jsx)(Nn,{group:e,onNavigate:e=>r(n.file,e),navTitle:e=>o({id:`xKDsGS`,values:{0:e.range.start.line+1,1:n.file}}),renderActions:e=>e.linkTarget===void 0||i===void 0?null:(0,Q.jsx)(In,{target:e.linkTarget,creating:a===e.linkTarget,disabled:a!==null,onCreate:()=>i(e)})},e.key),t[21]=o,t[22]=a,t[23]=n.file,t[24]=i,t[25]=r,t[26]=v):v=t[26],d=Mn(e).map(v),t[0]=o,t[1]=a,t[2]=n.diagnostics,t[3]=n.file,t[4]=i,t[5]=r,t[6]=s,t[7]=c,t[8]=l,t[9]=u,t[10]=d,t[11]=f,t[12]=p,t[13]=m,t[14]=h}else s=t[6],c=t[7],l=t[8],u=t[9],d=t[10],f=t[11],p=t[12],m=t[13],h=t[14];let g;t[27]!==l||t[28]!==u||t[29]!==d?(g=(0,Q.jsx)(`ul`,{"aria-label":l,className:u,children:d}),t[27]=l,t[28]=u,t[29]=d,t[30]=g):g=t[30];let v;t[31]!==s||t[32]!==f||t[33]!==g?(v=(0,Q.jsx)(s,{className:f,children:g}),t[31]=s,t[32]=f,t[33]=g,t[34]=v):v=t[34];let y;return t[35]!==c||t[36]!==p||t[37]!==m||t[38]!==h||t[39]!==v?(y=(0,Q.jsxs)(c,{defaultOpen:p,"data-testid":m,children:[h,v]}),t[35]=c,t[36]=p,t[37]=m,t[38]=h,t[39]=v,t[40]=y):y=t[40],y}var $n={words:0,chars:0,tokens:0},er=/[ -〿-ゟ゠-ヿ㐀-䶿一-鿿豈---ក-]/,tr=/[\p{L}\p{N}]/u,nr=new Set([`text`,`inlineCode`,`code`,`tag`]),rr=new Set([`html`,`definition`,`footnoteDefinition`,`yaml`,`toml`,`image`,`imageReference`,`mdxFlowExpression`,`mdxTextExpression`,`mdxjsEsm`,`rawMdxFallback`,`rawMdxFallbackMdast`]),ir=new Set([`paragraph`,`heading`,`blockquote`,`list`,`listItem`,`thematicBreak`,`table`,`tableRow`,`tableCell`,`mdxJsxFlowElement`,`commentBlock`]);function ar(e,t){if(!e)return;let n=e.type;if(!rr.has(n)){if(nr.has(n)){e.value&&(t.push(e.value),n===`code`&&t.push(`
|
|
4
4
|
`));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)ar(n,t);if(ir.has(n)&&t.length>0){let e=t[t.length-1];e&&!e.endsWith(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./globals-BGbHjQJ2.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a,t as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./utils-CPqDy6Hr.js";import{t as l}from"./button-D3xSRfT4.js";import{t as u}from"./checkbox-Cq1BnJ3x.js";import{t as d}from"./label-CGqMAe0S.js";import{n as f,t as p}from"./radio-group-DxMM4tU-.js";import{Lt as m,Rt as h}from"./dist-lf4nG52q2.js";import{t as g}from"./check-D1JmbeH0.js";import{t as _}from"./loader-circle-C4uszcbe.js";import{t as v}from"./input-DcoGZoTQ.js";import{t as y}from"./dist-D6euTqbb.js";import{t as b}from"./badge-DwfQ2IQa.js";import{t as x}from"./textarea-Cl4IJ1LU.js";var S=e(r(),1),C=t(),w=s();async function T(){let e=typeof window>`u`?void 0:window.okUninstall;if(e===void 0)return null;try{let t=await e.ready();return t.kind===`screen`?t.screen:null}catch{return null}}function E(e){let t=typeof window>`u`?void 0:window.okUninstall;t!==void 0&&t.send(e).catch(()=>void 0)}var D=n();function O(e){let t=(0,w.c)(6),{items:n}=e,r;if(t[0]!==n){let e;t[2]===n.length?e=t[3]:(e=(e,t)=>(0,D.jsxs)(`li`,{className:`relative pb-5 pl-[30px] last:pb-1`,children:[t<n.length-1&&(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[22px] bottom-0.5 left-[9px] w-0.5 bg-border`}),(0,D.jsx)(`span`,{"aria-hidden":`true`,className:c(`absolute top-px left-0 inline-flex size-5 items-center justify-center rounded-full`,e.done?`bg-primary/15 text-primary`:`border-[1.5px] border-muted-foreground/50`),children:e.done&&(0,D.jsx)(g,{className:`size-3`})}),(0,D.jsx)(`span`,{className:`sr-only`,children:e.done?(0,D.jsx)(i,{id:`clJ3qM`}):(0,D.jsx)(i,{id:`yU_9ur`})}),(0,D.jsxs)(`span`,{className:`block`,children:[(0,D.jsx)(`span`,{className:`font-medium`,children:e.label}),e.detail!==void 0&&(0,D.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground leading-snug`,children:e.detail})]})]},e.label),t[2]=n.length,t[3]=e),r=n.map(e),t[0]=n,t[1]=r}else r=t[1];let a;return t[4]===r?a=t[5]:(a=(0,D.jsx)(`ol`,{className:`mb-1.5`,children:r}),t[4]=r,t[5]=a),a}function k(e){let t=(0,w.c)(49),{notice:n,onConfirm:r,onCancel:i,onRevealLog:o}=e,{_:s}=a(),c=(0,S.useId)(),u=(0,S.useId)(),d=n.cancelLabel!==void 0,f,p;t[0]!==d||t[1]!==i||t[2]!==r?(f=()=>{let e=e=>{e.key===`Escape`&&(d?i():r())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},p=[d,i,r],t[0]=d,t[1]=i,t[2]=r,t[3]=f,t[4]=p):(f=t[3],p=t[4]),(0,S.useEffect)(f,p);let m;t[5]!==n.title||t[6]!==c?(m=(0,D.jsx)(`h1`,{id:c,className:`font-medium text-base leading-none`,children:n.title}),t[5]=n.title,t[6]=c,t[7]=m):m=t[7];let h;t[8]===n.subtitle?h=t[9]:(h=n.subtitle!==void 0&&(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm leading-snug`,children:n.subtitle}),t[8]=n.subtitle,t[9]=h);let g;t[10]!==m||t[11]!==h?(g=(0,D.jsxs)(`header`,{className:`shrink-0 space-y-4 px-6 pt-5 pb-3.5`,children:[m,h]}),t[10]=m,t[11]=h,t[12]=g):g=t[12];let _;t[13]===n.paragraphs?_=t[14]:(_=n.paragraphs.map(A),t[13]=n.paragraphs,t[14]=_);let v;t[15]===n.checklist?v=t[16]:(v=n.checklist!==void 0&&(0,D.jsx)(O,{items:n.checklist}),t[15]=n.checklist,t[16]=v);let y;t[17]!==s||t[18]!==n.log?(y=n.log!==void 0&&(0,D.jsx)(`section`,{"aria-label":s({id:`Oi56Cu`}),tabIndex:0,className:`subtle-scrollbar mt-0.5 mb-2.5 min-h-20 flex-1 overflow-auto rounded-lg border border-border border-dotted bg-muted/40 px-3 py-2.5 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,D.jsx)(`pre`,{className:`select-text whitespace-pre-wrap font-mono text-xs leading-relaxed wrap-anywhere`,children:n.log})}),t[17]=s,t[18]=n.log,t[19]=y):y=t[19];let b;t[20]===n.footnote?b=t[21]:(b=n.footnote!==void 0&&(0,D.jsx)(`p`,{className:`select-text text-muted-foreground text-xs wrap-anywhere`,children:n.footnote}),t[20]=n.footnote,t[21]=b);let x;t[22]!==n.logRevealLabel||t[23]!==o?(x=n.logRevealLabel!==void 0&&(0,D.jsx)(`p`,{className:`mt-0.5`,children:(0,D.jsx)(l,{type:`button`,variant:`link-muted`,size:`xs`,className:`h-auto px-0 underline underline-offset-2`,onClick:o,children:n.logRevealLabel})}),t[22]=n.logRevealLabel,t[23]=o,t[24]=x):x=t[24];let C;t[25]!==u||t[26]!==x||t[27]!==_||t[28]!==v||t[29]!==y||t[30]!==b?(C=(0,D.jsxs)(`div`,{id:u,className:`flex min-h-0 flex-1 flex-col px-6 pt-1 pb-4 text-sm`,children:[_,v,y,b,x]}),t[25]=u,t[26]=x,t[27]=_,t[28]=v,t[29]=y,t[30]=b,t[31]=C):C=t[31];let T;t[32]!==n.cancelLabel||t[33]!==i?(T=n.cancelLabel!==void 0&&(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:i,children:n.cancelLabel}),t[32]=n.cancelLabel,t[33]=i,t[34]=T):T=t[34];let E=n.danger===!0?`destructive`:`default`,k=!d,j;t[35]!==n.confirmLabel||t[36]!==r||t[37]!==E||t[38]!==k?(j=(0,D.jsx)(l,{type:`button`,variant:E,autoFocus:k,onClick:r,children:n.confirmLabel}),t[35]=n.confirmLabel,t[36]=r,t[37]=E,t[38]=k,t[39]=j):j=t[39];let M;t[40]!==T||t[41]!==j?(M=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[T,j]}),t[40]=T,t[41]=j,t[42]=M):M=t[42];let N;return t[43]!==u||t[44]!==C||t[45]!==M||t[46]!==g||t[47]!==c?(N=(0,D.jsxs)(`div`,{role:`alertdialog`,"aria-labelledby":c,"aria-describedby":u,className:`flex h-dvh flex-col bg-background text-foreground`,children:[g,C,M]}),t[43]=u,t[44]=C,t[45]=M,t[46]=g,t[47]=c,t[48]=N):N=t[48],N}function A(e){return(0,D.jsx)(`p`,{className:`mb-2.5 leading-normal`,children:e},e)}function j(e){return e.open||e.running?`active`:e.recent?`recent`:null}function M(e){return e.split(`/`).filter(Boolean).at(-1)??e}function N(e){let t=(0,w.c)(9),{status:n}=e,{_:r}=a(),i;t[0]===r?i=t[1]:(i=r({id:`s_ereB`}),t[0]=r,t[1]=i);let o;t[2]===r?o=t[3]:(o=r({id:`_2cM9E`}),t[2]=r,t[3]=o);let s;t[4]!==i||t[5]!==o?(s={active:i,recent:o},t[4]=i,t[5]=o,t[6]=s):s=t[6];let c=s[n],l;return t[7]===c?l=t[8]:(l=(0,D.jsx)(b,{variant:`secondary`,className:`rounded-sm text-muted-foreground`,children:c}),t[7]=c,t[8]=l),l}function P(e){let t=(0,w.c)(28),{project:n,checked:r,onCheckedChange:i}=e,{_:o}=a(),s=(0,S.useId)(),c;t[0]===n?c=t[1]:(c=j(n),t[0]=n,t[1]=c);let l=c,f;t[2]===i?f=t[3]:(f=e=>i(e===!0),t[2]=i,t[3]=f);let p;t[4]!==o||t[5]!==n.path?(p=o({id:`CHfFN_`,values:{0:n.path}}),t[4]=o,t[5]=n.path,t[6]=p):p=t[6];let m;t[7]!==s||t[8]!==r||t[9]!==f||t[10]!==p?(m=(0,D.jsx)(u,{id:s,className:`mt-0.5`,checked:r,onCheckedChange:f,"aria-label":p}),t[7]=s,t[8]=r,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]===n.path?h=t[13]:(h=M(n.path),t[12]=n.path,t[13]=h);let g;t[14]===h?g=t[15]:(g=(0,D.jsx)(`span`,{className:`w-full truncate font-medium text-sm`,children:h}),t[14]=h,t[15]=g);let _;t[16]===n.path?_=t[17]:(_=(0,D.jsx)(`span`,{className:`w-full select-text break-words text-muted-foreground text-xs`,children:n.path}),t[16]=n.path,t[17]=_);let v;t[18]!==s||t[19]!==g||t[20]!==_?(v=(0,D.jsxs)(d,{htmlFor:s,className:`min-w-0 flex-col items-start gap-0.5 font-normal`,children:[g,_]}),t[18]=s,t[19]=g,t[20]=_,t[21]=v):v=t[21];let y;t[22]===l?y=t[23]:(y=l!==null&&(0,D.jsx)(`div`,{className:`flex justify-end max-sm:col-start-2 max-sm:justify-start`,children:(0,D.jsx)(N,{status:l})}),t[22]=l,t[23]=y);let b;return t[24]!==m||t[25]!==v||t[26]!==y?(b=(0,D.jsxs)(`div`,{className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-2.5 border-border/60 border-b px-3 py-2.5 last:border-b-0 hover:bg-accent/40 max-sm:grid-cols-[auto_minmax(0,1fr)]`,children:[m,v,y]}),t[24]=m,t[25]=v,t[26]=y,t[27]=b):b=t[27],b}function F(e){let t=(0,w.c)(45),{projects:n,onConfirm:r,onCancel:o}=e,{_:s}=a(),[c,f]=(0,S.useState)(ne),p=(0,S.useId)(),m=(0,S.useId)(),h=(0,S.useId)(),g=n.length>0&&c.size===n.length?!0:c.size>0?`indeterminate`:!1,_;t[0]===n?_=t[1]:(_=e=>f(e?new Set(n.map(I)):new Set),t[0]=n,t[1]=_);let v=_,y,b;t[2]!==o||t[3]!==n?(y=()=>{let e=e=>{if(e.key===`Escape`){o();return}(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`a`&&(e.preventDefault(),f(new Set(n.map(te))))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},b=[o,n],t[2]=o,t[3]=n,t[4]=y,t[5]=b):(y=t[4],b=t[5]),(0,S.useEffect)(y,b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,D.jsx)(i,{id:`PrVaZo`}),t[6]=x):x=t[6];let C;t[7]===p?C=t[8]:(C=(0,D.jsx)(`h1`,{id:p,className:`font-medium leading-none text-base`,children:x}),t[7]=p,t[8]=C);let T;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,D.jsx)(i,{id:`keop3U`}),t[9]=T):T=t[9];let E;t[10]===m?E=t[11]:(E=(0,D.jsx)(`p`,{id:m,className:`text-sm text-muted-foreground`,children:T}),t[10]=m,t[11]=E);let O;t[12]!==C||t[13]!==E?(O=(0,D.jsxs)(`header`,{className:`shrink-0 px-6 pt-5 pb-3.5 space-y-4`,children:[C,E]}),t[12]=C,t[13]=E,t[14]=O):O=t[14];let k;t[15]===s?k=t[16]:(k=s({id:`QySH4I`}),t[15]=s,t[16]=k);let A;t[17]!==s||t[18]!==n||t[19]!==h||t[20]!==g||t[21]!==c||t[22]!==v?(A=n.length===0?(0,D.jsx)(`div`,{className:`rounded-lg border border-border p-4`,children:(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,D.jsx)(i,{id:`bKt9Jk`})})}):(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-border`,children:[(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2.5 border-border border-b px-3 py-2.5 bg-muted/30`,children:[(0,D.jsx)(u,{id:h,checked:g,onCheckedChange:e=>v(e===!0)}),(0,D.jsx)(d,{htmlFor:h,className:`flex-1 font-medium text-sm`,children:(0,D.jsx)(i,{id:`wgNoIs`})}),(0,D.jsxs)(`span`,{role:`status`,"aria-label":s({id:`nsUDL8`,values:{0:c.size,1:n.length}}),className:`text-muted-foreground text-xs tabular-nums`,children:[c.size,` / `,n.length]})]}),(0,D.jsx)(`div`,{className:`subtle-scrollbar min-h-0 flex-1 overflow-y-scroll [scrollbar-gutter:stable]`,children:n.map((e,t)=>(0,D.jsx)(P,{project:e,checked:c.has(t),onCheckedChange:e=>{f(n=>{let r=new Set(n);return e?r.add(t):r.delete(t),r})}},e.path))})]}),t[17]=s,t[18]=n,t[19]=h,t[20]=g,t[21]=c,t[22]=v,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==k?(j=(0,D.jsx)(`section`,{"aria-label":k,className:`flex min-h-0 flex-1 flex-col px-6 py-3.5`,children:A}),t[24]=A,t[25]=k,t[26]=j):j=t[26];let M;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,D.jsx)(i,{id:`dEgA5A`}),t[27]=M):M=t[27];let N;t[28]===o?N=t[29]:(N=(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:o,children:M}),t[28]=o,t[29]=N);let F;t[30]!==r||t[31]!==c?(F=()=>r([...c].sort(ee)),t[30]=r,t[31]=c,t[32]=F):F=t[32];let L;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,D.jsx)(i,{id:`J7nMqi`}),t[33]=L):L=t[33];let R;t[34]===F?R=t[35]:(R=(0,D.jsx)(l,{type:`button`,variant:`destructive`,onClick:F,children:L}),t[34]=F,t[35]=R);let z;t[36]!==N||t[37]!==R?(z=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[N,R]}),t[36]=N,t[37]=R,t[38]=z):z=t[38];let B;return t[39]!==m||t[40]!==j||t[41]!==z||t[42]!==O||t[43]!==p?(B=(0,D.jsxs)(`div`,{role:`dialog`,"aria-labelledby":p,"aria-describedby":m,className:`flex h-dvh flex-col overflow-hidden bg-background text-foreground`,children:[O,j,z]}),t[39]=m,t[40]=j,t[41]=z,t[42]=O,t[43]=p,t[44]=B):B=t[44],B}function ee(e,t){return e-t}function te(e,t){return t}function I(e,t){return t}function ne(){return new Set}function L(){let e=(0,w.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(_,{"aria-hidden":`true`,className:`mx-auto mb-4 size-8 animate-spin text-primary motion-reduce:animate-none`}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,D.jsx)(`h1`,{className:`mb-2 font-medium text-base leading-none`,children:(0,D.jsx)(i,{id:`j2229h`})}),e[1]=n):n=e[1];let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,D.jsx)(`main`,{className:`grid h-dvh place-items-center bg-background text-foreground`,children:(0,D.jsxs)(`div`,{role:`status`,className:`max-w-vw px-7 py-7 text-center`,children:[t,n,(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm leading-relaxed`,children:(0,D.jsx)(i,{id:`kCjkGY`})})]})}),e[2]=r):r=e[2],r}function R(){let{_:e}=a();return{"workflow-fit":e({id:`5vAI6Z`}),"missing-feature":e({id:`cH0dkG`}),"hard-to-start":e({id:`uoJF_D`}),unreliable:e({id:`WGMoTY`}),"switched-tool":e({id:`jO18NZ`}),"one-off":e({id:`S3qu11`}),other:e({id:`aQyGJc`})}}function z(e){let t=(0,w.c)(86),{onSend:n,onSkip:r}=e,{_:o}=a(),s=R(),[c,g]=(0,S.useState)(``),[_,y]=(0,S.useState)(``),[b,C]=(0,S.useState)(!1),[T,E]=(0,S.useState)(``),O=(0,S.useRef)(null),k=(0,S.useId)(),A=(0,S.useId)(),j=(0,S.useId)(),M=(0,S.useId)(),N=(0,S.useId)(),P=(0,S.useId)(),F,ee;t[0]===b?(F=t[1],ee=t[2]):(F=()=>{b&&O.current?.focus()},ee=[b],t[0]=b,t[1]=F,t[2]=ee),(0,S.useEffect)(F,ee);let te;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,D.jsx)(i,{id:`ElyuiT`}),t[3]=te):te=t[3];let I;t[4]===k?I=t[5]:(I=(0,D.jsx)(`h1`,{id:k,className:`font-medium leading-none text-base`,children:te}),t[4]=k,t[5]=I);let ne;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,D.jsx)(i,{id:`ZDOq9A`}),t[6]=ne):ne=t[6];let L;t[7]===A?L=t[8]:(L=(0,D.jsx)(`p`,{id:A,className:`text-muted-foreground text-sm`,children:ne}),t[7]=A,t[8]=L);let z;t[9]!==I||t[10]!==L?(z=(0,D.jsxs)(`header`,{className:`px-6 pt-5 pb-3.5 space-y-4`,children:[I,L]}),t[9]=I,t[10]=L,t[11]=z):z=t[11];let B;t[12]!==T||t[13]!==b||t[14]!==_||t[15]!==n||t[16]!==c?(B=e=>{e.preventDefault();let t=_.trim(),r=b?T.trim():``;n({...c===``?{}:{reason:c},...t===``?{}:{note:t},...r===``?{}:{email:r}})},t[12]=T,t[13]=b,t[14]=_,t[15]=n,t[16]=c,t[17]=B):B=t[17];let re;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,D.jsx)(i,{id:`oxdGJn`}),t[18]=re):re=t[18];let V;t[19]===j?V=t[20]:(V=(0,D.jsx)(`p`,{id:j,className:`mb-2 font-medium text-sm`,children:re}),t[19]=j,t[20]=V);let H;t[21]!==j||t[22]!==s?(H=h.map(e=>(0,D.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-1 py-1`,children:[(0,D.jsx)(f,{id:`${j}-${e.value}`,value:e.value}),(0,D.jsx)(d,{htmlFor:`${j}-${e.value}`,className:`font-normal text-sm leading-snug`,children:s[e.value]})]},e.value)),t[21]=j,t[22]=s,t[23]=H):H=t[23];let U;t[24]!==j||t[25]!==c||t[26]!==H?(U=(0,D.jsx)(p,{"aria-labelledby":j,value:c,onValueChange:g,children:H}),t[24]=j,t[25]=c,t[26]=H,t[27]=U):U=t[27];let W;t[28]!==V||t[29]!==U?(W=(0,D.jsxs)(`div`,{className:`mb-6`,children:[V,U]}),t[28]=V,t[29]=U,t[30]=W):W=t[30];let ie;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,D.jsx)(i,{id:`axQ1h6`}),t[31]=ie):ie=t[31];let G;t[32]===M?G=t[33]:(G=(0,D.jsx)(d,{htmlFor:M,className:`mb-2 font-medium text-sm`,children:ie}),t[32]=M,t[33]=G);let K;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(K=e=>y(e.target.value),t[34]=K):K=t[34];let q;t[35]!==_||t[36]!==M?(q=(0,D.jsx)(x,{id:M,rows:3,maxLength:m,value:_,onChange:K}),t[35]=_,t[36]=M,t[37]=q):q=t[37];let J;t[38]!==G||t[39]!==q?(J=(0,D.jsxs)(`div`,{className:`mb-6`,children:[G,q]}),t[38]=G,t[39]=q,t[40]=J):J=t[40];let ae;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>C(e===!0),t[41]=ae):ae=t[41];let Y;t[42]!==b||t[43]!==N?(Y=(0,D.jsx)(u,{id:N,checked:b,onCheckedChange:ae}),t[42]=b,t[43]=N,t[44]=Y):Y=t[44];let oe;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,D.jsx)(i,{id:`xEb24l`}),t[45]=oe):oe=t[45];let X;t[46]===N?X=t[47]:(X=(0,D.jsx)(d,{htmlFor:N,className:`font-medium text-sm`,children:oe}),t[46]=N,t[47]=X);let Z;t[48]!==Y||t[49]!==X?(Z=(0,D.jsxs)(`div`,{className:`mb-2 flex items-center gap-2.5`,children:[Y,X]}),t[48]=Y,t[49]=X,t[50]=Z):Z=t[50];let se=!b,ce;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,D.jsx)(i,{id:`ATGYL1`}),t[51]=ce):ce=t[51];let Q;t[52]===P?Q=t[53]:(Q=(0,D.jsx)(d,{htmlFor:P,className:`mb-2 font-medium text-sm sr-only`,children:ce}),t[52]=P,t[53]=Q);let le;t[54]===o?le=t[55]:(le=o({id:`JHf6qZ`}),t[54]=o,t[55]=le);let ue=!b,de;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>E(e.target.value),t[56]=de):de=t[56];let fe;t[57]!==T||t[58]!==P||t[59]!==le||t[60]!==ue?(fe=(0,D.jsx)(v,{id:P,ref:O,type:`email`,maxLength:320,autoComplete:`email`,spellCheck:!1,placeholder:le,disabled:ue,value:T,onChange:de}),t[57]=T,t[58]=P,t[59]=le,t[60]=ue,t[61]=fe):fe=t[61];let $;t[62]!==se||t[63]!==Q||t[64]!==fe?($=(0,D.jsxs)(`div`,{className:`mb-6`,hidden:se,children:[Q,fe]}),t[62]=se,t[63]=Q,t[64]=fe,t[65]=$):$=t[65];let pe;t[66]!==W||t[67]!==J||t[68]!==Z||t[69]!==$?(pe=(0,D.jsxs)(`div`,{className:`subtle-scrollbar min-h-0 flex-1 overflow-y-auto px-6 pt-1 pb-4`,children:[W,J,Z,$]}),t[66]=W,t[67]=J,t[68]=Z,t[69]=$,t[70]=pe):pe=t[70];let me;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,D.jsx)(i,{id:`6Uau97`}),t[71]=me):me=t[71];let he;t[72]===r?he=t[73]:(he=(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:r,children:me}),t[72]=r,t[73]=he);let ge;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,D.jsx)(l,{type:`submit`,children:(0,D.jsx)(i,{id:`xMsnTe`})}),t[74]=ge):ge=t[74];let _e;t[75]===he?_e=t[76]:(_e=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[he,ge]}),t[75]=he,t[76]=_e);let ve;t[77]!==pe||t[78]!==_e||t[79]!==B?(ve=(0,D.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:B,children:[pe,_e]}),t[77]=pe,t[78]=_e,t[79]=B,t[80]=ve):ve=t[80];let ye;return t[81]!==A||t[82]!==ve||t[83]!==z||t[84]!==k?(ye=(0,D.jsxs)(`div`,{role:`dialog`,"aria-labelledby":k,"aria-describedby":A,className:`flex h-dvh flex-col bg-background text-foreground`,children:[z,ve]}),t[81]=A,t[82]=ve,t[83]=z,t[84]=k,t[85]=ye):ye=t[85],ye}function B(){let e=(0,w.c)(9),[t,n]=(0,S.useState)(null),r,a;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=!0;return T().then(t=>{e&&n(t)}),()=>{e=!1}},a=[],e[0]=r,e[1]=a):(r=e[0],a=e[1]),(0,S.useEffect)(r,a),t!==null)switch(t.kind){case`picker`:{let n;return e[2]===t.projects?n=e[3]:(n=(0,D.jsx)(F,{projects:t.projects,onConfirm:G,onCancel:ie}),e[2]=t.projects,e[3]=n),n}case`survey`:{let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(z,{onSend:W,onSkip:U}),e[4]=t):t=e[4],t}case`progress`:{let t;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(L,{}),e[5]=t):t=e[5],t}case`notice`:{let n;return e[6]===t.notice?n=e[7]:(n=(0,D.jsx)(k,{notice:t.notice,onConfirm:H,onCancel:V,onRevealLog:re}),e[6]=t.notice,e[7]=n),n}default:return t}let o;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,D.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center bg-background p-8 text-foreground`,children:(0,D.jsx)(`p`,{className:`text-center text-muted-foreground text-sm`,children:(0,D.jsx)(i,{id:`tzGWeg`})})}),e[8]=o):o=e[8],o}function re(){return E({kind:`notice-reveal-log`})}function V(){return E({kind:`notice-cancel`})}function H(){return E({kind:`notice-confirm`})}function U(){return E({kind:`survey-skip`})}function W(e){return E({kind:`survey-send`,...e})}function ie(){return E({kind:`picker-cancel`})}function G(e){return E({kind:`picker-confirm`,selectedIndexes:e})}var K=document.getElementById(`root`);if(!K)throw Error(`Root element not found`);(0,C.createRoot)(K).render((0,D.jsx)(S.StrictMode,{children:(0,D.jsx)(o,{i18n:y,children:(0,D.jsx)(B,{})})}));
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./globals-CLapcd3A.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a,t as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./utils-CPqDy6Hr.js";import{t as l}from"./button-D3xSRfT4.js";import{t as u}from"./checkbox-CgM6fL3A.js";import{t as d}from"./label-CGqMAe0S.js";import{n as f,t as p}from"./radio-group-DxMM4tU-.js";import{Lt as m,Rt as h}from"./dist-lf4nG52q2.js";import{t as g}from"./check-D1JmbeH0.js";import{t as _}from"./loader-circle-C4uszcbe.js";import{t as v}from"./input-CdGQDWjM.js";import{t as y}from"./dist-D1YpGD7x.js";import{t as b}from"./badge-BTPyRUGW.js";import{t as x}from"./textarea-BzPGvj03.js";var S=e(r(),1),C=t(),w=s();async function T(){let e=typeof window>`u`?void 0:window.okUninstall;if(e===void 0)return null;try{let t=await e.ready();return t.kind===`screen`?t.screen:null}catch{return null}}function E(e){let t=typeof window>`u`?void 0:window.okUninstall;t!==void 0&&t.send(e).catch(()=>void 0)}var D=n();function O(e){let t=(0,w.c)(6),{items:n}=e,r;if(t[0]!==n){let e;t[2]===n.length?e=t[3]:(e=(e,t)=>(0,D.jsxs)(`li`,{className:`relative pb-5 pl-[30px] last:pb-1`,children:[t<n.length-1&&(0,D.jsx)(`span`,{"aria-hidden":`true`,className:`absolute top-[22px] bottom-0.5 left-[9px] w-0.5 bg-border`}),(0,D.jsx)(`span`,{"aria-hidden":`true`,className:c(`absolute top-px left-0 inline-flex size-5 items-center justify-center rounded-full`,e.done?`bg-primary/15 text-primary`:`border-[1.5px] border-muted-foreground/50`),children:e.done&&(0,D.jsx)(g,{className:`size-3`})}),(0,D.jsx)(`span`,{className:`sr-only`,children:e.done?(0,D.jsx)(i,{id:`clJ3qM`}):(0,D.jsx)(i,{id:`yU_9ur`})}),(0,D.jsxs)(`span`,{className:`block`,children:[(0,D.jsx)(`span`,{className:`font-medium`,children:e.label}),e.detail!==void 0&&(0,D.jsx)(`span`,{className:`mt-0.5 block text-muted-foreground leading-snug`,children:e.detail})]})]},e.label),t[2]=n.length,t[3]=e),r=n.map(e),t[0]=n,t[1]=r}else r=t[1];let a;return t[4]===r?a=t[5]:(a=(0,D.jsx)(`ol`,{className:`mb-1.5`,children:r}),t[4]=r,t[5]=a),a}function k(e){let t=(0,w.c)(49),{notice:n,onConfirm:r,onCancel:i,onRevealLog:o}=e,{_:s}=a(),c=(0,S.useId)(),u=(0,S.useId)(),d=n.cancelLabel!==void 0,f,p;t[0]!==d||t[1]!==i||t[2]!==r?(f=()=>{let e=e=>{e.key===`Escape`&&(d?i():r())};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},p=[d,i,r],t[0]=d,t[1]=i,t[2]=r,t[3]=f,t[4]=p):(f=t[3],p=t[4]),(0,S.useEffect)(f,p);let m;t[5]!==n.title||t[6]!==c?(m=(0,D.jsx)(`h1`,{id:c,className:`font-medium text-base leading-none`,children:n.title}),t[5]=n.title,t[6]=c,t[7]=m):m=t[7];let h;t[8]===n.subtitle?h=t[9]:(h=n.subtitle!==void 0&&(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm leading-snug`,children:n.subtitle}),t[8]=n.subtitle,t[9]=h);let g;t[10]!==m||t[11]!==h?(g=(0,D.jsxs)(`header`,{className:`shrink-0 space-y-4 px-6 pt-5 pb-3.5`,children:[m,h]}),t[10]=m,t[11]=h,t[12]=g):g=t[12];let _;t[13]===n.paragraphs?_=t[14]:(_=n.paragraphs.map(A),t[13]=n.paragraphs,t[14]=_);let v;t[15]===n.checklist?v=t[16]:(v=n.checklist!==void 0&&(0,D.jsx)(O,{items:n.checklist}),t[15]=n.checklist,t[16]=v);let y;t[17]!==s||t[18]!==n.log?(y=n.log!==void 0&&(0,D.jsx)(`section`,{"aria-label":s({id:`Oi56Cu`}),tabIndex:0,className:`subtle-scrollbar mt-0.5 mb-2.5 min-h-20 flex-1 overflow-auto rounded-lg border border-border border-dotted bg-muted/40 px-3 py-2.5 focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:(0,D.jsx)(`pre`,{className:`select-text whitespace-pre-wrap font-mono text-xs leading-relaxed wrap-anywhere`,children:n.log})}),t[17]=s,t[18]=n.log,t[19]=y):y=t[19];let b;t[20]===n.footnote?b=t[21]:(b=n.footnote!==void 0&&(0,D.jsx)(`p`,{className:`select-text text-muted-foreground text-xs wrap-anywhere`,children:n.footnote}),t[20]=n.footnote,t[21]=b);let x;t[22]!==n.logRevealLabel||t[23]!==o?(x=n.logRevealLabel!==void 0&&(0,D.jsx)(`p`,{className:`mt-0.5`,children:(0,D.jsx)(l,{type:`button`,variant:`link-muted`,size:`xs`,className:`h-auto px-0 underline underline-offset-2`,onClick:o,children:n.logRevealLabel})}),t[22]=n.logRevealLabel,t[23]=o,t[24]=x):x=t[24];let C;t[25]!==u||t[26]!==x||t[27]!==_||t[28]!==v||t[29]!==y||t[30]!==b?(C=(0,D.jsxs)(`div`,{id:u,className:`flex min-h-0 flex-1 flex-col px-6 pt-1 pb-4 text-sm`,children:[_,v,y,b,x]}),t[25]=u,t[26]=x,t[27]=_,t[28]=v,t[29]=y,t[30]=b,t[31]=C):C=t[31];let T;t[32]!==n.cancelLabel||t[33]!==i?(T=n.cancelLabel!==void 0&&(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:i,children:n.cancelLabel}),t[32]=n.cancelLabel,t[33]=i,t[34]=T):T=t[34];let E=n.danger===!0?`destructive`:`default`,k=!d,j;t[35]!==n.confirmLabel||t[36]!==r||t[37]!==E||t[38]!==k?(j=(0,D.jsx)(l,{type:`button`,variant:E,autoFocus:k,onClick:r,children:n.confirmLabel}),t[35]=n.confirmLabel,t[36]=r,t[37]=E,t[38]=k,t[39]=j):j=t[39];let M;t[40]!==T||t[41]!==j?(M=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[T,j]}),t[40]=T,t[41]=j,t[42]=M):M=t[42];let N;return t[43]!==u||t[44]!==C||t[45]!==M||t[46]!==g||t[47]!==c?(N=(0,D.jsxs)(`div`,{role:`alertdialog`,"aria-labelledby":c,"aria-describedby":u,className:`flex h-dvh flex-col bg-background text-foreground`,children:[g,C,M]}),t[43]=u,t[44]=C,t[45]=M,t[46]=g,t[47]=c,t[48]=N):N=t[48],N}function A(e){return(0,D.jsx)(`p`,{className:`mb-2.5 leading-normal`,children:e},e)}function j(e){return e.open||e.running?`active`:e.recent?`recent`:null}function M(e){return e.split(`/`).filter(Boolean).at(-1)??e}function N(e){let t=(0,w.c)(9),{status:n}=e,{_:r}=a(),i;t[0]===r?i=t[1]:(i=r({id:`s_ereB`}),t[0]=r,t[1]=i);let o;t[2]===r?o=t[3]:(o=r({id:`_2cM9E`}),t[2]=r,t[3]=o);let s;t[4]!==i||t[5]!==o?(s={active:i,recent:o},t[4]=i,t[5]=o,t[6]=s):s=t[6];let c=s[n],l;return t[7]===c?l=t[8]:(l=(0,D.jsx)(b,{variant:`secondary`,className:`rounded-sm text-muted-foreground`,children:c}),t[7]=c,t[8]=l),l}function P(e){let t=(0,w.c)(28),{project:n,checked:r,onCheckedChange:i}=e,{_:o}=a(),s=(0,S.useId)(),c;t[0]===n?c=t[1]:(c=j(n),t[0]=n,t[1]=c);let l=c,f;t[2]===i?f=t[3]:(f=e=>i(e===!0),t[2]=i,t[3]=f);let p;t[4]!==o||t[5]!==n.path?(p=o({id:`CHfFN_`,values:{0:n.path}}),t[4]=o,t[5]=n.path,t[6]=p):p=t[6];let m;t[7]!==s||t[8]!==r||t[9]!==f||t[10]!==p?(m=(0,D.jsx)(u,{id:s,className:`mt-0.5`,checked:r,onCheckedChange:f,"aria-label":p}),t[7]=s,t[8]=r,t[9]=f,t[10]=p,t[11]=m):m=t[11];let h;t[12]===n.path?h=t[13]:(h=M(n.path),t[12]=n.path,t[13]=h);let g;t[14]===h?g=t[15]:(g=(0,D.jsx)(`span`,{className:`w-full truncate font-medium text-sm`,children:h}),t[14]=h,t[15]=g);let _;t[16]===n.path?_=t[17]:(_=(0,D.jsx)(`span`,{className:`w-full select-text break-words text-muted-foreground text-xs`,children:n.path}),t[16]=n.path,t[17]=_);let v;t[18]!==s||t[19]!==g||t[20]!==_?(v=(0,D.jsxs)(d,{htmlFor:s,className:`min-w-0 flex-col items-start gap-0.5 font-normal`,children:[g,_]}),t[18]=s,t[19]=g,t[20]=_,t[21]=v):v=t[21];let y;t[22]===l?y=t[23]:(y=l!==null&&(0,D.jsx)(`div`,{className:`flex justify-end max-sm:col-start-2 max-sm:justify-start`,children:(0,D.jsx)(N,{status:l})}),t[22]=l,t[23]=y);let b;return t[24]!==m||t[25]!==v||t[26]!==y?(b=(0,D.jsxs)(`div`,{className:`grid grid-cols-[auto_minmax(0,1fr)_auto] items-start gap-2.5 border-border/60 border-b px-3 py-2.5 last:border-b-0 hover:bg-accent/40 max-sm:grid-cols-[auto_minmax(0,1fr)]`,children:[m,v,y]}),t[24]=m,t[25]=v,t[26]=y,t[27]=b):b=t[27],b}function F(e){let t=(0,w.c)(45),{projects:n,onConfirm:r,onCancel:o}=e,{_:s}=a(),[c,f]=(0,S.useState)(ne),p=(0,S.useId)(),m=(0,S.useId)(),h=(0,S.useId)(),g=n.length>0&&c.size===n.length?!0:c.size>0?`indeterminate`:!1,_;t[0]===n?_=t[1]:(_=e=>f(e?new Set(n.map(I)):new Set),t[0]=n,t[1]=_);let v=_,y,b;t[2]!==o||t[3]!==n?(y=()=>{let e=e=>{if(e.key===`Escape`){o();return}(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`a`&&(e.preventDefault(),f(new Set(n.map(te))))};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},b=[o,n],t[2]=o,t[3]=n,t[4]=y,t[5]=b):(y=t[4],b=t[5]),(0,S.useEffect)(y,b);let x;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,D.jsx)(i,{id:`PrVaZo`}),t[6]=x):x=t[6];let C;t[7]===p?C=t[8]:(C=(0,D.jsx)(`h1`,{id:p,className:`font-medium leading-none text-base`,children:x}),t[7]=p,t[8]=C);let T;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,D.jsx)(i,{id:`keop3U`}),t[9]=T):T=t[9];let E;t[10]===m?E=t[11]:(E=(0,D.jsx)(`p`,{id:m,className:`text-sm text-muted-foreground`,children:T}),t[10]=m,t[11]=E);let O;t[12]!==C||t[13]!==E?(O=(0,D.jsxs)(`header`,{className:`shrink-0 px-6 pt-5 pb-3.5 space-y-4`,children:[C,E]}),t[12]=C,t[13]=E,t[14]=O):O=t[14];let k;t[15]===s?k=t[16]:(k=s({id:`QySH4I`}),t[15]=s,t[16]=k);let A;t[17]!==s||t[18]!==n||t[19]!==h||t[20]!==g||t[21]!==c||t[22]!==v?(A=n.length===0?(0,D.jsx)(`div`,{className:`rounded-lg border border-border p-4`,children:(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,D.jsx)(i,{id:`bKt9Jk`})})}):(0,D.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden rounded-lg border border-border`,children:[(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2.5 border-border border-b px-3 py-2.5 bg-muted/30`,children:[(0,D.jsx)(u,{id:h,checked:g,onCheckedChange:e=>v(e===!0)}),(0,D.jsx)(d,{htmlFor:h,className:`flex-1 font-medium text-sm`,children:(0,D.jsx)(i,{id:`wgNoIs`})}),(0,D.jsxs)(`span`,{role:`status`,"aria-label":s({id:`nsUDL8`,values:{0:c.size,1:n.length}}),className:`text-muted-foreground text-xs tabular-nums`,children:[c.size,` / `,n.length]})]}),(0,D.jsx)(`div`,{className:`subtle-scrollbar min-h-0 flex-1 overflow-y-scroll [scrollbar-gutter:stable]`,children:n.map((e,t)=>(0,D.jsx)(P,{project:e,checked:c.has(t),onCheckedChange:e=>{f(n=>{let r=new Set(n);return e?r.add(t):r.delete(t),r})}},e.path))})]}),t[17]=s,t[18]=n,t[19]=h,t[20]=g,t[21]=c,t[22]=v,t[23]=A):A=t[23];let j;t[24]!==A||t[25]!==k?(j=(0,D.jsx)(`section`,{"aria-label":k,className:`flex min-h-0 flex-1 flex-col px-6 py-3.5`,children:A}),t[24]=A,t[25]=k,t[26]=j):j=t[26];let M;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,D.jsx)(i,{id:`dEgA5A`}),t[27]=M):M=t[27];let N;t[28]===o?N=t[29]:(N=(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:o,children:M}),t[28]=o,t[29]=N);let F;t[30]!==r||t[31]!==c?(F=()=>r([...c].sort(ee)),t[30]=r,t[31]=c,t[32]=F):F=t[32];let L;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,D.jsx)(i,{id:`J7nMqi`}),t[33]=L):L=t[33];let R;t[34]===F?R=t[35]:(R=(0,D.jsx)(l,{type:`button`,variant:`destructive`,onClick:F,children:L}),t[34]=F,t[35]=R);let z;t[36]!==N||t[37]!==R?(z=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[N,R]}),t[36]=N,t[37]=R,t[38]=z):z=t[38];let B;return t[39]!==m||t[40]!==j||t[41]!==z||t[42]!==O||t[43]!==p?(B=(0,D.jsxs)(`div`,{role:`dialog`,"aria-labelledby":p,"aria-describedby":m,className:`flex h-dvh flex-col overflow-hidden bg-background text-foreground`,children:[O,j,z]}),t[39]=m,t[40]=j,t[41]=z,t[42]=O,t[43]=p,t[44]=B):B=t[44],B}function ee(e,t){return e-t}function te(e,t){return t}function I(e,t){return t}function ne(){return new Set}function L(){let e=(0,w.c)(3),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(_,{"aria-hidden":`true`,className:`mx-auto mb-4 size-8 animate-spin text-primary motion-reduce:animate-none`}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,D.jsx)(`h1`,{className:`mb-2 font-medium text-base leading-none`,children:(0,D.jsx)(i,{id:`j2229h`})}),e[1]=n):n=e[1];let r;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,D.jsx)(`main`,{className:`grid h-dvh place-items-center bg-background text-foreground`,children:(0,D.jsxs)(`div`,{role:`status`,className:`max-w-vw px-7 py-7 text-center`,children:[t,n,(0,D.jsx)(`p`,{className:`text-muted-foreground text-sm leading-relaxed`,children:(0,D.jsx)(i,{id:`kCjkGY`})})]})}),e[2]=r):r=e[2],r}function R(){let{_:e}=a();return{"workflow-fit":e({id:`5vAI6Z`}),"missing-feature":e({id:`cH0dkG`}),"hard-to-start":e({id:`uoJF_D`}),unreliable:e({id:`WGMoTY`}),"switched-tool":e({id:`jO18NZ`}),"one-off":e({id:`S3qu11`}),other:e({id:`aQyGJc`})}}function z(e){let t=(0,w.c)(86),{onSend:n,onSkip:r}=e,{_:o}=a(),s=R(),[c,g]=(0,S.useState)(``),[_,y]=(0,S.useState)(``),[b,C]=(0,S.useState)(!1),[T,E]=(0,S.useState)(``),O=(0,S.useRef)(null),k=(0,S.useId)(),A=(0,S.useId)(),j=(0,S.useId)(),M=(0,S.useId)(),N=(0,S.useId)(),P=(0,S.useId)(),F,ee;t[0]===b?(F=t[1],ee=t[2]):(F=()=>{b&&O.current?.focus()},ee=[b],t[0]=b,t[1]=F,t[2]=ee),(0,S.useEffect)(F,ee);let te;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,D.jsx)(i,{id:`ElyuiT`}),t[3]=te):te=t[3];let I;t[4]===k?I=t[5]:(I=(0,D.jsx)(`h1`,{id:k,className:`font-medium leading-none text-base`,children:te}),t[4]=k,t[5]=I);let ne;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,D.jsx)(i,{id:`ZDOq9A`}),t[6]=ne):ne=t[6];let L;t[7]===A?L=t[8]:(L=(0,D.jsx)(`p`,{id:A,className:`text-muted-foreground text-sm`,children:ne}),t[7]=A,t[8]=L);let z;t[9]!==I||t[10]!==L?(z=(0,D.jsxs)(`header`,{className:`px-6 pt-5 pb-3.5 space-y-4`,children:[I,L]}),t[9]=I,t[10]=L,t[11]=z):z=t[11];let B;t[12]!==T||t[13]!==b||t[14]!==_||t[15]!==n||t[16]!==c?(B=e=>{e.preventDefault();let t=_.trim(),r=b?T.trim():``;n({...c===``?{}:{reason:c},...t===``?{}:{note:t},...r===``?{}:{email:r}})},t[12]=T,t[13]=b,t[14]=_,t[15]=n,t[16]=c,t[17]=B):B=t[17];let re;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,D.jsx)(i,{id:`oxdGJn`}),t[18]=re):re=t[18];let V;t[19]===j?V=t[20]:(V=(0,D.jsx)(`p`,{id:j,className:`mb-2 font-medium text-sm`,children:re}),t[19]=j,t[20]=V);let H;t[21]!==j||t[22]!==s?(H=h.map(e=>(0,D.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-md px-1 py-1`,children:[(0,D.jsx)(f,{id:`${j}-${e.value}`,value:e.value}),(0,D.jsx)(d,{htmlFor:`${j}-${e.value}`,className:`font-normal text-sm leading-snug`,children:s[e.value]})]},e.value)),t[21]=j,t[22]=s,t[23]=H):H=t[23];let U;t[24]!==j||t[25]!==c||t[26]!==H?(U=(0,D.jsx)(p,{"aria-labelledby":j,value:c,onValueChange:g,children:H}),t[24]=j,t[25]=c,t[26]=H,t[27]=U):U=t[27];let W;t[28]!==V||t[29]!==U?(W=(0,D.jsxs)(`div`,{className:`mb-6`,children:[V,U]}),t[28]=V,t[29]=U,t[30]=W):W=t[30];let ie;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,D.jsx)(i,{id:`axQ1h6`}),t[31]=ie):ie=t[31];let G;t[32]===M?G=t[33]:(G=(0,D.jsx)(d,{htmlFor:M,className:`mb-2 font-medium text-sm`,children:ie}),t[32]=M,t[33]=G);let K;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(K=e=>y(e.target.value),t[34]=K):K=t[34];let q;t[35]!==_||t[36]!==M?(q=(0,D.jsx)(x,{id:M,rows:3,maxLength:m,value:_,onChange:K}),t[35]=_,t[36]=M,t[37]=q):q=t[37];let J;t[38]!==G||t[39]!==q?(J=(0,D.jsxs)(`div`,{className:`mb-6`,children:[G,q]}),t[38]=G,t[39]=q,t[40]=J):J=t[40];let ae;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>C(e===!0),t[41]=ae):ae=t[41];let Y;t[42]!==b||t[43]!==N?(Y=(0,D.jsx)(u,{id:N,checked:b,onCheckedChange:ae}),t[42]=b,t[43]=N,t[44]=Y):Y=t[44];let oe;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(oe=(0,D.jsx)(i,{id:`xEb24l`}),t[45]=oe):oe=t[45];let X;t[46]===N?X=t[47]:(X=(0,D.jsx)(d,{htmlFor:N,className:`font-medium text-sm`,children:oe}),t[46]=N,t[47]=X);let Z;t[48]!==Y||t[49]!==X?(Z=(0,D.jsxs)(`div`,{className:`mb-2 flex items-center gap-2.5`,children:[Y,X]}),t[48]=Y,t[49]=X,t[50]=Z):Z=t[50];let se=!b,ce;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,D.jsx)(i,{id:`ATGYL1`}),t[51]=ce):ce=t[51];let Q;t[52]===P?Q=t[53]:(Q=(0,D.jsx)(d,{htmlFor:P,className:`mb-2 font-medium text-sm sr-only`,children:ce}),t[52]=P,t[53]=Q);let le;t[54]===o?le=t[55]:(le=o({id:`JHf6qZ`}),t[54]=o,t[55]=le);let ue=!b,de;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(de=e=>E(e.target.value),t[56]=de):de=t[56];let fe;t[57]!==T||t[58]!==P||t[59]!==le||t[60]!==ue?(fe=(0,D.jsx)(v,{id:P,ref:O,type:`email`,maxLength:320,autoComplete:`email`,spellCheck:!1,placeholder:le,disabled:ue,value:T,onChange:de}),t[57]=T,t[58]=P,t[59]=le,t[60]=ue,t[61]=fe):fe=t[61];let $;t[62]!==se||t[63]!==Q||t[64]!==fe?($=(0,D.jsxs)(`div`,{className:`mb-6`,hidden:se,children:[Q,fe]}),t[62]=se,t[63]=Q,t[64]=fe,t[65]=$):$=t[65];let pe;t[66]!==W||t[67]!==J||t[68]!==Z||t[69]!==$?(pe=(0,D.jsxs)(`div`,{className:`subtle-scrollbar min-h-0 flex-1 overflow-y-auto px-6 pt-1 pb-4`,children:[W,J,Z,$]}),t[66]=W,t[67]=J,t[68]=Z,t[69]=$,t[70]=pe):pe=t[70];let me;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,D.jsx)(i,{id:`6Uau97`}),t[71]=me):me=t[71];let he;t[72]===r?he=t[73]:(he=(0,D.jsx)(l,{type:`button`,variant:`outline-mono`,autoFocus:!0,onClick:r,children:me}),t[72]=r,t[73]=he);let ge;t[74]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,D.jsx)(l,{type:`submit`,children:(0,D.jsx)(i,{id:`xMsnTe`})}),t[74]=ge):ge=t[74];let _e;t[75]===he?_e=t[76]:(_e=(0,D.jsxs)(`footer`,{className:`flex items-center justify-end gap-2.5 border-border border-t bg-muted/50 px-6 pt-3.5 pb-4`,children:[he,ge]}),t[75]=he,t[76]=_e);let ve;t[77]!==pe||t[78]!==_e||t[79]!==B?(ve=(0,D.jsxs)(`form`,{className:`flex min-h-0 flex-1 flex-col`,onSubmit:B,children:[pe,_e]}),t[77]=pe,t[78]=_e,t[79]=B,t[80]=ve):ve=t[80];let ye;return t[81]!==A||t[82]!==ve||t[83]!==z||t[84]!==k?(ye=(0,D.jsxs)(`div`,{role:`dialog`,"aria-labelledby":k,"aria-describedby":A,className:`flex h-dvh flex-col bg-background text-foreground`,children:[z,ve]}),t[81]=A,t[82]=ve,t[83]=z,t[84]=k,t[85]=ye):ye=t[85],ye}function B(){let e=(0,w.c)(9),[t,n]=(0,S.useState)(null),r,a;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=!0;return T().then(t=>{e&&n(t)}),()=>{e=!1}},a=[],e[0]=r,e[1]=a):(r=e[0],a=e[1]),(0,S.useEffect)(r,a),t!==null)switch(t.kind){case`picker`:{let n;return e[2]===t.projects?n=e[3]:(n=(0,D.jsx)(F,{projects:t.projects,onConfirm:G,onCancel:ie}),e[2]=t.projects,e[3]=n),n}case`survey`:{let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(z,{onSend:W,onSkip:U}),e[4]=t):t=e[4],t}case`progress`:{let t;return e[5]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,D.jsx)(L,{}),e[5]=t):t=e[5],t}case`notice`:{let n;return e[6]===t.notice?n=e[7]:(n=(0,D.jsx)(k,{notice:t.notice,onConfirm:H,onCancel:V,onRevealLog:re}),e[6]=t.notice,e[7]=n),n}default:return t}let o;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,D.jsx)(`main`,{className:`flex min-h-dvh items-center justify-center bg-background p-8 text-foreground`,children:(0,D.jsx)(`p`,{className:`text-center text-muted-foreground text-sm`,children:(0,D.jsx)(i,{id:`tzGWeg`})})}),e[8]=o):o=e[8],o}function re(){return E({kind:`notice-reveal-log`})}function V(){return E({kind:`notice-cancel`})}function H(){return E({kind:`notice-confirm`})}function U(){return E({kind:`survey-skip`})}function W(e){return E({kind:`survey-send`,...e})}function ie(){return E({kind:`picker-cancel`})}function G(e){return E({kind:`picker-confirm`,selectedIndexes:e})}var K=document.getElementById(`root`);if(!K)throw Error(`Root element not found`);(0,C.createRoot)(K).render((0,D.jsx)(S.StrictMode,{children:(0,D.jsx)(o,{i18n:y,children:(0,D.jsx)(B,{})})}));
|
package/dist/public/assets/{use-activity-panel-BZ9nGQPH.js → use-activity-panel-D9D0qVT-.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{i as t}from"./DocumentContext-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{i as t}from"./DocumentContext-BYAIHlLG.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{j as i}from"./CodeMirrorPropInput-yJZmvoN3.js";import{ft as a,i as o,r as s}from"./dist-lf4nG52q2.js";import{d as c}from"./documents-events-Bz6CFw_P.js";import{n as l}from"./agent-presence-DspgbUIJ.js";import{t as u}from"./lru-string-cache-DXyh0UqD.js";var d=r(),f=e(n(),1),p=500,m=64;async function h(e){let t=`/api/agent-activity?agentId=${encodeURIComponent(e)}`,n=await fetch(t),r;try{r=await n.json()}catch(e){throw new i(`Could not parse /api/agent-activity response.`,{cause:e,status:n.status})}if(!n.ok){let e=a.safeParse(r);throw e.success?Error(e.data.title):new i(`/api/agent-activity returned a non-RFC-9457 error response.`,{cause:e.error,status:n.status})}let o=s.safeParse(r);if(!o.success)throw new i(`/api/agent-activity returned a body that did not match AgentActivitySuccessSchema.`,{cause:o.error,status:n.status});return o.data}async function g(e,t,n){let r=`/api/agent-burst-diff?agentId=${encodeURIComponent(e)}&docName=${encodeURIComponent(t)}&keptCount=${n}`,s=await fetch(r),c;try{c=await s.json()}catch(e){throw new i(`Could not parse /api/agent-burst-diff response.`,{cause:e,status:s.status})}if(!s.ok){let e=a.safeParse(c);throw e.success?Error(e.data.title):new i(`/api/agent-burst-diff returned a non-RFC-9457 error response.`,{cause:e.error,status:s.status})}let l=o.safeParse(c);if(!l.success)throw new i(`/api/agent-burst-diff returned a body that did not match AgentBurstDiffSuccessSchema.`,{cause:l.error,status:s.status});let{diff:u,before:d,after:f}=l.data;return{diff:u,before:d,after:f}}function _(e){let n=(0,d.c)(23),{systemProvider:r}=t(),[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(`idle`),[l,_]=(0,f.useState)(null),b;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=new u(m),n[0]=b):b=n[0];let x=(0,f.useRef)(b),S=(0,f.useRef)(0),C;n[1]===r?C=n[2]:(C=e=>{let t=S.current+=1;s(`loading`),_(null),h(e).then(n=>{if(S.current!==t)return;let i=y(r,e);a({...n,writingDocs:i}),s(`ready`)}).catch(e=>{S.current===t&&(_(e instanceof Error?e.message:String(e)),s(`error`))})},n[1]=r,n[2]=C);let w=C,T;n[3]!==e||n[4]!==w?(T=()=>{if(!e){S.current+=1,a(null),s(`idle`),_(null),x.current.clear();return}x.current.clear(),w(e);let t=null,n=c(n=>{n.includes(`session-activity`)&&(t&&clearTimeout(t),t=setTimeout(()=>{t=null,w(e)},p))});return()=>{t&&clearTimeout(t),n()}},n[3]=e,n[4]=w,n[5]=T):T=n[5];let E;n[6]===e?E=n[7]:(E=[e],n[6]=e,n[7]=E),(0,f.useEffect)(T,E);let D,O;n[8]!==e||n[9]!==r?(D=()=>{if(!e||!r)return;let t=()=>{if(!r.awareness)return;let t=y(r,e);a(e=>!e||v(e.writingDocs,t)?e:{...e,writingDocs:t})},n=r.awareness;if(!n||typeof n.on!=`function`){t();return}n.on(`update`,t),t();let i=setInterval(t,1e3);return()=>{clearInterval(i),typeof n.off==`function`&&n.off(`update`,t)}},O=[e,r],n[8]=e,n[9]=r,n[10]=D,n[11]=O):(D=n[10],O=n[11]),(0,f.useEffect)(D,O);let k;n[12]===e?k=n[13]:(k=async(t,n)=>{if(!e)return``;let r=`${t}\0${n}`,i=x.current.get(r);if(i!==void 0)return i;let{diff:a}=await g(e,t,n);return x.current.set(r,a),a},n[12]=e,n[13]=k);let A=k,j;n[14]!==e||n[15]!==w?(j=()=>{e&&w(e)},n[14]=e,n[15]=w,n[16]=j):j=n[16];let M=j,N;return n[17]!==i||n[18]!==l||n[19]!==A||n[20]!==M||n[21]!==o?(N={data:i,status:o,error:l,reload:M,fetchBurstDiff:A},n[17]=i,n[18]=l,n[19]=A,n[20]=M,n[21]=o,n[22]=N):N=n[22],N}function v(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function y(e,t){let n=new Set;if(!e)return n;let r=e.awareness;if(!l(r))return n;let i=[t,t.startsWith(`agent-`)?t.slice(6):`agent-${t}`];for(let e of r.getStates().values()){let t=e.agentPresence;if(t)for(let e of i){let r=t[e];r&&r.mode===`writing`&&r.currentDoc&&n.add(r.currentDoc)}}return n}export{_ as n,g as t};
|
package/dist/public/assets/{use-live-xterm-theme-on3ebtaK.js → use-live-xterm-theme-CRmcqypM.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{i as r}from"./config-context-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{i as r}from"./config-context-7il4AXHf.js";var i=e(t(),1),a=n(),o={background:`#171717`,foreground:`#e5e5e5`,cursor:`#e5e5e5`,cursorAccent:`#171717`,selectionBackground:`#3a3d41`,black:`#000000`,red:`#cd3131`,green:`#0dbc79`,yellow:`#e5e510`,blue:`#2472c8`,magenta:`#bc3fbc`,cyan:`#11a8cd`,white:`#e5e5e5`,brightBlack:`#666666`,brightRed:`#f14c4c`,brightGreen:`#23d18b`,brightYellow:`#f5f543`,brightBlue:`#3b8eea`,brightMagenta:`#d670d6`,brightCyan:`#29b8db`,brightWhite:`#ffffff`},s={background:`#ffffff`,foreground:`#262626`,cursor:`#262626`,cursorAccent:`#ffffff`,selectionBackground:`#add6ff`,black:`#000000`,red:`#cd3131`,green:`#00bc00`,yellow:`#949800`,blue:`#0451a5`,magenta:`#bc05bc`,cyan:`#0598bc`,white:`#555555`,brightBlack:`#666666`,brightRed:`#cd3131`,brightGreen:`#14ce14`,brightYellow:`#b5ba00`,brightBlue:`#0451a5`,brightMagenta:`#bc05bc`,brightCyan:`#0598bc`,brightWhite:`#a5a5a5`};function c(e){return e===`dark`?o:s}function l(e){try{let t=document.createElement(`span`);t.style.display=`none`,t.style.backgroundColor=`var(${e})`,document.body.appendChild(t);try{let e=getComputedStyle(t).backgroundColor;return!e||e===`rgba(0, 0, 0, 0)`||e===`transparent`||e.includes(`var(`)?null:e}finally{t.remove()}}catch{return null}}var u={black:`--ansi-black`,red:`--ansi-red`,green:`--ansi-green`,yellow:`--ansi-yellow`,blue:`--ansi-blue`,magenta:`--ansi-magenta`,cyan:`--ansi-cyan`,white:`--ansi-white`,brightBlack:`--ansi-bright-black`,brightRed:`--ansi-bright-red`,brightGreen:`--ansi-bright-green`,brightYellow:`--ansi-bright-yellow`,brightBlue:`--ansi-bright-blue`,brightMagenta:`--ansi-bright-magenta`,brightCyan:`--ansi-bright-cyan`,brightWhite:`--ansi-bright-white`};function d(e,t=l){let n=c(e),r=t(`--background`)??n.background,i=t(`--foreground`)??n.foreground,a={};for(let e of Object.keys(u)){let n=t(u[e]);n&&(a[e]=n)}return{...n,...a,background:r,foreground:i,cursor:i,cursorAccent:r,selectionBackground:t(`--selection-soft`)??n.selectionBackground}}function f(e,t){let n=new Set([...Object.keys(e),...Object.keys(t)]);for(let r of n)if(e[r]!==t[r])return!1;return!0}function p(e){let t=(0,a.c)(5),n;t[0]===e?n=t[1]:(n=()=>d(e),t[0]=e,t[1]=n);let[o,s]=(0,i.useState)(n),c,l;return t[2]===e?(c=t[3],l=t[4]):(c=()=>{let t=()=>{let t=d(e);s(e=>f(e,t)?e:t)};t();let n=new MutationObserver(t);return n.observe(document.documentElement,{attributes:!0,attributeFilter:[r,`class`]}),n.observe(document.head,{childList:!0,subtree:!0,characterData:!0}),()=>n.disconnect()},l=[e],t[2]=e,t[3]=c,t[4]=l),(0,i.useEffect)(c,l),o}export{p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./DocumentContext-
|
|
1
|
+
import{i as e}from"./DocumentContext-BYAIHlLG.js";import{t}from"./compiler-runtime-BfE3aGVn.js";import{Va as n}from"./dist-lf4nG52q2.js";import{n as r}from"./dist-Dr52ya0i.js";import{t as i}from"./dist-D1YpGD7x.js";import{f as a,x as o}from"./doc-paths-D9TaK83y.js";import{G as s}from"./navigation-targets-CIvGC6UT.js";import{m as c}from"./skills-api-DF632dit.js";import{t as l}from"./use-skills-CjgBfNqJ.js";var u=t();function d(){let t=(0,u.c)(4),{openTarget:d}=e(),f=l(),p;return t[0]!==d||t[1]!==f.data||t[2]!==f.status?(p=(e,t,l)=>{let u=e=>{d({kind:`doc`,target:e,docName:e},l?.replaceActive?{tabBehavior:`replace-active`}:void 0),o(a(e))},p=f.status===`ready`?f.data.find(n=>n.scope===e&&n.name===t):void 0;if(p)return u(s(p));if(e===`project`&&l?.path)return u(l.path.replace(/\.mdx?$/i,``));if(e===`global`)return u(n(e,t));(async()=>{try{let n=await c(`project`);if(!n.ok){r.error(i._({id:`IO8REi`,values:{0:n.error,name:t}}));return}let a=n.skills.find(n=>n.scope===e&&n.name===t);if(!a){r.error(i._({id:`9uRLEH`,values:{name:t}}));return}u(s(a))}catch(e){let n=e;r.error(i._({id:`IO8REi`,values:{0:n instanceof Error?n.message:String(n),name:t}}))}})()},t[0]=d,t[1]=f.data,t[2]=f.status,t[3]=p):p=t[3],p}export{d as t};
|
package/dist/public/assets/{use-skill-directory-BVbrNJTi.js → use-skill-directory-ByVFCtzx.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./useQuery-ZeEDLtxh.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./button-D3xSRfT4.js";import{t as c}from"./createLucideIcon-wbFLvDA-.js";import{t as l}from"./check-D1JmbeH0.js";import{t as u}from"./badge-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./useQuery-ZeEDLtxh.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./button-D3xSRfT4.js";import{t as c}from"./createLucideIcon-wbFLvDA-.js";import{t as l}from"./check-D1JmbeH0.js";import{t as u}from"./badge-BTPyRUGW.js";import{o as d}from"./skills-api-DF632dit.js";import{t as f}from"./use-skills-CjgBfNqJ.js";import{t as p}from"./use-open-skill-7MNEmyfe.js";import{n as m}from"./open-managed-artifact-tab-DvNiFkHO.js";var h=[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]],g=c(`package`,h),_=e(n(),1),v=o(),y=t();function b(e){let t=(0,v.c)(27),{name:n,description:r,onOpen:a,action:o,meta:c,leading:l}=e,{_:u}=i(),d;t[0]===n?d=t[1]:(d=(0,y.jsx)(`div`,{className:`truncate font-medium text-sm`,children:n}),t[0]=n,t[1]=d);let f=d,p;t[2]!==u||t[3]!==n?(p=u({id:`9_euHO`,values:{name:n}}),t[2]=u,t[3]=n,t[4]=p):p=t[4];let m;t[5]!==a||t[6]!==p?(m=(0,y.jsx)(s,{variant:`ghost`,"aria-label":p,onClick:a,className:`absolute inset-0 h-auto w-full rounded-xl p-0 opacity-0`}),t[5]=a,t[6]=p,t[7]=m):m=t[7];let h;t[8]===l?h=t[9]:(h=l?(0,y.jsx)(`div`,{className:`shrink-0`,children:l}):null,t[8]=l,t[9]=h);let g;t[10]!==c||t[11]!==f?(g=(0,y.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[f,c]}),t[10]=c,t[11]=f,t[12]=g):g=t[12];let _;t[13]===o?_=t[14]:(_=(0,y.jsx)(`div`,{className:`relative z-10 shrink-0`,children:o}),t[13]=o,t[14]=_);let b;t[15]!==h||t[16]!==g||t[17]!==_?(b=(0,y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[h,g,_]}),t[15]=h,t[16]=g,t[17]=_,t[18]=b):b=t[18];let x;t[19]===r?x=t[20]:(x=r?(0,y.jsx)(`p`,{className:`line-clamp-2 text-muted-foreground text-xs leading-relaxed`,children:r}):null,t[19]=r,t[20]=x);let S;t[21]!==b||t[22]!==x?(S=(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[b,x]}),t[21]=b,t[22]=x,t[23]=S):S=t[23];let C;return t[24]!==m||t[25]!==S?(C=(0,y.jsxs)(`li`,{className:`relative rounded-xl border border-border bg-card p-4 transition-colors hover:border-border/60 hover:bg-accent/40 focus-within:ring-2 focus-within:ring-ring`,children:[m,S]}),t[24]=m,t[25]=S,t[26]=C):C=t[26],C}function x(e,t){return new Intl.NumberFormat(t||void 0,{notation:`compact`,compactDisplay:`short`}).format(e)}function S(e){let t=(0,v.c)(4),{login:n}=e,[r,i]=(0,_.useState)(!0);if(n&&r){let e=`https://github.com/${encodeURIComponent(n)}.png?size=96`,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>i(!1),t[0]=r):r=t[0];let a;return t[1]===e?a=t[2]:(a=(0,y.jsx)(`img`,{src:e,alt:``,loading:`lazy`,className:`size-10 rounded border border-border bg-background object-cover`,onError:r}),t[1]=e,t[2]=a),a}let a;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,y.jsx)(`div`,{className:`flex size-10 items-center justify-center rounded border border-border bg-muted text-muted-foreground`,children:(0,y.jsx)(g,{className:`size-5`,"aria-hidden":!0})}),t[3]=a):a=t[3],a}function C(e){let t=(0,v.c)(22),{result:n,imported:a,onOpen:o}=e,{i18n:s}=i(),c;t[0]===n.publisher?c=t[1]:(c=(0,y.jsx)(S,{login:n.publisher}),t[0]=n.publisher,t[1]=c);let d;t[2]===a?d=t[3]:(d=a?(0,y.jsxs)(u,{variant:`primary`,className:`gap-1`,children:[(0,y.jsx)(l,{"aria-hidden":!0}),(0,y.jsx)(r,{id:`hp8OtS`})]}):null,t[2]=a,t[3]=d);let f=n.publisher??n.source,p;t[4]===f?p=t[5]:(p=(0,y.jsx)(`span`,{className:`truncate`,children:f}),t[4]=f,t[5]=p);let m;t[6]===n.publisher?m=t[7]:(m=n.publisher===`openknowledge`||n.publisher===`inkeep`?(0,y.jsx)(u,{variant:`secondary`,className:`h-4 px-1 text-[10px] uppercase tracking-wide`,children:(0,y.jsx)(r,{id:`o0bHtA`})}):null,t[6]=n.publisher,t[7]=m);let h;t[8]!==s||t[9]!==n.installs?(h=n.installs==null?null:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{"aria-hidden":!0,children:`·`}),(0,y.jsxs)(`span`,{className:`shrink-0`,children:[(0,y.jsx)(`span`,{"aria-hidden":`true`,children:`↓ `}),(0,y.jsxs)(`span`,{className:`sr-only`,children:[(0,y.jsx)(r,{id:`7m3Ade`}),` `]}),x(n.installs,s.locale)]})]}),t[8]=s,t[9]=n.installs,t[10]=h):h=t[10];let g;t[11]!==p||t[12]!==m||t[13]!==h?(g=(0,y.jsxs)(`div`,{className:`mt-0.5 flex items-center gap-1.5 text-muted-foreground text-xs`,children:[p,m,h]}),t[11]=p,t[12]=m,t[13]=h,t[14]=g):g=t[14];let _;return t[15]!==o||t[16]!==n.description||t[17]!==n.name||t[18]!==c||t[19]!==d||t[20]!==g?(_=(0,y.jsx)(b,{name:n.name,description:n.description,onOpen:o,leading:c,action:d,meta:g}),t[15]=o,t[16]=n.description,t[17]=n.name,t[18]=c,t[19]=d,t[20]=g,t[21]=_):_=t[21],_}function w(){let e=(0,v.c)(7),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={queryKey:[`skills`,`popular`],queryFn:T,staleTime:3e5},e[0]=t):t=e[0];let{data:n,isPending:r,isError:i}=a(t),o;e[1]===n?o=e[2]:(o=n??[],e[1]=n,e[2]=o);let s;return e[3]!==i||e[4]!==r||e[5]!==o?(s={skills:o,isPending:r,failed:i},e[3]=i,e[4]=r,e[5]=o,e[6]=s):s=e[6],s}async function T(){let e=await d();if(!e.ok)throw Error(e.error);return e.results}function E(e,t){return e.find(e=>e.origin?.source===t.source&&(e.name===t.name||e.name===`${t.name}-imported`||e.name.startsWith(`${t.name}-imported-`)))??null}function D(e){let t=(0,v.c)(15),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{scope:r,onNavigate:i}=n,a=p(),o=f(),s;t[2]!==o.data||t[3]!==o.status?(s=o.status===`ready`?o.data.filter(O):[],t[2]=o.data,t[3]=o.status,t[4]=s):s=t[4];let c=s,l;t[5]===c?l=t[6]:(l=e=>E(c,e),t[5]=c,t[6]=l);let u=l,d;t[7]!==u||t[8]!==i||t[9]!==a||t[10]!==r?(d=function(e){i?.();let t=u(e);if(t){a(t.scope,t.name);return}m({flavor:`explore`,source:e.source,name:e.name,subtitle:e.source,level:r})},t[7]=u,t[8]=i,t[9]=a,t[10]=r,t[11]=d):d=t[11];let h=d,g;return t[12]!==u||t[13]!==h?(g={importedEntry:u,openResult:h},t[12]=u,t[13]=h,t[14]=g):g=t[14],g}function O(e){return e.origin}export{h as a,g as i,w as n,C as r,D as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{r as n}from"./dist-Nvb76hAm.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{Ha as i}from"./dist-lf4nG52q2.js";import{n as a}from"./dist-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{r as n}from"./dist-Nvb76hAm.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{Ha as i}from"./dist-lf4nG52q2.js";import{n as a}from"./dist-Dr52ya0i.js";import{b as o,w as s}from"./skills-api-DF632dit.js";import{t as c}from"./use-skills-CjgBfNqJ.js";var l=r(),u=e(t(),1);function d(e,t,n){let r=(0,l.c)(13),[i,a]=(0,u.useState)(!1),[s,c]=(0,u.useState)(!1),[d,p]=(0,u.useState)(0),m;r[0]!==n||r[1]!==t||r[2]!==e?(m=()=>{if(!n){a(!1);return}let r=!1;return o({scope:e,name:t,dryRun:!0}).then(e=>{r||(a(e.ok&&e.updated===!0),c(e.ok&&e.gitTracked===!0))}),()=>{r=!0}},r[0]=n,r[1]=t,r[2]=e,r[3]=m):m=r[3];let h;r[4]!==n||r[5]!==t||r[6]!==d||r[7]!==e?(h=[e,t,n,d],r[4]=n,r[5]=t,r[6]=d,r[7]=e,r[8]=h):h=r[8],(0,u.useEffect)(m,h);let g;r[9]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>p(f),r[9]=g):g=r[9];let _;return r[10]!==i||r[11]!==s?(_={available:i,gitTracked:s,recheck:g},r[10]=i,r[11]=s,r[12]=_):_=r[12],_}function f(e){return e+1}function p(e,t){return e.publisher?i(e.source,e.skill??t)?.skillsUrl??null:null}function m(e){let t=e.trim();if(/^https?:\/\//i.test(t))return t.includes(`github.com`)?t.replace(/\.git$/,``):null;if(/^(?:\.|\/|~|file:|git@)/.test(t))return null;let n=/^([\w.-]+)\/([\w.-]+?)(?:\.git)?(?:\/.*)?$/.exec(t);return n?`https://github.com/${n[1]}/${n[2]}`:null}function h(e,t){return p(e,t)??e.marketplaceUrl??m(e.source)}var g=new Set;function _(e){if(!e)return!1;if(e.autoUpdate!==void 0)return e.autoUpdate;let t=e.source.trim();return t.startsWith(`/`)||t.startsWith(`.`)||t.startsWith(`~`)||t.startsWith(`file://`)||/^[A-Za-z]:[\\/]/.test(t)||t.startsWith(`\\\\`)}function v(e){let t=(0,l.c)(33),{scope:r,name:i}=e,{_:f}=n(),p=c(),m=p.status===`ready`?p.data.find(e=>e.scope===r&&e.name===i):void 0,v=m?.origin??null,y=v?/^adopt:(.+)$/.exec(v.source):null,b=y?y[1].charAt(0).toUpperCase()+y[1].slice(1):null,x=!!v&&!b,{available:S,gitTracked:C,recheck:w}=d(r,i,x),[T,E]=(0,u.useState)(!1),[D,O]=(0,u.useState)(!1),k=_(v),A=m?.modified??!1,j;t[0]!==f||t[1]!==i||t[2]!==w||t[3]!==r?(j=async function(){E(!0);let e=await o({scope:r,name:i});if(E(!1),!e.ok){a.error(f({id:`AYoYhU`,values:{0:e.error}}));return}e.updated?a.success(f({id:`YS9mSt`,values:{0:e.source,name:i}})):a.success(f({id:`ah_ekO`,values:{name:i}}));for(let t of e.warnings)a.warning(t);w()},t[0]=f,t[1]=i,t[2]=w,t[3]=r,t[4]=j):j=t[4];let M=j;(0,u.useEffect)(()=>{if(!S||!k||A||T||C)return;let e=`${r}:${i}`;g.has(e)||(g.add(e),M())});let N;t[5]!==f||t[6]!==i||t[7]!==r?(N=async function(){let e=await o({scope:r,name:i,dryRun:!0});return e.ok?!e.updated||e.upstreamBody===void 0?(a.success(f({id:`ah_ekO`,values:{name:i}})),null):{localBody:e.localBody??``,upstreamBody:e.upstreamBody}:(a.error(f({id:`AYoYhU`,values:{0:e.error}})),null)},t[5]=f,t[6]=i,t[7]=r,t[8]=N):N=t[8];let P=N,F;t[9]!==f||t[10]!==i?(F=async function(){O(!0);let e=await s({name:i});if(O(!1),!e.ok){a.error(f({id:`RO9IbI`,values:{0:e.error}}));return}a.success(f({id:`BhLPRk`,values:{name:i}}));for(let t of e.warnings)a.warning(t)},t[9]=f,t[10]=i,t[11]=F):F=t[11];let I=F,L=v?/\/plugins\/cache\/[^/]+\/([^/]+)\//.exec(v.source)??/\/plugins\/marketplaces\/([^/]+)\//.exec(v.source):null,R=v?b?f({id:`e6dMJT`,values:{harnessLabel:b}}):L?f({id:`xBFg6z`,values:{0:L[1]}}):v.source:null,z=v?new Date(v.importedAt):null,B=z&&!Number.isNaN(z.getTime())?z.toLocaleDateString(void 0,{year:`numeric`,month:`short`,day:`numeric`}):v?.importedAt??null,V=v?h(v,i):null,H=B?f({id:`9J8xNg`,values:{importedLabel:B}}):null,U;t[12]!==f||t[13]!==i||t[14]!==r?(U=async e=>{let t=await o({scope:r,name:i,setAutoUpdate:e});if(!t.ok){a.error(f({id:`fMsFdZ`,values:{0:t.error}}));return}a.success(f(e?{id:`UNwKSz`,values:{name:i}}:{id:`HAvHev`,values:{name:i}}))},t[12]=f,t[13]=i,t[14]=r,t[15]=U):U=t[15];let W=m?.revertable??!1,G;return t[16]!==k||t[17]!==x||t[18]!==R||t[19]!==C||t[20]!==A||t[21]!==v||t[22]!==P||t[23]!==M||t[24]!==T||t[25]!==I||t[26]!==D||t[27]!==V||t[28]!==H||t[29]!==U||t[30]!==W||t[31]!==S?(G={origin:v,github:V,displaySource:R,importedTitle:H,canReimport:x,updateAvailable:S,modified:A,autoUpdate:k,gitTracked:C,setAutoUpdate:U,revertable:W,reimport:M,reimporting:T,previewUpdate:P,revert:I,reverting:D},t[16]=k,t[17]=x,t[18]=R,t[19]=C,t[20]=A,t[21]=v,t[22]=P,t[23]=M,t[24]=T,t[25]=I,t[26]=D,t[27]=V,t[28]=H,t[29]=U,t[30]=W,t[31]=S,t[32]=G):G=t[32],G}export{v as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{kt as r}from"./dist-lf4nG52q2.js";import{t as i}from"./parse-api-error-
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{kt as r}from"./dist-lf4nG52q2.js";import{t as i}from"./parse-api-error-9c-Rs5WJ.js";import{d as a,f as o,t as s}from"./documents-events-Bz6CFw_P.js";var c=n(),l=e(t(),1),u=null,d=null;function f(){return d??=fetch(`/api/skills`).then(async e=>{if(!e.ok){let t=await e.json().catch(()=>null);throw Error(i(t)??`HTTP ${e.status}`)}return e.json()}).finally(()=>{d=null}),d}function p(e){let t=(0,c.c)(9),n=e?.enabled??!0,[i,d]=(0,l.useState)(g),[p,_]=(0,l.useState)(0),v,y;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v=()=>{let e=null,t=()=>{e&&clearTimeout(e),e=setTimeout(()=>_(h),200)},n=o(t),r=a(e=>{e.includes(`files`)&&t()});return()=>{e&&clearTimeout(e),n(),r()}},y=[],t[0]=v,t[1]=y):(v=t[0],y=t[1]),(0,l.useEffect)(v,y);let b;t[2]===n?b=t[3]:(b=()=>{if(!n)return;let e=!1;return d(m),f().then(t=>{if(e)return;let n=r.safeParse(t);if(!n.success){console.error(`[ok-skills] /api/skills response failed schema validation:`,n.error.issues),d({status:`error`,message:`Server returned an incomplete skills response.`});return}u=n.data.skills,d({status:`ready`,data:n.data.skills})}).catch(t=>{e||d({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},t[2]=n,t[3]=b);let x;t[4]!==n||t[5]!==p?(x=[p,n],t[4]=n,t[5]=p,t[6]=x):x=t[6],(0,l.useEffect)(b,x);let S;return t[7]===i?S=t[8]:(S=i.status===`ready`?{status:`ready`,data:s(i.data)}:i,t[7]=i,t[8]=S),S}function m(e){return e.status===`ready`?e:{status:`loading`}}function h(e){return e+1}function g(){return u===null?{status:`idle`}:{status:`ready`,data:u}}export{p as t};
|
package/dist/public/assets/{use-terminal-enabled-DVN1muEr.js → use-terminal-enabled-6lUTjD1J.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./compiler-runtime-BfE3aGVn.js";import{t}from"./terminal-telemetry-
|
|
1
|
+
import{t as e}from"./compiler-runtime-BfE3aGVn.js";import{t}from"./terminal-telemetry-tRSeGdHR.js";import{go as n}from"./dist-lf4nG52q2.js";import"./config-provider-CH2tG_0H.js";import{n as r}from"./config-context-7il4AXHf.js";var i=e();function a(){let e=(0,i.c)(3),{projectLocalConfig:t,projectLocalSynced:n}=r(),a=t?.terminal?.enabled??null,o;return e[0]!==n||e[1]!==a?(o={enabled:a,synced:n},e[0]=n,e[1]=a,e[2]=o):o=e[2],o}function o(){let e=(0,i.c)(2),{projectLocalBinding:a}=r();if(a===null)return null;let o;return e[0]===a?o=e[1]:(o=e=>{let r=a.patch({terminal:{enabled:e}});return r.ok&&e&&t(),r.ok?{ok:!0}:{ok:!1,error:n(r.error)}},e[0]=a,e[1]=o),o}export{o as n,a as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{h as r,i}from"./DocumentContext-Bhb-Rllg.js";import{t as a}from"./react-f2sANaYj.js";import{t as o}from"./react-dom-DPxgxlDT.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{A as c,et as l,q as u}from"./CodeMirrorPropInput-C21yk3-k.js";import{$i as d,Hi as f,Ki as p,Ua as m,Vi as h,W as g,Zi as _,gi as v,ki as y,na as b,qi as x,ra as S,ta as C}from"./dist-lf4nG52q2.js";import{t as ee}from"./libesm-DXt8eMZu.js";var w=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.unescapeToken=t,e.escapeToken=n;function t(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function n(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.Pointer=function(){function e(e){e===void 0&&(e=[``]),this.tokens=e}return e.fromJSON=function(n){var r=n.split(`/`).map(t);if(r[0]!==``)throw Error(`Invalid JSON Pointer: ${n}`);return new e(r)},e.prototype.toString=function(){return this.tokens.map(n).join(`/`)},e.prototype.evaluate=function(e){for(var t=null,n=``,r=e,i=1,a=this.tokens.length;i<a;i++)t=r,n=this.tokens[i],!(n==`__proto__`||n==`constructor`||n==`prototype`)&&(r=(t||{})[n]);return{parent:t,key:n,value:r}},e.prototype.get=function(e){return this.evaluate(e).value},e.prototype.set=function(e,t){var n=this.evaluate(e);n.parent&&(n.parent[n.key]=t)},e.prototype.push=function(e){this.tokens.push(e)},e.prototype.add=function(t){return new e(this.tokens.concat(String(t)))},e.prototype.parent=function(){return new e(this.tokens.length>1?this.tokens.slice(0,-1):[``])},e}()})),T=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasOwnProperty=void 0,e.objectType=t,e.clone=r,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(e){return e===void 0?`undefined`:e===null?`null`:Array.isArray(e)?`array`:typeof e}function n(e){return typeof e==`object`&&!!e}function r(t){if(!n(t))return t;if(t.constructor==Array){for(var i=t.length,a=Array(i),o=0;o<i;o++)a[o]=r(t[o]);return a}if(t.constructor==Date)return new Date(+t);var s={};for(var c in t)e.hasOwnProperty.call(t,c)&&(s[c]=r(t[c]));return s}})),E=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isDestructive=n,e.subtract=r,e.intersection=i,e.diffArrays=l,e.diffObjects=u,e.diffAny=d;var t=T();function n(e){var t=e.op;return t===`remove`||t===`replace`||t===`copy`||t===`move`}function r(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&!(t.hasOwnProperty.call(n,i)&&n[i]!==void 0)&&r.push(i);return r}function i(e){for(var n=e.length,r={},i=0;i<n;i++){var a=e[i];for(var o in a)t.hasOwnProperty.call(a,o)&&a[o]!==void 0&&(r[o]=(r[o]||0)+1)}for(var o in r)r[o]<n&&delete r[o];return Object.keys(r)}function a(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&t.hasOwnProperty.call(n,i)&&n[i]!==void 0&&r.push(i);return r}function o(e){return e.op===`add`}function s(e){return e.op===`remove`}function c(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function l(e,t,n,r){r===void 0&&(r=d);var i=Math.max(e.length,t.length),a=new Map([[0,{operations:[],cost:0}]]);function l(o,s){var u=o*i+s,d=a.get(u);if(d===void 0){if(o>0&&s>0&&!r(e[o-1],t[s-1],n.add(String(o-1))).length)d=l(o-1,s-1);else{var f=[];if(o>0){var p=l(o-1,s),m={op:`remove`,index:o-1};f.push(c(p,m))}if(s>0){var h=l(o,s-1),g={op:`add`,index:o-1,value:t[s-1]};f.push(c(h,g))}if(o>0&&s>0){var _=l(o-1,s-1),v={op:`replace`,index:o-1,original:e[o-1],value:t[s-1]};f.push(c(_,v))}d=f.sort(function(e,t){return e.cost-t.cost})[0]}a.set(u,d)}return d}var u=isNaN(e.length)||e.length<=0?0:e.length;return l(u,isNaN(t.length)||t.length<=0?0:t.length).operations.reduce(function(e,t){var i=e[0],a=e[1];if(o(t)){var c=t.index+1+a,l=c<u+a?String(c):`-`,d={op:t.op,path:n.add(l).toString(),value:t.value};return[i.concat(d),a+1]}else if(s(t)){var d={op:t.op,path:n.add(String(t.index+a)).toString()};return[i.concat(d),a-1]}else{var f=n.add(String(t.index+a)),p=r(t.original,t.value,f);return[i.concat.apply(i,p),a]}},[[],0])[0]}function u(e,t,n,i){i===void 0&&(i=d);var o=[];return r(e,t).forEach(function(e){o.push({op:`remove`,path:n.add(e).toString()})}),r(t,e).forEach(function(e){o.push({op:`add`,path:n.add(e).toString(),value:t[e]})}),a(e,t).forEach(function(r){o.push.apply(o,i(e[r],t[r],n.add(r)))}),o}function d(e,n,r,i){if(i===void 0&&(i=d),e===n)return[];var a=(0,t.objectType)(e),o=(0,t.objectType)(n);return a==`array`&&o==`array`?l(e,n,r,i):a==`object`&&o==`object`?u(e,n,r,i):[{op:`replace`,path:r.toString(),value:n}]}})),te=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.InvalidOperationError=e.TestError=e.MissingError=void 0,e.add=l,e.remove=u,e.replace=d,e.move=f,e.copy=p,e.test=m,e.apply=g;var n=w(),r=T(),i=E(),a=function(e){t(n,e);function n(t){var n=e.call(this,`Value required at path: ${t}`)||this;return n.path=t,n.name=`MissingError`,n}return n}(Error);e.MissingError=a;var o=function(e){t(n,e);function n(t,n){var r=e.call(this,`Test failed: ${t} != ${n}`)||this;return r.actual=t,r.expected=n,r.name=`TestError`,r}return n}(Error);e.TestError=o;function s(e,t,n){if(Array.isArray(e))if(t==`-`)e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function c(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function l(e,t,i){var o=n.Pointer.fromJSON(t.path);if(i?.implicitArrayCreation&&o.tokens[o.tokens.length-1]===`-`){var c=o.parent().evaluate(e);c.value===void 0&&(0,r.objectType)(c.parent)===`object`&&(c.parent[c.key]=[])}var l=o.evaluate(e);return l.parent===void 0||i?.implicitArrayCreation&&l.key===`-`&&!Array.isArray(l.parent)?new a(t.path):(s(l.parent,l.key,(0,r.clone)(t.value)),null)}function u(e,t,r){var i=n.Pointer.fromJSON(t.path).evaluate(e);return i.value===void 0?new a(t.path):(c(i.parent,i.key),null)}function d(e,t,i){var o=n.Pointer.fromJSON(t.path).evaluate(e);if(o.parent===null)return new a(t.path);if(Array.isArray(o.parent)){if(parseInt(o.key,10)>=o.parent.length)return new a(t.path)}else if(o.value===void 0)return new a(t.path);return o.parent[o.key]=(0,r.clone)(t.value),null}function f(e,t,r){var i=n.Pointer.fromJSON(t.from).evaluate(e);if(i.value===void 0)return new a(t.from);var o=n.Pointer.fromJSON(t.path).evaluate(e);return o.parent===void 0?new a(t.path):(c(i.parent,i.key),s(o.parent,o.key,i.value),null)}function p(e,t,i){var o=n.Pointer.fromJSON(t.from).evaluate(e);if(o.value===void 0)return new a(t.from);var c=n.Pointer.fromJSON(t.path).evaluate(e);return c.parent===void 0?new a(t.path):(s(c.parent,c.key,(0,r.clone)(o.value)),null)}function m(e,t,r){var a=n.Pointer.fromJSON(t.path).evaluate(e);return(0,i.diffAny)(a.value,t.value,new n.Pointer).length?new o(a.value,t.value):null}var h=function(e){t(n,e);function n(t){var n=e.call(this,`Invalid operation: ${t.op}`)||this;return n.operation=t,n.name=`InvalidOperationError`,n}return n}(Error);e.InvalidOperationError=h;function g(e,t,n){switch(t.op){case`add`:return l(e,t,n);case`remove`:return u(e,t,n);case`replace`:return d(e,t,n);case`move`:return f(e,t,n);case`copy`:return p(e,t,n);case`test`:return m(e,t,n)}return new h(t)}})),ne=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.applyPatch=i,e.createPatch=o;var t=w();Object.defineProperty(e,`Pointer`,{enumerable:!0,get:function(){return t.Pointer}});var n=te(),r=E();function i(e,t,r){return t.map(function(t){return(0,n.apply)(e,t,r)})}function a(e){function t(n,i,a){var o=e(n,i,a);return Array.isArray(o)?o:(0,r.diffAny)(n,i,a,t)}return t}function o(e,n,i){var o=new t.Pointer;return(i?a(i):r.diffAny)(e,n,o)}})),D=e(a(),1),re=e(o(),1),O=s(),k=ne();function A(){}A.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(ie(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function ie(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}var j=new A;function ae(e,t,n){return j.diff(e,t,n)}var M=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,N=/\S/,P=new A;P.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!N.test(e)&&!N.test(t)},P.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&M.test(t[n])&&M.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function oe(e,t,n){return P.diff(e,t,n)}var F=new A;F.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
1
|
+
import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{h as r,i}from"./DocumentContext-BYAIHlLG.js";import{t as a}from"./react-f2sANaYj.js";import{t as o}from"./react-dom-DPxgxlDT.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{A as c,et as l,q as u}from"./CodeMirrorPropInput-yJZmvoN3.js";import{$i as d,Hi as f,Ki as p,Ua as m,Vi as h,W as g,Zi as _,gi as v,ki as y,na as b,qi as x,ra as S,ta as C}from"./dist-lf4nG52q2.js";import{t as ee}from"./libesm-COuF-Ycc.js";var w=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.unescapeToken=t,e.escapeToken=n;function t(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function n(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.Pointer=function(){function e(e){e===void 0&&(e=[``]),this.tokens=e}return e.fromJSON=function(n){var r=n.split(`/`).map(t);if(r[0]!==``)throw Error(`Invalid JSON Pointer: ${n}`);return new e(r)},e.prototype.toString=function(){return this.tokens.map(n).join(`/`)},e.prototype.evaluate=function(e){for(var t=null,n=``,r=e,i=1,a=this.tokens.length;i<a;i++)t=r,n=this.tokens[i],!(n==`__proto__`||n==`constructor`||n==`prototype`)&&(r=(t||{})[n]);return{parent:t,key:n,value:r}},e.prototype.get=function(e){return this.evaluate(e).value},e.prototype.set=function(e,t){var n=this.evaluate(e);n.parent&&(n.parent[n.key]=t)},e.prototype.push=function(e){this.tokens.push(e)},e.prototype.add=function(t){return new e(this.tokens.concat(String(t)))},e.prototype.parent=function(){return new e(this.tokens.length>1?this.tokens.slice(0,-1):[``])},e}()})),T=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasOwnProperty=void 0,e.objectType=t,e.clone=r,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(e){return e===void 0?`undefined`:e===null?`null`:Array.isArray(e)?`array`:typeof e}function n(e){return typeof e==`object`&&!!e}function r(t){if(!n(t))return t;if(t.constructor==Array){for(var i=t.length,a=Array(i),o=0;o<i;o++)a[o]=r(t[o]);return a}if(t.constructor==Date)return new Date(+t);var s={};for(var c in t)e.hasOwnProperty.call(t,c)&&(s[c]=r(t[c]));return s}})),E=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isDestructive=n,e.subtract=r,e.intersection=i,e.diffArrays=l,e.diffObjects=u,e.diffAny=d;var t=T();function n(e){var t=e.op;return t===`remove`||t===`replace`||t===`copy`||t===`move`}function r(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&!(t.hasOwnProperty.call(n,i)&&n[i]!==void 0)&&r.push(i);return r}function i(e){for(var n=e.length,r={},i=0;i<n;i++){var a=e[i];for(var o in a)t.hasOwnProperty.call(a,o)&&a[o]!==void 0&&(r[o]=(r[o]||0)+1)}for(var o in r)r[o]<n&&delete r[o];return Object.keys(r)}function a(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&t.hasOwnProperty.call(n,i)&&n[i]!==void 0&&r.push(i);return r}function o(e){return e.op===`add`}function s(e){return e.op===`remove`}function c(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function l(e,t,n,r){r===void 0&&(r=d);var i=Math.max(e.length,t.length),a=new Map([[0,{operations:[],cost:0}]]);function l(o,s){var u=o*i+s,d=a.get(u);if(d===void 0){if(o>0&&s>0&&!r(e[o-1],t[s-1],n.add(String(o-1))).length)d=l(o-1,s-1);else{var f=[];if(o>0){var p=l(o-1,s),m={op:`remove`,index:o-1};f.push(c(p,m))}if(s>0){var h=l(o,s-1),g={op:`add`,index:o-1,value:t[s-1]};f.push(c(h,g))}if(o>0&&s>0){var _=l(o-1,s-1),v={op:`replace`,index:o-1,original:e[o-1],value:t[s-1]};f.push(c(_,v))}d=f.sort(function(e,t){return e.cost-t.cost})[0]}a.set(u,d)}return d}var u=isNaN(e.length)||e.length<=0?0:e.length;return l(u,isNaN(t.length)||t.length<=0?0:t.length).operations.reduce(function(e,t){var i=e[0],a=e[1];if(o(t)){var c=t.index+1+a,l=c<u+a?String(c):`-`,d={op:t.op,path:n.add(l).toString(),value:t.value};return[i.concat(d),a+1]}else if(s(t)){var d={op:t.op,path:n.add(String(t.index+a)).toString()};return[i.concat(d),a-1]}else{var f=n.add(String(t.index+a)),p=r(t.original,t.value,f);return[i.concat.apply(i,p),a]}},[[],0])[0]}function u(e,t,n,i){i===void 0&&(i=d);var o=[];return r(e,t).forEach(function(e){o.push({op:`remove`,path:n.add(e).toString()})}),r(t,e).forEach(function(e){o.push({op:`add`,path:n.add(e).toString(),value:t[e]})}),a(e,t).forEach(function(r){o.push.apply(o,i(e[r],t[r],n.add(r)))}),o}function d(e,n,r,i){if(i===void 0&&(i=d),e===n)return[];var a=(0,t.objectType)(e),o=(0,t.objectType)(n);return a==`array`&&o==`array`?l(e,n,r,i):a==`object`&&o==`object`?u(e,n,r,i):[{op:`replace`,path:r.toString(),value:n}]}})),te=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.InvalidOperationError=e.TestError=e.MissingError=void 0,e.add=l,e.remove=u,e.replace=d,e.move=f,e.copy=p,e.test=m,e.apply=g;var n=w(),r=T(),i=E(),a=function(e){t(n,e);function n(t){var n=e.call(this,`Value required at path: ${t}`)||this;return n.path=t,n.name=`MissingError`,n}return n}(Error);e.MissingError=a;var o=function(e){t(n,e);function n(t,n){var r=e.call(this,`Test failed: ${t} != ${n}`)||this;return r.actual=t,r.expected=n,r.name=`TestError`,r}return n}(Error);e.TestError=o;function s(e,t,n){if(Array.isArray(e))if(t==`-`)e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function c(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function l(e,t,i){var o=n.Pointer.fromJSON(t.path);if(i?.implicitArrayCreation&&o.tokens[o.tokens.length-1]===`-`){var c=o.parent().evaluate(e);c.value===void 0&&(0,r.objectType)(c.parent)===`object`&&(c.parent[c.key]=[])}var l=o.evaluate(e);return l.parent===void 0||i?.implicitArrayCreation&&l.key===`-`&&!Array.isArray(l.parent)?new a(t.path):(s(l.parent,l.key,(0,r.clone)(t.value)),null)}function u(e,t,r){var i=n.Pointer.fromJSON(t.path).evaluate(e);return i.value===void 0?new a(t.path):(c(i.parent,i.key),null)}function d(e,t,i){var o=n.Pointer.fromJSON(t.path).evaluate(e);if(o.parent===null)return new a(t.path);if(Array.isArray(o.parent)){if(parseInt(o.key,10)>=o.parent.length)return new a(t.path)}else if(o.value===void 0)return new a(t.path);return o.parent[o.key]=(0,r.clone)(t.value),null}function f(e,t,r){var i=n.Pointer.fromJSON(t.from).evaluate(e);if(i.value===void 0)return new a(t.from);var o=n.Pointer.fromJSON(t.path).evaluate(e);return o.parent===void 0?new a(t.path):(c(i.parent,i.key),s(o.parent,o.key,i.value),null)}function p(e,t,i){var o=n.Pointer.fromJSON(t.from).evaluate(e);if(o.value===void 0)return new a(t.from);var c=n.Pointer.fromJSON(t.path).evaluate(e);return c.parent===void 0?new a(t.path):(s(c.parent,c.key,(0,r.clone)(o.value)),null)}function m(e,t,r){var a=n.Pointer.fromJSON(t.path).evaluate(e);return(0,i.diffAny)(a.value,t.value,new n.Pointer).length?new o(a.value,t.value):null}var h=function(e){t(n,e);function n(t){var n=e.call(this,`Invalid operation: ${t.op}`)||this;return n.operation=t,n.name=`InvalidOperationError`,n}return n}(Error);e.InvalidOperationError=h;function g(e,t,n){switch(t.op){case`add`:return l(e,t,n);case`remove`:return u(e,t,n);case`replace`:return d(e,t,n);case`move`:return f(e,t,n);case`copy`:return p(e,t,n);case`test`:return m(e,t,n)}return new h(t)}})),ne=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.applyPatch=i,e.createPatch=o;var t=w();Object.defineProperty(e,`Pointer`,{enumerable:!0,get:function(){return t.Pointer}});var n=te(),r=E();function i(e,t,r){return t.map(function(t){return(0,n.apply)(e,t,r)})}function a(e){function t(n,i,a){var o=e(n,i,a);return Array.isArray(o)?o:(0,r.diffAny)(n,i,a,t)}return t}function o(e,n,i){var o=new t.Pointer;return(i?a(i):r.diffAny)(e,n,o)}})),D=e(a(),1),re=e(o(),1),O=s(),k=ne();function A(){}A.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(ie(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function ie(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}var j=new A;function ae(e,t,n){return j.diff(e,t,n)}var M=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,N=/\S/,P=new A;P.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!N.test(e)&&!N.test(t)},P.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&M.test(t[n])&&M.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function oe(e,t,n){return P.diff(e,t,n)}var F=new A;F.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
|
|
2
2
|
`));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var I=new A;I.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var se=new A;se.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function L(e){"@babel/helpers - typeof";return L=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},L(e)}var ce=Object.prototype.toString,R=new A;R.useLongestToken=!0,R.tokenize=F.tokenize,R.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(z(e,null,null,i),i,` `)},R.equals=function(e,t){return A.prototype.equals.call(R,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`))};function z(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(ce.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=z(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),L(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=z(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var B=new A;B.tokenize=function(e){return e.slice()},B.join=B.removeEmpty=function(e){return e};function V(e,t){let n=t.content.findDiffStart(e.content);if(n===null)return!1;let{a:r,b:i}=t.content.findDiffEnd(e.content),a=n-Math.min(r,i);return a>0&&(e.resolve(n-a).depth<t.resolve(r+a).depth?n-=a:(r+=a,i+=a)),new C(n,i,t.slice(n,r))}function le(e){if(!e.steps.length)return;let t=new b(e.docs[0]),n=e.steps.slice();for(;n.length;){let e=n.shift();for(;n.length&&e.merge(n[0]);){let r=n.shift();e=e instanceof C&&r instanceof C?V(t.doc,r.apply(e.apply(t.doc).doc).doc):e.merge(r)}t.step(e)}return t}function H(e){let t=new b(e);return t.removeMark(0,e.nodeSize-2),t.doc}function U(e,t){let n=t.split(`/`);for(n.shift();n.length;){if(typeof e!=`object`)throw Error();let t=n.shift();e=e[t]}return e}function W(e){return JSON.parse(JSON.stringify(e))}var ue=class{fromDoc;toDoc;complexSteps;wordDiffs;simplifyDiff;schema;tr;currentJSON;finalJSON;ops;constructor(e,t,n={}){let r={complexSteps:!0,wordDiffs:!1,simplifyDiff:!0,...n};this.fromDoc=e,this.toDoc=t,this.complexSteps=r.complexSteps,this.wordDiffs=r.wordDiffs,this.simplifyDiff=r.simplifyDiff,this.schema=e.type.schema,this.tr=new b(e),this.currentJSON={},this.finalJSON={},this.ops=[]}init(){return this.complexSteps?(this.currentJSON=H(this.fromDoc).toJSON(),this.finalJSON=H(this.toDoc).toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps(),this.recreateChangeMarkSteps()):(this.currentJSON=this.fromDoc.toJSON(),this.finalJSON=this.toDoc.toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps()),this.simplifyDiff&&(this.tr=le(this.tr)||this.tr),this.tr}recreateChangeContentSteps(){let e=[];for(;this.ops.length;){let t=this.ops.shift();e.push(t);let n,r=W(this.currentJSON),i=t.path.split(`/`);for(;n==null;){(0,k.applyPatch)(r,[t]);try{n=this.schema.nodeFromJSON(r),n.check()}catch{if(n=null,this.ops.length>0)t=this.ops.shift(),e.push(t);else throw Error(`No valid diff possible applying ${t.path}`)}}this.complexSteps&&e.length===1&&(i.includes(`attrs`)||i.includes(`type`))?(this.addSetNodeMarkup(),e=[]):e.length===1&&t.op===`replace`&&i[i.length-1]===`text`?(this.addReplaceTextSteps(t,r),e=[]):this.addReplaceStep(n,r)&&(e=[])}}addSetNodeMarkup(){let e=this.schema.nodeFromJSON(this.currentJSON),t=this.schema.nodeFromJSON(this.finalJSON),n=t.content.findDiffStart(e.content),r=e.nodeAt(n),i=t.nodeAt(n);if(n!=null){let e=r.type===i.type?null:i.type;try{this.tr.setNodeMarkup(n,e,i.attrs,i.marks)}catch(t){if(e&&t.message.includes(`Invalid content`))this.tr.replaceWith(n,n+r.nodeSize,i);else throw t}return this.currentJSON=H(this.tr.doc).toJSON(),this.ops=(0,k.createPatch)(this.currentJSON,this.finalJSON),!0}return!1}recreateChangeMarkSteps(){this.toDoc.descendants((e,t)=>{if(!e.isInline)return!0;this.tr.doc.nodesBetween(t,t+e.nodeSize,(n,r)=>{if(!n.isInline)return!0;let i=Math.max(t,r),a=Math.min(t+e.nodeSize,r+n.nodeSize);n.marks.forEach(t=>{t.isInSet(e.marks)||this.tr.removeMark(i,a,t)}),e.marks.forEach(e=>{e.isInSet(n.marks)||this.tr.addMark(i,a,e)})})})}addReplaceStep(e,t){let n=V(this.schema.nodeFromJSON(this.currentJSON),e);if(!n)return!1;if(!this.tr.maybeStep(n).failed)return this.currentJSON=t,!0;throw Error(`No valid step found.`)}addReplaceTextSteps(e,t){let n={...e,value:`xx`},r={...e,value:`yy`},i=W(this.currentJSON),a=W(this.currentJSON);(0,k.applyPatch)(i,[n]),(0,k.applyPatch)(a,[r]);let o=this.schema.nodeFromJSON(i),s=this.schema.nodeFromJSON(a),c=e.value,l=U(this.currentJSON,e.path),u=this.wordDiffs?oe(l,c):ae(l,c),d=o.content.findDiffStart(s.content),f=o.resolve(d+1).marks();for(;u.length;){let e=u.shift();if(e.added){let t=this.schema.nodeFromJSON({type:`text`,text:e.value}).mark(f);if(u.length&&u[0].removed){let e=u.shift();this.tr.replaceWith(d,d+e.value.length,t)}else this.tr.insert(d,t);d+=e.value.length}else if(e.removed)if(u.length&&u[0].added){let t=u.shift(),n=this.schema.nodeFromJSON({type:`text`,text:t.value}).mark(f);this.tr.replaceWith(d,d+e.value.length,n),d+=t.value.length}else this.tr.delete(d,d+e.value.length);else d+=e.value.length}this.currentJSON=t}};function de(e,t,n={}){return new ue(e,t,n).init()}var G=new Set([`list`,`bulletList`,`orderedList`,`taskList`]);function K(e){let t=[];return e.forEach((e,n)=>{if(G.has(e.type.name)){let r=n+1,i=0;e.forEach(e=>{let n=r+i;t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`}),i+=e.nodeSize})}else t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`})}),t}function fe(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)i[a][n]=e[a].key===t[n].key?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o].key===t[s].key?(a.push({type:`same`,b:t[s]}),o++,s++):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,a:e[o]}),o++):(a.push({type:`ins`,b:t[s]}),s++);for(;o<n;)a.push({type:`del`,a:e[o++]});for(;s<r;)a.push({type:`ins`,b:t[s++]});return a}function pe(e,t){let n=fe(K(e),K(t)),r=[],i=0;for(let e of n)e.type===`same`?i=e.b.to:e.type===`ins`?(r.push({fromA:0,toA:0,fromB:e.b.from,toB:e.b.to}),i=e.b.to):r.push({fromA:e.a.from,toA:e.a.to,fromB:i,toB:i});return r}var me=400;function q(e,t,n){return t.nodeFromJSON(e.parseWithFallback(n))}function he(e,t){let n=t.filter(e=>e.toB>e.fromB),r=[];return e.steps.forEach((t,i)=>{let a=t instanceof _?`add`:t instanceof d?`remove`:null;if(a===null)return;let o=t,s=e.mapping.slice(i+1),c=s.map(o.from,-1),l=s.map(o.to,1);if(l<=c||n.some(e=>e.fromB<=c&&l<=e.toB))return;let u=e.mapping.slice(0,i).invert(),f=u.map(o.from),p=u.map(o.to);p<=f||r.push({fromA:f,toA:p,fromB:c,toB:l,markName:o.mark.type.name,kind:a})}),r}function ge(e,t,n,r){if(e.length>2e5||t.length>2e5)return{ok:!1,reason:`ceiling`};let i,a;try{i=q(r,n,e),a=q(r,n,t)}catch{return{ok:!1,reason:`parse`}}let o=a,s=null;try{s=de(i,a,{complexSteps:!0,wordDiffs:!0,simplifyDiff:!0}),o=s.doc}catch{}let c=pe(i,o),l=s?he(s,c):[];return c.length+l.length>me?{ok:!1,reason:`ceiling`}:{ok:!0,afterDoc:o,beforeDoc:i,changes:c,markChanges:l}}var _e=`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`;function ve(e){return e.changes.length+2*e.markChanges.length}function J(e){let t=!1;return e.forEach(e=>{e.isBlock&&(t=!0)}),t}function ye(e){if(e.childCount===0)return!1;let t=!0;return e.forEach(e=>{e.type.name!==`listItem`&&e.type.name!==`taskItem`&&(t=!1)}),t}function Y(e,t,n){let r=document.createElement(n?`div`:`span`);r.className=n?`ok-diff-del ok-diff-del-block`:`ok-diff-del`,r.setAttribute(`data-diff-deleted`,``);let i=e.serializeFragment(t);if(n&&ye(t)){let e=document.createElement(`ul`);e.appendChild(i),r.appendChild(e)}else r.appendChild(i);return r}function be(e,t,n,r,i){let a=S.fromSchema(i),o=[];for(let e of r){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(h.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]})),o.push(h.inline(e.fromB,e.toB,{class:`ok-diff-ins`},{inclusiveEnd:!0}))}for(let e of n)if(e.toB>e.fromB&&o.push(h.node(e.fromB,e.toB,{class:`ok-diff-ins-block`})),e.toA>e.fromA){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(h.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]}))}return f.create(e,o)}var xe=new Set([`slashCommand`,`blockDragHandle`,`blockMover`,`tableInsertControls`,`fileHandler`,`gfmAutolink`,`inlineLinkInputRule`,`keyboardNav`,`tiptapFindReplace`,`selectionState`,`sourceDirtyObserver`,`tabFocusTrap`]),X=r.filter(e=>!xe.has(e.name)).map(e=>e.name===`jsxComponent`?g:e),Z=n(),Q=y(X);function Se(e,t){return ge(e,t,Q,c())}var Ce=v.create({name:`renderedDiffDecorations`,addOptions(){return{decorations:f.empty}},addProseMirrorPlugins(){let e=this.options.decorations;return[new p({key:new x(`renderedDiffDecorations`),props:{decorations:()=>e}})]}});function we(e){let t=(0,O.c)(31),{diff:n}=e,r,i,a,o;if(t[0]!==n.afterDoc||t[1]!==n.beforeDoc||t[2]!==n.changes||t[3]!==n.markChanges){let e=be(n.afterDoc,n.beforeDoc,n.changes,n.markChanges,Q);o=l,a=!1,r=X,i=Ce.configure({decorations:e}),t[0]=n.afterDoc,t[1]=n.beforeDoc,t[2]=n.changes,t[3]=n.markChanges,t[4]=r,t[5]=i,t[6]=a,t[7]=o}else r=t[4],i=t[5],a=t[6],o=t[7];let s;t[8]!==r||t[9]!==i?(s=[...r,i],t[8]=r,t[9]=i,t[10]=s):s=t[10];let c;t[11]===n.afterDoc?c=t[12]:(c=n.afterDoc.toJSON(),t[11]=n.afterDoc,t[12]=c);let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d={attributes:{class:`pt-4`}},t[13]=d):d=t[13];let f;t[14]!==a||t[15]!==s||t[16]!==c?(f={editable:a,extensions:s,content:c,editorProps:d},t[14]=a,t[15]=s,t[16]=c,t[17]=f):f=t[17];let p;t[18]===n?p=t[19]:(p=[n],t[18]=n,t[19]=p);let m=o(f,p),[h]=(0,D.useState)(Te),g=(0,D.useRef)(null),_,v;t[20]===h?(_=t[21],v=t[22]):(_=()=>{let e=g.current;if(e)return e.appendChild(h),()=>{h.parentNode===e&&e.removeChild(h)}},v=[h],t[20]=h,t[21]=_,t[22]=v),(0,D.useLayoutEffect)(_,v);let y;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`div`,{className:`tiptap-editor`,children:(0,Z.jsx)(`div`,{ref:g,style:{display:`contents`}})}),t[23]=y):y=t[23];let b;t[24]===m?b=t[25]:(b=(0,Z.jsx)(u,{editor:m,className:`tiptap-editor-portal-content`}),t[24]=m,t[25]=b);let x;t[26]!==h||t[27]!==b?(x=(0,re.createPortal)(b,h),t[26]=h,t[27]=b,t[28]=x):x=t[28];let S;return t[29]===x?S=t[30]:(S=(0,Z.jsxs)(`div`,{className:`editor-doc-scroll min-h-0 flex-1`,"data-testid":`rendered-diff-view`,children:[y,x]}),t[29]=x,t[30]=S),S}function Te(){let e=document.createElement(`div`);return e.style.display=`contents`,e}function Ee(e){let t=0,n=!1;for(let r of e.split(`
|
|
3
3
|
`)){let e=r.startsWith(`+`)&&!r.startsWith(`+++`)||r.startsWith(`-`)&&!r.startsWith(`---`);e&&!n&&(t+=1),n=e}return t}function De(e){let t=Array.from(e.querySelectorAll(`.diff-code-insert, .diff-code-delete`)),n=[],r=null;for(let e of t){let t=e.closest(`tr`);t&&((r===null||t.previousElementSibling!==r)&&n.push(e),r=t)}return n}function $(e){let t=0,n=0;for(let r of e.split(`
|
|
4
4
|
`))r.startsWith(`+`)&&!r.startsWith(`+++`)?t++:r.startsWith(`-`)&&!r.startsWith(`---`)&&n++;return{additions:t,deletions:n}}function Oe(e,t){return`${e}\u0000${t}`}function ke(e,t,n){let r=m(e).body,i=m(t).body;return r===i?``:ee(n,r,i,``,``,{context:Math.max(r.split(`
|