@inkeep/open-knowledge 0.59.0-beta.2 → 0.59.0-beta.20
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/README.md +43 -0
- package/dist/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/acp-harness-probe-D3XBCJlW.mjs +3 -0
- package/dist/cli.mjs +63 -63
- package/dist/constants-CZbUCfs2.mjs +2 -0
- package/dist/fs-traced-C1nHpvFb.mjs +1 -0
- package/dist/{fs-traced-CJ0NSnI0.mjs → fs-traced-Dy67FR5_.mjs} +2 -2
- package/dist/{git-handle-DGgEJR3Q.mjs → git-handle-CNwCRo87.mjs} +3 -3
- package/dist/git-handle-NFQsjK7c.mjs +1 -0
- package/dist/index.d.mts +17 -44
- package/dist/index.mjs +201 -201
- package/dist/init-7CTnd_9x.mjs +638 -0
- package/dist/init-BJbL7X0r.mjs +1 -0
- package/dist/{launch-json-removal-C2sqlpi5.mjs → launch-json-removal-Csrv47E2.mjs} +2 -2
- package/dist/loader-DQH64t89.mjs +1 -0
- package/dist/{loader-BnpW6FXd.mjs → loader-DWgAKgRN.mjs} +2 -2
- package/dist/md-manager-Bp8E9rKB.mjs +2 -0
- package/dist/native/native-config.linux-x64-gnu.node +0 -0
- package/dist/native/package.json +3 -3
- package/dist/{open-browser-CtfBqG33.mjs → open-browser-NqfFJFxa.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-D2YlaiUs.mjs → preview-Byh_oZ6p.mjs} +2 -2
- package/dist/preview-wAZxumMb.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-DBbldt0k.js → ActivityModeContent-B1pQ8Fr1.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-DwjS2yV9.js → AgentDiffPane-DcYw43Zi.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-DoFc7NfG.js → AgentThreadClientBinder-B84l9uZw.js} +1 -1
- package/dist/public/assets/{AppMenubar-DzA6PAJ1.js → AppMenubar-D1k8f9DO.js} +1 -1
- package/dist/public/assets/{BugReportHistory-Dj4DWBsG.js → BugReportHistory-DnmaPA_t.js} +1 -1
- package/dist/public/assets/{BugReportHistoryDialog-DNOoF0sF.js → BugReportHistoryDialog-BjRpH89b.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-Bbe8zInO.js → CodeMirrorPropInput-Cw-cqnG9.js} +3 -3
- package/dist/public/assets/{DiffView-BuSYMH4e.js → DiffView-B-B3fi5F.js} +1 -1
- package/dist/public/assets/DocumentContext-DuId1ipA.js +38 -0
- package/dist/public/assets/{EditorModeToggle-K2dlTUFw.js → EditorModeToggle-d6K3kH0G.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-Crl0PHbt.js → EnableSyncConfirmDialog-_BecfoEt.js} +1 -1
- package/dist/public/assets/{ExcalidrawDocEditor-C89vengD.js → ExcalidrawDocEditor-C_J7SZoj.js} +1 -1
- package/dist/public/assets/FeedbackForm-D8N9fulH.js +1 -0
- package/dist/public/assets/{GraphPanel-BioJjRJE.js → GraphPanel-Dw4fPl4b.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-CTisXGKo.js → ImportSkillDialog-CTy28SPr.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-2PX1Y8Gp.js → LintConfigEditor-De4dE4SA.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-CKnZN6FQ.js +1 -0
- package/dist/public/assets/ManagedArtifactProperties-Cjn8Ah2m.js +1 -0
- package/dist/public/assets/McpConsentDialogBody-CQXH8Lp7.js +1 -0
- package/dist/public/assets/{MermaidDocEditor-Q13CWidl.js → MermaidDocEditor-D9FyG6Kw.js} +1 -1
- package/dist/public/assets/{PropertyDisplayRow-DVXahRWZ.js → PropertyDisplayRow-B9AaOerd.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody-BTwtPNzB.js → ReportBugDialogBody-DW4o2BT_.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-BzfcQ3Bd.js → SchemaConfigEditor-Cd1K2DoP.js} +1 -1
- package/dist/public/assets/SessionsHost-CJWBpA8P.js +2 -0
- package/dist/public/assets/{SettingsDialogBody-CBraPHPP.js → SettingsDialogBody-DpIUx5V_.js} +4 -4
- package/dist/public/assets/{ShareBranchSwitchDialog-DIQmuIkz.js → ShareBranchSwitchDialog-D1AH4Y6y.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-BWuqWxsw.js → ShareReceiveDialog-CbKDTc_q.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-CjolEfpx.js → ShareReceiveMissDialog-D1E5sCM9.js} +1 -1
- package/dist/public/assets/{SkillCostValue-6xiHOBnl.js → SkillCostValue-CNgPJgJP.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-BqzwArWv.js → SkillEditBanner-DlmybH22.js} +1 -1
- package/dist/public/assets/{SkillInstallMenu-CIrDCCxr.js → SkillInstallMenu-2eNo1Z7l.js} +2 -2
- package/dist/public/assets/{SkillOriginInline-9ArgS7v6.js → SkillOriginInline-C7edbNlp.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-B9LFwwR_.js → SkillToolbarControls-C3JaFbGd.js} +1 -1
- package/dist/public/assets/{SlidesToolbarControls-BZvu5Syj.js → SlidesToolbarControls-BjCNikZH.js} +1 -1
- package/dist/public/assets/{SourceEditor-BwO15VQF.js → SourceEditor-ok4GSPD_.js} +1 -1
- package/dist/public/assets/{TerminalPanel-B4u8CA0m.js → TerminalPanel-11TArWI4.js} +3 -3
- package/dist/public/assets/{TerminalWindowApp-BgTVBGP9.js → TerminalWindowApp-xZbxnWtH.js} +1 -1
- package/dist/public/assets/{TextDocEditor-DHilRKxH.js → TextDocEditor-CIIcTz5P.js} +1 -1
- package/dist/public/assets/ThreadView-COqnnOm_.js +14 -0
- package/dist/public/assets/{TimelineDiffPane-DBuwXW3c.js → TimelineDiffPane-B8aGyddp.js} +1 -1
- package/dist/public/assets/{agent-diff-store-C3QOPAgw.js → agent-diff-store-BLYDBu2n.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DBcpAYj1.js → auth-state-cache-CrXUa3P0.js} +3 -3
- package/dist/public/assets/client-version-K_S_dR_T.js +1 -0
- package/dist/public/assets/{cm-theme-Da-a0GOT.js → cm-theme-Bi-g5j8J.js} +1 -1
- package/dist/public/assets/{comment-chips-PokDlHuL.js → comment-chips-B_3iO5uw.js} +1 -1
- package/dist/public/assets/{config-provider-C7t6oRiN.js → config-provider-CTLH1QmT.js} +3 -3
- package/dist/public/assets/{dist-BpbQP0nJ.js → dist-8oXszleg.js} +1 -1
- package/dist/public/assets/{dist-DJO8o4ls2.js → dist-BJNERzM02.js} +1 -1
- package/dist/public/assets/{dist-DAvyu-Pu.js → dist-BLe6Laue.js} +1 -1
- package/dist/public/assets/{dist-DV5JQxhA.js → dist-BOvI9R-K.js} +1 -1
- package/dist/public/assets/{dist-RIwmEtSi.js → dist-CB_NMgy4.js} +1 -1
- package/dist/public/assets/{dist-9jLm2WMy.js → dist-CuMGVsog.js} +1 -1
- package/dist/public/assets/{dist-j8YNkBWX.js → dist-CyQvb_hJ.js} +1 -1
- package/dist/public/assets/{dist-CrpG6qZF.js → dist-DMk7rHfk.js} +1 -1
- package/dist/public/assets/{dist-DGemBD_J.js → dist-Dkm48MhE.js} +3 -3
- package/dist/public/assets/{dist-DtBd-emT.js → dist-DpwTwWzy.js} +1 -1
- package/dist/public/assets/{dist-83_CVK0Y.js → dist-RP9GkCTw.js} +1 -1
- package/dist/public/assets/{dist-CIfqGNU5.js → dist-THE2PCU5.js} +1 -1
- package/dist/public/assets/{dist-CmZSQ_Dr.js → dist-TdeurvvU.js} +1 -1
- package/dist/public/assets/{doc-paths-BkpejoFL.js → doc-paths-BmaDk64-.js} +1 -1
- package/dist/public/assets/{documents-events-B2g_1xMi.js → documents-events-uT6X4Tcz.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-BAEEzFBR.js → file-tree-adapter-CM4Ag7kS.js} +1 -1
- package/dist/public/assets/{file-tree-utils-CzXn1zjH.js → file-tree-utils-DBwwlF-O.js} +1 -1
- package/dist/public/assets/{folder-config-api-DPWmRi8a.js → folder-config-api-CAW_y1hA.js} +1 -1
- package/dist/public/assets/{follow-file-4OaGQKr8.js → follow-file-DXA3BOUt.js} +2 -2
- package/dist/public/assets/globals-DdEQxuJJ.css +1 -0
- package/dist/public/assets/i18n-BR0Ehm4U.js +1 -0
- package/dist/public/assets/{index-DjHwk3he.js → index-7NZkEURt.js} +13 -11
- package/dist/public/assets/known-skill-dirs-toPil01C.js +1 -0
- package/dist/public/assets/{lint-config-client-sK38eqbj.js → lint-config-client-425xrzvc.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-B4O09K7a.js → markdownlint-rule-browser-De3mHZNd.js} +1 -1
- package/dist/public/assets/messages-Bn-xu_rE.js +1 -0
- package/dist/public/assets/messages-CKJXoaKj.js +1 -0
- package/dist/public/assets/messages-CKdYjVhD.js +1 -0
- package/dist/public/assets/messages-CPGTW1NQ.js +1 -0
- package/dist/public/assets/messages-CS_N86Ei.js +1 -0
- package/dist/public/assets/messages-CnMRloEI.js +1 -0
- package/dist/public/assets/messages-DN3rXcam.js +1 -0
- package/dist/public/assets/messages-DXmfXtqf.js +1 -0
- package/dist/public/assets/messages-Dem4M78x.js +1 -0
- package/dist/public/assets/messages-JackANlx.js +1 -0
- package/dist/public/assets/messages-V72AX5Xv.js +1 -0
- package/dist/public/assets/messages-wfQK5euc.js +1 -0
- package/dist/public/assets/navigation-targets-PGhaiird.js +1 -0
- package/dist/public/assets/{open-managed-artifact-tab-ENQgQOde.js → open-managed-artifact-tab-CBK4CpP2.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-CUM2yGMy.js → pending-receive-nav-store-C_qwLsM1.js} +1 -1
- package/dist/public/assets/{prop-types-efgXxLQK.js → prop-types-5CGkfdug.js} +1 -1
- package/dist/public/assets/{receive-store-DHalgzeU.js → receive-store-DI90Nns7.js} +1 -1
- package/dist/public/assets/{selection-context-0QPVSyyM.js → selection-context-DDCkoK9e.js} +1 -1
- package/dist/public/assets/skill-actions-47p0S1kO.js +1 -0
- package/dist/public/assets/{skill-scope-gUkJkFRO.js → skill-scope-BaySijKB.js} +1 -1
- package/dist/public/assets/skills-api-B5a5iAvc.js +1 -0
- package/dist/public/assets/{src-C-kGu7U9.js → src-DZ2XSskm.js} +1 -1
- package/dist/public/assets/{tag-pill-input-BbNgNG5U.js → tag-pill-input-B8HUD_bs.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-CQRrvMAa.js → target-navigation-intent-BwI3e-KO.js} +1 -1
- package/dist/public/assets/{telemetry-impl-B-PaTlR_.js → telemetry-impl-BYZItTXA.js} +1 -1
- package/dist/public/assets/{telemetry-startup-toj6ifVD.js → telemetry-startup-3EwtyoWe.js} +1 -1
- package/dist/public/assets/{terminal-cli-display-w0URjEKX.js → terminal-cli-display-Bv_z6XXt.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-CLm4Tujb.js → terminal-launch-events-BUPvrCyE.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-Bwit7Ew2.js → terminal-telemetry-BcVdzV_Q.js} +1 -1
- package/dist/public/assets/{text-viewer-languages-BTH8XtqT.js → text-viewer-languages-CF6DiXgT.js} +2 -2
- package/dist/public/assets/{typing-burst-detector-BSBim2fh.js → typing-burst-detector-DSClMHUi.js} +1 -1
- package/dist/public/assets/{uninstall-DjCmbDes.js → uninstall-Awe1WTmu.js} +1 -1
- package/dist/public/assets/{use-activity-panel-Dsk5r0Dh.js → use-activity-panel-qWkBLHpg.js} +1 -1
- package/dist/public/assets/{use-apply-config-color-theme-DZRctrdg.js → use-apply-config-color-theme-BkWKpx5Z.js} +1 -1
- package/dist/public/assets/{use-collab-url-cmMNtL6Q.js → use-collab-url-Bw2JQFx-.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-C1EtEd_i.js → use-live-xterm-theme-8zXEZ6xs.js} +1 -1
- package/dist/public/assets/use-open-skill-D90cfK4C.js +1 -0
- package/dist/public/assets/use-popular-skills-K09T0BP-.js +1 -0
- package/dist/public/assets/{use-settings-route-BrzzIll2.js → use-settings-route-D53s2DY3.js} +1 -1
- package/dist/public/assets/use-skill-origin-BNGiYHuK.js +1 -0
- package/dist/public/assets/{use-terminal-enabled-nco9YpDh.js → use-terminal-enabled-CZvqovly.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-C_A3TeSj.js → use-timeline-entry-diff-6flbTc6U.js} +1 -1
- package/dist/public/assets/{use-workspace-8Sxb8Z6Q.js → use-workspace-CLXmIc7v.js} +1 -1
- package/dist/public/index.html +67 -67
- package/dist/public/uninstall.html +7 -7
- package/dist/{repair-launch-json-C8AhW98D.mjs → repair-launch-json-DRPudcLH.mjs} +2 -2
- package/dist/repair-mcp-configs-wNRE9zuI.mjs +2 -0
- package/dist/repair-skills-EH0Ffdw4.mjs +4 -0
- package/dist/repair-skills-g6r7LRh4.mjs +1 -0
- package/dist/{write-project-skill-B7q9oxw9.mjs → resolve-project-root-Nwm2qORT.mjs} +7 -7
- package/dist/server-lock-D5VOrm_3.mjs +1 -0
- package/dist/{server-lock-BmwIVWMl.mjs → server-lock-rUhECxao.mjs} +2 -2
- package/dist/{skill-teardown-Cx7h3ooY.mjs → skill-teardown-C6p-GLNj.mjs} +2 -2
- package/dist/{sleep-B416PNUo.mjs → sleep-CEs13Om_.mjs} +2 -2
- package/dist/src-BMU93Lqr.mjs +1 -0
- package/dist/src-CgJnLUby.mjs +2029 -0
- package/dist/{src-BxdlvOrw.mjs → src-DNXRgLIt.mjs} +118 -118
- package/dist/src-DganMrgf.mjs +20 -0
- package/dist/src-FRwwqmkJ.mjs +1 -0
- package/dist/start-Co2WNLNX.mjs +1 -0
- package/dist/start-xVODdbR6.mjs +12 -0
- package/dist/{ui-C7ao4aMi.mjs → ui-sG72X5aW.mjs} +3 -3
- package/package.json +17 -6
- package/scripts/verify-package-surface.mjs +57 -0
- package/dist/acp-harness-probe-DbmYyet3.mjs +0 -3
- package/dist/constants-B2i3K_l3.mjs +0 -2
- package/dist/fs-traced-Bmqe7SqT.mjs +0 -1
- package/dist/git-handle-CNjG3dz9.mjs +0 -1
- package/dist/init-Bt_IJJIs.mjs +0 -1
- package/dist/init-CF0murTO.mjs +0 -638
- package/dist/loader-AnN06DGS.mjs +0 -1
- package/dist/md-manager-30E0O9b-.mjs +0 -2
- package/dist/preview-U_HlFEjF.mjs +0 -1
- package/dist/public/assets/DocumentContext-BC38uC8R.js +0 -38
- package/dist/public/assets/FeedbackForm-wyWA05iX.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-BkJurdY8.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-Bmcgejtj.js +0 -1
- package/dist/public/assets/McpConsentDialogBody-5ojAKZte.js +0 -1
- package/dist/public/assets/SessionsHost-Bn80i4wO.js +0 -2
- package/dist/public/assets/ThreadView-7sbMEVak.js +0 -14
- package/dist/public/assets/client-version-Cea4CPxm.js +0 -1
- package/dist/public/assets/globals-DMVk7DOF.css +0 -1
- package/dist/public/assets/i18n-BzFVw6me.js +0 -1
- package/dist/public/assets/messages-7TQ4p_5e.js +0 -1
- package/dist/public/assets/messages-BAyOSOzR.js +0 -1
- package/dist/public/assets/messages-BLbXONgk.js +0 -1
- package/dist/public/assets/messages-BjIH4q0G.js +0 -1
- package/dist/public/assets/messages-BzRqDtdz.js +0 -1
- package/dist/public/assets/messages-Cimiq3nE.js +0 -1
- package/dist/public/assets/messages-Cn23SiIt.js +0 -1
- package/dist/public/assets/messages-Cpdcajhh.js +0 -1
- package/dist/public/assets/messages-DEperCf5.js +0 -1
- package/dist/public/assets/messages-Vju40UVv.js +0 -1
- package/dist/public/assets/messages-agMQw_WX.js +0 -1
- package/dist/public/assets/messages-pwWS2IL9.js +0 -1
- package/dist/public/assets/navigation-targets-saCskzOA.js +0 -1
- package/dist/public/assets/skill-actions-H0gbk5VS.js +0 -1
- package/dist/public/assets/skills-api-DriOKSSy.js +0 -1
- package/dist/public/assets/use-open-skill-BNgqZmZx.js +0 -1
- package/dist/public/assets/use-popular-skills-CfasFpLW.js +0 -1
- package/dist/public/assets/use-skill-origin-Bpi6sqBq.js +0 -1
- package/dist/public/assets/use-skills-DJ009sMa.js +0 -1
- package/dist/repair-mcp-configs-BBS47svB.mjs +0 -2
- package/dist/repair-skills-D7rSfppe.mjs +0 -4
- package/dist/repair-skills-aO5Yt4lm.mjs +0 -1
- package/dist/server-lock-e6dYuoeq.mjs +0 -1
- package/dist/src-COqGK-op.mjs +0 -1
- package/dist/src-Cqh-Fhfh.mjs +0 -2023
- package/dist/src-isAOog5y.mjs +0 -1
- package/dist/src-xQY8yiP4.mjs +0 -20
- package/dist/start-Cnm6c7AK.mjs +0 -1
- package/dist/start-D44mUONb.mjs +0 -12
- /package/dist/public/assets/{asset-dispatch-KsnhYIM1.js → asset-dispatch-CdZ_--jl.js} +0 -0
- /package/dist/public/assets/{badge-BHNK6NBf.js → badge-BG5JKjNK.js} +0 -0
- /package/dist/public/assets/{dist-D9pOpWzq.js → dist-ZfIywMZM.js} +0 -0
- /package/dist/public/assets/{external-link-B0bVg1hn.js → external-link-B4qPZwve.js} +0 -0
- /package/dist/public/assets/{globals--kx1ORbr.js → globals-CiMYEcFP.js} +0 -0
- /package/dist/public/assets/{stex-BUFg5G8g.js → stex-Bh4EH31F.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{$ as e,At as t,Bt as n,Et as r,Gt as i,Ht as a,It as o,Lt as s,Mt as c,Nt as l,Ot as u,Pt as d,Q as f,Vt as p,Wt as m,Y as h,Z as g,_t as ee,at as _,bt as te,dt as ne,et as re,kt as ie,mt as ae,st as oe,tt as se,vt as ce,xt as v,yt as le}from"./dist-
|
|
1
|
+
import{$ as e,At as t,Bt as n,Et as r,Gt as i,Ht as a,It as o,Lt as s,Mt as c,Nt as l,Ot as u,Pt as d,Q as f,Vt as p,Wt as m,Y as h,Z as g,_t as ee,at as _,bt as te,dt as ne,et as re,kt as ie,mt as ae,st as oe,tt as se,vt as ce,xt as v,yt as le}from"./dist-ZfIywMZM.js";var ue=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFKD`):e=>e,y=class{constructor(e,t,n=0,r=e.length,i,a){this.test=a,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer=``,this.bufferPos=0,this.iter=e.iterRange(n,r),this.bufferStart=n,this.normalize=i?e=>i(ue(e)):ue,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return n(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=i(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=p(e);let r=this.normalize(t);if(r.length)for(let e=0,i=n,a=!0;;e++){let n=r.charCodeAt(e),o=this.match(n,i,a,this.bufferPos+this.bufferStart,e==r.length-1);if(o)return this.value=o,this;if(e==r.length-1)break;a&&e<t.length&&t.charCodeAt(e)==n?i++:a=!1}}}match(e,t,n,r,i){let a=null;for(let t=0;t<this.matches.length;){let n=this.matches[t],o=!1;this.query.charCodeAt(n.index)==e&&(n.index==this.query.length-1?a={from:n.from,to:r,precise:i&&n.precise}:(n.index++,o=!0)),o?t++:this.matches.splice(t,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?a={from:t,to:r,precise:n&&i}:this.matches.push({from:t,index:1,precise:n})),a&&this.test&&!this.test(a.from,a.to,this.buffer,this.bufferStart)&&(a=null),a}};typeof Symbol<`u`&&(y.prototype[Symbol.iterator]=function(){return this});var de={from:-1,to:-1,match:/.*/.exec(``),precise:!0},b=`gm`+(/x/.unicode==null?``:`u`),fe=class{constructor(e,t,n,r=0,i=e.length){if(this.text=e,this.to=i,this.curLine=``,this.done=!1,this.value=de,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new me(e,t,n,r,i);this.re=new RegExp(t,b+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.iter=e.iter(),this.curLineStart=e.lineAt(r).from,this.matchPos=S(e,r),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine=``:(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine=``:this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,r=n+t[0].length;if(this.matchPos=S(this.text,r+ +(n==r)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<r||n>this.value.to)&&(!this.test||this.test(n,r,t)))return this.value={from:n,to:r,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}},x=new WeakMap,pe=class e{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(t,n,r){let i=x.get(t);if(!i||i.from>=r||i.to<=n){let i=new e(n,t.sliceString(n,r));return x.set(t,i),i}if(i.from==n&&i.to==r)return i;let{text:a,from:o}=i;return o>n&&(a=t.sliceString(n,o)+a,o=n),i.to<r&&(a+=t.sliceString(i.to,r)),x.set(t,new e(o,a)),new e(n,a.slice(n-o,r-o))}},me=class{constructor(e,t,n,r,i){this.text=e,this.to=i,this.done=!1,this.value=de,this.matchPos=S(e,r),this.re=new RegExp(t,b+(n?.ignoreCase?`i`:``)),this.test=n?.test,this.flat=pe.get(e,r,this.chunkEnd(r+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,precise:!0,match:t},this.matchPos=S(this.text,n+ +(e==n)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=pe.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<`u`&&(fe.prototype[Symbol.iterator]=me.prototype[Symbol.iterator]=function(){return this});function he(e){try{return new RegExp(e,b),!0}catch{return!1}}function S(e,t){if(t>=e.length)return t;let n=e.lineAt(t),r;for(;t<n.to&&(r=n.text.charCodeAt(t-n.from))>=56320&&r<57344;)t++;return t}var ge=e=>{let{state:t}=e,n=String(t.doc.lineAt(e.state.selection.main.head).number),{close:r,result:i}=ce(e,{label:t.phrase(`Go to line`),input:{type:`text`,name:`line`,value:n},focus:!0,submitLabel:t.phrase(`go`)});return i.then(n=>{let i=n&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(n.elements.line.value);if(!i){e.dispatch({effects:r});return}let a=t.doc.lineAt(t.selection.main.head),[,o,s,c,l]=i,d=c?+c.slice(1):0,f=s?+s:a.number;if(s&&l){let e=f/100;o&&(e=e*(o==`-`?-1:1)+a.number/t.doc.lines),f=Math.round(t.doc.lines*e)}else s&&o&&(f=f*(o==`-`?-1:1)+a.number);let p=t.doc.line(Math.max(1,Math.min(t.doc.lines,f))),m=u.cursor(p.from+Math.max(0,Math.min(d,p.length)));e.dispatch({effects:[r,g.scrollIntoView(m.from,{y:`center`})],selection:m})}),!0},_e={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ve=t.define({combine(e){return a(e,_e,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function ye(e){let t=[Te,we];return e&&t.push(ve.of(e)),t}var be=h.mark({class:`cm-selectionMatch`}),xe=h.mark({class:`cm-selectionMatch cm-selectionMatch-main`});function Se(e,t,n,i){return(n==0||e(t.sliceDoc(n-1,n))!=r.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=r.Word)}function Ce(e,t,n,i){return e(t.sliceDoc(n,n+1))==r.Word&&e(t.sliceDoc(i-1,i))==r.Word}var we=e.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(ve),{state:n}=e,r=n.selection;if(r.ranges.length>1)return h.none;let i=r.main,a,o=null;if(i.empty){if(!t.highlightWordAroundCursor)return h.none;let e=n.wordAt(i.head);if(!e)return h.none;o=n.charCategorizer(i.head),a=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e<t.minSelectionLength||e>200)return h.none;if(t.wholeWords){if(a=n.sliceDoc(i.from,i.to),o=n.charCategorizer(i.head),!(Se(o,n,i.from,i.to)&&Ce(o,n,i.from,i.to)))return h.none}else if(a=n.sliceDoc(i.from,i.to),!a)return h.none}let s=[];for(let r of e.visibleRanges){let e=new y(n.doc,a,r.from,r.to);for(;!e.next().done;){let{from:r,to:a}=e.value;if((!o||Se(o,n,r,a))&&(i.empty&&r<=i.from&&a>=i.to?s.push(xe.range(r,a)):(r>=i.to||a<=i.from)&&s.push(be.range(r,a)),s.length>t.maxMatches))return h.none}}return h.set(s)}},{decorations:e=>e.decorations}),Te=g.baseTheme({".cm-selectionMatch":{backgroundColor:`#99ff7780`},".cm-searchMatch .cm-selectionMatch":{backgroundColor:`transparent`}}),Ee=({state:e,dispatch:t})=>{let{selection:n}=e,r=u.create(n.ranges.map(t=>e.wordAt(t.head)||u.cursor(t.head)),n.mainIndex);return r.eq(n)?!1:(t(e.update({selection:r})),!0)};function De(e,t){let{main:n,ranges:r}=e.selection,i=e.wordAt(n.head),a=i&&i.from==n.from&&i.to==n.to;for(let n=!1,i=new y(e.doc,t,r[r.length-1].to);;)if(i.next(),i.done){if(n)return null;i=new y(e.doc,t,0,Math.max(0,r[r.length-1].from-1)),n=!0}else{if(n&&r.some(e=>e.from==i.value.from))continue;if(a){let t=e.wordAt(i.value.from);if(!t||t.from!=i.value.from||t.to!=i.value.to)continue}return i.value}}var Oe=({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some(e=>e.from===e.to))return Ee({state:e,dispatch:t});let r=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some(t=>e.sliceDoc(t.from,t.to)!=r))return!1;let i=De(e,r);return i?(t(e.update({selection:e.selection.addRange(u.range(i.from,i.to),!1),effects:g.scrollIntoView(i.to)})),!0):!1},C=t.define({combine(e){return a(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Xe(e),scrollToMatch:e=>g.scrollIntoView(e)})}});function ke(e){return e?[C.of(e),V]:V}var Ae=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||``,this.valid=!!this.search&&(!this.regexp||he(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(e,t)=>t==`n`?`
|
|
2
2
|
`:t==`r`?`\r`:t==`t`?` `:`\\`)}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Le(this):new Pe(this)}getCursor(e,t=0,n){let r=e.doc?e:ie.create({doc:e});return n??=r.doc.length,this.regexp?T(this,r,t,n):w(this,r,t,n)}},je=class{constructor(e){this.spec=e}};function Me(e,t,n){return(r,i,a,o)=>n&&!n(r,i,a,o)?!1:e(r>=o&&i<=o+a.length?a.slice(r-o,i-o):t.doc.sliceString(r,i),t,r,i)}function w(e,t,n,r){let i;return e.wholeWord&&(i=Ne(t.doc,t.charCategorizer(t.selection.main.head))),e.test&&(i=Me(e.test,t,i)),new y(t.doc,e.unquoted,n,r,e.caseSensitive?void 0:e=>e.toLowerCase(),i)}function Ne(e,t){return(n,i,a,o)=>((o>n||o+a.length<i)&&(o=Math.max(0,n-2),a=e.sliceString(o,Math.min(e.length,i+2))),(t(E(a,n-o))!=r.Word||t(D(a,n-o))!=r.Word)&&(t(D(a,i-o))!=r.Word||t(E(a,i-o))!=r.Word))}var Pe=class extends je{constructor(e){super(e)}nextMatch(e,t,n){let r=w(this.spec,e,n,e.doc.length).nextOverlapping();if(r.done){let n=Math.min(e.doc.length,t+this.spec.unquoted.length);r=w(this.spec,e,0,n).nextOverlapping()}return r.done||r.value.from==t&&r.value.to==n?null:r.value}prevMatchInRange(e,t,n){for(let r=n;;){let n=Math.max(t,r-1e4-this.spec.unquoted.length),i=w(this.spec,e,n,r),a=null;for(;!i.nextOverlapping().done;)a=i.value;if(a)return a;if(n==t)return null;r-=1e4}}prevMatch(e,t,n){let r=this.prevMatchInRange(e,0,t);return r||=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length),r&&(r.from!=t||r.to!=n)?r:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=w(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=w(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}};function Fe(e,t,n){return(r,i,a)=>(!n||n(r,i,a))&&e(a[0],t,r,i)}function T(e,t,n,r){let i;return e.wholeWord&&(i=Ie(t.charCategorizer(t.selection.main.head))),e.test&&(i=Fe(e.test,t,i)),new fe(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:i},n,r)}function E(e,t){return e.slice(m(e,t,!1),t)}function D(e,t){return e.slice(t,m(e,t))}function Ie(e){return(t,n,i)=>!i[0].length||(e(E(i.input,i.index))!=r.Word||e(D(i.input,i.index))!=r.Word)&&(e(D(i.input,i.index+i[0].length))!=r.Word||e(E(i.input,i.index+i[0].length))!=r.Word)}var Le=class extends je{nextMatch(e,t,n){let r=T(this.spec,e,n,e.doc.length).next();return r.done&&(r=T(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,n){for(let r=1;;r++){let i=Math.max(t,n-r*1e4),a=T(this.spec,e,i,n),o=null;for(;!a.next().done;)o=a.value;if(o&&(i==t||o.from>i+10))return o;if(i==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n==`&`)return e.match[0];if(n==`$`)return`$`;for(let t=n.length;t>0;t--){let r=+n.slice(0,t);if(r>0&&r<e.match.length)return e.match[r]+n.slice(t)}return t})}matchAll(e,t){let n=T(this.spec,e,0,e.doc.length),r=[];for(;!n.next().done;){if(r.length>=t)return null;r.push(n.value)}return r}highlight(e,t,n,r){let i=T(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!i.next().done;)r(i.value.from,i.value.to)}},O=o.define(),k=o.define(),A=s.define({create(e){return new j(I(e).create(),null)},update(e,t){for(let n of t.effects)n.is(O)?e=new j(n.value.create(),e.panel):n.is(k)&&(e=new j(e.query,n.value?F:null));return e},provide:e=>le.from(e,e=>e.panel)}),j=class{constructor(e,t){this.query=e,this.panel=t}},Re=h.mark({class:`cm-searchMatch`}),ze=h.mark({class:`cm-searchMatch cm-searchMatch-selected`}),Be=e.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(A))}update(e){let t=e.state.field(A);(t!=e.startState.field(A)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return h.none;let{view:n}=this,r=new d;for(let t=0,i=n.visibleRanges,a=i.length;t<a;t++){let{from:o,to:s}=i[t];for(;t<a-1&&s>i[t+1].from-500;)s=i[++t].to;e.highlight(n.state,o,s,(e,t)=>{let i=n.state.selection.ranges.some(n=>n.from==e&&n.to==t);r.add(e,t,i?ze:Re)})}return r.finish()}},{decorations:e=>e.decorations});function M(e){return t=>{let n=t.state.field(A,!1);return n&&n.query.spec.valid?e(t,n):qe(t)}}var N=M((e,{query:t})=>{let{to:n}=e.state.selection.main,r=t.nextMatch(e.state,n,n);if(!r)return!1;let i=u.single(r.from,r.to),a=e.state.facet(C);return e.dispatch({selection:i,effects:[B(e,r),a.scrollToMatch(i.main,e)],userEvent:`select.search`}),Ke(e),!0}),P=M((e,{query:t})=>{let{state:n}=e,{from:r}=n.selection.main,i=t.prevMatch(n,r,r);if(!i)return!1;let a=u.single(i.from,i.to),o=e.state.facet(C);return e.dispatch({selection:a,effects:[B(e,i),o.scrollToMatch(a.main,e)],userEvent:`select.search`}),Ke(e),!0}),Ve=M((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!n||!n.length?!1:(e.dispatch({selection:u.create(n.map(e=>u.range(e.from,e.to))),userEvent:`select.search.matches`}),!0)}),He=({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:r,to:i}=n.main,a=[],o=0;for(let t=new y(e.doc,e.sliceDoc(r,i));!t.next().done;){if(a.length>1e3)return!1;t.value.from==r&&(o=a.length),a.push(u.range(t.value.from,t.value.to))}return t(e.update({selection:u.create(a,o),userEvent:`select.search.matches`})),!0},Ue=M((e,{query:t})=>{let{state:n}=e,{from:r,to:i}=n.selection.main;if(n.readOnly)return!1;let a=t.nextMatch(n,r,r);if(!a)return!1;let o=a,s=[],c,l,d=[];o.precise?o.from==r&&o.to==i&&(l=n.toText(t.getReplacement(o)),s.push({from:o.from,to:o.to,insert:l}),o=t.nextMatch(n,o.from,o.to),d.push(g.announce.of(n.phrase(`replaced match on line $`,n.doc.lineAt(r).number)+`.`))):o=t.nextMatch(n,o.from,o.to);let f=e.state.changes(s);return o&&(c=u.single(o.from,o.to).map(f),d.push(B(e,o)),d.push(n.facet(C).scrollToMatch(c.main,e))),e.dispatch({changes:f,selection:c,effects:d,userEvent:`input.replace`}),!0}),We=M((e,{query:t})=>{if(e.state.readOnly)return!1;let n=[];for(let r of t.matchAll(e.state,1e9)){let{from:e,to:i,precise:a}=r;a&&n.push({from:e,to:i,insert:t.getReplacement(r)})}if(!n.length)return!1;let r=e.state.phrase(`replaced $ matches`,n.length)+`.`;return e.dispatch({changes:n,effects:g.announce.of(r),userEvent:`input.replace.all`}),!0});function F(e){return e.state.facet(C).createPanel(e)}function I(e,t){let n=e.selection.main,r=n.empty||n.to>n.from+100?``:e.sliceDoc(n.from,n.to);if(t&&!r)return t;let i=e.facet(C);return new Ae({search:t?.literal??i.literal?r:r.replace(/\n/g,`\\n`),caseSensitive:t?.caseSensitive??i.caseSensitive,literal:t?.literal??i.literal,regexp:t?.regexp??i.regexp,wholeWord:t?.wholeWord??i.wholeWord})}function Ge(e){let t=_(e,F);return t&&t.dom.querySelector(`[main-field]`)}function Ke(e){let t=Ge(e);t&&t==e.root.activeElement&&t.select()}var qe=e=>{let t=e.state.field(A,!1);if(t&&t.panel){let n=Ge(e);if(n&&n!=e.root.activeElement){let r=I(e.state,t.query.spec);r.valid&&e.dispatch({effects:O.of(r)}),n.focus(),n.select()}}else e.dispatch({effects:[k.of(!0),t?O.of(I(e.state,t.query.spec)):o.appendConfig.of(V)]});return!0},Je=e=>{let t=e.state.field(A,!1);if(!t||!t.panel)return!1;let n=_(e,F);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:k.of(!1)}),!0},Ye=[{key:`Mod-f`,run:qe,scope:`editor search-panel`},{key:`F3`,run:N,shift:P,scope:`editor search-panel`,preventDefault:!0},{key:`Mod-g`,run:N,shift:P,scope:`editor search-panel`,preventDefault:!0},{key:`Escape`,run:Je,scope:`editor search-panel`},{key:`Mod-Shift-l`,run:He},{key:`Mod-Alt-g`,run:ge},{key:`Mod-d`,run:Oe,preventDefault:!0}],Xe=class{constructor(e){this.view=e;let t=this.query=e.state.field(A).query.spec;this.commit=this.commit.bind(this),this.searchField=v(`input`,{value:t.search,placeholder:L(e,`Find`),"aria-label":L(e,`Find`),class:`cm-textfield`,name:`search`,form:``,"main-field":`true`,onchange:this.commit,onkeyup:this.commit}),this.replaceField=v(`input`,{value:t.replace,placeholder:L(e,`Replace`),"aria-label":L(e,`Replace`),class:`cm-textfield`,name:`replace`,form:``,onchange:this.commit,onkeyup:this.commit}),this.caseField=v(`input`,{type:`checkbox`,name:`case`,form:``,checked:t.caseSensitive,onchange:this.commit}),this.reField=v(`input`,{type:`checkbox`,name:`re`,form:``,checked:t.regexp,onchange:this.commit}),this.wordField=v(`input`,{type:`checkbox`,name:`word`,form:``,checked:t.wholeWord,onchange:this.commit});function n(e,t,n){return v(`button`,{class:`cm-button`,name:e,onclick:t,type:`button`},n)}this.dom=v(`div`,{onkeydown:e=>this.keydown(e),class:`cm-search`},[this.searchField,n(`next`,()=>N(e),[L(e,`next`)]),n(`prev`,()=>P(e),[L(e,`previous`)]),n(`select`,()=>Ve(e),[L(e,`all`)]),v(`label`,null,[this.caseField,L(e,`match case`)]),v(`label`,null,[this.reField,L(e,`regexp`)]),v(`label`,null,[this.wordField,L(e,`by word`)]),...e.state.readOnly?[]:[v(`br`),this.replaceField,n(`replace`,()=>Ue(e),[L(e,`replace`)]),n(`replaceAll`,()=>We(e),[L(e,`replace all`)])],v(`button`,{name:`close`,onclick:()=>Je(e),"aria-label":L(e,`close`),type:`button`},[`×`])])}commit(){let e=new Ae({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:O.of(e)}))}keydown(e){ee(this.view,e,`search-panel`)?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?P:N)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),Ue(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(O)&&!e.value.eq(this.query)&&this.setQuery(e.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(C).top}};function L(e,t){return e.state.phrase(t)}var R=30,z=/[\s\.,:;?!]/;function B(e,{from:t,to:n}){let r=e.state.doc.lineAt(t),i=e.state.doc.lineAt(n).to,a=Math.max(r.from,t-R),o=Math.min(i,n+R),s=e.state.sliceDoc(a,o);if(a!=r.from){for(let e=0;e<R;e++)if(!z.test(s[e+1])&&z.test(s[e])){s=s.slice(e);break}}if(o!=i){for(let e=s.length-1;e>s.length-R;e--)if(!z.test(s[e-1])&&z.test(s[e])){s=s.slice(0,e);break}}return g.announce.of(`${e.state.phrase(`current match`)}. ${s} ${e.state.phrase(`on line`)} ${r.number}.`)}var Ze=g.baseTheme({".cm-panel.cm-search":{padding:`2px 6px 4px`,position:`relative`,"& [name=close]":{position:`absolute`,top:`0`,right:`4px`,backgroundColor:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0},"& input, & button, & label":{margin:`.2em .6em .2em 0`},"& input[type=checkbox]":{marginRight:`.2em`},"& label":{fontSize:`80%`,whiteSpace:`pre`}},"&light .cm-searchMatch":{backgroundColor:`#ffff0054`},"&dark .cm-searchMatch":{backgroundColor:`#00ffff8a`},"&light .cm-searchMatch-selected":{backgroundColor:`#ff6a0054`},"&dark .cm-searchMatch-selected":{backgroundColor:`#ff00ff8a`}}),V=[A,c.low(Be),Ze],Qe=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},H=class e{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(t,n,r){let i=r.facet(q).markerFilter;i&&(t=i(t,r));let a=t.slice().sort((e,t)=>e.from-t.from||e.to-t.to),o=new d,s=[],c=0,l=r.doc.iter(),u=0,f=r.doc.length;for(let e=0;;){let t=e==a.length?null:a[e];if(!t&&!s.length)break;let n,r;if(s.length)n=c,r=s.reduce((e,t)=>Math.min(e,t.to),t&&t.from>n?t.from:1e8);else{if(n=t.from,n>f)break;r=t.to,s.push(t),e++}for(;e<a.length;){let t=a[e];if(t.from==n&&(t.to>t.from||t.to==n))s.push(t),e++,r=Math.min(t.to,r);else{r=Math.min(t.from,r);break}}r=Math.min(r,f);let i=!1;if(s.some(e=>e.from==n&&(e.to==r||r==f))&&(i=n==r,!i&&r-n<10)){let e=n-(u+l.value.length);e>0&&(l.next(e),u=n);for(let e=n;;){if(e>=r){i=!0;break}if(!l.lineBreak&&u+l.value.length>e)break;e=u+l.value.length,u+=l.value.length,l.next()}}let d=bt(s);if(i)o.add(n,n,h.widget({widget:new gt(d),diagnostics:s.slice()}));else{let e=s.reduce((e,t)=>t.markClass?e+` `+t.markClass:e,``);o.add(n,r,h.mark({class:`cm-lintRange cm-lintRange-`+d+e,diagnostics:s.slice(),inclusiveEnd:s.some(e=>e.to>r)}))}if(c=r,c==f)break;for(let e=0;e<s.length;e++)s[e].to<=c&&s.splice(e--,1)}let p=o.finish();return new e(p,n,U(p))}};function U(e,t=null,n=0){let r=null;return e.between(n,1e9,(e,n,{spec:i})=>{if(!(t&&i.diagnostics.indexOf(t)<0))if(!r)r=new Qe(e,n,t||i.diagnostics[0]);else if(i.diagnostics.indexOf(r.diagnostic)<0)return!1;else r=new Qe(r.from,n,r.diagnostic)}),r}function $e(e,t){let n=t.pos,r=t.end||n,i=e.state.facet(q).hideOn(e,n,r);if(i!=null)return i;let a=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(e=>e.is(W))||e.changes.touchesRange(a.from,Math.max(a.to,r)))}function et(e,t){return e.field(K,!1)?t:t.concat(o.appendConfig.of(kt))}function tt(e,t){return{effects:et(e,[W.of(t)])}}var W=o.define(),G=o.define(),nt=o.define(),K=s.define({create(){return new H(h.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let n=e.diagnostics.map(t.changes),r=null,i=e.panel;if(e.selected){let i=t.changes.mapPos(e.selected.from,1);r=U(n,e.selected.diagnostic,i)||U(n,null,i)}!n.size&&i&&t.state.facet(q).autoPanel&&(i=null),e=new H(n,i,r)}for(let n of t.effects)if(n.is(W)){let r=t.state.facet(q).autoPanel?n.value.length?J.open:null:e.panel;e=H.init(n.value,r,t.state)}else n.is(G)?e=new H(e.diagnostics,n.value?J.open:null,e.selected):n.is(nt)&&(e=new H(e.diagnostics,e.panel,n.value));return e},provide:e=>[le.from(e,e=>e.panel),g.decorations.from(e,e=>e.diagnostics)]}),rt=h.mark({class:`cm-lintRange cm-lintRange-active`});function it(e,t,n){let{diagnostics:r}=e.state.field(K),i,a=-1,o=-1;r.between(t-+(n<0),t+ +(n>0),(e,r,{spec:s})=>{if(t>=e&&t<=r&&(e==r||(t>e||n>0)&&(t<r||n<0)))return i=s.diagnostics,a=e,o=r,!1});let s=e.state.facet(q).tooltipFilter;return i&&s&&(i=s(i,e.state)),i?{pos:a,end:o,above:!0,create(){return{dom:at(e,i)}}}:null}function at(e,t){return v(`ul`,{class:`cm-tooltip-lint`},t.map(t=>ht(e,t,!1)))}var ot=e=>{let t=e.state.field(K,!1);(!t||!t.panel)&&e.dispatch({effects:et(e.state,[G.of(!0)])});let n=_(e,J.open);return n&&n.dom.querySelector(`.cm-panel-lint ul`).focus(),!0},st=e=>{let t=e.state.field(K,!1);return!t||!t.panel?!1:(e.dispatch({effects:G.of(!1)}),!0)},ct=[{key:`Mod-Shift-m`,run:ot,preventDefault:!0},{key:`F8`,run:e=>{let t=e.state.field(K,!1);if(!t)return!1;let n=e.state.selection.main,r=U(t.diagnostics,null,n.to+1);return!r&&(r=U(t.diagnostics,null,0),!r||r.from==n.from&&r.to==n.to)?!1:(e.dispatch({selection:{anchor:r.from,head:r.to},scrollIntoView:!0}),se(e,r.from,1,{tooltip:Ot,until:e=>e.docChanged||e.newSelection.main.head<r.from||e.newSelection.main.head>r.to}),!0)}}],lt=e.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(q);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){clearTimeout(this.timeout);let e=Date.now();if(e<this.lintTime-10)this.timeout=setTimeout(this.run,this.lintTime-e);else{this.set=!1;let{state:e}=this.view,{sources:t}=e.facet(q);t.length&&ut(t.map(e=>Promise.resolve(e(this.view))),t=>{this.view.state.doc==e.doc&&this.view.dispatch(tt(this.view.state,t.reduce((e,t)=>e.concat(t))))},e=>{ae(this.view.state,e)})}}update(e){let t=e.state.facet(q);(e.docChanged||t!=e.startState.facet(q)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}});function ut(e,t,n){let r=[],i=-1;for(let a of e)a.then(n=>{r.push(n),clearTimeout(i),r.length==e.length?t(r):i=setTimeout(()=>t(r),200)},n)}var q=t.define({combine(e){return{sources:e.map(e=>e.source).filter(e=>e!=null),...a(e.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:dt,tooltipFilter:dt,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,r,i)=>e(n,r,i)||t(n,r,i):e:t,autoPanel:(e,t)=>e||t})}}});function dt(e,t){return e?t?(n,r)=>t(e(n,r),r):e:t}function ft(e,t={}){return[q.of({source:e,config:t}),lt,kt]}function pt(e){let t=e.plugin(lt);t&&t.force()}function mt(e){let t=[];if(e)actions:for(let{name:n}of e){for(let e=0;e<n.length;e++){let r=n[e];if(/[a-zA-Z]/.test(r)&&!t.some(e=>e.toLowerCase()==r.toLowerCase())){t.push(r);continue actions}}t.push(``)}return t}function ht(e,t,n){let r=n?mt(t.actions):[];return v(`li`,{class:`cm-diagnostic cm-diagnostic-`+t.severity},v(`span`,{class:`cm-diagnosticText`},t.renderMessage?t.renderMessage(e):t.message),t.actions?.map((n,i)=>{let a=!1,o=r=>{if(r.preventDefault(),a)return;a=!0;let i=U(e.state.field(K).diagnostics,t);i&&n.apply(e,i.from,i.to)},{name:s}=n,c=r[i]?s.indexOf(r[i]):-1,l=c<0?s:[s.slice(0,c),v(`u`,s.slice(c,c+1)),s.slice(c+1)];return v(`button`,{type:`button`,class:`cm-diagnosticAction`+(n.markClass?` `+n.markClass:``),onclick:o,onmousedown:o,"aria-label":` Action: ${s}${c<0?``:` (access key "${r[i]})"`}.`},l)}),t.source&&v(`div`,{class:`cm-diagnosticSource`},t.source))}var gt=class extends re{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return v(`span`,{class:`cm-lintPoint cm-lintPoint-`+this.sev})}},_t=class{constructor(e,t){this.diagnostic=t,this.id=`item_`+Math.floor(Math.random()*4294967295).toString(16),this.dom=ht(e,t,!0),this.dom.id=this.id,this.dom.setAttribute(`role`,`option`)}},J=class e{constructor(e){this.view=e,this.items=[],this.list=v(`ul`,{tabIndex:0,role:`listbox`,"aria-label":this.view.state.phrase(`Diagnostics`),onkeydown:t=>{if(!(t.ctrlKey||t.altKey||t.metaKey)){if(t.keyCode==27)st(this.view),this.view.focus();else if(t.keyCode==38||t.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(t.keyCode==40||t.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(t.keyCode==36)this.moveSelection(0);else if(t.keyCode==35)this.moveSelection(this.items.length-1);else if(t.keyCode==13)this.view.focus();else if(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:n}=this.items[this.selectedIndex],r=mt(n.actions);for(let i=0;i<r.length;i++)if(r[i].toUpperCase().charCodeAt(0)==t.keyCode){let t=U(this.view.state.field(K).diagnostics,n);t&&n.actions[i].apply(e,t.from,t.to)}}else return;t.preventDefault()}},onclick:e=>{for(let t=0;t<this.items.length;t++)this.items[t].dom.contains(e.target)&&this.moveSelection(t)}}),this.dom=v(`div`,{class:`cm-panel-lint`},this.list,v(`button`,{type:`button`,name:`close`,"aria-label":this.view.state.phrase(`close`),onclick:()=>st(this.view)},`×`)),this.update()}get selectedIndex(){let e=this.view.state.field(K).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(K),n=0,r=!1,i=null,a=new Set;for(e.between(0,this.view.state.doc.length,(e,o,{spec:s})=>{for(let e of s.diagnostics){if(a.has(e))continue;a.add(e);let o=-1,s;for(let t=n;t<this.items.length;t++)if(this.items[t].diagnostic==e){o=t;break}o<0?(s=new _t(this.view,e),this.items.splice(n,0,s),r=!0):(s=this.items[o],o>n&&(this.items.splice(n,o-n),r=!0)),t&&s.diagnostic==t.diagnostic?s.dom.hasAttribute(`aria-selected`)||(s.dom.setAttribute(`aria-selected`,`true`),i=s):s.dom.hasAttribute(`aria-selected`)&&s.dom.removeAttribute(`aria-selected`),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)r=!0,this.items.pop();this.items.length==0&&(this.items.push(new _t(this.view,{from:-1,to:-1,severity:`info`,message:this.view.state.phrase(`No diagnostics`)})),r=!0),i?(this.list.setAttribute(`aria-activedescendant`,i.id),this.view.requestMeasure({key:this,read:()=>({sel:i.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.top<t.top?this.list.scrollTop-=(t.top-e.top)/n:e.bottom>t.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute(`aria-activedescendant`),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=U(this.view.state.field(K).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:nt.of(t)})}static open(t){return new e(t)}};function Y(e,t=`viewBox="0 0 40 40"`){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function X(e){return Y(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,`width="6" height="3"`)}var vt=g.baseTheme({".cm-diagnostic":{padding:`3px 6px 3px 8px`,marginLeft:`-1px`,display:`block`,whiteSpace:`pre-wrap`},".cm-diagnostic-error":{borderLeft:`5px solid #d11`},".cm-diagnostic-warning":{borderLeft:`5px solid orange`},".cm-diagnostic-info":{borderLeft:`5px solid #999`},".cm-diagnostic-hint":{borderLeft:`5px solid #66d`},".cm-diagnosticAction":{font:`inherit`,border:`none`,padding:`2px 4px`,backgroundColor:`#444`,color:`white`,borderRadius:`3px`,marginLeft:`8px`,cursor:`pointer`},".cm-diagnosticSource":{fontSize:`70%`,opacity:.7},".cm-lintRange":{backgroundPosition:`left bottom`,backgroundRepeat:`repeat-x`,paddingBottom:`0.7px`},".cm-lintRange-error":{backgroundImage:X(`#f11`)},".cm-lintRange-warning":{backgroundImage:X(`orange`)},".cm-lintRange-info":{backgroundImage:X(`#999`)},".cm-lintRange-hint":{backgroundImage:X(`#66d`)},".cm-lintRange-active":{backgroundColor:`#ffdd9980`},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:`relative`,"&:after":{content:`""`,position:`absolute`,bottom:0,left:`-2px`,borderLeft:`3px solid transparent`,borderRight:`3px solid transparent`,borderBottom:`4px solid #d11`}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:`orange`}},".cm-lintPoint-info":{"&:after":{borderBottomColor:`#999`}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:`#66d`}},".cm-panel.cm-panel-lint":{position:`relative`,"& ul":{maxHeight:`100px`,overflowY:`auto`,"& [aria-selected]":{backgroundColor:`#ddd`,"& u":{textDecoration:`underline`}},"&:focus [aria-selected]":{background_fallback:`#bdf`,backgroundColor:`Highlight`,color_fallback:`white`,color:`HighlightText`},"& u":{textDecoration:`none`},padding:0,margin:0},"& [name=close]":{position:`absolute`,top:`0`,right:`2px`,background:`inherit`,border:`none`,font:`inherit`,padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:`#86714a80`},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:`#2e343e`}}});function yt(e){return e==`error`?4:e==`warning`?3:e==`info`?2:1}function bt(e){let t=`hint`,n=1;for(let r of e){let e=yt(r.severity);e>n&&(n=e,t=r.severity)}return t}var xt=class extends f{constructor(e){super(),this.diagnostics=e,this.severity=bt(e)}toDOM(e){let t=document.createElement(`div`);t.className=`cm-lint-marker cm-lint-marker-`+this.severity;let n=this.diagnostics,r=e.state.facet($).tooltipFilter;return r&&(n=r(n,e.state)),n.length&&(t.onmouseover=()=>Ct(e,t,n)),t}};function St(e,t){let n=r=>{let i=t.getBoundingClientRect();if(!(r.clientX>i.left-10&&r.clientX<i.right+10&&r.clientY>i.top-10&&r.clientY<i.bottom+10)){for(let e=r.target;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains(`cm-tooltip-lint`))return;window.removeEventListener(`mousemove`,n),e.state.field(Et)&&e.dispatch({effects:Q.of(null)})}};window.addEventListener(`mousemove`,n)}function Ct(e,t,n){function r(){let r=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(r.from)&&e.dispatch({effects:Q.of({pos:r.from,above:!1,clip:!1,create(){return{dom:at(e,n),getCoords:()=>t.getBoundingClientRect()}}})}),t.onmouseout=t.onmousemove=null,St(e,t)}let{hoverTime:i}=e.state.facet($),a=setTimeout(r,i);t.onmouseout=()=>{clearTimeout(a),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(a),a=setTimeout(r,i)}}function wt(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let r=[];for(let e in n)r.push(new xt(n[e]).range(+e));return l.of(r,!0)}var Tt=oe({class:`cm-gutter-lint`,markers:e=>e.state.field(Z),widgetMarker:(e,t,n)=>{let r=[];return e.state.field(Z).between(n.from,n.to,(e,t,i)=>{e>n.from&&e<n.to&&r.push(...i.diagnostics)}),r.length?new xt(r):null}}),Z=s.define({create(){return l.empty},update(e,t){e=e.map(t.changes);let n=t.state.facet($).markerFilter;for(let r of t.effects)if(r.is(W)){let i=r.value;n&&(i=n(i||[],t.state)),e=wt(t.state.doc,i.slice(0))}return e}}),Q=o.define(),Et=s.define({create(){return null},update(e,t){return e&&t.docChanged&&(e=$e(t,e)?null:{...e,pos:t.changes.mapPos(e.pos)}),t.effects.reduce((e,t)=>t.is(Q)?t.value:e,e)},provide:e=>te.from(e)}),Dt=g.baseTheme({".cm-gutter-lint":{width:`1.4em`,"& .cm-gutterElement":{padding:`.2em`}},".cm-lint-marker":{width:`1em`,height:`1em`},".cm-lint-marker-info":{content:Y(`<path fill="#aaf" stroke="#77e" stroke-width="6" stroke-linejoin="round" d="M5 5L35 5L35 35L5 35Z"/>`)},".cm-lint-marker-warning":{content:Y(`<path fill="#fe8" stroke="#fd7" stroke-width="6" stroke-linejoin="round" d="M20 6L37 35L3 35Z"/>`)},".cm-lint-marker-error":{content:Y(`<circle cx="20" cy="20" r="15" fill="#f87" stroke="#f43" stroke-width="6"/>`)}}),Ot=ne(it,{hideOn:$e}),kt=[K,g.decorations.compute([K],e=>{let{selected:t,panel:n}=e.field(K);return!t||!n||t.from==t.to?h.none:h.set([rt.range(t.from,t.to)])}),Ot,vt],$=t.define({combine(e){return a(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})}});function At(e={}){return[$.of(e),Z,Tt,Dt,Et]}export{ye as a,ft as i,At as n,ke as o,ct as r,Ye as s,pt as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CYidjpOJ.js";import{E as t,R as n,d as r,o as i,r as a,x as o,y as s,z as c}from"./dist-
|
|
1
|
+
import{r as e}from"./chunk-CYidjpOJ.js";import{E as t,R as n,d as r,o as i,r as a,x as o,y as s,z as c}from"./dist-ZfIywMZM.js";import{r as l}from"./dist-BLe6Laue.js";var u=n({String:c.string,Number:c.number,"True False":c.bool,PropertyName:c.propertyName,Null:c.null,", :":c.separator,"[ ]":c.squareBracket,"{ }":c.brace}),d=l.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:`#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O`,goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:`⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array`,maxTerm:25,nodeProps:[[`isolate`,-2,6,11,``],[`openedBy`,7,`{`,14,`[`],[`closedBy`,8,`}`,15,`]`]],propSources:[u],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),f=e({json:()=>m,jsonLanguage:()=>p}),p=a.define({name:`json`,parser:d.configure({props:[t.add({Object:r({except:/^\s*\}/}),Array:r({except:/^\s*\]/})}),o.add({"Object Array":s})]}),languageData:{closeBrackets:{brackets:[`[`,`{`,`"`]},indentOnInput:/^\s*[\}\]]$/}});function m(){return new i(p)}export{m as n,f as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CYidjpOJ.js";import{E as t,F as n,H as r,I as i,J as a,K as o,Mt as s,Ot as c,R as l,S as u,U as d,Ut as f,W as p,Z as m,a as h,ft as g,i as ee,j as te,k as ne,kt as re,o as ie,p as ae,q as _,s as oe,x as se,z as v}from"./dist-D9pOpWzq.js";import{n as ce,r as le}from"./dist-9jLm2WMy.js";import{t as ue}from"./dist-BpbQP0nJ.js";var de=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,i,a,o,s){this.type=e,this.value=t,this.from=n,this.hash=i,this.end=a,this.children=o,this.positions=s,this.hashProp=[[r.contextHash,i]]}addChild(e,t){e.prop(r.contextHash)!=this.hash&&(e=new _(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new _(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new _(p.none,e,t,n,this.hashProp)})}},y;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(y||={});var fe=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},pe=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return S(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function b(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==y.OrderedList?E:T)(n,t,!1);return r>0&&(e.type!=y.BulletList||w(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var me={[y.Blockquote](e,t,n){return n.next==62?(n.markers.push(L(y.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(x(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[y.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[y.OrderedList]:b,[y.BulletList]:b,[y.Document](){return!0}};function x(e){return e==32||e==9||e==10||e==13}function S(e,t=0){for(;t<e.length&&x(e.charCodeAt(t));)t++;return t}function he(e,t,n){for(;t>n&&x(e.charCodeAt(t-1));)t--;return t}function C(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function ge(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function w(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!x(n))return-1}return n&&e.next==45&&ye(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(Ee.SetextHeading)>-1||r<3?-1:1}function _e(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function T(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||x(e.text.charCodeAt(e.pos+1)))&&(!n||_e(t,y.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function E(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!x(e.text.charCodeAt(r+1))||n&&!_e(t,y.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function ve(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function ye(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&x(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var D=/^[ \t]*$/,be=/-->/,xe=/\?>/,O=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,be],[/^\s*<\?/,xe],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,D],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,D]];function Se(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=O.length-+!!n;e<t;e++)if(O[e][0].test(r))return e;return-1}function Ce(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function k(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==y.CodeText?e[r].to=n:e.push(L(y.CodeText,t,n))}var A={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(k(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){k(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==y.CodeText?k(o,e.from,e.to):o.push(e);s=[]}k(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&k(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=y.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(y.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=C(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=he(t.text,t.text.length,o),c=[L(y.CodeMark,r,r+a)];o<s&&c.push(L(y.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&k(c,e.lineStart-1,e.lineStart),c.push(L(y.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(k(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(k(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(y.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=ge(t);return n<0?!1:(e.startContext(y.Blockquote,t.pos),e.addNode(y.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(w(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(y.HorizontalRule,n),!0},BulletList(e,t){let n=T(t,e,!1);if(n<0)return!1;e.block.type!=y.BulletList&&e.startContext(y.BulletList,t.basePos,t.next);let r=Ce(t,t.pos+1);return e.startContext(y.ListItem,t.basePos,r-t.baseIndent),e.addNode(y.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=E(t,e,!1);if(n<0)return!1;e.block.type!=y.OrderedList&&e.startContext(y.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=Ce(t,t.pos+n);return e.startContext(y.ListItem,t.basePos,r-t.baseIndent),e.addNode(y.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=ve(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=he(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!x(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(y.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(y.HeaderMark,o-r,a-r);let c=s.finish(y.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=Se(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=O[n][1],a=[],o=i!=D;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==be?y.CommentBlock:i==xe?y.ProcessingInstructionBlock:y.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},we=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
|
|
1
|
+
import{r as e}from"./chunk-CYidjpOJ.js";import{E as t,F as n,H as r,I as i,J as a,K as o,Mt as s,Ot as c,R as l,S as u,U as d,Ut as f,W as p,Z as m,a as h,ft as g,i as ee,j as te,k as ne,kt as re,o as ie,p as ae,q as _,s as oe,x as se,z as v}from"./dist-ZfIywMZM.js";import{n as ce,r as le}from"./dist-CuMGVsog.js";import{t as ue}from"./dist-8oXszleg.js";var de=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,i,a,o,s){this.type=e,this.value=t,this.from=n,this.hash=i,this.end=a,this.children=o,this.positions=s,this.hashProp=[[r.contextHash,i]]}addChild(e,t){e.prop(r.contextHash)!=this.hash&&(e=new _(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new _(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new _(p.none,e,t,n,this.hashProp)})}},y;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(y||={});var fe=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},pe=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return S(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function b(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==y.OrderedList?E:T)(n,t,!1);return r>0&&(e.type!=y.BulletList||w(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var me={[y.Blockquote](e,t,n){return n.next==62?(n.markers.push(L(y.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(x(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[y.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[y.OrderedList]:b,[y.BulletList]:b,[y.Document](){return!0}};function x(e){return e==32||e==9||e==10||e==13}function S(e,t=0){for(;t<e.length&&x(e.charCodeAt(t));)t++;return t}function he(e,t,n){for(;t>n&&x(e.charCodeAt(t-1));)t--;return t}function C(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function ge(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function w(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!x(n))return-1}return n&&e.next==45&&ye(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(Ee.SetextHeading)>-1||r<3?-1:1}function _e(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function T(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||x(e.text.charCodeAt(e.pos+1)))&&(!n||_e(t,y.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function E(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!x(e.text.charCodeAt(r+1))||n&&!_e(t,y.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function ve(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function ye(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&x(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var D=/^[ \t]*$/,be=/-->/,xe=/\?>/,O=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,be],[/^\s*<\?/,xe],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,D],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,D]];function Se(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=O.length-+!!n;e<t;e++)if(O[e][0].test(r))return e;return-1}function Ce(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function k(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==y.CodeText?e[r].to=n:e.push(L(y.CodeText,t,n))}var A={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(k(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){k(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==y.CodeText?k(o,e.from,e.to):o.push(e);s=[]}k(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&k(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=y.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(y.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=C(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=he(t.text,t.text.length,o),c=[L(y.CodeMark,r,r+a)];o<s&&c.push(L(y.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&k(c,e.lineStart-1,e.lineStart),c.push(L(y.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(k(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(k(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(y.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=ge(t);return n<0?!1:(e.startContext(y.Blockquote,t.pos),e.addNode(y.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(w(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(y.HorizontalRule,n),!0},BulletList(e,t){let n=T(t,e,!1);if(n<0)return!1;e.block.type!=y.BulletList&&e.startContext(y.BulletList,t.basePos,t.next);let r=Ce(t,t.pos+1);return e.startContext(y.ListItem,t.basePos,r-t.baseIndent),e.addNode(y.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=E(t,e,!1);if(n<0)return!1;e.block.type!=y.OrderedList&&e.startContext(y.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=Ce(t,t.pos+n);return e.startContext(y.ListItem,t.basePos,r-t.baseIndent),e.addNode(y.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=ve(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=he(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!x(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(y.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(y.HeaderMark,o-r,a-r);let c=s.finish(y.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=Se(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=O[n][1],a=[],o=i!=D;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==be?y.CommentBlock:i==xe?y.ProcessingInstructionBlock:y.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},we=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
|
|
2
2
|
`+t.scrub(),i=this.advance(r);return i>-1&&i<r.length?this.complete(e,n,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&S(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,L(y.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(Ve(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(L(y.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(ze(e,S(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=S(e,this.pos),n=0;if(t>this.pos){let r=Be(e,t,this.start);if(r){let t=j(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=j(e,this.pos),n>0&&n<e.length?n:-1}else return j(e,this.pos)}};function j(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!x(n))return-1}return t}var Te=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:ye(t),i=t.next;if(r<0)return!1;let a=L(y.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,L(i==61?y.SetextHeading1:y.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},Ee={LinkReference(e,t){return t.content.charCodeAt(0)==91?new we(t):null},SetextHeading(){return new Te}},De=[(e,t)=>ve(t)>=0,(e,t)=>C(t)>=0,(e,t)=>ge(t)>=0,(e,t)=>T(t,e,!0)>=0,(e,t)=>E(t,e,!0)>=0,(e,t)=>w(t,e,!0)>=0,(e,t)=>Se(t,e,!0)>=0],Oe={text:``,end:0},ke=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new pe,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=de.create(y.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Ue(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new fe(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
|
|
3
3
|
`+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=We(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=Oe;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+y[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
|
|
4
4
|
`?``:t;else{let e=t.indexOf(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./chunk-CYidjpOJ.js";import{E as t,R as n,m as r,o as i,r as a,x as o,y as s,z as c}from"./dist-D9pOpWzq.js";import{n as l,r as ee,t as te}from"./dist-DAvyu-Pu.js";var u=63,d=64,f=1,p=2,m=3,h=4,g=5,_=6,v=7,y=65,b=66,ne=8,x=9,S=10,C=11,w=12,T=13,E=19,D=20,O=29,re=33,ie=34,ae=47,oe=0,k=1,A=2,j=3,M=4,N=class{constructor(e,t,n){this.parent=e,this.depth=t,this.type=n,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+n}};N.top=new N(null,-1,oe);function P(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let t=e.peek(r);if(I(t)||t==-1)return n}}function F(e){return e==32||e==9}function I(e){return e==10||e==13}function L(e){return F(e)||I(e)}function R(e){return e<0||L(e)}var z=new te({start:N.top,reduce(e,t){return e.type==j&&(t==D||t==ie)?e.parent:e},shift(e,t,n,r){if(t==m)return new N(e,P(r,r.pos),k);if(t==y||t==g)return new N(e,P(r,r.pos),A);if(t==u)return e.parent;if(t==E||t==re)return new N(e,0,j);if(t==T&&e.type==M)return e.parent;if(t==ae){let t=/[1-9]/.exec(r.read(r.pos,n.pos));if(t)return new N(e,e.depth+ +t[0],M)}return e},hash(e){return e.hash}});function B(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&R(e.peek(n+3))}var V=new l((e,t)=>{if(e.next==-1&&t.canShift(d))return e.acceptToken(d);let n=e.peek(-1);if((I(n)||n<0)&&t.context.type!=j){if(B(e,45))if(t.canShift(u))e.acceptToken(u);else return e.acceptToken(f,3);if(B(e,46))if(t.canShift(u))e.acceptToken(u);else return e.acceptToken(p,3);let n=0;for(;e.next==32;)n++,e.advance();(n<t.context.depth||n==t.context.depth&&t.context.type==k&&(e.next!=45||!R(e.peek(1))))&&e.next!=-1&&!I(e.next)&&e.next!=35&&e.acceptToken(u,-n)}},{contextual:!0}),H=new l((e,t)=>{if(t.context.type==j){e.next==63&&(e.advance(),R(e.next)&&e.acceptToken(v));return}if(e.next==45)e.advance(),R(e.next)&&e.acceptToken(t.context.type==k&&t.context.depth==P(e,e.pos-1)?h:m);else if(e.next==63)e.advance(),R(e.next)&&e.acceptToken(t.context.type==A&&t.context.depth==P(e,e.pos-1)?_:g);else{let n=e.pos;for(;;)if(F(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)K(e);else if(e.next==38)q(e);else if(e.next==42){q(e);break}else if(e.next==39||e.next==34){if(J(e,!0))break;return}else if(e.next==91||e.next==123){if(!se(e))return;break}else{Z(e,!0,!1,0);break}for(;F(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(O))return;R(e.peek(1))&&e.acceptTokenTo(t.context.type==A&&t.context.depth==P(e,n)?b:y,n)}}},{contextual:!0});function U(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function W(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function G(e,t){return e.next==37?(e.advance(),W(e.next)&&e.advance(),W(e.next)&&e.advance(),!0):U(e.next)||t&&e.next==44?(e.advance(),!0):!1}function K(e){if(e.advance(),e.next==60){for(e.advance();;)if(!G(e,!0)){e.next==62&&e.advance();break}}else for(;G(e,!1););}function q(e){for(e.advance();!R(e.next)&&Y(e.next)!=`f`;)e.advance()}function J(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let a=e.next;if(a<0)break;if(e.advance(),a==n)if(a==39)if(e.next==39)e.advance();else break;else break;else if(a==92&&n==34)e.next>=0&&e.advance();else if(I(a)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function se(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!J(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else if(e.next<0||e.pos>n||I(e.next))return!1;else e.advance()}var ce=`iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif`;function Y(e){return e<33?`u`:e>125?`s`:ce[e-33]}function X(e,t){let n=Y(e);return n!=`u`&&!(t&&n==`f`)}function Z(e,t,n,r){if(Y(e.next)==`s`||(e.next==63||e.next==58||e.next==45)&&X(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let a=e.next,o=0,s=r+1;for(;L(a);){if(I(a)){if(t)return!1;s=0}else s++;a=e.peek(++o)}if(!(a>=0&&(a==58?X(e.peek(o+1),n):a==35?e.peek(o-1)!=32:X(a,n)))||!n&&s<=r||s==0&&!n&&(B(e,45,o)||B(e,46,o)))break;if(t&&Y(a)==`f`)return!1;for(let t=o;t>=0;t--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}var le=new l((e,t)=>{if(e.next==33)K(e),e.acceptToken(w);else if(e.next==38||e.next==42){let t=e.next==38?S:C;q(e),e.acceptToken(t)}else e.next==39||e.next==34?(J(e,!1),e.acceptToken(x)):Z(e,!1,t.context.type==j,t.context.depth)&&e.acceptToken(ne)}),ue=new l((e,t)=>{let n=t.context.type==M?t.context.depth:-1,r=e.pos;scan:for(;;){let i=0,a=e.next;for(;a==32;)a=e.peek(++i);if(!i&&(B(e,45,i)||B(e,46,i))||!I(a)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break scan;let t=I(e.next);if(e.advance(),t)continue scan;r=e.pos}}e.acceptTokenTo(T,r)}),de=n({DirectiveName:c.keyword,DirectiveContent:c.attributeValue,"DirectiveEnd DocEnd":c.meta,QuotedLiteral:c.string,BlockLiteralHeader:c.special(c.string),BlockLiteralContent:c.content,Literal:c.content,"Key/Literal Key/QuotedLiteral":c.definition(c.propertyName),"Anchor Alias":c.labelName,Tag:c.typeName,Comment:c.lineComment,": , -":c.separator,"?":c.punctuation,"[ ]":c.squareBracket,"{ }":c.brace}),fe=ee.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:`⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document`,maxTerm:74,context:z,nodeProps:[[`isolate`,-3,8,9,14,``],[`openedBy`,18,`[`,32,`{`],[`closedBy`,19,`]`,33,`}`]],propSources:[de],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[V,H,le,ue,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),pe=e({yaml:()=>$,yamlLanguage:()=>Q}),Q=a.define({name:`yaml`,parser:fe.configure({props:[t.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name==`BlockLiteralContent`&&t.from<t.to)return e.baseIndentFor(t);if(t.name==`BlockLiteral`)return e.baseIndentFor(t)+e.unit;if(t.name==`BlockSequence`||t.name==`BlockMapping`)return e.column(t.firstChild.from,1);if(t.name==`QuotedLiteral`)return null;if(t.name==`Literal`){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:r({closing:`}`}),FlowSequence:r({closing:`]`})}),o.add({"FlowMapping FlowSequence":s,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:`#`},indentOnInput:/^\s*[\]\}]$/}});function $(){return new i(Q)}c.meta;export{$ as n,pe as t};
|
|
1
|
+
import{r as e}from"./chunk-CYidjpOJ.js";import{E as t,R as n,m as r,o as i,r as a,x as o,y as s,z as c}from"./dist-ZfIywMZM.js";import{n as l,r as ee,t as te}from"./dist-BLe6Laue.js";var u=63,d=64,f=1,p=2,m=3,h=4,g=5,_=6,v=7,y=65,b=66,ne=8,x=9,S=10,C=11,w=12,T=13,E=19,D=20,O=29,re=33,ie=34,ae=47,oe=0,k=1,A=2,j=3,M=4,N=class{constructor(e,t,n){this.parent=e,this.depth=t,this.type=n,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)+n}};N.top=new N(null,-1,oe);function P(e,t){for(let n=0,r=t-e.pos-1;;r--,n++){let t=e.peek(r);if(I(t)||t==-1)return n}}function F(e){return e==32||e==9}function I(e){return e==10||e==13}function L(e){return F(e)||I(e)}function R(e){return e<0||L(e)}var z=new te({start:N.top,reduce(e,t){return e.type==j&&(t==D||t==ie)?e.parent:e},shift(e,t,n,r){if(t==m)return new N(e,P(r,r.pos),k);if(t==y||t==g)return new N(e,P(r,r.pos),A);if(t==u)return e.parent;if(t==E||t==re)return new N(e,0,j);if(t==T&&e.type==M)return e.parent;if(t==ae){let t=/[1-9]/.exec(r.read(r.pos,n.pos));if(t)return new N(e,e.depth+ +t[0],M)}return e},hash(e){return e.hash}});function B(e,t,n=0){return e.peek(n)==t&&e.peek(n+1)==t&&e.peek(n+2)==t&&R(e.peek(n+3))}var V=new l((e,t)=>{if(e.next==-1&&t.canShift(d))return e.acceptToken(d);let n=e.peek(-1);if((I(n)||n<0)&&t.context.type!=j){if(B(e,45))if(t.canShift(u))e.acceptToken(u);else return e.acceptToken(f,3);if(B(e,46))if(t.canShift(u))e.acceptToken(u);else return e.acceptToken(p,3);let n=0;for(;e.next==32;)n++,e.advance();(n<t.context.depth||n==t.context.depth&&t.context.type==k&&(e.next!=45||!R(e.peek(1))))&&e.next!=-1&&!I(e.next)&&e.next!=35&&e.acceptToken(u,-n)}},{contextual:!0}),H=new l((e,t)=>{if(t.context.type==j){e.next==63&&(e.advance(),R(e.next)&&e.acceptToken(v));return}if(e.next==45)e.advance(),R(e.next)&&e.acceptToken(t.context.type==k&&t.context.depth==P(e,e.pos-1)?h:m);else if(e.next==63)e.advance(),R(e.next)&&e.acceptToken(t.context.type==A&&t.context.depth==P(e,e.pos-1)?_:g);else{let n=e.pos;for(;;)if(F(e.next)){if(e.pos==n)return;e.advance()}else if(e.next==33)K(e);else if(e.next==38)q(e);else if(e.next==42){q(e);break}else if(e.next==39||e.next==34){if(J(e,!0))break;return}else if(e.next==91||e.next==123){if(!se(e))return;break}else{Z(e,!0,!1,0);break}for(;F(e.next);)e.advance();if(e.next==58){if(e.pos==n&&t.canShift(O))return;R(e.peek(1))&&e.acceptTokenTo(t.context.type==A&&t.context.depth==P(e,n)?b:y,n)}}},{contextual:!0});function U(e){return e>32&&e<127&&e!=34&&e!=37&&e!=44&&e!=60&&e!=62&&e!=92&&e!=94&&e!=96&&e!=123&&e!=124&&e!=125}function W(e){return e>=48&&e<=57||e>=97&&e<=102||e>=65&&e<=70}function G(e,t){return e.next==37?(e.advance(),W(e.next)&&e.advance(),W(e.next)&&e.advance(),!0):U(e.next)||t&&e.next==44?(e.advance(),!0):!1}function K(e){if(e.advance(),e.next==60){for(e.advance();;)if(!G(e,!0)){e.next==62&&e.advance();break}}else for(;G(e,!1););}function q(e){for(e.advance();!R(e.next)&&Y(e.next)!=`f`;)e.advance()}function J(e,t){let n=e.next,r=!1,i=e.pos;for(e.advance();;){let a=e.next;if(a<0)break;if(e.advance(),a==n)if(a==39)if(e.next==39)e.advance();else break;else break;else if(a==92&&n==34)e.next>=0&&e.advance();else if(I(a)){if(t)return!1;r=!0}else if(t&&e.pos>=i+1024)return!1}return!r}function se(e){for(let t=[],n=e.pos+1024;;)if(e.next==91||e.next==123)t.push(e.next),e.advance();else if(e.next==39||e.next==34){if(!J(e,!0))return!1}else if(e.next==93||e.next==125){if(t[t.length-1]!=e.next-2)return!1;if(t.pop(),e.advance(),!t.length)return!0}else if(e.next<0||e.pos>n||I(e.next))return!1;else e.advance()}var ce=`iiisiiissisfissssssssssssisssiiissssssssssssssssssssssssssfsfssissssssssssssssssssssssssssfif`;function Y(e){return e<33?`u`:e>125?`s`:ce[e-33]}function X(e,t){let n=Y(e);return n!=`u`&&!(t&&n==`f`)}function Z(e,t,n,r){if(Y(e.next)==`s`||(e.next==63||e.next==58||e.next==45)&&X(e.peek(1),n))e.advance();else return!1;let i=e.pos;for(;;){let a=e.next,o=0,s=r+1;for(;L(a);){if(I(a)){if(t)return!1;s=0}else s++;a=e.peek(++o)}if(!(a>=0&&(a==58?X(e.peek(o+1),n):a==35?e.peek(o-1)!=32:X(a,n)))||!n&&s<=r||s==0&&!n&&(B(e,45,o)||B(e,46,o)))break;if(t&&Y(a)==`f`)return!1;for(let t=o;t>=0;t--)e.advance();if(t&&e.pos>i+1024)return!1}return!0}var le=new l((e,t)=>{if(e.next==33)K(e),e.acceptToken(w);else if(e.next==38||e.next==42){let t=e.next==38?S:C;q(e),e.acceptToken(t)}else e.next==39||e.next==34?(J(e,!1),e.acceptToken(x)):Z(e,!1,t.context.type==j,t.context.depth)&&e.acceptToken(ne)}),ue=new l((e,t)=>{let n=t.context.type==M?t.context.depth:-1,r=e.pos;scan:for(;;){let i=0,a=e.next;for(;a==32;)a=e.peek(++i);if(!i&&(B(e,45,i)||B(e,46,i))||!I(a)&&(n<0&&(n=Math.max(t.context.depth+1,i)),i<n))break;for(;;){if(e.next<0)break scan;let t=I(e.next);if(e.advance(),t)continue scan;r=e.pos}}e.acceptTokenTo(T,r)}),de=n({DirectiveName:c.keyword,DirectiveContent:c.attributeValue,"DirectiveEnd DocEnd":c.meta,QuotedLiteral:c.string,BlockLiteralHeader:c.special(c.string),BlockLiteralContent:c.content,Literal:c.content,"Key/Literal Key/QuotedLiteral":c.definition(c.propertyName),"Anchor Alias":c.labelName,Tag:c.typeName,Comment:c.lineComment,": , -":c.separator,"?":c.punctuation,"[ ]":c.squareBracket,"{ }":c.brace}),fe=ee.deserialize({version:14,states:"5lQ!ZQgOOO#PQfO'#CpO#uQfO'#DOOOQR'#Dv'#DvO$qQgO'#DRO%gQdO'#DUO%nQgO'#DUO&ROaO'#D[OOQR'#Du'#DuO&{QgO'#D^O'rQgO'#D`OOQR'#Dt'#DtO(iOqO'#DbOOQP'#Dj'#DjO(zQaO'#CmO)YQgO'#CmOOQP'#Cm'#CmQ)jQaOOQ)uQgOOQ]QgOOO*PQdO'#CrO*nQdO'#CtOOQO'#Dw'#DwO+]Q`O'#CxO+hQdO'#CwO+rQ`O'#CwOOQO'#Cv'#CvO+wQdO'#CvOOQO'#Cq'#CqO,UQ`O,59[O,^QfO,59[OOQR,59[,59[OOQO'#Cx'#CxO,eQ`O'#DPO,pQdO'#DPOOQO'#Dx'#DxO,zQdO'#DxO-XQ`O,59jO-aQfO,59jOOQR,59j,59jOOQR'#DS'#DSO-hQcO,59mO-sQgO'#DVO.TQ`O'#DVO.YQcO,59pOOQR'#DX'#DXO#|QfO'#DWO.hQcO'#DWOOQR,59v,59vO.yOWO,59vO/OOaO,59vO/WOaO,59vO/cQgO'#D_OOQR,59x,59xO0VQgO'#DaOOQR,59z,59zOOQP,59|,59|O0yOaO,59|O1ROaO,59|O1aOqO,59|OOQP-E7h-E7hO1oQgO,59XOOQP,59X,59XO2PQaO'#DeO2_QgO'#DeO2oQgO'#DkOOQP'#Dk'#DkQ)jQaOOO3PQdO'#CsOOQO,59^,59^O3kQdO'#CuOOQO,59`,59`OOQO,59c,59cO4VQdO,59cO4aQdO'#CzO4kQ`O'#CzOOQO,59b,59bOOQU,5:Q,5:QOOQR1G.v1G.vO4pQ`O1G.vOOQU-E7d-E7dO4xQdO,59kOOQO,59k,59kO5SQdO'#DQO5^Q`O'#DQOOQO,5:d,5:dOOQU,5:R,5:ROOQR1G/U1G/UO5cQ`O1G/UOOQU-E7e-E7eO5kQgO'#DhO5xQcO1G/XOOQR1G/X1G/XOOQR,59q,59qO6TQgO,59qO6eQdO'#DiO6lQgO'#DiO7PQcO1G/[OOQR1G/[1G/[OOQR,59r,59rO#|QfO,59rOOQR1G/b1G/bO7_OWO1G/bO7dOaO1G/bOOQR,59y,59yOOQR,59{,59{OOQP1G/h1G/hO7lOaO1G/hO7tOaO1G/hO8POaO1G/hOOQP1G.s1G.sO8_QgO,5:POOQP,5:P,5:POOQP,5:V,5:VOOQP-E7i-E7iOOQO,59_,59_OOQO,59a,59aOOQO1G.}1G.}OOQO,59f,59fO8oQdO,59fOOQR7+$b7+$bP,XQ`O'#DfOOQO1G/V1G/VOOQO,59l,59lO8yQdO,59lOOQR7+$p7+$pP9TQ`O'#DgOOQR'#DT'#DTOOQR,5:S,5:SOOQR-E7f-E7fOOQR7+$s7+$sOOQR1G/]1G/]O9YQgO'#DYO9jQ`O'#DYOOQR,5:T,5:TO#|QfO'#DZO9oQcO'#DZOOQR-E7g-E7gOOQR7+$v7+$vOOQR1G/^1G/^OOQR7+$|7+$|O:QOWO7+$|OOQP7+%S7+%SO:VOaO7+%SO:_OaO7+%SOOQP1G/k1G/kOOQO1G/Q1G/QOOQO1G/W1G/WOOQR,59t,59tO:jQgO,59tOOQR,59u,59uO#|QfO,59uOOQR<<Hh<<HhOOQP<<Hn<<HnO:zOaO<<HnOOQR1G/`1G/`OOQR1G/a1G/aOOQPAN>YAN>Y",stateData:";S~O!fOS!gOS^OS~OP_OQbORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!V[O!cTO~O`cO~P]OVkOWROXROYeOZfO[dOcPOmhOqQO~OboO~P!bOVtOWROXROYeOZfO[dOcPOmrOqQO~OpwO~P#WORSOTUOWROXROYYOZZO[XOcPOqQO!PVO!cTO~OSvP!avP!bvP~P#|OWROXROYeOZfO[dOcPOqQO~OmzO~P%OOm!OOUzP!azP!bzP!dzP~P#|O^!SO!b!QO!f!TO!g!RO~ORSOTUOWROXROcPOqQO!PVO!cTO~OY!UOP!QXQ!QX!V!QX!`!QXS!QX!a!QX!b!QXU!QXm!QX!d!QX~P&aO[!WOP!SXQ!SX!V!SX!`!SXS!SX!a!SX!b!SXU!SXm!SX!d!SX~P&aO^!ZO!W![O!b!YO!f!]O!g!YO~OP!_O!V[OQaX!`aX~OPaXQaX!VaX!`aX~P#|OP!bOQ!cO!V[O~OP_O!V[O~P#|OWROXROY!fOcPOqQObfXmfXofXpfX~OWROXRO[!hOcPOqQObhXmhXohXphX~ObeXmlXoeX~ObkXokX~P%OOm!kO~Om!lObnPonP~P%OOb!pOo!oO~Ob!pO~P!bOm!sOosXpsX~OosXpsX~P%OOm!uOotPptP~P%OOo!xOp!yO~Op!yO~P#WOS!|O!a#OO!b#OO~OUyX!ayX!byX!dyX~P#|Om#QO~OU#SO!a#UO!b#UO!d#RO~Om#WOUzX!azX!bzX!dzX~O]#XO~O!b#XO!g#YO~O^#ZO!b#XO!g#YO~OP!RXQ!RX!V!RX!`!RXS!RX!a!RX!b!RXU!RXm!RX!d!RX~P&aOP!TXQ!TX!V!TX!`!TXS!TX!a!TX!b!TXU!TXm!TX!d!TX~P&aO!b#^O!g#^O~O^#_O!b#^O!f#`O!g#^O~O^#_O!W#aO!b#^O!g#^O~OPaaQaa!Vaa!`aa~P#|OP#cO!V[OQ!XX!`!XX~OP!XXQ!XX!V!XX!`!XX~P#|OP_O!V[OQ!_X!`!_X~P#|OWROXROcPOqQObgXmgXogXpgX~OWROXROcPOqQObiXmiXoiXpiX~Obkaoka~P%OObnXonX~P%OOm#kO~Ob#lOo!oO~Oosapsa~P%OOotXptX~P%OOm#pO~Oo!xOp#qO~OSwP!awP!bwP~P#|OS!|O!a#vO!b#vO~OUya!aya!bya!dya~P#|Om#xO~P%OOm#{OU}P!a}P!b}P!d}P~P#|OU#SO!a$OO!b$OO!d#RO~O]$QO~O!b$QO!g$RO~O!b$SO!g$SO~O^$TO!b$SO!g$SO~O^$TO!b$SO!f$UO!g$SO~OP!XaQ!Xa!V!Xa!`!Xa~P#|Obnaona~P%OOotapta~P%OOo!xO~OU|X!a|X!b|X!d|X~P#|Om$ZO~Om$]OU}X!a}X!b}X!d}X~O]$^O~O!b$_O!g$_O~O^$`O!b$_O!g$_O~OU|a!a|a!b|a!d|a~P#|O!b$cO!g$cO~O",goto:",]!mPPPPPPPPPPPPPPPPP!nPP!v#v#|$`#|$c$f$j$nP%VPPP!v%Y%^%a%{&O%a&R&U&X&_&b%aP&e&{&e'O'RPP']'a'g'm's'y(XPPPPPPPP(_)e*X+c,VUaObcR#e!c!{ROPQSTUXY_bcdehknrtvz!O!U!W!_!b!c!f!h!k!l!s!u!|#Q#R#S#W#c#k#p#x#{$Z$]QmPR!qnqfPQThknrtv!k!l!s!u#R#k#pR!gdR!ieTlPnTjPnSiPnSqQvQ{TQ!mkQ!trQ!vtR#y#RR!nkTsQvR!wt!RWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]RySR#t!|R|TR|UQ!PUR#|#SR#z#RR#z#SyZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]R!VXR!XYa]O^abc!a!c!eT!da!eQnPR!rnQvQR!{vQ!}yR#u!}Q#T|R#}#TW^Obc!cS!^^!aT!aa!eQ!eaR#f!eW`Obc!cQxSS}U#SQ!`_Q#PzQ#V!OQ#b!_Q#d!bQ#s!|Q#w#QQ$P#WQ$V#cQ$Y#xQ$[#{Q$a$ZR$b$]xZOSU_bcz!O!_!b!c!|#Q#S#W#c#x#{$Z$]Q!VXQ!XYQ#[!UR#]!W!QWOSUXY_bcz!O!U!W!_!b!c!|#Q#S#W#c#x#{$Z$]pfPQThknrtv!k!l!s!u#R#k#pQ!gdQ!ieQ#g!fR#h!hSgPn^pQTkrtv#RQ!jhQ#i!kQ#j!lQ#n!sQ#o!uQ$W#kR$X#pQuQR!zv",nodeNames:`⚠ DirectiveEnd DocEnd - - ? ? ? Literal QuotedLiteral Anchor Alias Tag BlockLiteralContent Comment Stream BOM Document ] [ FlowSequence Item Tagged Anchored Anchored Tagged FlowMapping Pair Key : Pair , } { FlowMapping Pair Pair BlockSequence Item Item BlockMapping Pair Pair Key Pair Pair BlockLiteral BlockLiteralHeader Tagged Anchored Anchored Tagged Directive DirectiveName DirectiveContent Document`,maxTerm:74,context:z,nodeProps:[[`isolate`,-3,8,9,14,``],[`openedBy`,18,`[`,32,`{`],[`closedBy`,19,`]`,33,`}`]],propSources:[de],skippedNodes:[0],repeatNodeCount:6,tokenData:"-Y~RnOX#PXY$QYZ$]Z]#P]^$]^p#Ppq$Qqs#Pst$btu#Puv$yv|#P|}&e}![#P![!]'O!]!`#P!`!a'i!a!}#P!}#O*g#O#P#P#P#Q+Q#Q#o#P#o#p+k#p#q'i#q#r,U#r;'S#P;'S;=`#z<%l?HT#P?HT?HU,o?HUO#PQ#UU!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PQ#kTOY#PZs#Pt;'S#P;'S;=`#z<%lO#PQ#}P;=`<%l#P~$VQ!f~XY$Qpq$Q~$bO!g~~$gS^~OY$bZ;'S$b;'S;=`$s<%lO$b~$vP;=`<%l$bR%OX!WQOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR%rX!WQ!VPOX%kXY#PZ]%k]^#P^p%kpq#hq;'S%k;'S;=`&_<%lO%kR&bP;=`<%l%kR&lUoP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'VUmP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR'p[!PP!WQOY#PZp#Ppq#hq{#P{|(f|}#P}!O(f!O!R#P!R![)p![;'S#P;'S;=`#z<%lO#PR(mW!PP!WQOY#PZp#Ppq#hq!R#P!R![)V![;'S#P;'S;=`#z<%lO#PR)^U!PP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR)wY!PP!WQOY#PZp#Ppq#hq{#P{|)V|}#P}!O)V!O;'S#P;'S;=`#z<%lO#PR*nUcP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+XUbP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR+rUqP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,]UpP!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#PR,vU`P!WQOY#PZp#Ppq#hq;'S#P;'S;=`#z<%lO#P",tokenizers:[V,H,le,ue,0,1],topRules:{Stream:[0,15]},tokenPrec:0}),pe=e({yaml:()=>$,yamlLanguage:()=>Q}),Q=a.define({name:`yaml`,parser:fe.configure({props:[t.add({Stream:e=>{for(let t=e.node.resolve(e.pos,-1);t&&t.to>=e.pos;t=t.parent){if(t.name==`BlockLiteralContent`&&t.from<t.to)return e.baseIndentFor(t);if(t.name==`BlockLiteral`)return e.baseIndentFor(t)+e.unit;if(t.name==`BlockSequence`||t.name==`BlockMapping`)return e.column(t.firstChild.from,1);if(t.name==`QuotedLiteral`)return null;if(t.name==`Literal`){let n=e.column(t.from,1);if(n==e.lineIndent(t.from,1))return n;if(t.to>e.pos)return null}}return null},FlowMapping:r({closing:`}`}),FlowSequence:r({closing:`]`})}),o.add({"FlowMapping FlowSequence":s,"Item Pair BlockLiteral":(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}),languageData:{commentTokens:{line:`#`},indentOnInput:/^\s*[\]\}]$/}});function $(){return new i(Q)}c.meta;export{$ as n,pe as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{fo as e}from"./dist-
|
|
1
|
+
import{fo as e}from"./dist-Dkm48MhE.js";function t(t){return e.includes(t)}function n(e){if(e.startsWith(_)||e.startsWith(x)||e.startsWith(S)||e.startsWith(T)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=v(t),r=n>=0?t.slice(0,n):t;if(!r)return null;try{return r.split(`/`).map(decodeURIComponent).join(`/`)}catch{return r}}function r(e){if(e.startsWith(_)||!e.startsWith(`#/`))return null;let t=e.slice(2),n=t.indexOf(`#`);if(n<0)return null;let r=t.slice(n+1);if(!r)return null;try{return decodeURIComponent(r)}catch{return r}}function i(e,t){let n=`#/${e}`;return t?`${n}#${encodeURIComponent(t)}`:n}function a(e,t){return e===t||o(e)===o(t)}function o(e){try{return decodeURIComponent(e)}catch{return e}}var s=`__okHashHistoryEntry`;function c(e){return{...typeof e==`object`&&e?e:{},[s]:!0}}function l(e){return typeof e==`object`&&!!e&&e[s]===!0}function u(){l(window.history.state)||window.history.replaceState(c(window.history.state),``)}function d(e){let{pathname:t,search:n}=window.location;window.history.replaceState(c(window.history.state),``,`${t}${n}${e}`)}function f(e){if(a(window.location.hash,e))return;let{pathname:t,search:n}=window.location;window.history.pushState(c(window.history.state),``,`${t}${n}${e}`)}function p(e){return e.endsWith(`.mdx`)?e.slice(0,-4):e.endsWith(`.md`)?e.slice(0,-3):e}function m(e,t){let n=e.replace(/^\/+|\/+$/g,``),r=n?`#/${n}/`:`#/`;return t?`${r}#${encodeURIComponent(t)}`:r}function h(e,t,n){if(e===`folder`)return m(t);let r=`#/${encodeURIComponent(t)}`;return n==null||n===``?r:`${r}?branch=${encodeURIComponent(n)}`}function g(e){if(e===`#/`)return!0;if(!e.startsWith(`#/`))return!1;let t=e.slice(2);return t.length>0&&t[0]===`?`}var _=`#/__asset__/`;function v(e){let t=e.indexOf(`?`),n=e.indexOf(`#`);return t<0?n:n<0?t:Math.min(t,n)}function y(e){if(!e.startsWith(_))return null;let t=e.slice(12);if(!t)return null;try{return t.split(`/`).map(decodeURIComponent).join(`/`)}catch{return t}}function b(e){return`${_}${e.split(`/`).map(encodeURIComponent).join(`/`)}`}var x=`#/__skill-file__/`,S=`#/__skills__`;function C(){return S}function w(e){return e===S||e.startsWith(`${S}/`)}var T=`#/__skill-preview__/`,E=[`explore`,`detected`,`builtin`,`foreign`];function D(e){return e!==void 0&&E.includes(e)}var O=`project`;function k(e){return[e.flavor,e.source,e.name,e.subtitle,e.level??O].map(encodeURIComponent).join(`/`)}function A(e){if(!e)return null;let n;try{n=e.split(`/`).map(decodeURIComponent)}catch{return null}if(n.length<4||n.length>6)return null;let[r,i,a,o,s,c]=n;return!D(r)||!i||!a?null:{flavor:r,source:i,name:a,subtitle:o??``,...s&&t(s)?{level:s}:{},...c?{path:c}:{}}}function j(e){let t=k(e);return e.path&&(t+=`/${encodeURIComponent(e.path)}`),`${T}${t}`}function M(e){return e.startsWith(T)?A(e.slice(20)):null}var N=`:`;function P(e){let t=e.host===void 0?e.name:`${e.name}${N}${e.host}`;return`${x}${[e.scope,t].map(encodeURIComponent).join(`/`)}/${e.path.split(`/`).map(encodeURIComponent).join(`/`)}`}function F(e){if(!e.startsWith(x))return null;let n=e.slice(17);if(!n)return null;let r;try{r=n.split(`/`).map(decodeURIComponent)}catch{return null}if(r.length<3)return null;let[i,a,...o]=r,s=o.join(`/`);if(!i||!a||!s||!t(i))return null;let c=a.indexOf(N),l=c===-1?a:a.slice(0,c),u=c===-1?void 0:a.slice(c+1);return l?{scope:i,name:l,path:s,...u?{host:u}:{}}:null}var I=/\.(md|mdx)$/i;function L(e){return e.trim().replace(/^\.\/+/,``).replace(/^\/+/,``)}function R(e){return L(e).replace(I,``)}function z(e){let t=L(e);return t?I.test(t)?t:`${t}.md`:`untitled.md`}function B(e){let t=R(e),n=t.lastIndexOf(`/`);return{initialDir:n>0?t.slice(0,n):``,suggestedName:`${n>=0?t.slice(n+1):t||`untitled`}.md`}}export{F as C,d as S,w as T,g as _,y as a,u as b,h as c,b as d,i as f,C as g,j as h,r as i,k as l,P as m,z as n,A as o,m as p,R as r,n as s,B as t,p as u,l as v,M as w,f as x,a as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e}from"./dist-
|
|
1
|
+
import{A as e}from"./dist-Dkm48MhE.js";var t=`open-knowledge:documents-changed`,n=new Set(e.options);function r(e){return e===void 0||!Array.isArray(e)?[`files`]:[...new Set(e.filter(e=>n.has(e)))]}function i(e=[`files`]){window.dispatchEvent(new CustomEvent(t,{detail:{channels:r(e)}}))}function a(e){let n=t=>{e(r(t instanceof CustomEvent?t.detail?.channels:void 0))};return window.addEventListener(t,n),()=>window.removeEventListener(t,n)}function o(e){return e.includes(`local-targets`)||e.includes(`files`)}var s=`open-knowledge:doc-persisted`;function c(e){window.dispatchEvent(new CustomEvent(s,{detail:{docName:e}}))}function l(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail?.docName;typeof n==`string`&&n.length>0&&e(n)};return window.addEventListener(s,t),()=>window.removeEventListener(s,t)}var u=`open-knowledge:branch-changed`;function d(e){window.dispatchEvent(new CustomEvent(u,{detail:{branch:e}}))}function f(e){let t=t=>{if(!(t instanceof CustomEvent))return;let n=t.detail;e(n?.branch??null)};return window.addEventListener(u,t),()=>window.removeEventListener(u,t)}var p=`open-knowledge:templates-changed`;function m(){window.dispatchEvent(new CustomEvent(p))}function h(e){let t=()=>e();return window.addEventListener(p,t),()=>window.removeEventListener(p,t)}var g=`open-knowledge:skills-changed`;function _(){window.dispatchEvent(new CustomEvent(g))}function v(e){let t=()=>e();return window.addEventListener(g,t),()=>window.removeEventListener(g,t)}var y=new Set,b=(e,t)=>`${e}\u0000${t}`;function x(e,t){y.add(b(e,t)),_()}function S(e,t){y.delete(b(e,t))&&_()}var C=new Set;function w(e,t){C.add(b(e,t)),_()}function T(e,t){C.delete(b(e,t))&&_()}function E(e,t){return C.has(b(e,t))}function D(){return[...C].sort().join(``)}function O(e,t){return y.has(b(e,t))}function k(e){return y.size===0?e:e.filter(e=>!y.has(b(e.scope,e.name)))}export{a as _,c as a,m as c,o as d,O as f,l as g,f as h,d as i,S as l,D as m,x as n,i as o,E as p,w as r,_ as s,k as t,T as u,v,h as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Cs as e,Ds as t,bs as n,xs as r}from"./dist-
|
|
1
|
+
import{Cs as e,Ds as t,bs as n,xs as r}from"./dist-Dkm48MhE.js";import{d as i,f as a,p as o}from"./doc-paths-BmaDk64-.js";import{t as s}from"./file-tree-rename-validation-CVcZpNDF.js";import{c,l,s as u}from"./file-tree-utils-DBwwlF-O.js";import{a as d}from"./navigation-targets-PGhaiird.js";var f=`application/x-open-knowledge-sidebar-item+json`,p={image:!0,video:!0,audio:!0,pdf:!0,text:!0,mermaid:!0,excalidraw:!0};function m(e){return JSON.stringify(e)}function h(e){return e?Array.from(e.types).includes(f):!1}function ee(e){return e.kind===`folder`?{target:{kind:`folder`,target:e.folderPath,folderPath:e.folderPath},hash:o(e.folderPath)}:e.kind===`asset`?{target:{kind:`asset`,target:e.assetPath,assetPath:e.assetPath,mediaKind:e.mediaKind},hash:i(e.assetPath)}:{target:d(e.docName,e.size)??{kind:`doc`,target:e.docName,docName:e.docName},hash:a(e.docName)}}function g(e){if(!e||!h(e))return null;let t=e.getData(f);if(!t)return null;let n;try{n=JSON.parse(t)}catch{return null}if(!_(n)||n.v!==1||typeof n.kind!=`string`)return null;if(n.kind===`doc`){if(typeof n.docName!=`string`||n.docName.length===0)return null;let e=n.size;return e!==null&&typeof e!=`number`?null:{v:1,kind:`doc`,docName:n.docName,size:e}}if(n.kind===`folder`)return typeof n.folderPath==`string`?{v:1,kind:`folder`,folderPath:n.folderPath}:null;if(n.kind===`asset`){if(typeof n.assetPath!=`string`||n.assetPath.length===0)return null;let e=n.mediaKind;return e!==null&&!v(e)?null:{v:1,kind:`asset`,assetPath:n.assetPath,mediaKind:e}}return null}function _(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function v(e){return typeof e==`string`&&Object.hasOwn(p,e)}var y=`.md`,b=/\.(md|mdx)$/i;function x(t,i=y){return b.test(t)||e(t)||r(t)||n(t)?t:`${t}${i}`}function S(e){return $(e).replace(b,``)}function C(e,t){let n=$(e),r=k(t),i=t.find(e=>c(e)&&A(e,r)===n)??t.find(e=>c(e)&&T(e)===n);if(i)return i.docName;let a=S(n);return t.find(e=>{let t=T(e);return t!==n&&b.test(t)&&S(t)===a})&&b.test(n)?n:a}function w(e,t){let n=k(t);return t.find(t=>A(t,n)===e)??t.find(t=>T(t)===e)}function T(e){return l(e)?O(e.path):u(e)?e.path:x(e.docName,e.docExt)}function E(e){let t=$(e).match(b);return t?`.${t[1].toLowerCase()}`:void 0}function D(e){return $(e)}function O(e){let t=$(e.trim());return t?`${t}/`:``}function te(e){return e.endsWith(`/`)?D(e):S(e)}function k(e){let t=new Map;for(let n of e){if(!c(n))continue;let e=n.docName.match(b);if(!e)continue;let r=n.docName.slice(0,-e[0].length),i=t.get(r);i?i.add(e[0]):t.set(r,new Set([e[0]]))}return t}function A(e,t){let n=T(e);if(!c(e))return n;let r=e.docName.match(b);if(!r)return n;let i=e.docName.slice(0,-r[0].length);return(t.get(i)?.size??0)>1?n:`${e.docName}${e.docExt??y}`}function j(e){let t=k(e),n=new Set,r=[];for(let i of e){let e=A(i,t);n.has(e)||(n.add(e),r.push(e))}return r}function M(e){return[...e].sort().join(`\0`)}function N(e){return M(j(e))}function P(e,t={}){let n=new Set;for(let r of e){let e=(l(r)||u(r)?r.path:r.docName).split(`/`).filter(Boolean);if(!t.includeOkFolders&&e.includes(`.ok`))continue;if(l(r)){let e=O(r.path);e&&n.add(e)}let i=l(r)?e.length:e.length-1;for(let t=1;t<=i;t++)n.add(`${e.slice(0,t).join(`/`)}/`)}return[...n].sort()}function F(e){if(!e)return[];let t=$(e.replace(b,``)).split(`/`).filter(Boolean),n=[],r=e.endsWith(`/`)?t.length:t.length-1;for(let e=1;e<=r;e++)n.push(`${t.slice(0,e).join(`/`)}/`);return n}function I(e,t,n){let r=E(e);if(r)return r;let i=n.find(e=>c(e)&&e.docName===t);return i?i.docExt??y:Q(e).includes(`.`)?void 0:y}function L(e,t){let n=e.lastIndexOf(`/`),r=n===-1?``:e.slice(0,n+1),i=n===-1?e:e.slice(n+1),a=t.filter(e=>{if(!u(e)||!e.path.startsWith(r))return!1;let t=e.path.slice(r.length);return!t.includes(`/`)&&t.startsWith(`${i}.`)});return a.length===1?a[0].path:null}function R(e,t,n){if(E(e))return null;let r=n.find(e=>u(e)&&e.path===t);return r?r.path:Q(e).includes(`.`)?t:L(t,n)}function z(e,t){let n=e.kind===`directory`,r=n?D(e.path):C(e.path,t);if(n)return{kind:`folder`,name:$(Q(e.path)).replace(b,``),path:r,treePath:V(e.path,!0)};let i=R(e.path,r,t);if(i)return{kind:`asset`,name:$(Q(i)),path:i,treePath:i};let a=I(e.path,r,t);return{kind:`file`,name:$(Q(e.path)).replace(b,``),path:r,treePath:V(e.path,!1),docExt:a}}function B(e){return e.kind===`directory`?D(e.path):e.path}function V(e,t){return t?O(e):b.test(e)?e:`${e}${y}`}function H(e,t,n){let r=O(t),i=new Set(n);for(let t=0;t<100;t++){let n=t===0?``:` ${t+1}`;if(e===`file`){let e=`${r}Untitled${n}${y}`;if(!i.has(e))return{addPath:e,renamePath:e};continue}let a=`${r}New Folder${n}/`;if(!i.has(a))return{addPath:a,renamePath:a}}throw Error(`Could not allocate a unique tree placeholder`)}function U(e,t){return e===`file`?V(t,!1):`${D(t)}/index${y}`}function W(e,t){return t.kind===`root`||t.directoryPath==null?Q(e):`${t.directoryPath}${Q(e)}`}function G(e,t){if(t)return D(O(e));let n=S(e),r=n.lastIndexOf(`/`);return r===-1?``:n.slice(0,r)}function K(e,t){let n=D(O(e));return n?`${n}/${t}`:t}function q(e,t,n){e.append(`parentDocName`,K(t,n)),e.append(`placement`,`parent-dir`)}function J(e,t){return(t.path??K(e,t.src)).replace(/^\/+/,``)}function Y(e){let t=e.dataTransfer?.types;if(!t)return!1;let n=Array.from(t);return n.includes(`Files`)&&!n.includes(`application/x-open-knowledge-sidebar-item+json`)}function X(e){return Array.from(e.dataTransfer?.files??[]).filter(e=>e.name.length>0||e.size>0)}function Z(e,n){let r=s(e).toLowerCase();if(r===``)return null;let i=new Date().toISOString();if(r===`.md`||r===`.mdx`)return{kind:`document`,docName:S(e),docExt:r,modified:i,size:n.size};let a=r.startsWith(`.`)?r.slice(1):r;return{kind:`asset`,path:e,assetExt:a,mediaKind:t(a),modified:i,size:n.size}}function Q(e){let t=$(e),n=t.lastIndexOf(`/`),r=n===-1?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function $(e){return e.endsWith(`/`)?e.slice(0,-1):e}export{g as A,z as C,f as D,J as E,h as O,C as S,te as T,G as _,U as a,D as b,j as c,T as d,X as f,V as g,Y as h,W as i,m as j,ee as k,N as l,O as m,P as n,H as o,w as p,F as r,x as s,q as t,Z as u,B as v,M as w,S as x,L as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Eo as e,Ur as t,Yr as n}from"./dist-
|
|
1
|
+
import{Eo as e,Ur as t,Yr as n}from"./dist-Dkm48MhE.js";function r(e){return e.kind===`asset`}function i(e){return e.kind===`document`}function a(e){return e.kind===`folder`}function o(e){let t=[],n=0;for(let r of e)switch(r.kind){case`document`:if(r.docName===void 0){n+=1;break}t.push({kind:`document`,docName:r.docName,docExt:r.docExt,size:r.size,modified:r.modified,isSymlink:r.isSymlink,canonicalDocName:r.canonicalDocName,targetPath:r.targetPath});break;case`asset`:if(r.path===void 0||r.assetExt===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt,mediaKind:r.mediaKind??null,size:r.size,modified:r.modified,referencedBy:r.referencedBy});break;case`file`:if(r.path===void 0){n+=1;break}t.push({kind:`asset`,path:r.path,assetExt:r.assetExt??s(r.path),mediaKind:null,size:r.size,modified:r.modified,referencedBy:[]});break;case`folder`:if(r.path===void 0){n+=1;break}t.push({kind:`folder`,path:r.path,size:r.size,modified:r.modified,hasChildren:r.hasChildren,isSymlink:r.isSymlink,targetPath:r.targetPath});break;default:r.kind;break}return n>0&&console.warn(`[file-tree-utils] dropped ${n} listing entries missing variant identity fields`),t}function s(e){let t=e.includes(`/`)?e.split(`/`).pop()??e:e,n=t.lastIndexOf(`.`);return n>0&&n<t.length-1?t.slice(n+1).toLowerCase():t.startsWith(`.`)&&t.length>1?t.slice(1).toLowerCase():`file`}function c(e){if(!e)return[];let t=e.split(`/`).filter(Boolean),n=[];for(let e=1;e<t.length;e++)n.push(t.slice(0,e).join(`/`));return n}function l(e){if(!e)return``;let t=e.lastIndexOf(`/`);return t>0?e.slice(0,t):``}function u(e){return e.split(`/`).some(e=>e.toLowerCase()===`.ok`)}function d(e,t){return t&&e!==`document`&&e!==`folder`}function f(e,n){return!n&&t(e)}function p(e,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1,showOkFolders:o=!1}=r;return e.filter(e=>{let r=e.docName??e.path??``;if(r===``||d(e.kind,a))return!1;let s=r.split(`/`),c=s.indexOf(`.ok`);if(c!==-1){if(!o)return!1;let e=s.slice(0,c).join(`/`);return i||e===``||!t(e)}return n(r)?!1:!f(r,i)})}function m(t,r={}){let{showHiddenFiles:i=!1,showOnlyMarkdownFiles:a=!1}=r,o=t.docName??t.path??``;return o===``||e(o)||n(o)||u(o)?{hiddenFiles:!1,onlyMarkdownFiles:!1}:{hiddenFiles:f(o,i),onlyMarkdownFiles:d(t.kind,a)}}function h(e){let{visibility:t={},unfilteredRootEntryCount:n,knownPageCount:r}=e;return(n>0||r>0)&&(t.showOnlyMarkdownFiles??!1)?`filtered-to-zero`:`true-empty`}export{p as a,i as c,o as d,l as i,a as l,h as n,u as o,c as r,r as s,m as t,s as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./documents-events-
|
|
1
|
+
import{c as e}from"./documents-events-uT6X4Tcz.js";import{t}from"./parse-api-error-DsopQ8yv.js";import{t as n}from"./createLucideIcon-Bhw2PmPp.js";var r=n(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]);async function i(e){return t(await e.json().catch(()=>null))??`HTTP ${e.status}`}async function a(e,t){try{let n=await fetch(`/api/folder-config`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e,frontmatter:t})});return n.ok?{ok:!0}:{ok:!1,error:await i(n)}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function o(t){try{let n=await fetch(`/api/template`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function s(t,n){try{let r=`?folder=${encodeURIComponent(t)}&name=${encodeURIComponent(n)}`,a=await fetch(`/api/template${r}`,{method:`DELETE`});if(!a.ok)return{ok:!1,error:await i(a)};let o=await a.json().catch(()=>null);return e(),{ok:!0,existed:o?.existed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function c(t){try{let n=await fetch(`/api/template`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,committed:r?.committed??!1}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}async function l(t){try{let n=await fetch(`/api/template/import`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)return{ok:!1,error:await i(n)};let r=await n.json().catch(()=>null);return e(),{ok:!0,path:r?.path??``,created:r?.created??!1,warnings:r?.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}}export{o as a,a as i,l as n,r as o,c as r,s as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Zt as n,en as r,tn as i}from"./DocumentContext-BC38uC8R.js";import{t as a}from"./react-f2sANaYj.js";import{r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./utils-CPqDy6Hr.js";import{r as l,t as u}from"./button-CA0dewJJ.js";import{B as d,K as f,L as p,Q as m,R as h,V as g,et as _,f as v,l as y,q as ee,u as b,z as x}from"./CodeMirrorPropInput-Bbe8zInO.js";import{t as S}from"./separator-BM37WC0d.js";import{$i as C,Ba as w,Fa as T,Na as te,Pa as ne,Qi as E,ea as D,fa as O,ka as k,la as A,ta as j,za as M}from"./dist-DGemBD_J.js";import{t as N}from"./dist-XgwTV-oh2.js";import{t as P}from"./workspace-paths-CKUFX0v6.js";import{t as F}from"./createLucideIcon-Bhw2PmPp.js";import{t as I}from"./x-DddVxTPq.js";var L=F(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),R=s(),z=t(),B=l(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function V(e){let t=(0,R.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=c(B({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==i||t[9]!==a?(o=(0,z.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":r,className:a,...i}),t[7]=r,t[8]=i,t[9]=a,t[10]=o):o=t[10],o}function re(e){let t=(0,R.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,o;t[4]===n?o=t[5]:(o=c(`relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,z.jsx)(S,{"data-slot":`button-group-separator`,orientation:a,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}var H=e(a(),1),U=`ok-ask-ai-draft-v2`,W={doc:null,dismissed:!1};function G(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}var K=null,q=new Set;function J(e){if(e===null)return!0;let t=e.content;return!Array.isArray(t)||t.length===0?!0:t.every(e=>{let t=e.content;return!Array.isArray(t)||t.length===0})}function Y(){let e=G();if(!e)return W;try{let t=e.getItem(U);if(!t)return W;let n=JSON.parse(t);return typeof n!=`object`||!n||Array.isArray(n)?W:{doc:n,dismissed:!1}}catch(e){return console.warn(`failed to parse stored draft — clearing`,e),W}}function X(){return K===null&&(K=Y()),K}function Z(e){let t=G();if(t)try{e&&!J(e)?t.setItem(U,JSON.stringify(e)):t.removeItem(U)}catch{}}function ie(){for(let e of q)e()}function ae(){return X()}function oe(e){let t=e&&!J(e)?e:null;K={...X(),doc:t},Z(t),ie()}function se(){oe(null)}var ce=E;function le(e){let t=v(e).kind;return t===`folder`||t===`asset`?t:`page`}function ue(e){let t=(0,R.c)(14),{items:r,query:i,selectedIndex:a,onSelect:s,loading:c,error:l,hasMore:u}=e,d=c===void 0?!1:c,f=l===void 0?!1:l,p=u===void 0?!1:u,{_:m}=o(),h=(0,H.useId)(),g=(0,H.useRef)(null),_,v;t[0]===a?(_=t[1],v=t[2]):(_=()=>{(g.current?.querySelectorAll(`[role="option"]`))?.item(a)?.scrollIntoView({block:`nearest`})},v=[a],t[0]=a,t[1]=_,t[2]=v),(0,H.useEffect)(_,v);let y=a>=0&&a<r.length?r[a]:null,ee;return t[3]!==m||t[4]!==f||t[5]!==p||t[6]!==r||t[7]!==h||t[8]!==d||t[9]!==s||t[10]!==i||t[11]!==a||t[12]!==y?(ee=(0,z.jsx)(`div`,{ref:g,className:`w-80 max-w-[min(28rem,90vw)] overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:d?(0,z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:m({id:`3m2GBo`})}):f?(0,z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`assertive`,children:m({id:`weP6me`})}):r.length===0?(0,z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:i.trim()===``?m({id:`0E9DR6`}):m({id:`yQyglE`})}):(0,z.jsxs)(`div`,{role:`listbox`,id:h,"aria-label":m({id:`05n5wS`}),tabIndex:-1,className:`max-h-64 overflow-y-auto overscroll-contain subtle-scrollbar`,children:[(0,z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:y?y.title:``}),r.map((e,t)=>{let r=t===a,i=le(e.path),o=i===`folder`,c=o?`${e.path}/`:e.path;return(0,z.jsxs)(`button`,{id:`${h}-option-${t}`,type:`button`,role:`option`,"aria-selected":r,"data-active":r,"data-mention-kind":i,"data-testid":`composer-mention-option-${e.docName}`,className:`flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left ${r?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),s(e)},children:[(0,z.jsx)(n,{path:e.path,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,z.jsxs)(`span`,{className:`flex items-baseline gap-1.5`,children:[(0,z.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.title}),o?(0,z.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:m({id:`kNqMMd`})}):null]}),(0,z.jsx)(`span`,{className:`line-clamp-2 break-all text-xs text-muted-foreground`,children:c})]})]},e.docName)}),p?(0,z.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,"aria-hidden":!0,children:m({id:`F1T9y_`})}):null]})}),t[3]=m,t[4]=f,t[5]=p,t[6]=r,t[7]=h,t[8]=d,t[9]=s,t[10]=i,t[11]=a,t[12]=y,t[13]=ee):ee=t[13],ee}function de(e){let t=(0,R.c)(12),{items:n,query:r,selectedIndex:i,onSelect:a,commandsKnown:s}=e,{_:c}=o(),l=(0,H.useId)(),u=(0,H.useRef)(null),d,f;t[0]===i?(d=t[1],f=t[2]):(d=()=>{(u.current?.querySelectorAll(`[role="option"]`))?.item(i)?.scrollIntoView({block:`nearest`})},f=[i],t[0]=i,t[1]=d,t[2]=f),(0,H.useEffect)(d,f);let p=i>=0&&i<n.length?n[i]:null,m;return t[3]!==c||t[4]!==s||t[5]!==n||t[6]!==l||t[7]!==a||t[8]!==r||t[9]!==i||t[10]!==p?(m=(0,z.jsx)(`div`,{ref:u,"data-testid":`composer-slash-menu`,className:`w-[42rem] max-w-[min(42rem,90vw)] overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:n.length===0?(0,z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:s?r.trim()===``?c({id:`QohqVL`}):c({id:`odYWGJ`}):c({id:`9OPs7U`})}):(0,z.jsxs)(`div`,{role:`listbox`,id:l,"aria-label":c({id:`67Dpmh`}),tabIndex:-1,className:`max-h-64 overflow-y-auto overscroll-contain subtle-scrollbar`,children:[(0,z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:p?`/${p.name}`:``}),n.map((e,t)=>{let n=t===i;return(0,z.jsxs)(`button`,{id:`${l}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-active":n,"data-testid":`composer-slash-option-${e.name}`,className:`flex w-full items-baseline gap-2 rounded-md px-2 py-1.5 text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,z.jsxs)(`span`,{className:`shrink-0 font-mono text-sm font-medium`,children:[`/`,e.name]}),(0,z.jsx)(`span`,{className:`line-clamp-2 min-w-0 flex-1 text-xs text-muted-foreground`,children:e.description})]},e.name)})]})}),t[3]=c,t[4]=s,t[5]=n,t[6]=l,t[7]=a,t[8]=r,t[9]=i,t[10]=p,t[11]=m):m=t[11],m}var fe=new w(`composerSlashSuggestion`),pe=O.create({name:`composerCommand`,group:`inline`,inline:!0,atom:!0,selectable:!1,addAttributes(){return{name:{default:``},description:{default:``},hint:{default:``}}},parseHTML(){return[{tag:`span[data-composer-command]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.name??``);return[`span`,k(t,{"data-composer-command":n,class:`composer-slash-token composer-slash-token-known`}),`/${n}`]},renderText({node:e}){return`/${e.attrs.name}`}}),me=new w(`composerSlashToken`),he=`composerSlashCommand`;function ge(e){return e.storage[he]}function _e(e){return ge(e)?.commands??null}function ve(e,t){let n=ge(e);return n===void 0||n.commands===t?!1:(n.commands=t,!0)}function ye(e,t){let n=t.trim().toLowerCase();if(n===``)return[...e];let r=[],i=[],a=[];for(let t of e){let e=t.name.toLowerCase();e.startsWith(n)?r.push(t):e.includes(n)?i.push(t):t.description.toLowerCase().includes(n)&&a.push(t)}return[...r,...i,...a]}function be(e){let t=/^\/(\S+)/.exec(e);return t===null?null:{name:t[1]??``,length:t[0].length}}function xe(e,t){let n=be(e);if(n===null||t===null)return null;let r=t.find(e=>e.name===n.name);return r===void 0?{kind:`unknown`,name:n.name,agentHasCommands:t.length>0}:{kind:`known`,name:r.name,description:r.description}}function Se(e){return Ce(e.state.doc.firstChild)}function Ce(e){let t=e?.firstChild??null;return t?.isText?t.text??``:``}function we(e,t){let n=e.firstChild,r=n?.firstChild??null;if(r!==null&&r.type.name===`composerCommand`){if(!De(e))return T.empty;let t=String(r.attrs.hint??``),i=String(r.attrs.description??``),a=t===``?i===``?``:`— ${i}`:t;return a===``?T.empty:T.create(e,[Te(1+(n?.content.size??0),a,String(r.attrs.name))])}if(t===null)return T.empty;let i=be(Ce(e.firstChild));if(i===null)return T.empty;let a=t.find(e=>e.name===i.name),o=[ne.inline(1,1+i.length,{class:a===void 0?`composer-slash-token composer-slash-token-unknown`:`composer-slash-token composer-slash-token-known`})];if(a!==void 0&&Ee(e,i.length)){let t=a.input?.hint!=null&&a.input.hint!==``?a.input.hint:`— ${a.description}`;(a.description!==``||a.input?.hint)&&o.push(Te(1+(e.firstChild?.firstChild?.nodeSize??0),t,a.name))}return T.create(e,o)}function Te(e,t,n){return ne.widget(e,()=>{let e=document.createElement(`span`);return e.className=`composer-slash-ghost`,e.setAttribute(`aria-hidden`,`true`),e.textContent=t,e},{side:1,key:`slash-ghost:${n}`})}function Ee(e,t){if(e.childCount!==1)return!1;let n=e.firstChild;if(n===null||n.childCount!==1)return!1;let r=n.firstChild;if(r===null||!r.isText)return!1;let i=r.text??``;return i.length<=t+1&&(i.length===t||i.endsWith(` `))}function De(e){if(e.childCount!==1)return!1;let t=e.firstChild;if(t===null)return!1;if(t.childCount===1)return!0;if(t.childCount!==2)return!1;let n=t.child(1);return n.isText&&/^\s*$/.test(n.text??``)}var Oe=A.create({name:he,addOptions(){return{commands:null}},addStorage(){return{commands:this.options.commands}},addProseMirrorPlugins(){let e=this.storage,t=()=>e.commands??null;return[new M({key:me,state:{init:(e,n)=>we(n.doc,t()),apply:e=>we(e.doc,t())},props:{decorations(e){return this.getState(e)}}}),f({editor:this.editor,pluginKey:fe,char:`/`,startOfLine:!0,allow:({range:e})=>e.from===1,items:({query:e})=>{let n=t();return n===null||n.length===0?[]:ye(n,e)},command:({editor:e,range:t,props:n})=>{let r=e.state.doc.firstChild?.firstChild??null,i=r?.isText?be(r.text??``)?.length??0:0;try{e.chain().focus().deleteRange({from:t.from,to:Math.max(t.to,1+i)}).insertContent([{type:`composerCommand`,attrs:{name:n.name,description:n.description,hint:n.input?.hint??``}},{type:`text`,text:` `}]).run()}catch(e){console.error(`[composer-slash-command] insert failed`,{item:n,range:t},e)}},render:()=>{let e=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=null,s=e=>{n?.command(e)},c=e=>{o=e.editor.view,d(o,(e.items??[]).length)},l=e=>({items:e.items??[],query:e.query??``,selectedIndex:r,onSelect:s,commandsKnown:t()!==null}),u=()=>{!e||!n||e.updateProps(l(n))};return{onBeforeStart(t){n=t,r=0,c(t);let o=h(()=>n,`composer-slash`);i.popup=o.popup,a=o.doPosition,e=new m(de,{props:l(t),editor:t.editor}),o.popup.appendChild(e.element),i.stopAutoUpdate=o.startAutoUpdate(),o.reveal()},onStart(e){n=e,r=0,c(e),u()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),c(e),u(),a?.()},onKeyDown({event:e}){if(!n)return!1;let t=n.items;if(e.key===`ArrowDown`)return t.length===0?!1:(r=(r+1)%t.length,u(),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(r=(r-1+t.length)%t.length,u(),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e?(n.command(e),!0):!1}return!1},onExit(){x(i),a=null,e?.destroy(),e=null,n=null,r=0,o!==null&&(p(o),o=null)}}}})]}}),ke=8,Ae=new w(`composerMentionSuggestion`);function je(e){return e.kind===`asset`?e.docName.replace(/^\//,``):e.kind===`folder`?e.docName:P(e.docName)}var Me=O.create({name:`doc`,topNode:!0,content:`paragraph+`}),Ne=O.create({name:`paragraph`,group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML(){return[`p`,0]}}),Pe=O.create({name:`text`,group:`inline`}),Fe=O.create({name:`hardBreak`,group:`inline`,inline:!0,selectable:!1,parseHTML(){return[{tag:`br`}]},renderHTML(){return[`br`]},addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.commands.insertContent({type:`hardBreak`})}}}),Ie=A.create({name:`composerHistory`,addProseMirrorPlugins(){return[C(),te({"Mod-z":j,"Mod-y":D,"Shift-Mod-z":D})]}}),Le=O.create({name:`composerMention`,group:`inline`,inline:!0,atom:!0,selectable:!0,addAttributes(){return{path:{default:``},label:{default:``},mentionKind:{default:`file`}}},parseHTML(){return[{tag:`span[data-composer-mention]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.label||e.attrs.path);return[`span`,k(t,{"data-composer-mention":String(e.attrs.path??``),class:`composer-mention-chip`}),`@${n}`]},renderText({node:e}){return`@${e.attrs.path}`},addNodeView(){return({node:e,editor:t,getPos:n})=>{let a=String(e.attrs.path??``),o=String(e.attrs.label||e.attrs.path),s=document.createElement(`span`);s.className=`composer-mention-chip group/mention`,s.setAttribute(`data-composer-mention`,a),s.title=o;let c=document.createElement(`button`);c.type=`button`,c.className=`composer-mention-icon`,c.setAttribute(`aria-label`,N._({id:`Xzy0s0`,values:{fullLabel:o}}));let l=document.createElement(`span`);l.className=`composer-mention-glyph composer-mention-glyph-icon`,l.setAttribute(`aria-hidden`,`true`),l.innerHTML=r(a),c.appendChild(l);let u=document.createElement(`span`);u.className=`composer-mention-glyph composer-mention-glyph-x`,u.setAttribute(`aria-hidden`,`true`),u.innerHTML=i(I),c.appendChild(u),c.addEventListener(`mousedown`,e=>e.preventDefault()),c.addEventListener(`click`,r=>{r.preventDefault();let i=typeof n==`function`?n():null;i!=null&&t.chain().focus().deleteRange({from:i,to:i+e.nodeSize}).run()}),s.appendChild(c);let d=document.createElement(`span`);return d.className=`composer-mention-label`,d.textContent=o,s.appendChild(d),{dom:s}}},addProseMirrorPlugins(){return[Be(this.editor)]}});function Re(e){return[Me,Ne,Pe,Fe,Ie,Le,pe,...e?.slashCommands===void 0?[]:[Oe.configure({commands:e.slashCommands})],...e?.placeholder?[ce.configure({placeholder:e.placeholder,showOnlyWhenEditable:!1})]:[]]}function ze(e=()=>y({includeFolders:!0})){let t=[],n=!1,r=null,i=!1;return{snapshot(){return{loaded:n,error:i}},async getItems(a){if(!n){r||=e();try{t=await r,n=!0,i=!1}catch(e){console.error(`[composer-mention] failed to fetch pages`,e),t=[],i=!0}finally{r=null}}return b(t,a).map(e=>({docName:e.docName,title:e.title,path:je(e),kind:e.kind===`folder`?`folder`:`file`})).filter(e=>e.path!==``)},reset(){t=[],n=!1,r=null,i=!1}}}function Be(e){let t=ze();return f({editor:e,pluginKey:Ae,char:`@`,items:({query:e})=>t.getItems(e),command:({editor:e,range:t,props:n})=>{try{e.chain().focus().deleteRange(t).insertContent([{type:`composerMention`,attrs:{path:n.path,label:n.title,mentionKind:n.kind}},{type:`text`,text:` `}]).run()}catch(e){console.error(`[composer-mention] insert failed`,{item:n,range:t},e)}},render:()=>{let e=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=null,s=null,c=e=>{n?.command(e)},l=e=>{s=e.editor.view,d(s,(e.items??[]).length)},u=e=>{let n=e.items??[],{loaded:i,error:a}=t.snapshot();return{items:n,query:e.query??``,selectedIndex:r,onSelect:c,loading:!i&&!a,error:a,hasMore:n.length>=ke}},f=()=>{!e||!n||e.updateProps(u(n))};return{onBeforeStart(t){n=t,r=0,l(t);let s=h(()=>n,`composer-mention`);i.popup=s.popup,a=s.doPosition,o=s.reveal,e=new m(ue,{props:u(t),editor:t.editor}),s.popup.appendChild(e.element),i.stopAutoUpdate=s.startAutoUpdate()},onStart(e){n=e,r=0,l(e),f(),o?.()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),l(e),f(),a?.()},onKeyDown({event:e}){if(!n)return!1;let t=n.items;if(e.key===`ArrowDown`)return t.length===0?!1:(r=(r+1)%t.length,f(),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(r=(r-1+t.length)%t.length,f(),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e?(n.command(e),!0):!1}return!1},onExit(){x(i),a=null,o=null,e?.destroy(),e=null,n=null,r=0,s!==null&&(p(s),s=null),t.reset()}}}})}function Q(e){let t=[],n=[],r=new Set,i=[];return e.state.doc.forEach(e=>{let a=``;e.forEach(e=>{if(e.type.name===`composerMention`){let i=String(e.attrs.path??``);if(i!==``&&(a+=`@${i}`,!r.has(i))){r.add(i),t.push(i);let a=String(e.attrs.label??``),o=e.attrs.mentionKind===`folder`?`folder`:`file`;n.push({kind:o,path:i,name:a===``?i:a})}}else e.type.name===`composerCommand`?a+=`/${String(e.attrs.name??``)}`:e.isText?a+=e.text??``:e.type.name===`hardBreak`&&(a+=`
|
|
1
|
+
import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Zt as n,en as r,tn as i}from"./DocumentContext-DuId1ipA.js";import{t as a}from"./react-f2sANaYj.js";import{r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./utils-CPqDy6Hr.js";import{r as l,t as u}from"./button-CA0dewJJ.js";import{B as d,K as f,L as p,Q as m,R as h,V as g,et as _,f as v,l as y,q as ee,u as b,z as x}from"./CodeMirrorPropInput-Cw-cqnG9.js";import{t as S}from"./separator-BM37WC0d.js";import{$i as C,Ba as w,Fa as T,Na as te,Pa as ne,Qi as E,ea as D,fa as O,ka as k,la as A,ta as j,za as M}from"./dist-Dkm48MhE.js";import{t as N}from"./dist-XgwTV-oh2.js";import{t as P}from"./workspace-paths-CKUFX0v6.js";import{t as F}from"./createLucideIcon-Bhw2PmPp.js";import{t as I}from"./x-DddVxTPq.js";var L=F(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),R=s(),z=t(),B=l(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function V(e){let t=(0,R.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=c(B({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==i||t[9]!==a?(o=(0,z.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":r,className:a,...i}),t[7]=r,t[8]=i,t[9]=a,t[10]=o):o=t[10],o}function re(e){let t=(0,R.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,o;t[4]===n?o=t[5]:(o=c(`relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,z.jsx)(S,{"data-slot":`button-group-separator`,orientation:a,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}var H=e(a(),1),U=`ok-ask-ai-draft-v2`,W={doc:null,dismissed:!1};function G(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}var K=null,q=new Set;function J(e){if(e===null)return!0;let t=e.content;return!Array.isArray(t)||t.length===0?!0:t.every(e=>{let t=e.content;return!Array.isArray(t)||t.length===0})}function Y(){let e=G();if(!e)return W;try{let t=e.getItem(U);if(!t)return W;let n=JSON.parse(t);return typeof n!=`object`||!n||Array.isArray(n)?W:{doc:n,dismissed:!1}}catch(e){return console.warn(`failed to parse stored draft — clearing`,e),W}}function X(){return K===null&&(K=Y()),K}function Z(e){let t=G();if(t)try{e&&!J(e)?t.setItem(U,JSON.stringify(e)):t.removeItem(U)}catch{}}function ie(){for(let e of q)e()}function ae(){return X()}function oe(e){let t=e&&!J(e)?e:null;K={...X(),doc:t},Z(t),ie()}function se(){oe(null)}var ce=E;function le(e){let t=v(e).kind;return t===`folder`||t===`asset`?t:`page`}function ue(e){let t=(0,R.c)(14),{items:r,query:i,selectedIndex:a,onSelect:s,loading:c,error:l,hasMore:u}=e,d=c===void 0?!1:c,f=l===void 0?!1:l,p=u===void 0?!1:u,{_:m}=o(),h=(0,H.useId)(),g=(0,H.useRef)(null),_,v;t[0]===a?(_=t[1],v=t[2]):(_=()=>{(g.current?.querySelectorAll(`[role="option"]`))?.item(a)?.scrollIntoView({block:`nearest`})},v=[a],t[0]=a,t[1]=_,t[2]=v),(0,H.useEffect)(_,v);let y=a>=0&&a<r.length?r[a]:null,ee;return t[3]!==m||t[4]!==f||t[5]!==p||t[6]!==r||t[7]!==h||t[8]!==d||t[9]!==s||t[10]!==i||t[11]!==a||t[12]!==y?(ee=(0,z.jsx)(`div`,{ref:g,className:`w-80 max-w-[min(28rem,90vw)] overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:d?(0,z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:m({id:`3m2GBo`})}):f?(0,z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`assertive`,children:m({id:`weP6me`})}):r.length===0?(0,z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:i.trim()===``?m({id:`0E9DR6`}):m({id:`yQyglE`})}):(0,z.jsxs)(`div`,{role:`listbox`,id:h,"aria-label":m({id:`05n5wS`}),tabIndex:-1,className:`max-h-64 overflow-y-auto overscroll-contain subtle-scrollbar`,children:[(0,z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:y?y.title:``}),r.map((e,t)=>{let r=t===a,i=le(e.path),o=i===`folder`,c=o?`${e.path}/`:e.path;return(0,z.jsxs)(`button`,{id:`${h}-option-${t}`,type:`button`,role:`option`,"aria-selected":r,"data-active":r,"data-mention-kind":i,"data-testid":`composer-mention-option-${e.docName}`,className:`flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left ${r?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),s(e)},children:[(0,z.jsx)(n,{path:e.path,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,z.jsxs)(`span`,{className:`flex items-baseline gap-1.5`,children:[(0,z.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.title}),o?(0,z.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:m({id:`kNqMMd`})}):null]}),(0,z.jsx)(`span`,{className:`line-clamp-2 break-all text-xs text-muted-foreground`,children:c})]})]},e.docName)}),p?(0,z.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,"aria-hidden":!0,children:m({id:`F1T9y_`})}):null]})}),t[3]=m,t[4]=f,t[5]=p,t[6]=r,t[7]=h,t[8]=d,t[9]=s,t[10]=i,t[11]=a,t[12]=y,t[13]=ee):ee=t[13],ee}function de(e){let t=(0,R.c)(12),{items:n,query:r,selectedIndex:i,onSelect:a,commandsKnown:s}=e,{_:c}=o(),l=(0,H.useId)(),u=(0,H.useRef)(null),d,f;t[0]===i?(d=t[1],f=t[2]):(d=()=>{(u.current?.querySelectorAll(`[role="option"]`))?.item(i)?.scrollIntoView({block:`nearest`})},f=[i],t[0]=i,t[1]=d,t[2]=f),(0,H.useEffect)(d,f);let p=i>=0&&i<n.length?n[i]:null,m;return t[3]!==c||t[4]!==s||t[5]!==n||t[6]!==l||t[7]!==a||t[8]!==r||t[9]!==i||t[10]!==p?(m=(0,z.jsx)(`div`,{ref:u,"data-testid":`composer-slash-menu`,className:`w-[42rem] max-w-[min(42rem,90vw)] overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:n.length===0?(0,z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:s?r.trim()===``?c({id:`QohqVL`}):c({id:`odYWGJ`}):c({id:`9OPs7U`})}):(0,z.jsxs)(`div`,{role:`listbox`,id:l,"aria-label":c({id:`67Dpmh`}),tabIndex:-1,className:`max-h-64 overflow-y-auto overscroll-contain subtle-scrollbar`,children:[(0,z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:p?`/${p.name}`:``}),n.map((e,t)=>{let n=t===i;return(0,z.jsxs)(`button`,{id:`${l}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-active":n,"data-testid":`composer-slash-option-${e.name}`,className:`flex w-full items-baseline gap-2 rounded-md px-2 py-1.5 text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,z.jsxs)(`span`,{className:`shrink-0 font-mono text-sm font-medium`,children:[`/`,e.name]}),(0,z.jsx)(`span`,{className:`line-clamp-2 min-w-0 flex-1 text-xs text-muted-foreground`,children:e.description})]},e.name)})]})}),t[3]=c,t[4]=s,t[5]=n,t[6]=l,t[7]=a,t[8]=r,t[9]=i,t[10]=p,t[11]=m):m=t[11],m}var fe=new w(`composerSlashSuggestion`),pe=O.create({name:`composerCommand`,group:`inline`,inline:!0,atom:!0,selectable:!1,addAttributes(){return{name:{default:``},description:{default:``},hint:{default:``}}},parseHTML(){return[{tag:`span[data-composer-command]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.name??``);return[`span`,k(t,{"data-composer-command":n,class:`composer-slash-token composer-slash-token-known`}),`/${n}`]},renderText({node:e}){return`/${e.attrs.name}`}}),me=new w(`composerSlashToken`),he=`composerSlashCommand`;function ge(e){return e.storage[he]}function _e(e){return ge(e)?.commands??null}function ve(e,t){let n=ge(e);return n===void 0||n.commands===t?!1:(n.commands=t,!0)}function ye(e,t){let n=t.trim().toLowerCase();if(n===``)return[...e];let r=[],i=[],a=[];for(let t of e){let e=t.name.toLowerCase();e.startsWith(n)?r.push(t):e.includes(n)?i.push(t):t.description.toLowerCase().includes(n)&&a.push(t)}return[...r,...i,...a]}function be(e){let t=/^\/(\S+)/.exec(e);return t===null?null:{name:t[1]??``,length:t[0].length}}function xe(e,t){let n=be(e);if(n===null||t===null)return null;let r=t.find(e=>e.name===n.name);return r===void 0?{kind:`unknown`,name:n.name,agentHasCommands:t.length>0}:{kind:`known`,name:r.name,description:r.description}}function Se(e){return Ce(e.state.doc.firstChild)}function Ce(e){let t=e?.firstChild??null;return t?.isText?t.text??``:``}function we(e,t){let n=e.firstChild,r=n?.firstChild??null;if(r!==null&&r.type.name===`composerCommand`){if(!De(e))return T.empty;let t=String(r.attrs.hint??``),i=String(r.attrs.description??``),a=t===``?i===``?``:`— ${i}`:t;return a===``?T.empty:T.create(e,[Te(1+(n?.content.size??0),a,String(r.attrs.name))])}if(t===null)return T.empty;let i=be(Ce(e.firstChild));if(i===null)return T.empty;let a=t.find(e=>e.name===i.name),o=[ne.inline(1,1+i.length,{class:a===void 0?`composer-slash-token composer-slash-token-unknown`:`composer-slash-token composer-slash-token-known`})];if(a!==void 0&&Ee(e,i.length)){let t=a.input?.hint!=null&&a.input.hint!==``?a.input.hint:`— ${a.description}`;(a.description!==``||a.input?.hint)&&o.push(Te(1+(e.firstChild?.firstChild?.nodeSize??0),t,a.name))}return T.create(e,o)}function Te(e,t,n){return ne.widget(e,()=>{let e=document.createElement(`span`);return e.className=`composer-slash-ghost`,e.setAttribute(`aria-hidden`,`true`),e.textContent=t,e},{side:1,key:`slash-ghost:${n}`})}function Ee(e,t){if(e.childCount!==1)return!1;let n=e.firstChild;if(n===null||n.childCount!==1)return!1;let r=n.firstChild;if(r===null||!r.isText)return!1;let i=r.text??``;return i.length<=t+1&&(i.length===t||i.endsWith(` `))}function De(e){if(e.childCount!==1)return!1;let t=e.firstChild;if(t===null)return!1;if(t.childCount===1)return!0;if(t.childCount!==2)return!1;let n=t.child(1);return n.isText&&/^\s*$/.test(n.text??``)}var Oe=A.create({name:he,addOptions(){return{commands:null}},addStorage(){return{commands:this.options.commands}},addProseMirrorPlugins(){let e=this.storage,t=()=>e.commands??null;return[new M({key:me,state:{init:(e,n)=>we(n.doc,t()),apply:e=>we(e.doc,t())},props:{decorations(e){return this.getState(e)}}}),f({editor:this.editor,pluginKey:fe,char:`/`,startOfLine:!0,allow:({range:e})=>e.from===1,items:({query:e})=>{let n=t();return n===null||n.length===0?[]:ye(n,e)},command:({editor:e,range:t,props:n})=>{let r=e.state.doc.firstChild?.firstChild??null,i=r?.isText?be(r.text??``)?.length??0:0;try{e.chain().focus().deleteRange({from:t.from,to:Math.max(t.to,1+i)}).insertContent([{type:`composerCommand`,attrs:{name:n.name,description:n.description,hint:n.input?.hint??``}},{type:`text`,text:` `}]).run()}catch(e){console.error(`[composer-slash-command] insert failed`,{item:n,range:t},e)}},render:()=>{let e=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=null,s=e=>{n?.command(e)},c=e=>{o=e.editor.view,d(o,(e.items??[]).length)},l=e=>({items:e.items??[],query:e.query??``,selectedIndex:r,onSelect:s,commandsKnown:t()!==null}),u=()=>{!e||!n||e.updateProps(l(n))};return{onBeforeStart(t){n=t,r=0,c(t);let o=h(()=>n,`composer-slash`);i.popup=o.popup,a=o.doPosition,e=new m(de,{props:l(t),editor:t.editor}),o.popup.appendChild(e.element),i.stopAutoUpdate=o.startAutoUpdate(),o.reveal()},onStart(e){n=e,r=0,c(e),u()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),c(e),u(),a?.()},onKeyDown({event:e}){if(!n)return!1;let t=n.items;if(e.key===`ArrowDown`)return t.length===0?!1:(r=(r+1)%t.length,u(),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(r=(r-1+t.length)%t.length,u(),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e?(n.command(e),!0):!1}return!1},onExit(){x(i),a=null,e?.destroy(),e=null,n=null,r=0,o!==null&&(p(o),o=null)}}}})]}}),ke=8,Ae=new w(`composerMentionSuggestion`);function je(e){return e.kind===`asset`?e.docName.replace(/^\//,``):e.kind===`folder`?e.docName:P(e.docName)}var Me=O.create({name:`doc`,topNode:!0,content:`paragraph+`}),Ne=O.create({name:`paragraph`,group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML(){return[`p`,0]}}),Pe=O.create({name:`text`,group:`inline`}),Fe=O.create({name:`hardBreak`,group:`inline`,inline:!0,selectable:!1,parseHTML(){return[{tag:`br`}]},renderHTML(){return[`br`]},addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.commands.insertContent({type:`hardBreak`})}}}),Ie=A.create({name:`composerHistory`,addProseMirrorPlugins(){return[C(),te({"Mod-z":j,"Mod-y":D,"Shift-Mod-z":D})]}}),Le=O.create({name:`composerMention`,group:`inline`,inline:!0,atom:!0,selectable:!0,addAttributes(){return{path:{default:``},label:{default:``},mentionKind:{default:`file`}}},parseHTML(){return[{tag:`span[data-composer-mention]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.label||e.attrs.path);return[`span`,k(t,{"data-composer-mention":String(e.attrs.path??``),class:`composer-mention-chip`}),`@${n}`]},renderText({node:e}){return`@${e.attrs.path}`},addNodeView(){return({node:e,editor:t,getPos:n})=>{let a=String(e.attrs.path??``),o=String(e.attrs.label||e.attrs.path),s=document.createElement(`span`);s.className=`composer-mention-chip group/mention`,s.setAttribute(`data-composer-mention`,a),s.title=o;let c=document.createElement(`button`);c.type=`button`,c.className=`composer-mention-icon`,c.setAttribute(`aria-label`,N._({id:`Xzy0s0`,values:{fullLabel:o}}));let l=document.createElement(`span`);l.className=`composer-mention-glyph composer-mention-glyph-icon`,l.setAttribute(`aria-hidden`,`true`),l.innerHTML=r(a),c.appendChild(l);let u=document.createElement(`span`);u.className=`composer-mention-glyph composer-mention-glyph-x`,u.setAttribute(`aria-hidden`,`true`),u.innerHTML=i(I),c.appendChild(u),c.addEventListener(`mousedown`,e=>e.preventDefault()),c.addEventListener(`click`,r=>{r.preventDefault();let i=typeof n==`function`?n():null;i!=null&&t.chain().focus().deleteRange({from:i,to:i+e.nodeSize}).run()}),s.appendChild(c);let d=document.createElement(`span`);return d.className=`composer-mention-label`,d.textContent=o,s.appendChild(d),{dom:s}}},addProseMirrorPlugins(){return[Be(this.editor)]}});function Re(e){return[Me,Ne,Pe,Fe,Ie,Le,pe,...e?.slashCommands===void 0?[]:[Oe.configure({commands:e.slashCommands})],...e?.placeholder?[ce.configure({placeholder:e.placeholder,showOnlyWhenEditable:!1})]:[]]}function ze(e=()=>y({includeFolders:!0})){let t=[],n=!1,r=null,i=!1;return{snapshot(){return{loaded:n,error:i}},async getItems(a){if(!n){r||=e();try{t=await r,n=!0,i=!1}catch(e){console.error(`[composer-mention] failed to fetch pages`,e),t=[],i=!0}finally{r=null}}return b(t,a).map(e=>({docName:e.docName,title:e.title,path:je(e),kind:e.kind===`folder`?`folder`:`file`})).filter(e=>e.path!==``)},reset(){t=[],n=!1,r=null,i=!1}}}function Be(e){let t=ze();return f({editor:e,pluginKey:Ae,char:`@`,items:({query:e})=>t.getItems(e),command:({editor:e,range:t,props:n})=>{try{e.chain().focus().deleteRange(t).insertContent([{type:`composerMention`,attrs:{path:n.path,label:n.title,mentionKind:n.kind}},{type:`text`,text:` `}]).run()}catch(e){console.error(`[composer-mention] insert failed`,{item:n,range:t},e)}},render:()=>{let e=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=null,s=null,c=e=>{n?.command(e)},l=e=>{s=e.editor.view,d(s,(e.items??[]).length)},u=e=>{let n=e.items??[],{loaded:i,error:a}=t.snapshot();return{items:n,query:e.query??``,selectedIndex:r,onSelect:c,loading:!i&&!a,error:a,hasMore:n.length>=ke}},f=()=>{!e||!n||e.updateProps(u(n))};return{onBeforeStart(t){n=t,r=0,l(t);let s=h(()=>n,`composer-mention`);i.popup=s.popup,a=s.doPosition,o=s.reveal,e=new m(ue,{props:u(t),editor:t.editor}),s.popup.appendChild(e.element),i.stopAutoUpdate=s.startAutoUpdate()},onStart(e){n=e,r=0,l(e),f(),o?.()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),l(e),f(),a?.()},onKeyDown({event:e}){if(!n)return!1;let t=n.items;if(e.key===`ArrowDown`)return t.length===0?!1:(r=(r+1)%t.length,f(),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(r=(r-1+t.length)%t.length,f(),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e?(n.command(e),!0):!1}return!1},onExit(){x(i),a=null,o=null,e?.destroy(),e=null,n=null,r=0,s!==null&&(p(s),s=null),t.reset()}}}})}function Q(e){let t=[],n=[],r=new Set,i=[];return e.state.doc.forEach(e=>{let a=``;e.forEach(e=>{if(e.type.name===`composerMention`){let i=String(e.attrs.path??``);if(i!==``&&(a+=`@${i}`,!r.has(i))){r.add(i),t.push(i);let a=String(e.attrs.label??``),o=e.attrs.mentionKind===`folder`?`folder`:`file`;n.push({kind:o,path:i,name:a===``?i:a})}}else e.type.name===`composerCommand`?a+=`/${String(e.attrs.name??``)}`:e.isText?a+=e.text??``:e.type.name===`hardBreak`&&(a+=`
|
|
2
2
|
`)}),i.push(a)}),{instruction:i.join(`
|
|
3
3
|
`).trim(),mentions:t,attachments:n}}function Ve(e){let{instruction:t,mentions:n}=Q(e);return t===``&&n.length===0}function He(e){let t=e?.content;return!Array.isArray(t)||t.length===0?!1:t.some(e=>Array.isArray(e.content)&&e.content.length>0)}function Ue(e){return e.split(`
|
|
4
|
-
`).map(e=>({type:`paragraph`,content:e===``?[]:[{type:`text`,text:e}]}))}function We(e){let t=(0,R.c)(55),{ref:n,ariaLabel:r,onEmptyChange:i,onContentChange:a,onMentionsChange:s,onSubmit:l,onEscape:u,className:d,placeholder:f,initialDoc:p,disabled:m,testId:h,slashCommands:v}=e,y=m===void 0?!1:m,{_:b}=o(),[x,S]=(0,H.useState)(null),C=(0,H.useRef)(i),w=(0,H.useRef)(a),T=(0,H.useRef)(s),te=(0,H.useRef)(l),ne=(0,H.useRef)(u),E;t[0]!==a||t[1]!==i||t[2]!==u||t[3]!==s||t[4]!==l?(E=()=>{C.current=i,w.current=a,T.current=s,te.current=l,ne.current=u},t[0]=a,t[1]=i,t[2]=u,t[3]=s,t[4]=l,t[5]=E):E=t[5],(0,H.useEffect)(E);let D;t[6]!==f||t[7]!==v?(D=Re({placeholder:f,slashCommands:v}),t[6]=f,t[7]=v,t[8]=D):D=t[8];let O=p??void 0,k=!y,A;t[9]===h?A=t[10]:(A=h===void 0?{}:{"data-testid":h},t[9]=h,t[10]=A);let j;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(j=c(`composer-prosemirror py-1 outline-none`),t[11]=j):j=t[11];let M;t[12]!==r||t[13]!==A?(M={role:`textbox`,"aria-label":r,"aria-multiline":`true`,...A,class:j},t[12]=r,t[13]=A,t[14]=M):M=t[14];let N;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(N=(e,t)=>t.key===`Escape`?Ae.getState(e.state)?.active||fe.getState(e.state)?.active?!1:ne.current===void 0?(e.dom.blur(),!0):(ne.current(),!0):t.key===`Enter`&&!t.shiftKey&&!t.isComposing&&!e.composing?(Ae.getState(e.state)?.active||fe.getState(e.state)?.active)&&g(e)?!1:(te.current(),!0):!1,t[15]=N):N=t[15];let P;t[16]===M?P=t[17]:(P={attributes:M,handleKeyDown:N},t[16]=M,t[17]=P);let F;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{let{editor:t}=e;C.current(Ve(t)),w.current?.(t.getJSON()),T.current?.(Q(t).mentions),S(xe(Se(t),_e(t)))},t[18]=F):F=t[18];let I;t[19]!==P||t[20]!==D||t[21]!==O||t[22]!==k?(I={extensions:D,content:O,immediatelyRender:!0,editable:k,editorProps:P,onUpdate:F},t[19]=P,t[20]=D,t[21]=O,t[22]=k,t[23]=I):I=t[23];let L=_(I),B,V;t[24]!==r||t[25]!==L||t[26]!==f?(B=()=>{if(!L||L.isDestroyed)return;let e=L.extensionManager.extensions.find(Ge);e&&(e.options.placeholder=f??``);let t=L.editorView;t&&(t.dom.setAttribute(`aria-label`,r??``),t.dispatch(L.state.tr.setMeta(`addToHistory`,!1)))},V=[L,f,r],t[24]=r,t[25]=L,t[26]=f,t[27]=B,t[28]=V):(B=t[27],V=t[28]),(0,H.useEffect)(B,V);let re,U;t[29]!==y||t[30]!==L?(re=()=>{if(!L||L.isDestroyed)return;let e=!y;L.isEditable!==e&&L.setEditable(e,!1);let t=L.editorView;t&&(y?t.dom.setAttribute(`aria-disabled`,`true`):t.dom.removeAttribute(`aria-disabled`))},U=[L,y],t[29]=y,t[30]=L,t[31]=re,t[32]=U):(re=t[31],U=t[32]),(0,H.useEffect)(re,U);let W,G;t[33]!==L||t[34]!==v?(W=()=>{if(!(!L||L.isDestroyed)){if(ve(L,v??null)){let e=L.editorView;e&&e.dispatch(L.state.tr.setMeta(`addToHistory`,!1))}S(xe(Se(L),_e(L)))}},G=[L,v],t[33]=L,t[34]=v,t[35]=W,t[36]=G):(W=t[35],G=t[36]),(0,H.useEffect)(W,G);let K;t[37]!==L||t[38]!==p?(K=()=>{L&&(Ve(L)&&He(p)&&(console.warn(`composer draft was incompatible with the current schema — clearing it`),se()),C.current(Ve(L)),T.current?.(Q(L).mentions))},t[37]=L,t[38]=p,t[39]=K):K=t[39];let q;t[40]===L?q=t[41]:(q=[L],t[40]=L,t[41]=q),(0,H.useEffect)(K,q);let J,Y;t[42]===L?(J=t[43],Y=t[44]):(J=()=>({focus:()=>L?.commands.focus(),focusEnd:()=>L?.commands.focus(`end`),blur:()=>L?.commands.blur(),clear:()=>L?.commands.clearContent(!0),setText:e=>{L&&(L.commands.setContent(e),w.current?.(L.getJSON()),T.current?.(Q(L).mentions),S(xe(Se(L),_e(L))))},appendText:e=>{!L||e===``||(Ve(L)?L.commands.setContent(Ue(e)):L.commands.insertContentAt(L.state.doc.content.size,[{type:`paragraph`,content:[]},...Ue(e)]),C.current(Ve(L)),w.current?.(L.getJSON()),T.current?.(Q(L).mentions),S(xe(Se(L),_e(L))))},getContent:()=>L?Q(L):{instruction:``,mentions:[],attachments:[]},openMentionPicker:()=>{L&&L.chain().focus().insertContent(`@`).run()}}),Y=[L],t[42]=L,t[43]=J,t[44]=Y),(0,H.useImperativeHandle)(n,J,Y);let X;t[45]!==d||t[46]!==L?(X=(0,z.jsx)(ee,{editor:L,className:d}),t[45]=d,t[46]=L,t[47]=X):X=t[47];let Z;t[48]!==b||t[49]!==v||t[50]!==x?(Z=v===void 0?null:(0,z.jsx)(`p`,{className:c(`truncate px-2.5 text-xs text-muted-foreground`,x?.kind===`unknown`&&`pb-1`),"aria-live":`polite`,"aria-atomic":`true`,"data-testid":`composer-slash-hint`,children:x?.kind===`unknown`?x.agentHasCommands?b({id:`mBK8zm`,values:{0:x.name}}):b({id:`Q9AxTM`}):null}),t[48]=b,t[49]=v,t[50]=x,t[51]=Z):Z=t[51];let ie;return t[52]!==X||t[53]!==Z?(ie=(0,z.jsxs)(z.Fragment,{children:[X,Z]}),t[52]=X,t[53]=Z,t[54]=ie):ie=t[54],ie}function Ge(e){return e.name===`placeholder`}var Ke=`button, a[href], [role="menuitem"], [role="button"], input, textarea, select, [contenteditable="true"]`;function qe(e,t){if(!(e.target instanceof HTMLElement)||!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.contains(e.target)||e.target.closest(Ke))return;e.preventDefault();let n=t.current;n!==null&&(n.focusEnd===void 0?n.focus():n.focusEnd())}function Je(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Ye(e){let t=(0,R.c)(21),{path:r,onRemove:i}=e,{_:a}=o(),s,c;t[0]!==a||t[1]!==r?(s=Je(r),c=a({id:`hnq8fP`,values:{label:s}}),t[0]=a,t[1]=r,t[2]=s,t[3]=c):(s=t[2],c=t[3]);let l=c,d=`composer-context-chip-file-${r}`,f;t[4]===i?f=t[5]:(f=e=>{(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),i())},t[4]=i,t[5]=f);let p;t[6]===r?p=t[7]:(p=(0,z.jsx)(`span`,{className:`absolute top-1/2 left-1/2 inline-flex size-3 -translate-x-1/2 -translate-y-1/2 opacity-100 transition-opacity duration-150 ease-out group-hover/chip:opacity-0 group-focus-within/chip:opacity-0 motion-reduce:transition-none`,children:(0,z.jsx)(n,{path:r,className:`size-3`,showExtensionBadge:!1})}),t[6]=r,t[7]=p);let m;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,z.jsx)(I,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-150 ease-out group-hover/chip:opacity-100 group-focus-within/chip:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0}),t[8]=m):m=t[8];let h;t[9]!==i||t[10]!==l||t[11]!==f||t[12]!==p?(h=(0,z.jsxs)(u,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":l,onClick:i,onKeyDown:f,className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[p,m]}),t[9]=i,t[10]=l,t[11]=f,t[12]=p,t[13]=h):h=t[13];let g;t[14]===s?g=t[15]:(g=(0,z.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[14]=s,t[15]=g);let _;return t[16]!==r||t[17]!==d||t[18]!==h||t[19]!==g?(_=(0,z.jsxs)(`span`,{"data-testid":d,title:r,className:`group/chip inline-flex max-w-[14rem] items-center gap-1 rounded-md border bg-muted/40 py-0.5 pr-1.5 pl-1 text-muted-foreground text-xs`,children:[h,g]}),t[16]=r,t[17]=d,t[18]=h,t[19]=g,t[20]=_):_=t[20],_}function Xe(e){let t=(0,R.c)(13),{files:n,onRemoveFile:r,className:i,children:a}=e,o;t[0]===n?o=t[1]:(o=n===void 0?[]:n,t[0]=n,t[1]=o);let s=o;if(s.length===0&&H.Children.toArray(a).length===0)return null;let l;t[2]===i?l=t[3]:(l=c(`flex flex-wrap items-center gap-1`,i),t[2]=i,t[3]=l);let u;if(t[4]!==s||t[5]!==r){let e;t[7]===r?e=t[8]:(e=e=>(0,z.jsx)(Ye,{path:e,onRemove:()=>r?.(e)},e),t[7]=r,t[8]=e),u=s.map(e),t[4]=s,t[5]=r,t[6]=u}else u=t[6];let d;return t[9]!==a||t[10]!==l||t[11]!==u?(d=(0,z.jsxs)(`div`,{className:l,"data-testid":`composer-context-chips`,children:[u,a]}),t[9]=a,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function Ze(){let e=(0,R.c)(2),[t,n]=(0,H.useState)(Qe),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);n(e.matches);let t=e=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,H.useEffect)(r,i),t}function Qe(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function $(e,t){let n=e[t];return typeof n==`string`&&n!==``?n:null}function $e(e){if(typeof e!=`object`||!e)return null;let t=e,n=$(t,`tool`)??$(t,`name`),r=t;if(typeof t.arguments==`object`&&t.arguments!==null)r=t.arguments;else if(typeof t.arguments==`string`)try{let e=JSON.parse(t.arguments);typeof e==`object`&&e&&(r=e)}catch{}return{tool:n,args:r}}var et=`ok-acp-follow-file-v1`;function tt(){try{return localStorage.getItem(et)!==`0`}catch{return!0}}function nt(e){try{localStorage.setItem(et,e?`1`:`0`)}catch{}}function rt(e){return e===``||e.startsWith(`/`)||e.startsWith(`\\`)||e.split(`/`).some(e=>e===``||e.startsWith(`.`))?null:e}function it(e,t){let n=t.pathSeparator,r=e=>n===`\\`?e.replaceAll(`\\`,`/`):e,i=r(t.contentDir).replace(/\/$/,``),a=r(e);if(!a.startsWith(`${i}/`))return null;let o=a.slice(i.length+1),s=/\.(md|mdx)$/.exec(o);return s===null?null:rt(o.slice(0,-s[0].length))}var at=new Set([`cat`,`ls`,`grep`,`rg`,`find`,`head`,`tail`,`wc`,`sort`,`uniq`,`cut`,`sed`,`awk`,`bat`,`less`,`more`]);function ot(e,t){let n=[],r=/"([^"]*)"|'([^']*)'|(\S+)/g,i=r.exec(e);for(;i!==null;)n.push(i[1]??i[2]??i[3]??``),i=r.exec(e);let a=n[0];if(a===void 0||!at.has(a))return null;for(let e of n.slice(1)){if(e.startsWith(`-`)||/[*?[\]]/.test(e))continue;let n=/\.(md|mdx)$/i.exec(e);if(n===null)continue;if(e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)){if(t!==null){let n=it(e,t);if(n!==null)return n}continue}let r=rt(e.replace(/^\.\//,``).slice(0,-n[0].length));if(r!==null)return r}return null}function st(e){if(e===null||e.loading||e.error!==null)return{};let t=e.pages;return{docExists:e=>t.has(e)}}function ct(e,t,n,r){let i=$e(e);if(i===null)return null;let{tool:a,args:o}=i;if(a===`delete`||a===null&&/\bdelete\b/i.test(t))return null;let s=typeof o.document==`object`&&o.document!==null?o.document:null,c=null;if(Array.isArray(o.documents))for(let e=o.documents.length-1;e>=0;e--){let t=o.documents[e];if(typeof t==`object`&&t){c=t;break}}let l=(s===null?null:$(s,`path`))??(c===null?null:$(c,`path`))??$(o,`to`)??$(o,`docName`);if(l!==null)return rt(l.replace(/\.(md|mdx)$/,``));let u=$(o,`command`);if(u!==null){let e=ot(u,n);return e!==null&&r.docExists!==void 0&&!r.docExists(e)?null:e}return null}function lt(e,t,n={}){if(e.toolKind===`delete`)return null;let r=ct(e.rawInput,e.title,t,n);if(r!==null)return r;if(t===null)return null;let i=e.toolKind!==`edit`&&e.toolKind!==`move`&&n.docExists!==void 0;for(let r=e.locations.length-1;r>=0;r--){let a=e.locations[r];if(a===void 0)continue;let o=it(a.path,t);if(o!==null)return i&&!n.docExists?.(o)?null:o}return null}var ut={lastFollowed:null,yielded:!1,reArmed:!1};function dt(e,t,n){if(e===null||n.lastFollowed===e)return{navigateTo:null,state:n};if(n.lastFollowed!==null&&t!==null&&t!==n.lastFollowed&&t!==e&&!n.reArmed)return{navigateTo:null,state:{...n,yielded:!0}};if(n.yielded&&!n.reArmed)return{navigateTo:null,state:n};let r={lastFollowed:e,yielded:!1,reArmed:!1};return t===e?{navigateTo:null,state:r}:{navigateTo:e,state:r}}function ft(e,t,n={}){let r=null;for(let i of e){if(i.kind!==`tool_call`)continue;let e=lt(i,t,n);e!==null&&(r=e)}return r}export{oe as _,st as a,L as b,$ as c,Xe as d,qe as f,ae as g,se as h,tt as i,$e as l,ce as m,dt as n,rt as o,We as p,ft as r,nt as s,ut as t,Ze as u,V as v,re as y};
|
|
4
|
+
`).map(e=>({type:`paragraph`,content:e===``?[]:[{type:`text`,text:e}]}))}function We(e){let t=(0,R.c)(55),{ref:n,ariaLabel:r,onEmptyChange:i,onContentChange:a,onMentionsChange:s,onSubmit:l,onEscape:u,className:d,placeholder:f,initialDoc:p,disabled:m,testId:h,slashCommands:v}=e,y=m===void 0?!1:m,{_:b}=o(),[x,S]=(0,H.useState)(null),C=(0,H.useRef)(i),w=(0,H.useRef)(a),T=(0,H.useRef)(s),te=(0,H.useRef)(l),ne=(0,H.useRef)(u),E;t[0]!==a||t[1]!==i||t[2]!==u||t[3]!==s||t[4]!==l?(E=()=>{C.current=i,w.current=a,T.current=s,te.current=l,ne.current=u},t[0]=a,t[1]=i,t[2]=u,t[3]=s,t[4]=l,t[5]=E):E=t[5],(0,H.useEffect)(E);let D;t[6]!==f||t[7]!==v?(D=Re({placeholder:f,slashCommands:v}),t[6]=f,t[7]=v,t[8]=D):D=t[8];let O=p??void 0,k=!y,A;t[9]===h?A=t[10]:(A=h===void 0?{}:{"data-testid":h},t[9]=h,t[10]=A);let j;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(j=c(`composer-prosemirror py-1 outline-none`),t[11]=j):j=t[11];let M;t[12]!==r||t[13]!==A?(M={role:`textbox`,"aria-label":r,"aria-multiline":`true`,...A,class:j},t[12]=r,t[13]=A,t[14]=M):M=t[14];let N;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(N=(e,t)=>t.key===`Escape`?Ae.getState(e.state)?.active||fe.getState(e.state)?.active?!1:ne.current===void 0?(e.dom.blur(),!0):(ne.current(),!0):t.key===`Enter`&&!t.shiftKey&&!t.isComposing&&!e.composing?(Ae.getState(e.state)?.active||fe.getState(e.state)?.active)&&g(e)?!1:(te.current(),!0):!1,t[15]=N):N=t[15];let P;t[16]===M?P=t[17]:(P={attributes:M,handleKeyDown:N},t[16]=M,t[17]=P);let F;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(F=e=>{let{editor:t}=e;C.current(Ve(t)),w.current?.(t.getJSON()),T.current?.(Q(t).mentions),S(xe(Se(t),_e(t)))},t[18]=F):F=t[18];let I;t[19]!==P||t[20]!==D||t[21]!==O||t[22]!==k?(I={extensions:D,content:O,immediatelyRender:!0,editable:k,editorProps:P,onUpdate:F},t[19]=P,t[20]=D,t[21]=O,t[22]=k,t[23]=I):I=t[23];let L=_(I),B,V;t[24]!==r||t[25]!==L||t[26]!==f?(B=()=>{if(!L||L.isDestroyed)return;let e=L.extensionManager.extensions.find(Ge);e&&(e.options.placeholder=f??``);let t=L.editorView;t&&(t.dom.setAttribute(`aria-label`,r??``),t.dispatch(L.state.tr.setMeta(`addToHistory`,!1)))},V=[L,f,r],t[24]=r,t[25]=L,t[26]=f,t[27]=B,t[28]=V):(B=t[27],V=t[28]),(0,H.useEffect)(B,V);let re,U;t[29]!==y||t[30]!==L?(re=()=>{if(!L||L.isDestroyed)return;let e=!y;L.isEditable!==e&&L.setEditable(e,!1);let t=L.editorView;t&&(y?t.dom.setAttribute(`aria-disabled`,`true`):t.dom.removeAttribute(`aria-disabled`))},U=[L,y],t[29]=y,t[30]=L,t[31]=re,t[32]=U):(re=t[31],U=t[32]),(0,H.useEffect)(re,U);let W,G;t[33]!==L||t[34]!==v?(W=()=>{if(!(!L||L.isDestroyed)){if(ve(L,v??null)){let e=L.editorView;e&&e.dispatch(L.state.tr.setMeta(`addToHistory`,!1))}S(xe(Se(L),_e(L)))}},G=[L,v],t[33]=L,t[34]=v,t[35]=W,t[36]=G):(W=t[35],G=t[36]),(0,H.useEffect)(W,G);let K;t[37]!==L||t[38]!==p?(K=()=>{L&&(Ve(L)&&He(p)&&(console.warn(`composer draft was incompatible with the current schema — clearing it`),se()),C.current(Ve(L)),T.current?.(Q(L).mentions))},t[37]=L,t[38]=p,t[39]=K):K=t[39];let q;t[40]===L?q=t[41]:(q=[L],t[40]=L,t[41]=q),(0,H.useEffect)(K,q);let J,Y;t[42]===L?(J=t[43],Y=t[44]):(J=()=>({focus:()=>L?.commands.focus(),focusEnd:()=>L?.commands.focus(`end`),blur:()=>L?.commands.blur(),clear:()=>L?.commands.clearContent(!0),setText:e=>{L&&(L.commands.setContent(e),w.current?.(L.getJSON()),T.current?.(Q(L).mentions),S(xe(Se(L),_e(L))))},appendText:e=>{!L||e===``||(Ve(L)?L.commands.setContent(Ue(e)):L.commands.insertContentAt(L.state.doc.content.size,[{type:`paragraph`,content:[]},...Ue(e)]),C.current(Ve(L)),w.current?.(L.getJSON()),T.current?.(Q(L).mentions),S(xe(Se(L),_e(L))))},getContent:()=>L?Q(L):{instruction:``,mentions:[],attachments:[]},openMentionPicker:()=>{L&&L.chain().focus().insertContent(`@`).run()}}),Y=[L],t[42]=L,t[43]=J,t[44]=Y),(0,H.useImperativeHandle)(n,J,Y);let X;t[45]!==d||t[46]!==L?(X=(0,z.jsx)(ee,{editor:L,className:d}),t[45]=d,t[46]=L,t[47]=X):X=t[47];let Z;t[48]!==b||t[49]!==v||t[50]!==x?(Z=v===void 0?null:(0,z.jsx)(`p`,{className:c(`truncate px-2.5 text-xs text-muted-foreground`,x?.kind===`unknown`&&`pb-1`),"aria-live":`polite`,"aria-atomic":`true`,"data-testid":`composer-slash-hint`,children:x?.kind===`unknown`?x.agentHasCommands?b({id:`mBK8zm`,values:{0:x.name}}):b({id:`Q9AxTM`}):null}),t[48]=b,t[49]=v,t[50]=x,t[51]=Z):Z=t[51];let ie;return t[52]!==X||t[53]!==Z?(ie=(0,z.jsxs)(z.Fragment,{children:[X,Z]}),t[52]=X,t[53]=Z,t[54]=ie):ie=t[54],ie}function Ge(e){return e.name===`placeholder`}var Ke=`button, a[href], [role="menuitem"], [role="button"], input, textarea, select, [contenteditable="true"]`;function qe(e,t){if(!(e.target instanceof HTMLElement)||!(e.currentTarget instanceof HTMLElement)||!e.currentTarget.contains(e.target)||e.target.closest(Ke))return;e.preventDefault();let n=t.current;n!==null&&(n.focusEnd===void 0?n.focus():n.focusEnd())}function Je(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Ye(e){let t=(0,R.c)(21),{path:r,onRemove:i}=e,{_:a}=o(),s,c;t[0]!==a||t[1]!==r?(s=Je(r),c=a({id:`hnq8fP`,values:{label:s}}),t[0]=a,t[1]=r,t[2]=s,t[3]=c):(s=t[2],c=t[3]);let l=c,d=`composer-context-chip-file-${r}`,f;t[4]===i?f=t[5]:(f=e=>{(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),i())},t[4]=i,t[5]=f);let p;t[6]===r?p=t[7]:(p=(0,z.jsx)(`span`,{className:`absolute top-1/2 left-1/2 inline-flex size-3 -translate-x-1/2 -translate-y-1/2 opacity-100 transition-opacity duration-150 ease-out group-hover/chip:opacity-0 group-focus-within/chip:opacity-0 motion-reduce:transition-none`,children:(0,z.jsx)(n,{path:r,className:`size-3`,showExtensionBadge:!1})}),t[6]=r,t[7]=p);let m;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,z.jsx)(I,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-150 ease-out group-hover/chip:opacity-100 group-focus-within/chip:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0}),t[8]=m):m=t[8];let h;t[9]!==i||t[10]!==l||t[11]!==f||t[12]!==p?(h=(0,z.jsxs)(u,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":l,onClick:i,onKeyDown:f,className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[p,m]}),t[9]=i,t[10]=l,t[11]=f,t[12]=p,t[13]=h):h=t[13];let g;t[14]===s?g=t[15]:(g=(0,z.jsx)(`span`,{className:`min-w-0 truncate`,children:s}),t[14]=s,t[15]=g);let _;return t[16]!==r||t[17]!==d||t[18]!==h||t[19]!==g?(_=(0,z.jsxs)(`span`,{"data-testid":d,title:r,className:`group/chip inline-flex max-w-[14rem] items-center gap-1 rounded-md border bg-muted/40 py-0.5 pr-1.5 pl-1 text-muted-foreground text-xs`,children:[h,g]}),t[16]=r,t[17]=d,t[18]=h,t[19]=g,t[20]=_):_=t[20],_}function Xe(e){let t=(0,R.c)(13),{files:n,onRemoveFile:r,className:i,children:a}=e,o;t[0]===n?o=t[1]:(o=n===void 0?[]:n,t[0]=n,t[1]=o);let s=o;if(s.length===0&&H.Children.toArray(a).length===0)return null;let l;t[2]===i?l=t[3]:(l=c(`flex flex-wrap items-center gap-1`,i),t[2]=i,t[3]=l);let u;if(t[4]!==s||t[5]!==r){let e;t[7]===r?e=t[8]:(e=e=>(0,z.jsx)(Ye,{path:e,onRemove:()=>r?.(e)},e),t[7]=r,t[8]=e),u=s.map(e),t[4]=s,t[5]=r,t[6]=u}else u=t[6];let d;return t[9]!==a||t[10]!==l||t[11]!==u?(d=(0,z.jsxs)(`div`,{className:l,"data-testid":`composer-context-chips`,children:[u,a]}),t[9]=a,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function Ze(){let e=(0,R.c)(2),[t,n]=(0,H.useState)(Qe),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);n(e.matches);let t=e=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,H.useEffect)(r,i),t}function Qe(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function $(e,t){let n=e[t];return typeof n==`string`&&n!==``?n:null}function $e(e){if(typeof e!=`object`||!e)return null;let t=e,n=$(t,`tool`)??$(t,`name`),r=t;if(typeof t.arguments==`object`&&t.arguments!==null)r=t.arguments;else if(typeof t.arguments==`string`)try{let e=JSON.parse(t.arguments);typeof e==`object`&&e&&(r=e)}catch{}return{tool:n,args:r}}var et=`ok-acp-follow-file-v1`;function tt(){try{return localStorage.getItem(et)!==`0`}catch{return!0}}function nt(e){try{localStorage.setItem(et,e?`1`:`0`)}catch{}}function rt(e){return e===``||e.startsWith(`/`)||e.startsWith(`\\`)||e.split(`/`).some(e=>e===``||e.startsWith(`.`))?null:e}function it(e,t){let n=t.pathSeparator,r=e=>n===`\\`?e.replaceAll(`\\`,`/`):e,i=r(t.contentDir).replace(/\/$/,``),a=r(e);if(!a.startsWith(`${i}/`))return null;let o=a.slice(i.length+1),s=/\.(md|mdx)$/.exec(o);return s===null?null:rt(o.slice(0,-s[0].length))}var at=new Set([`cat`,`ls`,`grep`,`rg`,`find`,`head`,`tail`,`wc`,`sort`,`uniq`,`cut`,`sed`,`awk`,`bat`,`less`,`more`]);function ot(e,t){let n=[],r=/"([^"]*)"|'([^']*)'|(\S+)/g,i=r.exec(e);for(;i!==null;)n.push(i[1]??i[2]??i[3]??``),i=r.exec(e);let a=n[0];if(a===void 0||!at.has(a))return null;for(let e of n.slice(1)){if(e.startsWith(`-`)||/[*?[\]]/.test(e))continue;let n=/\.(md|mdx)$/i.exec(e);if(n===null)continue;if(e.startsWith(`/`)||/^[A-Za-z]:[\\/]/.test(e)){if(t!==null){let n=it(e,t);if(n!==null)return n}continue}let r=rt(e.replace(/^\.\//,``).slice(0,-n[0].length));if(r!==null)return r}return null}function st(e){if(e===null||e.loading||e.error!==null)return{};let t=e.pages;return{docExists:e=>t.has(e)}}function ct(e,t,n,r){let i=$e(e);if(i===null)return null;let{tool:a,args:o}=i;if(a===`delete`||a===null&&/\bdelete\b/i.test(t))return null;let s=typeof o.document==`object`&&o.document!==null?o.document:null,c=null;if(Array.isArray(o.documents))for(let e=o.documents.length-1;e>=0;e--){let t=o.documents[e];if(typeof t==`object`&&t){c=t;break}}let l=(s===null?null:$(s,`path`))??(c===null?null:$(c,`path`))??$(o,`to`)??$(o,`docName`);if(l!==null)return rt(l.replace(/\.(md|mdx)$/,``));let u=$(o,`command`);if(u!==null){let e=ot(u,n);return e!==null&&r.docExists!==void 0&&!r.docExists(e)?null:e}return null}function lt(e,t,n={}){if(e.toolKind===`delete`)return null;let r=ct(e.rawInput,e.title,t,n);if(r!==null)return r;if(t===null)return null;let i=e.toolKind!==`edit`&&e.toolKind!==`move`&&n.docExists!==void 0;for(let r=e.locations.length-1;r>=0;r--){let a=e.locations[r];if(a===void 0)continue;let o=it(a.path,t);if(o!==null)return i&&!n.docExists?.(o)?null:o}return null}var ut={lastFollowed:null,yielded:!1,reArmed:!1};function dt(e,t,n){if(e===null||n.lastFollowed===e)return{navigateTo:null,state:n};if(n.lastFollowed!==null&&t!==null&&t!==n.lastFollowed&&t!==e&&!n.reArmed)return{navigateTo:null,state:{...n,yielded:!0}};if(n.yielded&&!n.reArmed)return{navigateTo:null,state:n};let r={lastFollowed:e,yielded:!1,reArmed:!1};return t===e?{navigateTo:null,state:r}:{navigateTo:e,state:r}}function ft(e,t,n={}){let r=null;for(let i of e){if(i.kind!==`tool_call`)continue;let e=lt(i,t,n);e!==null&&(r=e)}return r}export{ae as _,tt as a,re as b,nt as c,Ze as d,Xe as f,se as g,ce as h,ft as i,$ as l,We as m,dt as n,st as o,qe as p,it as r,rt as s,ut as t,$e as u,oe as v,L as x,V as y};
|