@inkeep/open-knowledge 0.47.0-beta.14 → 0.47.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acp-harness-probe-Bzpi4D-5.mjs → acp-harness-probe-Bnts6rTj.mjs} +2 -2
- package/dist/cli.mjs +7 -7
- package/dist/constants-C60h_U5-.mjs +2 -0
- package/dist/git-handle-CPdkNcKW.mjs +1 -0
- package/dist/{git-handle-I4Wo1xI2.mjs → git-handle-DZ99-PGe.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/init-CAm3g_m2.mjs +1 -0
- package/dist/{init-p3FBT6M-.mjs → init-CUaIjiMo.mjs} +3 -3
- package/dist/{launch-json-removal-DkXEI_E-.mjs → launch-json-removal-B_v3c67x.mjs} +2 -2
- package/dist/{loader-C9P23H2V.mjs → loader-CkZ6CTb2.mjs} +2 -2
- package/dist/loader-D0fOaLys.mjs +1 -0
- package/dist/md-manager-AQqN3Gpb.mjs +2 -0
- package/dist/{open-browser-Bc_3nD-8.mjs → open-browser-CWvpqBNK.mjs} +2 -2
- package/dist/parse-worker.mjs +1 -1
- package/dist/{preview-Cuq6GZ9t.mjs → preview-BwiH8Ec6.mjs} +2 -2
- package/dist/preview-Dg3j3UKT.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-DnZx_iOU.js → ActivityModeContent-D5TfDRam.js} +1 -1
- package/dist/public/assets/{AgentDiffPane-DJ2-UsWA.js → AgentDiffPane-DzyTBPWr.js} +1 -1
- package/dist/public/assets/{AgentThreadClientBinder-BnfaxmYs.js → AgentThreadClientBinder-BctQyzUb.js} +1 -1
- package/dist/public/assets/{ChangedOutsideBadge-B7Nb_Prz.js → ChangedOutsideBadge-D8PLhT3b.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-BPC_zQgZ.js → CodeMirrorPropInput-C_Ul6LEF.js} +1 -1
- package/dist/public/assets/{DocumentContext-anJxeK9i.js → DocumentContext-BSUVMRPR.js} +6 -6
- package/dist/public/assets/{EditorModeToggle-C9BKN-yE.js → EditorModeToggle-DyKtsJ5u.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-DIz2gorY.js → EnableSyncConfirmDialog-DEjR8RoN.js} +1 -1
- package/dist/public/assets/FeedbackForm-CwKlgOyH.js +1 -0
- package/dist/public/assets/{GraphPanel-BVeL-7D5.js → GraphPanel-DkwBXcDT.js} +1 -1
- package/dist/public/assets/{ImportSkillDialog-BSa0kpLo.js → ImportSkillDialog-B9L3IH3D.js} +1 -1
- package/dist/public/assets/{LintConfigEditor-BprWEWXR.js → LintConfigEditor-BpXnpZd0.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-B6Rxdr9G.js → ManagedArtifactProperties-DQ-jFLHF.js} +1 -1
- package/dist/public/assets/ManagedArtifactProperties-Zkro4AtJ.js +1 -0
- package/dist/public/assets/{McpConsentDialogBody-CxKa0U9E.js → McpConsentDialogBody-Di0dc0Tq.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-Bzd-2Jzs.js → MermaidDocEditor-Dpg12Tki.js} +1 -1
- package/dist/public/assets/{ReportBugDialogBody--l9pSfnw.js → ReportBugDialogBody-CTRJuYcL.js} +1 -1
- package/dist/public/assets/{SchemaConfigEditor-DeGW895c.js → SchemaConfigEditor-DMhtLwRw.js} +1 -1
- package/dist/public/assets/{SessionsHost-D5UkI7-p.js → SessionsHost-oNyYvi5z.js} +2 -2
- package/dist/public/assets/{SettingsDialogBody-IFOvZZqr.js → SettingsDialogBody-CDbFtTdS.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-BIi10Y8l.js → ShareBranchSwitchDialog-CaXs87VY.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-CKAMTDsZ.js → ShareReceiveDialog-0sIjLwpR.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-B0ferX65.js → ShareReceiveMissDialog-B5FxAhNW.js} +1 -1
- package/dist/public/assets/{SkillEditBanner-B34nvuqh.js → SkillEditBanner-Dp8Hkers.js} +1 -1
- package/dist/public/assets/{SkillOriginInline-u1OYA4fd.js → SkillOriginInline-D6Vqhr21.js} +1 -1
- package/dist/public/assets/{SkillToolbarControls-1YGkO2th.js → SkillToolbarControls-G3pICno5.js} +1 -1
- package/dist/public/assets/{SourceEditor-HVX16YXz.js → SourceEditor-DmNElH6G.js} +1 -1
- package/dist/public/assets/{TerminalPanel-CJod-Zrx.js → TerminalPanel-CbtOMei5.js} +1 -1
- package/dist/public/assets/{TerminalWindowApp-Dwk2DcF6.js → TerminalWindowApp-L5dPQ7lv.js} +1 -1
- package/dist/public/assets/{TextDocEditor-C5J4jgjO.js → TextDocEditor-Dmf7TTiA.js} +1 -1
- package/dist/public/assets/{ThreadView-h4TbdkA3.js → ThreadView-CER4InFQ.js} +1 -1
- package/dist/public/assets/{TimelineDiffPane-CNiUuVNQ.js → TimelineDiffPane-uqxXdU23.js} +1 -1
- package/dist/public/assets/{agent-diff-store-BeaPLwYM.js → agent-diff-store-bHo6Kh5a.js} +1 -1
- package/dist/public/assets/{agent-visibility-DOI-aRe5.js → agent-visibility-D8P2aHAW.js} +1 -1
- package/dist/public/assets/{auth-state-cache-1bfEn7hj.js → auth-state-cache-pFBbLky5.js} +1 -1
- package/dist/public/assets/{client-version-CVk8TXQL.js → client-version-DvKMLhnr.js} +1 -1
- package/dist/public/assets/{config-context-BlTWIu0S.js → config-context-CAqXUmYZ.js} +1 -1
- package/dist/public/assets/{config-provider-VpKVpqSK.js → config-provider-C9bLBOvA.js} +1 -1
- package/dist/public/assets/{dist-Dp50RPBY2.js → dist-BU8JCBqy2.js} +1 -1
- package/dist/public/assets/{doc-paths-DGWtnOSZ.js → doc-paths-D9KdMECm.js} +1 -1
- package/dist/public/assets/{documents-events-BMvnact8.js → documents-events-Dg32OM79.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-DGfCX-aq.js → file-tree-adapter-CdI4HnMo.js} +1 -1
- package/dist/public/assets/{file-tree-utils-Cawb-Fht.js → file-tree-utils-B9qjWixz.js} +1 -1
- package/dist/public/assets/{folder-config-api-Rk-XVk8n.js → folder-config-api-Bigw9oyp.js} +1 -1
- package/dist/public/assets/{globals-DpKvVzNS.js → globals-ChLmp8Vo.js} +1 -1
- package/dist/public/assets/{index-B7kLMpFo.js → index-CA7fa9Ef.js} +7 -7
- package/dist/public/assets/{lint-config-client-DQhrbuBD.js → lint-config-client-CaqOCeCX.js} +1 -1
- package/dist/public/assets/{markdownlint-rule-browser-CXXfZ7AS.js → markdownlint-rule-browser-afLnTSOU.js} +1 -1
- package/dist/public/assets/{navigation-targets-_6Iwr-fQ.js → navigation-targets-BDEX1Jzv.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-C9oj9rmC.js → open-managed-artifact-tab-D0ob9Lcy.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-DsY7F3C7.js → pending-receive-nav-store-6GSwpITy.js} +1 -1
- package/dist/public/assets/{prop-types-cgBDAKXT.js → prop-types-BU2yOBBY.js} +1 -1
- package/dist/public/assets/{receive-store-V-894b3Q.js → receive-store-Cd4Hbr5L.js} +1 -1
- package/dist/public/assets/{selection-context-B-KMAXq0.js → selection-context-rElDeSYS.js} +1 -1
- package/dist/public/assets/{skill-actions-DgfuLyh3.js → skill-actions-BC2N04TN.js} +1 -1
- package/dist/public/assets/{skill-scope-B08uDTjW.js → skill-scope-DmJyA019.js} +1 -1
- package/dist/public/assets/{skills-api-BRPaZddc.js → skills-api-CIrx9VYh.js} +1 -1
- package/dist/public/assets/{src-CQwTZt_9.js → src-UZsyoffN.js} +1 -1
- package/dist/public/assets/{tag-pill-input-Diwtyypb.js → tag-pill-input-CC-dmF2y.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-KPxzHOsd.js → target-navigation-intent-9V6vp_PY.js} +1 -1
- package/dist/public/assets/{terminal-launch-events-oqilDUow.js → terminal-launch-events-t5eziTRM.js} +1 -1
- package/dist/public/assets/{terminal-telemetry-DyhaSTn5.js → terminal-telemetry-C5CXQZFf.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-BK0ARuUX.js → typing-burst-detector-B00fsp8R.js} +1 -1
- package/dist/public/assets/{uninstall-DN3K5-qU.js → uninstall-roTqJpdJ.js} +1 -1
- package/dist/public/assets/{use-activity-panel-DfWrpNMe.js → use-activity-panel-C8Bsa4Wh.js} +1 -1
- package/dist/public/assets/{use-collab-url-D0OTAOCR.js → use-collab-url-DE27_qfd.js} +1 -1
- package/dist/public/assets/{use-live-xterm-theme-7QgVqT2i.js → use-live-xterm-theme-Bs8i6uIk.js} +1 -1
- package/dist/public/assets/{use-open-skill-NV7rKurq.js → use-open-skill-CwFa389s.js} +1 -1
- package/dist/public/assets/{use-settings-route-DAGaZ39q.js → use-settings-route-BxF_KhIQ.js} +1 -1
- package/dist/public/assets/{use-skill-directory-Ju1ZmlKr.js → use-skill-directory-B_aFh-rY.js} +1 -1
- package/dist/public/assets/{use-skill-origin-C-FHHNBF.js → use-skill-origin-18USFBF8.js} +1 -1
- package/dist/public/assets/{use-skills-CeXXLoHf.js → use-skills-p2WuQJcF.js} +1 -1
- package/dist/public/assets/{use-terminal-enabled-B9EaAD2q.js → use-terminal-enabled-DycT8EtH.js} +1 -1
- package/dist/public/assets/{use-timeline-entry-diff-CDiv4XcE.js → use-timeline-entry-diff-AqVeS9gC.js} +1 -1
- package/dist/public/assets/{use-workspace-7rqwaYpi.js → use-workspace-XD6JgiN8.js} +1 -1
- package/dist/public/index.html +42 -42
- package/dist/public/uninstall.html +3 -3
- package/dist/{repair-launch-json-CHIF7tq1.mjs → repair-launch-json-HoVxof_u.mjs} +2 -2
- package/dist/{repair-mcp-configs-DRpP5X6l.mjs → repair-mcp-configs-CaWo5lPQ.mjs} +2 -2
- package/dist/{repair-skills-BFS9VdJG.mjs → repair-skills-BTZ4p2eR.mjs} +2 -2
- package/dist/repair-skills-DG80TYra.mjs +1 -0
- package/dist/server-lock-1g24bWxY.mjs +1 -0
- package/dist/{server-lock-CG7HATY5.mjs → server-lock-Iwha6Mev.mjs} +2 -2
- package/dist/{src-Cd48emEJ.mjs → src-D7ue1-zj.mjs} +2 -2
- package/dist/{src-DTDFcMVx.mjs → src-DSW-Uq2t.mjs} +1 -1
- package/dist/{src-C_Slu4-t.mjs → src-aLMPCjd_.mjs} +2 -2
- package/dist/{src-DbA3hkai.mjs → src-d3vC7Yq4.mjs} +8 -8
- package/dist/{start-TlV2KNW-.mjs → start-B3hIo1zn.mjs} +3 -3
- package/dist/start-E1o1cIg-.mjs +1 -0
- package/dist/{write-project-skill-BERngm0S.mjs → write-project-skill-49lx5BFR.mjs} +2 -2
- package/package.json +4 -4
- package/dist/constants-t6bITiHu.mjs +0 -2
- package/dist/git-handle-Bt16fZHs.mjs +0 -1
- package/dist/init-Br0-eR8k.mjs +0 -1
- package/dist/loader-uo1bqPoI.mjs +0 -1
- package/dist/md-manager-5iZyY6ma.mjs +0 -2
- package/dist/preview-BOkS5aPh.mjs +0 -1
- package/dist/public/assets/FeedbackForm-lsEggh84.js +0 -1
- package/dist/public/assets/ManagedArtifactProperties-Cf1VOAl2.js +0 -1
- package/dist/repair-skills-FfuWyfMq.mjs +0 -1
- package/dist/server-lock-D7O44--l.mjs +0 -1
- package/dist/start-DHRkxHgT.mjs +0 -1
|
@@ -181,7 +181,7 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
|
|
|
181
181
|
`),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function WO(e){throw Error("Cannot handle value `"+e+"`, expected node")}function GO(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function KO(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function qO(e,t){return PO(e,this,t)}function JO(e,t){return FO(e,this,t)}function YO(e,t){return zO(this,e,t)}function XO(){return{enter:{table:ZO,tableData:tk,tableHeader:tk,tableRow:$O},exit:{codeText:nk,table:QO,tableData:ek,tableHeader:ek,tableRow:ek}}}function ZO(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function QO(e){this.exit(e),this.data.inTable=void 0}function $O(e){this.enter({type:`tableRow`,children:[]},e)}function ek(e){this.exit(e)}function tk(e){this.enter({type:`tableCell`,children:[]},e)}function nk(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,rk));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function rk(e,t){return t===`|`?t:e}function ik(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
182
182
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
183
183
|
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return _D(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=bO.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function ak(){return{exit:{taskListCheckValueChecked:sk,taskListCheckValueUnchecked:sk,paragraph:ck}}}function ok(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:lk}}}function sk(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function ck(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function lk(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=bO.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function uk(){return[PE(),aD(),uD(),XO(),ak()]}function dk(e){return{extensions:[FE(),oD(e),dD(),ik(e),ok()]}}function fk(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function pk(e,t){return e.length>0?(fk(e,e.length,0,t),e):t}const mk={}.hasOwnProperty;function hk(e){let t={},n=-1;for(;++n<e.length;)gk(t,e[n]);return t}function gk(e,t){let n;for(n in t){let r=(mk.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){mk.call(r,a)||(r[a]=[]);let e=i[a];_k(r[a],Array.isArray(e)?e:e?[e]:[])}}}function _k(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);fk(e,0,0,r)}const vk={tokenize:Mk,partial:!0},yk={tokenize:Nk,partial:!0},bk={tokenize:Pk,partial:!0},xk={tokenize:Fk,partial:!0},Sk={tokenize:Ik,partial:!0},Ck={name:`wwwAutolink`,tokenize:Ak,previous:Lk},wk={name:`protocolAutolink`,tokenize:jk,previous:Rk},Tk={name:`emailAutolink`,tokenize:kk,previous:zk},Ek={};function Dk(){return{text:Ek}}let Ok=48;for(;Ok<123;)Ek[Ok]=Tk,Ok++,Ok===58?Ok=65:Ok===91&&(Ok=97);Ek[43]=Tk,Ek[45]=Tk,Ek[46]=Tk,Ek[95]=Tk,Ek[72]=[Tk,wk],Ek[104]=[Tk,wk],Ek[87]=[Tk,Ck],Ek[119]=[Tk,Ck];function kk(e,t,n){let r=this,i,a;return o;function o(t){return!Bk(t)||!zk.call(r,r.previous)||Vk(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Bk(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Sk,u,l)(t):t===45||t===95||_E(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&gE(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Ak(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Lk.call(r,r.previous)||Vk(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(vk,e.attempt(yk,e.attempt(bk,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function jk(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Rk.call(r,r.previous)&&!Vk(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(gE(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||yE(t)||CE(t)||TE(t)||wE(t)?n(t):e.attempt(yk,e.attempt(bk,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Mk(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Nk(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(xk,c,s)(t):t===null||CE(t)||TE(t)||t!==45&&wE(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Pk(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(xk,t,a)(o):o===null||CE(o)||TE(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Fk(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||CE(o)||TE(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||CE(e)||TE(e)?t(e):r(e)}function a(e){return gE(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):gE(t)?(e.consume(t),o):n(t)}}function Ik(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return _E(e)?n(e):t(e)}}function Lk(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||CE(e)}function Rk(e){return!gE(e)}function zk(e){return!(e===47||Bk(e))}function Bk(e){return e===43||e===45||e===46||e===95||_E(e)}function Vk(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}function Hk(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&_E(e.charCodeAt(n+1))&&_E(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Uk(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Wk={name:`attention`,resolveAll:Gk,tokenize:Kk};function Gk(e,t){let n=-1,r,i,a,o,s,c,l,u;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){for(r=n;r--;)if(e[r][0]===`exit`&&e[r][1].type===`attentionSequence`&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};qk(d,-c),qk(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=pk(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=pk(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=pk(l,Uk(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=pk(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=pk(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,fk(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function Kk(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=BD(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=BD(o),u=!l||l===2&&i||n.includes(o),d=!i||i===2&&l||n.includes(r);return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function qk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Jk={name:`autolink`,tokenize:Yk};function Yk(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return gE(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||_E(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||_E(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||yE(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):vE(t)?(e.consume(t),l):n(t)}function u(e){return _E(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||_E(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function Xk(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return X(r)?(e.enter(n),s(r)):t(r)}function s(r){return X(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const Zk={partial:!0,tokenize:Qk};function Qk(e,t,n){return r;function r(t){return X(t)?Xk(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}const $k={continuation:{tokenize:tA},exit:nA,name:`blockQuote`,tokenize:eA};function eA(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return X(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function tA(e,t,n){let r=this;return i;function i(t){return X(t)?Xk(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt($k,t,n)(r)}}function nA(e){e.exit(`blockQuote`)}const rA={name:`characterEscape`,tokenize:iA};function iA(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return SE(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const aA={name:`characterReference`,tokenize:oA};function oA(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=_E,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=xE,u):(e.enter(`characterReferenceValue`),a=7,o=bE,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===_E&&!DO(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}const sA={partial:!0,tokenize:uA},cA={concrete:!0,name:`codeFenced`,tokenize:lA};function lA(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),X(t)?Xk(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(sA,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):X(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Xk(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&X(t)?Xk(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(sA,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),X(t)?Xk(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),X(t)?Xk(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function uA(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}const dA={name:`codeIndented`,tokenize:pA},fA={partial:!0,tokenize:mA};function pA(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),Xk(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):Y(t)?e.attempt(fA,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function mA(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):Xk(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):Y(e)?i(e):n(e)}}const hA={name:`codeText`,previous:_A,resolve:gA,tokenize:vA};function gA(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function _A(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function vA(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var yA=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&bA(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),bA(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),bA(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){let t=this.left.splice(e,1/0);bA(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);bA(this.left,t.reverse())}}};function bA(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function xA(e){let t={},n=-1,r,i,a,o,s,c,l,u=new yA(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,SA(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(!(o[1].type===`linePrefix`||o[1].type===`listItemIndent`))break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return fk(e,0,1/0,u.slice(0)),!l}function SA(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}const CA={resolve:TA,tokenize:EA},wA={partial:!0,tokenize:DA};function TA(e){return xA(e),e}function EA(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(wA,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function DA(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Xk(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function OA(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||yE(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||CE(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||yE(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function kA(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!X(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function AA(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Xk(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function jA(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):X(i)?Xk(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const MA={name:`definition`,tokenize:PA},NA={partial:!0,tokenize:FA};function PA(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return kA.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=JE(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return CE(t)?jA(e,l)(t):l(t)}function l(t){return OA(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(NA,d,d)(t)}function d(t){return X(t)?Xk(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function FA(e,t,n){return r;function r(t){return CE(t)?jA(e,i)(t):n(t)}function i(t){return AA(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return X(t)?Xk(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}const IA={name:`hardBreakEscape`,tokenize:LA};function LA(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const RA={name:`headingAtx`,resolve:zA,tokenize:BA};function zA(e,t){let n=e.length-2,r=3,i,a;return e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r&&(i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`},fk(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function BA(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||CE(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):X(n)?Xk(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||CE(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const VA=`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.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),HA=[`pre`,`script`,`style`,`textarea`],UA={concrete:!0,name:`htmlFlow`,resolveTo:KA,tokenize:qA},WA={partial:!0,tokenize:YA},GA={partial:!0,tokenize:JA};function KA(e){let t=e.length;for(;t--&&!(e[t][0]===`enter`&&e[t][1].type===`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function qA(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:ae):gE(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):gE(a)?(e.consume(a),i=4,r.interrupt?t:ae):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ae):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return gE(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||CE(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&HA.includes(l)?(i=1,r.interrupt?t(s):O(s)):VA.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||_E(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return X(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||gE(t)?(e.consume(t),b):X(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||_E(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):X(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):X(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||CE(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||X(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):X(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),ne):t===60&&i===1?(e.consume(t),A):t===62&&i===4?(e.consume(t),j):t===63&&i===3?(e.consume(t),ae):t===93&&i===5?(e.consume(t),ie):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(WA,oe,ee)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),ee(t)):(e.consume(t),O)}function ee(t){return e.check(GA,te,oe)(t)}function te(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),k}function k(t){return t===null||Y(t)?ee(t):(e.enter(`htmlFlowData`),O(t))}function ne(t){return t===45?(e.consume(t),ae):O(t)}function A(t){return t===47?(e.consume(t),o=``,re):O(t)}function re(t){if(t===62){let n=o.toLowerCase();return HA.includes(n)?(e.consume(t),j):O(t)}return gE(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),re):O(t)}function ie(t){return t===93?(e.consume(t),ae):O(t)}function ae(t){return t===62?(e.consume(t),j):t===45&&i===2?(e.consume(t),ae):O(t)}function j(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),oe(t)):(e.consume(t),j)}function oe(n){return e.exit(`htmlFlow`),t(n)}}function JA(e,t,n){let r=this;return i;function i(t){return Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function YA(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(Zk,t,n)}}const XA={name:`htmlText`,tokenize:ZA};function ZA(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):gE(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):gE(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,A(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ne(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,A(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ne(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ne(t):Y(t)?(o=v,A(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,A(t)):(e.consume(t),y)}function b(e){return e===62?ne(e):y(e)}function x(t){return gE(t)?(e.consume(t),S):n(t)}function S(t){return t===45||_E(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,A(t)):X(t)?(e.consume(t),C):ne(t)}function w(t){return t===45||_E(t)?(e.consume(t),w):t===47||t===62||CE(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ne):t===58||t===95||gE(t)?(e.consume(t),E):Y(t)?(o=T,A(t)):X(t)?(e.consume(t),T):ne(t)}function E(t){return t===45||t===46||t===58||t===95||_E(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,A(t)):X(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ee):Y(t)?(o=O,A(t)):X(t)?(e.consume(t),O):(e.consume(t),te)}function ee(t){return t===i?(e.consume(t),i=void 0,k):t===null?n(t):Y(t)?(o=ee,A(t)):(e.consume(t),ee)}function te(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||CE(t)?T(t):(e.consume(t),te)}function k(e){return e===47||e===62||CE(e)?T(e):n(e)}function ne(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function A(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return X(t)?Xk(e,ie,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ie(t)}function ie(t){return e.enter(`htmlTextData`),o(t)}}const QA={name:`labelEnd`,resolveAll:nj,resolveTo:rj,tokenize:ij},$A={tokenize:aj},ej={tokenize:oj},tj={tokenize:sj};function nj(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&fk(e,0,e.length,n),e}function rj(e,t){let n=e.length,r=0,i,a,o,s;for(;n--;)if(i=e[n][1],a){if(i.type===`link`||i.type===`labelLink`&&i._inactive)break;e[n][0]===`enter`&&i.type===`labelLink`&&(i._inactive=!0)}else if(o){if(e[n][0]===`enter`&&(i.type===`labelImage`||i.type===`labelLink`)&&!i._balanced&&(a=n,i.type!==`labelLink`)){r=2;break}}else i.type===`labelEnd`&&(o=n);let c={type:e[a][1].type===`labelLink`?`link`:`image`,start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:`label`,start:{...e[a][1].start},end:{...e[o][1].end}},u={type:`labelText`,start:{...e[a+r+2][1].end},end:{...e[o-2][1].start}};return s=[[`enter`,c,t],[`enter`,l,t]],s=pk(s,e.slice(a+1,a+r+3)),s=pk(s,[[`enter`,u,t]]),s=pk(s,Uk(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=pk(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=pk(s,e.slice(o+1)),s=pk(s,[[`exit`,c,t]]),fk(e,a,e.length,s),e}function ij(e,t,n){let r=this,i=r.events.length,a,o;for(;i--;)if((r.events[i][1].type===`labelImage`||r.events[i][1].type===`labelLink`)&&!r.events[i][1]._balanced){a=r.events[i][1];break}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(JE(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt($A,u,o?u:d)(t):t===91?e.attempt(ej,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(tj,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function aj(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return CE(t)?jA(e,a)(t):a(t)}function a(t){return t===41?u(t):OA(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return CE(t)?jA(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?AA(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return CE(t)?jA(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function oj(e,t,n){let r=this;return i;function i(t){return kA.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(JE(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function sj(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}const cj={name:`labelStartImage`,resolveAll:QA.resolveAll,tokenize:lj};function lj(e,t,n){let r=this;return i;function i(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),a}function a(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelImage`),o):n(t)}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const uj={name:`labelStartLink`,resolveAll:QA.resolveAll,tokenize:dj};function dj(e,t,n){let r=this;return i;function i(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelLink`),a}function a(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):t(e)}}const fj={name:`lineEnding`,tokenize:pj};function pj(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Xk(e,t,`linePrefix`)}}const mj={name:`thematicBreak`,tokenize:hj};function hj(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),X(t)?Xk(e,s,`whitespace`)(t):s(t))}}const gj={continuation:{tokenize:bj},exit:Sj,name:`list`,tokenize:yj},_j={partial:!0,tokenize:Cj},vj={partial:!0,tokenize:xj};function yj(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:bE(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(mj,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return bE(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(Zk,r.interrupt?n:u,e.attempt(_j,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return X(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function bj(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(Zk,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Xk(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!X(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(vj,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Xk(e,e.attempt(gj,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function xj(e,t,n){let r=this;return Xk(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Sj(e){e.exit(this.containerState.type)}function Cj(e,t,n){let r=this;return Xk(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!X(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const wj={name:`setextUnderline`,resolveTo:Tj,tokenize:Ej};function Tj(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function Ej(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),X(t)?Xk(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const Dj={tokenize:Fj,partial:!0};function Oj(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:Mj,continuation:{tokenize:Nj},exit:Pj}},text:{91:{name:`gfmFootnoteCall`,tokenize:jj},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:kj,resolveTo:Aj}}}}function kj(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=JE(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function Aj(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function jj(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||CE(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(JE(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return CE(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function Mj(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||CE(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=JE(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return CE(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Xk(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function Nj(e,t,n){return e.check(Zk,t,e.attempt(Dj,t,n))}function Pj(e){e.exit(`gfmFootnoteDefinition`)}function Fj(e,t,n){let r=this;return Xk(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function Ij(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&fk(o,o.length,0,Uk(s,e.slice(r+1,n),t)),fk(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),fk(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=BD(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=BD(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var Lj=class{constructor(){this.map=[]}add(e,t,n){Rj(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0}};function Rj(e,t,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<e.map.length;){if(e.map[i][0]===t){e.map[i][1]+=n,e.map[i][2].push(...r);return}i+=1}e.map.push([t,n,r])}}function zj(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function Bj(){return{flow:{null:{name:`table`,tokenize:Vj,resolveAll:Hj}}}}function Vj(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):Y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):X(t)?Xk(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||CE(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,X(t)?Xk(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return X(t)?Xk(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Y(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return X(t)?Xk(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Y(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Y(n)?(e.exit(`tableRow`),t(n)):X(n)?Xk(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||CE(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function Hj(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new Lj;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(Wj(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=Uj(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=Uj(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=Uj(f,t,o,i,n,d)):(o[0]=o[1],d=Uj(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&Wj(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=zj(t.events,n))}return e}function Uj(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},Gj(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=Gj(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=Gj(t.events,n[2]),a=Gj(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},Gj(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function Wj(e,t,n,r,i){let a=[],o=Gj(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function Gj(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const Kj={name:`tasklistCheck`,tokenize:Jj};function qj(){return{text:{91:Kj}}}function Jj(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return CE(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Y(r)?t(r):X(r)?e.check({tokenize:Yj},t,n)(r):n(r)}}function Yj(e,t,n){return Xk(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function Xj(e){return hk([Dk(),Oj(),Ij(e),Bj(),qj()])}const Zj={};function Qj(e){let t=this,n=e||Zj,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(Xj(n)),a.push(uk()),o.push(dk(n))}function $j(e){let t=this;t.compiler=n;function n(n){return UO(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function eM(e){if(e)throw e}var tM=t(r(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}))(),1);function nM(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function rM(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a){r(a);return}for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?iM(s,i)(...o):r(null,...o)}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function iM(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}const aM=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),oM={}.hasOwnProperty,sM=new class e extends aM{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=rM()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,tM.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(uM(`data`,this.frozen),this.namespace[e]=t,this):oM.call(this.namespace,e)&&this.namespace[e]||void 0:e?(uM(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=pM(e),n=this.parser||this.Parser;return cM(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),cM(`process`,this.parser||this.Parser),lM(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=pM(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);hM(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),cM(`processSync`,this.parser||this.Parser),lM(`processSync`,this.compiler||this.Compiler),this.process(e,r),fM(`processSync`,`process`,t),n;function r(e,r){t=!0,eM(e),n=r}}run(e,t,n){dM(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=pM(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),fM(`runSync`,`run`,n),r;function i(e,t){eM(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=pM(t),r=this.compiler||this.Compiler;return lM(`stringify`,r),dM(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(uM(`use`,this.frozen),e!=null)if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`");return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`)if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e);else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,tM.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null)if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];nM(o)&&nM(r)&&(r=(0,tM.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function cM(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function lM(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function uM(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function dM(e){if(!nM(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function fM(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function pM(e){return mM(e)?e:new NT(e)}function mM(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function hM(e){return typeof e==`string`||gM(e)}function gM(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function _M(e){let t=[],n=0,r=()=>{t.length>0&&(n+=1)},i=e=>{for(;n>0;)t.push({type:`break`}),--n;t.push(e)},a=e=>{e.split(`
|
|
184
|
-
`).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r(),i({type:`text`,value:t?`${n+a}${c} `:`${o} `}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}function vM(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(yM(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(yM(t.slice(i),i>0,!1)),a.join(``)}function yM(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===9||t===32;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===9||t===32;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function bM(e,t,n,r){let i=new Map,a=new Map,o={all:c,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],one:s};return cE(r,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o;function s(r,i){return OM(e,t,n,r,i,o)}function c(t){let n=[];if(`children`in t){let r=t.children,i=-1;for(;++i<r.length;){let a=o.one(r[i],t);if(a){let t=i?r[i-1]:void 0;if(t?.type===`break`&&t.data?.sourceStyle!==`html`){if(!Array.isArray(a)&&a.type===e.nodes.text){let t=wM(a.text);a=t.length>0?e.text(t):void 0}else if(!Array.isArray(a)&&a.type!==e.nodes.text){let t=a.firstChild;if(t&&t.type===e.nodes.text){let n=wM(t.text),r=F.from(a.content);a=a.copy(n.length>0?r.replaceChild(0,e.text(n)):r.cut(t.nodeSize))}}}}a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}}function xM(e){return e.replaceAll(/\n([^\n])/g,` $1`)}function SM(e,t,n){let r=t.referenceType,i=`]`;if(r===`collapsed`?i+=`[]`:r===`full`&&(i+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[e.text(`![`+(t.alt??``)+i)];let a=n.all(t),o=a[0];o&&o.type===e.nodes.text?a[0]=o.copy(F.from(e.text(`[`+(o.text??``)))):a.unshift(e.text(`[`));let s=a[a.length-1];return s&&s.type===e.nodes.text?a[a.length-1]=s.copy(F.from(e.text((s.text??``)+i))):a.push(e.text(i)),a}function CM(e){throw Error(`unknown markdown node: ${e.type}`)}function wM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function TM(){}function EM(e){throw Error("Expected node, not `"+JSON.stringify(e)+"`")}function DM(e,t,n,r){return xD(`tagName`,{handlers:e})(t,n,r)}function OM(e,t,n,r,i,a){return xD(`type`,{invalid:EM,unknown:CM,handlers:{toml:TM,yaml:TM,definition:TM,footnoteDefinition:TM,root(t,n,r){let i=r.all(t);return e.topNodeType.create(null,i)},html(t){let r=WT(t.value).children[0];if(r?.type!==`element`)return null;let[,i]=r.children;if(i?.type!==`element`)return null;let o=i.children[0];return o?.type===`element`?DM(n,o,void 0,a)||(t.value?e.text(t.value):null):null},text(t){let n=xM(vM(String(t.value)));return n?e.text(n):null},...t,linkReference(n,r,i){if(t.linkReference)return t.linkReference(n,r,i);let a=String(n.identifier).toUpperCase(),o=i.definitionById.get(a);if(!o)return SM(e,n,i);let s={type:`link`,url:o.url,title:o.title,children:n.children,data:{...o.data,...n.data}};return t.link?.(s,r,i)}}})(r,i,a)}function kM(e,t){return(n,r,i)=>{let a=i.all(n);return e.createAndFill(t?.(n)??null,a)}}function AM(e,t){return(n,r,i)=>{let a=i.all(n),o=e.create(t?.(n)??null);return a.map(e=>e.mark(o.addToSet(e.marks)))}}const jM=function(e,t){let n=OM(t.schema,t.handlers,t.htmlHandlers??{},e,void 0,bM(t.schema,t.handlers,t.htmlHandlers??{},e));return n.check(),n},MM=function(e){this.compiler=function(t){return jM(t,e)}};function NM(e,t){let n={one:r,all:u,nodeHandlers:e,markHandlers:t};function r(e,t){let r=e.type.schema,i=e.type.name,a=n.nodeHandlers[i];if(a)return a(e,t,n);if(e.type===r.topNodeType){let t=n.all(e);return t.some(e=>YT(e,`root`)),{type:`root`,children:t}}return e.type===r.nodes.text?{type:`text`,value:e.text}:null}function i(e){if(e.length===0)return[];let t=e[0].marks,n=[];for(let r of t){let t=!0;for(let n=1;n<e.length;n++)if(!e[n].marks.some(e=>e.eq(r))){t=!1;break}t&&n.push(r)}return n}function a(e,t){let n=e.findIndex(e=>e.eq(t));return n===-1?e:e.slice(0,n).concat(e.slice(n+1))}function o(e,t){let n=[];for(let r of e)t.some(e=>e.eq(r))&&n.push(r);return n}function s(e,t,r){let i=n.markHandlers[e.type.name];if(!i)return r;let a=i(e,t,r,n);return(Array.isArray(a)?a:[a]).filter(e=>e!=null)}function c(e,t){let r=[];for(let i of e){let e=n.one(i.node,t);e!=null&&r.push(e)}return r}function l(e,t){if(e.length===0)return[];if(e.every(e=>e.marks.length===0))return c(e,t);let n=i(e);if(n.length>0){let r=n[0];return s(r,t,l(e.map(e=>({node:e.node,marks:a(e.marks,r)})),t))}let r=[],u=[e[0]],d=e[0].marks.slice();for(let t=1;t<e.length;t++){let n=e[t],i=o(d,n.marks),a=d.length===0&&n.marks.length===0;i.length>0||a?(u.push(n),d=a?[]:i):(r.push(u),u=[n],d=n.marks.slice())}if(r.push(u),r.length===1&&e.length>1){console.warn(`[mdast-util-from-prosemirror] degenerate mark partition; falling back to per-span rendering`,{spanCount:e.length,firstSpanMarks:e[0]?.marks.map(e=>e.type.name),lastSpanMarks:e[e.length-1]?.marks.map(e=>e.type.name)});let n=[];for(let r of e)for(let e of l([r],t))n.push(e);return n}let f=[];for(let e of r)for(let n of l(e,t))f.push(n);return f}function u(e){return l(e.children.map(e=>({node:e,marks:e.marks})),e)}return n}function PM(e,t){return NM(t.nodeHandlers,t.markHandlers).one(e)}function FM(e,t){return(n,r,i)=>{let a=i.all(n);return{type:e,...t?.(n),children:a}}}function IM(e,t){return(n,r,i)=>({type:e,...t?.(n),children:i})}function LM(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}const RM=new Set([`sourceRaw`,`sourceDirty`,`position`]),zM=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),BM={type:`__br__`},VM=/^<br\s*\/?>$/i;function HM(e){let t=qM(e,HM);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:UM(t.content)}:t}function UM(e){let t=[];for(let n of e){let e=WM(n);e.length!==0&&(t.length>0&&t.push(BM),t.push(...e))}return t}function WM(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?UM(e.content):e.content}function GM(e){return e.type===`hardBreak`||e.type===BM.type||e.text!==void 0&&VM.test(e.text.trim())?BM:qM(e,GM)}const KM=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:HM},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:GM}];function qM(e,t){return e.content?{...e,content:e.content.map(t)}:e}function JM(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=YM(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:YM(e.attrs,t)})).sort((e,t)=>ZM(e).localeCompare(ZM(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>JM(e,t))),n}function YM(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(RM.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?XM(i,t):i)}return Object.keys(n).length>0?n:null}function XM(e,t){if(Array.isArray(e))return e.map(e=>XM(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=XM(i,t));return n}return e}function ZM(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function QM(e){let t=``,n=e=>{if(e.text!==void 0&&(t+=e.text),e.content)for(let t of e.content)n(t)};return n(e),t.replace(/\s+/g,``)}function $M(e){let t=[],n=e=>{if(e.type&&zM.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function eN(e){let t=e,n=[];for(let e of KM){let r=ZM(t),i=e.canonicalize(t);ZM(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function tN(e,t,n={}){let r=eN(e),i=eN(t),a=[...new Set([...r.fired,...i.fired])];if(!LM(QM(r.normalized),QM(i.normalized)))return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let o=$M(r.normalized),s=$M(i.normalized);if(ZM(o)!==ZM(s))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${o.join(`, `)}] vs [${s.join(`, `)}]`};let c=JM(r.normalized,n.ignoreAttrs),l=JM(i.normalized,n.ignoreAttrs);return ZM(c)===ZM(l)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:nN(c,l)}}function nN(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(ZM(a[e])!==ZM(o[e]))return nN(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function rN(e,t,n){return!tN(e,t,{ignoreAttrs:n}).equivalent}const iN=new Set([`src`,`href`,`size`]),aN=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function oN(e){if(Array.isArray(e))return e.map(e=>oN(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))iN.has(n)||(t[n]=oN(r));return t}return e}function sN(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&aN.has(e.attrs.componentName)?oN(e):e.content?{...e,content:e.content.map(sN)}:e}function cN(e){if(Array.isArray(e))return e.map(e=>cN(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=cN(r));return t}return e}function lN(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=lN(t);if(e)return e}}function uN(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=lN(e.parse(r)),o=a?sN(cN(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?rN(n,sN(cN(e))):!1}}}function dN(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&fN(e.value.value,t))continue}let o=pN(e,t);r>=0?n[r]=o:n.push(o)}return n}function fN(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function pN(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function mN(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:dN(t,r),children:n.all(t),data:{}}}function hN(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:dN(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}const gN=/^[A-Za-z0-9]{20,}$/,_N=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function vN(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function yN(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return gN.test(n)?n:null}function bN(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!vN(t.hostname))return null;let n=yN(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&_N.test(r)?r:null}}function xN(e){return bN(e)!==null}function SN(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function CN(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:SN(t.hostname)}const wN=/^[A-Za-z0-9_-]{11}$/;function TN(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function EN(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function DN(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return wN.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return wN.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function ON(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!TN(t.hostname))return null;let n=DN(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?EN(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}const kN=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],AN=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:u,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],jN=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],MN=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:f,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(CN(e.src)||xN(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:u,hideWhen:e=>typeof e.src==`string`&&(CN(e.src)||xN(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&xN(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(CN(e.src)||xN(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(ON(e.src)!==null||CN(e.src)||xN(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],NN=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:S,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],PN=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],FN=[kN[0],kN[1],kN[4],kN[5],kN[6]],IN=[AN[0],AN[1],AN[7]],LN=[PN[0],PN[1],PN[4],PN[5]],RN=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],zN=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],BN=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],VN=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],HN=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],UN=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],WN=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],GN=[WN[0]],KN=[WN[0]],qN=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],JN=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],YN=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],XN=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:d,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],ZN=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],QN=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function $N(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function eP(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function tP(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}const nP=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:kN,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>mN(`Callout`,e,t,kN)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:AN,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>mN(`img`,e,t,AN)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:MN,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>mN(`video`,e,t,MN)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:NN,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>mN(`audio`,e,t,NN)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:XN,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>mN(`Pdf`,e,t,XN)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:YN,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>mN(`File`,e,t,YN)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:jN,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>mN(`Embed`,e,t,jN)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:PN,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`toggle`,`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>mN(`Accordion`,e,t,PN)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:HN,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
|
|
184
|
+
`).forEach((e,t)=>{t>0&&r(),e.length>0&&i({type:`text`,value:e})})},o=e=>{let t=e.ordered===!0,n=typeof e.start==`number`?e.start:1,a=e.data,o=typeof a?.bulletMarker==`string`?a.bulletMarker:`-`,c=typeof a?.listMarkerDelimiter==`string`?a.listMarkerDelimiter:`.`;e.children.forEach((e,a)=>{a>0&&r(),i({type:`text`,value:t?`${n+a}${c} `:`${o} `}),e.children.forEach((e,t)=>{t>0&&r(),s(e)})})},s=e=>{switch(e.type){case`paragraph`:case`heading`:e.children.forEach(i);return;case`list`:o(e);return;case`code`:case`html`:a(e.value);return;case`thematicBreak`:i({type:`text`,value:e.data?.sourceRaw??`---`});return;default:{let t=e;if(Array.isArray(t.children)&&t.children.length>0){t.children.forEach((e,t)=>{t>0&&r(),s(e)});return}let n=e;if(typeof n.value==`string`){a(n.value);return}console.warn(JSON.stringify({event:`table-cell-flatten-dropped-block`,nodeType:e.type}))}}};return e.forEach((e,t)=>{t>0&&r(),s(e)}),t}function vM(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(yM(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(yM(t.slice(i),i>0,!1)),a.join(``)}function yM(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===9||t===32;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===9||t===32;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function bM(e,t,n,r){let i=new Map,a=new Map,o={all:c,definitionById:i,footnoteById:a,footnoteCounts:new Map,footnoteOrder:[],one:s};return cE(r,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?i:a,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),o;function s(r,i){return OM(e,t,n,r,i,o)}function c(t){let n=[];if(`children`in t){let r=t.children,i=-1;for(;++i<r.length;){let a=o.one(r[i],t);if(a){let t=i?r[i-1]:void 0;if(t?.type===`break`&&t.data?.sourceStyle!==`html`){if(!Array.isArray(a)&&a.type===e.nodes.text){let t=wM(a.text);a=t.length>0?e.text(t):void 0}else if(!Array.isArray(a)&&a.type!==e.nodes.text){let t=a.firstChild;if(t&&t.type===e.nodes.text){let n=wM(t.text),r=F.from(a.content);a=a.copy(n.length>0?r.replaceChild(0,e.text(n)):r.cut(t.nodeSize))}}}}a&&(Array.isArray(a)?n.push(...a):n.push(a))}}return n}}function xM(e){return e.replaceAll(/\n([^\n])/g,` $1`)}function SM(e,t,n){let r=t.referenceType,i=`]`;if(r===`collapsed`?i+=`[]`:r===`full`&&(i+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[e.text(`![`+(t.alt??``)+i)];let a=n.all(t),o=a[0];o&&o.type===e.nodes.text?a[0]=o.copy(F.from(e.text(`[`+(o.text??``)))):a.unshift(e.text(`[`));let s=a[a.length-1];return s&&s.type===e.nodes.text?a[a.length-1]=s.copy(F.from(e.text((s.text??``)+i))):a.push(e.text(i)),a}function CM(e){throw Error(`unknown markdown node: ${e.type}`)}function wM(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function TM(){}function EM(e){throw Error("Expected node, not `"+JSON.stringify(e)+"`")}function DM(e,t,n,r){return xD(`tagName`,{handlers:e})(t,n,r)}function OM(e,t,n,r,i,a){return xD(`type`,{invalid:EM,unknown:CM,handlers:{toml:TM,yaml:TM,definition:TM,footnoteDefinition:TM,root(t,n,r){let i=r.all(t);return e.topNodeType.create(null,i)},html(t){let r=WT(t.value).children[0];if(r?.type!==`element`)return null;let[,i]=r.children;if(i?.type!==`element`)return null;let o=i.children[0];return o?.type===`element`?DM(n,o,void 0,a)||(t.value?e.text(t.value):null):null},text(t){let n=xM(vM(String(t.value)));return n?e.text(n):null},...t,linkReference(n,r,i){if(t.linkReference)return t.linkReference(n,r,i);let a=String(n.identifier).toUpperCase(),o=i.definitionById.get(a);if(!o)return SM(e,n,i);let s={type:`link`,url:o.url,title:o.title,children:n.children,data:{...o.data,...n.data}};return t.link?.(s,r,i)}}})(r,i,a)}function kM(e,t){return(n,r,i)=>{let a=i.all(n);return e.createAndFill(t?.(n)??null,a)}}function AM(e,t){return(n,r,i)=>{let a=i.all(n),o=e.create(t?.(n)??null);return a.map(e=>e.mark(o.addToSet(e.marks)))}}const jM=function(e,t){let n=OM(t.schema,t.handlers,t.htmlHandlers??{},e,void 0,bM(t.schema,t.handlers,t.htmlHandlers??{},e));return n.check(),n},MM=function(e){this.compiler=function(t){return jM(t,e)}};function NM(e,t){let n={one:r,all:u,nodeHandlers:e,markHandlers:t};function r(e,t){let r=e.type.schema,i=e.type.name,a=n.nodeHandlers[i];if(a)return a(e,t,n);if(e.type===r.topNodeType){let t=n.all(e);return t.some(e=>YT(e,`root`)),{type:`root`,children:t}}return e.type===r.nodes.text?{type:`text`,value:e.text}:null}function i(e){if(e.length===0)return[];let t=e[0].marks,n=[];for(let r of t){let t=!0;for(let n=1;n<e.length;n++)if(!e[n].marks.some(e=>e.eq(r))){t=!1;break}t&&n.push(r)}return n}function a(e,t){let n=e.findIndex(e=>e.eq(t));return n===-1?e:e.slice(0,n).concat(e.slice(n+1))}function o(e,t){let n=[];for(let r of e)t.some(e=>e.eq(r))&&n.push(r);return n}function s(e,t,r){let i=n.markHandlers[e.type.name];if(!i)return r;let a=i(e,t,r,n);return(Array.isArray(a)?a:[a]).filter(e=>e!=null)}function c(e,t){let r=[];for(let i of e){let e=n.one(i.node,t);e!=null&&r.push(e)}return r}function l(e,t){if(e.length===0)return[];if(e.every(e=>e.marks.length===0))return c(e,t);let n=i(e);if(n.length>0){let r=n[0];return s(r,t,l(e.map(e=>({node:e.node,marks:a(e.marks,r)})),t))}let r=[],u=[e[0]],d=e[0].marks.slice();for(let t=1;t<e.length;t++){let n=e[t],i=o(d,n.marks),a=d.length===0&&n.marks.length===0;i.length>0||a?(u.push(n),d=a?[]:i):(r.push(u),u=[n],d=n.marks.slice())}if(r.push(u),r.length===1&&e.length>1){console.warn(`[mdast-util-from-prosemirror] degenerate mark partition; falling back to per-span rendering`,{spanCount:e.length,firstSpanMarks:e[0]?.marks.map(e=>e.type.name),lastSpanMarks:e[e.length-1]?.marks.map(e=>e.type.name)});let n=[];for(let r of e)for(let e of l([r],t))n.push(e);return n}let f=[];for(let e of r)for(let n of l(e,t))f.push(n);return f}function u(e){return l(e.children.map(e=>({node:e,marks:e.marks})),e)}return n}function PM(e,t){return NM(t.nodeHandlers,t.markHandlers).one(e)}function FM(e,t){return(n,r,i)=>{let a=i.all(n);return{type:e,...t?.(n),children:a}}}function IM(e,t){return(n,r,i)=>({type:e,...t?.(n),children:i})}function LM(e,t){let n=0;for(let r=0;r<t.length&&n<e.length;r++)e[n]===t[r]&&n++;return n===e.length}const RM=new Set([`sourceRaw`,`sourceDirty`,`position`]),zM=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),BM={type:`__br__`},VM=/^<br\s*\/?>$/i;function HM(e){let t=qM(e,HM);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:UM(t.content)}:t}function UM(e){let t=[];for(let n of e){let e=WM(n);e.length!==0&&(t.length>0&&t.push(BM),t.push(...e))}return t}function WM(e){return e.text!==void 0||e.type===`hardBreak`||e.type===`jsxInline`?[e]:!e.content||e.content.length===0?[]:e.content.some(e=>e.text===void 0&&e.type!==`hardBreak`&&e.type!==`jsxInline`&&!!e.content)?UM(e.content):e.content}function GM(e){return e.type===`hardBreak`||e.type===BM.type||e.text!==void 0&&VM.test(e.text.trim())?BM:qM(e,GM)}const KM=[{label:`table-cell-block-flatten`,severity:`pm-model-caused`,rationale:`GFM table cells have no block spelling; a block placed in a cell is flattened to inline on serialize, so a cell-with-blocks and a cell-with-inline describe the same persisted document.`,proofPointer:`markdown/table-cell-flatten.ts flattenCellBlocks (table-cell-flatten-dropped-block event)`,canonicalize:HM},{label:`void-hardbreak-br`,severity:`serializer-caused`,rationale:`A void hardBreak inside a table cell or heading serializes to a literal <br /> that a fresh parse keeps as text; the node form and the literal form are the same break.`,proofPointer:`markdown/void-br-promoter.ts + markdown/to-markdown-handlers.ts break handler`,canonicalize:GM}];function qM(e,t){return e.content?{...e,content:e.content.map(t)}:e}function JM(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=YM(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:YM(e.attrs,t)})).sort((e,t)=>ZM(e).localeCompare(ZM(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>JM(e,t))),n}function YM(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(RM.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?XM(i,t):i)}return Object.keys(n).length>0?n:null}function XM(e,t){if(Array.isArray(e))return e.map(e=>XM(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=XM(i,t));return n}return e}function ZM(e){return JSON.stringify(e,(e,t)=>{if(t&&typeof t==`object`&&!Array.isArray(t)){let e={};for(let n of Object.keys(t).sort())e[n]=t[n];return e}return t})}function QM(e){let t=``,n=e=>{if(e.text!==void 0&&(t+=e.text),e.content)for(let t of e.content)n(t)};return n(e),t.replace(/\s+/g,``)}function $M(e){let t=[],n=e=>{if(e.type&&zM.has(e.type)){let n=e.type===`jsxComponent`?String(e.attrs?.componentName??``):``;t.push(n?`${e.type}:${n}`:e.type)}if(e.content)for(let t of e.content)n(t)};return n(e),t.sort()}function eN(e){let t=e,n=[];for(let e of KM){let r=ZM(t),i=e.canonicalize(t);ZM(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function tN(e,t,n={}){let r=eN(e),i=eN(t),a=[...new Set([...r.fired,...i.fired])];if(!LM(QM(r.normalized),QM(i.normalized)))return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let o=$M(r.normalized),s=$M(i.normalized);if(ZM(o)!==ZM(s))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${o.join(`, `)}] vs [${s.join(`, `)}]`};let c=JM(r.normalized,n.ignoreAttrs),l=JM(i.normalized,n.ignoreAttrs);return ZM(c)===ZM(l)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:nN(c,l)}}function nN(e,t,n=`doc`){let r=e,i=t;if(!r||!i)return`${n}: node presence differs`;if(r.type!==i.type)return`${n}: type ${String(r.type)} vs ${String(i.type)}`;let a=r.content??[],o=i.content??[];if(a.length!==o.length)return`${n}(${String(r.type)}): child count ${a.length} vs ${o.length}`;for(let e=0;e<a.length;e++)if(ZM(a[e])!==ZM(o[e]))return nN(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function rN(e,t,n){return!tN(e,t,{ignoreAttrs:n}).equivalent}const iN=new Set([`src`,`href`,`size`]),aN=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function oN(e){if(Array.isArray(e))return e.map(e=>oN(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))iN.has(n)||(t[n]=oN(r));return t}return e}function sN(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&aN.has(e.attrs.componentName)?oN(e):e.content?{...e,content:e.content.map(sN)}:e}function cN(e){if(Array.isArray(e))return e.map(e=>cN(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=cN(r));return t}return e}function lN(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=lN(t);if(e)return e}}function uN(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=lN(e.parse(r)),o=a?sN(cN(a)):null;if(n.size>=t){let e=n.keys().next().value;e!==void 0&&n.delete(e)}return n.set(r,o),o};return{isDiverged(e){if(e.type!==`jsxComponent`||!e.attrs||e.attrs.kind===`expression`)return!1;let t=e.attrs.sourceRaw;if(typeof t!=`string`||t.length===0)return!1;let n=r(t);return n?rN(n,sN(cN(e))):!1}}}function dN(e,t){let n=Array.isArray(e.attrs.attributes)?e.attrs.attributes.filter(e=>typeof e==`object`&&!!e&&`type`in e):[],r=e.attrs.props??{},i=new Map,a=new Set;if(t)for(let e of t)e.omitOnDefault===!0&&`defaultValue`in e&&e.defaultValue!==void 0&&i.set(e.name,e.defaultValue),e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&a.add(e.name);for(let[e,t]of Object.entries(r)){let r=n.findIndex(t=>t.type===`mdxJsxAttribute`&&t.name===e);if(i.has(e)&&Object.is(i.get(e),t)){r>=0&&n.splice(r,1);continue}if(a.has(e)&&t===``){r>=0&&n.splice(r,1);continue}if(r>=0){let e=n[r];if(e.type===`mdxJsxAttribute`&&e.value!=null&&typeof e.value==`object`&&e.value.type===`mdxJsxAttributeValueExpression`&&fN(e.value.value,t))continue}let o=pN(e,t);r>=0?n[r]=o:n.push(o)}return n}function fN(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function pN(e,t){if(t===!0)return{type:`mdxJsxAttribute`,name:e,value:null};if(t===!1)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:`false`}};if(t==null)return{type:`mdxJsxAttribute`,name:e,value:null};if(typeof t==`string`)return{type:`mdxJsxAttribute`,name:e,value:t};if(typeof t==`number`)return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:JSON.stringify(t)}};if(typeof t==`object`){let n;try{n=JSON.stringify(t)}catch{n=String(t)}return{type:`mdxJsxAttribute`,name:e,value:{type:`mdxJsxAttributeValueExpression`,value:n}}}return{type:`mdxJsxAttribute`,name:e,value:String(t)}}function mN(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:dN(t,r),children:n.all(t),data:{}}}function hN(e,t,n){let r=t.attrs.props?.children;return{type:`mdxJsxTextElement`,name:e,attributes:dN(t,n),children:typeof r==`string`&&r!==``?[{type:`text`,value:r}]:[],data:{}}}const gN=/^[A-Za-z0-9]{20,}$/,_N=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function vN(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function yN(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return gN.test(n)?n:null}function bN(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!vN(t.hostname))return null;let n=yN(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&_N.test(r)?r:null}}function xN(e){return bN(e)!==null}function SN(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function CN(e){if(typeof e!=`string`||e.length===0)return!1;let t;try{t=new URL(e)}catch{return!1}return t.protocol!==`http:`&&t.protocol!==`https:`?!1:SN(t.hostname)}const wN=/^[A-Za-z0-9_-]{11}$/;function TN(e){let t=e.toLowerCase();return t===`youtube.com`||t===`www.youtube.com`||t===`m.youtube.com`||t===`music.youtube.com`||t===`youtu.be`||t===`youtube-nocookie.com`||t===`www.youtube-nocookie.com`}function EN(e){if(e.length===0)return null;if(/^[0-9]+$/.test(e)){let t=Number.parseInt(e,10);return t>0?t:null}let t=e.match(/^(?:([0-9]+)h)?(?:([0-9]+)m)?(?:([0-9]+)s?)?$/);if(!t)return null;let n=t[1]?Number.parseInt(t[1],10):0,r=t[2]?Number.parseInt(t[2],10):0,i=t[3]?Number.parseInt(t[3],10):0,a=n*3600+r*60+i;return a>0?a:null}function DN(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return wN.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return wN.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function ON(e){if(typeof e!=`string`||e.length===0)return null;let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`http:`&&t.protocol!==`https:`||!TN(t.hostname))return null;let n=DN(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?EN(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}const kN=[{name:`type`,type:`enum`,enumValues:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`],defaultValue:`note`,required:!1,description:`Callout variant`},{name:`title`,type:`string`,required:!1,description:`Optional heading shown above the body`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Lightbulb`)",iconPicker:!0},{name:`color`,type:`string`,required:!1,advanced:!0,description:"Optional accent color override (hex — e.g. `#F05032`)",colorPicker:!0},{name:`collapsible`,type:`boolean`,required:!1,defaultValue:!1,advanced:!0,description:"Render as a foldable `<details>` (Obsidian `[!TYPE]+/-`)"},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,description:`When collapsible, start in the open state`,hideWhen:e=>e.collapsible!==!0},{name:`children`,type:`reactnode`,required:!0,description:`Callout content`}],AN=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:u,autoFocus:!0},{name:`alt`,type:`string`,required:!0,description:`Alt text`},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Image width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Image height`},{name:`srcset`,type:`string`,required:!1,advanced:!0,description:`Responsive image candidate set (e.g. "x.png 1x, y.png 2x")`},{name:`sizes`,type:`string`,required:!1,advanced:!0,description:`Responsive image sizes hint paired with srcset`},{name:`loading`,type:`enum`,enumValues:[`eager`,`lazy`],defaultValue:`lazy`,required:!1,advanced:!0,omitOnDefault:!0,description:`Native img loading strategy (defaults to lazy)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`decoding`,type:`enum`,enumValues:[`sync`,`async`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Hint for how the browser should decode the image`},{name:`fetchpriority`,type:`enum`,enumValues:[`high`,`low`,`auto`],defaultValue:`auto`,required:!1,advanced:!0,omitOnDefault:!0,description:`Resource fetch priority hint`},{name:`crossorigin`,type:`enum`,enumValues:[`anonymous`,`use-credentials`],required:!1,advanced:!0,description:`CORS mode for the image fetch`},{name:`referrerpolicy`,type:`string`,required:!1,advanced:!0,description:`Referrer policy for the image fetch (HTML referrerpolicy values)`},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],jN=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Embedded page URL (must start with http:// or https://)`,autoFocus:!0},{name:`title`,type:`string`,required:!1,description:`Iframe title (accessible label for screen readers)`},{name:`width`,type:`string`,required:!1,advanced:!0,description:`Embed width as a CSS length (e.g. "100%", "640px")`,cssLengthInput:!0},{name:`height`,type:`string`,required:!1,advanced:!0,description:`Embed height as a CSS length (e.g. "26rem", "480px")`,cssLengthInput:!0},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],MN=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:f,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 video controls (defaults to true)`,hideWhen:e=>typeof e.src==`string`&&(CN(e.src)||xN(e.src))},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`poster`,type:`string`,required:!1,advanced:!0,description:`Poster image URL shown before playback`,accept:u,hideWhen:e=>typeof e.src==`string`&&(CN(e.src)||xN(e.src))},{name:`width`,type:`number`,required:!1,advanced:!0,description:`Video width`},{name:`height`,type:`number`,required:!1,advanced:!0,description:`Video height`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`,hideWhen:e=>typeof e.src==`string`&&xN(e.src)},{name:`playsinline`,type:`boolean`,required:!1,advanced:!0,description:`Play inline on iOS rather than entering fullscreen`,hideWhen:e=>typeof e.src==`string`&&(CN(e.src)||xN(e.src))},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the video to preload`,hideWhen:e=>typeof e.src==`string`&&(ON(e.src)!==null||CN(e.src)||xN(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],NN=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:S,autoFocus:!0},{name:`controls`,type:`boolean`,required:!1,defaultValue:!0,advanced:!0,omitOnDefault:!0,description:`Show native HTML5 audio controls (defaults to true)`},{name:`autoplay`,type:`boolean`,required:!1,advanced:!0,description:`Begin playback as soon as possible (usually requires muted)`},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Native HTML title attribute (tooltip)`},{name:`muted`,type:`boolean`,required:!1,advanced:!0,description:`Mute audio on load`},{name:`loop`,type:`boolean`,required:!1,advanced:!0,description:`Restart from the beginning when playback ends`},{name:`preload`,type:`enum`,enumValues:[`none`,`metadata`,`auto`],required:!1,advanced:!0,description:`Hint for how much of the audio to preload`}],PN=[{name:`title`,type:`string`,required:!0,description:`Accordion heading shown inside the <summary>`},{name:`defaultOpen`,type:`boolean`,required:!1,defaultValue:!1,description:`When true, the accordion renders expanded on initial load`},{name:`icon`,type:`string`,required:!1,advanced:!0,description:"Custom lucide icon override (e.g. `lucide:Rocket`)",iconPicker:!0},{name:`description`,type:`string`,required:!1,advanced:!0,description:`Optional subtitle rendered below the title inside <summary>`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#advanced-options`)"},{name:`name`,type:`string`,required:!1,advanced:!0,description:`HTML5 <details name=> group — siblings with the same name are mutually exclusive`}],FN=[kN[0],kN[1],kN[4],kN[5],kN[6]],IN=[AN[0],AN[1],AN[7]],LN=[PN[0],PN[1],PN[4],PN[5]],RN=[{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`,`justify`],required:!1,defaultValue:`center`,description:"Block alignment from the `<div align>` attribute."},{name:`tag`,type:`string`,required:!1,defaultValue:`div`,hidden:!0,description:`Source wrapper tag (div or center).`},{name:`sourceAttrs`,type:`string`,required:!1,defaultValue:``,hidden:!0,description:`Raw opener-tag attribute bytes preserved for round-trip.`}],zN=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],BN=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],VN=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],HN=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],UN=[{name:`label`,type:`string`,required:!0,autoFocus:!0,defaultValue:`Tab`,description:`Tab strip label — shown in the clickable pill at the top`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#tab-npm`)"}],WN=[{name:`formula`,type:`string`,required:!0,autoFocus:!0,language:`latex`,description:`LaTeX math source (rendered with KaTeX in the browser)`},{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#eq-pythagoras`)"},{name:`language`,type:`string`,required:!1,advanced:!0,description:"Forward-compat hint for the math source language (default `latex`). Reserved for future MathJax / Typst / AsciiMath substrates."}],GN=[WN[0]],KN=[WN[0]],qN=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],JN=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],YN=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],XN=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:d,autoFocus:!0},{name:`title`,type:`string`,required:!1,advanced:!0,description:`Accessible label for the embedded PDF viewer`},{name:`anchor`,type:`string`,required:!1,advanced:!0,description:"PDF viewer parameters as a single URL-fragment string (e.g. `page=3&height=600`)"}],ZN=[{name:`src`,type:`string`,required:!0,description:"Path of the source doc, extension-less (e.g. `api-spec`).",autoFocus:!0},{name:`anchor`,type:`string`,required:!0,description:"Id of the `<MirrorSource>` block within the source doc."}],QN=[{name:`id`,type:`string`,required:!0,description:"Stable id agents and authors use to reference this block from `<Mirror>` elsewhere.",autoFocus:!0},{name:`children`,type:`reactnode`,required:!0,description:`Block content this MirrorSource owns — paragraphs, callouts, code, nested JSX, anything.`}];function $N(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function eP(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function tP(e){let t=e.attrs.props,n=t?.target??``,r=typeof t?.alias==`string`&&t.alias.length>0?t.alias:null,i=typeof t?.anchor==`string`&&t.anchor.length>0?t.anchor:null,a=r??(i?`${n}#${i}`:n);return{type:`wikiLinkEmbed`,value:a,data:{target:n,anchor:i,alias:r},children:[{type:`text`,value:a}]}}const nP=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:kN,icon:`MessageSquareWarning`,category:`content`,displayName:`Callout`,description:`Alert / admonition with 15 type variants — 5 GFM (note, tip, important, warning, caution) plus 10 Obsidian-parity (abstract, info, todo, success, question, failure, danger, bug, example, quote)`,searchTerms:[`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`,`alert`,`admonition`,`callout`],serialize:(e,t)=>mN(`Callout`,e,t,kN)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:AN,icon:`Image`,category:`media`,displayName:`Image`,description:`Image with click-to-zoom and HTML-native attributes`,searchTerms:[`image`,`zoom`,`picture`,`photo`],placeholder:{label:`Add an image`},serialize:(e,t)=>mN(`img`,e,t,AN)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:MN,icon:`SquarePlay`,category:`media`,displayName:`Video`,description:`HTML5 video player with native controls`,searchTerms:[`video`,`media`,`player`,`mp4`,`webm`,`movie`],placeholder:{label:`Add a video`},serialize:(e,t)=>mN(`video`,e,t,MN)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:NN,icon:`Volume2`,category:`media`,displayName:`Audio`,description:`HTML5 audio player with native controls`,searchTerms:[`audio`,`sound`,`music`,`mp3`,`podcast`,`player`],placeholder:{label:`Add audio`},serialize:(e,t)=>mN(`audio`,e,t,NN)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:XN,icon:`FileText`,category:`media`,displayName:`PDF`,description:"Embedded PDF viewer (`#page=N` to open at page N, `#height=N` for viewer height)",searchTerms:[`pdf`,`document`,`embed`,`pdfjs`],placeholder:{label:`Add a PDF`},serialize:(e,t)=>mN(`Pdf`,e,t,XN)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:YN,icon:`Paperclip`,category:`media`,displayName:`File`,description:`Downloadable file attachment — inline row with name + size + download link`,searchTerms:[`file`,`attachment`,`download`,`document`,`zip`,`docx`,`doc`],placeholder:{label:`Add a file`},serialize:(e,t)=>mN(`File`,e,t,YN)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:jN,icon:`AppWindow`,category:`media`,displayName:`Embed`,description:'Inline web embed (iframe) — drop a URL, get a resizable preview pane. For YouTube / Vimeo / Loom prefer `<video src="…">` (player props, click-facade); `<Embed>` auto-rewrites watch URLs as a fallback.',searchTerms:[`embed`,`iframe`,`website`,`page`,`inline`,`frame`,`preview`],placeholder:{label:`Embed a URL`},serialize:(e,t)=>mN(`Embed`,e,t,jN)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:PN,icon:`ChevronRight`,category:`content`,displayName:`Accordion`,description:"Standalone expand/collapse via native HTML5 <details>/<summary>. Group siblings with the `name` prop for exclusive-accordion UX.",searchTerms:[`accordion`,`expandable`,`details`,`disclosure`,`collapse`,`fold`],exampleBody:`Body content revealed when the accordion is expanded.`,serialize:(e,t)=>mN(`Accordion`,e,t,PN)},{name:`Toggle`,surface:`canonical`,hasChildren:!0,props:PN,icon:`ChevronRight`,category:`content`,displayName:`Toggle`,description:"Standalone expand/collapse block (Notion-style). Same render + props as `<Accordion>` — pick whichever vocabulary matches the vault.",searchTerms:[`toggle`,`collapsible`,`expand`,`details`,`disclosure`,`fold`],exampleBody:`Body content revealed when the toggle is expanded.`,serialize:(e,t)=>mN(`Toggle`,e,t,PN)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:HN,icon:`LayoutPanelTop`,category:`content`,displayName:`Tabs`,description:"Horizontal tab strip + active panel below. Each `<Tab>` child is one panel; clickable pills at the top switch the active one. Active selection is ephemeral (resets on reload).",searchTerms:[`tabs`,`tabbed`,`panels`,`tabgroup`,`switcher`],exampleBody:`<Tab label="One">Body of the first tab panel.</Tab>
|
|
185
185
|
<Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>mN(`Tabs`,e,t,HN)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:UN,icon:`PanelTop`,category:`content`,displayName:`Tab`,description:"A single tab panel inside a `<Tabs>` container — carries the strip label and the block-content body.",searchTerms:[`tab`,`panel`],exampleBody:"Panel content — must be nested inside a `<Tabs>` parent.",serialize:(e,t)=>mN(`Tab`,e,t,UN)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:WN,icon:`Sigma`,category:`content`,displayName:`Math`,description:`Block math equation rendered with KaTeX from a LaTeX source string`,searchTerms:[`math`,`latex`,`equation`,`formula`,`katex`,`tex`],serialize:(e,t)=>mN(`Math`,e,t,WN)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:qN,icon:`Workflow`,category:`content`,displayName:`Mermaid`,placeholder:{label:`Add a Mermaid diagram`},description:"Diagram rendered from Mermaid source (flowchart, sequence, class, state, ER, gantt, pie). Authored exclusively as ` ```mermaid ` fenced code.",searchTerms:[`mermaid`,`diagram`,`flowchart`,`graph`,`sequence`,`sequencediagram`,`class`,`state`,`er`,`erdiagram`,`gantt`,`pie`,`chart`],serialize:e=>({type:`code`,lang:`mermaid`,meta:null,value:e.attrs.props?.chart??``})},{name:`Mirror`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:ZN,icon:`CopyPlus`,category:`content`,displayName:`Mirror`,description:"Render a read-only copy of a `<MirrorSource>` block from another doc. Use to keep the same content in sync across multiple docs without copy-paste — edits land at the source, every Mirror reflects the change.",searchTerms:[`mirror`,`sync`,`synced`,`transclude`,`embed`,`reference`,`shared block`],serialize:(e,t)=>mN(`Mirror`,e,t,ZN)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:QN,icon:`GitBranch`,category:`content`,displayName:`Mirror Source`,description:'Mark a block as the source of truth for content that appears in multiple docs. Wrap any block content; `<Mirror src="…" anchor="<id>">` references render this verbatim read-only at every call-site. Edit here, propagate everywhere.',searchTerms:[`mirror source`,`sync source`,`source block`,`master block`,`shared`],exampleBody:"Authoritative content lives inside this block — edits here propagate to every `<Mirror>` that references this id.",serialize:(e,t)=>mN(`MirrorSource`,e,t,QN)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:FN,icon:`MessageSquareWarning`,category:`content`,displayName:`GFM Callout`,description:"GFM blockquote alert (`> [!NOTE]`) — read-only compat. Preserves `> [!NOTE]` syntax on round-trip; insert a fresh Callout block for the full prop surface.",rendersAs:`Callout`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=new Set([`note`,`tip`,`important`,`warning`,`caution`,`abstract`,`info`,`todo`,`success`,`question`,`failure`,`danger`,`bug`,`example`,`quote`]),i=n?.type??`note`;return{type:`blockquote`,children:[{type:`html`,value:`[!${(r.has(i.toLowerCase())?i:`note`).toUpperCase()}]${n?.collapsible?n.defaultOpen===!1?`-`:`+`:``}${n?.title?` ${n.title}`:``}`},...t.all(e).filter(e=>{if(e.type!==`paragraph`)return!0;let t=e;return Array.isArray(t.children)&&t.children.length>0})]}}},{name:`CommonMarkImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:IN,icon:`Image`,category:`media`,displayName:`CommonMark Image`,description:'CommonMark image (``) — read-only compat. Preserves `` syntax on round-trip; insert a fresh Image block for the full HTML-native attribute surface (srcset, sizes, decoding, etc.).',rendersAs:`img`,translateProps:e=>e,serialize:e=>{let t=e.attrs.props;return{type:`paragraph`,children:[{type:`image`,url:t?.sourceUrl??t?.src??``,alt:t?.alt??``,title:t?.title??null}]}}},{name:`WikiEmbedImage`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:zN,icon:`ZoomIn`,category:`media`,displayName:`Wiki Embed Image`,description:"Obsidian-style `![[file.png]]` wiki-embed — read-only compat. Edit the alt-text via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`img`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,alt:t??n}},serialize:tP},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:BN,icon:`Film`,category:`media`,displayName:`Wiki Embed Video`,description:"Obsidian-style `![[clip.mp4]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`video`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:tP},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:VN,icon:`Volume2`,category:`media`,displayName:`Wiki Embed Audio`,description:"Obsidian-style `![[song.mp3]]` wiki-embed — read-only compat. Edit the title via the alias slot; the embed target / anchor stay on the prop bag and round-trip byte-identical.",rendersAs:`audio`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.target==`string`?e.target:``;return{src:e.src,title:t??n}},serialize:tP},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:JN,icon:`Paperclip`,category:`media`,displayName:`Wiki Embed File`,description:"Obsidian-style `![[file.zip]]` wiki-embed — read-only compat for arbitrary downloadable attachments. Renders through the `File` canonical (inline row with file-up icon + bold name + optional dim size). Edit the display name via the alias slot.",rendersAs:`File`,translateProps:e=>{let t=typeof e.alias==`string`&&e.alias.length>0?e.alias:null,n=typeof e.size==`string`&&e.size.length>0?e.size:null;return{src:e.src,name:t??void 0,size:n??void 0}},serialize:tP},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:LN,icon:`ChevronRight`,category:`content`,displayName:`HTML5 Details`,description:"HTML5 `<details><summary>` collapsible — read-only compat. Preserves `<details>` syntax on round-trip; insert a fresh Accordion block for icon / description / group-name props.",rendersAs:`Accordion`,translateProps:e=>e,serialize:(e,t)=>{let n=e.attrs.props,r=n?.defaultOpen?` open`:``,i=n?.name?` name="${$N(n.name)}"`:``,a=n?.id?` id="${$N(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${eP(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`HtmlAlignBlock`,surface:`canonical`,hasChildren:!0,props:RN,icon:`AlignCenter`,category:`content`,displayName:`Align block`,description:"GitHub-style `<div align>` wrapper. Children render as normal blocks with the alignment applied; the `<div align>` syntax is preserved on round-trip.",searchTerms:[`align`,`center`,`centered`,`div`],serialize:(e,t)=>{let n=e.attrs.props,r=n?.tag===`center`?`center`:`div`,i=typeof n?.align==`string`&&n.align?n.align:null,a=typeof n?.sourceAttrs==`string`?n.sourceAttrs:``,o=/(\balign\s*=\s*)(?:"[^"]*"|'[^']*'|[^\s"'<>]+)/i;return i!==null&&(r===`div`||i!==`center`)?a=o.test(a)?a.replace(o,`$1"${$N(i)}"`):`${a} align="${$N(i)}"`:(i===null||r===`center`&&i===`center`)&&(a=a.replace(RegExp(`\\s*${o.source}`,`i`),``)),{type:`mdxJsxFlowElement`,name:`HtmlAlignBlock`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<${r}${a}>`,closer:`</${r}>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:GN,icon:`Sigma`,category:`content`,displayName:`Dollar Math`,description:"Block math via `$$…$$` syntax — read-only compat. Preserves `$$…$$` form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`math`,value:e.attrs.props?.formula??``})},{name:`MathFence`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:KN,icon:`Sigma`,category:`content`,displayName:`Math Fence`,description:"Block math via ` ```math ` fenced code syntax — read-only compat. Preserves the fence form on round-trip; insert a fresh Math block for the full prop surface (id, language).",rendersAs:`Math`,translateProps:e=>e,serialize:e=>({type:`code`,lang:`math`,meta:null,value:e.attrs.props?.formula??``})}],rP={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>mN(e.attrs.componentName||`*`,e,t)};function iP(){let e=new Map;e.set(`*`,rP);for(let t of nP)e.set(t.name,t);return{get(t){return e.get(t)},getOrWildcard(t){return e.get(t)??e.get(`*`)},set(t,n){e.set(t,n)},has(t){return e.has(t)},entries(){return e.entries()}}}function aP(){let e=globalThis;return e.__okYpsCounters||={block:0,inline:0},e.__okYpsCounters}const oP={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function sP(){oP.parseFallback.blockLevel++}function cP(){oP.parseFallback.wholeDoc++}function lP(){oP.parseFallback.wholeDocBudget++}function uP(){let e=aP();return{parseFallback:{...oP.parseFallback},ypsMismatch:{block:e.block,inline:e.inline},jsxRenderFailure:{...oP.jsxRenderFailure},jsxAutoConvertFailed:{...oP.jsxAutoConvertFailed},jsxAutoConvertSucceeded:{...oP.jsxAutoConvertSucceeded},jsxPropDropped:{...oP.jsxPropDropped},jsxMoveFailed:{...oP.jsxMoveFailed},jsxStuckCopyFailed:{...oP.jsxStuckCopyFailed},jsxStuckDeleteFailed:{...oP.jsxStuckDeleteFailed},jsxPopoverCloseRestoreFailed:{...oP.jsxPopoverCloseRestoreFailed},jsxKeyboardDeleteFailed:{...oP.jsxKeyboardDeleteFailed},blockGripClickSelectFailed:{...oP.blockGripClickSelectFailed},jsxArrowNodeSelectFailed:{...oP.jsxArrowNodeSelectFailed}}}const dP=/^(`{3,}|~{3,})/gm;function fP(e){let t=[],n=null;for(let r of e.matchAll(dP)){let e=r[1],i=r.index;n?e[0]===n.marker[0]&&e.length>=n.marker.length&&(t.push([n.offset,i+r[0].length]),n=null):n={marker:e,offset:i}}return n&&t.push([n.offset,e.length]),t}function pP(e,t){return t.some(([t,n])=>e>=t&&e<n)}const mP=/`+/g;function hP(e){let t=[];mP.lastIndex=0;for(let n of e.matchAll(mP))t.push({offset:n.index,length:n[0].length});let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let i=e+1;i<t.length;i++){let a=t[i];if(a.length===r.length){n.push([r.offset,a.offset+a.length]),e=i;break}}}return n}const gP=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function _P(e){let t=fP(e),n=[];for(let r of e.matchAll(gP))pP(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
|
|
186
186
|
`)}\n\n`:``}function vP(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return xP(e,t.parse,0,n)}function yP(e){return e.calls>=1e3?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=500}function bP(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,500),stack:e.stack?.split(`
|
|
187
187
|
`).slice(0,4).join(`
|
|
@@ -342,4 +342,4 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
342
342
|
`);if(!(t[0]??``).startsWith(`template:`))return null;let n=[t[0]??``],r=1;for(;r<t.length;){let e=t[r]??``;if(/^[ \t]/.test(e)){n.push(e),r++;continue}if(e.trim()===``){let i=r+1;for(;i<t.length&&(t[i]??``).trim()===``;)i++;if(i<t.length&&/^[ \t]/.test(t[i]??``)){n.push(e),r++;continue}}break}let i=k5(n.join(`
|
|
343
343
|
`))[O5];return{identity:typeof i==`object`&&i&&!Array.isArray(i)?i:{},docFrontmatterText:t.slice(r).join(`
|
|
344
344
|
`).replace(/\n+$/,``)}}function N5(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=em(t);if(n===``)return{identity:{},starterContent:t};let i=nm(n),a=M5(i);if(a)return{identity:a.identity,starterContent:A5(a.docFrontmatterText,r)};let{frontmatter:o}=em(r);if(o!==``)return{identity:k5(i),starterContent:r};let s=k5(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:A5(i,r)}}function P5(e,t){let{docFrontmatterText:n,markdown:r}=j5(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,je.stringify)({[O5]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function F5(e){return N5(e).starterContent}const I5=`(agent thread)`;function L5(){let e=!1,t=``,n=0;return r=>{let i=R5(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function R5(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}const z5=/^(#{1,6})\s+(.+)$/;function B5(e,t){let n=(e.endsWith(`\r`)?e.slice(0,-1):e).match(z5);if(!n)return null;let r=n[2].trim(),i=bY(r,t);return i?{level:n[1].length,text:r,slug:i}:null}const V5=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],H5={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function U5(e,t=V5){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const W5={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function G5(e){return e?W5[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}const K5={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`};function q5(e){let t=e?.trim();return t?K5[G5(t)]??t:`Agent`}function J5(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}const Y5=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function X5(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Z5(e){let t=e.trim();return Y5.test(t)||t.startsWith(`//`)}function Q5(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if(Z5(n))return{kind:`external`,url:n};let r=n.indexOf(`#`),i=r<0?n:n.slice(0,r),a=Ze(i,t);if(a)return{kind:`doc`,docName:a,anchor:r<0?null:n.slice(r+1)};let o=Xe(i,t);if(o)return{kind:`doc`,docName:o,anchor:r<0?null:n.slice(r+1)};let s=J5(n,t);if(s)return{kind:`doc`,docName:s.docName,anchor:s.anchor};let c=X5(n);return c&&c!==`md`&&c!==`mdx`?{kind:`asset`,url:n,ext:c}:null}function $5(e,t){let n=e.trim();if(!n)return null;if(Z5(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=X5(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function e7(e,t){let n=e.trim();if(!n||Y5.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function t7(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function n7(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function r7(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function i7(e){return e.split(`/`).filter(e=>e!==``)}function a7(e,t){let n=r7(t);return e===``||n===e?!0:n.startsWith(`${e}/`)}function o7(e,t){let n=r7(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:i7(r).length}function s7(e,t){let n=i7(e),r=i7(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function c7(){let e=new Map;function t(t){let n=t7(t);if(n===``)return;let r=n7(n);if(r===``)return;let i=r.toLowerCase(),a=e.get(i);if(!a){e.set(i,[n]);return}a.includes(n)||a.push(n)}function n(t){let n=t7(t),r=n7(n).toLowerCase(),i=e.get(r);if(!i)return;let a=i.indexOf(n);a!==-1&&(i.splice(a,1),i.length===0&&e.delete(r))}function r(e,r){n(e),t(r)}function i(t,n){let r=t.toLowerCase(),i=e.get(r);if(!i||i.length===0)return null;if(i.length===1)return i[0];let a=r7(t7(n)),o=[],s=[];for(let e of i)a7(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=o7(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=o7(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=s7(a,r7(t));for(let r=1;r<e.length;r++){let i=e[r],o=s7(a,r7(i));(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(s)}function a(){let t=new Map;for(let[n,r]of e)t.set(n,[...r]);return t}function o(){e.clear()}return{add:t,remove:n,rename:r,resolveEmbed:i,clear:o,snapshot:a,size:()=>e.size}}function l7(e){if(!e)return[];let t=e.split(`/`),n=[],r=``;for(let e of t)r=r?`${r}/${e}`:e,n.push(r);return n}function u7(e,t){if(e.size===0)return new Set;if(t===``)return new Set(e);let n=new Set,r=`${t}/`;for(let i of e)(i===t||i.startsWith(r))&&n.add(i);return n}export{s2 as $,Uy as $a,mY as $i,YQ as $n,Re as $o,gZ as $r,V$ as $t,u5 as A,mU as Aa,hX as Ai,a$ as An,Tt as Ao,rQ as Ar,A1 as At,_8 as B,vb as Ba,oX as Bi,e$ as Bn,dt as Bo,kZ as Br,i1 as Bt,y5 as C,pW as Ca,xX as Ci,l$ as Cn,Mt as Co,XZ as Cr,ge as Cs,q1 as Ct,_5 as D,cW as Da,OX as Di,i$ as Dn,At as Do,iQ as Dr,N1 as Dt,f5 as E,_W as Ea,kX as Ei,r$ as En,jt as Eo,$Z as Er,V1 as Et,X8 as F,uP as Fa,JY as Fi,P$ as Fn,bt as Fo,NZ as Fr,p1 as Ft,C2 as G,_b as Ga,mX as Gi,LQ as Gn,mt as Go,bZ as Gr,Z$ as Gt,C8 as H,Sb as Ha,aX as Hi,MQ as Hn,ft as Ho,OZ as Hr,X$ as Ht,$8 as I,tN as Ia,cX as Ii,k$ as In,xt as Io,jZ as Ir,n1 as It,m2 as J,lb as Ja,EY as Ji,WQ as Jn,lt as Jo,fZ as Jr,PQ as Jt,w2 as K,ob as Ka,VY as Ki,VQ as Kn,gt as Ko,uZ as Kr,Y$ as Kt,t5 as L,hb as La,lX as Li,A$ as Ln,St as Lo,AZ as Lr,o1 as Lt,r5 as M,VV as Ma,tX as Mi,KQ as Mn,Dt as Mo,TZ as Mr,y1 as Mt,q8 as N,BV as Na,qY as Ni,j$ as Nn,Ct as No,LZ as Nr,v1 as Nt,p5 as O,lW as Oa,EX as Oi,F$ as On,Ot as Oo,aQ as Or,P1 as Ot,J8 as P,xR as Pa,sX as Pi,N$ as Pn,wt as Po,FZ as Pr,c1 as Pt,d2 as Q,Wy as Qa,vY as Qi,RQ as Qn,ze as Qo,pZ as Qr,L$ as Qt,e5 as R,xb as Ra,fX as Ri,G$ as Rn,yt as Ro,IZ as Rr,a1 as Rt,D5 as S,dW as Sa,HX as Si,d$ as Sn,Nt as So,VZ as Sr,he as Ss,J1 as St,d5 as T,TW as Ta,DX as Ti,n$ as Tn,zt as To,QZ as Tr,R1 as Tt,y2 as U,bb as Ua,rX as Ui,AQ as Un,pt as Uo,EZ as Ur,$$ as Ut,V8 as V,pb as Va,GY as Vi,XQ as Vn,vt as Vo,DZ as Vr,t1 as Vt,S2 as W,yb as Wa,pX as Wi,UQ as Wn,_t as Wo,yZ as Wr,Q$ as Wt,p2 as X,zy as Xa,LY as Xi,zQ as Xn,st as Xo,vZ as Xr,D$ as Xt,u2 as Y,Iy as Ya,FY as Yi,GQ as Yn,ct as Yo,_Z as Yr,FQ as Yt,f2 as Z,Ry as Za,IY as Zi,BQ as Zn,Pe as Zo,mZ as Zr,qQ as Zt,F5 as _,FJ as _a,FX as _i,U$ as _n,nm as _o,UZ as _r,nt as _s,s0 as _t,$5 as a,tY as aa,oZ as ai,h$ as an,Zy as ao,wQ as ar,Ve as as,n2 as at,w5 as b,jJ as ba,MX as bi,c$ as bn,F as bo,KZ as br,P as bs,Q1 as bt,H5 as c,oY as ca,tZ as ci,_$ as cn,ky as co,hQ as cr,We as cs,U0 as ct,G5 as d,LJ as da,QX as di,b$ as dn,wy as do,fQ as dr,Ge as ds,H0 as dt,pY as ea,sZ as ei,B$ as en,Ky as eo,kQ as er,Fe as es,o2 as et,B5 as f,HJ as fa,KX as fi,M$ as fn,Sy as fo,pQ as fr,tt as fs,z0 as ft,P5 as g,JJ as ga,IX as gi,E$ as gn,em as go,HZ as gr,Ze as gs,g0 as gt,O5 as h,qJ as ha,GX as hi,J$ as hn,tm as ho,GZ as hr,Je as hs,m0 as ht,Q5 as i,QJ as ia,nZ as ii,m$ as in,rb as io,xQ as ir,Be as is,i2 as it,n5 as j,$V as ja,gX as ji,o$ as jn,Et as jo,wZ as jr,j1 as jt,l5 as k,YU as ka,TX as ki,I$ as kn,kt as ko,nQ as kr,L1 as kt,U5 as l,sY as la,YX as li,v$ as ln,Dy as lo,gQ as lr,Ue as ls,Y0 as lt,I5 as m,VJ as ma,ZX as mi,W$ as mn,hy as mo,WZ as mr,$e as ms,S0 as mt,u7 as n,uY as na,aZ as ni,f$ as nn,ub as no,DQ as nr,Ie as ns,l2 as nt,e7 as o,YJ as oa,$X as oi,S$ as on,ib as oo,yQ as or,He as os,t2 as ot,L5 as p,NJ as pa,qX as pi,QQ as pn,yy as po,mQ as pr,it as ps,v0 as pt,v2 as q,sb as qa,WY as qi,HQ as qn,ht as qo,dZ as qr,NQ as qt,c7 as r,dY as ra,rZ as ri,p$ as rn,db as ro,bQ as rr,qe as rs,c2 as rt,J5 as s,ZJ as sa,eZ as si,x$ as sn,Yy as so,vQ as sr,Ne as ss,X0 as st,l7 as t,fY as ta,lZ as ti,s$ as tn,Jy as to,TQ as tr,Le as ts,a2 as tt,q5 as u,IJ as ua,XX as ui,y$ as un,Ty as uo,_Q as ur,ot as us,V0 as ut,N5 as v,KJ as va,LX as vi,O$ as vn,Gd as vo,eQ as vr,Me as vs,c0 as vt,x5 as w,fW as wa,AX as wi,t$ as wn,Rt as wo,JZ as wr,me as ws,K1 as wt,T5 as x,AJ as xa,zX as xi,u$ as xn,Bt as xo,qZ as xr,ve as xs,Y1 as xt,E5 as y,WJ as ya,NX as yi,T$ as yn,Ni as yo,tQ as yr,Ae as ys,a0 as yt,y8 as z,mb as za,KY as zi,K$ as zn,ut as zo,RZ as zr,r1 as zt};
|
|
345
|
-
//# sourceMappingURL=src-
|
|
345
|
+
//# sourceMappingURL=src-D7ue1-zj.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Ao as e,No as t,P as n,Po as r,R as i,Yo as a,Zo as o,d as s,l as c,ss as l,ws as u}from"./src-Cd48emEJ.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ci as D,Cn as O,Ct as k,D as A,Di as j,Dn as M,Dt as N,E as P,Ei as F,En as I,Et as L,F as R,Fi as z,Fn as B,Fr as V,Ft as H,G as U,Gi as W,Gn as G,Gr as K,Gt as q,H as J,Hi as Y,Hn as X,Hr as Z,Ht as Q,I as $,Ii as ee,In as te,Ir as ne,It as re,J as ie,Ji as ae,Jn as oe,Jr as se,Jt as ce,K as le,Ki as ue,Kn as de,Kr as fe,Kt as pe,L as me,Li as he,Ln as ge,Lr as _e,Lt as ve,M as ye,Mi as be,Mn as xe,Mr as Se,Mt as Ce,N as we,Ni as Te,Nn as Ee,Nr as De,Nt as Oe,O as ke,Oi as Ae,On as je,Or as Me,Ot as Ne,P as Pe,Pi as Fe,Pn as Ie,Pr as Le,Pt as Re,Q as ze,Qi as Be,Qn as Ve,Qr as He,Qt as Ue,R as We,Ri as Ge,Rn as Ke,Rr as qe,Rt as Je,S as Ye,Si as Xe,Sn as Ze,Sr as Qe,St as $e,T as et,Ti as tt,Tn as nt,Tt as rt,U as it,Ui as at,Un as ot,Ur as st,Ut as ct,V as lt,Vi as ut,Vn as dt,Vr as ft,Vt as pt,W as mt,Wi as ht,Wn as gt,Wr as _t,Wt as vt,X as yt,Xi as bt,Xn as xt,Xr as St,Xt as Ct,Y as wt,Yi as Tt,Yn as Et,Yr as Dt,Yt as Ot,Z as kt,Zi as At,Zn as jt,Zr as Mt,Zt as Nt,_ as Pt,_a as Ft,_i as It,_n as Lt,_r as Rt,_t as zt,a as Bt,aa as Vt,ai as Ht,an as Ut,ar as Wt,at as Gt,b as Kt,bi as qt,bn as Jt,br as Yt,bt as Xt,c as Zt,ca as Qt,ci as $t,cn as en,cr as tn,d as nn,da as rn,di as an,dn as on,dr as sn,ea as cn,ei as ln,en as un,er as dn,et as fn,f as pn,fa as mn,fi as hn,fn as gn,fr as _n,g as vn,ga as yn,gn as bn,gr as xn,gt as Sn,h as Cn,ha as wn,hi as Tn,hn as En,hr as Dn,ht as On,i as kn,ia as An,ii as jn,in as Mn,ir as Nn,it as Pn,j as Fn,ji as In,jn as Ln,jr as Rn,jt as zn,k as Bn,ki as Vn,kn as Hn,kr as Un,kt as Wn,l as Gn,la as Kn,li as qn,ln as Jn,lr as Yn,m as Xn,ma as Zn,mi as Qn,mn as $n,mr as er,mt as tr,n as nr,na as rr,ni as ir,nn as ar,nr as or,nt as sr,o as cr,oa as lr,oi as ur,on as dr,or as fr,ot as pr,p as mr,pa as hr,pi as gr,pn as _r,pr as vr,q as yr,qi as br,qn as xr,qr as Sr,qt as Cr,r as wr,ra as Tr,ri as Er,rn as Dr,rr as Or,rt as kr,s as Ar,sa as jr,si as Mr,sn as Nr,sr as Pr,st as Fr,t as Ir,ta as Lr,ti as Rr,tn as zr,tr as Br,tt as Vr,u as Hr,ua as Ur,ui as Wr,un as Gr,ur as Kr,v as qr,va as Jr,vi as Yr,vn as Xr,vr as Zr,vt as Qr,w as $r,wi as ei,wn as ti,wt as ni,x as ri,xi as ii,xn as ai,xr as oi,xt as si,y as ci,yi as li,yn as ui,yr as di,yt as fi,z as pi,zi as mi,zn as hi,zr as gi,zt as _i}from"./src-DbA3hkai.mjs";import{C as vi,E as yi,T as bi,_ as xi,b as Si,c as Ci,d as wi,g as Ti,i as Ei,l as Di,m as Oi,n as ki,p as Ai,s as ji,t as Mi,u as Ni,v as Pi,w as Fi,x as Ii,y as Li}from"./fs-traced-ArlA_yTp.mjs";import{a as Ri,d as zi,f as Bi,i as Vi,l as Hi,n as Ui,r as Wi,t as Gi,u as Ki}from"./logger-5LePyO3n.mjs";import{S as qi,_ as Ji,a as Yi,c as Xi,f as Zi,g as Qi,h as $i,i as ea,l as ta,m as na,n as ra,o as ia,p as aa,r as oa,s as sa,t as ca,u as la,v as ua,x as da}from"./server-lock-CG7HATY5.mjs";export{Kn as AGENT_ID_MAX_LEN,Ur as AGENT_ID_RE,tt as AGENT_WRITE_ORIGIN,yn as AcpPermissionStore,hr as AcpRegistry,qt as AcpThreadManager,Yr as AgentFocusBroadcaster,It as AgentPresenceBroadcaster,F as AgentSessionCapacityError,j as AgentSessionManager,On as AutoStartDisabledError,tn as BUNDLE_IDS,Yn as BUNDLE_SCOPE,Kr as BUNDLE_SKILL_NAME,hi as BacklinkIndex,he as CC1Broadcaster,o as CC1_CONTRACT_VERSION,Jn as CONFIG_FILENAME,Ee as CONFLICT_MARKER_RE,Se as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Pt as ConfigSchema,at as DEFAULT_CHECKPOINT_RETENTION,se as DEFAULT_EMBEDDINGS_DIMENSIONS,Re as DEFAULT_PACK_ID,lt as DocumentDurabilityState,Dt as EMBEDDINGS_API_KEY_ENV,Zn as FEATURED_AGENT_IDS,ht as FILE_SYSTEM_WRITER,ge as FILE_WATCHER_ORIGIN,Z as FileEmbeddingsBackend,Ct as GIT_PREFLIGHT_FAIL_SPAN_NAME,W as GIT_UPSTREAM_WRITER,Ft as GitDirAccessError,Ue as GitNotAvailableError,h as GitTooOldError,Sn as HOCUSPOCUS_AUTH_REJECTION_REASONS,zt as HocuspocusAuthRejection,Qr as HocuspocusAuthTokenSchema,qe as INSTALLED_AGENTS_SCHEMES,a as LINEAGE_EPOCH_KEY,We as LIVE_DERIVED_INDEX_DEBOUNCE_MS,H as LOG_MD_TEMPLATE,ni as MANAGED_RENAME_ORIGIN,ii as MAX_ACP_THREADS,Ae as MAX_AGENT_SESSIONS,D as MCP_CONNECTION_ID_HEADER,e as MCP_SERVER_NAME,Vn as MIN_EVICTABLE_IDLE_MS,un as MIN_GIT_VERSION,J as MISSING_OK_CONFIG_MESSAGE,Jr as MalformedGitPointerError,fn as McpLogger,it as MissingOkConfigError,In as OBSERVER_SYNC_ORIGIN,Gr as OK_OKIGNORE_TEMPLATE,t as ORPHAN_MODES,u as PROTOCOL_VERSION,Gi as PinoLogger,Xi as ProcessLockCollisionError,Gn as ProjectGitInitError,rt as ROLLBACK_ORIGIN,on as ROOT_GITIGNORE_TEMPLATE,Qi as RUNTIME_VERSION,Wr as RemoteConfigError,ue as SERVICE_WRITER,Or as SKILL_INSTALL_EVENTS_FILE_REL,n as SKILL_STATE_TARGETS,re as STARTER_FOLDERS,ve as STARTER_FOLDER_FRONTMATTER_FILENAME,Je as STARTER_PACKS,_i as STARTER_PACK_IDS,T as STARTER_TEMPLATES,et as STATE_MANIFEST_FILENAME,Ji as STATE_SCHEMA_VERSION,l as SYSTEM_DOC_NAME,pe as SeedPrerequisiteError,Cr as SeedRootDirError,ca as ServerLockCollisionError,Ir as SingleFileNotAFileError,nr as SingleFileNotFoundError,wr as SingleFileNotMarkdownError,P as StateManifestError,Ke as TagIndex,sn as USER_GLOBAL_BUNDLE_IDS,dt as UiLockCollisionError,L as __getShowAllWalkStatsForTesting,N as __resetShowAllWalkStatsForTesting,ta as acquireProcessLock,ra as acquireServerLock,X as acquireUiLock,_ as applyAgentMarkdownWrite,Ln as applyExternalChange,Oe as applySeed,A as assertCompatibleStateManifest,zr as assertGitAvailable,ui as assertNeverDiskEvent,li as attachAcpThreadSocket,tr as attachIdleShutdown,qr as bootServer,de as buildAndOpenSkill,gn as buildConfigYmlContent,wt as buildExecResult,Xe as buildOkMcpStdioCommand,Wt as buildSkillZip,pt as buildStarterFolderFrontmatterYaml,br as buildWipTree,_n as bundleSkillMdPath,st as canonicalProjectKey,Jt as classifyEvents,Mi as classifyFsPath,_t as clearAllEmbeddingsKeys,Mt as clearContributors,Q as coercePackId,c as colorFromSeed,ae as commitUpstreamImport,Tt as commitWip,bt as commitWipFromTree,ar as compareSemver,Dn as composeEffectiveLinterConfig,xn as composeFrontmatterSchemasConfig,Ie as containsConflictMarkers,ai as contentHash,He as contributorCount,Pe as countShadowObjects,R as countStaleAgentWipRefs,$ as countWipRefs,Ne as createApiExtension,Mr as createAssetServeMiddleware,U as createCollaborationHost,Me as createContentFilter,Un as createContentFilterAsync,K as createEmbeddingsSecretStore,kn as createEphemeralProjectDir,xe as createExternalChangeHandler,pn as createFileLogger,pi as createLiveDerivedIndexExtension,yr as createMcpHttpHandler,gi as createOsProbe,we as createPersistenceExtension,E as createServer,Fn as createServerObserverExtension,Fe as createStreamingErrorWriter,Ui as createTestLogger,fe as describeStoredEmbeddingsKey,vn as detectClaudeDesktopPresence,Dr as detectGit,ke as detectProjectShape,xr as detectUserSkillHosts,kr as discoverLockDirs,di as discoverMarkdownlintConfig,Nt as emitPreflightFailureSpan,yt as encodeDocName,kt as encodeFolderRoute,ze as encodeSkillRoute,Hr as ensureProjectGit,_r as ensureProjectSkillGitignore,z as errorResponse,Ze as evictStaleTrackerEntries,Wn as extractHeadings,Pn as extractOkBinaryPath,C as extractWikiLinksFromMarkdown,Mn as fallbackPaths,nn as findEnclosingGitRoot,Lt as findEnclosingProjectRoot,Yt as findNativeMarkdownlintFile,mr as flushFileLogger,fi as formatAuthRejectionWire,m as formatContributors,ln as formatContributorsFrom,zn as formatPackRationale,At as gcCheckpointRefs,Vr as getCurrentMcpLogger,jn as getLocalDir,Xn as getLogFilePath,Wi as getLogger,Cn as getLogsDir,ua as getMachineId,Li as getMeter,An as getMetrics,Si as getTracer,Vt as handleCollabSocketError,De as handleSpawnCursor,an as hasForwardingHeaders,me as hasGcLogLatch,s as iconFromClientName,lr as incrementCollabSocketFilteredError,jr as incrementServerObserverFire,$n as initContent,Be as initShadowRepo,Ii as initTelemetry,Kt as initToleranceTelemetryWriter,Fr as installPrettyZodErrors,Vi as installTestLoggers,oe as installUserSkill,qn as isAllowedApiOrigin,Qn as isAllowedWorkspaceHostHeader,Ge as isConfigDoc,Xt as isHocuspocusAuthRejectionReason,ct as isKnownPackId,mi as isLinkIndexExcludedDoc,Tn as isLoopbackAddress,S as isManagedArtifactDoc,r as isOrphanMode,be as isPairedWriteOrigin,Le as isPathWithinDir,da as isProcessAlive,Xr as isProjectRoot,hn as isRemoteAdmitted,ut as isReservedForUserTree,O as isSelfWrite,Y as isSystemDoc,ri as isToleranceTelemetryEnabled,qi as isValidLockPid,ti as lastKnownHash,f as listRescueCheckpoints,vt as listStarterPacks,wn as loadCustomAgents,ye as loadPrincipal,la as lockFilePath,Ri as loggerFactory,Hi as logsCurrentPath,Ki as logsPreviousPath,Sr as makeLazyEmbeddingsKeyStore,oa as markServerLockDraining,mt as mountMcpAndApi,ki as normalizeFsPath,vr as originGitHubHost,En as packageVersionMajorMinor,si as parseAuthRejectionWire,Ut as parseGitVersion,$e as parseHocuspocusAuthToken,le as parseKeepaliveConnectionId,nt as pathToDocName,Ce as planSeed,Bt as prepareSingleFileOpen,Gt as processCommand,pr as processUsage,Et as readAllTargets,xt as readBundleDecision,oi as readOwnNativeRules,Zi as readProcessLock,aa as readProcessLockDetailed,x as readProjectHeadState,ft as readProjectLocalSemanticConfig,ea as readServerLock,jt as readServerPackageVersion,Ve as readSkillInstallStateSnapshot,Bn as readStateManifest,p as readTargetRecordedAt,dn as readTargetVersion,ot as readUiLock,B as reconcile,Rr as recordContributor,Nn as recordSkillInstallEvent,ie as registerAllTools,I as registerWrite,na as releaseProcessLock,Yi as releaseServerLock,gt as releaseUiLock,M as removeLastKnownHash,Qt as resetMetrics,i as resolveBundleEnabled,fr as resolveBundledSkillDir,Ht as resolveContentDir,V as resolveCursorBinaryDefault,ne as resolveCursorSpawnInvocation,Rt as resolveEffectiveLinterConfig,St as resolveEmbeddingsCredential,ur as resolveLockDir,Zr as resolveNativeConfigForDoc,Qe as resolveNativeMarkdownlintConfig,q as resolvePack,Ar as resolvePackageVersion,gr as resolveRemoteAccess,d as resolveUiInfo,ir as restoreContributors,ci as restoreLifecycleFromConflictsJson,y as rewriteMarkdownLinksForDocumentRename,Rn as rewriteWikiLinksForDocumentRename,dr as runAuthReposSubprocess,Nr as runAuthStatusSubprocess,ce as runCloneSubprocess,en as runDeviceFlowSubprocess,sr as runWithMcpLogger,$t as safeContentPath,b as safeSubdir,cn as safetyCheckpoint,ei as sanitizeClientName,Lr as saveInMemoryCheckpoint,rr as saveVersion,k as seedBasenameIndex,cr as serializeError,vi as setActiveSpanAttributes,Te as setupServerObservers,Tr as shadowGit,Fi as shutdownTelemetry,zi as spansCurrentPath,Bi as spansPreviousPath,_e as spawnDetached,te as splitMarkdownBlocks,je as startWatcher,ee as streamingProblemEvent,Er as swapContributors,Ye as teardownToleranceTelemetryWriter,rn as toBroadcasterKey,Ei as tracedAppendFileSync,ji as tracedLinkSync,Ci as tracedMkdir,Di as tracedMkdirSync,Ni as tracedRename,wi as tracedRenameSync,Ai as tracedRmSync,Oi as tracedRmdirSync,Ti as tracedUnlinkSync,xi as tracedWriteFile,Pi as tracedWriteFileSync,$r as trustSystemCertificates,Zt as untrackTrackedProjectSkillProjection,Hn as updateLastKnownHash,$i as updateProcessLockPort,ia as updateServerLockPort,G as updateUiLockPort,mn as validateAgentId,Ot as validateCloneInputs,Pr as validateSkillZip,sa as waitForServerLockDrain,w as withHiddenWindowsConsole,bi as withSpan,yi as withSpanSync,Br as writeBundleDecision,er as writeMarkdownlintRule,bn as writeRootGitignoreForNewRepo,g as writeStateManifest,or as writeTargetVersion,v as writeTracker};
|
|
1
|
+
import{Ao as e,No as t,P as n,Po as r,R as i,Yo as a,Zo as o,d as s,l as c,ss as l,ws as u}from"./src-D7ue1-zj.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ci as D,Cn as O,Ct as k,D as A,Di as j,Dn as M,Dt as N,E as P,Ei as F,En as I,Et as L,F as R,Fi as z,Fn as B,Fr as V,Ft as H,G as U,Gi as W,Gn as G,Gr as K,Gt as q,H as J,Hi as Y,Hn as X,Hr as Z,Ht as Q,I as $,Ii as ee,In as te,Ir as ne,It as re,J as ie,Ji as ae,Jn as oe,Jr as se,Jt as ce,K as le,Ki as ue,Kn as de,Kr as fe,Kt as pe,L as me,Li as he,Ln as ge,Lr as _e,Lt as ve,M as ye,Mi as be,Mn as xe,Mr as Se,Mt as Ce,N as we,Ni as Te,Nn as Ee,Nr as De,Nt as Oe,O as ke,Oi as Ae,On as je,Or as Me,Ot as Ne,P as Pe,Pi as Fe,Pn as Ie,Pr as Le,Pt as Re,Q as ze,Qi as Be,Qn as Ve,Qr as He,Qt as Ue,R as We,Ri as Ge,Rn as Ke,Rr as qe,Rt as Je,S as Ye,Si as Xe,Sn as Ze,Sr as Qe,St as $e,T as et,Ti as tt,Tn as nt,Tt as rt,U as it,Ui as at,Un as ot,Ur as st,Ut as ct,V as lt,Vi as ut,Vn as dt,Vr as ft,Vt as pt,W as mt,Wi as ht,Wn as gt,Wr as _t,Wt as vt,X as yt,Xi as bt,Xn as xt,Xr as St,Xt as Ct,Y as wt,Yi as Tt,Yn as Et,Yr as Dt,Yt as Ot,Z as kt,Zi as At,Zn as jt,Zr as Mt,Zt as Nt,_ as Pt,_a as Ft,_i as It,_n as Lt,_r as Rt,_t as zt,a as Bt,aa as Vt,ai as Ht,an as Ut,ar as Wt,at as Gt,b as Kt,bi as qt,bn as Jt,br as Yt,bt as Xt,c as Zt,ca as Qt,ci as $t,cn as en,cr as tn,d as nn,da as rn,di as an,dn as on,dr as sn,ea as cn,ei as ln,en as un,er as dn,et as fn,f as pn,fa as mn,fi as hn,fn as gn,fr as _n,g as vn,ga as yn,gn as bn,gr as xn,gt as Sn,h as Cn,ha as wn,hi as Tn,hn as En,hr as Dn,ht as On,i as kn,ia as An,ii as jn,in as Mn,ir as Nn,it as Pn,j as Fn,ji as In,jn as Ln,jr as Rn,jt as zn,k as Bn,ki as Vn,kn as Hn,kr as Un,kt as Wn,l as Gn,la as Kn,li as qn,ln as Jn,lr as Yn,m as Xn,ma as Zn,mi as Qn,mn as $n,mr as er,mt as tr,n as nr,na as rr,ni as ir,nn as ar,nr as or,nt as sr,o as cr,oa as lr,oi as ur,on as dr,or as fr,ot as pr,p as mr,pa as hr,pi as gr,pn as _r,pr as vr,q as yr,qi as br,qn as xr,qr as Sr,qt as Cr,r as wr,ra as Tr,ri as Er,rn as Dr,rr as Or,rt as kr,s as Ar,sa as jr,si as Mr,sn as Nr,sr as Pr,st as Fr,t as Ir,ta as Lr,ti as Rr,tn as zr,tr as Br,tt as Vr,u as Hr,ua as Ur,ui as Wr,un as Gr,ur as Kr,v as qr,va as Jr,vi as Yr,vn as Xr,vr as Zr,vt as Qr,w as $r,wi as ei,wn as ti,wt as ni,x as ri,xi as ii,xn as ai,xr as oi,xt as si,y as ci,yi as li,yn as ui,yr as di,yt as fi,z as pi,zi as mi,zn as hi,zr as gi,zt as _i}from"./src-d3vC7Yq4.mjs";import{C as vi,E as yi,T as bi,_ as xi,b as Si,c as Ci,d as wi,g as Ti,i as Ei,l as Di,m as Oi,n as ki,p as Ai,s as ji,t as Mi,u as Ni,v as Pi,w as Fi,x as Ii,y as Li}from"./fs-traced-ArlA_yTp.mjs";import{a as Ri,d as zi,f as Bi,i as Vi,l as Hi,n as Ui,r as Wi,t as Gi,u as Ki}from"./logger-5LePyO3n.mjs";import{S as qi,_ as Ji,a as Yi,c as Xi,f as Zi,g as Qi,h as $i,i as ea,l as ta,m as na,n as ra,o as ia,p as aa,r as oa,s as sa,t as ca,u as la,v as ua,x as da}from"./server-lock-Iwha6Mev.mjs";export{Kn as AGENT_ID_MAX_LEN,Ur as AGENT_ID_RE,tt as AGENT_WRITE_ORIGIN,yn as AcpPermissionStore,hr as AcpRegistry,qt as AcpThreadManager,Yr as AgentFocusBroadcaster,It as AgentPresenceBroadcaster,F as AgentSessionCapacityError,j as AgentSessionManager,On as AutoStartDisabledError,tn as BUNDLE_IDS,Yn as BUNDLE_SCOPE,Kr as BUNDLE_SKILL_NAME,hi as BacklinkIndex,he as CC1Broadcaster,o as CC1_CONTRACT_VERSION,Jn as CONFIG_FILENAME,Ee as CONFLICT_MARKER_RE,Se as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Pt as ConfigSchema,at as DEFAULT_CHECKPOINT_RETENTION,se as DEFAULT_EMBEDDINGS_DIMENSIONS,Re as DEFAULT_PACK_ID,lt as DocumentDurabilityState,Dt as EMBEDDINGS_API_KEY_ENV,Zn as FEATURED_AGENT_IDS,ht as FILE_SYSTEM_WRITER,ge as FILE_WATCHER_ORIGIN,Z as FileEmbeddingsBackend,Ct as GIT_PREFLIGHT_FAIL_SPAN_NAME,W as GIT_UPSTREAM_WRITER,Ft as GitDirAccessError,Ue as GitNotAvailableError,h as GitTooOldError,Sn as HOCUSPOCUS_AUTH_REJECTION_REASONS,zt as HocuspocusAuthRejection,Qr as HocuspocusAuthTokenSchema,qe as INSTALLED_AGENTS_SCHEMES,a as LINEAGE_EPOCH_KEY,We as LIVE_DERIVED_INDEX_DEBOUNCE_MS,H as LOG_MD_TEMPLATE,ni as MANAGED_RENAME_ORIGIN,ii as MAX_ACP_THREADS,Ae as MAX_AGENT_SESSIONS,D as MCP_CONNECTION_ID_HEADER,e as MCP_SERVER_NAME,Vn as MIN_EVICTABLE_IDLE_MS,un as MIN_GIT_VERSION,J as MISSING_OK_CONFIG_MESSAGE,Jr as MalformedGitPointerError,fn as McpLogger,it as MissingOkConfigError,In as OBSERVER_SYNC_ORIGIN,Gr as OK_OKIGNORE_TEMPLATE,t as ORPHAN_MODES,u as PROTOCOL_VERSION,Gi as PinoLogger,Xi as ProcessLockCollisionError,Gn as ProjectGitInitError,rt as ROLLBACK_ORIGIN,on as ROOT_GITIGNORE_TEMPLATE,Qi as RUNTIME_VERSION,Wr as RemoteConfigError,ue as SERVICE_WRITER,Or as SKILL_INSTALL_EVENTS_FILE_REL,n as SKILL_STATE_TARGETS,re as STARTER_FOLDERS,ve as STARTER_FOLDER_FRONTMATTER_FILENAME,Je as STARTER_PACKS,_i as STARTER_PACK_IDS,T as STARTER_TEMPLATES,et as STATE_MANIFEST_FILENAME,Ji as STATE_SCHEMA_VERSION,l as SYSTEM_DOC_NAME,pe as SeedPrerequisiteError,Cr as SeedRootDirError,ca as ServerLockCollisionError,Ir as SingleFileNotAFileError,nr as SingleFileNotFoundError,wr as SingleFileNotMarkdownError,P as StateManifestError,Ke as TagIndex,sn as USER_GLOBAL_BUNDLE_IDS,dt as UiLockCollisionError,L as __getShowAllWalkStatsForTesting,N as __resetShowAllWalkStatsForTesting,ta as acquireProcessLock,ra as acquireServerLock,X as acquireUiLock,_ as applyAgentMarkdownWrite,Ln as applyExternalChange,Oe as applySeed,A as assertCompatibleStateManifest,zr as assertGitAvailable,ui as assertNeverDiskEvent,li as attachAcpThreadSocket,tr as attachIdleShutdown,qr as bootServer,de as buildAndOpenSkill,gn as buildConfigYmlContent,wt as buildExecResult,Xe as buildOkMcpStdioCommand,Wt as buildSkillZip,pt as buildStarterFolderFrontmatterYaml,br as buildWipTree,_n as bundleSkillMdPath,st as canonicalProjectKey,Jt as classifyEvents,Mi as classifyFsPath,_t as clearAllEmbeddingsKeys,Mt as clearContributors,Q as coercePackId,c as colorFromSeed,ae as commitUpstreamImport,Tt as commitWip,bt as commitWipFromTree,ar as compareSemver,Dn as composeEffectiveLinterConfig,xn as composeFrontmatterSchemasConfig,Ie as containsConflictMarkers,ai as contentHash,He as contributorCount,Pe as countShadowObjects,R as countStaleAgentWipRefs,$ as countWipRefs,Ne as createApiExtension,Mr as createAssetServeMiddleware,U as createCollaborationHost,Me as createContentFilter,Un as createContentFilterAsync,K as createEmbeddingsSecretStore,kn as createEphemeralProjectDir,xe as createExternalChangeHandler,pn as createFileLogger,pi as createLiveDerivedIndexExtension,yr as createMcpHttpHandler,gi as createOsProbe,we as createPersistenceExtension,E as createServer,Fn as createServerObserverExtension,Fe as createStreamingErrorWriter,Ui as createTestLogger,fe as describeStoredEmbeddingsKey,vn as detectClaudeDesktopPresence,Dr as detectGit,ke as detectProjectShape,xr as detectUserSkillHosts,kr as discoverLockDirs,di as discoverMarkdownlintConfig,Nt as emitPreflightFailureSpan,yt as encodeDocName,kt as encodeFolderRoute,ze as encodeSkillRoute,Hr as ensureProjectGit,_r as ensureProjectSkillGitignore,z as errorResponse,Ze as evictStaleTrackerEntries,Wn as extractHeadings,Pn as extractOkBinaryPath,C as extractWikiLinksFromMarkdown,Mn as fallbackPaths,nn as findEnclosingGitRoot,Lt as findEnclosingProjectRoot,Yt as findNativeMarkdownlintFile,mr as flushFileLogger,fi as formatAuthRejectionWire,m as formatContributors,ln as formatContributorsFrom,zn as formatPackRationale,At as gcCheckpointRefs,Vr as getCurrentMcpLogger,jn as getLocalDir,Xn as getLogFilePath,Wi as getLogger,Cn as getLogsDir,ua as getMachineId,Li as getMeter,An as getMetrics,Si as getTracer,Vt as handleCollabSocketError,De as handleSpawnCursor,an as hasForwardingHeaders,me as hasGcLogLatch,s as iconFromClientName,lr as incrementCollabSocketFilteredError,jr as incrementServerObserverFire,$n as initContent,Be as initShadowRepo,Ii as initTelemetry,Kt as initToleranceTelemetryWriter,Fr as installPrettyZodErrors,Vi as installTestLoggers,oe as installUserSkill,qn as isAllowedApiOrigin,Qn as isAllowedWorkspaceHostHeader,Ge as isConfigDoc,Xt as isHocuspocusAuthRejectionReason,ct as isKnownPackId,mi as isLinkIndexExcludedDoc,Tn as isLoopbackAddress,S as isManagedArtifactDoc,r as isOrphanMode,be as isPairedWriteOrigin,Le as isPathWithinDir,da as isProcessAlive,Xr as isProjectRoot,hn as isRemoteAdmitted,ut as isReservedForUserTree,O as isSelfWrite,Y as isSystemDoc,ri as isToleranceTelemetryEnabled,qi as isValidLockPid,ti as lastKnownHash,f as listRescueCheckpoints,vt as listStarterPacks,wn as loadCustomAgents,ye as loadPrincipal,la as lockFilePath,Ri as loggerFactory,Hi as logsCurrentPath,Ki as logsPreviousPath,Sr as makeLazyEmbeddingsKeyStore,oa as markServerLockDraining,mt as mountMcpAndApi,ki as normalizeFsPath,vr as originGitHubHost,En as packageVersionMajorMinor,si as parseAuthRejectionWire,Ut as parseGitVersion,$e as parseHocuspocusAuthToken,le as parseKeepaliveConnectionId,nt as pathToDocName,Ce as planSeed,Bt as prepareSingleFileOpen,Gt as processCommand,pr as processUsage,Et as readAllTargets,xt as readBundleDecision,oi as readOwnNativeRules,Zi as readProcessLock,aa as readProcessLockDetailed,x as readProjectHeadState,ft as readProjectLocalSemanticConfig,ea as readServerLock,jt as readServerPackageVersion,Ve as readSkillInstallStateSnapshot,Bn as readStateManifest,p as readTargetRecordedAt,dn as readTargetVersion,ot as readUiLock,B as reconcile,Rr as recordContributor,Nn as recordSkillInstallEvent,ie as registerAllTools,I as registerWrite,na as releaseProcessLock,Yi as releaseServerLock,gt as releaseUiLock,M as removeLastKnownHash,Qt as resetMetrics,i as resolveBundleEnabled,fr as resolveBundledSkillDir,Ht as resolveContentDir,V as resolveCursorBinaryDefault,ne as resolveCursorSpawnInvocation,Rt as resolveEffectiveLinterConfig,St as resolveEmbeddingsCredential,ur as resolveLockDir,Zr as resolveNativeConfigForDoc,Qe as resolveNativeMarkdownlintConfig,q as resolvePack,Ar as resolvePackageVersion,gr as resolveRemoteAccess,d as resolveUiInfo,ir as restoreContributors,ci as restoreLifecycleFromConflictsJson,y as rewriteMarkdownLinksForDocumentRename,Rn as rewriteWikiLinksForDocumentRename,dr as runAuthReposSubprocess,Nr as runAuthStatusSubprocess,ce as runCloneSubprocess,en as runDeviceFlowSubprocess,sr as runWithMcpLogger,$t as safeContentPath,b as safeSubdir,cn as safetyCheckpoint,ei as sanitizeClientName,Lr as saveInMemoryCheckpoint,rr as saveVersion,k as seedBasenameIndex,cr as serializeError,vi as setActiveSpanAttributes,Te as setupServerObservers,Tr as shadowGit,Fi as shutdownTelemetry,zi as spansCurrentPath,Bi as spansPreviousPath,_e as spawnDetached,te as splitMarkdownBlocks,je as startWatcher,ee as streamingProblemEvent,Er as swapContributors,Ye as teardownToleranceTelemetryWriter,rn as toBroadcasterKey,Ei as tracedAppendFileSync,ji as tracedLinkSync,Ci as tracedMkdir,Di as tracedMkdirSync,Ni as tracedRename,wi as tracedRenameSync,Ai as tracedRmSync,Oi as tracedRmdirSync,Ti as tracedUnlinkSync,xi as tracedWriteFile,Pi as tracedWriteFileSync,$r as trustSystemCertificates,Zt as untrackTrackedProjectSkillProjection,Hn as updateLastKnownHash,$i as updateProcessLockPort,ia as updateServerLockPort,G as updateUiLockPort,mn as validateAgentId,Ot as validateCloneInputs,Pr as validateSkillZip,sa as waitForServerLockDrain,w as withHiddenWindowsConsole,bi as withSpan,yi as withSpanSync,Br as writeBundleDecision,er as writeMarkdownlintRule,bn as writeRootGitignoreForNewRepo,g as writeStateManifest,or as writeTargetVersion,v as writeTracker};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{o as e}from"./chunk-DTipWd-i.mjs";import{Y as t}from"./sleep-ByqzSHar.mjs";import{Lo as n,X as r,Z as i,bs as a,xs as o}from"./src-
|
|
1
|
+
import{o as e}from"./chunk-DTipWd-i.mjs";import{Y as t}from"./sleep-ByqzSHar.mjs";import{Lo as n,X as r,Z as i,bs as a,xs as o}from"./src-D7ue1-zj.mjs";import{Br as s,Sa as c,_n as l,at as u,it as d,oi as f,ot as p,rt as m}from"./src-d3vC7Yq4.mjs";import{O as h,P as g}from"./fs-traced-ArlA_yTp.mjs";import{S as _,u as v,v as y,x as b}from"./server-lock-Iwha6Mev.mjs";import{t as x}from"./yazl-BafwB467.mjs";import{T as S,b as C,d as w,i as T,x as ee}from"./write-project-skill-49lx5BFR.mjs";import{c as te}from"./colors-BsmVIwfM.mjs";import"./acp-harness-probe-Bnts6rTj.mjs";import{D as E,E as D,S as ne,T as O,_ as k,b as re,o as ie,v as A}from"./init-CUaIjiMo.mjs";import{n as j}from"./constants-C60h_U5-.mjs";import{t as ae}from"./is-object-ByG7RnjH.mjs";import"./loader-CkZ6CTb2.mjs";import"./preview-BwiH8Ec6.mjs";import{execSync as oe,spawnSync as M}from"node:child_process";import{basename as N,dirname as P,isAbsolute as se,join as F,relative as ce,resolve as I,sep as le}from"node:path";import{cpSync as ue,createWriteStream as de,existsSync as L,lstatSync as fe,mkdirSync as R,mkdtempSync as pe,readFileSync as z,readdirSync as B,readlinkSync as me,rmSync as he,statSync as ge,writeFileSync as V}from"node:fs";import{arch as _e,freemem as ve,homedir as ye,hostname as be,platform as xe,release as Se,tmpdir as Ce,totalmem as we,type as Te,uptime as Ee}from"node:os";import{realpath as De}from"node:fs/promises";import{createHash as Oe}from"node:crypto";var H=t();const ke=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Ae(e,t,n=l){if(e!==void 0&&!ke.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let je=null;function Me(e){je=e}function Ne(){return je??process.cwd()}function Pe(){return F(ye(),`.ok`,`bug-reports`)}function Fe(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Pe(),r=`${t}-bugreport`,i=F(n,`${r}.zip`);for(let e=2;L(i);e+=1)i=F(n,`${r}-${e}.zip`);return i}function Ie(e,t){let n=F(e,`.ok`,`config.yml`);if(L(n))try{let e=z(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return L(F(e,`.ok`))?Oe(`sha256`).update(I(e)).digest(`hex`).slice(0,12):null}function Le(){let e={timestamp:new Date().toISOString(),platform:xe(),osType:Te(),osRelease:Se(),hostname:`[redacted]`,uptime:Ee(),freeMem:ve(),totalMem:we(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=oe(`sw_vers -productVersion 2>/dev/null`,s({encoding:`utf8`})).trim()}catch{}try{let t=F(__dirname,`..`,`..`,`package.json`);L(t)&&(e.okVersion=JSON.parse(z(t,`utf8`)).version)}catch{}return e}function Re(e,t){return ze(e,t).files}function ze(e,t){if(!L(t))return{files:[]};let n=B(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>F(t,e));if(e&&n.length>0){let t=n.filter(t=>{try{return z(t,`utf8`).includes(`"project":"${e}"`)}catch{return!0}});t.length>0&&(n=t)}return{files:n}}function Be(e){let t=F(e,`.ok`,`local`);return L(t)?{files:[`server.lock`,`last-spawn-error.log`,r].map(e=>F(t,e)).filter(e=>L(e))}:{files:[]}}function Ve(e){let t=F(e,`.ok`,`local`,`logs`);return L(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>F(t,e)).filter(e=>L(e))}:{files:[]}}function He(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=o(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function U(e){for(let t of e.files)try{He({zipfile:e.zipfile,name:`${e.prefix}/${N(t)}`,content:z(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function Ue(t){let{redact:n,outputPath:r,logger:i}=t,o=t.userLogsDir??F(ye(),`.ok`,`logs`),s=t.projectDir?Ie(t.projectDir,i):null;R(P(r),{recursive:!0}),i?.info({projectSlug:s},`gathering diagnostic data`);let c=Le();c.desktop=t.desktop??null;let{files:l}=ze(s,o),{files:u}=t.projectDir?Be(t.projectDir):{files:[]},{files:d}=t.projectDir?Ve(t.projectDir):{files:[]};i?.info({logFileCount:l.length,lockFileCount:u.length,localSinkFileCount:d.length},`files collected`);let f=[],p=[],{ZipFile:m}=await import(`./yazl-vwTkB7U0.mjs`).then(t=>e(t.default,1)),h=new m;U({zipfile:h,files:l,prefix:`logs`,redact:n,bundleFiles:p,redactions:f,logger:i}),U({zipfile:h,files:u,prefix:`lockdir`,redact:n,bundleFiles:p,redactions:f,logger:i}),U({zipfile:h,files:d,prefix:`local-logs`,redact:n,bundleFiles:p,redactions:f,logger:i});for(let e of t.extraFiles??[])try{let t=z(e.sourcePath),n=`extra/${e.zipName??N(e.sourcePath)}`;h.addBuffer(t,n),p.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&He({zipfile:h,name:`note.txt`,content:t.note,redact:n,bundleFiles:p,redactions:f});let g=JSON.stringify(c,null,2);h.addBuffer(Buffer.from(g,`utf8`),`sysinfo.json`),p.push(`sysinfo.json`);let _={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:s,files:p,redactions:f,sysinfo:c};h.addBuffer(Buffer.from(JSON.stringify(_,null,2),`utf8`),`MANIFEST.json`);let v=f.reduce((e,t)=>e+t.lineCount,0),y=[`# Bug Report Bundle`,``,`Generated: ${_.generatedAt}`,`Project: ${s??`(unscoped)`}`,`Discipline version: ${_.disciplineVersion}`,``,`## Contents`,``,...p.map(e=>`- ${e}`),``,`## Privacy`,``,...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${a.join(`, `)}`,v>0?`${v} line(s) were scrubbed across ${f.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
|
|
2
2
|
`);h.addBuffer(Buffer.from(y,`utf8`),`README.md`),h.end();let b=de(r);return h.outputStream.pipe(b),await new Promise((e,t)=>{b.on(`close`,e),b.on(`error`,t)}),i?.info({bundlePath:r,fileCount:p.length,redactionCount:v},`bundle written`),{zipPath:r,summary:{projectSlug:s,files:p,redactions:f,redactedLineCount:v,generatedAt:_.generatedAt}}}var We=e(x(),1),W=e(te(),1);function G(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Ge(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function K(e,t){if(typeof e==`string`)return G(e,t.contentDir);if(Array.isArray(e))return e.map(e=>K(e,t));if(!Ge(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=K(i,t);return n}function Ke(e,t){let n=z(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
|
|
3
3
|
`),i=n.split(`
|
|
4
4
|
`),a=[];for(let e=0;e<i.length;e++){let n=i[e]??``;if(!(e===i.length-1&&n===``)){if(n.length===0){a.push(``);continue}try{let e=K(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}V(e,r?`${a.join(`
|
|
@@ -17,4 +17,4 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{Y as t}from"./sleep-ByqzSHar.mjs
|
|
|
17
17
|
`).replace(/\n/g,`\r
|
|
18
18
|
`));let u=`${i?``:``}${l}`;return u!==r&&g(e,u,{mode:O(e)}),{kind:`removed`}}function ln(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function un(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=t-n,i=Math.floor(r/1e3);if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m ago`;let o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function dn(e,t,n,r,i,a){if(t.status===`missing`||t.status===`corrupt`)return null;let o=t.lock,s=null;if(n.status!==`missing`&&n.status!==`corrupt`){let e=n.lock;s={port:e.port,status:n.status,pid:e.pid,startedAt:e.startedAt,usage:a}}return{directory:o.worktreeRoot,server:{port:o.port,status:t.status,pid:o.pid,startedAt:o.startedAt,usage:i},ui:s,hostname:o.hostname,lockPath:t.lockPath,binary:r==null?null:d(r),command:r,isDesktop:ln(r)}}function fn(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function Q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&fn(e)?`ui-orphan`:`stale`}const pn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function mn(e){switch(e){case`running`:return W.default.green(e);case`desktop`:return W.default.blue(e);case`foreign`:return W.default.cyan(e);case`ui-orphan`:return W.default.magenta(e);case`stale`:return W.default.yellow(e)}}function hn(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function gn(e){return`${hn(e.server.usage)} | ${hn(e.ui?.usage??null)}`}function _n(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function vn(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=Q(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,_n(e),gn(e),t,String(n),un(e.server.startedAt),e.binary??`—`]}),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=mn(Q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=W.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
|
|
19
19
|
`)}async function yn(e={}){let t=e.discover??m,n=e.inspect??Z,r=e.log??(e=>console.log(e)),i=e.resolveCommand??u,a=e.resolveUsage??p,o=await t(),s=[];for(let e of o){let t=n(e,`server`),r=n(e,`ui`),o=dn(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:a(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:a(r.lock.pid));o!=null&&s.push(o)}if(e.json){let e=s.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(vn(e.all?s:s.filter(e=>pn.has(Q(e)))))}function bn(){return new S(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await yn({all:t.all===!0||e===`all`,json:t.json===!0})})}function xn(e,t,n={}){let r=n.isAlive??b,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function Sn(e){let t=e.inspect??(t=>Z(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=xn(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function Cn(e,t=b){let n=await m(),r=null;for(let i of n){let n=Z(i,`server`),a=Z(i,`ui`);if($(n,t)&&n.lock.port===e||$(a,t)&&a.lock.port===e)return i;r===null&&($(n,t)&&n.lock.pid===e||$(a,t)&&a.lock.pid===e)&&(r=i)}return r}function wn(e){let t=Sn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function Tn(e){return new S(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async t=>{let n=t.length===0?void 0:t.join(` `);if(n===void 0){e();let t=Sn({lockDir:f(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await yn({});return}if(n===`all`){let e=await m();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e){let e=Z(n,`server`),r=Z(n,`ui`);!$(e,b)&&!$(r,b)||(wn(n),t++)}t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(n)){let e=Number.parseInt(n,10),t=await Cn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}wn(t);return}wn(f(I(Ne(),n)))})}function En(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function Dn(e,t){let r,i;try{r=await De(I(e)),i=await De(I(P(e)))}catch{return{kind:`not-git`}}if(!On(r,i))return{kind:`symlink-escape`};let a=F(r,`.git`),o;try{o=ge(a)}catch{return{kind:`not-git`}}if(o.isDirectory()){let e;try{e=await De(a)}catch{return{kind:`not-git`}}if(!On(e,r))return{kind:`symlink-escape`}}else if(!o.isFile())return{kind:`not-git`};let s=c(r);if(s.kind!==`repository`)return{kind:`not-git`};let l=s.repository.readRemoteUrl(`origin`);if(l.kind===`unreadable`)return{kind:`not-git`};if(l.kind===`absent`)return l.reason===`config-missing`?{kind:`not-git`}:{kind:`no-origin`};let u=l.url,d=Wt(u);if(d===null)return{kind:`non-github`};let f=n(d.hostname);if(f===null)return{kind:`non-github`};let p=f===t.host.toLowerCase(),m=d.owner.toLowerCase()===t.owner.toLowerCase(),h=d.name.toLowerCase()===t.repo.toLowerCase();return!p&&m&&h?{kind:`wrong-host`,actualHost:f}:!p||!m||!h?{kind:`wrong-repo`,actualOwner:d.owner,actualRepo:d.name}:{kind:`ok`,gitRemoteUrl:`https://${f}/${d.owner}/${d.name}.git`}}function On(e,t){if(e===t)return!0;let n=ce(t,e);return n.length>0&&!n.startsWith(`..`)&&!se(n)}const kn=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=A(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let r=T(e,t,{home:n.home});return{integration:`project-skill`,editorId:e.id,action:r.action,...r.path?{path:r.path}:{},...r.error?{error:r.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function An(e,t,n={},r=kn){let i=[];for(let a of t){let t=w[a];for(let a of r)i.push(a.write(t,e,n))}return i}function jn(e,t,n={}){return{integrations:An(e,t,n)}}export{Fe as C,Ae as D,Me as E,zt as S,Ne as T,Kt as _,Tn as a,Ht as b,Jt as c,tn as d,Zt as f,qt as g,Gt as h,Sn as i,Xt as l,en as m,Dn as n,bn as o,$t as p,En as r,an as s,jn as t,Yt as u,Wt as v,Pe as w,Rt as x,Z as y};
|
|
20
|
-
//# sourceMappingURL=src-
|
|
20
|
+
//# sourceMappingURL=src-aLMPCjd_.mjs.map
|