@inkeep/open-knowledge 0.31.0-beta.4 → 0.31.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +7 -7
- package/dist/constants-DK10Qbwz.mjs +2 -0
- package/dist/{dist-BX5OZ5Db.mjs → dist-D-bO1Mlq.mjs} +1 -1
- package/dist/{dist-DBTiY_Nn.mjs → dist-DEBa6nkk.mjs} +3 -3
- package/dist/{gh-detect-CSEtnBcE.mjs → gh-detect-Cm8hekXk.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/init-BGGQ3ing.mjs +1 -0
- package/dist/{init-C0QGLO6F.mjs → init-reB4XeLP.mjs} +3 -3
- package/dist/{launch-json-removal-0NlwQB8W.mjs → launch-json-removal-v_ZIEJ04.mjs} +2 -2
- package/dist/{loader-C61jjZiw.mjs → loader-C3crD0ZW.mjs} +2 -2
- package/dist/loader-pzsmJGfG.mjs +1 -0
- package/dist/{open-browser-C2K4_AGB.mjs → open-browser-B5KfPH4H.mjs} +2 -2
- package/dist/preview-GYvJ1m2X.mjs +1 -0
- package/dist/{preview-BXznrh51.mjs → preview-yptAXY9Q.mjs} +2 -2
- package/dist/public/assets/{ActivityModeContent-C1jtV-hU.js → ActivityModeContent-DIN900Tw.js} +1 -1
- package/dist/public/assets/{CodeMirrorPropInput-DiXxMe7E.js → CodeMirrorPropInput-ZO7IAXY4.js} +1 -1
- package/dist/public/assets/{DocumentContext-5toIZ8hA.js → DocumentContext-yguu7wL1.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-BRUoKGlI.js → EnableSyncConfirmDialog-CDm2rW8c.js} +1 -1
- package/dist/public/assets/{GraphPanel-CAT7ozBx.js → GraphPanel-BSBoTUuF.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-CGEPiwpI.js → ManagedArtifactProperties-DCr0fsi-.js} +1 -1
- package/dist/public/assets/{McpConsentDialogBody-DfJ3dXdV.js → McpConsentDialogBody-DZr8d0vu.js} +1 -1
- package/dist/public/assets/{MermaidDocEditor-Dg8dOZ9W.js → MermaidDocEditor-DqKOZzfV.js} +1 -1
- package/dist/public/assets/{PropertyPanel-BMHDSIGn.js → PropertyPanel-C_ExYapZ.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-CfzWeNyS.js → SettingsDialogBody-ILc_zuoi.js} +1 -1
- package/dist/public/assets/{ShareBranchSwitchDialog-CWwC7UJv.js → ShareBranchSwitchDialog-Dv66XosJ.js} +1 -1
- package/dist/public/assets/{ShareReceiveDialog-4FwHQsF4.js → ShareReceiveDialog-DcJrhi3C.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-o0LerOQ_.js → ShareReceiveMissDialog-8AKkkTF9.js} +1 -1
- package/dist/public/assets/{SkillEditorActions-C3Pt-Yag.js → SkillEditorActions-D7GmHyae.js} +1 -1
- package/dist/public/assets/{SourceEditor-Bem9oxYY.js → SourceEditor-F7MHMYDQ.js} +1 -1
- package/dist/public/assets/{TerminalPanel-Dnfkoo0l.js → TerminalPanel-Z0XhL8rx.js} +1 -1
- package/dist/public/assets/{agent-presence-Dp6Wg18I.js → agent-presence-Bf_k8RmI.js} +1 -1
- package/dist/public/assets/{auth-state-cache-xkP6pnyp.js → auth-state-cache-Ck3G6jUi.js} +1 -1
- package/dist/public/assets/{config-provider-2uXvVEZR.js → config-provider-CQL47dca.js} +1 -1
- package/dist/public/assets/{dist-DLPICmSw.js → dist-BmgoHUkm.js} +5 -5
- package/dist/public/assets/{dist-C0zHgAnC.js → dist-LUHivJAB.js} +1 -1
- package/dist/public/assets/{doc-hash-B37_BwmO.js → doc-hash-W5LZeE0c.js} +1 -1
- package/dist/public/assets/{documents-events-Bf8O52Ha.js → documents-events-CijCy-Sc.js} +1 -1
- package/dist/public/assets/{file-tree-adapter-3d-SPVop.js → file-tree-adapter-Bjoeiw_B.js} +1 -1
- package/dist/public/assets/{index-Byr-pQd3.css → index-A8hej5b5.css} +1 -1
- package/dist/public/assets/{index-C6gsky75.js → index-BpZF8EJT.js} +7 -7
- package/dist/public/assets/{keyboard-shortcuts-BxD83XhC.js → keyboard-shortcuts-DDw4HRe3.js} +1 -1
- package/dist/public/assets/{navigation-targets-DFne-srR.js → navigation-targets-V0noaD6h.js} +1 -1
- package/dist/public/assets/{open-managed-artifact-tab-B1BoyKiE.js → open-managed-artifact-tab-_d-k5W-o.js} +1 -1
- package/dist/public/assets/{pending-receive-nav-store-DCHjTg-k.js → pending-receive-nav-store-Cqe-Gc-y.js} +1 -1
- package/dist/public/assets/{prop-types-DXfg1BnH.js → prop-types-DK0zwiLA.js} +1 -1
- package/dist/public/assets/{receive-store-vDvyLF_T.js → receive-store-DIQKaDkz.js} +1 -1
- package/dist/public/assets/{selection-context-CaK5JqJX.js → selection-context-D7Vmm-jV.js} +1 -1
- package/dist/public/assets/{skill-actions-z_sZDeWy.js → skill-actions-C3jnKy6a.js} +1 -1
- package/dist/public/assets/{skills-api-CQ8dGACz.js → skills-api-FVkz2ZvD.js} +1 -1
- package/dist/public/assets/{src-D_zlKpkH.js → src-BfQVXkAq.js} +1 -1
- package/dist/public/assets/{target-navigation-intent-fp9D_EWj.js → target-navigation-intent-BF4mAnMq.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-D2Bw0GR2.js → typing-burst-detector-D0BBhVWB.js} +1 -1
- package/dist/public/assets/{workspace-paths-DkmFj3_t.js → workspace-paths-B1R7zp-q.js} +1 -1
- package/dist/public/index.html +26 -26
- package/dist/{repair-launch-json-CWlCWLWQ.mjs → repair-launch-json-DJL0xXvL.mjs} +2 -2
- package/dist/{repair-mcp-configs-D7PsV_5H.mjs → repair-mcp-configs-DsGk5WD7.mjs} +2 -2
- package/dist/repair-skills-UdFUgcgx.mjs +1 -0
- package/dist/{repair-skills-NaoxQmHc.mjs → repair-skills-wFFbPc3w.mjs} +2 -2
- package/dist/server-lock-GuuouVft-CPaJpyJ7.mjs +1 -0
- package/dist/{server-lock-iLcBw_q0-CRHu2BK6.mjs → server-lock-iLcBw_q0-CEih6ZHm.mjs} +6 -6
- package/dist/{src-CtkUCvS1.mjs → src-DHfQops5.mjs} +2 -2
- package/dist/start-esyH-MiN.mjs +1 -0
- package/dist/{start-DlaVc6b9.mjs → start-r9b4OB7D.mjs} +2 -2
- package/dist/{write-project-skill-DMrjtHrd.mjs → write-project-skill-CAZzOEUh.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-BA922dQX.mjs +0 -2
- package/dist/init-B3upuqT1.mjs +0 -1
- package/dist/loader-BLESzzLh.mjs +0 -1
- package/dist/preview-4OfJtTyQ.mjs +0 -1
- package/dist/repair-skills-D3xs9x2T.mjs +0 -1
- package/dist/server-lock-GuuouVft-Cz-UWwuo.mjs +0 -1
- package/dist/start-D00lFRDq.mjs +0 -1
|
@@ -270,7 +270,7 @@ ${t.slice(l+2)}`,d+=1;else break}t.push({indent:l,number:parseInt(s,10),content:
|
|
|
270
270
|
`,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=`
|
|
271
271
|
`),i;function a(e){return r.stack.push(e),t;function t(){r.stack.pop()}}}function qP(e){throw Error("Cannot handle value `"+e+"`, expected node")}function JP(e){throw Error("Cannot handle unknown node `"+e.type+"`")}function YP(e,t){if(e.type===`definition`&&e.type===t.type)return 0}function XP(e,t){return LP(e,this,t)}function ZP(e,t){return RP(e,this,t)}function QP(e,t){return HP(this,e,t)}function $P(){return{enter:{table:eF,tableData:iF,tableHeader:iF,tableRow:nF},exit:{codeText:aF,table:tF,tableData:rF,tableHeader:rF,tableRow:rF}}}function eF(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 tF(e){this.exit(e),this.data.inTable=void 0}function nF(e){this.enter({type:`tableRow`,children:[]},e)}function rF(e){this.exit(e)}function iF(e){this.enter({type:`tableCell`,children:[]},e)}function aF(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,oF));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function oF(e,t){return t===`|`?t:e}function sF(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
272
272
|
`,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(`
|
|
273
|
-
`))}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 bN(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=CP.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function cF(){return{exit:{taskListCheckValueChecked:uF,taskListCheckValueUnchecked:uF,paragraph:dF}}}function lF(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:fF}}}function uF(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function dF(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 fF(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=CP.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 pF(){return[LM(),cN(),pN(),$P(),cF()]}function mF(e){return{extensions:[RM(),lN(e),mN(),sF(e),lF()]}}function hF(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 gF(e,t){return e.length>0?(hF(e,e.length,0,t),e):t}const _F={}.hasOwnProperty;function vF(e){let t={},n=-1;for(;++n<e.length;)yF(t,e[n]);return t}function yF(e,t){let n;for(n in t){let r=(_F.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){_F.call(r,a)||(r[a]=[]);let e=i[a];bF(r[a],Array.isArray(e)?e:e?[e]:[])}}}function bF(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);hF(e,0,0,r)}const xF={tokenize:FF,partial:!0},SF={tokenize:IF,partial:!0},CF={tokenize:LF,partial:!0},wF={tokenize:RF,partial:!0},TF={tokenize:zF,partial:!0},EF={name:`wwwAutolink`,tokenize:NF,previous:BF},DF={name:`protocolAutolink`,tokenize:PF,previous:VF},OF={name:`emailAutolink`,tokenize:MF,previous:HF},kF={};function AF(){return{text:kF}}let jF=48;for(;jF<123;)kF[jF]=OF,jF++,jF===58?jF=65:jF===91&&(jF=97);kF[43]=OF,kF[45]=OF,kF[46]=OF,kF[95]=OF,kF[72]=[OF,DF],kF[104]=[OF,DF],kF[87]=[OF,EF],kF[119]=[OF,EF];function MF(e,t,n){let r=this,i,a;return o;function o(t){return!UF(t)||!HF.call(r,r.previous)||WF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return UF(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(TF,u,l)(t):t===45||t===95||bM(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&&yM(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function NF(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!BF.call(r,r.previous)||WF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(xF,e.attempt(SF,e.attempt(CF,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function PF(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&VF.call(r,r.previous)&&!WF(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(yM(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||SM(t)||EM(t)||OM(t)||DM(t)?n(t):e.attempt(SF,e.attempt(CF,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function FF(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 IF(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(wF,c,s)(t):t===null||EM(t)||OM(t)||t!==45&&DM(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 LF(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(wF,t,a)(o):o===null||EM(o)||OM(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function RF(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||EM(o)||OM(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||EM(e)||OM(e)?t(e):r(e)}function a(e){return yM(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):yM(t)?(e.consume(t),o):n(t)}}function zF(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return bM(e)?n(e):t(e)}}function BF(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||EM(e)}function VF(e){return!yM(e)}function HF(e){return!(e===47||UF(e))}function UF(e){return e===43||e===45||e===46||e===95||bM(e)}function WF(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 GF(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&bM(e.charCodeAt(n+1))&&bM(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 KF(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 qF={name:`attention`,resolveAll:JF,tokenize:YF};function JF(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};XF(d,-c),XF(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=gF(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=gF(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=gF(l,KF(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=gF(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=gF(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,hF(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 YF(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=UN(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=UN(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 XF(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ZF={name:`autolink`,tokenize:QF};function QF(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 yM(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||bM(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||bM(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||SM(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):xM(t)?(e.consume(t),l):n(t)}function u(e){return bM(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||bM(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function $F(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return $(r)?(e.enter(n),s(r)):t(r)}function s(r){return $(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const eI={partial:!0,tokenize:tI};function tI(e,t,n){return r;function r(t){return $(t)?$F(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Q(e)?t(e):n(e)}}const nI={continuation:{tokenize:iI},exit:aI,name:`blockQuote`,tokenize:rI};function rI(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 $(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function iI(e,t,n){let r=this;return i;function i(t){return $(t)?$F(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(nI,t,n)(r)}}function aI(e){e.exit(`blockQuote`)}const oI={name:`characterEscape`,tokenize:sI};function sI(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 TM(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const cI={name:`characterReference`,tokenize:lI};function lI(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=bM,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=wM,u):(e.enter(`characterReferenceValue`),a=7,o=CM,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===bM&&!AP(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 uI={partial:!0,tokenize:pI},dI={concrete:!0,name:`codeFenced`,tokenize:fI};function fI(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`),$(t)?$F(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(uI,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),$F(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Q(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&&$(t)?$F(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Q(t)?e.check(uI,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Q(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`),$(t)?$F(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`),$(t)?$F(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function pI(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 mI={name:`codeIndented`,tokenize:gI},hI={partial:!0,tokenize:_I};function gI(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),$F(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):Q(t)?e.attempt(hI,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function _I(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):$F(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):Q(e)?i(e):n(e)}}const vI={name:`codeText`,previous:bI,resolve:yI,tokenize:xI};function yI(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 bI(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function xI(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)):Q(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||Q(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 SI=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&&CI(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),CI(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),CI(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);CI(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);CI(this.left,t.reverse())}}};function CI(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 wI(e){let t={},n=-1,r,i,a,o,s,c,l,u=new SI(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,TI(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 hF(e,0,1/0,u.slice(0)),!l}function TI(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 EI={resolve:OI,tokenize:kI},DI={partial:!0,tokenize:AI};function OI(e){return wI(e),e}function kI(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):Q(t)?e.check(DI,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 AI(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$F(e,a,`linePrefix`)}function a(i){if(i===null||Q(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 jI(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||SM(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||Q(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||EM(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||SM(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 MI(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):Q(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||Q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!$(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function NI(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):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$F(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Q(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 PI(e,t){let n;return r;function r(i){return Q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):$(i)?$F(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const FI={name:`definition`,tokenize:LI},II={partial:!0,tokenize:RI};function LI(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return MI.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=ZM(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 EM(t)?PI(e,l)(t):l(t)}function l(t){return jI(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(II,d,d)(t)}function d(t){return $(t)?$F(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function RI(e,t,n){return r;function r(t){return EM(t)?PI(e,i)(t):n(t)}function i(t){return NI(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return $(t)?$F(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Q(e)?t(e):n(e)}}const zI={name:`hardBreakEscape`,tokenize:BI};function BI(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const VI={name:`headingAtx`,resolve:HI,tokenize:UI};function HI(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`},hF(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function UI(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||EM(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Q(n)?(e.exit(`atxHeading`),t(n)):$(n)?$F(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||EM(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const WI=`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(`.`),GI=[`pre`,`script`,`style`,`textarea`],KI={concrete:!0,name:`htmlFlow`,resolveTo:YI,tokenize:XI},qI={partial:!0,tokenize:QI},JI={partial:!0,tokenize:ZI};function YI(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 XI(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:ce):yM(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):yM(a)?(e.consume(a),i=4,r.interrupt?t:ce):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ce):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:te:m):n(i)}function h(t){return yM(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||EM(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&GI.includes(l)?(i=1,r.interrupt?t(s):te(s)):WI.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):te(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||bM(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:te):n(i)}function v(t){return $(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||yM(t)?(e.consume(t),b):$(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||bM(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):$(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):$(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Q(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||EM(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||$(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||Q(t)?te(t):$(t)?(e.consume(t),ee):n(t)}function te(t){return t===45&&i===2?(e.consume(t),ae):t===60&&i===1?(e.consume(t),D):t===62&&i===4?(e.consume(t),le):t===63&&i===3?(e.consume(t),ce):t===93&&i===5?(e.consume(t),se):Q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(qI,ue,ne)(t)):t===null||Q(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),te)}function ne(t){return e.check(JI,re,ue)(t)}function re(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return t===null||Q(t)?ne(t):(e.enter(`htmlFlowData`),te(t))}function ae(t){return t===45?(e.consume(t),ce):te(t)}function D(t){return t===47?(e.consume(t),o=``,oe):te(t)}function oe(t){if(t===62){let n=o.toLowerCase();return GI.includes(n)?(e.consume(t),le):te(t)}return yM(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),oe):te(t)}function se(t){return t===93?(e.consume(t),ce):te(t)}function ce(t){return t===62?(e.consume(t),le):t===45&&i===2?(e.consume(t),ce):te(t)}function le(t){return t===null||Q(t)?(e.exit(`htmlFlowData`),ue(t)):(e.consume(t),le)}function ue(n){return e.exit(`htmlFlow`),t(n)}}function ZI(e,t,n){let r=this;return i;function i(t){return Q(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 QI(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(eI,t,n)}}const $I={name:`htmlText`,tokenize:eL};function eL(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):yM(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):yM(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):Q(t)?(o=d,D(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ae(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):Q(t)?(o=h,D(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ae(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ae(t):Q(t)?(o=v,D(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Q(t)?(o=y,D(t)):(e.consume(t),y)}function b(e){return e===62?ae(e):y(e)}function x(t){return yM(t)?(e.consume(t),S):n(t)}function S(t){return t===45||bM(t)?(e.consume(t),S):C(t)}function C(t){return Q(t)?(o=C,D(t)):$(t)?(e.consume(t),C):ae(t)}function w(t){return t===45||bM(t)?(e.consume(t),w):t===47||t===62||EM(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ae):t===58||t===95||yM(t)?(e.consume(t),E):Q(t)?(o=T,D(t)):$(t)?(e.consume(t),T):ae(t)}function E(t){return t===45||t===46||t===58||t===95||bM(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),te):Q(t)?(o=ee,D(t)):$(t)?(e.consume(t),ee):T(t)}function te(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ne):Q(t)?(o=te,D(t)):$(t)?(e.consume(t),te):(e.consume(t),re)}function ne(t){return t===i?(e.consume(t),i=void 0,ie):t===null?n(t):Q(t)?(o=ne,D(t)):(e.consume(t),ne)}function re(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||EM(t)?T(t):(e.consume(t),re)}function ie(e){return e===47||e===62||EM(e)?T(e):n(e)}function ae(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function D(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),oe}function oe(t){return $(t)?$F(e,se,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):se(t)}function se(t){return e.enter(`htmlTextData`),o(t)}}const tL={name:`labelEnd`,resolveAll:aL,resolveTo:oL,tokenize:sL},nL={tokenize:cL},rL={tokenize:lL},iL={tokenize:uL};function aL(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&&hF(e,0,e.length,n),e}function oL(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=gF(s,e.slice(a+1,a+r+3)),s=gF(s,[[`enter`,u,t]]),s=gF(s,KF(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=gF(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=gF(s,e.slice(o+1)),s=gF(s,[[`exit`,c,t]]),hF(e,a,e.length,s),e}function sL(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(ZM(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(nL,u,o?u:d)(t):t===91?e.attempt(rL,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(iL,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function cL(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 EM(t)?PI(e,a)(t):a(t)}function a(t){return t===41?u(t):jI(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return EM(t)?PI(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?NI(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return EM(t)?PI(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 lL(e,t,n){let r=this;return i;function i(t){return MI.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(ZM(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function uL(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 dL={name:`labelStartImage`,resolveAll:tL.resolveAll,tokenize:fL};function fL(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 pL={name:`labelStartLink`,resolveAll:tL.resolveAll,tokenize:mL};function mL(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 hL={name:`lineEnding`,tokenize:gL};function gL(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$F(e,t,`linePrefix`)}}const _L={name:`thematicBreak`,tokenize:vL};function vL(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||Q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),$(t)?$F(e,s,`whitespace`)(t):s(t))}}const yL={continuation:{tokenize:CL},exit:TL,name:`list`,tokenize:SL},bL={partial:!0,tokenize:EL},xL={partial:!0,tokenize:wL};function SL(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:CM(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(_L,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 CM(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(eI,r.interrupt?n:u,e.attempt(bL,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return $(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 CL(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(eI,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$F(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!$(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(xL,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,$F(e,e.attempt(yL,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function wL(e,t,n){let r=this;return $F(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 TL(e){e.exit(this.containerState.type)}function EL(e,t,n){let r=this;return $F(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!$(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const DL={name:`setextUnderline`,resolveTo:OL,tokenize:kL};function OL(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 kL(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`),$(t)?$F(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const AL={tokenize:RL,partial:!0};function jL(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:FL,continuation:{tokenize:IL},exit:LL}},text:{91:{name:`gfmFootnoteCall`,tokenize:PL},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:ML,resolveTo:NL}}}}function ML(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=ZM(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 NL(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 PL(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||EM(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(ZM(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return EM(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 FL(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||EM(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=ZM(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return EM(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),$F(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function IL(e,t,n){return e.check(eI,t,e.attempt(AL,t,n))}function LL(e){e.exit(`gfmFootnoteDefinition`)}function RL(e,t,n){let r=this;return $F(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 zL(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&&hF(o,o.length,0,KF(s,e.slice(r+1,n),t)),hF(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),hF(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=UN(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=UN(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var BL=class{constructor(){this.map=[]}add(e,t,n){VL(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 VL(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 HL(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 UL(){return{flow:{null:{name:`table`,tokenize:WL,resolveAll:GL}}}}function WL(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):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):$(t)?$F(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||EM(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,$(t)?$F(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 $(t)?$F(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||Q(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 $(t)?$F(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(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||Q(n)?(e.exit(`tableRow`),t(n)):$(n)?$F(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||EM(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 GL(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 BL;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(qL(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=KL(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=KL(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=KL(f,t,o,i,n,d)):(o[0]=o[1],d=KL(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&qL(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=HL(t.events,n))}return e}function KL(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},JL(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=JL(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=JL(t.events,n[2]),a=JL(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({},JL(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function qL(e,t,n,r,i){let a=[],o=JL(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 JL(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const YL={name:`tasklistCheck`,tokenize:ZL};function XL(){return{text:{91:YL}}}function ZL(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 EM(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 Q(r)?t(r):$(r)?e.check({tokenize:QL},t,n)(r):n(r)}}function QL(e,t,n){return $F(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function $L(e){return vF([AF(),jL(),zL(e),UL(),XL()])}const eR={};function tR(e){let t=this,n=e||eR,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push($L(n)),a.push(pF()),o.push(mF(n))}function nR(e){let t=this;t.compiler=n;function n(n){return KP(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function rR(e){if(e)throw e}var iR=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}}));function aR(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 oR(){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?sR(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 sR(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 cR=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var lR=n(iR(),1);const uR={}.hasOwnProperty,dR=new class e extends cR{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=oR()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,lR.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(mR(`data`,this.frozen),this.namespace[e]=t,this):uR.call(this.namespace,e)&&this.namespace[e]||void 0:e?(mR(`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=_R(e),n=this.parser||this.Parser;return fR(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),fR(`process`,this.parser||this.Parser),pR(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=_R(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);yR(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(),fR(`processSync`,this.parser||this.Parser),pR(`processSync`,this.compiler||this.Compiler),this.process(e,r),gR(`processSync`,`process`,t),n;function r(e,r){t=!0,rR(e),n=r}}run(e,t,n){hR(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=_R(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),gR(`runSync`,`run`,n),r;function i(e,t){rR(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=_R(t),r=this.compiler||this.Compiler;return pR(`stringify`,r),hR(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(mR(`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,lR.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];aR(o)&&aR(r)&&(r=(0,lR.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function fR(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function pR(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function mR(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 hR(e){if(!aR(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function gR(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function _R(e){return vR(e)?e:new Ij(e)}function vR(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function yR(e){return typeof e==`string`||bR(e)}function bR(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function xR(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(SR(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(SR(t.slice(i),i>0,!1)),a.join(``)}function SR(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 CR(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 dM(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 jR(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=DR(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=DR(t.text),r=L.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 wR(e){return e.replaceAll(/\n([^\n])/g,` $1`)}function TR(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(L.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(L.from(e.text((s.text??``)+i))):a.push(e.text(i)),a}function ER(e){throw Error(`unknown markdown node: ${e.type}`)}function DR(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function OR(){}function kR(e){throw Error("Expected node, not `"+JSON.stringify(e)+"`")}function AR(e,t,n,r){return wN(`tagName`,{handlers:e})(t,n,r)}function jR(e,t,n,r,i,a){return wN(`type`,{invalid:kR,unknown:ER,handlers:{toml:OR,yaml:OR,definition:OR,footnoteDefinition:OR,root(t,n,r){let i=r.all(t);return e.topNodeType.create(null,i)},html(t){let r=qj(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`?AR(n,o,void 0,a)||(t.value?e.text(t.value):null):null},text(t){let n=wR(xR(String(t.value)));return n?e.text(/^\s+$/.test(n)?n.replace(/ /g,`\xA0`):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 TR(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 MR(e,t){return(n,r,i)=>{let a=i.all(n);return e.createAndFill(t?.(n)??null,a)}}function NR(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 PR=function(e,t){let n=jR(t.schema,t.handlers,t.htmlHandlers??{},e,void 0,CR(t.schema,t.handlers,t.htmlHandlers??{},e));return n.check(),n},FR=function(e){this.compiler=function(t){return PR(t,e)}};function IR(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=>Qj(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 LR(e,t){return IR(t.nodeHandlers,t.markHandlers).one(e)}function RR(e,t){return(n,r,i)=>{let a=i.all(n);return{type:e,...t?.(n),children:a}}}function zR(e,t){return(n,r,i)=>({type:e,...t?.(n),children:i})}var BR=n(r(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o;break}else o===`%`?s=!0:a+=o;return a}})()}))(),1);const VR=Object.assign(HR(Error),{eval:HR(EvalError),range:HR(RangeError),reference:HR(ReferenceError),syntax:HR(SyntaxError),type:HR(TypeError),uri:HR(URIError)});function HR(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,BR.default)(t,...n))}}const UR={}.hasOwnProperty,WR={yaml:`-`,toml:`+`};function GR(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=KR(r[n]);return t}function KR(e){let t=e;if(typeof t==`string`){if(!UR.call(WR,t))throw VR("Missing matter definition for `%s`",t);t={type:t,marker:WR[t]}}else if(typeof t!=`object`)throw VR("Expected matter to be an object, not `%j`",t);if(!UR.call(t,`type`))throw VR("Missing `type` in matter `%j`",t);if(!UR.call(t,`fence`)&&!UR.call(t,`marker`))throw VR("Missing `marker` or `fence` in matter `%j`",t);return t}function qR(e){let t=GR(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=YR(e,`open`).charCodeAt(0),a=JR(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function JR(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=YR(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),$(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return $(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return Q(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=YR(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||Q(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||Q(e)?(l.exit(a),y(e)):(l.consume(e),v)}function y(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,b,_))}function b(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),$(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return $(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||Q(i)?(e.exit(r),t(i)):n(i)}}}function YR(e,t){return e.marker?XR(e.marker,t).repeat(3):XR(e.fence,t)}function XR(e,t){return typeof e==`string`?e:e[t]}function ZR(e){let t=GR(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=QR(e),r[e.type]=$R,r[e.type+`Value`]=ez}return{enter:n,exit:r}}function QR(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function $R(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function ez(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function tz(e){let t=[],n={},r=GR(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=nz(e);let a=rz(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:AM(a.charAt(1))})}return{unsafe:t,handlers:n}}function nz(e){let t=rz(e,`open`),n=rz(e,`close`);return r;function r(e){return t+(e.value?`
|
|
273
|
+
`))}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 bN(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=CP.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function cF(){return{exit:{taskListCheckValueChecked:uF,taskListCheckValueUnchecked:uF,paragraph:dF}}}function lF(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:fF}}}function uF(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function dF(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 fF(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=CP.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 pF(){return[LM(),cN(),pN(),$P(),cF()]}function mF(e){return{extensions:[RM(),lN(e),mN(),sF(e),lF()]}}function hF(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 gF(e,t){return e.length>0?(hF(e,e.length,0,t),e):t}const _F={}.hasOwnProperty;function vF(e){let t={},n=-1;for(;++n<e.length;)yF(t,e[n]);return t}function yF(e,t){let n;for(n in t){let r=(_F.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){_F.call(r,a)||(r[a]=[]);let e=i[a];bF(r[a],Array.isArray(e)?e:e?[e]:[])}}}function bF(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);hF(e,0,0,r)}const xF={tokenize:FF,partial:!0},SF={tokenize:IF,partial:!0},CF={tokenize:LF,partial:!0},wF={tokenize:RF,partial:!0},TF={tokenize:zF,partial:!0},EF={name:`wwwAutolink`,tokenize:NF,previous:BF},DF={name:`protocolAutolink`,tokenize:PF,previous:VF},OF={name:`emailAutolink`,tokenize:MF,previous:HF},kF={};function AF(){return{text:kF}}let jF=48;for(;jF<123;)kF[jF]=OF,jF++,jF===58?jF=65:jF===91&&(jF=97);kF[43]=OF,kF[45]=OF,kF[46]=OF,kF[95]=OF,kF[72]=[OF,DF],kF[104]=[OF,DF],kF[87]=[OF,EF],kF[119]=[OF,EF];function MF(e,t,n){let r=this,i,a;return o;function o(t){return!UF(t)||!HF.call(r,r.previous)||WF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return UF(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(TF,u,l)(t):t===45||t===95||bM(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&&yM(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function NF(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!BF.call(r,r.previous)||WF(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(xF,e.attempt(SF,e.attempt(CF,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function PF(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&VF.call(r,r.previous)&&!WF(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(yM(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||SM(t)||EM(t)||OM(t)||DM(t)?n(t):e.attempt(SF,e.attempt(CF,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function FF(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 IF(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(wF,c,s)(t):t===null||EM(t)||OM(t)||t!==45&&DM(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 LF(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(wF,t,a)(o):o===null||EM(o)||OM(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function RF(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||EM(o)||OM(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||EM(e)||OM(e)?t(e):r(e)}function a(e){return yM(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):yM(t)?(e.consume(t),o):n(t)}}function zF(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return bM(e)?n(e):t(e)}}function BF(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||EM(e)}function VF(e){return!yM(e)}function HF(e){return!(e===47||UF(e))}function UF(e){return e===43||e===45||e===46||e===95||bM(e)}function WF(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 GF(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&bM(e.charCodeAt(n+1))&&bM(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 KF(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 qF={name:`attention`,resolveAll:JF,tokenize:YF};function JF(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};XF(d,-c),XF(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=gF(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=gF(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=gF(l,KF(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=gF(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=gF(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,hF(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 YF(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=UN(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=UN(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 XF(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const ZF={name:`autolink`,tokenize:QF};function QF(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 yM(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||bM(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||bM(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||SM(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):xM(t)?(e.consume(t),l):n(t)}function u(e){return bM(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||bM(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}function $F(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return $(r)?(e.enter(n),s(r)):t(r)}function s(r){return $(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}const eI={partial:!0,tokenize:tI};function tI(e,t,n){return r;function r(t){return $(t)?$F(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Q(e)?t(e):n(e)}}const nI={continuation:{tokenize:iI},exit:aI,name:`blockQuote`,tokenize:rI};function rI(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 $(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function iI(e,t,n){let r=this;return i;function i(t){return $(t)?$F(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(nI,t,n)(r)}}function aI(e){e.exit(`blockQuote`)}const oI={name:`characterEscape`,tokenize:sI};function sI(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 TM(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}const cI={name:`characterReference`,tokenize:lI};function lI(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=bM,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=wM,u):(e.enter(`characterReferenceValue`),a=7,o=CM,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===bM&&!AP(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 uI={partial:!0,tokenize:pI},dI={concrete:!0,name:`codeFenced`,tokenize:fI};function fI(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`),$(t)?$F(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Q(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(uI,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Q(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):$(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),$F(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Q(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Q(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&&$(t)?$F(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Q(t)?e.check(uI,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Q(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`),$(t)?$F(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`),$(t)?$F(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function pI(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 mI={name:`codeIndented`,tokenize:gI},hI={partial:!0,tokenize:_I};function gI(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),$F(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):Q(t)?e.attempt(hI,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||Q(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function _I(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):$F(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):Q(e)?i(e):n(e)}}const vI={name:`codeText`,previous:bI,resolve:yI,tokenize:xI};function yI(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 bI(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function xI(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)):Q(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||Q(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 SI=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&&CI(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),CI(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),CI(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);CI(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);CI(this.left,t.reverse())}}};function CI(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 wI(e){let t={},n=-1,r,i,a,o,s,c,l,u=new SI(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,TI(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 hF(e,0,1/0,u.slice(0)),!l}function TI(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 EI={resolve:OI,tokenize:kI},DI={partial:!0,tokenize:AI};function OI(e){return wI(e),e}function kI(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):Q(t)?e.check(DI,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 AI(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$F(e,a,`linePrefix`)}function a(i){if(i===null||Q(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 jI(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||SM(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||Q(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||EM(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||SM(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 MI(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):Q(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||Q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!$(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function NI(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):Q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),$F(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Q(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 PI(e,t){let n;return r;function r(i){return Q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):$(i)?$F(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}const FI={name:`definition`,tokenize:LI},II={partial:!0,tokenize:RI};function LI(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return MI.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=ZM(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 EM(t)?PI(e,l)(t):l(t)}function l(t){return jI(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(II,d,d)(t)}function d(t){return $(t)?$F(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function RI(e,t,n){return r;function r(t){return EM(t)?PI(e,i)(t):n(t)}function i(t){return NI(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return $(t)?$F(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Q(e)?t(e):n(e)}}const zI={name:`hardBreakEscape`,tokenize:BI};function BI(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}const VI={name:`headingAtx`,resolve:HI,tokenize:UI};function HI(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`},hF(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function UI(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||EM(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Q(n)?(e.exit(`atxHeading`),t(n)):$(n)?$F(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||EM(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}const WI=`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(`.`),GI=[`pre`,`script`,`style`,`textarea`],KI={concrete:!0,name:`htmlFlow`,resolveTo:YI,tokenize:XI},qI={partial:!0,tokenize:QI},JI={partial:!0,tokenize:ZI};function YI(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 XI(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:ce):yM(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):yM(a)?(e.consume(a),i=4,r.interrupt?t:ce):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ce):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:te:m):n(i)}function h(t){return yM(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||EM(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&GI.includes(l)?(i=1,r.interrupt?t(s):te(s)):WI.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):te(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||bM(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:te):n(i)}function v(t){return $(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||yM(t)?(e.consume(t),b):$(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||bM(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):$(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):$(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Q(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||EM(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||$(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),ee):n(t)}function ee(t){return t===null||Q(t)?te(t):$(t)?(e.consume(t),ee):n(t)}function te(t){return t===45&&i===2?(e.consume(t),ae):t===60&&i===1?(e.consume(t),D):t===62&&i===4?(e.consume(t),le):t===63&&i===3?(e.consume(t),ce):t===93&&i===5?(e.consume(t),se):Q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(qI,ue,ne)(t)):t===null||Q(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),te)}function ne(t){return e.check(JI,re,ue)(t)}function re(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ie}function ie(t){return t===null||Q(t)?ne(t):(e.enter(`htmlFlowData`),te(t))}function ae(t){return t===45?(e.consume(t),ce):te(t)}function D(t){return t===47?(e.consume(t),o=``,oe):te(t)}function oe(t){if(t===62){let n=o.toLowerCase();return GI.includes(n)?(e.consume(t),le):te(t)}return yM(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),oe):te(t)}function se(t){return t===93?(e.consume(t),ce):te(t)}function ce(t){return t===62?(e.consume(t),le):t===45&&i===2?(e.consume(t),ce):te(t)}function le(t){return t===null||Q(t)?(e.exit(`htmlFlowData`),ue(t)):(e.consume(t),le)}function ue(n){return e.exit(`htmlFlow`),t(n)}}function ZI(e,t,n){let r=this;return i;function i(t){return Q(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 QI(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(eI,t,n)}}const $I={name:`htmlText`,tokenize:eL};function eL(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):yM(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):yM(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):Q(t)?(o=d,D(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ae(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):Q(t)?(o=h,D(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ae(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ae(t):Q(t)?(o=v,D(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Q(t)?(o=y,D(t)):(e.consume(t),y)}function b(e){return e===62?ae(e):y(e)}function x(t){return yM(t)?(e.consume(t),S):n(t)}function S(t){return t===45||bM(t)?(e.consume(t),S):C(t)}function C(t){return Q(t)?(o=C,D(t)):$(t)?(e.consume(t),C):ae(t)}function w(t){return t===45||bM(t)?(e.consume(t),w):t===47||t===62||EM(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ae):t===58||t===95||yM(t)?(e.consume(t),E):Q(t)?(o=T,D(t)):$(t)?(e.consume(t),T):ae(t)}function E(t){return t===45||t===46||t===58||t===95||bM(t)?(e.consume(t),E):ee(t)}function ee(t){return t===61?(e.consume(t),te):Q(t)?(o=ee,D(t)):$(t)?(e.consume(t),ee):T(t)}function te(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ne):Q(t)?(o=te,D(t)):$(t)?(e.consume(t),te):(e.consume(t),re)}function ne(t){return t===i?(e.consume(t),i=void 0,ie):t===null?n(t):Q(t)?(o=ne,D(t)):(e.consume(t),ne)}function re(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||EM(t)?T(t):(e.consume(t),re)}function ie(e){return e===47||e===62||EM(e)?T(e):n(e)}function ae(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function D(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),oe}function oe(t){return $(t)?$F(e,se,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):se(t)}function se(t){return e.enter(`htmlTextData`),o(t)}}const tL={name:`labelEnd`,resolveAll:aL,resolveTo:oL,tokenize:sL},nL={tokenize:cL},rL={tokenize:lL},iL={tokenize:uL};function aL(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&&hF(e,0,e.length,n),e}function oL(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=gF(s,e.slice(a+1,a+r+3)),s=gF(s,[[`enter`,u,t]]),s=gF(s,KF(t.parser.constructs.insideSpan.null,e.slice(a+r+4,o-3),t)),s=gF(s,[[`exit`,u,t],e[o-2],e[o-1],[`exit`,l,t]]),s=gF(s,e.slice(o+1)),s=gF(s,[[`exit`,c,t]]),hF(e,a,e.length,s),e}function sL(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(ZM(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(nL,u,o?u:d)(t):t===91?e.attempt(rL,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(iL,u,d)(t)}function u(e){return t(e)}function d(e){return a._balanced=!0,n(e)}}function cL(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 EM(t)?PI(e,a)(t):a(t)}function a(t){return t===41?u(t):jI(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return EM(t)?PI(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?NI(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return EM(t)?PI(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 lL(e,t,n){let r=this;return i;function i(t){return MI.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(ZM(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function uL(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 dL={name:`labelStartImage`,resolveAll:tL.resolveAll,tokenize:fL};function fL(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 pL={name:`labelStartLink`,resolveAll:tL.resolveAll,tokenize:mL};function mL(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 hL={name:`lineEnding`,tokenize:gL};function gL(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),$F(e,t,`linePrefix`)}}const _L={name:`thematicBreak`,tokenize:vL};function vL(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||Q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),$(t)?$F(e,s,`whitespace`)(t):s(t))}}const yL={continuation:{tokenize:CL},exit:TL,name:`list`,tokenize:SL},bL={partial:!0,tokenize:EL},xL={partial:!0,tokenize:wL};function SL(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:CM(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(_L,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 CM(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(eI,r.interrupt?n:u,e.attempt(bL,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return $(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 CL(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(eI,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$F(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!$(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(xL,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,$F(e,e.attempt(yL,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function wL(e,t,n){let r=this;return $F(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 TL(e){e.exit(this.containerState.type)}function EL(e,t,n){let r=this;return $F(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!$(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}const DL={name:`setextUnderline`,resolveTo:OL,tokenize:kL};function OL(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 kL(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`),$(t)?$F(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}const AL={tokenize:RL,partial:!0};function jL(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:FL,continuation:{tokenize:IL},exit:LL}},text:{91:{name:`gfmFootnoteCall`,tokenize:PL},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:ML,resolveTo:NL}}}}function ML(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=ZM(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 NL(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 PL(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||EM(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(ZM(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return EM(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 FL(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||EM(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=ZM(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return EM(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),$F(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function IL(e,t,n){return e.check(eI,t,e.attempt(AL,t,n))}function LL(e){e.exit(`gfmFootnoteDefinition`)}function RL(e,t,n){let r=this;return $F(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 zL(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&&hF(o,o.length,0,KF(s,e.slice(r+1,n),t)),hF(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),hF(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=UN(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=UN(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var BL=class{constructor(){this.map=[]}add(e,t,n){VL(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 VL(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 HL(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 UL(){return{flow:{null:{name:`table`,tokenize:WL,resolveAll:GL}}}}function WL(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):Q(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):$(t)?$F(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||EM(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,$(t)?$F(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 $(t)?$F(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||Q(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 $(t)?$F(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Q(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||Q(n)?(e.exit(`tableRow`),t(n)):$(n)?$F(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||EM(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 GL(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 BL;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(qL(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=KL(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=KL(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=KL(f,t,o,i,n,d)):(o[0]=o[1],d=KL(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&qL(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=HL(t.events,n))}return e}function KL(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},JL(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=JL(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=JL(t.events,n[2]),a=JL(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({},JL(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function qL(e,t,n,r,i){let a=[],o=JL(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 JL(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}const YL={name:`tasklistCheck`,tokenize:ZL};function XL(){return{text:{91:YL}}}function ZL(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 EM(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 Q(r)?t(r):$(r)?e.check({tokenize:QL},t,n)(r):n(r)}}function QL(e,t,n){return $F(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function $L(e){return vF([AF(),jL(),zL(e),UL(),XL()])}const eR={};function tR(e){let t=this,n=e||eR,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push($L(n)),a.push(pF()),o.push(mF(n))}function nR(e){let t=this;t.compiler=n;function n(n){return KP(n,{...t.data(`settings`),...e,extensions:t.data(`toMarkdownExtensions`)||[]})}}function rR(e){if(e)throw e}var iR=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}}));function aR(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 oR(){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?sR(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 sR(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 cR=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r});var lR=n(iR(),1);const uR={}.hasOwnProperty,dR=new class e extends cR{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=oR()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,lR.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(mR(`data`,this.frozen),this.namespace[e]=t,this):uR.call(this.namespace,e)&&this.namespace[e]||void 0:e?(mR(`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=_R(e),n=this.parser||this.Parser;return fR(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),fR(`process`,this.parser||this.Parser),pR(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=_R(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);yR(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(),fR(`processSync`,this.parser||this.Parser),pR(`processSync`,this.compiler||this.Compiler),this.process(e,r),gR(`processSync`,`process`,t),n;function r(e,r){t=!0,rR(e),n=r}}run(e,t,n){hR(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=_R(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),gR(`runSync`,`run`,n),r;function i(e,t){rR(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=_R(t),r=this.compiler||this.Compiler;return pR(`stringify`,r),hR(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(mR(`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,lR.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];aR(o)&&aR(r)&&(r=(0,lR.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function fR(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function pR(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function mR(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 hR(e){if(!aR(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function gR(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function _R(e){return vR(e)?e:new Ij(e)}function vR(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function yR(e){return typeof e==`string`||bR(e)}function bR(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}function xR(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(SR(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(SR(t.slice(i),i>0,!1)),a.join(``)}function SR(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 CR(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 dM(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 jR(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=DR(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=DR(t.text),r=L.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 wR(e){return e.replaceAll(/\n([^\n])/g,` $1`)}function TR(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(L.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(L.from(e.text((s.text??``)+i))):a.push(e.text(i)),a}function ER(e){throw Error(`unknown markdown node: ${e.type}`)}function DR(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function OR(){}function kR(e){throw Error("Expected node, not `"+JSON.stringify(e)+"`")}function AR(e,t,n,r){return wN(`tagName`,{handlers:e})(t,n,r)}function jR(e,t,n,r,i,a){return wN(`type`,{invalid:kR,unknown:ER,handlers:{toml:OR,yaml:OR,definition:OR,footnoteDefinition:OR,root(t,n,r){let i=r.all(t);return e.topNodeType.create(null,i)},html(t){let r=qj(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`?AR(n,o,void 0,a)||(t.value?e.text(t.value):null):null},text(t){let n=wR(xR(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 TR(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 MR(e,t){return(n,r,i)=>{let a=i.all(n);return e.createAndFill(t?.(n)??null,a)}}function NR(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 PR=function(e,t){let n=jR(t.schema,t.handlers,t.htmlHandlers??{},e,void 0,CR(t.schema,t.handlers,t.htmlHandlers??{},e));return n.check(),n},FR=function(e){this.compiler=function(t){return PR(t,e)}};function IR(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=>Qj(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 LR(e,t){return IR(t.nodeHandlers,t.markHandlers).one(e)}function RR(e,t){return(n,r,i)=>{let a=i.all(n);return{type:e,...t?.(n),children:a}}}function zR(e,t){return(n,r,i)=>({type:e,...t?.(n),children:i})}var BR=n(r(((e,t)=>{(function(){var e=t===void 0?function(){return this||(0,eval)(`this`)}():t.exports=i;e.format=i,e.vsprintf=r,typeof console<`u`&&typeof console.log==`function`&&(e.printf=n);function n(){console.log(i.apply(null,arguments))}function r(e,t){return i.apply(null,[e].concat(t))}function i(e){for(var t=1,n=[].slice.call(arguments),r=0,i=e.length,a=``,o,s=!1,c,l,u=!1,d,f=function(){return n[t++]},p=function(){for(var t=``;/\d/.test(e[r]);)t+=e[r++],o=e[r];return t.length>0?parseInt(t):null};r<i;++r)if(o=e[r],s)switch(s=!1,o==`.`?(u=!1,o=e[++r]):o==`0`&&e[r+1]==`.`?(u=!0,r+=2,o=e[r]):u=!0,d=p(),o){case`b`:a+=parseInt(f(),10).toString(2);break;case`c`:c=f(),typeof c==`string`||c instanceof String?a+=c:a+=String.fromCharCode(parseInt(c,10));break;case`d`:a+=parseInt(f(),10);break;case`f`:l=String(parseFloat(f()).toFixed(d||6)),a+=u?l:l.replace(/^0/,``);break;case`j`:a+=JSON.stringify(f());break;case`o`:a+=`0`+parseInt(f(),10).toString(8);break;case`s`:a+=f();break;case`x`:a+=`0x`+parseInt(f(),10).toString(16);break;case`X`:a+=`0x`+parseInt(f(),10).toString(16).toUpperCase();break;default:a+=o;break}else o===`%`?s=!0:a+=o;return a}})()}))(),1);const VR=Object.assign(HR(Error),{eval:HR(EvalError),range:HR(RangeError),reference:HR(ReferenceError),syntax:HR(SyntaxError),type:HR(TypeError),uri:HR(URIError)});function HR(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){return new e(t&&(0,BR.default)(t,...n))}}const UR={}.hasOwnProperty,WR={yaml:`-`,toml:`+`};function GR(e){let t=[],n=-1,r=Array.isArray(e)?e:e?[e]:[`yaml`];for(;++n<r.length;)t[n]=KR(r[n]);return t}function KR(e){let t=e;if(typeof t==`string`){if(!UR.call(WR,t))throw VR("Missing matter definition for `%s`",t);t={type:t,marker:WR[t]}}else if(typeof t!=`object`)throw VR("Expected matter to be an object, not `%j`",t);if(!UR.call(t,`type`))throw VR("Missing `type` in matter `%j`",t);if(!UR.call(t,`fence`)&&!UR.call(t,`marker`))throw VR("Missing `marker` or `fence` in matter `%j`",t);return t}function qR(e){let t=GR(e),n={},r=-1;for(;++r<t.length;){let e=t[r],i=YR(e,`open`).charCodeAt(0),a=JR(e),o=n[i];Array.isArray(o)?o.push(a):n[i]=[a]}return{flow:n}}function JR(e){let t=e.anywhere,n=e.type,r=n+`Fence`,i=r+`Sequence`,a=n+`Value`,o={tokenize:u,partial:!0},s,c=0;return{tokenize:l,concrete:!0};function l(l,u,d){let f=this;return p;function p(a){let o=f.now();return o.column===1&&(o.line===1||t)&&(s=YR(e,`open`),c=0,a===s.charCodeAt(c))?(l.enter(n),l.enter(r),l.enter(i),m(a)):d(a)}function m(e){return c===s.length?(l.exit(i),$(e)?(l.enter(`whitespace`),h(e)):g(e)):e===s.charCodeAt(c++)?(l.consume(e),m):d(e)}function h(e){return $(e)?(l.consume(e),h):(l.exit(`whitespace`),g(e))}function g(t){return Q(t)?(l.exit(r),l.enter(`lineEnding`),l.consume(t),l.exit(`lineEnding`),s=YR(e,`close`),c=0,l.attempt(o,b,_)):d(t)}function _(e){return e===null||Q(e)?y(e):(l.enter(a),v(e))}function v(e){return e===null||Q(e)?(l.exit(a),y(e)):(l.consume(e),v)}function y(e){return e===null?d(e):(l.enter(`lineEnding`),l.consume(e),l.exit(`lineEnding`),l.attempt(o,b,_))}function b(e){return l.exit(n),u(e)}}function u(e,t,n){let a=0;return o;function o(t){return t===s.charCodeAt(a)?(e.enter(r),e.enter(i),c(t)):n(t)}function c(t){return a===s.length?(e.exit(i),$(t)?(e.enter(`whitespace`),l(t)):u(t)):t===s.charCodeAt(a++)?(e.consume(t),c):n(t)}function l(t){return $(t)?(e.consume(t),l):(e.exit(`whitespace`),u(t))}function u(i){return i===null||Q(i)?(e.exit(r),t(i)):n(i)}}}function YR(e,t){return e.marker?XR(e.marker,t).repeat(3):XR(e.fence,t)}function XR(e,t){return typeof e==`string`?e:e[t]}function ZR(e){let t=GR(e),n={},r={},i=-1;for(;++i<t.length;){let e=t[i];n[e.type]=QR(e),r[e.type]=$R,r[e.type+`Value`]=ez}return{enter:n,exit:r}}function QR(e){return t;function t(t){this.enter({type:e.type,value:``},t),this.buffer()}}function $R(e){let t=this.resume(),n=this.stack[this.stack.length-1];`value`in n,this.exit(e),n.value=t.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``)}function ez(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}function tz(e){let t=[],n={},r=GR(e),i=-1;for(;++i<r.length;){let e=r[i];n[e.type]=nz(e);let a=rz(e,`open`);t.push({atBreak:!0,character:a.charAt(0),after:AM(a.charAt(1))})}return{unsafe:t,handlers:n}}function nz(e){let t=rz(e,`open`),n=rz(e,`close`);return r;function r(e){return t+(e.value?`
|
|
274
274
|
`+e.value:``)+`
|
|
275
275
|
`+n}}function rz(e,t){return e.marker?iz(e.marker,t).repeat(3):iz(e.fence,t)}function iz(e,t){return typeof e==`string`?e:e[t]}function az(e){let t=this,n=e||`yaml`,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(qR(n)),a.push(ZR(n)),o.push(tz(n))}function oz(e){return e.charAt(0).toUpperCase()+e.slice(1)}const sz={note:`<svg class="octicon octicon-info mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`,tip:`<svg class="octicon octicon-light-bulb mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></svg>`,important:`<svg class="octicon octicon-report mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,warning:`<svg class="octicon octicon-alert mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></svg>`,caution:`<svg class="octicon octicon-stop mr-2" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"><path d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></svg>`};function cz(e){return e.replace(`<svg`,~e.indexOf(`xmlns`)?`<svg`:`<svg xmlns="http://www.w3.org/2000/svg"`).replaceAll(`"`,`'`).replaceAll(`%`,`%25`).replaceAll(`#`,`%23`).replaceAll(`{`,`%7B`).replaceAll(`}`,`%7D`).replaceAll(`<`,`%3C`).replaceAll(`>`,`%3E`)}const lz=(e={})=>{let{markers:t=[`TIP`,`NOTE`,`IMPORTANT`,`WARNING`,`CAUTION`],icons:n=sz,matchCaseSensitive:r=!1,titles:i={},classPrefix:a=`markdown-alert`,ignoreSquareBracket:o=!1}=e,s=t===`*`?`\\w+`:t.join(`|`),c=RegExp(o?`^!(${s})([^\\n\\r]*)`:`^\\[\\!(${s})\\]([^\\n\\r]*)`,r?``:`i`);return e=>(dM(e,`blockquote`,(e,t,r)=>{let o=e.children[0];if(!o)return;let s=o.children?.[0];if(!s||(!(`value`in s)&&`children`in s&&s.children[0]&&(s=s.children[0]),s.type!==`text`))return;let l=s.value.match(c);if(!l)return;let u=l[1]?.toLowerCase(),d=l[2]?.trim()||(i[u]??oz(u)),f=n[u],p=`data:image/svg+xml;utf8,${cz(f)}`;t===void 0||!r||(s.value=s.value.slice(l[0].length).trimStart(),e.data={hName:`div`,hProperties:{class:`${a} ${a}-${u}`}},e.children=[{type:`paragraph`,data:{hName:`p`,hProperties:{class:`${a}-title`}},children:[{type:`span`,data:{hName:`span`,hProperties:{class:`octicon octicon-${u}`,style:`--oct-icon: url("${p}")`}}},{type:`text`,value:d}]},...e.children])}),e)};function uz(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function dz(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
|
|
276
276
|
`,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(PN(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
|
|
@@ -364,7 +364,7 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
364
364
|
});
|
|
365
365
|
<\/script>
|
|
366
366
|
</div>`}];function rK(e){return["```html preview",e.html,"```"].join(`
|
|
367
|
-
`)}const iK=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.6321 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],aK=`127.0.0.1`,oK=oS.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}}),sK=yS.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[Lx({find:mS,type:this.type,getAttributes:{sourceDelimiter:`*`}}),Lx({find:gS,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),cK=pS.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[Lx({find:cS,type:this.type,getAttributes:{sourceDelimiter:`**`}}),Lx({find:uS,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),lK=gx.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),uK=eS.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}}),dK=eS.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),fK=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/;function pK(e){let t=e.match(fK);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function mK(e,t){return e?e+t:t}function hK(e){if(e===``)return``;let t=e.match(fK);return t?(t[1]??``).replace(/\r?\n$/,``):e}const gK=xS.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),_K=CS.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1},sourceLeadingIndent:{default:null,rendered:!1},sourceInteriorSpacing:{default:null,rendered:!1}}}}),vK=eS.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}});function yK(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}const bK=TS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=sb(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=yK(t.src)),[`img`,t]}}),xK=eS.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),SK=eS.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),CK=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],wK=CK.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${wK}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function TK(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}const EK=new Set(CK.map(e=>`${e}:`));function DK(e){try{let t=new URL(e,`https://placeholder.invalid`);return EK.has(t.protocol.toLowerCase())}catch{return!1}}const OK=LS.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:DK,validate:DK,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),kK=eS.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs,i=r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},i]}});function AK(e){return e.type.name===`list`&&!e.attrs.ordered}function jK(e){return e.type.name===`list`&&!!e.attrs.ordered}function MK(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function NK(e,t,n,r,i,a,o){let s=Zy(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Jp(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return Gp(n,a)(e,void 0)?t?Gp(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}const PK=eS.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,sb(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:NK(e,t,n,r,e=>AK(e)&&!MK(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:NK(e,t,n,r,e=>jK(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:NK(e,t,n,r,e=>AK(e)&&MK(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Bx({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),Bx({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new cx({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=sf(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),FK=eS.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1},sourceMarkerSpacing:{default:null,rendered:!1},sourceOrdinal:{default:null,rendered:!1},sourceCheckboxChar:{default:null,rendered:!1},sourceContinuationIndent:{default:null,rendered:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,sb(t),0]:[`li`,sb(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(sb(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`),c=()=>{o&&(o.disabled=!n.isEditable)};return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,c(),n.on(`update`,c),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,o.disabled=!n.isEditable,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)},destroy(){n.off(`update`,c)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),IK=PK,LK=FK,RK=eS.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),zK=eS.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),BK=Jw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),VK=Qw.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),HK=eS.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,style:`display: none;`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),UK=gx.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,style:`display: none;`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),WK=Tx.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}}),GK=eS.create({name:`imageReference`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs,i=t||n;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:i}]}});function KK(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function qK(e){let t=!1;return e.descendants(e=>t?!1:(e.type.name===`list`&&(t=!0),!t)),t}function JK(e){let{selection:t}=e;return t instanceof B?t.$cursor:null}function YK(e){let t=JK(e);if(!t||t.parentOffset!==0)return!1;let n=KK(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r===0?!1:qK(t.node(n-1).child(r-1))}function XK(e,t){for(let n=t-1;n>=0;n--){let t=e.node(n),r=e.index(n);if(r<t.childCount-1){let e=t.child(r+1),i=n+1;for(;e.type.name===`list`&&e.firstChild;)e=e.firstChild,i+=1;return e.type.name===`listItem`?i:null}}return null}function ZK(e){let t=JK(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=KK(t);if(n===null)return!1;for(let e=t.depth;e>n;e--)if(t.index(e-1)!==t.node(e-1).childCount-1)return!1;let r=XK(t,n);return r!==null&&r<n}const QK=Tx.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!YK(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return dp(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!ZK(e.state))return!1;let{state:t,view:n}=e;return fp(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),$K=new Map([[32,` `],[9,` `]]);function eq(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function tq(e){let t=eq(e);return t!==null&&$K.has(t)}function nq(e){let t=eq(e);return t===null?null:$K.get(t)??null}const rq=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function iq(e){rq.lastIndex=0;let t=e.match(rq);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=nq(e);if(t===null)return null;n+=t}return n}const aq=gx.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function oq(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||sq(n)===r?!0:iq(n)===r}function sq(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const cq=RT.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),lq=Gw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),uq=Aw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),dq=jw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),fq=eS.create({name:`tag`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),pq=/^(?:---|—-|___\s|\*\*\*\s)$/;function mq(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const hq=tT.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[Rx({find:pq,type:this.type,getAttributes:e=>({sourceRaw:mq(e)})})]}});function gq(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function _q(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const vq=eS.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:gq(e.getAttribute(`data-alias`)),anchor:gq(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:gq(e.getAttribute(`data-alias`)),anchor:gq(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=gq(e.attrs.alias),i=gq(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},_q({target:n,alias:r,anchor:i})]}});function yq(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function bq(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const xq=[xK,zK,SK,RK,vq,eS.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:gq(e.getAttribute(`data-alias`)),anchor:gq(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=gq(e.attrs.alias),i=gq(e.attrs.anchor),a=gq(e.attrs.resolvedSrc),o=yq(n);if(Vc.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},bq({target:n,alias:r,anchor:i})]}}),fq,IK,LK,sK,cK,cq,VK,oK,BK,_K,hq,OK,vK,kK,gK,lK,WK,aq,AE.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),QK,lq.configure({resizable:!0}),Mw,dq,uq,bK.configure({inline:!0}),GK,BS,UK,HK,dK,uK];3072-Sq("This is an OpenKnowledge project: load the `open-knowledge` skill and use the OpenKnowledge MCP tools for all markdown — don't probe for `.ok/` or use native file tools on `.md` / `.mdx`. ",`cursor`);function Sq(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function Cq(e){return`'${e.replace(/'/g,`'\\''`)}'`}`${tK}`,[`delete`,`move`,`share_link`,`install`].map(e=>`mcp__${tK}__${e}`),`${Cq(`mcp_servers.${tK}.default_tools_approval_mode="approve"`)}`;function wq(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}const Tq=new Set([`opencode.json`]);function Eq(e){return e.split(`/`).some(e=>e.startsWith(`.`))?!0:Tq.has(e.slice(e.lastIndexOf(`/`)+1))}function Dq(e,t){let n=wq(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const Oq=A().superRefine(Dq).optional(),kq={agentId:A().optional(),agentName:A().optional(),colorSeed:A().optional(),clientName:A().optional(),clientVersion:A().optional(),label:A().optional()},Aq=A().optional(),jq=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Mq=tc(`kind`,[P({kind:I(`doc`),docPath:A().min(1)}).loose(),P({kind:I(`folder`),folderPath:A()}).loose()]),Nq=F([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),Pq=F([`current`,`stale`,`absent`]),Fq=tc(`ok`,[P({ok:I(!0),shareUrl:A().min(1),sharedUrl:A().min(1),branch:A().min(1),freshness:Pq.optional().catch(void 0)}).loose(),P({ok:I(!1),error:Nq,branch:A().min(1).optional()}).loose()]),Iq=F([`user`,`org`]),Lq=P({login:A().min(1),kind:Iq,avatarUrl:A().optional()}).loose(),Rq=F([`auth-required`,`network`]),zq=tc(`ok`,[P({ok:I(!0),owners:N(Lq)}).loose(),P({ok:I(!1),error:Rq}).loose()]),Bq=tc(`ok`,[P({ok:I(!0),available:M()}).loose(),P({ok:I(!1),error:Rq}).loose()]),Vq=F([`public`,`private`]),Hq=P({owner:A().min(1),name:A().min(1),visibility:Vq,description:A().optional()}).loose(),Uq=F([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),Wq=tc(`ok`,[P({ok:I(!0),ownerLogin:A().min(1),repoName:A().min(1),cloneUrl:A().min(1),defaultBranch:A().min(1)}).loose(),P({ok:I(!1),error:Uq}).loose()]);function Gq(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const Kq=e=>e.refine(Gq,`invalid branch name`);function qq(e){if(e==null)return!1;let t=e instanceof Error?e.message:String(e);return/couldn'?t find remote ref|Remote branch .+ not found/i.test(t)}const Jq=[/could not read (username|password)/i,/terminal prompts disabled/i],Yq=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],Xq=[/permission denied.*\(publickey\)/i,/host key verification failed/i],Zq=[/\b(401|403)\b/,/authentication failed/i,/authorization failed/i,/invalid credentials/i,/credential helper/i,/bad credentials/i,/token.*expired/i,/expired.*token/i,/fatal:.*repository.*not found/i];function Qq(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function $q(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${Qq(e)}`;return Jq.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:Yq.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:Xq.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:Zq.some(e=>e.test(t))?/\b401\b/.test(t)||/token.*expired/i.test(t)?{kind:`auth`,subclass:`401`}:/\b403\b/.test(t)?{kind:`auth`,subclass:`403`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function eJ(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const tJ={shareTargetExists:M(),dirtyConflicts:P({conflicts:M(),files:N(A().min(1))}).loose(),branchIsLocal:M(),shareTargetOnOriginBranch:M().optional()},nJ=tc(`detached`,[P({detached:I(!1),currentBranch:A().min(1).nullable(),currentHeadSha:Hs(),...tJ}).loose(),P({detached:I(!0),currentBranch:Hs(),currentHeadSha:A().min(1),...tJ}).loose()]),rJ=P({branch:Kq(A().min(1)),principalId:A().optional(),fastForward:M().optional()}).loose(),iJ=F([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]),aJ=tc(`ok`,[P({ok:I(!0)}).loose(),P({ok:I(!1),reason:iJ,files:N(A().min(1)).optional(),otherWorktreePath:A().min(1).optional()}).loose()]);F([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]);const oJ=P({branch:Kq(A().min(1)),path:A(),kind:F([`doc`,`folder`])}).loose(),sJ=tc(`verdict`,[P({verdict:I(`on-origin`)}).loose(),P({verdict:I(`renamed`),renamedTo:A().min(1)}).loose(),P({verdict:I(`deleted`)}).loose(),P({verdict:I(`never-on-branch`)}).loose(),P({verdict:I(`changed-locally`)}).loose(),P({verdict:I(`unknown`)}).loose()]).catch({verdict:`unknown`}),cJ=P({startedAt:A().min(1),httpListenMs:j().nonnegative().optional(),seedWalkMs:j().nonnegative().optional(),indexesMs:j().nonnegative().optional(),readyMs:j().nonnegative().optional(),fileCount:j().nonnegative().optional()}),lJ=P({serverInstanceId:A().min(1),currentBranch:A().min(1).optional(),currentDiskAckSVs:ac(A().min(1),A().min(1)).optional(),boot:cJ.optional()}).loose(),uJ=P({id:A().min(1),display_name:A().min(1),display_email:A(),source:F([`git-config`,`synthesized`]),created_at:A().min(1)}).loose(),dJ=P({collabUrl:A().nullable(),previewUrl:A().nullable(),port:j(),singleFile:M().default(!1)}).loose(),fJ=F(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:no-conflict-tracked.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed`.split(`.`));function pJ(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const mJ=P({type:fJ,title:A().min(1),status:j().int().min(400).max(599),instance:A().regex(jq,`instance must be urn:uuid:<uuid>`).optional(),detail:A().optional()}).loose(),hJ=P({parentDocName:A().min(1),placement:F([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:A().min(1).optional(),agentName:A().min(1).optional()}).loose(),gJ=P({src:A().min(1),path:A().min(1).optional(),deduped:M().optional()}).loose(),_J=P({url:A().min(1),dir:A().min(1),branch:A().min(1).refine(Gq,`invalid branch name`).optional()}).loose(),vJ=P({type:I(`error`),problem:mJ}).loose();function yJ(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(`
|
|
367
|
+
`)}const iK=[{name:`--chart-1`,light:`oklch(0.62 0.19 259)`,dark:`oklch(0.72 0.14 259)`},{name:`--chart-2`,light:`oklch(0.58 0.14 145)`,dark:`oklch(0.73 0.13 145)`},{name:`--chart-3`,light:`oklch(0.62 0.15 70)`,dark:`oklch(0.77 0.14 70)`},{name:`--chart-4`,light:`oklch(0.55 0.18 290)`,dark:`oklch(0.72 0.16 290)`},{name:`--chart-5`,light:`oklch(0.58 0.21 25)`,dark:`oklch(0.72 0.2 25)`},{name:`--primary`,light:`oklch(0.6321 0.1983 259.59)`,dark:`#69a3ff`},{name:`--primary-foreground`,light:`oklch(0.985 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--background`,light:`oklch(1 0 0)`,dark:`oklch(0.145 0 0)`},{name:`--card`,light:`oklch(1 0 0)`,dark:`oklch(0.205 0 0)`},{name:`--card-foreground`,light:`oklch(0.145 0 0)`,dark:`oklch(0.985 0 0)`},{name:`--muted-foreground`,light:`oklch(0.556 0 0)`,dark:`oklch(0.708 0 0)`},{name:`--border`,light:`oklch(0.922 0 0)`,dark:`oklch(1 0 0 / 10%)`},{name:`--destructive`,light:`oklch(0.577 0.245 27.325)`,dark:`oklch(0.704 0.191 22.216)`},{name:`--radius`,light:`0.625rem`,dark:`0.625rem`}],aK=`127.0.0.1`,oK=oS.extend({priority:60,addAttributes(){return{...this.parent?.(),fenceDelimiter:{default:"`"},fenceLength:{default:3},meta:{default:null},sourceStyle:{default:`fenced`},sourceClosingFenceLength:{default:null,rendered:!1},sourceFenceIndent:{default:null,rendered:!1},sourceInfoPadding:{default:null,rendered:!1},sourceIndents:{default:null,rendered:!1}}}}),sK=yS.extend({name:`emphasis`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`*`}}},addInputRules(){return[Lx({find:mS,type:this.type,getAttributes:{sourceDelimiter:`*`}}),Lx({find:gS,type:this.type,getAttributes:{sourceDelimiter:`_`}})]}}),cK=pS.extend({name:`strong`,priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`**`}}},addInputRules(){return[Lx({find:cS,type:this.type,getAttributes:{sourceDelimiter:`**`}}),Lx({find:uS,type:this.type,getAttributes:{sourceDelimiter:`__`}})]}}),lK=gx.create({name:`escapeMark`,priority:10,excludes:``,inclusive:!1,parseHTML(){return[{tag:`span[data-escape-mark]`}]},renderHTML(){return[`span`,{"data-escape-mark":``},0]}}),uK=eS.create({name:`footnoteDefinition`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){let e=e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}};return[{tag:`aside[data-footnote-def]`,getAttrs:e},{tag:`aside.footnote-def`,getAttrs:e}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.identifier??``);return[`aside`,{...t,"data-footnote-def":``,"data-footnote-id":n,id:`fn-${n}`,class:`footnote-def`},[`div`,{class:`footnote-body`},0],[`a`,{href:`#fnref-${n}`,class:`footnote-backref`,contentEditable:`false`,"aria-label":`Back to reference`},`↩`]]},addCommands(){return{insertFootnoteDefinition:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e},content:[{type:`paragraph`}]})}}}),dK=eS.create({name:`footnoteReference`,group:`inline`,inline:!0,atom:!0,selectable:!0,draggable:!1,priority:60,addAttributes(){return{identifier:{default:``},label:{default:null}}},parseHTML(){return[{tag:`sup[data-footnote-ref]`,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-footnote-id`)||``;return{identifier:t,label:t||null}}}]},renderHTML({node:e}){let t=String(e.attrs.identifier??``);return[`sup`,{id:`fnref-${t}`,"data-footnote-ref":``,"data-footnote-id":t,class:`footnote-ref`},[`a`,{href:`#fn-${t}`,class:`footnote-ref-link`},`[${t}]`]]},addCommands(){return{insertFootnoteReference:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{identifier:e,label:e}})}}}),fK=/^---[ \t]*\r?\n([\s\S]*?\r?\n)?---[ \t]*(\r?\n|$)/;function pK(e){let t=e.match(fK);return t?{frontmatter:t[0],body:e.slice(t[0].length)}:{frontmatter:``,body:e}}function mK(e,t){return e?e+t:t}function hK(e){if(e===``)return``;let t=e.match(fK);return t?(t[1]??``).replace(/\r?\n$/,``):e}const gK=xS.extend({priority:60,addAttributes(){return{...this.parent?.(),hardBreakStyle:{default:`backslash`},sourceRaw:{default:null}}}}),_K=CS.extend({priority:60,addAttributes(){return{...this.parent?.(),headingStyle:{default:`atx`},sourceTrailingHashes:{default:null},sourceUnderlineLength:{default:null},sourceContiguousNext:{default:!1},sourceLeadingIndent:{default:null,rendered:!1},sourceInteriorSpacing:{default:null,rendered:!1}}}}),vK=eS.create({name:`htmlBlock`,group:`block`,atom:!0,priority:60,addAttributes(){return{content:{default:``}}},parseHTML(){return[{tag:`div[data-html-block]`}]},renderHTML({node:e}){return[`div`,{"data-html-block":``,class:`html-block`},e.attrs.content]}});function yK(e){if(typeof e!=`string`||!e.startsWith(`/`))return e;let t=globalThis.window?.okDesktop?.config?.apiOrigin;return typeof t==`string`&&t?t+e:e}const bK=TS.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceUrl:{default:null,rendered:!1}}},renderHTML({HTMLAttributes:e}){let t=sb(this.options.HTMLAttributes,e);return typeof t.src==`string`&&(t.src=yK(t.src)),[`img`,t]}}),xK=eS.create({name:`jsxComponent`,group:`block`,atom:!1,content:`block*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{componentName:{default:``},kind:{default:`element`},attributes:{default:[]},sourceRaw:{default:``},sourceDirty:{default:!1},props:{default:{}}}},parseHTML(){return[{tag:`div[data-jsx-component]`,getAttrs:e=>typeof e==`string`?!1:{componentName:e.getAttribute(`data-component-name`)||``,sourceRaw:e.getAttribute(`data-source-raw`)||``}}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-jsx-component":``,"data-component-name":e.componentName,"data-source-raw":e.sourceRaw},0]},addCommands(){return{insertJsxComponent:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{sourceRaw:e}})}}}),SK=eS.create({name:`jsxInline`,group:`inline`,inline:!0,atom:!1,content:`text*`,isolating:!1,selectable:!0,priority:60,addAttributes(){return{}},parseHTML(){return[{tag:`span[data-jsx-inline]`}]},renderHTML(){return[`span`,{"data-jsx-inline":``},0]}}),CK=[`https`,`http`,`mailto`,`tel`,`ftp`,`sms`],wK=CK.map(e=>`${e}:`).join(`|`);RegExp(`^(?:${wK}|\\/|#|\\?|\\.\\/|\\.\\.\\/)`,`i`);function TK(e){let t=e.trim();if(t===``)return!0;let n=t.indexOf(`:`);if(n===-1)return!0;let r=t.indexOf(`/`),i=t.indexOf(`?`),a=t.indexOf(`#`);return n>Math.min(r===-1?1/0:r,i===-1?1/0:i,a===-1?1/0:a)}const EK=new Set(CK.map(e=>`${e}:`));function DK(e){try{let t=new URL(e,`https://placeholder.invalid`);return EK.has(t.protocol.toLowerCase())}catch{return!1}}const OK=LS.extend({priority:60,addOptions(){return{openOnClick:!1,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:`http`,HTMLAttributes:{target:`_blank`,rel:`noopener noreferrer`},isAllowedUri:DK,validate:DK,shouldAutoLink:()=>!0}},addAttributes(){return{...this.parent?.(),linkStyle:{default:`inline`,rendered:!1},refLabel:{default:null,rendered:!1},sourceForm:{default:null,rendered:!1},target:{default:null,rendered:!1},anchor:{default:null,rendered:!1},alias:{default:null,rendered:!1},sourceUrlForm:{default:null,rendered:!1},sourceTitleMarker:{default:null,rendered:!1}}}}),kK=eS.create({name:`linkRefDef`,group:`block`,atom:!0,priority:60,addAttributes(){return{label:{default:``},href:{default:``},title:{default:null},sourceLayout:{default:null},sourceTitleMarker:{default:null}}},parseHTML(){return[{tag:`div[data-link-ref-def]`}]},renderHTML({node:e}){let{label:t,href:n,title:r}=e.attrs,i=r?`[${t}]: ${n} "${r}"`:`[${t}]: ${n}`;return[`div`,{"data-link-ref-def":``,class:`link-ref-def`},i]}});function AK(e){return e.type.name===`list`&&!e.attrs.ordered}function jK(e){return e.type.name===`list`&&!!e.attrs.ordered}function MK(e){let t=!1;return e.forEach(e=>{e.type.name===`listItem`&&e.attrs.checked!==null&&(t=!0)}),t}function NK(e,t,n,r,i,a,o){let s=Zy(e=>e.type.name===`list`)(e.selection);if(s&&i(s.node)){let{$from:n,$to:i}=e.selection;return n.blockRange(i)?Jp(r)(e,t):!1}if(s){if(!t)return!0;let{tr:n}=e;return n.setNodeMarkup(s.pos,void 0,{...s.node.attrs,...a}),o!==void 0&&s.node.forEach((e,t)=>{if(e.type.name===`listItem`){let r=s.pos+1+t;n.setNodeMarkup(r,void 0,{...e.attrs,...o})}}),t(n),!0}return Gp(n,a)(e,void 0)?t?Gp(n,a)(e,n=>{if(o){let t=n.mapping.map(e.selection.$from.pos),r=n.doc.resolve(t);for(let e=r.depth;e>0;e--){let t=r.node(e);if(t.type.name===`listItem`){n.setNodeMarkup(r.before(e),void 0,{...t.attrs,...o});break}}}t(n)}):!0:!1}const PK=eS.create({name:`list`,group:`block list`,content:`listItem+`,priority:60,addAttributes(){return{ordered:{default:!1},start:{default:1},spread:{default:!1},bulletMarker:{default:null},listMarkerDelimiter:{default:null}}},parseHTML(){return[{tag:`ul`,getAttrs:()=>({ordered:!1})},{tag:`ol`,getAttrs:e=>({ordered:!0,start:e.getAttribute(`start`)?Number(e.getAttribute(`start`)):1})}]},renderHTML({node:e,HTMLAttributes:t}){let n=e.attrs.ordered?`ol`:`ul`,r={};return e.attrs.ordered&&e.attrs.start!==1&&(r.start=e.attrs.start),[n,sb(t,r),0]},addCommands(){return{toggleBulletList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:NK(e,t,n,r,e=>AK(e)&&!MK(e),{ordered:!1},{checked:null})},toggleOrderedList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:NK(e,t,n,r,e=>jK(e),{ordered:!0},{checked:null})},toggleTaskList:()=>({state:e,dispatch:t})=>{let n=e.schema.nodes.list,r=e.schema.nodes.listItem;return!n||!r?!1:NK(e,t,n,r,e=>AK(e)&&MK(e),{ordered:!1},{checked:!1})}}},addInputRules(){return[Bx({find:/^\s*([-+*])(?!\s*\[[ xX]\])\s$/,type:this.type,getAttributes:e=>({ordered:!1,bulletMarker:e[1]}),joinPredicate:(e,t)=>t.attrs.ordered===!1}),Bx({find:/^\s*(\d+)([.)])\s$/,type:this.type,getAttributes:e=>({ordered:!0,start:Number(e[1]),listMarkerDelimiter:e[2]}),joinPredicate:(e,t)=>t.attrs.ordered===!0}),new cx({find:/^\s*[-*+]\s\[([ xX])\]\s$/,handler:({state:e,range:t,match:n})=>{let r=e.schema.nodes.list;if(!r)return null;let i=n[1]!==` `,a=e.tr.delete(t.from,t.to),o=a.doc.resolve(t.from).blockRange();if(!o)return null;let s=sf(o,r,{ordered:!1});if(!s)return null;a.wrap(o,s);let c=a.doc.resolve(a.mapping.map(t.from));for(let e=c.depth;e>0;e--){let t=c.node(e);if(t.type.name===`listItem`){a.setNodeMarkup(c.before(e),void 0,{...t.attrs,checked:i});break}}}})]},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList(),"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList(),"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),FK=eS.create({name:`listItem`,content:`paragraph block*`,defining:!0,addAttributes(){return{checked:{default:null},spread:{default:!1},sourceMarkerSpacing:{default:null,rendered:!1},sourceOrdinal:{default:null,rendered:!1},sourceCheckboxChar:{default:null,rendered:!1},sourceContinuationIndent:{default:null,rendered:!1}}},parseHTML(){return[{tag:`li`,getAttrs:e=>{let t=e.querySelector(`input[type="checkbox"]`);return{checked:t?t.checked:null}}}]},renderHTML({node:e,HTMLAttributes:t}){return e.attrs.checked===null?[`li`,sb(t),0]:[`li`,sb(t,{"data-type":`taskItem`,"data-checked":e.attrs.checked?`true`:`false`}),[`label`,{contenteditable:`false`},[`input`,{type:`checkbox`,...e.attrs.checked?{checked:`checked`}:{}}]],[`div`,0]]},addNodeView(){return({node:e,getPos:t,editor:n,HTMLAttributes:r})=>{let i=document.createElement(`li`);Object.entries(sb(r,e.attrs.checked===null?{}:{"data-type":`taskItem`,"data-checked":String(!!e.attrs.checked)})).forEach(([e,t])=>{t!=null&&i.setAttribute(e,String(t))});let a=null,o=null,s=document.createElement(`div`),c=()=>{o&&(o.disabled=!n.isEditable)};return e.attrs.checked!==null&&(a=document.createElement(`label`),a.contentEditable=`false`,o=document.createElement(`input`),o.type=`checkbox`,o.checked=!!e.attrs.checked,c(),n.on(`update`,c),o.addEventListener(`change`,()=>{let r=t();r===void 0||typeof r!=`number`||n.view.dispatch(n.view.state.tr.setNodeMarkup(r,void 0,{...e.attrs,checked:o?.checked??!1}))}),a.appendChild(o),i.appendChild(a)),i.appendChild(s),{dom:i,contentDOM:s,update(t){return t.type!==e.type||t.attrs.checked!==null!=(e.attrs.checked!==null)?!1:(o&&t.attrs.checked!==null&&(o.checked=!!t.attrs.checked,o.disabled=!n.isEditable,i.setAttribute(`data-checked`,String(!!t.attrs.checked))),e=t,!0)},destroy(){n.off(`update`,c)}}}},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.sinkListItem(this.name);return!1},"Shift-Tab":()=>{let{$from:e}=this.editor.state.selection;for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return this.editor.commands.liftListItem(this.name);return!1}}}}),IK=PK,LK=FK,RK=eS.create({name:`mathInline`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{formula:{default:``},id:{default:null},language:{default:`latex`},sourceDelimiter:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-math-inline]`,getAttrs:e=>typeof e==`string`?!1:{formula:e.getAttribute(`data-formula`)||``,id:e.getAttribute(`id`)||null,language:e.getAttribute(`data-language`)||`latex`}}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-math-inline":``,"data-formula":e.formula,"data-language":e.language,...e.id?{id:e.id}:{}}]},addCommands(){return{insertMathInline:e=>({commands:t})=>t.insertContent({type:this.name,attrs:{formula:e}})}}}),zK=eS.create({name:`rawMdxFallback`,group:`block`,atom:!1,content:`text*`,isolating:!0,selectable:!0,defining:!0,priority:60,addAttributes(){return{reason:{default:``},originalSpan:{default:{start:0,end:0}}}},parseHTML(){let e=e=>typeof e==`string`?!1:{reason:e.getAttribute(`data-reason`)||``};return[{tag:`div[data-raw-mdx-fallback]`,getAttrs:e},{tag:`pre[data-raw-mdx-fallback]`,getAttrs:e}]},renderHTML({HTMLAttributes:e}){return[`div`,{"data-raw-mdx-fallback":``,"data-raw-badge":`raw`,"data-reason":e.reason,contenteditable:`false`,class:`raw-mdx-fallback`},0]},addNodeView(){return({HTMLAttributes:e})=>{let t=document.createElement(`div`);t.setAttribute(`data-raw-mdx-fallback`,``),t.setAttribute(`data-raw-badge`,`raw`),t.setAttribute(`contenteditable`,`false`),t.classList.add(`raw-mdx-fallback`),e.reason&&t.setAttribute(`data-reason`,e.reason);let n=document.createElement(`pre`);return n.classList.add(`raw-mdx-fallback-content`),n.setAttribute(`contenteditable`,`false`),t.appendChild(n),{dom:t,contentDOM:n,ignoreMutation:()=>!0}}}}),BK=Jw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceMarkerSpacings:{default:null}}}}),VK=Qw.extend({excludes:``,addAttributes(){return{...this.parent?.(),sourceFenceChar:{default:"`"},sourceFenceLength:{default:1},sourcePadded:{default:!1,rendered:!1}}}}),HK=eS.create({name:`commentBlock`,group:`block`,content:`block+`,defining:!0,priority:60,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}},sourceLayout:{default:`block`,parseHTML:e=>e.getAttribute(`data-source-layout`)===`inline`?`inline`:`block`,renderHTML:e=>e.sourceLayout===`inline`?{"data-source-layout":`inline`}:{}}}},parseHTML(){return[{tag:`aside[data-comment-block]`},{tag:`aside.comment-block`}]},renderHTML({HTMLAttributes:e}){return[`aside`,{"data-comment-block":``,"data-clipboard-omit":`true`,class:`comment-block`,style:`display: none;`,...e},0]},addCommands(){return{setCommentBlock:()=>({commands:e})=>e.wrapIn(this.name),toggleCommentBlock:()=>({commands:e})=>e.toggleWrap(this.name),unsetCommentBlock:()=>({commands:e})=>e.lift(this.name)}}}),UK=gx.create({name:`comment`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceForm:{default:`percent`,parseHTML:e=>e.getAttribute(`data-source-form`)===`html`?`html`:`percent`,renderHTML:e=>e.sourceForm===`html`?{"data-source-form":`html`}:{}}}},parseHTML(){return[{tag:`span[data-comment-mark]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-comment-mark":``,"data-clipboard-omit":`true`,class:`comment-mark`,style:`display: none;`,...e},0]},addCommands(){return{setComment:()=>({commands:e})=>e.setMark(this.name),toggleComment:()=>({commands:e})=>e.toggleMark(this.name),unsetComment:()=>({commands:e})=>e.unsetMark(this.name)}}}),WK=Tx.create({name:`docFidelity`,addGlobalAttributes(){return[{types:[`doc`],attributes:{sourceDocBoundary:{default:null,rendered:!1}}}]}}),GK=eS.create({name:`imageReference`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{alt:{default:``},label:{default:``},identifier:{default:``},referenceType:{default:`shortcut`}}},parseHTML(){return[{tag:`img[data-image-reference]`}]},renderHTML({node:e}){let{alt:t,label:n,referenceType:r}=e.attrs,i=t||n;return[`img`,{"data-image-reference":``,"data-reference-type":r,"data-label":n,alt:i}]}});function KK(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.name===`listItem`)return t;return null}function qK(e){let t=!1;return e.descendants(e=>t?!1:(e.type.name===`list`&&(t=!0),!t)),t}function JK(e){let{selection:t}=e;return t instanceof B?t.$cursor:null}function YK(e){let t=JK(e);if(!t||t.parentOffset!==0)return!1;let n=KK(t);if(n===null||t.depth!==n+1||t.index(n)!==0)return!1;let r=t.index(n-1);return r===0?!1:qK(t.node(n-1).child(r-1))}function XK(e,t){for(let n=t-1;n>=0;n--){let t=e.node(n),r=e.index(n);if(r<t.childCount-1){let e=t.child(r+1),i=n+1;for(;e.type.name===`list`&&e.firstChild;)e=e.firstChild,i+=1;return e.type.name===`listItem`?i:null}}return null}function ZK(e){let t=JK(e);if(!t||t.parentOffset!==t.parent.content.size)return!1;let n=KK(t);if(n===null)return!1;for(let e=t.depth;e>n;e--)if(t.index(e-1)!==t.node(e-1).childCount-1)return!1;let r=XK(t,n);return r!==null&&r<n}const QK=Tx.create({name:`listBoundaryMerge`,addKeyboardShortcuts(){let e=()=>{let{editor:e}=this;if(!YK(e.state))return!1;if(e.commands.undoInputRule())return!0;let{state:t,view:n}=e;return dp(t,n.dispatch,n)},t=()=>{let{editor:e}=this;if(!ZK(e.state))return!1;let{state:t,view:n}=e;return fp(t,n.dispatch,n)};return{Backspace:e,"Mod-Backspace":e,Delete:t,"Mod-Delete":t}}}),$K=new Map([[32,` `],[9,` `],[160,`\xA0`]]);function eq(e){let t=/^&#(x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);$/.exec(e);if(!t)return null;let n=t[1],r=n[0]===`x`||n[0]===`X`,i=Number.parseInt(r?n.slice(1):n,r?16:10);return Number.isNaN(i)?null:i}function tq(e){let t=eq(e);return t!==null&&$K.has(t)}function nq(e){let t=eq(e);return t===null?null:$K.get(t)??null}const rq=/&#(?:x[0-9A-Fa-f]+|X[0-9A-Fa-f]+|[0-9]+);/g;function iq(e){rq.lastIndex=0;let t=e.match(rq);if(t===null||t.join(``)!==e)return null;let n=``;for(let e of t){let t=nq(e);if(t===null)return null;n+=t}return n}const aq=gx.create({name:`sourceLiteral`,priority:10,excludes:``,inclusive:!1,addAttributes(){return{sourceRaw:{default:``}}},parseHTML(){return[{tag:`span[data-source-literal]`}]},renderHTML({HTMLAttributes:e}){return[`span`,{"data-source-literal":``,...e},0]}});function oq(e,t){if(typeof e!=`string`||typeof t!=`string`||/[\x00-\x1F\x7F]/.test(e))return!1;let n=e.replaceAll(`\xA0`,` `),r=t.replaceAll(`\xA0`,` `);return n===r||sq(n)===r?!0:iq(e)===t}function sq(e){return e.replace(/\\([!-/:-@[-`{-~])/g,`$1`)}const cq=RT.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDelimiter:{default:`~~`,rendered:!1}}}}),lq=Gw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourceDashCounts:{default:null},sourceOuterPipes:{default:null,rendered:!1},sourceAlignmentPadding:{default:null,rendered:!1}}}}),uq=Aw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),dq=jw.extend({priority:60,addAttributes(){return{...this.parent?.(),sourcePadding:{default:null}}}}),fq=eS.create({name:`tag`,group:`inline`,inline:!0,atom:!0,selectable:!0,priority:60,addAttributes(){return{value:{default:``}}},parseHTML(){return[{tag:`a[data-tag]`,getAttrs:e=>typeof e==`string`?!1:{value:e.getAttribute(`data-tag`)||``}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.value??``);return[`a`,{...t,"data-tag":n,href:`#tag/${n}`,class:`tag`},`#${n}`]},addCommands(){return{insertTag:e=>({chain:t})=>t().insertContent({type:`tag`,attrs:{value:e}}).run()}}}),pq=/^(?:---|—-|___\s|\*\*\*\s)$/;function mq(e){let t=String(e[0]??``).replace(/\s+$/,``);return t===`—-`?`---`:t}const hq=tT.extend({name:`thematicBreak`,priority:60,addAttributes(){return{...this.parent?.(),sourceRaw:{default:`---`}}},addInputRules(){return[Rx({find:pq,type:this.type,getAttributes:e=>({sourceRaw:mq(e)})})]}});function gq(e){if(typeof e!=`string`)return null;let t=e.trim();return t.length>0?t:null}function _q(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const vq=eS.create({name:`wikiLink`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolved:{default:!1},sourceTarget:{default:null,rendered:!1},sourceAnchor:{default:null,rendered:!1},sourceAlias:{default:null,rendered:!1}}},parseHTML(){return[{tag:`span[data-wiki-link]`,getAttrs:e=>typeof e==`string`?!1:{target:e.getAttribute(`data-target`)||``,alias:gq(e.getAttribute(`data-alias`)),anchor:gq(e.getAttribute(`data-anchor`)),resolved:e.getAttribute(`data-resolved`)===`true`}},{tag:`a.wiki-link[data-target]`,priority:100,getAttrs:e=>{if(typeof e==`string`)return!1;let t=e.getAttribute(`data-target`)??``;return t?{target:t,alias:gq(e.getAttribute(`data-alias`)),anchor:gq(e.getAttribute(`data-anchor`)),resolved:!1}:!1}}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=gq(e.attrs.alias),i=gq(e.attrs.anchor),a=e.attrs.resolved===!0;return[`span`,{...t,"data-wiki-link":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,"data-resolved":a?`true`:`false`},_q({target:n,alias:r,anchor:i})]}});function yq(e){let t=e.split(`/`).pop()??e,n=t.lastIndexOf(`.`);return n<=0||n===t.length-1?``:t.slice(n+1).toLowerCase()}function bq(e){return e.alias?e.alias:e.anchor?`${e.target}#${e.anchor}`:e.target}const xq=[xK,zK,SK,RK,vq,eS.create({name:`wikiLinkEmbed`,group:`inline`,inline:!0,atom:!0,priority:60,addAttributes(){return{target:{default:``},alias:{default:null},anchor:{default:null},resolvedSrc:{default:null,rendered:!1,parseHTML:()=>null}}},parseHTML(){let e=e=>typeof e==`string`||!e.hasAttribute(`data-wiki-embed`)?!1:{target:e.getAttribute(`data-target`)||``,alias:gq(e.getAttribute(`data-alias`)),anchor:gq(e.getAttribute(`data-anchor`))};return[{tag:`img[data-wiki-embed]`,getAttrs:e,priority:100},{tag:`a[data-wiki-embed]`,getAttrs:e,priority:100}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.target??``),r=gq(e.attrs.alias),i=gq(e.attrs.anchor),a=gq(e.attrs.resolvedSrc),o=yq(n);if(Vc.has(o))return[`img`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,src:a??n,alt:r??n}];let s=a??n;return[`a`,{...t,"data-wiki-embed":``,"data-target":n,"data-alias":r??``,"data-anchor":i??``,href:i?`${s}#${i}`:s,target:`_blank`,rel:`noopener noreferrer`},bq({target:n,alias:r,anchor:i})]}}),fq,IK,LK,sK,cK,cq,VK,oK,BK,_K,hq,OK,vK,kK,gK,lK,WK,aq,AE.configure({undoRedo:!1,bulletList:!1,orderedList:!1,listItem:!1,listKeymap:{listTypes:[{itemName:`listItem`,wrapperNames:[`list`]}]},italic:!1,bold:!1,strike:!1,code:!1,codeBlock:!1,heading:!1,horizontalRule:!1,hardBreak:!1,link:!1,blockquote:!1,dropcursor:{color:`color-mix(in oklch, var(--primary) 50%, transparent)`,width:2}}),QK,lq.configure({resizable:!0}),Mw,dq,uq,bK.configure({inline:!0}),GK,BS,UK,HK,dK,uK];3072-Sq("This is an OpenKnowledge project: load the `open-knowledge` skill and use the OpenKnowledge MCP tools for all markdown — don't probe for `.ok/` or use native file tools on `.md` / `.mdx`. ",`cursor`);function Sq(e,t){let n=encodeURIComponent(e);return t===`cursor`?encodeURIComponent(n).length:n.length}function Cq(e){return`'${e.replace(/'/g,`'\\''`)}'`}`${tK}`,[`delete`,`move`,`share_link`,`install`].map(e=>`mcp__${tK}__${e}`),`${Cq(`mcp_servers.${tK}.default_tools_approval_mode="approve"`)}`;function wq(e){if(e.length===0)return{ok:!1,reason:`docName must not be empty`};if(e.trim().length===0)return{ok:!1,reason:`docName must not be blank (whitespace only)`};if(e!==e.trim())return{ok:!1,reason:`docName must not have leading or trailing whitespace`};for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32||n===127)return{ok:!1,reason:`docName must not contain control characters`}}if(e.includes(`..`)||e.startsWith(`/`)||e.includes(`\\`))return{ok:!1,reason:`docName must not contain "..", a leading "/", or a backslash`};for(let t of e.split(`/`)){if(t.length===0)return{ok:!1,reason:`docName must not contain empty path segments (no leading, trailing, or doubled "/")`};if(t.startsWith(`.`))return{ok:!1,reason:`docName path segments must not start with "." (hidden files are not addressable)`}}return{ok:!0}}const Tq=new Set([`opencode.json`]);function Eq(e){return e.split(`/`).some(e=>e.startsWith(`.`))?!0:Tq.has(e.slice(e.lastIndexOf(`/`)+1))}function Dq(e,t){let n=wq(e);n.ok||t.addIssue({code:`custom`,message:n.reason})}const Oq=A().superRefine(Dq).optional(),kq={agentId:A().optional(),agentName:A().optional(),colorSeed:A().optional(),clientName:A().optional(),clientVersion:A().optional(),label:A().optional()},Aq=A().optional(),jq=/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Mq=tc(`kind`,[P({kind:I(`doc`),docPath:A().min(1)}).loose(),P({kind:I(`folder`),folderPath:A()}).loose()]),Nq=F([`no-remote`,`detached-head`,`branch-not-on-origin`,`non-github-remote`,`invalid-path`]),Pq=F([`current`,`stale`,`absent`]),Fq=tc(`ok`,[P({ok:I(!0),shareUrl:A().min(1),sharedUrl:A().min(1),branch:A().min(1),freshness:Pq.optional().catch(void 0)}).loose(),P({ok:I(!1),error:Nq,branch:A().min(1).optional()}).loose()]),Iq=F([`user`,`org`]),Lq=P({login:A().min(1),kind:Iq,avatarUrl:A().optional()}).loose(),Rq=F([`auth-required`,`network`]),zq=tc(`ok`,[P({ok:I(!0),owners:N(Lq)}).loose(),P({ok:I(!1),error:Rq}).loose()]),Bq=tc(`ok`,[P({ok:I(!0),available:M()}).loose(),P({ok:I(!1),error:Rq}).loose()]),Vq=F([`public`,`private`]),Hq=P({owner:A().min(1),name:A().min(1),visibility:Vq,description:A().optional()}).loose(),Uq=F([`name-conflict`,`saml-sso`,`auth-required`,`push-failed`,`init-failed`,`network`,`no-project`]),Wq=tc(`ok`,[P({ok:I(!0),ownerLogin:A().min(1),repoName:A().min(1),cloneUrl:A().min(1),defaultBranch:A().min(1)}).loose(),P({ok:I(!1),error:Uq}).loose()]);function Gq(e){return!(typeof e!=`string`||e.length===0||e.startsWith(`-`)||/[\x00-\x1F\x7F]/.test(e)||/\s/.test(e)||e.includes(`:`)||e.split(`/`).includes(`..`))}const Kq=e=>e.refine(Gq,`invalid branch name`);function qq(e){if(e==null)return!1;let t=e instanceof Error?e.message:String(e);return/couldn'?t find remote ref|Remote branch .+ not found/i.test(t)}const Jq=[/could not read (username|password)/i,/terminal prompts disabled/i],Yq=[/insufficient scopes/i,/missing.*scope/i,/required scope/i],Xq=[/permission denied.*\(publickey\)/i,/host key verification failed/i],Zq=[/\b(401|403)\b/,/authentication failed/i,/authorization failed/i,/invalid credentials/i,/credential helper/i,/bad credentials/i,/token.*expired/i,/expired.*token/i,/fatal:.*repository.*not found/i];function Qq(e){if(typeof e!=`object`||!e)return``;let t=e.git;return t==null?``:String(t)}function $q(e){if(e==null)return{kind:`non-auth`};let t=`${e instanceof Error?e.message:String(e)}\n${Qq(e)}`;return Jq.some(e=>e.test(t))?{kind:`auth`,subclass:`no-credential`}:Yq.some(e=>e.test(t))?{kind:`auth`,subclass:`scope-mismatch`}:Xq.some(e=>e.test(t))?{kind:`auth`,subclass:`ssh-auth`}:Zq.some(e=>e.test(t))?/\b401\b/.test(t)||/token.*expired/i.test(t)?{kind:`auth`,subclass:`401`}:/\b403\b/.test(t)?{kind:`auth`,subclass:`403`}:{kind:`auth`,subclass:`unknown-auth`}:{kind:`non-auth`}}function eJ(e){return e.kind===`auth`?e.subclass===`no-credential`||e.subclass===`401`||e.subclass===`unknown-auth`:!1}const tJ={shareTargetExists:M(),dirtyConflicts:P({conflicts:M(),files:N(A().min(1))}).loose(),branchIsLocal:M(),shareTargetOnOriginBranch:M().optional()},nJ=tc(`detached`,[P({detached:I(!1),currentBranch:A().min(1).nullable(),currentHeadSha:Hs(),...tJ}).loose(),P({detached:I(!0),currentBranch:Hs(),currentHeadSha:A().min(1),...tJ}).loose()]),rJ=P({branch:Kq(A().min(1)),principalId:A().optional(),fastForward:M().optional()}).loose(),iJ=F([`dirty-conflict`,`branch-not-found`,`fetch-failed`,`checkout-failed`,`branch-in-other-worktree`,`ff-diverged`]),aJ=tc(`ok`,[P({ok:I(!0)}).loose(),P({ok:I(!1),reason:iJ,files:N(A().min(1)).optional(),otherWorktreePath:A().min(1).optional()}).loose()]);F([`on-origin`,`renamed`,`deleted`,`never-on-branch`,`changed-locally`,`unknown`]);const oJ=P({branch:Kq(A().min(1)),path:A(),kind:F([`doc`,`folder`])}).loose(),sJ=tc(`verdict`,[P({verdict:I(`on-origin`)}).loose(),P({verdict:I(`renamed`),renamedTo:A().min(1)}).loose(),P({verdict:I(`deleted`)}).loose(),P({verdict:I(`never-on-branch`)}).loose(),P({verdict:I(`changed-locally`)}).loose(),P({verdict:I(`unknown`)}).loose()]).catch({verdict:`unknown`}),cJ=P({startedAt:A().min(1),httpListenMs:j().nonnegative().optional(),seedWalkMs:j().nonnegative().optional(),indexesMs:j().nonnegative().optional(),readyMs:j().nonnegative().optional(),fileCount:j().nonnegative().optional()}),lJ=P({serverInstanceId:A().min(1),currentBranch:A().min(1).optional(),currentDiskAckSVs:ac(A().min(1),A().min(1)).optional(),boot:cJ.optional()}).loose(),uJ=P({id:A().min(1),display_name:A().min(1),display_email:A(),source:F([`git-config`,`synthesized`]),created_at:A().min(1)}).loose(),dJ=P({collabUrl:A().nullable(),previewUrl:A().nullable(),port:j(),singleFile:M().default(!1)}).loose(),fJ=F(`urn:ok:error:malformed-upload.urn:ok:error:collision-exhaustion.urn:ok:error:storage-full.urn:ok:error:storage-readonly.urn:ok:error:storage-error.urn:ok:error:no-file-received.urn:ok:error:path-escape.urn:ok:error:method-not-allowed.urn:ok:error:invalid-request.urn:ok:error:payload-too-large.urn:ok:error:request-timeout.urn:ok:error:internal-server-error.urn:ok:error:loopback-required.urn:ok:error:invalid-origin.urn:ok:error:url-not-allowed.urn:ok:error:dir-outside-home.urn:ok:error:concurrent-operation.urn:ok:error:clone-failed.urn:ok:error:clone-timeout.urn:ok:error:server-start-failed.urn:ok:error:reserved-doc-name.urn:ok:error:target-not-found.urn:ok:error:stale-target.urn:ok:error:frontmatter-edit-not-supported.urn:ok:error:invalid-frontmatter-patch.urn:ok:error:frontmatter-malformed.urn:ok:error:no-active-session.urn:ok:error:too-many-agent-sessions.urn:ok:error:disk-divergence.urn:ok:error:doc-not-found.urn:ok:error:doc-already-exists.urn:ok:error:doc-not-open.urn:ok:error:rollback-not-configured.urn:ok:error:doc-not-available.urn:ok:error:backlink-index-not-configured.urn:ok:error:file-rescan-not-configured.urn:ok:error:shadow-not-configured.urn:ok:error:host-not-allowed.urn:ok:error:principal-not-available.urn:ok:error:not-found.urn:ok:error:auth-failed.urn:ok:error:no-project-dir.urn:ok:error:server-open-failed.urn:ok:error:doc-in-conflict.urn:ok:error:no-conflict-tracked.urn:ok:error:sync-not-active.urn:ok:error:project-repo-not-configured.urn:ok:error:seed-prerequisite-missing.urn:ok:error:seed-invalid-root.urn:ok:error:tag-index-not-configured.urn:ok:error:template-not-found.urn:ok:error:unsupported-asset-type.urn:ok:error:asset-not-found.urn:ok:error:single-file-mode.urn:ok:error:collab-server-not-running.urn:ok:error:gateway-timeout.urn:ok:error:cursor-not-installed.urn:ok:error:cursor-spawn-timeout.urn:ok:error:cursor-spawn-failed.urn:ok:error:handoff-target-not-installed.urn:ok:error:handoff-spawn-timeout.urn:ok:error:handoff-spawn-failed`.split(`.`));function pJ(e){throw Error(`Unexpected ProblemType variant: ${JSON.stringify(e)}`)}const mJ=P({type:fJ,title:A().min(1),status:j().int().min(400).max(599),instance:A().regex(jq,`instance must be urn:uuid:<uuid>`).optional(),detail:A().optional()}).loose(),hJ=P({parentDocName:A().min(1),placement:F([`configured-attachments`,`parent-dir`]).default(`configured-attachments`),agentId:A().min(1).optional(),agentName:A().min(1).optional()}).loose(),gJ=P({src:A().min(1),path:A().min(1).optional(),deduped:M().optional()}).loose(),_J=P({url:A().min(1),dir:A().min(1),branch:A().min(1).refine(Gq,`invalid branch name`).optional()}).loose(),vJ=P({type:I(`error`),problem:mJ}).loose();function yJ(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(`
|
|
368
368
|
`).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 bJ(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 xJ=new Set([`sourceRaw`,`sourceDirty`,`position`]),SJ=new Set([`jsxComponent`,`table`,`tableRow`,`tableCell`,`tableHeader`,`list`,`listItem`,`blockquote`,`codeBlock`,`heading`]),CJ={type:`__br__`},wJ=/^<br\s*\/?>$/i;function TJ(e){let t=AJ(e,TJ);return(t.type===`tableCell`||t.type===`tableHeader`)&&t.content?{...t,content:EJ(t.content)}:t}function EJ(e){let t=[];for(let n of e){let e=DJ(n);e.length!==0&&(t.length>0&&t.push(CJ),t.push(...e))}return t}function DJ(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)?EJ(e.content):e.content}function OJ(e){return e.type===`hardBreak`||e.type===CJ.type||e.text!==void 0&&wJ.test(e.text.trim())?CJ:AJ(e,OJ)}const kJ=[{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:TJ},{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:OJ}];function AJ(e,t){return e.content?{...e,content:e.content.map(t)}:e}function jJ(e,t){let n={};e.type!==void 0&&(n.type=e.type),e.text!==void 0&&(n.text=e.text);let r=MJ(e.attrs,t);return r&&(n.attrs=r),e.marks&&e.marks.length>0&&(n.marks=[...e.marks].map(e=>({type:e.type,attrs:MJ(e.attrs,t)})).sort((e,t)=>PJ(e).localeCompare(PJ(t)))),e.content&&e.content.length>0&&(n.content=e.content.map(e=>jJ(e,t))),n}function MJ(e,t){if(!e)return null;let n={};for(let r of Object.keys(e).sort()){if(xJ.has(r)||t?.(r))continue;let i=e[r];i!=null&&(n[r]=t?NJ(i,t):i)}return Object.keys(n).length>0?n:null}function NJ(e,t){if(Array.isArray(e))return e.map(e=>NJ(e,t));if(e&&typeof e==`object`){let n={};for(let[r,i]of Object.entries(e))t(r)||(n[r]=NJ(i,t));return n}return e}function PJ(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 FJ(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 IJ(e){let t=[],n=e=>{if(e.type&&SJ.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 LJ(e){let t=e,n=[];for(let e of kJ){let r=PJ(t),i=e.canonicalize(t);PJ(i)!==r&&n.push(e.label),t=i}return{normalized:t,fired:n}}function RJ(e,t,n={}){let r=LJ(e),i=LJ(t),a=[...new Set([...r.fired,...i.fired])];if(!bJ(FJ(r.normalized),FJ(i.normalized)))return{equivalent:!1,level:`L1`,reason:`content-loss`,appliedDegrades:a,detail:`authored text did not survive the round-trip`};let o=IJ(r.normalized),s=IJ(i.normalized);if(PJ(o)!==PJ(s))return{equivalent:!1,level:`L1`,reason:`structural-shatter`,appliedDegrades:a,detail:`container multiset diverged: [${o.join(`, `)}] vs [${s.join(`, `)}]`};let c=jJ(r.normalized,n.ignoreAttrs),l=jJ(i.normalized,n.ignoreAttrs);return PJ(c)===PJ(l)?{equivalent:!0,level:a.length>0?`L2`:`L1`,appliedDegrades:a}:{equivalent:!1,level:`L2`,reason:`structural-divergence`,appliedDegrades:a,detail:zJ(c,l)}}function zJ(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(PJ(a[e])!==PJ(o[e]))return zJ(a[e],o[e],`${n}>${String(r.type)}[${e}]`);return`${n}(${String(r.type)}): attrs or marks differ`}function BJ(e,t,n){return!RJ(e,t,{ignoreAttrs:n}).equivalent}const VJ=new Set([`src`,`href`,`size`]),HJ=new Set([`WikiEmbedImage`,`WikiEmbedVideo`,`WikiEmbedAudio`,`WikiEmbedFile`]);function UJ(e){if(Array.isArray(e))return e.map(e=>UJ(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))VJ.has(n)||(t[n]=UJ(r));return t}return e}function WJ(e){return e.type===`jsxComponent`&&typeof e.attrs?.componentName==`string`&&HJ.has(e.attrs.componentName)?UJ(e):e.content?{...e,content:e.content.map(WJ)}:e}function GJ(e){if(Array.isArray(e))return e.map(e=>GJ(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))n!==`position`&&(t[n]=GJ(r));return t}return e}function KJ(e){if(e.type===`jsxComponent`)return e;if(e.content)for(let t of e.content){let e=KJ(t);if(e)return e}}function qJ(e){let t=e.cacheLimit??2048,n=new Map,r=r=>{let i=n.get(r);if(i!==void 0)return i;let a=KJ(e.parse(r)),o=a?WJ(GJ(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?BJ(n,WJ(GJ(e))):!1}}}function JJ(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`&&YJ(e.value.value,t))continue}let o=XJ(e,t);r>=0?n[r]=o:n.push(o)}return n}function YJ(e,t){try{return JSON.stringify(JSON.parse(e))===JSON.stringify(t)}catch{return!1}}function XJ(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 ZJ(e,t,n,r){return{type:`mdxJsxFlowElement`,name:e,attributes:JJ(t,r),children:n.all(t),data:{}}}const QJ=/^[A-Za-z0-9]{20,}$/,$J=/^(?:\d+s?|(?:\d+h)?(?:\d+m)?(?:\d+s)?)$/;function eY(e){let t=e.toLowerCase();return t===`loom.com`||t===`www.loom.com`}function tY(e){let t=e.pathname.match(/^\/(?:share|embed)\/([A-Za-z0-9]+)\/?$/);if(!t)return null;let n=t[1]??``;return QJ.test(n)?n:null}function nY(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:`||!eY(t.hostname))return null;let n=tY(t);if(!n)return null;let r=t.searchParams.get(`t`);return{id:n,startRaw:r&&r.length>0&&$J.test(r)?r:null}}function rY(e){return nY(e)!==null}function iY(e){let t=e.toLowerCase();return t===`vimeo.com`||t===`www.vimeo.com`||t===`player.vimeo.com`}function aY(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:iY(t.hostname)}const oY=/^[A-Za-z0-9_-]{11}$/;function sY(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 cY(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 lY(e){if(e.hostname.toLowerCase()===`youtu.be`){let t=e.pathname.replace(/^\//,``).split(`/`)[0]??``;return oY.test(t)?t:null}if(e.pathname===`/watch`){let t=e.searchParams.get(`v`)??``;return oY.test(t)?t:null}let t=e.pathname.match(/^\/(?:embed|shorts|v)\/([A-Za-z0-9_-]{11})\/?$/);return t?t[1]??null:null}function uY(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:`||!sY(t.hostname))return null;let n=lY(t);if(!n)return null;let r=t.searchParams.get(`t`)??t.searchParams.get(`start`)??``;return{id:n,startSeconds:r.length>0?cY(r):null,noCookie:t.hostname.toLowerCase().endsWith(`youtube-nocookie.com`)}}const dY=[{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`}],fY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Image source URL`,accept:Lc,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}],pY=[{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}],mY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Video source URL`,accept:Rc,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`&&(aY(e.src)||rY(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:Lc,hideWhen:e=>typeof e.src==`string`&&(aY(e.src)||rY(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`&&rY(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`&&(aY(e.src)||rY(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`&&(uY(e.src)!==null||aY(e.src)||rY(e.src))},{name:`align`,type:`enum`,enumValues:[`center`,`left`,`right`],defaultValue:`center`,required:!1,omitOnDefault:!0,description:`Alignment within the column`,hidden:!0}],hY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`Audio source URL`,accept:zc,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`}],gY=[{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`}],_Y=[dY[0],dY[1],dY[4],dY[5],dY[6]],vY=[fY[0],fY[1],fY[7]],yY=[gY[0],gY[1],gY[4],gY[5]],bY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Alt text (Obsidian alias syntax: `![[file.png|alt text]]`)"}],xY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[clip.mp4|title]]`)"}],SY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Title text (Obsidian alias syntax: `![[song.mp3|title]]`)"}],CY=[{name:`id`,type:`string`,required:!1,advanced:!0,description:"HTML id attribute for deep-linking (e.g. `#install-tabs`)"}],wY=[{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`)"}],TY=[{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."}],EY=[TY[0]],DY=[TY[0]],OY=[{name:`chart`,type:`string`,required:!0,hidden:!0,description:`Mermaid chart source (graph / flowchart / sequenceDiagram / class / state / etc.)`}],kY=[{name:`alias`,type:`string`,required:!1,defaultValue:``,description:"Display name override (Obsidian alias syntax: `![[file.zip|label]]`)"}],AY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`File URL`,accept:[`*/*`],autoFocus:!0}],jY=[{name:`src`,type:`string`,required:!0,defaultValue:``,description:`PDF source URL`,accept:Bc,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`)"}],MY=[{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."}],NY=[{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 PY(e){return e.replace(/&/g,`&`).replace(/"/g,`"`).replace(/</g,`<`).replace(/>/g,`>`)}function FY(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function IY(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 LY=[{name:`Callout`,surface:`canonical`,hasChildren:!0,props:dY,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)=>ZJ(`Callout`,e,t,dY)},{name:`img`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:fY,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)=>ZJ(`img`,e,t,fY)},{name:`video`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:mY,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)=>ZJ(`video`,e,t,mY)},{name:`audio`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:hY,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)=>ZJ(`audio`,e,t,hY)},{name:`Pdf`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:jY,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)=>ZJ(`Pdf`,e,t,jY)},{name:`File`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:AY,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)=>ZJ(`File`,e,t,AY)},{name:`Embed`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:pY,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)=>ZJ(`Embed`,e,t,pY)},{name:`Accordion`,surface:`canonical`,hasChildren:!0,props:gY,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)=>ZJ(`Accordion`,e,t,gY)},{name:`Tabs`,surface:`canonical`,hasChildren:!0,emptyChildName:`Tab`,props:CY,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>
|
|
369
369
|
<Tab label="Two">Body of the second tab panel.</Tab>`,serialize:(e,t)=>ZJ(`Tabs`,e,t,CY)},{name:`Tab`,surface:`canonical`,hasChildren:!0,props:wY,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)=>ZJ(`Tab`,e,t,wY)},{name:`Math`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:TY,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)=>ZJ(`Math`,e,t,TY)},{name:`MermaidFence`,surface:`canonical`,hasChildren:!1,isSelfClosing:!0,props:OY,icon:`Workflow`,category:`content`,displayName:`Mermaid`,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:MY,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)=>ZJ(`Mirror`,e,t,MY)},{name:`MirrorSource`,surface:`canonical`,hasChildren:!0,props:NY,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)=>ZJ(`MirrorSource`,e,t,NY)},{name:`GFMCallout`,surface:`compat`,hasChildren:!0,props:_Y,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:vY,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:bY,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:IY},{name:`WikiEmbedVideo`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:xY,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:IY},{name:`WikiEmbedAudio`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:SY,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:IY},{name:`WikiEmbedFile`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:kY,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:IY},{name:`HtmlDetailsAccordion`,surface:`compat`,hasChildren:!0,props:yY,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="${PY(n.name)}"`:``,a=n?.id?` id="${PY(n.id)}"`:``,o=n?.title?.trim(),s=o?`<summary>${FY(o)}</summary>`:``;return{type:`mdxJsxFlowElement`,name:`HtmlDetailsAccordion`,attributes:[],children:t.all(e),data:{htmlBoundary:{opener:`<details${r}${i}${a}>\n${s}`,closer:`</details>`}}}}},{name:`DollarMath`,surface:`compat`,hasChildren:!1,isSelfClosing:!0,props:EY,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:DY,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??``})}],RY={name:`*`,surface:`canonical`,hasChildren:!0,props:[],description:`Unregistered component — children editable as markdown`,serialize:(e,t)=>ZJ(e.attrs.componentName||`*`,e,t)};function zY(){let e=new Map;e.set(`*`,RY);for(let t of LY)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 BY(){let e=globalThis;return e.__okYpsCounters||={block:0,inline:0},e.__okYpsCounters}const VY={parseFallback:{blockLevel:0,wholeDoc:0,wholeDocBudget:0},jsxRenderFailure:{},jsxAutoConvertFailed:{},jsxAutoConvertSucceeded:{},jsxPropDropped:{},jsxMoveFailed:{},jsxStuckCopyFailed:{},jsxStuckDeleteFailed:{},jsxPopoverCloseRestoreFailed:{},jsxKeyboardDeleteFailed:{},blockGripClickSelectFailed:{},jsxArrowNodeSelectFailed:{}};function HY(){VY.parseFallback.blockLevel++}function UY(){VY.parseFallback.wholeDoc++}function WY(){VY.parseFallback.wholeDocBudget++}function GY(){let e=BY();return{parseFallback:{...VY.parseFallback},ypsMismatch:{block:e.block,inline:e.inline},jsxRenderFailure:{...VY.jsxRenderFailure},jsxAutoConvertFailed:{...VY.jsxAutoConvertFailed},jsxAutoConvertSucceeded:{...VY.jsxAutoConvertSucceeded},jsxPropDropped:{...VY.jsxPropDropped},jsxMoveFailed:{...VY.jsxMoveFailed},jsxStuckCopyFailed:{...VY.jsxStuckCopyFailed},jsxStuckDeleteFailed:{...VY.jsxStuckDeleteFailed},jsxPopoverCloseRestoreFailed:{...VY.jsxPopoverCloseRestoreFailed},jsxKeyboardDeleteFailed:{...VY.jsxKeyboardDeleteFailed},blockGripClickSelectFailed:{...VY.blockGripClickSelectFailed},jsxArrowNodeSelectFailed:{...VY.jsxArrowNodeSelectFailed}}}const KY=/^(`{3,}|~{3,})/gm;function qY(e){let t=[],n=null;for(let r of e.matchAll(KY)){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 JY(e,t){return t.some(([t,n])=>e>=t&&e<n)}const YY=/^[ \t]{0,3}\[([^\]]+)\]:\s*(\S+)(\s+(?:"[^"]*"|'[^']*'|\([^)]*\)))?\s*$/gm;function XY(e){let t=qY(e),n=[];for(let r of e.matchAll(YY))JY(r.index,t)||n.push(r[0].trimEnd());return n.length>0?`${n.join(`
|
|
370
370
|
`)}\n\n`:``}function ZY(e,t){let n={startMs:typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),calls:0};return eX(e,t.parse,0,n)}function QY(e){return e.calls>=1e3?!0:(typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now())-e.startMs>=500}function $Y(e){return e instanceof Error?{name:e.name,message:e.message.slice(0,500),stack:e.stack?.split(`
|
|
@@ -398,7 +398,7 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
398
398
|
`);)t--;n[t]===`"`?e.data.sourceTitleMarker=`double`:n[t]===`'`?e.data.sourceTitleMarker=`single`:n[t]===`)`&&(e.data.sourceTitleMarker=`paren`)}}}}break;case`definition`:{let n=t.slice(a,o);if(e.data.sourceLayout=n.includes(`
|
|
399
399
|
`)?`multiline`:`inline`,typeof e.title==`string`&&n.length>0){let t=n[n.length-1];t===`"`?e.data.sourceTitleMarker=`double`:t===`'`?e.data.sourceTitleMarker=`single`:t===`)`&&(e.data.sourceTitleMarker=`paren`)}break}case`mdxJsxFlowElement`:case`mdxJsxTextElement`:case`mdxFlowExpression`:case`mdxTextExpression`:e.data.sourceRaw=t.slice(a,o);break;case`break`:if(e.data.sourceRaw)break;t.slice(a,o).includes(`\\`)?e.data.sourceStyle=`backslash`:e.data.sourceStyle=`spaces`;break}}function $Z(){return RegExp(`(^|\\s)#([a-zA-Z][\\w/-]*)`,`g`)}const eQ=$Z();function tQ(e,t){if(t<=0||e[t-1]!==`\\`)return!1;let n=t-1,r=0;for(;n>=0&&e[n]===`\\`;)r++,n--;return r%2==1}function nQ(e,t=``){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value,a=typeof i.position?.start?.offset==`number`?i.position?.start?.offset??0:0;eQ.lastIndex=0;let o=[],s=0;for(;;){let n=eQ.exec(e);if(n===null)break;let c=n[1]??``,l=n[2]??``,u=n.index+c.length;if(t&&a>=0){let n=a,r=0,i=-1;for(;r<=u&&n<t.length;){let a=t[n]===`\\`&&n+1<t.length&&e[r]===t[n+1],o=a?n+1:n;if(r===u){i=o;break}n=a?n+2:n+1,r+=1}if(i>=0&&tQ(t,i))continue}if(u>s){let n={type:`text`,value:e.slice(s,u)},r=iZ(t,i,s,u);r&&(n.position=r),o.push(n)}let d={type:`tag`,value:l},f=iZ(t,i,u,u+1+l.length);f&&(d.position=f),o.push(d),s=u+1+l.length,r=!0}if(o.length===0)n.push(i);else{if(s<e.length){let n={type:`text`,value:e.slice(s)},r=iZ(t,i,s,e.length);r&&(n.position=r),o.push(n)}n.push(...o)}}r&&(e.children=n)}const rQ=new Set(`root.paragraph.heading.text.emphasis.strong.blockquote.list.listItem.code.inlineCode.link.image.linkReference.imageReference.definition.html.thematicBreak.break.yaml.toml.table.tableRow.tableCell.delete.footnoteDefinition.footnoteReference.mdxFlowExpression.mdxJsxFlowElement.mdxJsxTextElement.mdxTextExpression.wikiLink.wikiLinkEmbed.tag.math.inlineMath.mark.comment.commentBlock.rawMdxFallbackMdast`.split(`.`));function iQ(e,t){if(!e||typeof e!=`object`)return null;if(typeof e.offset==`number`)return e.offset>=0&&e.offset<=t.length?e.offset:null;let{line:n,column:r}=e;if(typeof n!=`number`||typeof r!=`number`||n<1||r<1)return null;let i=0;for(let e=1;e<n;e++){let e=t.indexOf(`
|
|
400
400
|
`,i);if(e===-1)return null;i=e+1}let a=t.indexOf(`
|
|
401
|
-
`,i),o=a===-1?t.length:a,s=i+r-1;return s<=o?s:null}function aQ(e,t){if(!e)return null;let n=iQ(e.start,t),r=iQ(e.end,t);return n===null||r===null||r<n?null:t.slice(n,r)}function oQ(e,t){let n=aQ(e.position,t);return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:n??``,unresolvedPosition:n===null,position:e.position}}function sQ(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``,r=typeof process<`u`&&process.env?.OK_DEBUG_POSITION_SLICE===`1`;dM(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!rQ.has(e.type)){let r=oQ(e,n);return i.children[t]=r,cM}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(YZ(t,n),nQ(t,n))}if(QZ(e,n,r,i),e.type===`heading`&&i!==void 0&&typeof t==`number`){let n=e.position?.end?.line,r=i.children[t+1],a=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof a==`number`&&a===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}})}}function cQ(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function lQ(){return e=>{dM(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=cQ(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function uQ(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}const dQ=(e,t)=>{if(uQ(e,t))return 0;let n=t.data?.sourcePrecedingBlankLines;if(typeof n==`number`&&n>=2)return n;let r=e.position,i=t.position;if(!r||!i)return;let a=i.start.line-r.end.line-1;return a>=1?a:void 0},fQ=OV(),pQ=KB(),mQ=qB();function hQ(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===fQ)||t.push(fQ);let n=e.fromMarkdownExtensions;n.some(e=>e===pQ)||n.push(pQ);let r=e.toMarkdownExtensions;r.some(e=>e===mQ)||r.push(mQ)}const gQ=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function _Q(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;dM(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;gQ.lastIndex=0;let a=[],o;for(;(o=gQ.exec(i))!==null;)a.push(o);if(a.length===0)return;let s=[],c=0;for(let t of a){let r=t.index,a=r+t[0].length;if(r>c){let t={type:`text`,value:i.slice(c,r)},a=iZ(n,e,c,r);a&&(t.position=a),s.push(t)}let o={type:`inlineMath`,value:t[1]},l=iZ(n,e,r,a);l&&(o.position=l),s.push(o),c=a}if(c<i.length){let t={type:`text`,value:i.slice(c)},r=iZ(n,e,c,i.length);r&&(t.position=r),s.push(t)}return r.children.splice(t,1,...s),[cM,t+s.length]})}}const vQ={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function yQ(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===vQ)||e.toMarkdownExtensions.push(vQ)}const bQ=/(?<!\uE102)<br[ \t]*\/?>/g,xQ=new Set([`mdxJsxTextElement`,`mdxJsxFlowElement`]);function SQ(e,t){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;bQ.lastIndex=0;let a=[],o=0;for(;;){let n=bQ.exec(e);if(n===null)break;let s=n.index;if(s>o){let n={type:`text`,value:e.slice(o,s)},r=iZ(t,i,o,s);r&&(n.position=r),a.push(n)}let c={type:`break`,data:{sourceStyle:`html`,sourceRaw:n[0]}},l=iZ(t,i,s,s+n[0].length);l&&(c.position=l),a.push(c),o=s+n[0].length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=iZ(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}function CQ(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;dM(e,e=>{if(xQ.has(e.type))return cM;let t=e;Array.isArray(t.children)&&SQ(e,n)})}}const wQ={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===91?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===91?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===35?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===124?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===124?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===93?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===93?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},TQ={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===33?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===91?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===91?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===35?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===124?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===124?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===93?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===93?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function EQ(){return{text:{91:wQ,33:TQ}}}function DQ(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function OQ(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function kQ(e){return e.stack[e.stack.length-1]}function AQ(e){let t=kQ(this),n=this.sliceSerialize(e);t.data.target=n.trim(),n!==t.data.target&&(t.data.sourceTarget=n)}function jQ(e){let t=kQ(this),n=this.sliceSerialize(e),r=n.trim();t.data.anchor=r.length?r:null,t.data.anchor!==null&&n!==r&&(t.data.sourceAnchor=n)}function MQ(e){let t=kQ(this),n=this.sliceSerialize(e),r=n.trim();t.data.alias=r.length?r:null,t.data.alias!==null&&n!==r&&(t.data.sourceAlias=n)}function NQ(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function PQ(e){NQ(kQ(this)),this.exit(e)}function FQ(e){NQ(kQ(this)),this.exit(e)}const IQ={enter:{wikiLink:DQ,wikiLinkEmbed:OQ},exit:{wikiLinkTarget:AQ,wikiLinkAnchor:jQ,wikiLinkAlias:MQ,wikiLink:PQ,wikiLinkEmbed:FQ}};function LQ(e,t){return typeof e==`string`&&e.trim()===t?e:t}const RQ={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${LQ(t.data?.sourceTarget,n)}`;return r&&(a+=`#${LQ(t.data?.sourceAnchor,r)}`),i&&(a+=`|${LQ(t.data?.sourceAlias,i)}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},zQ=EQ();function BQ(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===zQ)||e.micromarkExtensions.push(zQ),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===IQ)||e.fromMarkdownExtensions.push(IQ),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===RQ)||e.toMarkdownExtensions.push(RQ)}function VQ(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}const HQ=[{name:`remark-parse`,plugin:oB},{name:`remark-mdx-agnostic`,plugin:hQ},{name:`remark-gfm`,plugin:tR},{name:`remark-math`,plugin:xz,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:BQ},{name:`remark-github-alerts`,plugin:lz,options:eZ},{name:`callout-transformer`,plugin:$X},{name:`restore-from-mdx`,plugin:AX},{name:`void-br-promoter`,plugin:CQ},{name:`restore-entity-refs`,plugin:RX},{name:`restore-backslash-escapes`,plugin:VX},{name:`details-accordion-promoter`,plugin:jZ},{name:`image-promoter`,plugin:zZ},{name:`indented-code-promoter`,plugin:GZ},{name:`math-promoter`,plugin:qZ},{name:`single-dollar-math-promoter`,plugin:_Q},{name:`highlight-promoter`,plugin:RZ},{name:`mermaid-promoter`,plugin:lQ},{name:`comment-promoter`,plugin:sZ},{name:`merged-post-parse-walker`,plugin:sQ},{name:`ensure-non-empty-doc`,plugin:()=>VQ}];function UQ(e){let t=dR();for(let e of HQ)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(FR,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function WQ(e){let t=dR().use(az,[`yaml`]).use(tR,{tablePipeAlign:!1}).use(xz,{singleDollarTextMath:!1}).use(hQ).use(BQ).use(yQ).use(nR,{bullet:`-`,fences:!0,rule:`-`,join:[dQ],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function GQ(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}const KQ=/^\n+$/,qQ=/^\n{2,}$/;function JQ(e,t,n){let r,i,a,o=e.children;if(o.length>0){let e=o[0]?.position?.start?.offset;if(typeof e==`number`&&e>0){let n=t.slice(0,e);KQ.test(n)&&(r=n)}let n=o[o.length-1]?.position?.end?.offset;if(typeof n==`number`&&n<=t.length){let e=t.slice(n);qQ.test(e)&&(i=e)}let s=[],c=!1;for(let e=1;e<o.length;e++){let n=o[e-1]?.position?.end?.offset,r=o[e]?.position?.start?.offset,i=null;if(typeof n==`number`&&typeof r==`number`&&r>=n){let e=t.slice(n,r);RegExp(`^\\n{3,}$`).test(e)&&(i=e.length-1,c=!0)}s.push(i)}c&&(a=s)}if(!n&&r===void 0&&i===void 0&&!a)return;let s={...n?{bom:!0}:{},...r===void 0?{}:{leading:r},...i===void 0?{}:{trailing:i},...a?{gapBlankLines:a}:{}};return e.data??={},e.data.sourceDocBoundary=s,s}function YQ(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&KQ.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&qQ.test(t.trailing)&&(n.trailing=t.trailing),Array.isArray(t.gapBlankLines)&&t.gapBlankLines.every(e=>e===null||typeof e==`number`&&Number.isInteger(e)&&e>=2)&&(n.gapBlankLines=t.gapBlankLines),n.bom||n.leading||n.trailing||n.gapBlankLines?n:void 0}function XQ(e,t){let{source:n,hadBom:r}=GQ(e),i=bZ(n),a=new Ij(FX(OX(BX(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a),c=JQ(s,i,r),l=t.stringify(s);return c?l.type.create({...l.attrs,sourceDocBoundary:c},l.content,l.marks):l}function ZQ(e,t){let{source:n,hadBom:r}=GQ(e),i=bZ(n),a=new Ij(FX(OX(BX(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a);return JQ(s,i,r),s}function QQ(e,t,n){let r=LR(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers}),i=YQ(e.attrs?.sourceDocBoundary),a=i?.gapBlankLines;if(a&&a.length===r.children.length-1)for(let e=1;e<r.children.length;e++){let t=a[e-1];if(typeof t==`number`){let n=r.children[e];n.data??={},n.data.sourcePrecedingBlankLines=t}}let o=String(t.stringify(r));return i?.leading&&(o=i.leading+o),i?.trailing&&(o=o.replace(/\n+$/,``)+i.trailing),i?.bom&&(o=`\uFEFF${o}`),o}function $Q(){return typeof process>`u`||!process.env?!1:process.env.NODE_ENV===`development`||process.env.NODE_ENV===`test`}function e$(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function t$(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function n$(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!TK(e))return e;let n=t$(e$(t),e);return n===``||n===`..`||n.startsWith(`../`)?($Q()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}const r$=Object.assign(C$,{peek:()=>`$`}),i$=Object.assign(w$,{peek:()=>`~`}),a$=(()=>{for(let e of mQ.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),o$=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/,s$={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&oq(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=h$(n,t.slice(o,e),{...r,before:r.before+a,after:`\\`})),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=h$(n,t.slice(o),{...r,before:r.before+a})),a}return h$(n,(e.value??``).replaceAll(`\xA0`,` `),r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=b$(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=b$(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:f$(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(d$(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(f$(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
|
|
401
|
+
`,i),o=a===-1?t.length:a,s=i+r-1;return s<=o?s:null}function aQ(e,t){if(!e)return null;let n=iQ(e.start,t),r=iQ(e.end,t);return n===null||r===null||r<n?null:t.slice(n,r)}function oQ(e,t){let n=aQ(e.position,t);return{type:`rawMdxFallbackMdast`,originalType:e.type??`unknown`,value:n??``,unresolvedPosition:n===null,position:e.position}}function sQ(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``,r=typeof process<`u`&&process.env?.OK_DEBUG_POSITION_SLICE===`1`;dM(e,(e,t,i)=>{if(i!==void 0&&typeof t==`number`&&typeof e.type==`string`&&!rQ.has(e.type)){let r=oQ(e,n);return i.children[t]=r,cM}if(`children`in e&&Array.isArray(e.children)){let t=e;t.children.some(e=>e.type===`text`)&&(YZ(t,n),nQ(t,n))}if(QZ(e,n,r,i),e.type===`heading`&&i!==void 0&&typeof t==`number`){let n=e.position?.end?.line,r=i.children[t+1],a=r?.position?.start?.line;if(r?.type===`paragraph`&&typeof n==`number`&&typeof a==`number`&&a===n+1){let t=e;t.data??={},t.data.sourceContiguousNext=!0}}})}}function cQ(e,t){let n={type:`mdxJsxFlowElement`,name:`MermaidFence`,attributes:[{type:`mdxJsxAttribute`,name:`chart`,value:e}],children:[]};return t&&(n.position=t),n}function lQ(){return e=>{dM(e,`code`,(e,t,n)=>{if(!n||t==null||e.lang!==`mermaid`)return;let r=cQ(typeof e.value==`string`?e.value:``,e.position);n.children[t]=r})}}function uQ(e,t){let n=e,r=t;return n.type===`heading`&&n.data?.sourceContiguousNext===!0&&r.type===`paragraph`}const dQ=(e,t)=>{if(uQ(e,t))return 0;let n=t.data?.sourcePrecedingBlankLines;if(typeof n==`number`&&n>=2)return n;let r=e.position,i=t.position;if(!r||!i)return;let a=i.start.line-r.end.line-1;return a>=1?a:void 0},fQ=OV(),pQ=KB(),mQ=qB();function hQ(){let e=this.data();e.micromarkExtensions||=[],e.fromMarkdownExtensions||=[],e.toMarkdownExtensions||=[];let t=e.micromarkExtensions;t.some(e=>e===fQ)||t.push(fQ);let n=e.fromMarkdownExtensions;n.some(e=>e===pQ)||n.push(pQ);let r=e.toMarkdownExtensions;r.some(e=>e===mQ)||r.push(mQ)}const gQ=/(?<!\\)\$(?=\S)([^$\n]*?[^\s$])\$(?!\d)/g;function _Q(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;dM(e,`text`,(e,t,r)=>{if(r===void 0||t==null)return;let i=e.value;if(i.indexOf(`$`)===-1)return;gQ.lastIndex=0;let a=[],o;for(;(o=gQ.exec(i))!==null;)a.push(o);if(a.length===0)return;let s=[],c=0;for(let t of a){let r=t.index,a=r+t[0].length;if(r>c){let t={type:`text`,value:i.slice(c,r)},a=iZ(n,e,c,r);a&&(t.position=a),s.push(t)}let o={type:`inlineMath`,value:t[1]},l=iZ(n,e,r,a);l&&(o.position=l),s.push(o),c=a}if(c<i.length){let t={type:`text`,value:i.slice(c)},r=iZ(n,e,c,i.length);r&&(t.position=r),s.push(t)}return r.children.splice(t,1,...s),[cM,t+s.length]})}}const vQ={handlers:{tag:e=>`#${e.value}`},unsafe:[{character:`#`,inConstruct:[`phrasing`],before:`\\s`,after:`[a-zA-Z]`}]};function yQ(){let e=this.data();e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===vQ)||e.toMarkdownExtensions.push(vQ)}const bQ=/(?<!\uE102)<br[ \t]*\/?>/g,xQ=new Set([`mdxJsxTextElement`,`mdxJsxFlowElement`]);function SQ(e,t){let n=[],r=!1;for(let i of e.children){if(i.type!==`text`){n.push(i);continue}let e=i.value;bQ.lastIndex=0;let a=[],o=0;for(;;){let n=bQ.exec(e);if(n===null)break;let s=n.index;if(s>o){let n={type:`text`,value:e.slice(o,s)},r=iZ(t,i,o,s);r&&(n.position=r),a.push(n)}let c={type:`break`,data:{sourceStyle:`html`,sourceRaw:n[0]}},l=iZ(t,i,s,s+n[0].length);l&&(c.position=l),a.push(c),o=s+n[0].length,r=!0}if(a.length===0)n.push(i);else{if(o<e.length){let n={type:`text`,value:e.slice(o)},r=iZ(t,i,o,e.length);r&&(n.position=r),a.push(n)}n.push(...a)}}r&&(e.children=n)}function CQ(){return(e,t)=>{let n=typeof t.value==`string`?t.value:``;dM(e,e=>{if(xQ.has(e.type))return cM;let t=e;Array.isArray(t.children)&&SQ(e,n)})}}const wQ={name:`wikiLink`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===91?(e.enter(`wikiLink`),e.enter(`wikiLinkMarker`),e.consume(t),s):n(t)}function s(t){return t===91?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),c):n(t)}function c(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?r===0?n(t):(e.exit(`wikiLinkTarget`),d(t)):t===35?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),l):t===124?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),r++,c)}function l(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?i===0?n(t):(e.exit(`wikiLinkAnchor`),d(t)):t===124?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),u):(e.consume(t),i++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?a===0?n(t):(e.exit(`wikiLinkAlias`),d(t)):(e.consume(t),a++,u)}function d(t){return t===93?(e.enter(`wikiLinkMarker`),e.consume(t),f):n(t)}function f(r){return r===93?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLink`),t):n(r)}}},TQ={name:`wikiLinkEmbed`,tokenize:(e,t,n)=>{let r=0,i=0,a=0;return o;function o(t){return t===33?(e.enter(`wikiLinkEmbed`),e.enter(`wikiLinkEmbedBang`),e.consume(t),e.exit(`wikiLinkEmbedBang`),s):n(t)}function s(t){return t===91?(e.enter(`wikiLinkMarker`),e.consume(t),c):n(t)}function c(t){return t===91?(e.consume(t),e.exit(`wikiLinkMarker`),e.enter(`wikiLinkTarget`),l):n(t)}function l(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?r===0?n(t):(e.exit(`wikiLinkTarget`),f(t)):t===35?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAnchor`),u):t===124?r===0?n(t):(e.exit(`wikiLinkTarget`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),r++,l)}function u(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?i===0?n(t):(e.exit(`wikiLinkAnchor`),f(t)):t===124?i===0?n(t):(e.exit(`wikiLinkAnchor`),e.enter(`wikiLinkSeparator`),e.consume(t),e.exit(`wikiLinkSeparator`),e.enter(`wikiLinkAlias`),d):(e.consume(t),i++,u)}function d(t){return t===null||t===-5||t===-4||t===-3||t===91?n(t):t===93?a===0?n(t):(e.exit(`wikiLinkAlias`),f(t)):(e.consume(t),a++,d)}function f(t){return t===93?(e.enter(`wikiLinkMarker`),e.consume(t),p):n(t)}function p(r){return r===93?(e.consume(r),e.exit(`wikiLinkMarker`),e.exit(`wikiLinkEmbed`),t):n(r)}}};function EQ(){return{text:{91:wQ,33:TQ}}}function DQ(e){this.enter({type:`wikiLink`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function OQ(e){this.enter({type:`wikiLinkEmbed`,value:``,data:{target:``,anchor:null,alias:null},children:[]},e)}function kQ(e){return e.stack[e.stack.length-1]}function AQ(e){let t=kQ(this),n=this.sliceSerialize(e);t.data.target=n.trim(),n!==t.data.target&&(t.data.sourceTarget=n)}function jQ(e){let t=kQ(this),n=this.sliceSerialize(e),r=n.trim();t.data.anchor=r.length?r:null,t.data.anchor!==null&&n!==r&&(t.data.sourceAnchor=n)}function MQ(e){let t=kQ(this),n=this.sliceSerialize(e),r=n.trim();t.data.alias=r.length?r:null,t.data.alias!==null&&n!==r&&(t.data.sourceAlias=n)}function NQ(e){let{target:t,anchor:n,alias:r}=e.data,i=r||(n?`${t}#${n}`:t);e.value=i,e.children=[{type:`text`,value:i}]}function PQ(e){NQ(kQ(this)),this.exit(e)}function FQ(e){NQ(kQ(this)),this.exit(e)}const IQ={enter:{wikiLink:DQ,wikiLinkEmbed:OQ},exit:{wikiLinkTarget:AQ,wikiLinkAnchor:jQ,wikiLinkAlias:MQ,wikiLink:PQ,wikiLinkEmbed:FQ}};function LQ(e,t){return typeof e==`string`&&e.trim()===t?e:t}const RQ={handlers:{wikiLink:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`[[${LQ(t.data?.sourceTarget,n)}`;return r&&(a+=`#${LQ(t.data?.sourceAnchor,r)}`),i&&(a+=`|${LQ(t.data?.sourceAlias,i)}`),`${a}]]`},wikiLinkEmbed:e=>{let t=e,n=t.data?.target??``,r=t.data?.anchor,i=t.data?.alias,a=`![[${n}`;return r&&(a+=`#${r}`),i&&(a+=`|${i}`),`${a}]]`}},unsafe:[{character:`[`,inConstruct:[`phrasing`]}]},zQ=EQ();function BQ(){let e=this.data();e.micromarkExtensions||=[],e.micromarkExtensions.some(e=>e===zQ)||e.micromarkExtensions.push(zQ),e.fromMarkdownExtensions||=[],e.fromMarkdownExtensions.some(e=>e===IQ)||e.fromMarkdownExtensions.push(IQ),e.toMarkdownExtensions||=[],e.toMarkdownExtensions.some(e=>e===RQ)||e.toMarkdownExtensions.push(RQ)}function VQ(e){return e.children.some(e=>{let t=e.type;return t!==`yaml`&&t!==`toml`})?e:{...e,children:[...e.children,{type:`paragraph`,children:[]}]}}const HQ=[{name:`remark-parse`,plugin:oB},{name:`remark-mdx-agnostic`,plugin:hQ},{name:`remark-gfm`,plugin:tR},{name:`remark-math`,plugin:xz,options:{singleDollarTextMath:!1}},{name:`remark-wiki-link`,plugin:BQ},{name:`remark-github-alerts`,plugin:lz,options:eZ},{name:`callout-transformer`,plugin:$X},{name:`restore-from-mdx`,plugin:AX},{name:`void-br-promoter`,plugin:CQ},{name:`restore-entity-refs`,plugin:RX},{name:`restore-backslash-escapes`,plugin:VX},{name:`details-accordion-promoter`,plugin:jZ},{name:`image-promoter`,plugin:zZ},{name:`indented-code-promoter`,plugin:GZ},{name:`math-promoter`,plugin:qZ},{name:`single-dollar-math-promoter`,plugin:_Q},{name:`highlight-promoter`,plugin:RZ},{name:`mermaid-promoter`,plugin:lQ},{name:`comment-promoter`,plugin:sZ},{name:`merged-post-parse-walker`,plugin:sQ},{name:`ensure-non-empty-doc`,plugin:()=>VQ}];function UQ(e){let t=dR();for(let e of HQ)t=`options`in e&&e.options!==void 0?t.use(e.plugin,e.options):t.use(e.plugin);return t=t.use(FR,{schema:e.schema,handlers:e.handlers}),t.freeze(),t}function WQ(e){let t=dR().use(az,[`yaml`]).use(tR,{tablePipeAlign:!1}).use(xz,{singleDollarTextMath:!1}).use(hQ).use(BQ).use(yQ).use(nR,{bullet:`-`,fences:!0,rule:`-`,join:[dQ],...e.toMarkdownHandlers?{handlers:e.toMarkdownHandlers}:{}});return t.freeze(),t}function GQ(e){return e.charCodeAt(0)===65279?{source:e.slice(1),hadBom:!0}:{source:e,hadBom:!1}}const KQ=/^\n+$/,qQ=/^\n{2,}$/;function JQ(e,t,n){let r,i,a,o=e.children;if(o.length>0){let e=o[0]?.position?.start?.offset;if(typeof e==`number`&&e>0){let n=t.slice(0,e);KQ.test(n)&&(r=n)}let n=o[o.length-1]?.position?.end?.offset;if(typeof n==`number`&&n<=t.length){let e=t.slice(n);qQ.test(e)&&(i=e)}let s=[],c=!1;for(let e=1;e<o.length;e++){let n=o[e-1]?.position?.end?.offset,r=o[e]?.position?.start?.offset,i=null;if(typeof n==`number`&&typeof r==`number`&&r>=n){let e=t.slice(n,r);RegExp(`^\\n{3,}$`).test(e)&&(i=e.length-1,c=!0)}s.push(i)}c&&(a=s)}if(!n&&r===void 0&&i===void 0&&!a)return;let s={...n?{bom:!0}:{},...r===void 0?{}:{leading:r},...i===void 0?{}:{trailing:i},...a?{gapBlankLines:a}:{}};return e.data??={},e.data.sourceDocBoundary=s,s}function YQ(e){if(typeof e!=`object`||!e)return;let t=e,n={};return t.bom===!0&&(n.bom=!0),typeof t.leading==`string`&&KQ.test(t.leading)&&(n.leading=t.leading),typeof t.trailing==`string`&&qQ.test(t.trailing)&&(n.trailing=t.trailing),Array.isArray(t.gapBlankLines)&&t.gapBlankLines.every(e=>e===null||typeof e==`number`&&Number.isInteger(e)&&e>=2)&&(n.gapBlankLines=t.gapBlankLines),n.bom||n.leading||n.trailing||n.gapBlankLines?n:void 0}function XQ(e,t){let{source:n,hadBom:r}=GQ(e),i=bZ(n),a=new Ij(FX(OX(BX(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a),c=JQ(s,i,r),l=t.stringify(s);return c?l.type.create({...l.attrs,sourceDocBoundary:c},l.content,l.marks):l}function ZQ(e,t){let{source:n,hadBom:r}=GQ(e),i=bZ(n),a=new Ij(FX(OX(BX(i)))),o=t.parse(a);a.value=i;let s=t.runSync(o,a);return JQ(s,i,r),s}function QQ(e,t,n){let r=LR(e,{schema:n.schema,nodeHandlers:n.pmNodeHandlers,markHandlers:n.pmMarkHandlers}),i=YQ(e.attrs?.sourceDocBoundary),a=i?.gapBlankLines;if(a&&a.length===r.children.length-1)for(let e=1;e<r.children.length;e++){let t=a[e-1];if(typeof t==`number`){let n=r.children[e];n.data??={},n.data.sourcePrecedingBlankLines=t}}let o=String(t.stringify(r));return i?.leading&&(o=i.leading+o),i?.trailing&&(o=o.replace(/\n+$/,``)+i.trailing),i?.bom&&(o=`\uFEFF${o}`),o}function $Q(){return typeof process>`u`||!process.env?!1:process.env.NODE_ENV===`development`||process.env.NODE_ENV===`test`}function e$(e){let t=e.lastIndexOf(`/`);return t===-1?``:t===0?`/`:e.slice(0,t)}function t$(e,t){let n=e?`${e}/${t}`:t,r=n.startsWith(`/`),i=[];for(let e of n.split(`/`))if(!(e===``||e===`.`)){if(e===`..`){let e=i[i.length-1];i.length>0&&e!==`..`?i.pop():r||i.push(`..`);continue}i.push(e)}let a=i.join(`/`);return r?`/${a}`:a}function n$(e,t){if(typeof e!=`string`||e===``||!t||e.startsWith(`/`)||!TK(e))return e;let n=t$(e$(t),e);return n===``||n===`..`||n.startsWith(`../`)?($Q()&&console.warn(`[resolve-image-url] doc-relative path escapes contentDir; emitting raw URL: ${e} (from sourcePath ${t})`),e):`/${n}`}const r$=Object.assign(C$,{peek:()=>`$`}),i$=Object.assign(w$,{peek:()=>`~`}),a$=(()=>{for(let e of mQ.extensions??[]){let t=e?.handlers?.mdxJsxFlowElement;if(typeof t==`function`)return t}throw Error(`mdast-util-mdx-jsx mdxJsxFlowElement to-markdown handler not found — the dirty MDX JSX serialize path cannot bind. Likely a breaking change in mdast-util-mdx-jsx (pinned in the root overrides); re-run the markdown-pipeline upgrade protocol (test:fidelity).`)})(),o$=/^[ \t]*(?:$|#{1,6}(?:[ \t]|[ \t]*$)|>|(?:[-+*]|\d{1,9}[.)])[ \t]|`{3,}|~{3,}|=+[ \t]*$|-+[ \t]*$|(?:\*[ \t]*){3,}$|(?:_[ \t]*){3,}$)/,s$={text(e,t,n,r){if(typeof e.data?.sourceRaw==`string`&&oq(e.data.sourceRaw,e.value??``))return e.data.sourceRaw;if(e.data?.escapedChars?.length){let t=e.value??``,i=e.data.escapedChars,a=``,o=0;for(let{offset:e,char:s}of i)e>o&&(a+=h$(n,t.slice(o,e),{...r,before:r.before+a,after:`\\`})),a+=`\\${s}`,o=e+1;return o<t.length&&(a+=h$(n,t.slice(o),{...r,before:r.before+a})),a}return h$(n,e.value??``,r)},emphasis(e,t,n,r){let i=e.data?.sourceDelimiter??`*`,a=n.createTracker(r),o=n.enter(`emphasis`),s=a.move(i);return s+=b$(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},strong(e,t,n,r){let i=e.data?.sourceDelimiter??`**`,a=n.createTracker(r),o=n.enter(`strong`),s=a.move(i);return s+=b$(n.containerPhrasing(e,{before:s,after:i,...a.current()}),r,i),s+=a.move(i),o(),s},link(e,t,n,r){if(e.data?.sourceStyle===`autolink`)return`<${e.url??``}>`;if(e.data?.sourceStyle===`gfm-autolink`){let t=e.children?.length===1?e.children[0]:null;if(t?.type===`text`&&typeof t.value==`string`)return t.value}let i=n.createTracker(r),a=n.enter(`link`),o=n.enter(`label`),s=i.move(`[`);s+=i.move(n.containerPhrasing(e,{before:s,after:`](`,...i.current()})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`),l=String(e.url??``),u=e.data?.sourceUrlForm===`angle-bracketed`,d=l.startsWith(`<`)&&l.endsWith(`>`),f=u&&!d?`<${l}>`:f$(l);if(s+=i.move(f),c(),e.title){let t=e.data?.sourceTitleMarker??`double`;s+=i.move(d$(e.title,t))}return s+=i.move(`)`),a(),s},image(e,t,n,r){let i=n.createTracker(r),a=n.enter(`image`),o=n.enter(`label`),s=i.move(`})),s+=i.move(`](`),o();let c=n.enter(`destinationRaw`);if(s+=i.move(f$(String(e.url??``))),c(),e.title){let t=n.enter(`titleQuote`);s+=i.move(` "`),s+=i.move(n.safe(e.title,{before:s,after:`"`,...i.current()})),s+=i.move(`"`),t()}return s+=i.move(`)`),a(),s},definition(e,t,n,r){let i=e.data?.sourceLayout??`inline`,a=e.data?.sourceTitleMarker??`double`,o=n.enter(`definition`),s=n.createTracker(r),c=n.enter(`label`),l=s.move(`[`);l+=s.move(n.safe(n.associationId(e),{before:l,after:`]`,...s.current()})),l+=s.move(`]:`),c();let u=i===`multiline`?`
|
|
402
402
|
`:` `;l+=s.move(u);let d=String(e.url??``);if(!d||/[\0- ]/.test(d)){let e=n.enter(`destinationLiteral`);l+=s.move(`<`),l+=s.move(n.safe(d,{before:l,after:`>`,...s.current()})),l+=s.move(`>`),e()}else{let e=n.enter(`destinationRaw`);l+=s.move(f$(d)),e()}if(e.title){let t=i===`multiline`?`
|
|
403
403
|
`:` `;l+=s.move(d$(e.title,a,t))}return o(),l},thematicBreak(e){return e.data?.sourceRaw??`---`},break(e,t,n){let r=e.data?.sourceRaw;return typeof r==`string`&&r.length>0?r:n.stack.includes(`tableCell`)||n.stack.includes(`okAtxHeading`)?`<br />`:e.data?.sourceStyle===`backslash`?`\\
|
|
404
404
|
`:`
|
|
@@ -422,9 +422,9 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
|
|
|
422
422
|
|
|
423
423
|
`:`
|
|
424
424
|
`;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=[],s=e.children??[];for(let e of s){let t=e.children??[],i=[],s=[];for(let e of t){let t=n.enter(`tableCell`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:` `,after:` `});a(),t(),i.push(o);let c=e.data?.sourcePadding;s.push(c&&typeof c.left==`number`&&typeof c.right==`number`?{left:c.left,right:c.right}:null)}a.push(i),o.push(s)}i();let c=e.align??[],l=e.data?.sourceDashCounts,u=a[0]?.length??0,d=a.slice(1).reduce((e,t)=>Math.max(e,t.length),0),f=Math.max(u,d,c.length);if(f===0)return console.warn(JSON.stringify({event:`table-serialize-dropped-empty`,rows:s.length})),``;let p=[];for(let e=0;e<f;e++){let t=c[e],n=``,r=``;t===`center`?(n=`:`,r=`:`):t===`left`?n=`:`:t===`right`&&(r=`:`);let i=l?.[e],a=typeof i==`number`&&i>=1?i:1;p.push(n+`-`.repeat(a)+r)}let m=(e,t)=>{let n=[];for(let r=0;r<f;r++){let i=e[r]??``,a=t[r]??{left:1,right:1};n.push(` `.repeat(a.left)+i+` `.repeat(a.right))}let r=v&&!v.leading?``:`|`,i=v&&!v.trailing?``:`|`;return`${r}${n.join(`|`)}${i}`},h=e.data?.sourceAlignmentPadding,g=Array.from({length:f},(e,t)=>{let n=h?.[t];return n&&typeof n.left==`number`&&typeof n.right==`number`?n:null}),_=e.data?.sourceOuterPipes,v=_&&f>=2&&a.every(e=>{let t=(e[0]??``).trim(),n=(e[f-1]??``).trim();return(_.leading||t.length>0)&&(_.trailing||n.length>0&&!n.endsWith(`\\`))})?_:null;if(a.length===0)return m(p,g);let y=[];y.push(m(a[0],o[0]??[])),y.push(m(p,g));for(let e=1;e<a.length;e++)y.push(m(a[e],o[e]??[]));return y.join(`
|
|
425
|
-
`)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=c$(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:a$({...i,attributes:(i.attributes??[]).map(u$)},t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=b$(n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),r,`==`),o+=i.move(`==`),a(),o},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=c$(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>{if(n)return`>`;let r=c++,i=s?.[r];return i===`lazy`&&r>0&&!o$.test(e)?e:i===`none`||i===0?`>${e}`:typeof i==`number`&&i>=2&&!e.startsWith(` `)?`>${` `.repeat(i)}${e}`:`> ${e}`})}};function c$(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){n.value.includes(`"`)?t.push(`${e}={${l$(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function l$(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function u$(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:l$(e.value)}}:e}function d$(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function f$(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function p$(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>m$(t)?e:`\\${e}`)}function m$(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32}function h$(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character===`!`&&e.after===`\\[`&&e.inConstruct===`phrasing`||e.character===`@`&&e.before===`[+\\-.\\w]`||e.character===`{`&&Array.isArray(e.inConstruct)&&e.inConstruct.includes(`phrasing`)||e.character==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`)),e.unsafe=e.unsafe.map(e=>{if(e.character!==`)`||e.atBreak!==!0||e.before!==`\\d+`||e.after!==void 0)return e;let t={...e,after:`(?:[ \r
|
|
425
|
+
`)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=c$(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:a$({...i,attributes:(i.attributes??[]).map(u$)},t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=b$(n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),r,`==`),o+=i.move(`==`),a(),o},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=c$(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>{if(n)return`>`;let r=c++,i=s?.[r];return i===`lazy`&&r>0&&!o$.test(e)?e:i===`none`||i===0?`>${e}`:typeof i==`number`&&i>=2&&!e.startsWith(` `)?`>${` `.repeat(i)}${e}`:`> ${e}`})}};function c$(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){n.value.includes(`"`)?t.push(`${e}={${l$(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function l$(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function u$(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:l$(e.value)}}:e}function d$(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function f$(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function p$(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>m$(t)?e:`\\${e}`)}function m$(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32||t===160}function h$(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character===`!`&&e.after===`\\[`&&e.inConstruct===`phrasing`||e.character===`@`&&e.before===`[+\\-.\\w]`||e.character===`{`&&Array.isArray(e.inConstruct)&&e.inConstruct.includes(`phrasing`)||e.character==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`||e.character===` `&&e.inConstruct===`phrasing`&&e.after===`[\\r\\n]`)),e.unsafe=e.unsafe.map(e=>{if(e.character!==`)`||e.atBreak!==!0||e.before!==`\\d+`||e.after!==void 0)return e;let t={...e,after:`(?:[ \r
|
|
426
426
|
]|$)`};return delete t._compiled,t});let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return p$(y$(i,n))}function g$(e){if(Number.isNaN(e))return`ws`;let t=UN(e);return t===1?`ws`:t===2?`punct`:`other`}function _$(e,t,n){let r=g$(t),i=g$(n),a=i!==`ws`&&(i===`other`||r!==`other`),o=r!==`ws`&&(r===`other`||i!==`other`);return e===`_`?a&&(!o||r===`punct`)||o&&(!a||i===`punct`):a||o}function v$(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
|
|
427
|
-
`||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function y$(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&v$(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=_$(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function b$(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);x$(i.charCodeAt(i.length-1),s,r)&&(o=S$(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return x$(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+S$(c)),o}function x$(e,t,n){return!(UN(t)!==1||n===`_`&&UN(e)===void 0)}function S$(e){return`&#x${e.toString(16).toUpperCase()};`}function C$(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!T$(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function w$(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=b$(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function T$(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function E$(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var D$=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};constructor(e){this.schema=_b(e.extensions),this.handlers=L$(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?qJ({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=R$(this.schema,this.freshnessHolder);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=UQ({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=WQ({toMarkdownHandlers:s$})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return XQ(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?ZQ(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?ZY(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e,t){let n;try{n=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}let r=this.freshnessHolder.checker;t?.skipFreshnessDerive&&(this.freshnessHolder.checker=void 0);try{return QQ(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}};const O$=zY();function k$(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function A$(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function j$(e,t){return e.attrs.sourceDirty||A$(e)?!0:t?t.isDiverged(e.toJSON()):!1}function M$(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function N$(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function P$(e,t){if(e.length===0)return N$({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return N$({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[P$(n.children,t)]}}return N$({type:`inlineCode`,value:F$(e)},t)}function F$(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=F$(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}const I$=Vc;function L$(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=MR(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=MR(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=n$(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i){let t=n.replaceAll(`\xA0`,` `);return r.sourceLiteral?e.text(t,[r.sourceLiteral.create({sourceRaw:i})]):e.text(t)}let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n.replaceAll(`\xA0`,` `));let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&iq(t.raw)!==null&&tq(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset).replaceAll(`\xA0`,` `);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length).replaceAll(`\xA0`,` `);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=iq(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u).replaceAll(`\xA0`,` `);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=NR(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=NR(r.highlight)),r.comment&&(i.comment=NR(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=MR(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=NR(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=NR(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=MR(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=MR(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=MR(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=O$.getOrWildcard(o),c=k$(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=n$(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=yq(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&I$.has(l)&&n.jsxComponent&&O$.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&Hc.has(l)&&n.jsxComponent&&O$.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Wc.has(l)&&n.jsxComponent&&O$.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Gc.has(l)&&n.jsxComponent&&O$.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:E$(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=MR(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function R$(e,t){let n={},r={},i=e.nodes,a=e.marks;i.paragraph&&(n.paragraph=RR(`paragraph`)),i.blockquote&&(n.blockquote=RR(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),i.heading&&(n.heading=RR(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),i.codeBlock&&(n.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),i.thematicBreak&&(n.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),i.hardBreak&&(n.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),i.list&&(n.list=RR(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),i.listItem&&(n.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&M$(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),i.table&&(n.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),i.tableRow&&(n.tableRow=RR(`tableRow`));let o=(e,t)=>{let n={type:`tableCell`,children:yJ(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(i.tableCell&&(n.tableCell=(e,t,n)=>o(e,n.all(e))),i.tableHeader&&(n.tableHeader=(e,t,n)=>o(e,n.all(e))),i.image&&(n.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),i.imageReference&&(n.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),i.htmlBlock&&(n.htmlBlock=e=>({type:`html`,value:e.attrs.content})),i.linkDefinition??i.linkRefDef){let e=i.linkDefinition?`linkDefinition`:`linkRefDef`;n[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(i.jsxComponent&&(n.jsxComponent=(e,n,r)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let i=e.attrs.componentName||null,a=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!j$(e,t.checker)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:i,attributes:a,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:O$.getOrWildcard(i??`*`).serialize(e,{all:e=>r.all(e),registry:O$,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),i.rawMdxFallback&&(n.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),i.jsxInline&&(n.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),i.mathInline&&(n.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),i.wikiLink&&(n.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),i.tag&&(n.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),i.wikiLinkEmbed&&(n.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),a.emphasis&&(r.emphasis=zR(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.strong&&(r.strong=zR(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.code&&(r.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return P$(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),a.strike??a.delete){let e=a.strike?`strike`:`delete`;r[e]=zR(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return a.highlight&&(r.highlight=zR(`mark`)),a.comment&&(r.comment=zR(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),i.commentBlock&&(n.commentBlock=RR(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),i.footnoteReference&&(n.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),i.footnoteDefinition&&(n.footnoteDefinition=RR(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),a.link&&(r.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),a.escapeMark&&(r.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),a.sourceLiteral&&(r.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return oq(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:n,markHandlers:r}}const z$=/\p{M}+/gu,B$=/[^\p{L}\p{N}]+/gu,V$=/^-+|-+$/g;function H$(e){return e.trim().normalize(`NFKD`).replace(z$,``).toLowerCase().replace(B$,`-`).replace(V$,``)}function U$(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function W$(e,t){let n=H$(e);return n?U$(n,t):``}const G$=new Set([`img`,`video`,`audio`,`mark`]);new Map(LY.flatMap(e=>e.surface===`compat`&&G$.has(e.rendersAs)?[[e.name,e]]:[])),GF(`<>`);const K$=OV(),q$=KB(),J$=qB();function Y$(){return LY.filter(e=>e.surface===`canonical`&&e.name!==`*`)}function X$(){return Y$().filter(e=>Z$(e)!==`fence`)}function Z$(e){return e.name===`MermaidFence`?`fence`:e.hasChildren?`jsx-block`:`jsx-void`}function Q$(e){return{id:e.name,displayName:e.displayName??e.name,description:e.description??``,kind:Z$(e)}}function $$(e){if(e.hidden!==!0&&e.type!==`reactnode`){if(`defaultValue`in e&&e.defaultValue!==void 0)return e.defaultValue;if(e.type===`enum`)return e.enumValues[0];if(e.type===`string`)return``;if(e.type===`number`)return 0;if(e.type===`boolean`)return!1}}function e1(e,t){return!(e.omitOnDefault===!0&&`defaultValue`in e&&Object.is(e.defaultValue,t)||e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&t===``)}function t1(e){let t=[];for(let n of e.props){let e=$$(n);e!==void 0&&e1(n,e)&&t.push(XJ(n.name,e))}return t}function n1(e){return eB(e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`Body content here.`,{extensions:[K$],mdastExtensions:[q$]}).children}function r1(e){let t=Z$(e),n;if(t===`fence`)n={type:`code`,lang:`mermaid`,meta:null,value:e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`graph LR
|
|
427
|
+
`||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function y$(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&v$(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=_$(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function b$(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=t.before??``,a=t.after??``,o=e,s=o.charCodeAt(0);x$(i.charCodeAt(i.length-1),s,r)&&(o=S$(s)+o.slice(1));let c=o.charCodeAt(o.length-1);return x$(a.charCodeAt(0),c,r)&&(o=o.slice(0,-1)+S$(c)),o}function x$(e,t,n){return!(UN(t)!==1||n===`_`&&UN(e)===void 0)}function S$(e){return`&#x${e.toString(16).toUpperCase()};`}function C$(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!T$(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function w$(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=b$(n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),r,i),s+=a.move(i),o(),s}function T$(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function E$(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var D$=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};freshnessHolder={checker:void 0};constructor(e){this.schema=_b(e.extensions),this.handlers=L$(this.schema,this.parseCtx),this.freshnessHolder.checker=e.deriveStructuralFreshness?qJ({parse:e=>this.parseWithFallback(e)}):void 0;let{nodeHandlers:t,markHandlers:n}=R$(this.schema,this.freshnessHolder);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=UQ({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=WQ({toMarkdownHandlers:s$})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return XQ(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?ZQ(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?ZY(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e,t){let n;try{n=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}let r=this.freshnessHolder.checker;t?.skipFreshnessDerive&&(this.freshnessHolder.checker=void 0);try{return QQ(n,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}finally{this.freshnessHolder.checker=r}}};const O$=zY();function k$(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function A$(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function j$(e,t){return e.attrs.sourceDirty||A$(e)?!0:t?t.isDiverged(e.toJSON()):!1}function M$(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function N$(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function P$(e,t){if(e.length===0)return N$({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return N$({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[P$(n.children,t)]}}return N$({type:`inlineCode`,value:F$(e)},t)}function F$(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=F$(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}const I$=Vc;function L$(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=MR(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=MR(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=n$(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i)return r.sourceLiteral?e.text(n,[r.sourceLiteral.create({sourceRaw:i})]):e.text(n);let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n);let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&iq(t.raw)!==null&&tq(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=iq(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=NR(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=NR(r.highlight)),r.comment&&(i.comment=NR(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=MR(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=NR(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=NR(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=MR(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`,sourceRaw:e.data?.sourceRaw??null})),n.list&&(i.list=MR(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=MR(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=O$.getOrWildcard(o),c=k$(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=n$(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=yq(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&I$.has(l)&&n.jsxComponent&&O$.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&Hc.has(l)&&n.jsxComponent&&O$.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Wc.has(l)&&n.jsxComponent&&O$.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&Gc.has(l)&&n.jsxComponent&&O$.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:E$(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=MR(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function R$(e,t){let n={},r={},i=e.nodes,a=e.marks;i.paragraph&&(n.paragraph=RR(`paragraph`)),i.blockquote&&(n.blockquote=RR(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),i.heading&&(n.heading=RR(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),i.codeBlock&&(n.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),i.thematicBreak&&(n.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),i.hardBreak&&(n.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle,...typeof e.attrs.sourceRaw==`string`&&e.attrs.sourceRaw.length>0?{sourceRaw:e.attrs.sourceRaw}:{}}})),i.list&&(n.list=RR(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),i.listItem&&(n.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&M$(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),i.table&&(n.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),i.tableRow&&(n.tableRow=RR(`tableRow`));let o=(e,t)=>{let n={type:`tableCell`,children:yJ(t)},r=e.attrs.sourcePadding;return typeof r==`object`&&r&&typeof r.left==`number`&&typeof r.right==`number`&&(n.data={sourcePadding:r}),n};if(i.tableCell&&(n.tableCell=(e,t,n)=>o(e,n.all(e))),i.tableHeader&&(n.tableHeader=(e,t,n)=>o(e,n.all(e))),i.image&&(n.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),i.imageReference&&(n.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),i.htmlBlock&&(n.htmlBlock=e=>({type:`html`,value:e.attrs.content})),i.linkDefinition??i.linkRefDef){let e=i.linkDefinition?`linkDefinition`:`linkRefDef`;n[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(i.jsxComponent&&(n.jsxComponent=(e,n,r)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let i=e.attrs.componentName||null,a=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!j$(e,t.checker)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:i,attributes:a,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:O$.getOrWildcard(i??`*`).serialize(e,{all:e=>r.all(e),registry:O$,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),i.rawMdxFallback&&(n.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),i.jsxInline&&(n.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),i.mathInline&&(n.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),i.wikiLink&&(n.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),i.tag&&(n.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),i.wikiLinkEmbed&&(n.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),a.emphasis&&(r.emphasis=zR(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.strong&&(r.strong=zR(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),a.code&&(r.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return P$(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),a.strike??a.delete){let e=a.strike?`strike`:`delete`;r[e]=zR(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return a.highlight&&(r.highlight=zR(`mark`)),a.comment&&(r.comment=zR(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),i.commentBlock&&(n.commentBlock=RR(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),i.footnoteReference&&(n.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),i.footnoteDefinition&&(n.footnoteDefinition=RR(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),a.link&&(r.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),a.escapeMark&&(r.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),a.sourceLiteral&&(r.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return oq(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:n,markHandlers:r}}const z$=/\p{M}+/gu,B$=/[^\p{L}\p{N}]+/gu,V$=/^-+|-+$/g;function H$(e){return e.trim().normalize(`NFKD`).replace(z$,``).toLowerCase().replace(B$,`-`).replace(V$,``)}function U$(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function W$(e,t){let n=H$(e);return n?U$(n,t):``}const G$=new Set([`img`,`video`,`audio`,`mark`]);new Map(LY.flatMap(e=>e.surface===`compat`&&G$.has(e.rendersAs)?[[e.name,e]]:[])),GF(`<>`);const K$=OV(),q$=KB(),J$=qB();function Y$(){return LY.filter(e=>e.surface===`canonical`&&e.name!==`*`)}function X$(){return Y$().filter(e=>Z$(e)!==`fence`)}function Z$(e){return e.name===`MermaidFence`?`fence`:e.hasChildren?`jsx-block`:`jsx-void`}function Q$(e){return{id:e.name,displayName:e.displayName??e.name,description:e.description??``,kind:Z$(e)}}function $$(e){if(e.hidden!==!0&&e.type!==`reactnode`){if(`defaultValue`in e&&e.defaultValue!==void 0)return e.defaultValue;if(e.type===`enum`)return e.enumValues[0];if(e.type===`string`)return``;if(e.type===`number`)return 0;if(e.type===`boolean`)return!1}}function e1(e,t){return!(e.omitOnDefault===!0&&`defaultValue`in e&&Object.is(e.defaultValue,t)||e.type===`string`&&e.required===!1&&e.defaultValue===void 0&&t===``)}function t1(e){let t=[];for(let n of e.props){let e=$$(n);e!==void 0&&e1(n,e)&&t.push(XJ(n.name,e))}return t}function n1(e){return eB(e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`Body content here.`,{extensions:[K$],mdastExtensions:[q$]}).children}function r1(e){let t=Z$(e),n;if(t===`fence`)n={type:`code`,lang:`mermaid`,meta:null,value:e.exampleBody&&e.exampleBody.trim().length>0?e.exampleBody:`graph LR
|
|
428
428
|
A --> B`};else{let r=t1(e),i=t===`jsx-block`?n1(e):[];n={type:`mdxJsxFlowElement`,name:e.name,attributes:r,children:i}}return KP({type:`root`,children:[n]},{extensions:[J$]}).trimEnd()}function i1(e){let t=[];for(let n of e.props){if(n.hidden===!0)continue;let e={name:n.name,type:n.type,required:n.required};n.description!==void 0&&(e.description=n.description),n.advanced===!0&&(e.advanced=!0),n.omitOnDefault===!0&&(e.omitOnDefault=!0),n.type===`enum`&&(e.values=n.enumValues,n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue)),n.type===`string`&&(n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),n.language!==void 0&&(e.language=n.language),n.accept!==void 0&&(e.accept=n.accept)),n.type===`boolean`&&n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),n.type===`number`&&n.defaultValue!==void 0&&(e.defaultValue=n.defaultValue),t.push(e)}return t}function a1(e){return{...Q$(e),example:r1(e),params:i1(e)}}function o1(){return[``,"**Custom canonical components.** OK `.md` / `.mdx` supports the JSX components below — use whichever is semantically useful in any part of the doc. For full source syntax + parameter schemas, call `palette({ components: [ids] })` with the ids you want to use. Fenced code blocks render naturally and don't need a fetch — including ` ```mermaid ` for diagrams (mermaid label text has sharp edges — `palette({ components: [\"Mermaid\"] })` lists them; parse failures come back as `warnings` entries on write/edit) and ` ```html preview ` for interactive HTML/JS/CSS pages (the fence info-string `preview` token renders the block as a live iframe; works for `html` / `htm` / `xml`; optional `h=` / `w=` tokens set size, e.g. ` ```html preview h=400px `). Use ` ```html preview ` whenever you want anything interactive or JS-powered (charts, demos, calculators, animations) — just author the standalone HTML page in the fence. Call `palette` for the markdown-native component forms (write `> [!NOTE]`, not `<Callout>`), copy-ready themed `html preview` starters, and the theme tokens (`var(--chart-1)`, `var(--foreground)`, …) an embed should reference so it tracks the reader's light/dark theme. Arbitrary `<TagName>` JSX falls through as raw MDX when no canonical fits.",``,...X$().map(Q$).map(e=>`- \`${e.id}\` (${e.kind}) — ${e.description}`)].join(`
|
|
429
429
|
`)}const s1=[`text`,`number`,`boolean`,`date`,`list`,`object`];F(s1);const c1=$s([A(),j(),M()]),l1=kc(()=>$s([c1.transform(e=>String(e)),ac(A(),u1),N(l1)])),u1=kc(()=>$s([A(),j(),M(),N(l1),ac(A(),u1)]));function d1(e){if(Array.isArray(e)){let t=[];for(let n of e)n!==null&&t.push(d1(n));return t}if(typeof e==`object`&&e){let t={};for(let[n,r]of Object.entries(e))t[n]=r===null?``:d1(r);return t}return e}const f1=Pc(d1,ac(A(),u1));ac(A(),$s([u1,Hs()]));function p1(e){return!!(e===null||typeof e==`string`&&e===``||Array.isArray(e)&&e.length===0)}const m1=P({docName:Oq,summary:Aq,content:A().optional(),...kq}).loose(),h1=P({docName:Oq,summary:Aq,markdown:A(),position:F([`append`,`prepend`,`replace`]).optional(),extension:F(VG).optional(),...kq}).loose(),g1=P({docName:Oq,summary:Aq,find:A().min(1),replace:A(),offset:j().int().nonnegative().optional(),...kq}).loose(),_1=P({docName:Oq,connectionId:A().min(1),scope:F([`last`,`session`,`file`]).optional(),...kq}).loose(),v1=P({value:A(),truncatedFrom:j().int().nonnegative().optional(),hint:A().optional()}).loose(),y1=tc(`kind`,[P({kind:I(`inline`),content:A()}),P({kind:I(`truncated`),byteLength:j().int().nonnegative(),hint:A()})]),b1=P({kind:I(`content-divergence`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),divergenceType:A().optional(),currentState:y1.optional(),hint:A().optional()}).loose(),x1=P({type:I(`orphan`),parentCandidates:N(A()),message:A()}).loose(),S1=P({kind:I(`disk-edit-reconciled`),intendedBytes:j().int().nonnegative(),actualBytes:j().int().nonnegative(),byteDelta:j().int(),mergeOutcome:A().optional(),hint:A().optional()}).loose(),C1=tc(`kind`,[b1,S1]),w1=tc(`kind`,[b1,S1,P({kind:I(`mermaid-parse-error`),fenceIndex:j().int().positive(),fenceFirstLine:A(),message:A(),line:j().int().positive().optional()}).loose()]),T1=N(w1).min(1),E1=P({href:A(),resolvedTo:A().nullable(),reason:F([`no-such-doc`,`no-such-file`,`unresolvable`])}).loose(),D1=N(E1),O1=P({timestamp:A().min(1),summary:v1.optional(),warning:C1.optional(),warnings:T1.optional()}).loose(),k1=P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),hints:N(x1).optional(),summary:v1.optional(),warning:C1.optional(),warnings:T1.optional(),brokenLinks:D1}).loose(),A1=P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),summary:v1.optional(),warning:C1.optional(),warnings:T1.optional(),brokenLinks:D1}).loose(),j1=P({docName:A().min(1),scope:F([`last`,`session`]),undone:M()}).loose(),M1=P({docName:Oq,patch:ac(A(),$s([u1,Hs()])),types:ac(A(),F(s1)).optional(),summary:Aq,...kq}).loose(),N1=P({timestamp:A().min(1),subscriberCount:j().int().nonnegative(),systemSubscriberCount:j().int().nonnegative(),appliedKeys:N(A()),summary:v1.optional(),warning:C1.optional(),warnings:T1.optional(),brokenLinks:D1}).loose(),P1=P({entries:N(P({level:F([`info`,`warn`,`error`]),message:A().max(8192),event:A().optional(),fields:ac(A(),Ks()).optional(),ts:j().optional(),sourceId:A().optional(),lineNumber:j().optional()}).loose()).max(100)}).loose(),F1=P({accepted:j().int().min(0)}).loose(),I1=P({status:A().min(1),reason:A()}).loose(),L1=P({docName:A().min(1),content:A(),lifecycle:I1.nullable()}).loose(),R1=P({documents:N(P({kind:F([`document`,`asset`,`folder`,`file`]).default(`document`),docName:A().min(1).optional(),docExt:A().min(1).default(`.md`),size:j().int().nonnegative(),modified:A().min(1),isSymlink:M().default(!1),canonicalDocName:A().nullable().default(null),targetPath:A().nullable().default(null),path:A().min(1).optional(),assetExt:A().min(1).optional(),mediaKind:F([`image`,`video`,`audio`,`pdf`,`text`,`mermaid`]).nullable().optional(),referencedBy:N(A().min(1)).optional(),hasChildren:M().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`})),truncated:M().optional()}).loose(),z1=P({source:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),B1=P({docName:A().min(1),backlinks:N(z1)}).loose(),V1=P({counts:ac(A().min(1),j().int().nonnegative())}).loose(),H1=tc(`kind`,[P({kind:I(`doc`),docName:A().min(1),anchor:A().nullable(),title:A(),snippet:A().nullable()}).loose(),P({kind:I(`external`),url:A().min(1),title:A(),snippet:A().nullable()}).loose()]),U1=P({docName:A().min(1),forwardLinks:N(H1)}).loose(),W1=tc(`kind`,[P({id:A().min(1),kind:I(`doc`),docName:A().min(1),anchor:A().nullable(),label:A(),cluster:A().nullable(),category:A().nullable(),tags:N(A()).nullable()}).loose(),P({id:A().min(1),kind:I(`external`),url:A().min(1),label:A()}).loose()]),G1=P({source:A().min(1),target:A().min(1)}).loose(),K1=P({nodes:N(W1),links:N(G1)}).loose(),q1=P({ts:j().int().min(0),url:A(),method:A(),ua:A().optional(),origin:A().optional(),referer:A().optional(),host:A().optional(),remote:A().optional(),secChUa:A().optional(),secChUaMobile:A().optional(),secChUaPlatform:A().optional(),secFetchSite:A().optional(),secFetchDest:A().optional(),secFetchMode:A().optional(),secFetchUser:A().optional()}).loose(),J1=P({app:$s([I(`cursor`),I(`codex`),I(`claude`),Hs()]),signals_fired:N(A())}).loose(),Y1=P({entries:N(q1),count:j().int().min(0),detection:J1}).loose(),X1=P({writers:N(P({id:A().min(1),name:A().optional(),email:A().optional()}).loose()).optional(),summary:Aq,...kq}).loose(),Z1=P({checkpointRef:A().min(1)}).loose(),Q1=P({v:j().int().optional(),id:A().min(1),name:A().min(1),colorSeed:A().optional(),docs:N(A()),summaries:N(A()).optional()}).loose(),$1=P({entries:N(P({sha:A().min(1),timestamp:A().min(1),author:A(),authorEmail:A(),type:F([`checkpoint`,`wip`,`upstream`,`park`]),message:A(),contributors:N(Q1),checkpoint:Ks().nullable()}).loose()),total:j().int().nonnegative().optional(),truncated:M().optional(),hasMore:M().optional()}).loose(),e0=P({sha:A().regex(/^[0-9a-f]{40}$/i),content:A(),timestamp:A(),author:A()}).loose(),t0=P({contentDir:A().min(1),pathSeparator:F([`/`,`\\`]),symlinkResolved:M()}).loose(),n0=N(tc(`source`,[P({docName:A().min(1),timestamp:A().min(1),size:j().int().nonnegative(),source:I(`flat`)}).loose(),P({docName:A().min(1),timestamp:A().min(1),source:I(`timeline`),sha:A().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."}),r0=P({orphans:N(P({docName:A().min(1),title:A()}).loose())}).loose(),i0=P({hubs:N(P({docName:A().min(1),title:A(),count:j().int().nonnegative()}).loose())}).loose(),a0=P({source:A().min(1),title:A(),snippet:A().nullable()}).loose(),o0=P({deadLinks:N(P({target:A().min(1),sources:N(a0)}).loose())}).loose(),s0=P({target:P({docName:A().min(1),title:A(),aliases:N(A())}).loose(),mentions:N(P({source:A().min(1),excerpt:A(),offset:j().int().nonnegative()}).loose()),truncated:M()}).loose(),c0=P({projectPath:A().min(1)}).loose(),l0=F([`not-a-git-worktree`,`init-failed`]),u0=tc(`ok`,[P({ok:I(!0),projectPath:A().min(1)}).loose(),P({ok:I(!1),reason:l0,message:A().min(1)}).loose()]),d0=P({host:A().min(1).optional()}).loose(),f0=P({key:A().min(1)}).loose(),p0=P({keyPresent:M()}).loose(),m0=P({name:A().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:A().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),h0=P({authenticated:M()}).loose(),g0=P({}).loose(),_0=P({stackIndex:j().int().min(0),ts:j().int().min(0),additions:j().int().min(0),deletions:j().int().min(0)}).loose(),v0=P({docName:A().min(1),additionsTotal:j().int().min(0),deletionsTotal:j().int().min(0),lastTs:j().int().min(0),bursts:N(_0)}).loose(),y0=P({displayName:A().min(1),color:A().min(1),icon:A().optional(),connectionId:A().min(1)}).loose(),b0=P({sessionAlive:M(),agent:y0.nullable(),files:N(v0)}).loose(),x0=P({diff:A(),generatedAt:j().int().min(0)}).loose(),S0=P({}).loose(),C0=P({}).loose(),w0=P({}).loose(),T0=P({}).loose(),E0=P({}).loose(),D0=P({}).loose(),O0=P({displayName:A().min(1),icon:A(),color:A().min(1),currentDoc:A().nullable(),mode:F([`idle`,`writing`]),ts:j().int().min(0)}).loose(),k0=P({presence:ac(A().min(1),O0)}).loose(),A0=ac(A().min(1),M()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`});P({path:A().min(1,`path must be non-empty`)}).loose();const j0=P({}).loose(),M0=P({fromDocName:A().min(1),toDocName:A().min(1)}).loose(),N0=P({fromPath:A().min(1),toPath:A().min(1)}).loose(),P0=P({}).loose(),F0=P({path:A().min(1),...kq,summary:Aq}).loose(),I0=P({docName:A().min(1)}).loose(),L0=P({path:A().min(1),...kq,summary:Aq}).loose(),R0=P({path:A().min(1)}).loose(),z0=P({kind:F([`file`,`folder`]),path:A().min(1),...kq,summary:Aq}).loose(),B0=P({kind:F([`file`,`folder`]),path:A().min(1),duplicatedDocNames:N(A().min(1))}).loose(),V0=P({pages:N(P({docName:A().min(1),title:A(),docExt:A().min(1),size:j().int().nonnegative(),modified:A().min(1),icon:A().min(1).max(2048).optional()}).loose())}).loose(),H0=P({level:j().int().min(1).max(6),text:A(),slug:A()}).loose(),U0=P({docName:A().min(1),headings:N(H0)}).loose(),W0=P({docName:A().min(1),rewrites:j().int().nonnegative()}).loose(),G0=P({kind:F([`file`,`folder`,`asset`]),fromPath:A().min(1),toPath:A().min(1),...kq,summary:Aq}).loose(),K0=P({renamed:N(M0),renamedAssets:N(N0),rewrittenDocs:N(W0).optional(),summary:v1.optional()}).loose(),q0=P({kind:F([`file`,`folder`,`asset`]),path:A().min(1),...kq}).loose(),J0=P({deletedDocNames:N(A().min(1))}).loose(),Y0=P({kind:F([`file`,`folder`,`asset`]),path:A().min(1),...kq,summary:Aq}).loose(),X0=P({deletedDocNames:N(A().min(1))}).loose(),Z0=P({docName:A().min(1),commitSha:A().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:Aq,...kq}).loose(),Q0=P({restoredFrom:A().min(1),timestamp:A().min(1),summary:v1.optional(),warning:b1.optional(),warnings:T1.optional()}).loose(),$0=F([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),e2=P({label:A().min(1),webUrl:xs().nullable()}).loose(),t2=tc(`checkStatus`,[P({checkStatus:I(`allowed`)}).loose(),P({checkStatus:I(`denied`),deniedReason:F([`no-collaborator`,`private-no-access`,`repo-not-found`])}).loose(),P({checkStatus:I(`unknown`),unknownError:F([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`]).optional()}).loose()]),n2=F([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]),r2=P({state:$0,lastSyncUtc:A().nullable(),lastFetchUtc:A().nullable(),lastPushedSha:A().nullable(),ahead:j().int().min(0),behind:j().int().min(0),consecutiveFailures:j().int().min(0),conflictCount:j().int().min(0),hasRemote:M(),syncEnabled:M(),identityUnresolved:M(),remote:e2.nullable().optional(),pushError:A().optional(),pushErrorCode:n2.optional(),pullError:A().optional(),pullErrorCode:n2.optional(),pausedReason:A().optional(),pushPermission:t2.optional()}).loose(),i2=P({op:F([`sync`,`push`,`pull`]).optional()}).loose(),a2=P({op:F([`sync`,`push`,`pull`])}).loose(),o2=P({conflicts:N(P({file:A().min(1),detectedAt:A().min(1),oursSha:A().optional(),theirsSha:A().optional(),baseSha:A().optional()}).loose())}).loose(),s2=P({file:A().min(1),strategy:F([`mine`,`theirs`,`content`,`delete`]),content:A().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),c2=P({}).loose(),l2=P({file:A().min(1),base:A(),ours:A(),theirs:A(),kind:F([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:A().nullable()}).loose(),u2=P({plan:jc(e=>e!==void 0,{message:`plan is required`})}).loose(),d2=P({plan:jc(e=>e!==void 0,{message:`plan is required`})}).loose(),f2=P({result:jc(e=>e!==void 0,{message:`result is required`})}).loose(),p2=P({path:A().min(1),summary:A().min(1)}).loose(),m2=P({files:j().int().nonnegative(),folders:j().int().nonnegative()}).loose(),h2=P({packs:N(P({id:A().min(1),name:A().min(1),description:A().min(1),defaultSubfolder:A().optional(),folders:N(p2),entryCounts:m2}).loose())}).loose(),g2=P({noOpen:M().optional(),out:A().min(1).optional()}).loose(),_2=P({reason:F([`unsupported-platform`,`spawn-error`]),message:A()}).loose(),v2=tc(`status`,[P({status:I(`installed`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A()}).loose(),P({status:I(`built`),outputPath:A(),size:j().int().nonnegative(),sha256:A(),skillVersion:A(),handoffError:_2.optional()}).loose(),P({status:I(`failed`),buildError:A()}).loose(),P({status:I(`skip-current`),skillVersion:A(),recordedAt:A().optional()}).loose()]),y2=[`.ok`,`skill-targets.json`],b2=F(qG),x2=Zs({schema:I(1),targets:N(b2).default([])});function S2(e){let t;try{t=JSON.parse(e)}catch{return null}let n=x2.safeParse(t);return n.success?n.data:null}const C2=P({tags:N(P({name:A().min(1),count:j().int().nonnegative(),isLeaf:M()}).loose())}).loose(),w2=P({docName:A().min(1),title:A(),matchingTags:N(A().min(1)),snippet:A().nullable()}).loose(),T2=P({name:A().min(1),docs:N(w2)}).loose(),E2=P({folder:Ks(),frontmatter_local:ac(A(),Ks()).nullable()}).loose(),D2=P({path:A(),frontmatter:ac(A(),Ks()).optional()}).loose(),O2=P({applied:Ks()}).loose(),k2=ac(A(),Ks()).meta({description:`Free-form frontmatter map embedded in template payloads.`}),A2=P({template:P({name:A().min(1),folder:A(),scope:F([`local`,`inherited`]),path:A().min(1),frontmatter:k2,body:A()}).strict()}).strict(),j2=P({templates:N(P({name:A().min(1),title:A().optional(),description:A().optional(),path:A().min(1),source_folder:A()}).strict()),truncated:M()}).strict(),M2=P({folder:A(),name:A(),body:A().optional(),frontmatter:k2.optional(),...kq,summary:Aq}).strict(),N2=P({path:A().min(1),created:M(),warnings:N(A())}).strict(),P2=P({existed:M(),path:A().min(1)}).strict(),F2=P({fromFolder:A(),fromName:A(),toFolder:A(),toName:A(),body:A().optional(),frontmatter:k2.optional(),...kq,summary:Aq}).strict(),I2=P({from:A().min(1),to:A().min(1),committed:M()}).strict(),L2=F(EG),R2=/^[a-z0-9-]+$/,z2=/<\/?[A-Za-z][^>]*>/;function B2(e){return z2.test(e)}const V2=/^[A-Za-z0-9_-]+$/,H2=P({name:A(),description:A()}).strict(),U2=P({skill:P({name:A().min(1),scope:L2,path:A().min(1),frontmatter:H2,body:A(),files:N(P({path:A().min(1),text:A().nullable()})).optional()}).strict()}).strict(),W2=P({skills:N(P({name:A().min(1),description:A().optional(),scope:L2,path:A().min(1),absolutePath:A().min(1).optional(),installed:M(),hosts:N(A()),installedVersion:A().optional(),bundledVersion:A().optional(),updateAvailable:M().optional()}).strict()),truncated:M()}).strict(),G2=P({scope:L2.default(`project`),name:A(),body:A().optional(),frontmatter:H2,...kq,summary:Aq}).strict(),K2=P({path:A().min(1),created:M(),warnings:N(A())}).strict(),q2=P({scope:L2.default(`project`),name:A(),...kq,summary:Aq}).strict(),J2=P({name:A().min(1),version:A().min(1),previousVersion:A().optional(),checkpointRef:A().optional()}).strict(),Y2=P({existed:M(),path:A().min(1)}).strict(),X2=P({scope:L2.default(`project`),fromName:A(),toName:A(),body:A().optional(),frontmatter:H2.optional(),...kq,summary:Aq}).strict(),Z2=P({from:A().min(1),to:A().min(1),committed:M()}).strict(),Q2=F([`reference`,`script`]),$2=P({scope:L2.default(`project`),name:A(),path:A().min(1),content:A(),...kq,summary:Aq}).strict(),e4=P({path:A().min(1),created:M(),kind:Q2,content:M()}).strict(),t4=P({path:A().min(1),kind:Q2,text:A()}).strict(),n4=P({path:A().min(1),existed:M(),kind:Q2}).strict(),r4=P({scope:L2.default(`project`),name:A(),targets:N(b2).optional().meta({description:`Explicit editor ids to install into; omit to use project-configured editors.`}),...kq,summary:Aq}).strict(),i4=P({name:A().min(1),hosts:N(A()),scripts:M(),warnings:N(A()),warningCodes:N(F([`no-targets`,`scripts-present`]))}).strict(),a4=P({scope:L2.default(`project`),name:A()}).strict(),o4=P({name:A().min(1),uninstalled:M()}).strict(),s4=P({targets:N(b2),configured:M()}).strict(),c4=P({targets:N(b2)}).strict(),l4=P({targets:N(b2),reprojected:N(P({name:A(),hosts:N(A())}).strict()),bundleHosts:N(A()),removedFrom:N(A())}).strict(),u4=P({scope:L2.default(`project`),name:A(),version:A().regex(/^[0-9a-f]{40}$/i),...kq,summary:Aq}).strict(),d4=P({name:A().min(1),version:A(),restoredFiles:N(A()),warnings:N(A())}).strict(),f4=P({query:A().optional(),intent:F([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:F([`navigation`,`relevance`]).optional(),scopes:N(F([`page`,`folder`,`content`,`file`])).optional(),scope:A().optional(),limit:j().int().nonnegative().optional(),semantic:M().optional(),source:F([`omnibar`,`mcp`,`http`]).optional()}).loose(),p4=P({kind:F([`page`,`folder`,`content`,`file`]),path:A().min(1),title:A(),score:j(),signals:ac(A(),Ks()),snippet:A().optional()}).loose(),m4=P({capable:M(),applied:M(),coverage:P({embedded:j().int().nonnegative(),total:j().int().nonnegative()})}).loose(),h4=P({enabled:M(),keyPresent:M(),keySource:F([`file`,`env`]).nullable(),keyHint:A().nullable(),ready:M(),capable:M(),embedded:j().int().nonnegative(),total:j().int().nonnegative()}).loose(),g4=P({query:A(),intent:F([`autocomplete`,`full_text`,`omnibar`]),results:N(p4),elapsedMs:j().nonnegative(),semantic:m4.optional(),truncated:M().optional(),ready:M().optional()}).loose(),_4=P({version:A().min(1),recordedAt:A().min(1)}).loose(),v4=P({currentVersion:A().min(1),targets:ac(A(),_4.nullable())}).loose(),y4=`server-info`,b4=`branch-switched`,x4=`disk-ack`,S4=`config-validation-rejected`,C4=`config-ignore-nested-error`,w4=F([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),T4=P({v:I(1),ch:I(y4),seq:j(),serverInstanceId:A().min(1),currentBranch:A().min(1).optional()}).loose(),E4=P({v:I(1),ch:I(b4),seq:j(),branch:A().min(1)}).loose(),D4=P({v:I(1),ch:w4,seq:j()}).loose(),O4=P({v:I(1),ch:I(x4),seq:j(),docName:A().min(1),sv:A().min(1)}).loose(),k4=P({v:I(1),ch:I(S4),seq:j(),docName:A().min(1),error:ql}).loose(),A4=P({v:I(1),ch:I(C4),seq:j(),path:A().min(1),error:A().min(1)}).loose(),j4=new pG.default;function M4(e,t){if(e===t)return[{value:e}];let{chars1:n,chars2:r,lineArray:i}=j4.diff_linesToChars_(e,t),a=j4.diff_main(n,r,!1);j4.diff_charsToLines_(a,i),j4.diff_cleanupSemantic(a);let o=[];for(let[e,t]of a)e===pG.default.DIFF_DELETE?o.push({value:t,removed:!0}):e===pG.default.DIFF_INSERT?o.push({value:t,added:!0}):o.push({value:t});return o}const N4=new pG.default;N4.Diff_Timeout=.25;const P4=256*1024;function F4(e,t,n){if(t===n)return;let r=M4(t,n),i=0;for(let n=0;n<r.length;n++){let a=r[n],o=r[n+1];if(a.removed&&o?.added){if(t.substring(i,i+o.value.length)===o.value){i+=o.value.length,n++;continue}e.delete(i,a.value.length),e.insert(i,o.value),i+=o.value.length,n++}else a.removed?e.delete(i,a.value.length):(a.added&&e.insert(i,a.value),i+=a.value.length)}}function I4(e,t,n){if(t===n)return;if(t.length>P4||n.length>P4){L4(e,t,n);return}let r=N4.diff_main(t,n);N4.diff_cleanupSemantic(r);let i=0;for(let[t,n]of r)t===0?i+=n.length:t===-1?e.delete(i,n.length):t===1&&(e.insert(i,n),i+=n.length)}function L4(e,t,n){let r=0,i=Math.min(t.length,n.length);for(;r<i&&t.charCodeAt(r)===n.charCodeAt(r);)r++;let a=0;for(;a<i-r&&t.charCodeAt(t.length-1-a)===n.charCodeAt(n.length-1-a);)a++;let o=t.length-r-a,s=n.slice(r,n.length-a);o>0&&e.delete(r,o),s.length>0&&e.insert(r,s)}const R4=P({path:N($s([A(),j()])),message:A(),issueCode:A()});tc(`code`,[P({code:I(`SCHEMA_INVALID`),issues:N(R4)}),P({code:I(`WRITE_ERROR`),detail:A()})]);const z4={defaultKeyType:`PLAIN`,defaultStringType:`PLAIN`,lineWidth:0};function B4(e){if(e.trim()===``)return{doc:new Fc.Document({}),map:{}};let t;try{t=(0,Fc.parseDocument)(e)}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new Fc.Document({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=f1.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function V4(e){return Object.keys(e).length===0?``:new Fc.Document(e).toString(z4)}function H4(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function U4(e,t,n){if(Array.isArray(n)){let r=e.createNode(n),i=(0,Fc.isSeq)(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}if(H4(n)){let r=e.createNode(n),i=(0,Fc.isMap)(t)?t.flow:void 0;return i!==void 0&&(r.flow=i),r}return n}function W4(e){return e===``?``:`---\n${e.endsWith(`
|
|
430
430
|
`)?e.slice(0,-1):e}\n---\n`}function G4(e){let t=e.match(fK);return t?{fenced:t[0],body:e.slice(t[0].length)}:{fenced:``,body:e}}function K4(e){if(e.trim()===``)return{doc:new Fc.Document({}),map:{}};let t;try{t=(0,Fc.parseDocument)(e,{uniqueKeys:!1})}catch(e){let t=e instanceof Error?e.message:String(e);return{doc:new Fc.Document({}),map:null,parseError:`parse threw: ${t}`}}if(t.errors.length>0)return{doc:t,map:null,parseError:t.errors[0]?.message??`yaml parse errors`};let n;try{n=t.toJS()}catch(e){let n=e instanceof Error?e.message:String(e);return{doc:t,map:null,parseError:`toJS threw: ${n}`}}if(typeof n!=`object`||!n||Array.isArray(n))return{doc:t,map:null,parseError:`top-level value is not a mapping`};let r=f1.safeParse(n);if(!r.success){let e=r.error.issues[0],n=e&&Array.isArray(e.path)?e.path.join(`.`):``,i=e?.message??`unknown`;return{doc:t,map:null,parseError:n?`value at "${n}" failed schema: ${i}`:`schema validation failed: ${i}`}}return{doc:t,map:r.data}}function q4(e){return e===``?{doc:new Fc.Document({}),map:{}}:K4(hK(e))}function J4(e){let{fenced:t}=G4(e),{map:n}=q4(t);return n??{}}function Y4(e){if(e.contents==null||!(`items`in e.contents)){let t=e.createNode({});return e.contents=t,t}return e.contents}function X4(e){let t=e.contents;return!t||!(`items`in t)||(t.items?.length??0)===0?``:W4(e.toString(z4))}function Z4(e){let t=new TextEncoder().encode(e).byteLength;return t>65536?{kind:`region_too_large`,bytes:t,limit:65536}:null}function Q4(e){let t=X4(e),n=Z4(t);return n?{ok:!1,error:n}:{ok:!0,nextFenced:t}}function $4(e,t){if(Object.hasOwn(t,`frontmatter`))return{ok:!1,error:{kind:`reserved_key`,key:`frontmatter`}};let{doc:n,map:r}=q4(e);if(r===null)return{ok:!1,error:{kind:`parse_failed`,reason:`fm region unparseable`}};try{Y4(n);for(let[e,r]of Object.entries(t)){if(r===null){n.delete(e);continue}let t=u1.safeParse(r);if(!t.success)return{ok:!1,error:{kind:`invalid_value`,key:e,reason:t.error.issues[0]?.message??`invalid value`}};n.set(e,U4(n,n.get(e,!0),t.data))}return Q4(n)}catch(e){return{ok:!1,error:{kind:`parse_failed`,reason:`yaml@2 threw: ${e instanceof Error?e.message:String(e)}`}}}}Object.freeze({source:`local`,skipStoreHooks:!1,context:Object.freeze({origin:`form-write`})});function e3(e,t){let n=t?.verbose===!0,r=t?.nowMs===void 0?new Date().toISOString():new Date(t.nowMs).toISOString(),i={event:`bridge-invariant-violation`,site:e.site,"doc.name":e.docName??null,"tolerance-class-attempted":`untracked`,"normalize-equal-modulo-tolerance":!1,ytextLen:e.ytextSnapshot.length,fragmentLen:e.fragmentMdSnapshot.length,ytextHash:uu(e.ytextSnapshot),fragmentHash:uu(e.fragmentMdSnapshot),redacted:!n,timestamp:r};return n?{...i,diff:e.unifiedDiff}:i}var t3=class extends Error{violation;constructor(e){let t=typeof e.origin==`string`?e.origin:e.origin?.context?.origin??`unknown-object`,n=e.docName?` doc='${e.docName}'`:``;super(`Bridge invariant violated [site='${e.site}'${n}, origin='${t}'].\n Y.Text (${e.ytextSnapshot.length} chars): ${e.ytextSnapshot.slice(0,200)}...\n Fragment (${e.fragmentMdSnapshot.length} chars): ${e.fragmentMdSnapshot.slice(0,200)}...\n Diff:\n${e.unifiedDiff}`),this.name=`BridgeInvariantViolationError`,this.violation=e}};const n3=/^(?:\r?\n)+/;function r3(e){let{frontmatter:t,body:n}=pK(e),r=n.match(n3);if(!r)return{boundary:``,text:e};let i=n.slice(r[0].length);return t===``&&fK.test(i)?{boundary:``,text:e}:{boundary:r[0],text:t+i}}function i3(e,t){if(t===``)return e;let{frontmatter:n,body:r}=pK(e);return n+t+r}function a3(e){let t=r3(e).text;return pK(t).frontmatter===``?t:i3(t,`
|
|
@@ -457,4 +457,4 @@ $2`).split(`
|
|
|
457
457
|
`);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=$6(n.join(`
|
|
458
458
|
`))[Q6];return{identity:typeof i==`object`&&i&&!Array.isArray(i)?i:{},docFrontmatterText:t.slice(r).join(`
|
|
459
459
|
`).replace(/\n+$/,``)}}function r8(e){let t=e.charCodeAt(0)===65279?e.slice(1):e,{frontmatter:n,body:r}=pK(t);if(n===``)return{identity:{},starterContent:t};let i=hK(n),a=n8(i);if(a)return{identity:a.identity,starterContent:e8(a.docFrontmatterText,r)};let{frontmatter:o}=pK(r);if(o!==``)return{identity:$6(i),starterContent:r};let s=$6(i);return typeof s.title==`string`?{identity:s,starterContent:r}:{identity:{},starterContent:e8(i,r)}}function i8(e,t){let{docFrontmatterText:n,markdown:r}=t8(t),i={};for(let[t,n]of Object.entries(e))n!==void 0&&(i[t]=n);let a=(0,Fc.stringify)({[Q6]:i});return`---\n${n.trim()===``?a:`${a}${n}\n`}---\n${r}`}function a8(e){return r8(e).starterContent}function o8(){let e=!1,t=``,n=0;return r=>{let i=s8(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 s8(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 c8=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],l8={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`};function u8(e,t=c8){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}const d8={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function f8(e){return e?d8[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}const p8={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`};function m8(e){let t=e?.trim();return t?p8[f8(t)]??t:`Agent`}function h8(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 g8=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function _8(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function v8(e){let t=e.trim();return g8.test(t)||t.startsWith(`//`)}function y8(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(v8(n))return{kind:`external`,url:n};let r=h8(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=_8(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function b8(e,t){let n=e.trim();if(!n)return null;if(v8(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=_8(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function x8(e,t){let n=e.trim();if(!n||g8.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 S8(e){let t=e;return t.startsWith(`./`)&&(t=t.slice(2)),t.startsWith(`/`)&&(t=t.slice(1)),t}function C8(e){let t=e.lastIndexOf(`/`);return t===-1?e:e.slice(t+1)}function w8(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function T8(e){return e.split(`/`).filter(e=>e!==``)}function E8(e,t){let n=w8(t);return e===``||n===e?!0:n.startsWith(`${e}/`)}function D8(e,t){let n=w8(t);if(e===n)return 0;let r=e===``?n:n.slice(e.length+1);return r===``?0:T8(r).length}function O8(e,t){let n=T8(e),r=T8(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;return n.length-i+(r.length-i)}function k8(){let e=new Map;function t(t){let n=S8(t);if(n===``)return;let r=C8(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=S8(t),r=C8(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=w8(S8(n)),o=[],s=[];for(let e of i)E8(a,e)?o.push(e):s.push(e);return o.length>0?(e=>{let t=e[0],n=D8(a,t);for(let r=1;r<e.length;r++){let i=e[r],o=D8(a,i);(o<n||o===n&&i<t)&&(t=i,n=o)}return t})(o):(e=>{let t=e[0],n=O8(a,w8(t));for(let r=1;r<e.length;r++){let i=e[r],o=O8(a,w8(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 A8(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 j8(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}function M8(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function N8(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}const P8=/^[A-Za-z0-9-]{8,64}$/;let F8=null;function I8(e){return l(e??m(),`.ok`,`machine-id`)}function L8(e){if(e===void 0&&F8!==null)return F8;let t=I8(e),n=null;try{let e=b(t,`utf-8`).trim();P8.test(e)&&(n=e)}catch{}if(n===null){n=w();try{v(c(t),{recursive:!0}),S(t,`${n}\n`,{encoding:`utf-8`,mode:384})}catch(e){console.warn(`[machine-id] Failed to persist ${t} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${e instanceof Error?e.message:String(e)}`)}}return e===void 0&&(F8=n),n}function R8(){try{let e=u(c(f(import.meta.url)),`..`,`package.json`),t=JSON.parse(b(e,`utf-8`));if(typeof t.version==`string`&&t.version.length>0)return t.version}catch{}return`0.0.0-unknown`}const z8=R8(),B8=1;var V8=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running on port ${e.port} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function H8(e,t){return u(e,`${t}.lock`)}const U8=new Map;function W8(e){U8.set(e,(U8.get(e)??0)+1)}function G8(e){let t=U8.get(e);return t===void 0||t<=1?(U8.delete(e),!0):(U8.set(e,t-1),!1)}function K8(e){return typeof e.machineId==`string`?e.machineId===L8():e.hostname===h()}const q8=new Set;let J8=!1;function Y8(e){q8.add(e),!J8&&(J8=!0,process.on(`exit`,()=>{for(let e of q8)try{let t=JSON.parse(b(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==L8()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==h())continue;x(e)}catch{}}))}function X8(e,t){try{let n=JSON.parse(b(e,`utf-8`));return n&&typeof n==`object`&&N8(n.pid)?n:(console.warn(`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return console.warn(`${t} Corrupt lock file at ${e} — replacing`),null}}function Z8(e){let{lockName:t,lockDir:n,metadata:r}=e,i=`[${t}-lock]`;v(n,{recursive:!0});let a=H8(n,t),o={pid:process.pid,hostname:h(),port:r.port,startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,machineId:L8(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??1,runtimeVersion:r.runtimeVersion??z8},s=JSON.stringify(o,null,2);for(let e=0;e<3;e++){if(!_(a))try{let e=y(a,`wx`,384);try{C(e,s)}finally{g(e)}return W8(a),Y8(a),Q8({lockName:t,lockDir:n,lockPath:a})}catch(e){if(e.code!==`EEXIST`)throw e}let e=X8(a,i);if(e){if(K8(e)&&e.pid===process.pid)return S(a,s,{encoding:`utf-8`,mode:384}),W8(a),Y8(a),Q8({lockName:t,lockDir:n,lockPath:a});if(M8(e.pid))throw new V8(e,a,t);console.warn(`${i} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{x(a)}catch{}}throw Error(`${i} Failed to acquire ${a} after 3 attempts (concurrent acquire contention).`)}function Q8(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>i5({lockName:t,lockDir:n}),updatePort:e=>$8({lockName:t,lockDir:n,port:e})}}function $8(e){let{lockName:t,lockDir:n,port:r}=e,i=`[${t}-lock]`,a=H8(n,t);if(!_(a)){console.warn(`${i} Lock file missing at ${a} during port update — skipping`);return}let o;try{let e=JSON.parse(b(a,`utf-8`));if(!e||typeof e!=`object`||!N8(e.pid)){console.warn(`${i} Corrupt lock at ${a} during port update — skipping`);return}o=e}catch{console.warn(`${i} Unreadable lock at ${a} during port update — skipping`);return}if(o.pid===process.pid&&K8(o)){o.port=r;try{S(a,JSON.stringify(o,null,2),{encoding:`utf-8`,mode:384})}catch(e){console.warn(`${i} Failed to update port in ${a}: ${e instanceof Error?e.message:String(e)}`)}}}function e5(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=H8(n,t);if((U8.get(i)??0)>1)return;let a;try{let e=JSON.parse(b(i,`utf-8`));if(!e||typeof e!=`object`||!N8(e.pid)){console.warn(`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){e.code!==`ENOENT`&&console.warn(`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&K8(a)&&a.draining!==!0){a.draining=!0;try{S(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){console.warn(`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function t5(e){let{lockName:t,lockDir:n}=e,r=H8(n,t);if(!_(r))return null;let i;try{let e=JSON.parse(b(r,`utf-8`));if(!e||typeof e!=`object`||!N8(e.pid))return null;i=e}catch{return null}if(!K8(i))return null;if(!M8(i.pid)){try{x(r)}catch{}return null}return i}function n5(e){let{lockName:t,lockDir:n}=e,r=H8(n,t);if(!_(r))return{status:`absent`};let i;try{i=JSON.parse(b(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let a=i;if(!N8(a.pid)||typeof a.hostname!=`string`||typeof a.port!=`number`||typeof a.startedAt!=`string`||typeof a.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let o={pid:a.pid,hostname:a.hostname,port:a.port,startedAt:a.startedAt,worktreeRoot:a.worktreeRoot,machineId:typeof a.machineId==`string`?a.machineId:void 0,draining:a.draining===!0?!0:void 0,protocolVersion:typeof a.protocolVersion==`number`?a.protocolVersion:void 0,runtimeVersion:typeof a.runtimeVersion==`string`?a.runtimeVersion:void 0};if(!K8(o))return{status:`stale`,lock:o};if(!M8(o.pid)){try{x(r)}catch{}return{status:`stale`,lock:o}}return o.protocolVersion===void 0||o.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:o}}async function r5(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>t5({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function i5(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,i=`[${t}-lock]`,a=H8(n,t);if(G8(a)){if(r){e5({lockName:t,lockDir:n});return}if(_(a))try{let e=JSON.parse(b(a,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!K8(e))return;x(a),q8.delete(a)}catch(e){console.warn(`${i} Failed to release ${a}: ${e instanceof Error?e.message:String(e)}`)}}}var a5=class extends V8{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function o5(e,t){try{return Z8({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof V8&&e.lockName===`server`?new a5(e.existing,e.lockPath):e}}function s5(e,t){$8({lockName:`server`,lockDir:e,port:t})}function c5(e){return t5({lockName:`server`,lockDir:e})}function l5(e,t){i5({lockName:`server`,lockDir:e,...t})}function u5(e){e5({lockName:`server`,lockDir:e})}function d5(e,t){return r5({lockName:`server`,lockDir:e,...t})}export{hG as $,ou as $a,RG as $i,sJ as $n,X0 as $r,p0 as $t,h1 as A,sp as Aa,e6 as Ai,W6 as An,Ks as Ao,l2 as Ar,D2 as At,E1 as B,xl as Ba,Eq as Bi,d2 as Bn,fn as Bo,C2 as Br,t6 as Bt,w1 as C,j8 as Ca,G4 as Ci,K0 as Cn,j as Co,o4 as Cr,B0 as Ct,A1 as D,wq as Da,Z6 as Di,OG as Dn,ac as Do,j0 as Dr,Y1 as Dt,g1 as E,hK as Ea,a6 as Ei,Q0 as En,Pc as Eo,W2 as Er,KG as Et,V1 as F,Ol as Fa,_q as Fi,_G as Fn,Ka as Fo,i2 as Fr,u1 as Ft,O4 as G,lu as Ga,Gq as Gi,lJ as Gn,Dt as Go,M2 as Gr,QG as Gt,A4 as H,Kc as Ha,DG as Hi,h2 as Hn,gn as Ho,A2 as Hr,v2 as Ht,B1 as I,Zc as Ia,f8 as Ii,X1 as In,qa as Io,a2 as Ir,JG as It,C4 as J,Yc as Ja,N3 as Ji,Bq as Jn,ht as Jo,T0 as Jr,g0 as Jt,T4 as K,cu as Ka,BG as Ki,Mq as Kn,k as Ko,N2 as Kr,HG as Kt,nJ as L,Cl as La,a8 as Li,Z1 as Ln,si as Lo,Q6 as Lr,$1 as Lt,m1 as M,uu as Ma,X$ as Mi,y2 as Mn,Go as Mo,s2 as Mr,U1 as Mt,O1 as N,qc as Na,W$ as Ni,X3 as Nn,Uo as No,c2 as Nr,M1 as Nt,_1 as O,W4 as Oa,R6 as Oi,R2 as On,A as Oo,vJ as Or,P0 as Ot,dJ as P,su as Pa,GY as Pi,VG as Pn,ma as Po,r2 as Pr,N1 as Pt,vG as Q,Tl as Qa,o6 as Qi,oJ as Qn,Y0 as Qr,_J as Qt,t3 as R,wl as Ra,qq as Ri,f4 as Rn,br as Ro,V2 as Rr,e0 as Rt,WG as S,pK as Sa,P3 as Si,G0 as Sn,Zs as So,a4 as Sr,z0 as St,x0 as T,H$ as Ta,J3 as Ti,Z0 as Tn,dc as To,J2 as Tr,YG as Tt,k4 as U,Xc as Ua,eK as Ui,u2 as Un,cn as Uo,F2 as Ur,A0 as Ut,E4 as V,bl as Va,eJ as Vi,f2 as Vn,mn as Vo,P2 as Vr,g2 as Vt,D4 as W,pl as Wa,V3 as Wi,h4 as Wn,zt as Wo,I2 as Wr,i6 as Wt,x4 as X,Ml as Xa,B4 as Xi,Hq as Xn,w0 as Xr,m0 as Xt,S4 as Y,Jc as Ya,c3 as Yi,zq as Yn,mt as Yo,C0 as Yr,d0 as Yt,y4 as Z,zl as Za,FG as Zi,Wq as Zn,S0 as Zr,h0 as Zt,l5 as _,q3 as _a,o8 as _i,mG as _n,M as _o,b2 as _r,o0 as _t,Z8 as a,a1 as aa,F4 as ai,EG as an,ml as ao,U2 as ar,rJ as at,d5 as b,IG as ba,m6 as bi,uJ as bn,rc as bo,l4 as br,R1 as bt,M8 as c,J4 as ca,$q as ci,k0 as cn,Ll as co,i4 as cr,F1 as ct,e5 as d,x8 as da,gG as di,$G as dn,Ls as do,G2 as dr,F0 as dt,NG as ea,XG as ei,f0 as en,Zl as eo,Y2 as er,CG as et,u5 as f,X6 as fa,u8 as fi,r0 as fn,uc as fo,K2 as fr,I0 as ft,i5 as g,V4 as ga,k8 as gi,qG as gn,N as go,Y6 as gr,UG as gt,c5 as h,F6 as ha,B2 as hi,iK as hn,Ws as ho,L2 as hr,Y3 as ht,a5 as i,rK as ia,I4 as ii,TG as in,tu as io,e4 as ir,bG as it,k1 as j,L as ja,E$ as ji,K6 as jn,xs as jo,o2 as jr,O2 as jt,j1 as k,_b as ka,A8 as ki,U6 as kn,$s as ko,s0 as kr,E2 as kt,N8 as l,i3 as la,y8 as li,D0 as ln,Al as lo,X2 as lr,L0 as lt,n5 as m,jG as ma,i8 as mi,nK as mn,Hs as mo,d4 as mr,aK as mt,z8 as n,r8 as na,hJ as ni,u0 as nn,fl as no,t4 as nr,yG as nt,o5 as o,a3 as oa,$4 as oi,tK as on,El as oo,r4 as or,aJ as ot,t5 as p,h8 as pa,RJ as pi,F3 as pn,F as po,u4 as pr,ZG as pt,b4 as q,ru as qa,u3 as qi,Fq as qn,O as qo,j2 as qr,K1 as qt,B8 as r,mK as ra,t0 as ri,wG as rn,Dl as ro,$2 as rr,xG as rt,L8 as s,kG as sa,pJ as si,D$ as sn,Bl as so,v4 as sr,P1 as st,V8 as t,S2 as ta,gJ as ti,c0 as tn,Jl as to,n4 as tr,SG as tt,H8 as u,o1 as ua,b8 as ui,E0 as un,jl as uo,Z2 as ur,R0 as ut,$8 as v,xq as va,$Z as vi,U0 as vn,jc as vo,s4 as vr,q0 as vt,b0 as w,e3 as wa,m8 as wi,n0 as wn,P as wo,q2 as wr,GG as wt,l8 as x,r3 as xa,H3 as xi,mJ as xn,I as xo,x2 as xr,L1 as xt,s5 as y,Cq as ya,g6 as yi,V0 as yn,tc as yo,c4 as yr,J0 as yt,p3 as z,Sl as za,p1 as zi,g4 as zn,un as zo,T2 as zr,i0 as zt};
|
|
460
|
-
//# sourceMappingURL=server-lock-iLcBw_q0-
|
|
460
|
+
//# sourceMappingURL=server-lock-iLcBw_q0-CEih6ZHm.mjs.map
|