@nuasite/cms-studio 0.50.0 → 0.50.1

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.
@@ -54,7 +54,7 @@ var iE=t=>{throw TypeError(t)};var sE=(t,e,n)=>e.has(t)||iE("Cannot "+n);var nt=
54
54
  `:" ")+s.indentLines(s.containerFlow(r,u.current()),e?aI:tJ))),h(),c}}function tJ(t,e,n){return e===0?t:aI(t,e,n)}function aI(t,e,n){return(n?"":" ")+t}const nJ=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];oI.peek=oJ;function rJ(){return{canContainEols:["delete"],enter:{strikethrough:sJ},exit:{strikethrough:aJ}}}function iJ(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:nJ}],handlers:{delete:oI}}}function sJ(t){this.enter({type:"delete",children:[]},t)}function aJ(t){this.exit(t)}function oI(t,e,n,r){const i=n.createTracker(r),s=n.enter("strikethrough");let o=i.move("~~");return o+=n.containerPhrasing(t,{...i.current(),before:o,after:"~"}),o+=i.move("~~"),s(),o}function oJ(){return"~"}function lJ(t){return t.length}function uJ(t,e){const n=e||{},r=(n.align||[]).concat(),i=n.stringLength||lJ,s=[],o=[],u=[],c=[];let h=0,d=-1;for(;++d<t.length;){const E=[],N=[];let M=-1;for(t[d].length>h&&(h=t[d].length);++M<t[d].length;){const P=cJ(t[d][M]);if(n.alignDelimiters!==!1){const F=i(P);N[M]=F,(c[M]===void 0||F>c[M])&&(c[M]=F)}E.push(P)}o[d]=E,u[d]=N}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<h;)s[g]=UN(r[g]);else{const E=UN(r);for(;++g<h;)s[g]=E}g=-1;const y=[],b=[];for(;++g<h;){const E=s[g];let N="",M="";E===99?(N=":",M=":"):E===108?N=":":E===114&&(M=":");let P=n.alignDelimiters===!1?1:Math.max(1,c[g]-N.length-M.length);const F=N+"-".repeat(P)+M;n.alignDelimiters!==!1&&(P=N.length+P+M.length,P>c[g]&&(c[g]=P),b[g]=P),y[g]=F}o.splice(1,0,y),u.splice(1,0,b),d=-1;const k=[];for(;++d<o.length;){const E=o[d],N=u[d];g=-1;const M=[];for(;++g<h;){const P=E[g]||"";let F="",U="";if(n.alignDelimiters!==!1){const _=c[g]-(N[g]||0),C=s[g];C===114?F=" ".repeat(_):C===99?_%2?(F=" ".repeat(_/2+.5),U=" ".repeat(_/2-.5)):(F=" ".repeat(_/2),U=F):U=" ".repeat(_)}n.delimiterStart!==!1&&!g&&M.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&P==="")&&(n.delimiterStart!==!1||g)&&M.push(" "),n.alignDelimiters!==!1&&M.push(F),M.push(P),n.alignDelimiters!==!1&&M.push(U),n.padding!==!1&&M.push(" "),(n.delimiterEnd!==!1||g!==h-1)&&M.push("|")}k.push(n.delimiterEnd===!1?M.join("").replace(/ +$/,""):M.join(""))}return k.join(`
55
55
  `)}function cJ(t){return t==null?"":String(t)}function UN(t){const e=typeof t=="string"?t.codePointAt(0):0;return e===67||e===99?99:e===76||e===108?108:e===82||e===114?114:0}function fJ(){return{enter:{table:hJ,tableData:JN,tableHeader:JN,tableRow:dJ},exit:{codeText:mJ,table:pJ,tableData:ux,tableHeader:ux,tableRow:ux}}}function hJ(t){const e=t._align;this.enter({type:"table",align:e.map(function(n){return n==="none"?null:n}),children:[]},t),this.data.inTable=!0}function pJ(t){this.exit(t),this.data.inTable=void 0}function dJ(t){this.enter({type:"tableRow",children:[]},t)}function ux(t){this.exit(t)}function JN(t){this.enter({type:"tableCell",children:[]},t)}function mJ(t){let e=this.resume();this.data.inTable&&(e=e.replace(/\\([\\|])/g,gJ));const n=this.stack[this.stack.length-1];n.type,n.value=e,this.exit(t)}function gJ(t,e){return e==="|"?e:t}function yJ(t){const e=t||{},n=e.tableCellPadding,r=e.tablePipeAlign,i=e.stringLength,s=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
56
56
  `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:o,tableCell:c,tableRow:u}};function o(b,k,E,N){return h(d(b,E,N),b.align)}function u(b,k,E,N){const M=g(b,E,N),P=h([M]);return P.slice(0,P.indexOf(`
57
- `))}function c(b,k,E,N){const M=E.enter("tableCell"),P=E.enter("phrasing"),F=E.containerPhrasing(b,{...N,before:s,after:s});return P(),M(),F}function h(b,k){return uJ(b,{align:k,alignDelimiters:r,padding:n,stringLength:i})}function d(b,k,E){const N=b.children;let M=-1;const P=[],F=k.enter("table");for(;++M<N.length;)P[M]=g(N[M],k,E);return F(),P}function g(b,k,E){const N=b.children;let M=-1;const P=[],F=k.enter("tableRow");for(;++M<N.length;)P[M]=c(N[M],b,k,E);return F(),P}function y(b,k,E){let N=xS.inlineCode(b,k,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function xJ(){return{exit:{taskListCheckValueChecked:qN,taskListCheckValueUnchecked:qN,paragraph:SJ}}}function bJ(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:vJ}}}function qN(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function SJ(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,o;for(;++s<i.length;){const u=i[s];if(u.type==="paragraph"){o=u;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function vJ(t,e,n,r){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",o="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);s&&u.move(o);let c=xS.listItem(t,e,n,{...r,...u.current()});return s&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(d){return d+o}}function kJ(){return[DU(),ZU(),rJ(),fJ(),xJ()]}function CJ(t){return{extensions:[IU(),eJ(t),iJ(),yJ(t),bJ()]}}const wJ={tokenize:OJ,partial:!0},lI={tokenize:RJ,partial:!0},uI={tokenize:DJ,partial:!0},cI={tokenize:IJ,partial:!0},EJ={tokenize:_J,partial:!0},fI={name:"wwwAutolink",tokenize:TJ,previous:pI},hI={name:"protocolAutolink",tokenize:MJ,previous:dI},qs={name:"emailAutolink",tokenize:NJ,previous:mI},Wi={};function AJ(){return{text:Wi}}let Eo=48;for(;Eo<123;)Wi[Eo]=qs,Eo++,Eo===58?Eo=65:Eo===91&&(Eo=97);Wi[43]=qs;Wi[45]=qs;Wi[46]=qs;Wi[95]=qs;Wi[72]=[qs,hI];Wi[104]=[qs,hI];Wi[87]=[qs,fI];Wi[119]=[qs,fI];function NJ(t,e,n){const r=this;let i,s;return o;function o(g){return!rS(g)||!mI.call(r,r.previous)||ik(r.events)?n(g):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(g))}function u(g){return rS(g)?(t.consume(g),u):g===64?(t.consume(g),c):n(g)}function c(g){return g===46?t.check(EJ,d,h)(g):g===45||g===95||Cn(g)?(s=!0,t.consume(g),c):d(g)}function h(g){return t.consume(g),i=!0,c}function d(g){return s&&i&&sn(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(g)):n(g)}}function TJ(t,e,n){const r=this;return i;function i(o){return o!==87&&o!==119||!pI.call(r,r.previous)||ik(r.events)?n(o):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(wJ,t.attempt(lI,t.attempt(uI,s),n),n)(o))}function s(o){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(o)}}function MJ(t,e,n){const r=this;let i="",s=!1;return o;function o(g){return(g===72||g===104)&&dI.call(r,r.previous)&&!ik(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(g),t.consume(g),u):n(g)}function u(g){if(sn(g)&&i.length<5)return i+=String.fromCodePoint(g),t.consume(g),u;if(g===58){const y=i.toLowerCase();if(y==="http"||y==="https")return t.consume(g),c}return n(g)}function c(g){return g===47?(t.consume(g),s?h:(s=!0,c)):n(g)}function h(g){return g===null||Cm(g)||et(g)||Pn(g)||vg(g)?n(g):t.attempt(lI,t.attempt(uI,d),n)(g)}function d(g){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(g)}}function OJ(t,e,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,t.consume(o),i):o===46&&r===3?(t.consume(o),s):n(o)}function s(o){return o===null?n(o):e(o)}}function RJ(t,e,n){let r,i,s;return o;function o(h){return h===46||h===95?t.check(cI,c,u)(h):h===null||et(h)||Pn(h)||h!==45&&vg(h)?c(h):(s=!0,t.consume(h),o)}function u(h){return h===95?r=!0:(i=r,r=void 0),t.consume(h),o}function c(h){return i||r||!s?n(h):e(h)}}function DJ(t,e){let n=0,r=0;return i;function i(o){return o===40?(n++,t.consume(o),i):o===41&&r<n?s(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?t.check(cI,e,s)(o):o===null||et(o)||Pn(o)?e(o):(t.consume(o),i)}function s(o){return o===41&&r++,t.consume(o),i}}function IJ(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),s):u===93?(t.consume(u),i):u===60||u===null||et(u)||Pn(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||et(u)||Pn(u)?e(u):r(u)}function s(u){return sn(u)?o(u):n(u)}function o(u){return u===59?(t.consume(u),r):sn(u)?(t.consume(u),o):n(u)}}function _J(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return Cn(s)?n(s):e(s)}}function pI(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||et(t)}function dI(t){return!sn(t)}function mI(t){return!(t===47||rS(t))}function rS(t){return t===43||t===45||t===46||t===95||Cn(t)}function ik(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const zJ={tokenize:UJ,partial:!0};function LJ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:PJ,continuation:{tokenize:jJ},exit:$J}},text:{91:{name:"gfmFootnoteCall",tokenize:FJ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:BJ,resolveTo:VJ}}}}function BJ(t,e,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return u;function u(c){if(!o||!o._balanced)return n(c);const h=Ei(r.sliceSerialize({start:o.end,end:r.now()}));return h.codePointAt(0)!==94||!s.includes(h.slice(1))?n(c):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),e(c))}}function VJ(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",o,e],["exit",o,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function FJ(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return u;function u(g){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),c}function c(g){return g!==94?n(g):(t.enter("gfmFootnoteCallMarker"),t.consume(g),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",h)}function h(g){if(s>999||g===93&&!o||g===null||g===91||et(g))return n(g);if(g===93){t.exit("chunkString");const y=t.exit("gfmFootnoteCallString");return i.includes(Ei(r.sliceSerialize(y)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(g)}return et(g)||(o=!0),s++,t.consume(g),g===92?d:h}function d(g){return g===91||g===92||g===93?(t.consume(g),s++,h):h(g)}}function PJ(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,u;return c;function c(k){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(k)}function d(k){if(o>999||k===93&&!u||k===null||k===91||et(k))return n(k);if(k===93){t.exit("chunkString");const E=t.exit("gfmFootnoteDefinitionLabelString");return s=Ei(r.sliceSerialize(E)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),y}return et(k)||(u=!0),o++,t.consume(k),k===92?g:d}function g(k){return k===91||k===92||k===93?(t.consume(k),o++,d):d(k)}function y(k){return k===58?(t.enter("definitionMarker"),t.consume(k),t.exit("definitionMarker"),i.includes(s)||i.push(s),Ge(t,b,"gfmFootnoteDefinitionWhitespace")):n(k)}function b(k){return e(k)}}function jJ(t,e,n){return t.check(ju,e,t.attempt(zJ,e,n))}function $J(t){t.exit("gfmFootnoteDefinition")}function UJ(t,e,n){const r=this;return Ge(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?e(s):n(s)}}function JJ(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,u){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let h=c;for(;h--;)if(o[h][0]==="exit"&&o[h][1].type==="strikethroughSequenceTemporary"&&o[h][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[h][1].end.offset-o[h][1].start.offset){o[c][1].type="strikethroughSequence",o[h][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[h][1].start),end:Object.assign({},o[c][1].end)},g={type:"strikethroughText",start:Object.assign({},o[h][1].end),end:Object.assign({},o[c][1].start)},y=[["enter",d,u],["enter",o[h][1],u],["exit",o[h][1],u],["enter",g,u]],b=u.parser.constructs.insideSpan.null;b&&Nr(y,y.length,0,kg(b,o.slice(h+1,c),u)),Nr(y,y.length,0,[["exit",g,u],["enter",o[c][1],u],["exit",o[c][1],u],["exit",d,u]]),Nr(o,h-1,c-h+3,y),c=h+y.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function s(o,u,c){const h=this.previous,d=this.events;let g=0;return y;function y(k){return h===126&&d[d.length-1][1].type!=="characterEscape"?c(k):(o.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const E=Iu(h);if(k===126)return g>1?c(k):(o.consume(k),g++,b);if(g<2&&!n)return c(k);const N=o.exit("strikethroughSequenceTemporary"),M=Iu(k);return N._open=!M||M===2&&!!E,N._close=!E||E===2&&!!M,u(k)}}}class qJ{constructor(){this.map=[]}add(e,n,r){HJ(this,e,n,r)}consume(e){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function HJ(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function KJ(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function GJ(){return{flow:{null:{name:"table",tokenize:YJ,resolveAll:WJ}}}}function YJ(t,e,n){const r=this;let i=0,s=0,o;return u;function u(K){let de=r.events.length-1;for(;de>-1;){const _e=r.events[de][1].type;if(_e==="lineEnding"||_e==="linePrefix")de--;else break}const ce=de>-1?r.events[de][1].type:null,ve=ce==="tableHead"||ce==="tableRow"?C:c;return ve===C&&r.parser.lazy[r.now().line]?n(K):ve(K)}function c(K){return t.enter("tableHead"),t.enter("tableRow"),h(K)}function h(K){return K===124||(o=!0,s+=1),d(K)}function d(K){return K===null?n(K):Ee(K)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(K),t.exit("lineEnding"),b):n(K):Ke(K)?Ge(t,d,"whitespace")(K):(s+=1,o&&(o=!1,i+=1),K===124?(t.enter("tableCellDivider"),t.consume(K),t.exit("tableCellDivider"),o=!0,d):(t.enter("data"),g(K)))}function g(K){return K===null||K===124||et(K)?(t.exit("data"),d(K)):(t.consume(K),K===92?y:g)}function y(K){return K===92||K===124?(t.consume(K),g):g(K)}function b(K){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(K):(t.enter("tableDelimiterRow"),o=!1,Ke(K)?Ge(t,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):k(K))}function k(K){return K===45||K===58?N(K):K===124?(o=!0,t.enter("tableCellDivider"),t.consume(K),t.exit("tableCellDivider"),E):_(K)}function E(K){return Ke(K)?Ge(t,N,"whitespace")(K):N(K)}function N(K){return K===58?(s+=1,o=!0,t.enter("tableDelimiterMarker"),t.consume(K),t.exit("tableDelimiterMarker"),M):K===45?(s+=1,M(K)):K===null||Ee(K)?U(K):_(K)}function M(K){return K===45?(t.enter("tableDelimiterFiller"),P(K)):_(K)}function P(K){return K===45?(t.consume(K),P):K===58?(o=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(K),t.exit("tableDelimiterMarker"),F):(t.exit("tableDelimiterFiller"),F(K))}function F(K){return Ke(K)?Ge(t,U,"whitespace")(K):U(K)}function U(K){return K===124?k(K):K===null||Ee(K)?!o||i!==s?_(K):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(K)):_(K)}function _(K){return n(K)}function C(K){return t.enter("tableRow"),z(K)}function z(K){return K===124?(t.enter("tableCellDivider"),t.consume(K),t.exit("tableCellDivider"),z):K===null||Ee(K)?(t.exit("tableRow"),e(K)):Ke(K)?Ge(t,z,"whitespace")(K):(t.enter("data"),G(K))}function G(K){return K===null||K===124||et(K)?(t.exit("data"),z(K)):(t.consume(K),K===92?J:G)}function J(K){return K===92||K===124?(t.consume(K),G):G(K)}}function WJ(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],u=!1,c=0,h,d,g;const y=new qJ;for(;++n<t.length;){const b=t[n],k=b[1];b[0]==="enter"?k.type==="tableHead"?(u=!1,c!==0&&(HN(y,e,c,h,d),d=void 0,c=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",h,e]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,g=void 0,s=[0,0,0,0],o=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",d,e]])),i=k.type==="tableDelimiterRow"?2:d?3:1):i&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],g=Vd(y,e,s,i,void 0,g),s=[0,0,0,0]),o[2]=n)):k.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],g=Vd(y,e,s,i,void 0,g)),s=o,o=[s[1],n,0,0])):k.type==="tableHead"?(u=!0,c=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(c=n,s[1]!==0?(o[0]=o[1],g=Vd(y,e,s,i,n,g)):o[1]!==0&&(g=Vd(y,e,o,i,n,g)),i=0):i&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&HN(y,e,c,h,d),y.consume(e.events),n=-1;++n<e.events.length;){const b=e.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=KJ(e.events,n))}return t}function Vd(t,e,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(s.end=Object.assign({},Au(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const c=Au(e.events,n[1]);if(s={type:o,start:Object.assign({},c),end:Object.assign({},c)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const h=Au(e.events,n[2]),d=Au(e.events,n[3]),g={type:u,start:Object.assign({},h),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",g,e]]),r!==2){const y=e.events[n[2]],b=e.events[n[3]];if(y[1].end=Object.assign({},b[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,E=n[3]-n[2]-1;t.add(k,E,[])}}t.add(n[3]+1,0,[["exit",g,e]])}return i!==void 0&&(s.end=Object.assign({},Au(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function HN(t,e,n,r,i){const s=[],o=Au(e.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,e])),r.end=Object.assign({},o),s.push(["exit",r,e]),t.add(n+1,0,s)}function Au(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const QJ={name:"tasklistCheck",tokenize:ZJ};function XJ(){return{text:{91:QJ}}}function ZJ(t,e,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),s)}function s(c){return et(c)?(t.enter("taskListCheckValueUnchecked"),t.consume(c),t.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(t.enter("taskListCheckValueChecked"),t.consume(c),t.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(c)}function u(c){return Ee(c)?e(c):Ke(c)?t.check({tokenize:eq},e,n)(c):n(c)}}function eq(t,e,n){return Ge(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function tq(t){return dS([AJ(),LJ(),JJ(t),GJ(),XJ()])}const nq={};function rq(t){const e=this,n=t||nq,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(tq(n)),s.push(kJ()),o.push(CJ(n))}function je(t,e){return Object.assign(t,{meta:{package:"@milkdown/preset-gfm",...e}}),t}var sk=Xh("strike_through");je(sk,{displayName:"Attr<strikethrough>",group:"Strikethrough"});var up=qu("strike_through",t=>({parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:e=>e==="line-through"}],toDOM:e=>["del",t.get(sk.key)(e)],parseMarkdown:{match:e=>e.type==="delete",runner:(e,n,r)=>{e.openMark(r),e.next(n.children),e.closeMark(r)}},toMarkdown:{match:e=>e.type.name==="strike_through",runner:(e,n)=>{e.withMark(n,"delete")}}}));je(up.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"});je(up.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});var Kg=qe("ToggleStrikeThrough",t=>()=>Ng(up.type(t)));je(Kg,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});var gI=mr(t=>Gh(new RegExp("(?<![\\w:/])(~{1,2})(.+?)\\1(?!\\w|\\/)"),up.type(t)));je(gI,{displayName:"InputRule<strikethrough>",group:"Strikethrough"});var ak=Rr("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:t=>{const e=t.get(vt);return()=>e.call(Kg.key)}}});je(ak.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"});je(ak.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});var cp=Dj({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:t=>t.style.textAlign||"left",setDOMAttr:(t,e)=>{e.style=`text-align: ${t||"left"}`}}}}),_s=en("table",()=>({...cp.table,content:"table_header_row table_row+",disableDropCursor:!0,parseMarkdown:{match:t=>t.type==="table",runner:(t,e,n)=>{const r=e.align,i=e.children.map((s,o)=>({...s,align:r,isHeader:o===0}));t.openNode(n),t.next(i),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table",runner:(t,e)=>{const n=e.content.firstChild?.content;if(!n)return;const r=[];n.forEach(i=>{r.push(i.attrs.alignment)}),t.openNode("table",void 0,{align:r}),t.next(e.content),t.closeNode()}}}));je(_s.node,{displayName:"NodeSchema<table>",group:"Table"});je(_s.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});var fp=en("table_header_row",()=>({...cp.table_row,disableDropCursor:!0,content:"(table_header)*",parseDOM:[{tag:"tr[data-is-header]"},{tag:"tr",getAttrs:t=>t instanceof HTMLElement&&t.querySelector("th")?{}:!1}],toDOM(){return["tr",{"data-is-header":!0},0]},parseMarkdown:{match:t=>!!(t.type==="tableRow"&&t.isHeader),runner:(t,e,n)=>{const r=e.align,i=e.children.map((s,o)=>({...s,align:r[o],isHeader:e.isHeader}));t.openNode(n),t.next(i),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table_header_row",runner:(t,e)=>{e.content.size!==0&&(t.openNode("tableRow",void 0,{isHeader:!0}),t.next(e.content),t.closeNode())}}}));je(fp.node,{displayName:"NodeSchema<tableHeaderRow>",group:"Table"});je(fp.ctx,{displayName:"NodeSchemaCtx<tableHeaderRow>",group:"Table"});var Yu=en("table_row",()=>({...cp.table_row,disableDropCursor:!0,content:"(table_cell)*",parseMarkdown:{match:t=>t.type==="tableRow",runner:(t,e,n)=>{const r=e.align,i=e.children.map((s,o)=>({...s,align:r[o]}));t.openNode(n),t.next(i),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table_row",runner:(t,e)=>{e.content.size!==0&&(t.openNode("tableRow"),t.next(e.content),t.closeNode())}}}));je(Yu.node,{displayName:"NodeSchema<tableRow>",group:"Table"});je(Yu.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});var hp=en("table_cell",()=>({...cp.table_cell,disableDropCursor:!0,parseMarkdown:{match:t=>t.type==="tableCell"&&!t.isHeader,runner:(t,e,n)=>{const r=e.align;t.openNode(n,{alignment:r}).openNode(t.schema.nodes.paragraph).next(e.children).closeNode().closeNode()}},toMarkdown:{match:t=>t.type.name==="table_cell",runner:(t,e)=>{t.openNode("tableCell").next(e.content).closeNode()}}}));je(hp.node,{displayName:"NodeSchema<tableCell>",group:"Table"});je(hp.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});var Pu=en("table_header",()=>({...cp.table_header,disableDropCursor:!0,parseMarkdown:{match:t=>t.type==="tableCell"&&!!t.isHeader,runner:(t,e,n)=>{const r=e.align;t.openNode(n,{alignment:r}),t.openNode(t.schema.nodes.paragraph),t.next(e.children),t.closeNode(),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table_header",runner:(t,e)=>{t.openNode("tableCell"),t.next(e.content),t.closeNode()}}}));je(Pu.node,{displayName:"NodeSchema<tableHeader>",group:"Table"});je(Pu.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});function yI(t,e=3,n=3){const r=Array(n).fill(0).map(()=>hp.type(t).createAndFill()),i=Array(n).fill(0).map(()=>Pu.type(t).createAndFill()),s=Array(e).fill(0).map((o,u)=>u===0?fp.type(t).create(null,i):Yu.type(t).create(null,r));return _s.type(t).create(null,s)}function xI(t){return(e,n)=>r=>{n=n??r.selection.from;const i=r.doc.resolve(n),s=t7(c=>c.type.name==="table")(i),o=s?{node:s.node,from:s.start}:void 0,u=t==="row";if(o){const c=kt.get(o.node);if(e>=0&&e<(u?c.height:c.width)){const h=c.positionAt(u?e:c.height-1,u?c.width-1:e,o.node),d=r.doc.resolve(o.from+h),g=u?It.rowSelection:It.colSelection,y=c.positionAt(u?e:0,u?0:e,o.node),b=r.doc.resolve(o.from+y);return DO(r.setSelection(g(d,b)))}}return r}}var iq=xI("row"),sq=xI("col");function bI(t,e,{map:n,tableStart:r,table:i},s){const o=Array(s).fill(0).reduce((c,h,d)=>c+i.child(d).nodeSize,r),u=Array(n.width).fill(0).map((c,h)=>{const d=i.nodeAt(n.map[h]);return hp.type(t).createAndFill({alignment:d?.attrs.alignment})});return e.insert(o,Yu.type(t).create(null,u)),e}function aq(t){const e=ap(t.$from);if(!e)return;const n=kt.get(e.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(r=>{const i=e.node.nodeAt(r),s=r+e.start;return{pos:s,start:s+1,node:i}})}function oq(t){const e=aq(t.selection);if(e&&e[0]){const n=t.doc.resolve(e[0].pos),r=e[e.length-1];if(r){const i=t.doc.resolve(r.pos);return DO(t.setSelection(new It(i,n)))}}return t}var ok=qe("GoToPrevTableCell",()=>()=>wD(-1));je(ok,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});var lk=qe("GoToNextTableCell",()=>()=>wD(1));je(lk,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});var uk=qe("ExitTable",t=>()=>(e,n)=>{if(!ui(e))return!1;const{$head:r}=e.selection,i=e7(r,_s.type(t));if(!i)return!1;const{to:s}=i,o=e.tr.replaceWith(s,s,Ui.type(t).createAndFill());return o.setSelection(Pe.near(o.doc.resolve(s),1)).scrollIntoView(),n?.(o),!0});je(uk,{displayName:"Command<breakTableCommand>",group:"Table"});var ck=qe("InsertTable",t=>({row:e,col:n}={})=>(r,i)=>{const{selection:s,tr:o}=r,{from:u}=s,c=yI(t,e,n),h=o.replaceSelectionWith(c),d=Pe.findFrom(h.doc.resolve(u),1,!0);return d&&h.setSelection(d),i?.(h),!0});je(ck,{displayName:"Command<insertTableCommand>",group:"Table"});var SI=qe("MoveRow",()=>({from:t,to:e,pos:n}={})=>a$({from:t??0,to:e??0,pos:n}));je(SI,{displayName:"Command<moveRowCommand>",group:"Table"});var vI=qe("MoveCol",()=>({from:t,to:e,pos:n}={})=>o$({from:t??0,to:e??0,pos:n}));je(vI,{displayName:"Command<moveColCommand>",group:"Table"});var kI=qe("SelectRow",()=>(t={index:0})=>(e,n)=>{const{tr:r}=e;return!!n?.(iq(t.index,t.pos)(r))});je(kI,{displayName:"Command<selectRowCommand>",group:"Table"});var CI=qe("SelectCol",()=>(t={index:0})=>(e,n)=>{const{tr:r}=e;return!!n?.(sq(t.index,t.pos)(r))});je(CI,{displayName:"Command<selectColCommand>",group:"Table"});var wI=qe("SelectTable",()=>()=>(t,e)=>{const{tr:n}=t;return!!e?.(oq(n))});je(wI,{displayName:"Command<selectTableCommand>",group:"Table"});var EI=qe("DeleteSelectedCells",()=>()=>(t,e)=>{const{selection:n}=t;if(!(n instanceof It))return!1;const r=n.isRowSelection(),i=n.isColSelection();return r&&i?s$(t,e):i?Zj(t,e):t$(t,e)});je(EI,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});var AI=qe("AddColBefore",()=>()=>Wj);je(AI,{displayName:"Command<addColBeforeCommand>",group:"Table"});var NI=qe("AddColAfter",()=>()=>Qj);je(NI,{displayName:"Command<addColAfterCommand>",group:"Table"});var TI=qe("AddRowBefore",t=>()=>(e,n)=>{if(!ui(e))return!1;if(n){const r=to(e);n(bI(t,e.tr,r,r.top))}return!0});je(TI,{displayName:"Command<addRowBeforeCommand>",group:"Table"});var MI=qe("AddRowAfter",t=>()=>(e,n)=>{if(!ui(e))return!1;if(n){const r=to(e);n(bI(t,e.tr,r,r.bottom))}return!0});je(MI,{displayName:"Command<addRowAfterCommand>",group:"Table"});var OI=qe("SetAlign",()=>(t="left")=>n$("alignment",t));je(OI,{displayName:"Command<setAlignCommand>",group:"Table"});var RI=mr(t=>new Or(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(e,n,r,i)=>{const s=e.doc.resolve(r);if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),_s.type(t)))return null;const o=yI(t,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),u=e.tr.replaceRangeWith(r,i,o);return u.setSelection(Me.create(u.doc,r+3)).scrollIntoView()}));je(RI,{displayName:"InputRule<insertTableInputRule>",group:"Table"});var DI=gF(t=>({run:(e,n,r)=>{if(r)return e;function i(h){const d=h.childCount,g=h.lastChild?.childCount??0;if(d===0||g===0)return Ui.type(t).create();const y=h.firstChild;if(!(g>0&&y&&y.childCount===0))return h;if(d>=3){const N=h.child(1),M=[];for(let U=0;U<N.childCount;U++){const _=N.child(U);M.push(Pu.type(t).create(_.attrs,_.content,_.marks))}const P=y.type.create(y.attrs,M),F=[];for(let U=2;U<d;U++)F.push(h.child(U));return h.type.create(h.attrs,[P,...F])}const b=Array(g).fill(0).map(()=>Pu.type(t).createAndFill()),k=new H(W.from(b),0,0),E=y.replace(0,0,k);return h.replace(0,y.nodeSize,new H(W.from(E),0,0))}function s(h){const d=Yu.type(t),g=[];let y=[],b=!1;function k(){if(y.length===0)return;const E=fp.type(t).createAndFill(),N=_s.type(t).create(null,[E,...y]);g.push(i(N)),y=[]}return h.forEach(E=>{E.type===d?(b=!0,y.push(E)):(k(),g.push(E))}),k(),b?W.from(g):h}function o(h){let d=s(h),g=d!==h;const y=[];return d.forEach(b=>{if(b.type===_s.type(t)){const k=i(b);k!==b&&(g=!0),y.push(k)}else if(b.childCount>0){const k=o(b.content);k!==b.content?(g=!0,y.push(b.copy(k))):y.push(b)}else y.push(b)}),g?W.from(y):h}function u(h){const d=[],g=[];h.forEach(y=>g.push(y));for(let y=0;y<g.length;y++){const b=g[y],k=g[y+1];b.type===Ui.type(t)&&b.content.size===0&&k&&k.type===_s.type(t)||d.push(b)}return d.length<g.length?W.from(d):h}let c=o(e.content);return c=u(c),new H(W.from(c),e.openStart,e.openEnd)}}));je(DI,{displayName:"PasteRule<table>",group:"Table"});var fk=Rr("tableKeymap",{NextCell:{priority:100,shortcuts:["Mod-]","Tab"],command:t=>{const e=t.get(vt);return()=>e.call(lk.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:t=>{const e=t.get(vt);return()=>e.call(ok.key)}},ExitTable:{shortcuts:["Mod-Enter","Enter"],command:t=>{const e=t.get(vt);return()=>e.call(uk.key)}}});je(fk.ctx,{displayName:"KeymapCtx<table>",group:"Table"});je(fk.shortcuts,{displayName:"Keymap<table>",group:"Table"});var cx="footnote_definition",KN="footnoteDefinition",hk=en("footnote_definition",()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`dl[data-type="${cx}"]`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw Ki(t);return{label:t.dataset.label}},contentElement:"dd"}],toDOM:t=>{const e=t.attrs.label;return["dl",{"data-label":e,"data-type":cx},["dt",e],["dd",0]]},parseMarkdown:{match:({type:t})=>t===KN,runner:(t,e,n)=>{t.openNode(n,{label:e.label}).next(e.children).closeNode()}},toMarkdown:{match:t=>t.type.name===cx,runner:(t,e)=>{t.openNode(KN,void 0,{label:e.attrs.label,identifier:e.attrs.label}).next(e.content).closeNode()}}}));je(hk.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"});je(hk.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});var fx="footnote_reference",pk=en("footnote_reference",()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`sup[data-type="${fx}"]`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw Ki(t);return{label:t.dataset.label}}}],toDOM:t=>{const e=t.attrs.label;return["sup",{"data-label":e,"data-type":fx},e]},parseMarkdown:{match:({type:t})=>t==="footnoteReference",runner:(t,e,n)=>{t.addNode(n,{label:e.label})}},toMarkdown:{match:t=>t.type.name===fx,runner:(t,e)=>{t.addNode("footnoteReference",void 0,void 0,{label:e.attrs.label,identifier:e.attrs.label})}}}));je(pk.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"});je(pk.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});var dk=$s.extendSchema(t=>e=>{const n=t(e);return{...n,attrs:{...n.attrs,checked:{default:null,validate:"boolean|null"}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:r=>{if(!(r instanceof HTMLElement))throw Ki(r);return{label:r.dataset.label,listType:r.dataset.listType,spread:r.dataset.spread,checked:r.dataset.checked?r.dataset.checked==="true":null}}},...n?.parseDOM||[]],toDOM:r=>n.toDOM&&r.attrs.checked==null?n.toDOM(r):["li",{"data-item-type":"task","data-label":r.attrs.label,"data-list-type":r.attrs.listType,"data-spread":r.attrs.spread,"data-checked":r.attrs.checked},0],parseMarkdown:{match:({type:r})=>r==="listItem",runner:(r,i,s)=>{if(i.checked==null){n.parseMarkdown.runner(r,i,s);return}const o=i.label!=null?`${i.label}.`:"•",u=i.checked!=null?!!i.checked:null,c=i.label!=null?"ordered":"bullet",h=i.spread!=null?`${i.spread}`:"true";r.openNode(s,{label:o,listType:c,spread:h,checked:u}),r.next(i.children),r.closeNode()}},toMarkdown:{match:r=>r.type.name==="list_item",runner:(r,i)=>{if(i.attrs.checked==null){n.toMarkdown.runner(r,i);return}const s=i.attrs.label,o=i.attrs.listType,u=i.attrs.spread==="true",c=i.attrs.checked;r.openNode("listItem",void 0,{label:s,listType:o,spread:u,checked:c}),r.next(i.content),r.closeNode()}}}});je(dk.node,{displayName:"NodeSchema<taskListItem>",group:"ListItem"});je(dk.ctx,{displayName:"NodeSchemaCtx<taskListItem>",group:"ListItem"});var II=mr(()=>new Or(/^\[(?<checked>\s|x)\]\s$/,(t,e,n,r)=>{const i=t.doc.resolve(n);let s=0,o=i.node(s);for(;o&&o.type.name!=="list_item";)s--,o=i.node(s);if(!o||o.attrs.checked!=null)return null;const u=e.groups?.checked==="x",c=i.before(s),h=t.tr;return h.deleteRange(n,r).setNodeMarkup(c,void 0,{...o.attrs,checked:u}),h}));je(II,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});var lq=[ak,fk].flat(),uq=[RI,II],cq=[gI],fq=[DI],_I=js(()=>AU);je(_I,{displayName:"Prose<autoInsertSpanPlugin>",group:"Prose"});var hq=js(()=>y$({}));je(hq,{displayName:"Prose<columnResizingPlugin>",group:"Prose"});var zI=js(()=>N$({allowTableNodeSelection:!0}));je(zI,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});var mk=Ti("remarkGFM",()=>rq);je(mk.plugin,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"});je(mk.options,{displayName:"RemarkConfig<remarkGFMPlugin>",group:"Remark"});var pq=new dr("MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN");function dq(t,e){let n=0;return e.forEach((r,i,s)=>{r===t&&(n=s)}),n}var LI=js(()=>new pr({key:pq,appendTransaction:(t,e,n)=>{let r;const i=(s,o)=>{if(r||(r=n.tr),s.type.name!=="table_cell")return;const u=n.doc.resolve(o),c=u.node(u.depth),h=u.node(u.depth-1).firstChild;if(!h)return;const d=dq(s,c),g=h.maybeChild(d);if(!g)return;const y=g.attrs.alignment;y!==s.attrs.alignment&&r.setNodeMarkup(o,void 0,{...s.attrs,alignment:y})};return e.doc!==n.doc&&n.doc.descendants(i),r}}));je(LI,{displayName:"Prose<keepTableAlignPlugin>",group:"Prose"});var mq=[LI,_I,mk,zI].flat(),gq=[dk,_s,fp,Yu,Pu,hp,hk,pk,sk,up].flat(),yq=[lk,ok,uk,ck,SI,vI,kI,CI,wI,EI,TI,MI,AI,NI,OI,Kg],BI=[gq,uq,fq,cq,lq,yq,mq].flat();const gk={display:"flex",gap:6,alignItems:"center",padding:6,border:"1px solid #d4d4d8",borderRadius:6,background:"#fff",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",marginTop:6},eg={flex:1,border:"1px solid #d4d4d8",borderRadius:4,padding:"4px 8px",font:"inherit",outline:"none",minWidth:0},_h={border:"1px solid #d4d4d8",background:"#fff",borderRadius:4,padding:"4px 8px",font:"inherit",fontSize:12,cursor:"pointer",color:"#3f3f46",whiteSpace:"nowrap"},xq=gk,bq=eg,hx=_h;function Sq({initialUrl:t,isEdit:e,onApply:n,onRemove:r,onClose:i}){const[s,o]=ae.useState(t),u=()=>{const c=s.trim();c!==""&&n(c)};return D.jsxs("div",{style:xq,"data-mdx-action":"link",onMouseDown:c=>c.stopPropagation(),children:[D.jsx("input",{style:bq,autoFocus:!0,placeholder:"https://…",value:s,onChange:c=>o(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),u()),c.key==="Escape"&&i()}}),D.jsx("button",{type:"button",style:{...hx,background:"#2563eb",borderColor:"#2563eb",color:"#fff"},onMouseDown:c=>c.preventDefault(),onClick:u,children:e?"Update":"Add"}),e&&r?D.jsx("button",{type:"button",style:{...hx,color:"#dc2626"},onMouseDown:c=>c.preventDefault(),onClick:r,children:"Remove"}):null,D.jsx("button",{type:"button",style:hx,onMouseDown:c=>c.preventDefault(),onClick:i,children:"Cancel"})]})}const vq={...gk,flexWrap:"wrap"},GN={fontSize:11,color:"#71717a",whiteSpace:"nowrap"};function kq({initialAlt:t,onApply:e,onClose:n}){const[r,i]=ae.useState(t),[s,o]=ae.useState(""),u=()=>e(r.trim(),s.trim()),c=h=>{h.key==="Enter"&&(h.preventDefault(),u()),h.key==="Escape"&&n()};return D.jsxs("div",{style:vq,"data-mdx-action":"image",onMouseDown:h=>h.stopPropagation(),children:[D.jsx("span",{style:GN,children:"Alt"}),D.jsx("input",{style:eg,autoFocus:!0,placeholder:"Alt text for screen readers",value:r,onChange:h=>i(h.currentTarget.value),onKeyDown:c}),D.jsx("span",{style:GN,children:"Caption"}),D.jsx("input",{style:eg,placeholder:"Caption / source (optional)",value:s,onChange:h=>o(h.currentTarget.value),onKeyDown:c}),D.jsx("button",{type:"button",style:{..._h,background:"#2563eb",borderColor:"#2563eb",color:"#fff"},onMouseDown:h=>h.preventDefault(),onClick:u,children:"Insert"}),D.jsx("button",{type:"button",style:_h,onMouseDown:h=>h.preventDefault(),onClick:n,children:"Cancel"})]})}function YN(t){return typeof t!="object"||t===null?!1:"status"in t&&t.status===501||"code"in t&&t.code==="unsupported"}const WN=new Set(["image/svg+xml","image/x-icon"]),Cq=60,wq=200,Eq=200;function QN(t){return{folder:t,cursor:void 0,seen:new Set,pages:0,busy:!1,failed:!1}}function Aq(t,e){if(!t.hasMore)return{cursor:void 0,stalled:!1};const n=t.cursor;return n===void 0||e.seen.has(n)||e.pages>=Eq?{cursor:void 0,stalled:!0}:(e.seen.add(n),{cursor:n,stalled:!1})}function Nq(t,e){if(e.length===0)return t;const n=new Map(t.map(i=>[i.path,i]));let r=!1;for(const i of e)n.has(i.path)||(n.set(i.path,i),r=!0);return r?[...n.values()].sort((i,s)=>i.name.localeCompare(s.name)):t}const Tq=[{value:"all",label:"All"},{value:"photo",label:"Photos"},{value:"graphic",label:"Graphics"},{value:"document",label:"Documents"}];function Mq(t,e){return e==="all"?!0:e==="photo"?t.startsWith("image/")&&!WN.has(t):e==="graphic"?WN.has(t):e==="document"?t==="application/pdf":!0}const Oq={position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1100},Rq={width:"min(760px, 94vw)",maxHeight:"82vh",display:"flex",flexDirection:"column",background:"#fff",border:"1px solid #d4d4d8",borderRadius:12,boxShadow:"0 16px 48px rgba(0,0,0,0.28)",overflow:"hidden",fontSize:13,color:"#27272a"},Dq={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid #ececed"},Iq={display:"flex",flexDirection:"column",gap:10,padding:"12px 16px",borderBottom:"1px solid #ececed"},Qc={display:"flex",alignItems:"center",gap:8},XN={flex:1,border:"1px solid #d4d4d8",borderRadius:6,padding:"6px 10px",font:"inherit",outline:"none"},Do={border:"1px solid #d4d4d8",background:"#fff",borderRadius:6,padding:"6px 12px",font:"inherit",cursor:"pointer",color:"#3f3f46",whiteSpace:"nowrap"},ZN={...Do,background:"#2563eb",borderColor:"#2563eb",color:"#fff"},_q={display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:10,padding:16,overflowY:"auto"},eT={position:"relative",aspectRatio:"1 / 1",border:"1px solid #e4e4e7",borderRadius:8,overflow:"hidden",cursor:"pointer",background:"#fafafa",padding:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},tT={padding:32,textAlign:"center",color:"#a1a1aa"},zq={display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"8px 16px",borderTop:"1px solid #ececed",fontSize:12,color:"#71717a"},Lq={position:"absolute",left:0,right:0,bottom:0,padding:"4px 6px",fontSize:11,color:"#fff",background:"linear-gradient(to top, rgba(0,0,0,0.65), transparent)",textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"};function VI({media:t,context:e,field:n,accept:r="image/*,application/pdf",onSelect:i,onClose:s}){const[o,u]=ae.useState([]),[c,h]=ae.useState([]),[d,g]=ae.useState(""),[y,b]=ae.useState(""),[k,E]=ae.useState("all"),[N,M]=ae.useState(!1),[P,F]=ae.useState(!1),[U,_]=ae.useState(!1),[C,z]=ae.useState(!1),[G,J]=ae.useState(!1),[K,de]=ae.useState(null),[ce,ve]=ae.useState(!1),[_e,Y]=ae.useState(""),Q=ae.useRef(null),oe=ae.useRef(QN("")),Ce=ae.useRef(!0);ae.useEffect(()=>(Ce.current=!0,()=>{Ce.current=!1}),[]);const ze=ae.useCallback(async(fe,we=Cq)=>{if(fe.busy||oe.current!==fe)return;const ut=fe.pages===0;fe.busy=!0,fe.failed=!1,ut?M(!0):F(!0),de(null);try{const ct=await t.listMedia({folder:fe.folder||void 0,limit:we,cursor:fe.cursor});if(!Ce.current||oe.current!==fe)return;fe.pages+=1,h(an=>Nq(an,ct.folders)),u(an=>ut?ct.items:[...an,...ct.items]);const xn=Aq(ct,fe);fe.cursor=xn.cursor,_(xn.cursor!==void 0),xn.stalled&&de("Stopped loading this folder early — some files are not shown.")}catch(ct){if(!Ce.current||oe.current!==fe)return;fe.failed=!0,YN(ct)?(z(!0),_(!1)):de(ct instanceof Error?ct.message:"Failed to load media")}finally{fe.busy=!1,Ce.current&&oe.current===fe&&(M(!1),F(!1))}},[t]);ae.useEffect(()=>{const fe=QN(d);oe.current=fe,u([]),h([]),_(!1),ze(fe)},[d,ze]);const V=y.trim().toLowerCase(),j=V!==""||k!=="all";ae.useEffect(()=>{if(!j)return;const fe=oe.current;fe.busy||fe.failed||fe.cursor===void 0||ze(fe,wq)},[j,o,ze]);const ie=fe=>{b(""),g(fe)},L=async fe=>{J(!0),de(null);try{const we=await t.uploadMedia(fe,{...e,field:n,folder:d||void 0});if(we.success&&we.url){if(we.url.startsWith("./")){i(we.url,we.annotation??"");return}const ut={id:we.id??we.url,url:we.url,filename:we.filename??fe.name,annotation:we.annotation,contentType:fe.type||"application/octet-stream",folder:d||void 0};u(ct=>[ut,...ct])}else de(we.error??"Upload failed")}catch(we){YN(we)?z(!0):de(we instanceof Error?we.message:"Upload failed")}finally{J(!1)}},Se=async()=>{const fe=_e.trim();if(!fe||!t.createFolder)return;if(/[/\\:*?"<>|]/.test(fe)){de("Invalid folder name");return}const we=d?`${d}/${fe}`:fe;try{const ut=await t.createFolder(we);ut.success?h(ct=>[...ct,{name:fe,path:we}].sort((xn,an)=>xn.name.localeCompare(an.name))):de(ut.error??"Failed to create folder")}catch(ut){de(ut instanceof Error?ut.message:"Failed to create folder")}Y(""),ve(!1)},De=ae.useMemo(()=>{const fe=k==="all"?o:o.filter(we=>Mq(we.contentType,k));return V===""?fe:fe.filter(we=>we.filename.toLowerCase().includes(V))},[o,k,V]),Ne=ae.useMemo(()=>{if(!d)return[];const fe=d.split("/");return fe.map((we,ut)=>({name:we,path:fe.slice(0,ut+1).join("/")}))},[d]),We=j?[]:c;return D.jsx("div",{style:Oq,onMouseDown:s,"data-cms-ui":"",children:D.jsxs("div",{style:Rq,onMouseDown:fe=>fe.stopPropagation(),onDrop:fe=>{fe.preventDefault();const we=fe.dataTransfer.files[0];we&&L(we)},onDragOver:fe=>fe.preventDefault(),children:[D.jsxs("div",{style:Dq,children:[D.jsx("strong",{style:{fontSize:15},children:"Media Library"}),D.jsx("button",{type:"button",style:{...Do,border:"none",fontSize:18,lineHeight:1,padding:2},onClick:s,"aria-label":"Close",children:"×"})]}),D.jsxs("div",{style:Iq,children:[Ne.length>0?D.jsxs("div",{style:{...Qc,gap:4,fontSize:12,color:"#71717a"},children:[D.jsx("button",{type:"button",style:{...Do,border:"none",padding:"0 2px"},onClick:()=>ie(""),children:"root"}),Ne.map((fe,we)=>D.jsxs("span",{style:Qc,children:[D.jsx("span",{children:"/"}),we===Ne.length-1?D.jsx("span",{style:{color:"#27272a",fontWeight:600},children:fe.name}):D.jsx("button",{type:"button",style:{...Do,border:"none",padding:"0 2px"},onClick:()=>ie(fe.path),children:fe.name})]},fe.path))]}):null,D.jsxs("div",{style:Qc,children:[D.jsx("input",{style:XN,placeholder:"Search files…",value:y,onChange:fe=>b(fe.target.value)}),t.createFolder?D.jsx("button",{type:"button",style:Do,onClick:()=>ve(fe=>!fe),children:"New folder"}):null,D.jsx("button",{type:"button",style:ZN,disabled:C||G,onClick:()=>Q.current?.click(),children:G?"Uploading…":"Upload"}),D.jsx("input",{ref:Q,type:"file",accept:r,style:{display:"none"},onChange:fe=>{const we=fe.target.files?.[0];we&&L(we),fe.target.value=""}})]}),D.jsx("div",{style:{...Qc,gap:4},children:Tq.map(fe=>D.jsx("button",{type:"button",style:{...Do,padding:"3px 10px",fontSize:12,...k===fe.value?{background:"#2563eb",border:"1px solid #2563eb",color:"#fff"}:{}},onClick:()=>E(fe.value),children:fe.label},fe.value))}),ce&&t.createFolder?D.jsxs("div",{style:Qc,children:[D.jsx("input",{style:XN,autoFocus:!0,placeholder:"Folder name…",value:_e,onChange:fe=>Y(fe.target.value),onKeyDown:fe=>{fe.key==="Enter"&&Se(),fe.key==="Escape"&&(ve(!1),Y(""))}}),D.jsx("button",{type:"button",style:ZN,onClick:()=>{Se()},children:"Create"})]}):null,C?D.jsx("div",{style:{fontSize:12,color:"#a16207"},children:"Media uploads are not configured for this project."}):null,K?D.jsx("div",{style:{fontSize:12,color:"#dc2626"},children:K}):null]}),N?D.jsx("div",{style:tT,children:"Loading…"}):We.length===0&&De.length===0?D.jsx("div",{style:tT,children:P?j?"Searching…":"Loading…":j?"No matching files.":"No files yet. Upload one to get started."}):D.jsxs("div",{style:_q,children:[We.map(fe=>D.jsxs("button",{type:"button",style:eT,onClick:()=>ie(fe.path),title:fe.name,"data-cms-media-folder":fe.path,children:[D.jsx("span",{style:{fontSize:30},children:"📁"}),D.jsx("span",{style:{fontSize:12,color:"#52525b",maxWidth:"90%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:fe.name})]},fe.path)),De.map(fe=>D.jsxs("button",{type:"button",style:eT,title:fe.filename,"data-cms-media-item":fe.id,onClick:()=>i(fe.url,fe.annotation||fe.filename||"Image"),children:[fe.contentType.startsWith("image/")?D.jsx("img",{src:fe.thumbnailUrl??fe.url,alt:fe.annotation||fe.filename,style:{width:"100%",height:"100%",objectFit:"contain"}}):D.jsx("span",{style:{fontSize:30},children:fe.contentType==="application/pdf"?"📄":"📎"}),D.jsx("span",{style:Lq,children:fe.filename})]},fe.id))]}),!N&&U?D.jsx("div",{style:zq,children:P?D.jsx("span",{children:j?`Searching the whole folder… ${o.length} files scanned`:"Loading…"}):D.jsx("button",{type:"button",style:Do,onClick:()=>{ze(oe.current)},children:"Load more"})}):null,D.jsxs("div",{style:{padding:"10px 16px",borderTop:"1px solid #ececed",fontSize:12,color:"#a1a1aa",textAlign:"center"},children:["Drag and drop a file here to upload",d?` to ${d}`:"","."]})]})})}const iS={bold:!1,italic:!1,strikethrough:!1,link:!1,linkHref:null,bulletList:!1,orderedList:!1,listStyle:null,blockquote:!1,heading:null};function Bq(t){const{state:e}=t,{$from:n,from:r,to:i}=e.selection;let s=!1,o=!1,u=!1,c=!1,h=null;const d=e.storedMarks||n.marks();for(const N of d)N.type.name==="strong"&&(s=!0),N.type.name==="emphasis"&&(o=!0),N.type.name==="strike_through"&&(u=!0),N.type.name==="link"&&(c=!0,h=typeof N.attrs.href=="string"?N.attrs.href:null);r!==i&&e.doc.nodesBetween(r,i,N=>{for(const M of N.marks)M.type.name==="strong"&&(s=!0),M.type.name==="emphasis"&&(o=!0),M.type.name==="strike_through"&&(u=!0),M.type.name==="link"&&(c=!0,h=typeof M.attrs.href=="string"?M.attrs.href:null)});let g=!1,y=!1,b=null,k=!1,E=null;for(let N=n.depth;N>0;N--){const M=n.node(N);(M.type.name==="bullet_list"||M.type.name==="ordered_list")&&(M.type.name==="bullet_list"&&(g=!0),M.type.name==="ordered_list"&&(y=!0),b===null&&(b=typeof M.attrs.listStyle=="string"?M.attrs.listStyle:null)),M.type.name==="blockquote"&&(k=!0)}if(n.parent.type.name==="heading"){const N=n.parent.attrs.level;E=typeof N=="number"?N:null}return{bold:s,italic:o,strikethrough:u,link:c,linkHref:h,bulletList:g,orderedList:y,listStyle:b,blockquote:k,heading:E}}function Vq(t,e){const{$from:n}=t.state.selection;for(let r=n.depth;r>0;r--)if(n.node(r).type.name===e)return!0;return!1}function Fq(t,e){const{state:n}=t,r=n.schema.nodes.heading,i=n.schema.nodes.paragraph;if(!r||!i)return;const{$from:s}=n.selection,o=s.parent.type.name==="heading"&&s.parent.attrs.level===e,u=o?i:r,c=o?void 0:{level:e},h=s.before(s.depth),d=n.selection.$to.after(n.selection.$to.depth);t.dispatch(n.tr.setBlockType(h,d,u,c)),t.focus()}function Pq(t){const{state:e}=t,{from:n,to:r}=e.selection,i=e.schema.marks.link;if(!i)return;let s=n,o=r;e.doc.nodesBetween(n,n===r?r+1:r,(u,c)=>{if(i.isInSet(u.marks))return s=c,o=c+u.nodeSize,!1}),t.dispatch(e.tr.removeMark(s,o,i))}function jq(t,e){return t.bold===e.bold&&t.italic===e.italic&&t.strikethrough===e.strikethrough&&t.link===e.link&&t.linkHref===e.linkHref&&t.bulletList===e.bulletList&&t.orderedList===e.orderedList&&t.listStyle===e.listStyle&&t.blockquote===e.blockquote&&t.heading===e.heading}function $q(t,e){let n=0,r=iS;const i=()=>{const u=t.ctx.get(yn),c=Bq(u);jq(c,r)||(r=c,e(c))},s=t.ctx.get(yn),o=s.dispatch.bind(s);return s.dispatch=u=>{o(u),(u.selectionSet||u.docChanged)&&(cancelAnimationFrame(n),n=requestAnimationFrame(i))},i(),()=>{cancelAnimationFrame(n)}}const Uq=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],nT={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function FI(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=48&&e<=57}function Jq(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=97&&e<=102||e>=65&&e<=70||e>=48&&e<=57}function qq(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=97&&e<=122||e>=65&&e<=90}function rT(t){return qq(t)||FI(t)}const Hq=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Gg(t,e){const n=e||{},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,i=[];let s=0,o=-1,u="",c,h;n.position&&("start"in n.position||"indent"in n.position?(h=n.position.indent,c=n.position.start):c=n.position);let d=(c?c.line:0)||1,g=(c?c.column:0)||1,y=k(),b;for(s--;++s<=t.length;)if(b===10&&(g=(h?h[o]:0)||1),b=t.charCodeAt(s),b===38){const M=t.charCodeAt(s+1);if(M===9||M===10||M===12||M===32||M===38||M===60||Number.isNaN(M)||r&&M===r){u+=String.fromCharCode(b),g++;continue}const P=s+1;let F=P,U=P,_;if(M===35){U=++F;const ve=t.charCodeAt(U);ve===88||ve===120?(_="hexadecimal",U=++F):_="decimal"}else _="named";let C="",z="",G="";const J=_==="named"?rT:_==="decimal"?FI:Jq;for(U--;++U<=t.length;){const ve=t.charCodeAt(U);if(!J(ve))break;G+=String.fromCharCode(ve),_==="named"&&Uq.includes(G)&&(C=G,z=fh(G))}let K=t.charCodeAt(U)===59;if(K){U++;const ve=_==="named"?fh(G):!1;ve&&(C=G,z=ve)}let de=1+U-P,ce="";if(!(!K&&n.nonTerminated===!1))if(!G)_!=="named"&&E(4,de);else if(_==="named"){if(K&&!z)E(5,1);else if(C!==G&&(U=F+C.length,de=1+U-F,K=!1),!K){const ve=C?1:3;if(n.attribute){const _e=t.charCodeAt(U);_e===61?(E(ve,de),z=""):rT(_e)?z="":E(ve,de)}else E(ve,de)}ce=z}else{K||E(2,de);let ve=Number.parseInt(G,_==="hexadecimal"?16:10);if(Kq(ve))E(7,de),ce="�";else if(ve in nT)E(6,de),ce=nT[ve];else{let _e="";Gq(ve)&&E(6,de),ve>65535&&(ve-=65536,_e+=String.fromCharCode(ve>>>10|55296),ve=56320|ve&1023),ce=_e+String.fromCharCode(ve)}}if(ce){N(),y=k(),s=U-1,g+=U-P+1,i.push(ce);const ve=k();ve.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,ce,{start:y,end:ve},t.slice(P-1,U)),y=ve}else G=t.slice(P-1,U),u+=G,g+=G.length,s=U-1}else b===10&&(d++,o++,g=0),Number.isNaN(b)?N():(u+=String.fromCharCode(b),g++);return i.join("");function k(){return{line:d,column:g,offset:s+((c?c.offset:0)||0)}}function E(M,P){let F;n.warning&&(F=k(),F.column+=P,F.offset+=P,n.warning.call(n.warningContext||void 0,Hq[M],F,M))}function N(){u&&(i.push(u),n.text&&n.text.call(n.textContext||void 0,u,{start:y,end:k()}),u="")}}function Kq(t){return t>=55296&&t<=57343||t>1114111}function Gq(t){return t>=1&&t<=8||t===11||t>=13&&t<=31||t>=127&&t<=159||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534}const Yq=/["&'<>`]/g,Wq=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Qq=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Xq=/[|\\{}()[\]^$+*?.]/g,iT=new WeakMap;function Zq(t,e){if(t=t.replace(e.subset?eH(e.subset):Yq,r),e.subset||e.escapeOnly)return t;return t.replace(Wq,n).replace(Qq,r);function n(i,s,o){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),e)}function r(i,s,o){return e.format(i.charCodeAt(0),o.charCodeAt(s+1),e)}}function eH(t){let e=iT.get(t);return e||(e=tH(t),iT.set(t,e)),e}function tH(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Xq,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}function nH(t){return"&#x"+t.toString(16).toUpperCase()+";"}function rH(t,e){return Zq(t,Object.assign({format:nH},e))}function iH(){return{canContainEols:["textDirective"],enter:{directiveContainer:sH,directiveContainerAttributes:dx,directiveContainerLabel:lH,directiveLeaf:aH,directiveLeafAttributes:dx,directiveText:oH,directiveTextAttributes:dx},exit:{directiveContainer:Sx,directiveContainerAttributeClassValue:gx,directiveContainerAttributeIdValue:mx,directiveContainerAttributeName:xx,directiveContainerAttributeValue:yx,directiveContainerAttributes:bx,directiveContainerLabel:uH,directiveContainerName:px,directiveLeaf:Sx,directiveLeafAttributeClassValue:gx,directiveLeafAttributeIdValue:mx,directiveLeafAttributeName:xx,directiveLeafAttributeValue:yx,directiveLeafAttributes:bx,directiveLeafName:px,directiveText:Sx,directiveTextAttributeClassValue:gx,directiveTextAttributeIdValue:mx,directiveTextAttributeName:xx,directiveTextAttributeValue:yx,directiveTextAttributes:bx,directiveTextName:px}}}function sH(t){yk.call(this,"containerDirective",t)}function aH(t){yk.call(this,"leafDirective",t)}function oH(t){yk.call(this,"textDirective",t)}function yk(t,e){this.enter({type:t,name:"",attributes:{},children:[]},e)}function px(t){const e=this.stack[this.stack.length-1];e.type==="containerDirective"||e.type==="leafDirective"||e.type,e.name=this.sliceSerialize(t)}function lH(t){this.enter({type:"paragraph",data:{directiveLabel:!0},children:[]},t)}function uH(t){this.exit(t)}function dx(){this.data.directiveAttributes=[],this.buffer()}function mx(t){this.data.directiveAttributes.push(["id",Gg(this.sliceSerialize(t),{attribute:!0})])}function gx(t){this.data.directiveAttributes.push(["class",Gg(this.sliceSerialize(t),{attribute:!0})])}function yx(t){const e=this.data.directiveAttributes;e[e.length-1][1]=Gg(this.sliceSerialize(t),{attribute:!0})}function xx(t){this.data.directiveAttributes.push([this.sliceSerialize(t),""])}function bx(){const t=this.data.directiveAttributes,e={};let n=-1;for(;++n<t.length;){const i=t[n];i[0]==="class"&&e.class?e.class+=" "+i[1]:e[i[0]]=i[1]}this.data.directiveAttributes=void 0,this.resume();const r=this.stack[this.stack.length-1];r.type==="containerDirective"||r.type==="leafDirective"||r.type,r.attributes=e}function Sx(t){this.exit(t)}function xk(t,e,n,r,i,s,o,u,c,h,d,g,y,b,k){let E,N;return M;function M(Y){return t.enter(r),t.enter(i),t.consume(Y),t.exit(i),P}function P(Y){return Y===35?(E=o,F(Y)):Y===46?(E=u,F(Y)):Y===58||Y===95||sn(Y)?(t.enter(s),t.enter(c),t.consume(Y),C):k&&Ke(Y)?Ge(t,P,"whitespace")(Y):!k&&et(Y)?Ts(t,P)(Y):_e(Y)}function F(Y){const Q=E+"Marker";return t.enter(s),t.enter(E),t.enter(Q),t.consume(Y),t.exit(Q),U}function U(Y){if(Y===null||Y===34||Y===35||Y===39||Y===46||Y===60||Y===61||Y===62||Y===96||Y===125||et(Y))return n(Y);const Q=E+"Value";return t.enter(Q),t.consume(Y),_}function _(Y){if(Y===null||Y===34||Y===39||Y===60||Y===61||Y===62||Y===96)return n(Y);if(Y===35||Y===46||Y===125||et(Y)){const Q=E+"Value";return t.exit(Q),t.exit(E),t.exit(s),P(Y)}return t.consume(Y),_}function C(Y){return Y===45||Y===46||Y===58||Y===95||Cn(Y)?(t.consume(Y),C):(t.exit(c),k&&Ke(Y)?Ge(t,z,"whitespace")(Y):!k&&et(Y)?Ts(t,z)(Y):z(Y))}function z(Y){return Y===61?(t.enter(h),t.consume(Y),t.exit(h),G):(t.exit(s),P(Y))}function G(Y){return Y===null||Y===60||Y===61||Y===62||Y===96||Y===125||k&&Ee(Y)?n(Y):Y===34||Y===39?(t.enter(d),t.enter(y),t.consume(Y),t.exit(y),N=Y,K):k&&Ke(Y)?Ge(t,G,"whitespace")(Y):!k&&et(Y)?Ts(t,G)(Y):(t.enter(g),t.enter(b),t.consume(Y),N=void 0,J)}function J(Y){return Y===null||Y===34||Y===39||Y===60||Y===61||Y===62||Y===96?n(Y):Y===125||et(Y)?(t.exit(b),t.exit(g),t.exit(s),P(Y)):(t.consume(Y),J)}function K(Y){return Y===N?(t.enter(y),t.consume(Y),t.exit(y),t.exit(d),t.exit(s),ve):(t.enter(g),de(Y))}function de(Y){return Y===N?(t.exit(g),K(Y)):Y===null?n(Y):Ee(Y)?k?n(Y):Ts(t,de)(Y):(t.enter(b),t.consume(Y),ce)}function ce(Y){return Y===N||Y===null||Ee(Y)?(t.exit(b),de(Y)):(t.consume(Y),ce)}function ve(Y){return Y===125||et(Y)?P(Y):_e(Y)}function _e(Y){return Y===125?(t.enter(i),t.consume(Y),t.exit(i),t.exit(r),e):n(Y)}}function bk(t,e,n,r,i,s,o){let u=0,c=0,h;return d;function d(N){return t.enter(r),t.enter(i),t.consume(N),t.exit(i),g}function g(N){return N===93?(t.enter(i),t.consume(N),t.exit(i),t.exit(r),e):(t.enter(s),y(N))}function y(N){if(N===93&&!c)return E(N);const M=t.enter("chunkText",{contentType:"text",previous:h});return h&&(h.next=M),h=M,b(N)}function b(N){return N===null||u>999||N===91&&++c>32?n(N):N===93&&!c--?(t.exit("chunkText"),E(N)):Ee(N)?o?n(N):(t.consume(N),t.exit("chunkText"),y):(t.consume(N),N===92?k:b)}function k(N){return N===91||N===92||N===93?(t.consume(N),u++,b):b(N)}function E(N){return t.exit(s),t.enter(i),t.consume(N),t.exit(i),t.exit(r),e}}function Sk(t,e,n,r){const i=this;return s;function s(u){return sn(u)?(t.enter(r),t.consume(u),o):n(u)}function o(u){return u===45||u===95||Cn(u)?(t.consume(u),o):(t.exit(r),i.previous===45||i.previous===95?n(u):e(u))}}const cH={tokenize:pH,concrete:!0},fH={tokenize:dH,partial:!0},hH={tokenize:mH,partial:!0},Fd={tokenize:gH,partial:!0};function pH(t,e,n){const r=this,i=r.events[r.events.length-1],s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let o=0,u;return c;function c(J){return t.enter("directiveContainer"),t.enter("directiveContainerFence"),t.enter("directiveContainerSequence"),h(J)}function h(J){return J===58?(t.consume(J),o++,h):o<3?n(J):(t.exit("directiveContainerSequence"),Sk.call(r,t,d,n,"directiveContainerName")(J))}function d(J){return J===91?t.attempt(fH,g,g)(J):g(J)}function g(J){return J===123?t.attempt(hH,y,y)(J):y(J)}function y(J){return Ge(t,b,"whitespace")(J)}function b(J){return t.exit("directiveContainerFence"),J===null?z(J):Ee(J)?r.interrupt?e(J):t.attempt(Fd,k,z)(J):n(J)}function k(J){return J===null?z(J):Ee(J)?t.check(Fd,F,z)(J):(t.enter("directiveContainerContent"),E(J))}function E(J){return t.attempt({tokenize:G,partial:!0},C,s?Ge(t,N,"linePrefix",s+1):N)(J)}function N(J){return J===null?C(J):Ee(J)?t.check(Fd,P,C)(J):P(J)}function M(J){if(J===null){const K=t.exit("chunkDocument");return r.parser.lazy[K.start.line]=!1,C(J)}return Ee(J)?t.check(Fd,U,_)(J):(t.consume(J),M)}function P(J){const K=t.enter("chunkDocument",{contentType:"document",previous:u});return u&&(u.next=K),u=K,M(J)}function F(J){return t.enter("directiveContainerContent"),E(J)}function U(J){t.consume(J);const K=t.exit("chunkDocument");return r.parser.lazy[K.start.line]=!1,E}function _(J){const K=t.exit("chunkDocument");return r.parser.lazy[K.start.line]=!1,C(J)}function C(J){return t.exit("directiveContainerContent"),z(J)}function z(J){return t.exit("directiveContainer"),e(J)}function G(J,K,de){let ce=0;return Ge(J,ve,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function ve(Q){return J.enter("directiveContainerFence"),J.enter("directiveContainerSequence"),_e(Q)}function _e(Q){return Q===58?(J.consume(Q),ce++,_e):ce<o?de(Q):(J.exit("directiveContainerSequence"),Ge(J,Y,"whitespace")(Q))}function Y(Q){return Q===null||Ee(Q)?(J.exit("directiveContainerFence"),K(Q)):de(Q)}}}function dH(t,e,n){return bk(t,e,n,"directiveContainerLabel","directiveContainerLabelMarker","directiveContainerLabelString",!0)}function mH(t,e,n){return xk(t,e,n,"directiveContainerAttributes","directiveContainerAttributesMarker","directiveContainerAttribute","directiveContainerAttributeId","directiveContainerAttributeClass","directiveContainerAttributeName","directiveContainerAttributeInitializerMarker","directiveContainerAttributeValueLiteral","directiveContainerAttributeValue","directiveContainerAttributeValueMarker","directiveContainerAttributeValueData",!0)}function gH(t,e,n){const r=this;return i;function i(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s}function s(o){return r.parser.lazy[r.now().line]?n(o):e(o)}}const yH={tokenize:SH},xH={tokenize:vH,partial:!0},bH={tokenize:kH,partial:!0};function SH(t,e,n){const r=this;return i;function i(d){return t.enter("directiveLeaf"),t.enter("directiveLeafSequence"),t.consume(d),s}function s(d){return d===58?(t.consume(d),t.exit("directiveLeafSequence"),Sk.call(r,t,o,n,"directiveLeafName")):n(d)}function o(d){return d===91?t.attempt(xH,u,u)(d):u(d)}function u(d){return d===123?t.attempt(bH,c,c)(d):c(d)}function c(d){return Ge(t,h,"whitespace")(d)}function h(d){return d===null||Ee(d)?(t.exit("directiveLeaf"),e(d)):n(d)}}function vH(t,e,n){return bk(t,e,n,"directiveLeafLabel","directiveLeafLabelMarker","directiveLeafLabelString",!0)}function kH(t,e,n){return xk(t,e,n,"directiveLeafAttributes","directiveLeafAttributesMarker","directiveLeafAttribute","directiveLeafAttributeId","directiveLeafAttributeClass","directiveLeafAttributeName","directiveLeafAttributeInitializerMarker","directiveLeafAttributeValueLiteral","directiveLeafAttributeValue","directiveLeafAttributeValueMarker","directiveLeafAttributeValueData",!0)}const CH={tokenize:NH,previous:AH},wH={tokenize:TH,partial:!0},EH={tokenize:MH,partial:!0};function AH(t){return t!==58||this.events[this.events.length-1][1].type==="characterEscape"}function NH(t,e,n){const r=this;return i;function i(c){return t.enter("directiveText"),t.enter("directiveTextMarker"),t.consume(c),t.exit("directiveTextMarker"),Sk.call(r,t,s,n,"directiveTextName")}function s(c){return c===58?n(c):c===91?t.attempt(wH,o,o)(c):o(c)}function o(c){return c===123?t.attempt(EH,u,u)(c):u(c)}function u(c){return t.exit("directiveText"),e(c)}}function TH(t,e,n){return bk(t,e,n,"directiveTextLabel","directiveTextLabelMarker","directiveTextLabelString")}function MH(t,e,n){return xk(t,e,n,"directiveTextAttributes","directiveTextAttributesMarker","directiveTextAttribute","directiveTextAttributeId","directiveTextAttributeClass","directiveTextAttributeName","directiveTextAttributeInitializerMarker","directiveTextAttributeValueLiteral","directiveTextAttributeValue","directiveTextAttributeValueMarker","directiveTextAttributeValueData")}function OH(){return{text:{58:CH},flow:{58:[cH,yH]}}}const tg="youtube";function RH(t){if(!t||typeof t!="object")return"";const e=Object.entries(t),n=t.id;if(typeof n=="string"&&n)return n;for(const[r,i]of e)if(i===""||i==null)return r;return""}const PI=Ju("youtube",()=>({group:"block",atom:!0,isolating:!0,selectable:!0,draggable:!1,attrs:{videoId:{default:""}},toDOM:t=>["div",{"data-youtube":t.attrs.videoId,class:"youtube-block"}],parseDOM:[{tag:"div[data-youtube]",getAttrs:t=>({videoId:t.getAttribute("data-youtube")||""})}],parseMarkdown:{match:t=>(t.type==="leafDirective"||t.type==="containerDirective"||t.type==="textDirective")&&t.name===tg,runner:(t,e,n)=>{const r=RH(e.attributes);t.addNode(n,{videoId:r})}},toMarkdown:{match:t=>t.type.name==="youtube",runner:(t,e)=>{t.addNode("leafDirective",void 0,void 0,{name:tg,attributes:{id:e.attrs.videoId}})}}}));function DH(t){const e=t.attributes,n=e&&typeof e=="object"?String(e.id??""):"";return`::${tg}{#${n}}`}const IH=function(){const t=this.data("toMarkdownExtensions")??[],e={handlers:{leafDirective:DH}};t.push(e),this.data("toMarkdownExtensions",t)},_H=Ti("remarkYoutubeDirective",()=>IH),jI=qe("insertYoutube",()=>t=>(e,n)=>{if(!t)return!1;const r=e.schema.nodes.youtube;if(!r)return!1;const i=r.create({videoId:t});return n&&n(e.tr.replaceSelectionWith(i).scrollIntoView()),!0}),sS="list",zH=/^[A-Za-z0-9_-]+$/,LH=new Set(["textDirective","leafDirective","containerDirective"]);function Pi(t){if(typeof t!="string")return null;const[e]=t.trim().split(/\s+/);return!e||!zH.test(e)?null:e}function zs(t){return Array.isArray(t?.children)?t.children:null}function vx(t){const e=zs(t);return e&&e.length>0?e[e.length-1]:void 0}function $I(t){return!t.attributes||typeof t.attributes!="object"||Array.isArray(t.attributes)?null:t.attributes}function BH(t){return Pi($I(t)?.class)}function UI(t,e){const n=zs(t);if(t?.type!=="paragraph"||n?.length!==1)return!1;const r=n[0];return r?.type!=="text"||typeof r.value!="string"?!1:e===void 0?!0:r.value===e}function VH(t){if(!UI(t))return null;const e=zs(t)?.[0];return typeof e?.value!="string"?null:/^:::list\{\.([A-Za-z0-9_-]+)\}$/.exec(e.value)?.[1]??null}function sT(t){return t?.type==="list"}function FH(t,e,n){if(UI(e[n],":::"))return e.splice(n,1),!0;const r=vx(t),i=vx(r);if(!i||i.type!=="paragraph")return!1;const s=zs(i),o=vx(i);if(!s||o?.type!=="text"||typeof o.value!="string")return!1;if(o.value===":::")s.pop();else if(o.value.endsWith(`
57
+ `))}function c(b,k,E,N){const M=E.enter("tableCell"),P=E.enter("phrasing"),F=E.containerPhrasing(b,{...N,before:s,after:s});return P(),M(),F}function h(b,k){return uJ(b,{align:k,alignDelimiters:r,padding:n,stringLength:i})}function d(b,k,E){const N=b.children;let M=-1;const P=[],F=k.enter("table");for(;++M<N.length;)P[M]=g(N[M],k,E);return F(),P}function g(b,k,E){const N=b.children;let M=-1;const P=[],F=k.enter("tableRow");for(;++M<N.length;)P[M]=c(N[M],b,k,E);return F(),P}function y(b,k,E){let N=xS.inlineCode(b,k,E);return E.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function xJ(){return{exit:{taskListCheckValueChecked:qN,taskListCheckValueUnchecked:qN,paragraph:SJ}}}function bJ(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:vJ}}}function qN(t){const e=this.stack[this.stack.length-2];e.type,e.checked=t.type==="taskListCheckValueChecked"}function SJ(t){const e=this.stack[this.stack.length-2];if(e&&e.type==="listItem"&&typeof e.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const i=e.children;let s=-1,o;for(;++s<i.length;){const u=i[s];if(u.type==="paragraph"){o=u;break}}o===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(t)}function vJ(t,e,n,r){const i=t.children[0],s=typeof t.checked=="boolean"&&i&&i.type==="paragraph",o="["+(t.checked?"x":" ")+"] ",u=n.createTracker(r);s&&u.move(o);let c=xS.listItem(t,e,n,{...r,...u.current()});return s&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),c;function h(d){return d+o}}function kJ(){return[DU(),ZU(),rJ(),fJ(),xJ()]}function CJ(t){return{extensions:[IU(),eJ(t),iJ(),yJ(t),bJ()]}}const wJ={tokenize:OJ,partial:!0},lI={tokenize:RJ,partial:!0},uI={tokenize:DJ,partial:!0},cI={tokenize:IJ,partial:!0},EJ={tokenize:_J,partial:!0},fI={name:"wwwAutolink",tokenize:TJ,previous:pI},hI={name:"protocolAutolink",tokenize:MJ,previous:dI},qs={name:"emailAutolink",tokenize:NJ,previous:mI},Wi={};function AJ(){return{text:Wi}}let Eo=48;for(;Eo<123;)Wi[Eo]=qs,Eo++,Eo===58?Eo=65:Eo===91&&(Eo=97);Wi[43]=qs;Wi[45]=qs;Wi[46]=qs;Wi[95]=qs;Wi[72]=[qs,hI];Wi[104]=[qs,hI];Wi[87]=[qs,fI];Wi[119]=[qs,fI];function NJ(t,e,n){const r=this;let i,s;return o;function o(g){return!rS(g)||!mI.call(r,r.previous)||ik(r.events)?n(g):(t.enter("literalAutolink"),t.enter("literalAutolinkEmail"),u(g))}function u(g){return rS(g)?(t.consume(g),u):g===64?(t.consume(g),c):n(g)}function c(g){return g===46?t.check(EJ,d,h)(g):g===45||g===95||Cn(g)?(s=!0,t.consume(g),c):d(g)}function h(g){return t.consume(g),i=!0,c}function d(g){return s&&i&&sn(r.previous)?(t.exit("literalAutolinkEmail"),t.exit("literalAutolink"),e(g)):n(g)}}function TJ(t,e,n){const r=this;return i;function i(o){return o!==87&&o!==119||!pI.call(r,r.previous)||ik(r.events)?n(o):(t.enter("literalAutolink"),t.enter("literalAutolinkWww"),t.check(wJ,t.attempt(lI,t.attempt(uI,s),n),n)(o))}function s(o){return t.exit("literalAutolinkWww"),t.exit("literalAutolink"),e(o)}}function MJ(t,e,n){const r=this;let i="",s=!1;return o;function o(g){return(g===72||g===104)&&dI.call(r,r.previous)&&!ik(r.events)?(t.enter("literalAutolink"),t.enter("literalAutolinkHttp"),i+=String.fromCodePoint(g),t.consume(g),u):n(g)}function u(g){if(sn(g)&&i.length<5)return i+=String.fromCodePoint(g),t.consume(g),u;if(g===58){const y=i.toLowerCase();if(y==="http"||y==="https")return t.consume(g),c}return n(g)}function c(g){return g===47?(t.consume(g),s?h:(s=!0,c)):n(g)}function h(g){return g===null||Cm(g)||et(g)||Pn(g)||vg(g)?n(g):t.attempt(lI,t.attempt(uI,d),n)(g)}function d(g){return t.exit("literalAutolinkHttp"),t.exit("literalAutolink"),e(g)}}function OJ(t,e,n){let r=0;return i;function i(o){return(o===87||o===119)&&r<3?(r++,t.consume(o),i):o===46&&r===3?(t.consume(o),s):n(o)}function s(o){return o===null?n(o):e(o)}}function RJ(t,e,n){let r,i,s;return o;function o(h){return h===46||h===95?t.check(cI,c,u)(h):h===null||et(h)||Pn(h)||h!==45&&vg(h)?c(h):(s=!0,t.consume(h),o)}function u(h){return h===95?r=!0:(i=r,r=void 0),t.consume(h),o}function c(h){return i||r||!s?n(h):e(h)}}function DJ(t,e){let n=0,r=0;return i;function i(o){return o===40?(n++,t.consume(o),i):o===41&&r<n?s(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?t.check(cI,e,s)(o):o===null||et(o)||Pn(o)?e(o):(t.consume(o),i)}function s(o){return o===41&&r++,t.consume(o),i}}function IJ(t,e,n){return r;function r(u){return u===33||u===34||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===63||u===95||u===126?(t.consume(u),r):u===38?(t.consume(u),s):u===93?(t.consume(u),i):u===60||u===null||et(u)||Pn(u)?e(u):n(u)}function i(u){return u===null||u===40||u===91||et(u)||Pn(u)?e(u):r(u)}function s(u){return sn(u)?o(u):n(u)}function o(u){return u===59?(t.consume(u),r):sn(u)?(t.consume(u),o):n(u)}}function _J(t,e,n){return r;function r(s){return t.consume(s),i}function i(s){return Cn(s)?n(s):e(s)}}function pI(t){return t===null||t===40||t===42||t===95||t===91||t===93||t===126||et(t)}function dI(t){return!sn(t)}function mI(t){return!(t===47||rS(t))}function rS(t){return t===43||t===45||t===46||t===95||Cn(t)}function ik(t){let e=t.length,n=!1;for(;e--;){const r=t[e][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return t.length>0&&!n&&(t[t.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const zJ={tokenize:UJ,partial:!0};function LJ(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:PJ,continuation:{tokenize:jJ},exit:$J}},text:{91:{name:"gfmFootnoteCall",tokenize:FJ},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:BJ,resolveTo:VJ}}}}function BJ(t,e,n){const r=this;let i=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o;for(;i--;){const c=r.events[i][1];if(c.type==="labelImage"){o=c;break}if(c.type==="gfmFootnoteCall"||c.type==="labelLink"||c.type==="label"||c.type==="image"||c.type==="link")break}return u;function u(c){if(!o||!o._balanced)return n(c);const h=Ei(r.sliceSerialize({start:o.end,end:r.now()}));return h.codePointAt(0)!==94||!s.includes(h.slice(1))?n(c):(t.enter("gfmFootnoteCallLabelMarker"),t.consume(c),t.exit("gfmFootnoteCallLabelMarker"),e(c))}}function VJ(t,e){let n=t.length;for(;n--;)if(t[n][1].type==="labelImage"&&t[n][0]==="enter"){t[n][1];break}t[n+1][1].type="data",t[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},t[n+3][1].start),end:Object.assign({},t[t.length-1][1].end)},i={type:"gfmFootnoteCallMarker",start:Object.assign({},t[n+3][1].end),end:Object.assign({},t[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},i.end),end:Object.assign({},t[t.length-1][1].start)},o={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},u=[t[n+1],t[n+2],["enter",r,e],t[n+3],t[n+4],["enter",i,e],["exit",i,e],["enter",s,e],["enter",o,e],["exit",o,e],["exit",s,e],t[t.length-2],t[t.length-1],["exit",r,e]];return t.splice(n,t.length-n+1,...u),t}function FJ(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,o;return u;function u(g){return t.enter("gfmFootnoteCall"),t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),c}function c(g){return g!==94?n(g):(t.enter("gfmFootnoteCallMarker"),t.consume(g),t.exit("gfmFootnoteCallMarker"),t.enter("gfmFootnoteCallString"),t.enter("chunkString").contentType="string",h)}function h(g){if(s>999||g===93&&!o||g===null||g===91||et(g))return n(g);if(g===93){t.exit("chunkString");const y=t.exit("gfmFootnoteCallString");return i.includes(Ei(r.sliceSerialize(y)))?(t.enter("gfmFootnoteCallLabelMarker"),t.consume(g),t.exit("gfmFootnoteCallLabelMarker"),t.exit("gfmFootnoteCall"),e):n(g)}return et(g)||(o=!0),s++,t.consume(g),g===92?d:h}function d(g){return g===91||g===92||g===93?(t.consume(g),s++,h):h(g)}}function PJ(t,e,n){const r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,o=0,u;return c;function c(k){return t.enter("gfmFootnoteDefinition")._container=!0,t.enter("gfmFootnoteDefinitionLabel"),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(t.enter("gfmFootnoteDefinitionMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionMarker"),t.enter("gfmFootnoteDefinitionLabelString"),t.enter("chunkString").contentType="string",d):n(k)}function d(k){if(o>999||k===93&&!u||k===null||k===91||et(k))return n(k);if(k===93){t.exit("chunkString");const E=t.exit("gfmFootnoteDefinitionLabelString");return s=Ei(r.sliceSerialize(E)),t.enter("gfmFootnoteDefinitionLabelMarker"),t.consume(k),t.exit("gfmFootnoteDefinitionLabelMarker"),t.exit("gfmFootnoteDefinitionLabel"),y}return et(k)||(u=!0),o++,t.consume(k),k===92?g:d}function g(k){return k===91||k===92||k===93?(t.consume(k),o++,d):d(k)}function y(k){return k===58?(t.enter("definitionMarker"),t.consume(k),t.exit("definitionMarker"),i.includes(s)||i.push(s),Ge(t,b,"gfmFootnoteDefinitionWhitespace")):n(k)}function b(k){return e(k)}}function jJ(t,e,n){return t.check(ju,e,t.attempt(zJ,e,n))}function $J(t){t.exit("gfmFootnoteDefinition")}function UJ(t,e,n){const r=this;return Ge(t,i,"gfmFootnoteDefinitionIndent",5);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="gfmFootnoteDefinitionIndent"&&o[2].sliceSerialize(o[1],!0).length===4?e(s):n(s)}}function JJ(t){let n=(t||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:i};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function i(o,u){let c=-1;for(;++c<o.length;)if(o[c][0]==="enter"&&o[c][1].type==="strikethroughSequenceTemporary"&&o[c][1]._close){let h=c;for(;h--;)if(o[h][0]==="exit"&&o[h][1].type==="strikethroughSequenceTemporary"&&o[h][1]._open&&o[c][1].end.offset-o[c][1].start.offset===o[h][1].end.offset-o[h][1].start.offset){o[c][1].type="strikethroughSequence",o[h][1].type="strikethroughSequence";const d={type:"strikethrough",start:Object.assign({},o[h][1].start),end:Object.assign({},o[c][1].end)},g={type:"strikethroughText",start:Object.assign({},o[h][1].end),end:Object.assign({},o[c][1].start)},y=[["enter",d,u],["enter",o[h][1],u],["exit",o[h][1],u],["enter",g,u]],b=u.parser.constructs.insideSpan.null;b&&Nr(y,y.length,0,kg(b,o.slice(h+1,c),u)),Nr(y,y.length,0,[["exit",g,u],["enter",o[c][1],u],["exit",o[c][1],u],["exit",d,u]]),Nr(o,h-1,c-h+3,y),c=h+y.length-2;break}}for(c=-1;++c<o.length;)o[c][1].type==="strikethroughSequenceTemporary"&&(o[c][1].type="data");return o}function s(o,u,c){const h=this.previous,d=this.events;let g=0;return y;function y(k){return h===126&&d[d.length-1][1].type!=="characterEscape"?c(k):(o.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const E=Iu(h);if(k===126)return g>1?c(k):(o.consume(k),g++,b);if(g<2&&!n)return c(k);const N=o.exit("strikethroughSequenceTemporary"),M=Iu(k);return N._open=!M||M===2&&!!E,N._close=!E||E===2&&!!M,u(k)}}}class qJ{constructor(){this.map=[]}add(e,n,r){HJ(this,e,n,r)}consume(e){if(this.map.sort(function(s,o){return s[0]-o[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(e.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),e.length=this.map[n][0];r.push(e.slice()),e.length=0;let i=r.pop();for(;i;){for(const s of i)e.push(s);i=r.pop()}this.map.length=0}}function HJ(t,e,n,r){let i=0;if(!(n===0&&r.length===0)){for(;i<t.map.length;){if(t.map[i][0]===e){t.map[i][1]+=n,t.map[i][2].push(...r);return}i+=1}t.map.push([e,n,r])}}function KJ(t,e){let n=!1;const r=[];for(;e<t.length;){const i=t[e];if(n){if(i[0]==="enter")i[1].type==="tableContent"&&r.push(t[e+1][1].type==="tableDelimiterMarker"?"left":"none");else if(i[1].type==="tableContent"){if(t[e-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(i[1].type==="tableDelimiterRow")break}else i[0]==="enter"&&i[1].type==="tableDelimiterRow"&&(n=!0);e+=1}return r}function GJ(){return{flow:{null:{name:"table",tokenize:YJ,resolveAll:WJ}}}}function YJ(t,e,n){const r=this;let i=0,s=0,o;return u;function u(K){let de=r.events.length-1;for(;de>-1;){const _e=r.events[de][1].type;if(_e==="lineEnding"||_e==="linePrefix")de--;else break}const ce=de>-1?r.events[de][1].type:null,ve=ce==="tableHead"||ce==="tableRow"?C:c;return ve===C&&r.parser.lazy[r.now().line]?n(K):ve(K)}function c(K){return t.enter("tableHead"),t.enter("tableRow"),h(K)}function h(K){return K===124||(o=!0,s+=1),d(K)}function d(K){return K===null?n(K):Ee(K)?s>1?(s=0,r.interrupt=!0,t.exit("tableRow"),t.enter("lineEnding"),t.consume(K),t.exit("lineEnding"),b):n(K):Ke(K)?Ge(t,d,"whitespace")(K):(s+=1,o&&(o=!1,i+=1),K===124?(t.enter("tableCellDivider"),t.consume(K),t.exit("tableCellDivider"),o=!0,d):(t.enter("data"),g(K)))}function g(K){return K===null||K===124||et(K)?(t.exit("data"),d(K)):(t.consume(K),K===92?y:g)}function y(K){return K===92||K===124?(t.consume(K),g):g(K)}function b(K){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(K):(t.enter("tableDelimiterRow"),o=!1,Ke(K)?Ge(t,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):k(K))}function k(K){return K===45||K===58?N(K):K===124?(o=!0,t.enter("tableCellDivider"),t.consume(K),t.exit("tableCellDivider"),E):_(K)}function E(K){return Ke(K)?Ge(t,N,"whitespace")(K):N(K)}function N(K){return K===58?(s+=1,o=!0,t.enter("tableDelimiterMarker"),t.consume(K),t.exit("tableDelimiterMarker"),M):K===45?(s+=1,M(K)):K===null||Ee(K)?U(K):_(K)}function M(K){return K===45?(t.enter("tableDelimiterFiller"),P(K)):_(K)}function P(K){return K===45?(t.consume(K),P):K===58?(o=!0,t.exit("tableDelimiterFiller"),t.enter("tableDelimiterMarker"),t.consume(K),t.exit("tableDelimiterMarker"),F):(t.exit("tableDelimiterFiller"),F(K))}function F(K){return Ke(K)?Ge(t,U,"whitespace")(K):U(K)}function U(K){return K===124?k(K):K===null||Ee(K)?!o||i!==s?_(K):(t.exit("tableDelimiterRow"),t.exit("tableHead"),e(K)):_(K)}function _(K){return n(K)}function C(K){return t.enter("tableRow"),z(K)}function z(K){return K===124?(t.enter("tableCellDivider"),t.consume(K),t.exit("tableCellDivider"),z):K===null||Ee(K)?(t.exit("tableRow"),e(K)):Ke(K)?Ge(t,z,"whitespace")(K):(t.enter("data"),G(K))}function G(K){return K===null||K===124||et(K)?(t.exit("data"),z(K)):(t.consume(K),K===92?J:G)}function J(K){return K===92||K===124?(t.consume(K),G):G(K)}}function WJ(t,e){let n=-1,r=!0,i=0,s=[0,0,0,0],o=[0,0,0,0],u=!1,c=0,h,d,g;const y=new qJ;for(;++n<t.length;){const b=t[n],k=b[1];b[0]==="enter"?k.type==="tableHead"?(u=!1,c!==0&&(HN(y,e,c,h,d),d=void 0,c=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",h,e]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,g=void 0,s=[0,0,0,0],o=[0,n+1,0,0],u&&(u=!1,d={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",d,e]])),i=k.type==="tableDelimiterRow"?2:d?3:1):i&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,o[2]===0&&(s[1]!==0&&(o[0]=o[1],g=Vd(y,e,s,i,void 0,g),s=[0,0,0,0]),o[2]=n)):k.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(o[0]=o[1],g=Vd(y,e,s,i,void 0,g)),s=o,o=[s[1],n,0,0])):k.type==="tableHead"?(u=!0,c=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(c=n,s[1]!==0?(o[0]=o[1],g=Vd(y,e,s,i,n,g)):o[1]!==0&&(g=Vd(y,e,o,i,n,g)),i=0):i&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(o[3]=n)}for(c!==0&&HN(y,e,c,h,d),y.consume(e.events),n=-1;++n<e.events.length;){const b=e.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=KJ(e.events,n))}return t}function Vd(t,e,n,r,i,s){const o=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",u="tableContent";n[0]!==0&&(s.end=Object.assign({},Au(e.events,n[0])),t.add(n[0],0,[["exit",s,e]]));const c=Au(e.events,n[1]);if(s={type:o,start:Object.assign({},c),end:Object.assign({},c)},t.add(n[1],0,[["enter",s,e]]),n[2]!==0){const h=Au(e.events,n[2]),d=Au(e.events,n[3]),g={type:u,start:Object.assign({},h),end:Object.assign({},d)};if(t.add(n[2],0,[["enter",g,e]]),r!==2){const y=e.events[n[2]],b=e.events[n[3]];if(y[1].end=Object.assign({},b[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,E=n[3]-n[2]-1;t.add(k,E,[])}}t.add(n[3]+1,0,[["exit",g,e]])}return i!==void 0&&(s.end=Object.assign({},Au(e.events,i)),t.add(i,0,[["exit",s,e]]),s=void 0),s}function HN(t,e,n,r,i){const s=[],o=Au(e.events,n);i&&(i.end=Object.assign({},o),s.push(["exit",i,e])),r.end=Object.assign({},o),s.push(["exit",r,e]),t.add(n+1,0,s)}function Au(t,e){const n=t[e],r=n[0]==="enter"?"start":"end";return n[1][r]}const QJ={name:"tasklistCheck",tokenize:ZJ};function XJ(){return{text:{91:QJ}}}function ZJ(t,e,n){const r=this;return i;function i(c){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(c):(t.enter("taskListCheck"),t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),s)}function s(c){return et(c)?(t.enter("taskListCheckValueUnchecked"),t.consume(c),t.exit("taskListCheckValueUnchecked"),o):c===88||c===120?(t.enter("taskListCheckValueChecked"),t.consume(c),t.exit("taskListCheckValueChecked"),o):n(c)}function o(c){return c===93?(t.enter("taskListCheckMarker"),t.consume(c),t.exit("taskListCheckMarker"),t.exit("taskListCheck"),u):n(c)}function u(c){return Ee(c)?e(c):Ke(c)?t.check({tokenize:eq},e,n)(c):n(c)}}function eq(t,e,n){return Ge(t,r,"whitespace");function r(i){return i===null?n(i):e(i)}}function tq(t){return dS([AJ(),LJ(),JJ(t),GJ(),XJ()])}const nq={};function rq(t){const e=this,n=t||nq,r=e.data(),i=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),o=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);i.push(tq(n)),s.push(kJ()),o.push(CJ(n))}function je(t,e){return Object.assign(t,{meta:{package:"@milkdown/preset-gfm",...e}}),t}var sk=Xh("strike_through");je(sk,{displayName:"Attr<strikethrough>",group:"Strikethrough"});var up=qu("strike_through",t=>({parseDOM:[{tag:"del"},{style:"text-decoration",getAttrs:e=>e==="line-through"}],toDOM:e=>["del",t.get(sk.key)(e)],parseMarkdown:{match:e=>e.type==="delete",runner:(e,n,r)=>{e.openMark(r),e.next(n.children),e.closeMark(r)}},toMarkdown:{match:e=>e.type.name==="strike_through",runner:(e,n)=>{e.withMark(n,"delete")}}}));je(up.mark,{displayName:"MarkSchema<strikethrough>",group:"Strikethrough"});je(up.ctx,{displayName:"MarkSchemaCtx<strikethrough>",group:"Strikethrough"});var Kg=qe("ToggleStrikeThrough",t=>()=>Ng(up.type(t)));je(Kg,{displayName:"Command<ToggleStrikethrough>",group:"Strikethrough"});var gI=mr(t=>Gh(new RegExp("(?<![\\w:/])(~{1,2})(.+?)\\1(?!\\w|\\/)"),up.type(t)));je(gI,{displayName:"InputRule<strikethrough>",group:"Strikethrough"});var ak=Rr("strikeThroughKeymap",{ToggleStrikethrough:{shortcuts:"Mod-Alt-x",command:t=>{const e=t.get(vt);return()=>e.call(Kg.key)}}});je(ak.ctx,{displayName:"KeymapCtx<strikethrough>",group:"Strikethrough"});je(ak.shortcuts,{displayName:"Keymap<strikethrough>",group:"Strikethrough"});var cp=Dj({tableGroup:"block",cellContent:"paragraph",cellAttributes:{alignment:{default:"left",getFromDOM:t=>t.style.textAlign||"left",setDOMAttr:(t,e)=>{e.style=`text-align: ${t||"left"}`}}}}),_s=en("table",()=>({...cp.table,content:"table_header_row table_row+",disableDropCursor:!0,parseMarkdown:{match:t=>t.type==="table",runner:(t,e,n)=>{const r=e.align,i=e.children.map((s,o)=>({...s,align:r,isHeader:o===0}));t.openNode(n),t.next(i),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table",runner:(t,e)=>{const n=e.content.firstChild?.content;if(!n)return;const r=[];n.forEach(i=>{r.push(i.attrs.alignment)}),t.openNode("table",void 0,{align:r}),t.next(e.content),t.closeNode()}}}));je(_s.node,{displayName:"NodeSchema<table>",group:"Table"});je(_s.ctx,{displayName:"NodeSchemaCtx<table>",group:"Table"});var fp=en("table_header_row",()=>({...cp.table_row,disableDropCursor:!0,content:"(table_header)*",parseDOM:[{tag:"tr[data-is-header]"},{tag:"tr",getAttrs:t=>t instanceof HTMLElement&&t.querySelector("th")?{}:!1}],toDOM(){return["tr",{"data-is-header":!0},0]},parseMarkdown:{match:t=>!!(t.type==="tableRow"&&t.isHeader),runner:(t,e,n)=>{const r=e.align,i=e.children.map((s,o)=>({...s,align:r[o],isHeader:e.isHeader}));t.openNode(n),t.next(i),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table_header_row",runner:(t,e)=>{e.content.size!==0&&(t.openNode("tableRow",void 0,{isHeader:!0}),t.next(e.content),t.closeNode())}}}));je(fp.node,{displayName:"NodeSchema<tableHeaderRow>",group:"Table"});je(fp.ctx,{displayName:"NodeSchemaCtx<tableHeaderRow>",group:"Table"});var Yu=en("table_row",()=>({...cp.table_row,disableDropCursor:!0,content:"(table_cell)*",parseMarkdown:{match:t=>t.type==="tableRow",runner:(t,e,n)=>{const r=e.align,i=e.children.map((s,o)=>({...s,align:r[o]}));t.openNode(n),t.next(i),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table_row",runner:(t,e)=>{e.content.size!==0&&(t.openNode("tableRow"),t.next(e.content),t.closeNode())}}}));je(Yu.node,{displayName:"NodeSchema<tableRow>",group:"Table"});je(Yu.ctx,{displayName:"NodeSchemaCtx<tableRow>",group:"Table"});var hp=en("table_cell",()=>({...cp.table_cell,disableDropCursor:!0,parseMarkdown:{match:t=>t.type==="tableCell"&&!t.isHeader,runner:(t,e,n)=>{const r=e.align;t.openNode(n,{alignment:r}).openNode(t.schema.nodes.paragraph).next(e.children).closeNode().closeNode()}},toMarkdown:{match:t=>t.type.name==="table_cell",runner:(t,e)=>{t.openNode("tableCell").next(e.content).closeNode()}}}));je(hp.node,{displayName:"NodeSchema<tableCell>",group:"Table"});je(hp.ctx,{displayName:"NodeSchemaCtx<tableCell>",group:"Table"});var Pu=en("table_header",()=>({...cp.table_header,disableDropCursor:!0,parseMarkdown:{match:t=>t.type==="tableCell"&&!!t.isHeader,runner:(t,e,n)=>{const r=e.align;t.openNode(n,{alignment:r}),t.openNode(t.schema.nodes.paragraph),t.next(e.children),t.closeNode(),t.closeNode()}},toMarkdown:{match:t=>t.type.name==="table_header",runner:(t,e)=>{t.openNode("tableCell"),t.next(e.content),t.closeNode()}}}));je(Pu.node,{displayName:"NodeSchema<tableHeader>",group:"Table"});je(Pu.ctx,{displayName:"NodeSchemaCtx<tableHeader>",group:"Table"});function yI(t,e=3,n=3){const r=Array(n).fill(0).map(()=>hp.type(t).createAndFill()),i=Array(n).fill(0).map(()=>Pu.type(t).createAndFill()),s=Array(e).fill(0).map((o,u)=>u===0?fp.type(t).create(null,i):Yu.type(t).create(null,r));return _s.type(t).create(null,s)}function xI(t){return(e,n)=>r=>{n=n??r.selection.from;const i=r.doc.resolve(n),s=t7(c=>c.type.name==="table")(i),o=s?{node:s.node,from:s.start}:void 0,u=t==="row";if(o){const c=kt.get(o.node);if(e>=0&&e<(u?c.height:c.width)){const h=c.positionAt(u?e:c.height-1,u?c.width-1:e,o.node),d=r.doc.resolve(o.from+h),g=u?It.rowSelection:It.colSelection,y=c.positionAt(u?e:0,u?0:e,o.node),b=r.doc.resolve(o.from+y);return DO(r.setSelection(g(d,b)))}}return r}}var iq=xI("row"),sq=xI("col");function bI(t,e,{map:n,tableStart:r,table:i},s){const o=Array(s).fill(0).reduce((c,h,d)=>c+i.child(d).nodeSize,r),u=Array(n.width).fill(0).map((c,h)=>{const d=i.nodeAt(n.map[h]);return hp.type(t).createAndFill({alignment:d?.attrs.alignment})});return e.insert(o,Yu.type(t).create(null,u)),e}function aq(t){const e=ap(t.$from);if(!e)return;const n=kt.get(e.node);return n.cellsInRect({left:0,right:n.width,top:0,bottom:n.height}).map(r=>{const i=e.node.nodeAt(r),s=r+e.start;return{pos:s,start:s+1,node:i}})}function oq(t){const e=aq(t.selection);if(e&&e[0]){const n=t.doc.resolve(e[0].pos),r=e[e.length-1];if(r){const i=t.doc.resolve(r.pos);return DO(t.setSelection(new It(i,n)))}}return t}var ok=qe("GoToPrevTableCell",()=>()=>wD(-1));je(ok,{displayName:"Command<goToPrevTableCellCommand>",group:"Table"});var lk=qe("GoToNextTableCell",()=>()=>wD(1));je(lk,{displayName:"Command<goToNextTableCellCommand>",group:"Table"});var uk=qe("ExitTable",t=>()=>(e,n)=>{if(!ui(e))return!1;const{$head:r}=e.selection,i=e7(r,_s.type(t));if(!i)return!1;const{to:s}=i,o=e.tr.replaceWith(s,s,Ui.type(t).createAndFill());return o.setSelection(Pe.near(o.doc.resolve(s),1)).scrollIntoView(),n?.(o),!0});je(uk,{displayName:"Command<breakTableCommand>",group:"Table"});var ck=qe("InsertTable",t=>({row:e,col:n}={})=>(r,i)=>{const{selection:s,tr:o}=r,{from:u}=s,c=yI(t,e,n),h=o.replaceSelectionWith(c),d=Pe.findFrom(h.doc.resolve(u),1,!0);return d&&h.setSelection(d),i?.(h),!0});je(ck,{displayName:"Command<insertTableCommand>",group:"Table"});var SI=qe("MoveRow",()=>({from:t,to:e,pos:n}={})=>a$({from:t??0,to:e??0,pos:n}));je(SI,{displayName:"Command<moveRowCommand>",group:"Table"});var vI=qe("MoveCol",()=>({from:t,to:e,pos:n}={})=>o$({from:t??0,to:e??0,pos:n}));je(vI,{displayName:"Command<moveColCommand>",group:"Table"});var kI=qe("SelectRow",()=>(t={index:0})=>(e,n)=>{const{tr:r}=e;return!!n?.(iq(t.index,t.pos)(r))});je(kI,{displayName:"Command<selectRowCommand>",group:"Table"});var CI=qe("SelectCol",()=>(t={index:0})=>(e,n)=>{const{tr:r}=e;return!!n?.(sq(t.index,t.pos)(r))});je(CI,{displayName:"Command<selectColCommand>",group:"Table"});var wI=qe("SelectTable",()=>()=>(t,e)=>{const{tr:n}=t;return!!e?.(oq(n))});je(wI,{displayName:"Command<selectTableCommand>",group:"Table"});var EI=qe("DeleteSelectedCells",()=>()=>(t,e)=>{const{selection:n}=t;if(!(n instanceof It))return!1;const r=n.isRowSelection(),i=n.isColSelection();return r&&i?s$(t,e):i?Zj(t,e):t$(t,e)});je(EI,{displayName:"Command<deleteSelectedCellsCommand>",group:"Table"});var AI=qe("AddColBefore",()=>()=>Wj);je(AI,{displayName:"Command<addColBeforeCommand>",group:"Table"});var NI=qe("AddColAfter",()=>()=>Qj);je(NI,{displayName:"Command<addColAfterCommand>",group:"Table"});var TI=qe("AddRowBefore",t=>()=>(e,n)=>{if(!ui(e))return!1;if(n){const r=to(e);n(bI(t,e.tr,r,r.top))}return!0});je(TI,{displayName:"Command<addRowBeforeCommand>",group:"Table"});var MI=qe("AddRowAfter",t=>()=>(e,n)=>{if(!ui(e))return!1;if(n){const r=to(e);n(bI(t,e.tr,r,r.bottom))}return!0});je(MI,{displayName:"Command<addRowAfterCommand>",group:"Table"});var OI=qe("SetAlign",()=>(t="left")=>n$("alignment",t));je(OI,{displayName:"Command<setAlignCommand>",group:"Table"});var RI=mr(t=>new Or(/^\|(?<col>\d+)[xX](?<row>\d+)\|\s$/,(e,n,r,i)=>{const s=e.doc.resolve(r);if(!s.node(-1).canReplaceWith(s.index(-1),s.indexAfter(-1),_s.type(t)))return null;const o=yI(t,Math.max(Number(n.groups?.row??0),2),Number(n.groups?.col)),u=e.tr.replaceRangeWith(r,i,o);return u.setSelection(Me.create(u.doc,r+3)).scrollIntoView()}));je(RI,{displayName:"InputRule<insertTableInputRule>",group:"Table"});var DI=gF(t=>({run:(e,n,r)=>{if(r)return e;function i(h){const d=h.childCount,g=h.lastChild?.childCount??0;if(d===0||g===0)return Ui.type(t).create();const y=h.firstChild;if(!(g>0&&y&&y.childCount===0))return h;if(d>=3){const N=h.child(1),M=[];for(let U=0;U<N.childCount;U++){const _=N.child(U);M.push(Pu.type(t).create(_.attrs,_.content,_.marks))}const P=y.type.create(y.attrs,M),F=[];for(let U=2;U<d;U++)F.push(h.child(U));return h.type.create(h.attrs,[P,...F])}const b=Array(g).fill(0).map(()=>Pu.type(t).createAndFill()),k=new H(W.from(b),0,0),E=y.replace(0,0,k);return h.replace(0,y.nodeSize,new H(W.from(E),0,0))}function s(h){const d=Yu.type(t),g=[];let y=[],b=!1;function k(){if(y.length===0)return;const E=fp.type(t).createAndFill(),N=_s.type(t).create(null,[E,...y]);g.push(i(N)),y=[]}return h.forEach(E=>{E.type===d?(b=!0,y.push(E)):(k(),g.push(E))}),k(),b?W.from(g):h}function o(h){let d=s(h),g=d!==h;const y=[];return d.forEach(b=>{if(b.type===_s.type(t)){const k=i(b);k!==b&&(g=!0),y.push(k)}else if(b.childCount>0){const k=o(b.content);k!==b.content?(g=!0,y.push(b.copy(k))):y.push(b)}else y.push(b)}),g?W.from(y):h}function u(h){const d=[],g=[];h.forEach(y=>g.push(y));for(let y=0;y<g.length;y++){const b=g[y],k=g[y+1];b.type===Ui.type(t)&&b.content.size===0&&k&&k.type===_s.type(t)||d.push(b)}return d.length<g.length?W.from(d):h}let c=o(e.content);return c=u(c),new H(W.from(c),e.openStart,e.openEnd)}}));je(DI,{displayName:"PasteRule<table>",group:"Table"});var fk=Rr("tableKeymap",{NextCell:{priority:100,shortcuts:["Mod-]","Tab"],command:t=>{const e=t.get(vt);return()=>e.call(lk.key)}},PrevCell:{shortcuts:["Mod-[","Shift-Tab"],command:t=>{const e=t.get(vt);return()=>e.call(ok.key)}},ExitTable:{shortcuts:["Mod-Enter","Enter"],command:t=>{const e=t.get(vt);return()=>e.call(uk.key)}}});je(fk.ctx,{displayName:"KeymapCtx<table>",group:"Table"});je(fk.shortcuts,{displayName:"Keymap<table>",group:"Table"});var cx="footnote_definition",KN="footnoteDefinition",hk=en("footnote_definition",()=>({group:"block",content:"block+",defining:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`dl[data-type="${cx}"]`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw Ki(t);return{label:t.dataset.label}},contentElement:"dd"}],toDOM:t=>{const e=t.attrs.label;return["dl",{"data-label":e,"data-type":cx},["dt",e],["dd",0]]},parseMarkdown:{match:({type:t})=>t===KN,runner:(t,e,n)=>{t.openNode(n,{label:e.label}).next(e.children).closeNode()}},toMarkdown:{match:t=>t.type.name===cx,runner:(t,e)=>{t.openNode(KN,void 0,{label:e.attrs.label,identifier:e.attrs.label}).next(e.content).closeNode()}}}));je(hk.ctx,{displayName:"NodeSchemaCtx<footnodeDef>",group:"footnote"});je(hk.node,{displayName:"NodeSchema<footnodeDef>",group:"footnote"});var fx="footnote_reference",pk=en("footnote_reference",()=>({group:"inline",inline:!0,atom:!0,attrs:{label:{default:"",validate:"string"}},parseDOM:[{tag:`sup[data-type="${fx}"]`,getAttrs:t=>{if(!(t instanceof HTMLElement))throw Ki(t);return{label:t.dataset.label}}}],toDOM:t=>{const e=t.attrs.label;return["sup",{"data-label":e,"data-type":fx},e]},parseMarkdown:{match:({type:t})=>t==="footnoteReference",runner:(t,e,n)=>{t.addNode(n,{label:e.label})}},toMarkdown:{match:t=>t.type.name===fx,runner:(t,e)=>{t.addNode("footnoteReference",void 0,void 0,{label:e.attrs.label,identifier:e.attrs.label})}}}));je(pk.ctx,{displayName:"NodeSchemaCtx<footnodeRef>",group:"footnote"});je(pk.node,{displayName:"NodeSchema<footnodeRef>",group:"footnote"});var dk=$s.extendSchema(t=>e=>{const n=t(e);return{...n,attrs:{...n.attrs,checked:{default:null,validate:"boolean|null"}},parseDOM:[{tag:'li[data-item-type="task"]',getAttrs:r=>{if(!(r instanceof HTMLElement))throw Ki(r);return{label:r.dataset.label,listType:r.dataset.listType,spread:r.dataset.spread,checked:r.dataset.checked?r.dataset.checked==="true":null}}},...n?.parseDOM||[]],toDOM:r=>n.toDOM&&r.attrs.checked==null?n.toDOM(r):["li",{"data-item-type":"task","data-label":r.attrs.label,"data-list-type":r.attrs.listType,"data-spread":r.attrs.spread,"data-checked":r.attrs.checked},0],parseMarkdown:{match:({type:r})=>r==="listItem",runner:(r,i,s)=>{if(i.checked==null){n.parseMarkdown.runner(r,i,s);return}const o=i.label!=null?`${i.label}.`:"•",u=i.checked!=null?!!i.checked:null,c=i.label!=null?"ordered":"bullet",h=i.spread!=null?`${i.spread}`:"true";r.openNode(s,{label:o,listType:c,spread:h,checked:u}),r.next(i.children),r.closeNode()}},toMarkdown:{match:r=>r.type.name==="list_item",runner:(r,i)=>{if(i.attrs.checked==null){n.toMarkdown.runner(r,i);return}const s=i.attrs.label,o=i.attrs.listType,u=i.attrs.spread==="true",c=i.attrs.checked;r.openNode("listItem",void 0,{label:s,listType:o,spread:u,checked:c}),r.next(i.content),r.closeNode()}}}});je(dk.node,{displayName:"NodeSchema<taskListItem>",group:"ListItem"});je(dk.ctx,{displayName:"NodeSchemaCtx<taskListItem>",group:"ListItem"});var II=mr(()=>new Or(/^\[(?<checked>\s|x)\]\s$/,(t,e,n,r)=>{const i=t.doc.resolve(n);let s=0,o=i.node(s);for(;o&&o.type.name!=="list_item";)s--,o=i.node(s);if(!o||o.attrs.checked!=null)return null;const u=e.groups?.checked==="x",c=i.before(s),h=t.tr;return h.deleteRange(n,r).setNodeMarkup(c,void 0,{...o.attrs,checked:u}),h}));je(II,{displayName:"InputRule<wrapInTaskListInputRule>",group:"ListItem"});var lq=[ak,fk].flat(),uq=[RI,II],cq=[gI],fq=[DI],_I=js(()=>AU);je(_I,{displayName:"Prose<autoInsertSpanPlugin>",group:"Prose"});var hq=js(()=>y$({}));je(hq,{displayName:"Prose<columnResizingPlugin>",group:"Prose"});var zI=js(()=>N$({allowTableNodeSelection:!0}));je(zI,{displayName:"Prose<tableEditingPlugin>",group:"Prose"});var mk=Ti("remarkGFM",()=>rq);je(mk.plugin,{displayName:"Remark<remarkGFMPlugin>",group:"Remark"});je(mk.options,{displayName:"RemarkConfig<remarkGFMPlugin>",group:"Remark"});var pq=new dr("MILKDOWN_KEEP_TABLE_ALIGN_PLUGIN");function dq(t,e){let n=0;return e.forEach((r,i,s)=>{r===t&&(n=s)}),n}var LI=js(()=>new pr({key:pq,appendTransaction:(t,e,n)=>{let r;const i=(s,o)=>{if(r||(r=n.tr),s.type.name!=="table_cell")return;const u=n.doc.resolve(o),c=u.node(u.depth),h=u.node(u.depth-1).firstChild;if(!h)return;const d=dq(s,c),g=h.maybeChild(d);if(!g)return;const y=g.attrs.alignment;y!==s.attrs.alignment&&r.setNodeMarkup(o,void 0,{...s.attrs,alignment:y})};return e.doc!==n.doc&&n.doc.descendants(i),r}}));je(LI,{displayName:"Prose<keepTableAlignPlugin>",group:"Prose"});var mq=[LI,_I,mk,zI].flat(),gq=[dk,_s,fp,Yu,Pu,hp,hk,pk,sk,up].flat(),yq=[lk,ok,uk,ck,SI,vI,kI,CI,wI,EI,TI,MI,AI,NI,OI,Kg],BI=[gq,uq,fq,cq,lq,yq,mq].flat();const gk={display:"flex",gap:6,alignItems:"center",padding:6,border:"1px solid #d4d4d8",borderRadius:6,background:"#fff",boxShadow:"0 4px 16px rgba(0,0,0,0.12)",marginTop:6},eg={flex:1,border:"1px solid #d4d4d8",borderRadius:4,padding:"4px 8px",font:"inherit",outline:"none",minWidth:0},_h={border:"1px solid #d4d4d8",background:"#fff",borderRadius:4,padding:"4px 8px",font:"inherit",fontSize:12,cursor:"pointer",color:"#3f3f46",whiteSpace:"nowrap"},xq=gk,bq=eg,hx=_h;function Sq({initialUrl:t,isEdit:e,onApply:n,onRemove:r,onClose:i}){const[s,o]=ae.useState(t),u=()=>{const c=s.trim();c!==""&&n(c)};return D.jsxs("div",{style:xq,"data-mdx-action":"link",onMouseDown:c=>c.stopPropagation(),children:[D.jsx("input",{style:bq,autoFocus:!0,placeholder:"https://…",value:s,onChange:c=>o(c.target.value),onKeyDown:c=>{c.key==="Enter"&&(c.preventDefault(),u()),c.key==="Escape"&&i()}}),D.jsx("button",{type:"button",style:{...hx,background:"#2563eb",borderColor:"#2563eb",color:"#fff"},onMouseDown:c=>c.preventDefault(),onClick:u,children:e?"Update":"Add"}),e&&r?D.jsx("button",{type:"button",style:{...hx,color:"#dc2626"},onMouseDown:c=>c.preventDefault(),onClick:r,children:"Remove"}):null,D.jsx("button",{type:"button",style:hx,onMouseDown:c=>c.preventDefault(),onClick:i,children:"Cancel"})]})}const vq={...gk,flexWrap:"wrap"},GN={fontSize:11,color:"#71717a",whiteSpace:"nowrap"};function kq({initialAlt:t,onApply:e,onClose:n}){const[r,i]=ae.useState(t),[s,o]=ae.useState(""),u=()=>e(r.trim(),s.trim()),c=h=>{h.key==="Enter"&&(h.preventDefault(),u()),h.key==="Escape"&&n()};return D.jsxs("div",{style:vq,"data-mdx-action":"image",onMouseDown:h=>h.stopPropagation(),children:[D.jsx("span",{style:GN,children:"Alt"}),D.jsx("input",{style:eg,autoFocus:!0,placeholder:"Alt text for screen readers",value:r,onChange:h=>i(h.currentTarget.value),onKeyDown:c}),D.jsx("span",{style:GN,children:"Caption"}),D.jsx("input",{style:eg,placeholder:"Caption / source (optional)",value:s,onChange:h=>o(h.currentTarget.value),onKeyDown:c}),D.jsx("button",{type:"button",style:{..._h,background:"#2563eb",borderColor:"#2563eb",color:"#fff"},onMouseDown:h=>h.preventDefault(),onClick:u,children:"Insert"}),D.jsx("button",{type:"button",style:_h,onMouseDown:h=>h.preventDefault(),onClick:n,children:"Cancel"})]})}function YN(t){return typeof t!="object"||t===null?!1:"status"in t&&t.status===501||"code"in t&&t.code==="unsupported"}const WN=new Set(["image/svg+xml","image/x-icon"]),Cq=60,wq=200,Eq=200;function QN(t){return{folder:t,cursor:void 0,seen:new Set,pages:0,busy:!1,failed:!1}}function Aq(t,e){if(!t.hasMore)return{cursor:void 0,stalled:!1};const n=t.cursor;return n===void 0||e.seen.has(n)||e.pages>=Eq?{cursor:void 0,stalled:!0}:(e.seen.add(n),{cursor:n,stalled:!1})}function Nq(t,e){if(e.length===0)return t;const n=new Map(t.map(i=>[i.path,i]));let r=!1;for(const i of e)n.has(i.path)||(n.set(i.path,i),r=!0);return r?[...n.values()].sort((i,s)=>i.name.localeCompare(s.name)):t}const Tq=[{value:"all",label:"All"},{value:"photo",label:"Photos"},{value:"graphic",label:"Graphics"},{value:"document",label:"Documents"}];function Mq(t,e){return e==="all"?!0:e==="photo"?t.startsWith("image/")&&!WN.has(t):e==="graphic"?WN.has(t):e==="document"?t==="application/pdf":!0}const Oq={position:"fixed",inset:0,background:"rgba(0,0,0,0.45)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1100},Rq={width:"min(760px, 94vw)",maxHeight:"82vh",display:"flex",flexDirection:"column",background:"#fff",border:"1px solid #d4d4d8",borderRadius:12,boxShadow:"0 16px 48px rgba(0,0,0,0.28)",overflow:"hidden",fontSize:13,color:"#27272a"},Dq={display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",borderBottom:"1px solid #ececed"},Iq={display:"flex",flexDirection:"column",gap:10,padding:"12px 16px",borderBottom:"1px solid #ececed"},Qc={display:"flex",alignItems:"center",gap:8},XN={flex:1,border:"1px solid #d4d4d8",borderRadius:6,padding:"6px 10px",font:"inherit",outline:"none"},Do={border:"1px solid #d4d4d8",background:"#fff",borderRadius:6,padding:"6px 12px",font:"inherit",cursor:"pointer",color:"#3f3f46",whiteSpace:"nowrap"},ZN={...Do,background:"#2563eb",borderColor:"#2563eb",color:"#fff"},_q={display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gridAutoRows:"max-content",gap:10,padding:16,overflowY:"auto"},eT={position:"relative",aspectRatio:"1 / 1",border:"1px solid #e4e4e7",borderRadius:8,overflow:"hidden",cursor:"pointer",background:"#fafafa",padding:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:6},tT={padding:32,textAlign:"center",color:"#a1a1aa"},zq={display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"8px 16px",borderTop:"1px solid #ececed",fontSize:12,color:"#71717a"},Lq={position:"absolute",left:0,right:0,bottom:0,padding:"4px 6px",fontSize:11,color:"#fff",background:"linear-gradient(to top, rgba(0,0,0,0.65), transparent)",textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"};function VI({media:t,context:e,field:n,accept:r="image/*,application/pdf",onSelect:i,onClose:s}){const[o,u]=ae.useState([]),[c,h]=ae.useState([]),[d,g]=ae.useState(""),[y,b]=ae.useState(""),[k,E]=ae.useState("all"),[N,M]=ae.useState(!1),[P,F]=ae.useState(!1),[U,_]=ae.useState(!1),[C,z]=ae.useState(!1),[G,J]=ae.useState(!1),[K,de]=ae.useState(null),[ce,ve]=ae.useState(!1),[_e,Y]=ae.useState(""),Q=ae.useRef(null),oe=ae.useRef(QN("")),Ce=ae.useRef(!0);ae.useEffect(()=>(Ce.current=!0,()=>{Ce.current=!1}),[]);const ze=ae.useCallback(async(fe,we=Cq)=>{if(fe.busy||oe.current!==fe)return;const ut=fe.pages===0;fe.busy=!0,fe.failed=!1,ut?M(!0):F(!0),de(null);try{const ct=await t.listMedia({folder:fe.folder||void 0,limit:we,cursor:fe.cursor});if(!Ce.current||oe.current!==fe)return;fe.pages+=1,h(an=>Nq(an,ct.folders)),u(an=>ut?ct.items:[...an,...ct.items]);const xn=Aq(ct,fe);fe.cursor=xn.cursor,_(xn.cursor!==void 0),xn.stalled&&de("Stopped loading this folder early — some files are not shown.")}catch(ct){if(!Ce.current||oe.current!==fe)return;fe.failed=!0,YN(ct)?(z(!0),_(!1)):de(ct instanceof Error?ct.message:"Failed to load media")}finally{fe.busy=!1,Ce.current&&oe.current===fe&&(M(!1),F(!1))}},[t]);ae.useEffect(()=>{const fe=QN(d);oe.current=fe,u([]),h([]),_(!1),ze(fe)},[d,ze]);const V=y.trim().toLowerCase(),j=V!==""||k!=="all";ae.useEffect(()=>{if(!j)return;const fe=oe.current;fe.busy||fe.failed||fe.cursor===void 0||ze(fe,wq)},[j,o,ze]);const ie=fe=>{b(""),g(fe)},L=async fe=>{J(!0),de(null);try{const we=await t.uploadMedia(fe,{...e,field:n,folder:d||void 0});if(we.success&&we.url){if(we.url.startsWith("./")){i(we.url,we.annotation??"");return}const ut={id:we.id??we.url,url:we.url,filename:we.filename??fe.name,annotation:we.annotation,contentType:fe.type||"application/octet-stream",folder:d||void 0};u(ct=>[ut,...ct])}else de(we.error??"Upload failed")}catch(we){YN(we)?z(!0):de(we instanceof Error?we.message:"Upload failed")}finally{J(!1)}},Se=async()=>{const fe=_e.trim();if(!fe||!t.createFolder)return;if(/[/\\:*?"<>|]/.test(fe)){de("Invalid folder name");return}const we=d?`${d}/${fe}`:fe;try{const ut=await t.createFolder(we);ut.success?h(ct=>[...ct,{name:fe,path:we}].sort((xn,an)=>xn.name.localeCompare(an.name))):de(ut.error??"Failed to create folder")}catch(ut){de(ut instanceof Error?ut.message:"Failed to create folder")}Y(""),ve(!1)},De=ae.useMemo(()=>{const fe=k==="all"?o:o.filter(we=>Mq(we.contentType,k));return V===""?fe:fe.filter(we=>we.filename.toLowerCase().includes(V))},[o,k,V]),Ne=ae.useMemo(()=>{if(!d)return[];const fe=d.split("/");return fe.map((we,ut)=>({name:we,path:fe.slice(0,ut+1).join("/")}))},[d]),We=j?[]:c;return D.jsx("div",{style:Oq,onMouseDown:s,"data-cms-ui":"",children:D.jsxs("div",{style:Rq,onMouseDown:fe=>fe.stopPropagation(),onDrop:fe=>{fe.preventDefault();const we=fe.dataTransfer.files[0];we&&L(we)},onDragOver:fe=>fe.preventDefault(),children:[D.jsxs("div",{style:Dq,children:[D.jsx("strong",{style:{fontSize:15},children:"Media Library"}),D.jsx("button",{type:"button",style:{...Do,border:"none",fontSize:18,lineHeight:1,padding:2},onClick:s,"aria-label":"Close",children:"×"})]}),D.jsxs("div",{style:Iq,children:[Ne.length>0?D.jsxs("div",{style:{...Qc,gap:4,fontSize:12,color:"#71717a"},children:[D.jsx("button",{type:"button",style:{...Do,border:"none",padding:"0 2px"},onClick:()=>ie(""),children:"root"}),Ne.map((fe,we)=>D.jsxs("span",{style:Qc,children:[D.jsx("span",{children:"/"}),we===Ne.length-1?D.jsx("span",{style:{color:"#27272a",fontWeight:600},children:fe.name}):D.jsx("button",{type:"button",style:{...Do,border:"none",padding:"0 2px"},onClick:()=>ie(fe.path),children:fe.name})]},fe.path))]}):null,D.jsxs("div",{style:Qc,children:[D.jsx("input",{style:XN,placeholder:"Search files…",value:y,onChange:fe=>b(fe.target.value)}),t.createFolder?D.jsx("button",{type:"button",style:Do,onClick:()=>ve(fe=>!fe),children:"New folder"}):null,D.jsx("button",{type:"button",style:ZN,disabled:C||G,onClick:()=>Q.current?.click(),children:G?"Uploading…":"Upload"}),D.jsx("input",{ref:Q,type:"file",accept:r,style:{display:"none"},onChange:fe=>{const we=fe.target.files?.[0];we&&L(we),fe.target.value=""}})]}),D.jsx("div",{style:{...Qc,gap:4},children:Tq.map(fe=>D.jsx("button",{type:"button",style:{...Do,padding:"3px 10px",fontSize:12,...k===fe.value?{background:"#2563eb",border:"1px solid #2563eb",color:"#fff"}:{}},onClick:()=>E(fe.value),children:fe.label},fe.value))}),ce&&t.createFolder?D.jsxs("div",{style:Qc,children:[D.jsx("input",{style:XN,autoFocus:!0,placeholder:"Folder name…",value:_e,onChange:fe=>Y(fe.target.value),onKeyDown:fe=>{fe.key==="Enter"&&Se(),fe.key==="Escape"&&(ve(!1),Y(""))}}),D.jsx("button",{type:"button",style:ZN,onClick:()=>{Se()},children:"Create"})]}):null,C?D.jsx("div",{style:{fontSize:12,color:"#a16207"},children:"Media uploads are not configured for this project."}):null,K?D.jsx("div",{style:{fontSize:12,color:"#dc2626"},children:K}):null]}),N?D.jsx("div",{style:tT,children:"Loading…"}):We.length===0&&De.length===0?D.jsx("div",{style:tT,children:P?j?"Searching…":"Loading…":j?"No matching files.":"No files yet. Upload one to get started."}):D.jsxs("div",{style:_q,children:[We.map(fe=>D.jsxs("button",{type:"button",style:eT,onClick:()=>ie(fe.path),title:fe.name,"data-cms-media-folder":fe.path,children:[D.jsx("span",{style:{fontSize:30},children:"📁"}),D.jsx("span",{style:{fontSize:12,color:"#52525b",maxWidth:"90%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:fe.name})]},fe.path)),De.map(fe=>D.jsxs("button",{type:"button",style:eT,title:fe.filename,"data-cms-media-item":fe.id,onClick:()=>i(fe.url,fe.annotation||fe.filename||"Image"),children:[fe.contentType.startsWith("image/")?D.jsx("img",{src:fe.thumbnailUrl??fe.url,alt:fe.annotation||fe.filename,style:{width:"100%",height:"100%",objectFit:"contain"}}):D.jsx("span",{style:{fontSize:30},children:fe.contentType==="application/pdf"?"📄":"📎"}),D.jsx("span",{style:Lq,children:fe.filename})]},fe.id))]}),!N&&U?D.jsx("div",{style:zq,children:P?D.jsx("span",{children:j?`Searching the whole folder… ${o.length} files scanned`:"Loading…"}):D.jsx("button",{type:"button",style:Do,onClick:()=>{ze(oe.current)},children:"Load more"})}):null,D.jsxs("div",{style:{padding:"10px 16px",borderTop:"1px solid #ececed",fontSize:12,color:"#a1a1aa",textAlign:"center"},children:["Drag and drop a file here to upload",d?` to ${d}`:"","."]})]})})}const iS={bold:!1,italic:!1,strikethrough:!1,link:!1,linkHref:null,bulletList:!1,orderedList:!1,listStyle:null,blockquote:!1,heading:null};function Bq(t){const{state:e}=t,{$from:n,from:r,to:i}=e.selection;let s=!1,o=!1,u=!1,c=!1,h=null;const d=e.storedMarks||n.marks();for(const N of d)N.type.name==="strong"&&(s=!0),N.type.name==="emphasis"&&(o=!0),N.type.name==="strike_through"&&(u=!0),N.type.name==="link"&&(c=!0,h=typeof N.attrs.href=="string"?N.attrs.href:null);r!==i&&e.doc.nodesBetween(r,i,N=>{for(const M of N.marks)M.type.name==="strong"&&(s=!0),M.type.name==="emphasis"&&(o=!0),M.type.name==="strike_through"&&(u=!0),M.type.name==="link"&&(c=!0,h=typeof M.attrs.href=="string"?M.attrs.href:null)});let g=!1,y=!1,b=null,k=!1,E=null;for(let N=n.depth;N>0;N--){const M=n.node(N);(M.type.name==="bullet_list"||M.type.name==="ordered_list")&&(M.type.name==="bullet_list"&&(g=!0),M.type.name==="ordered_list"&&(y=!0),b===null&&(b=typeof M.attrs.listStyle=="string"?M.attrs.listStyle:null)),M.type.name==="blockquote"&&(k=!0)}if(n.parent.type.name==="heading"){const N=n.parent.attrs.level;E=typeof N=="number"?N:null}return{bold:s,italic:o,strikethrough:u,link:c,linkHref:h,bulletList:g,orderedList:y,listStyle:b,blockquote:k,heading:E}}function Vq(t,e){const{$from:n}=t.state.selection;for(let r=n.depth;r>0;r--)if(n.node(r).type.name===e)return!0;return!1}function Fq(t,e){const{state:n}=t,r=n.schema.nodes.heading,i=n.schema.nodes.paragraph;if(!r||!i)return;const{$from:s}=n.selection,o=s.parent.type.name==="heading"&&s.parent.attrs.level===e,u=o?i:r,c=o?void 0:{level:e},h=s.before(s.depth),d=n.selection.$to.after(n.selection.$to.depth);t.dispatch(n.tr.setBlockType(h,d,u,c)),t.focus()}function Pq(t){const{state:e}=t,{from:n,to:r}=e.selection,i=e.schema.marks.link;if(!i)return;let s=n,o=r;e.doc.nodesBetween(n,n===r?r+1:r,(u,c)=>{if(i.isInSet(u.marks))return s=c,o=c+u.nodeSize,!1}),t.dispatch(e.tr.removeMark(s,o,i))}function jq(t,e){return t.bold===e.bold&&t.italic===e.italic&&t.strikethrough===e.strikethrough&&t.link===e.link&&t.linkHref===e.linkHref&&t.bulletList===e.bulletList&&t.orderedList===e.orderedList&&t.listStyle===e.listStyle&&t.blockquote===e.blockquote&&t.heading===e.heading}function $q(t,e){let n=0,r=iS;const i=()=>{const u=t.ctx.get(yn),c=Bq(u);jq(c,r)||(r=c,e(c))},s=t.ctx.get(yn),o=s.dispatch.bind(s);return s.dispatch=u=>{o(u),(u.selectionSet||u.docChanged)&&(cancelAnimationFrame(n),n=requestAnimationFrame(i))},i(),()=>{cancelAnimationFrame(n)}}const Uq=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],nT={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};function FI(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=48&&e<=57}function Jq(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=97&&e<=102||e>=65&&e<=70||e>=48&&e<=57}function qq(t){const e=typeof t=="string"?t.charCodeAt(0):t;return e>=97&&e<=122||e>=65&&e<=90}function rT(t){return qq(t)||FI(t)}const Hq=["","Named character references must be terminated by a semicolon","Numeric character references must be terminated by a semicolon","Named character references cannot be empty","Numeric character references cannot be empty","Named character references must be known","Numeric character references cannot be disallowed","Numeric character references cannot be outside the permissible Unicode range"];function Gg(t,e){const n=e||{},r=typeof n.additional=="string"?n.additional.charCodeAt(0):n.additional,i=[];let s=0,o=-1,u="",c,h;n.position&&("start"in n.position||"indent"in n.position?(h=n.position.indent,c=n.position.start):c=n.position);let d=(c?c.line:0)||1,g=(c?c.column:0)||1,y=k(),b;for(s--;++s<=t.length;)if(b===10&&(g=(h?h[o]:0)||1),b=t.charCodeAt(s),b===38){const M=t.charCodeAt(s+1);if(M===9||M===10||M===12||M===32||M===38||M===60||Number.isNaN(M)||r&&M===r){u+=String.fromCharCode(b),g++;continue}const P=s+1;let F=P,U=P,_;if(M===35){U=++F;const ve=t.charCodeAt(U);ve===88||ve===120?(_="hexadecimal",U=++F):_="decimal"}else _="named";let C="",z="",G="";const J=_==="named"?rT:_==="decimal"?FI:Jq;for(U--;++U<=t.length;){const ve=t.charCodeAt(U);if(!J(ve))break;G+=String.fromCharCode(ve),_==="named"&&Uq.includes(G)&&(C=G,z=fh(G))}let K=t.charCodeAt(U)===59;if(K){U++;const ve=_==="named"?fh(G):!1;ve&&(C=G,z=ve)}let de=1+U-P,ce="";if(!(!K&&n.nonTerminated===!1))if(!G)_!=="named"&&E(4,de);else if(_==="named"){if(K&&!z)E(5,1);else if(C!==G&&(U=F+C.length,de=1+U-F,K=!1),!K){const ve=C?1:3;if(n.attribute){const _e=t.charCodeAt(U);_e===61?(E(ve,de),z=""):rT(_e)?z="":E(ve,de)}else E(ve,de)}ce=z}else{K||E(2,de);let ve=Number.parseInt(G,_==="hexadecimal"?16:10);if(Kq(ve))E(7,de),ce="�";else if(ve in nT)E(6,de),ce=nT[ve];else{let _e="";Gq(ve)&&E(6,de),ve>65535&&(ve-=65536,_e+=String.fromCharCode(ve>>>10|55296),ve=56320|ve&1023),ce=_e+String.fromCharCode(ve)}}if(ce){N(),y=k(),s=U-1,g+=U-P+1,i.push(ce);const ve=k();ve.offset++,n.reference&&n.reference.call(n.referenceContext||void 0,ce,{start:y,end:ve},t.slice(P-1,U)),y=ve}else G=t.slice(P-1,U),u+=G,g+=G.length,s=U-1}else b===10&&(d++,o++,g=0),Number.isNaN(b)?N():(u+=String.fromCharCode(b),g++);return i.join("");function k(){return{line:d,column:g,offset:s+((c?c.offset:0)||0)}}function E(M,P){let F;n.warning&&(F=k(),F.column+=P,F.offset+=P,n.warning.call(n.warningContext||void 0,Hq[M],F,M))}function N(){u&&(i.push(u),n.text&&n.text.call(n.textContext||void 0,u,{start:y,end:k()}),u="")}}function Kq(t){return t>=55296&&t<=57343||t>1114111}function Gq(t){return t>=1&&t<=8||t===11||t>=13&&t<=31||t>=127&&t<=159||t>=64976&&t<=65007||(t&65535)===65535||(t&65535)===65534}const Yq=/["&'<>`]/g,Wq=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Qq=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Xq=/[|\\{}()[\]^$+*?.]/g,iT=new WeakMap;function Zq(t,e){if(t=t.replace(e.subset?eH(e.subset):Yq,r),e.subset||e.escapeOnly)return t;return t.replace(Wq,n).replace(Qq,r);function n(i,s,o){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,o.charCodeAt(s+2),e)}function r(i,s,o){return e.format(i.charCodeAt(0),o.charCodeAt(s+1),e)}}function eH(t){let e=iT.get(t);return e||(e=tH(t),iT.set(t,e)),e}function tH(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Xq,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}function nH(t){return"&#x"+t.toString(16).toUpperCase()+";"}function rH(t,e){return Zq(t,Object.assign({format:nH},e))}function iH(){return{canContainEols:["textDirective"],enter:{directiveContainer:sH,directiveContainerAttributes:dx,directiveContainerLabel:lH,directiveLeaf:aH,directiveLeafAttributes:dx,directiveText:oH,directiveTextAttributes:dx},exit:{directiveContainer:Sx,directiveContainerAttributeClassValue:gx,directiveContainerAttributeIdValue:mx,directiveContainerAttributeName:xx,directiveContainerAttributeValue:yx,directiveContainerAttributes:bx,directiveContainerLabel:uH,directiveContainerName:px,directiveLeaf:Sx,directiveLeafAttributeClassValue:gx,directiveLeafAttributeIdValue:mx,directiveLeafAttributeName:xx,directiveLeafAttributeValue:yx,directiveLeafAttributes:bx,directiveLeafName:px,directiveText:Sx,directiveTextAttributeClassValue:gx,directiveTextAttributeIdValue:mx,directiveTextAttributeName:xx,directiveTextAttributeValue:yx,directiveTextAttributes:bx,directiveTextName:px}}}function sH(t){yk.call(this,"containerDirective",t)}function aH(t){yk.call(this,"leafDirective",t)}function oH(t){yk.call(this,"textDirective",t)}function yk(t,e){this.enter({type:t,name:"",attributes:{},children:[]},e)}function px(t){const e=this.stack[this.stack.length-1];e.type==="containerDirective"||e.type==="leafDirective"||e.type,e.name=this.sliceSerialize(t)}function lH(t){this.enter({type:"paragraph",data:{directiveLabel:!0},children:[]},t)}function uH(t){this.exit(t)}function dx(){this.data.directiveAttributes=[],this.buffer()}function mx(t){this.data.directiveAttributes.push(["id",Gg(this.sliceSerialize(t),{attribute:!0})])}function gx(t){this.data.directiveAttributes.push(["class",Gg(this.sliceSerialize(t),{attribute:!0})])}function yx(t){const e=this.data.directiveAttributes;e[e.length-1][1]=Gg(this.sliceSerialize(t),{attribute:!0})}function xx(t){this.data.directiveAttributes.push([this.sliceSerialize(t),""])}function bx(){const t=this.data.directiveAttributes,e={};let n=-1;for(;++n<t.length;){const i=t[n];i[0]==="class"&&e.class?e.class+=" "+i[1]:e[i[0]]=i[1]}this.data.directiveAttributes=void 0,this.resume();const r=this.stack[this.stack.length-1];r.type==="containerDirective"||r.type==="leafDirective"||r.type,r.attributes=e}function Sx(t){this.exit(t)}function xk(t,e,n,r,i,s,o,u,c,h,d,g,y,b,k){let E,N;return M;function M(Y){return t.enter(r),t.enter(i),t.consume(Y),t.exit(i),P}function P(Y){return Y===35?(E=o,F(Y)):Y===46?(E=u,F(Y)):Y===58||Y===95||sn(Y)?(t.enter(s),t.enter(c),t.consume(Y),C):k&&Ke(Y)?Ge(t,P,"whitespace")(Y):!k&&et(Y)?Ts(t,P)(Y):_e(Y)}function F(Y){const Q=E+"Marker";return t.enter(s),t.enter(E),t.enter(Q),t.consume(Y),t.exit(Q),U}function U(Y){if(Y===null||Y===34||Y===35||Y===39||Y===46||Y===60||Y===61||Y===62||Y===96||Y===125||et(Y))return n(Y);const Q=E+"Value";return t.enter(Q),t.consume(Y),_}function _(Y){if(Y===null||Y===34||Y===39||Y===60||Y===61||Y===62||Y===96)return n(Y);if(Y===35||Y===46||Y===125||et(Y)){const Q=E+"Value";return t.exit(Q),t.exit(E),t.exit(s),P(Y)}return t.consume(Y),_}function C(Y){return Y===45||Y===46||Y===58||Y===95||Cn(Y)?(t.consume(Y),C):(t.exit(c),k&&Ke(Y)?Ge(t,z,"whitespace")(Y):!k&&et(Y)?Ts(t,z)(Y):z(Y))}function z(Y){return Y===61?(t.enter(h),t.consume(Y),t.exit(h),G):(t.exit(s),P(Y))}function G(Y){return Y===null||Y===60||Y===61||Y===62||Y===96||Y===125||k&&Ee(Y)?n(Y):Y===34||Y===39?(t.enter(d),t.enter(y),t.consume(Y),t.exit(y),N=Y,K):k&&Ke(Y)?Ge(t,G,"whitespace")(Y):!k&&et(Y)?Ts(t,G)(Y):(t.enter(g),t.enter(b),t.consume(Y),N=void 0,J)}function J(Y){return Y===null||Y===34||Y===39||Y===60||Y===61||Y===62||Y===96?n(Y):Y===125||et(Y)?(t.exit(b),t.exit(g),t.exit(s),P(Y)):(t.consume(Y),J)}function K(Y){return Y===N?(t.enter(y),t.consume(Y),t.exit(y),t.exit(d),t.exit(s),ve):(t.enter(g),de(Y))}function de(Y){return Y===N?(t.exit(g),K(Y)):Y===null?n(Y):Ee(Y)?k?n(Y):Ts(t,de)(Y):(t.enter(b),t.consume(Y),ce)}function ce(Y){return Y===N||Y===null||Ee(Y)?(t.exit(b),de(Y)):(t.consume(Y),ce)}function ve(Y){return Y===125||et(Y)?P(Y):_e(Y)}function _e(Y){return Y===125?(t.enter(i),t.consume(Y),t.exit(i),t.exit(r),e):n(Y)}}function bk(t,e,n,r,i,s,o){let u=0,c=0,h;return d;function d(N){return t.enter(r),t.enter(i),t.consume(N),t.exit(i),g}function g(N){return N===93?(t.enter(i),t.consume(N),t.exit(i),t.exit(r),e):(t.enter(s),y(N))}function y(N){if(N===93&&!c)return E(N);const M=t.enter("chunkText",{contentType:"text",previous:h});return h&&(h.next=M),h=M,b(N)}function b(N){return N===null||u>999||N===91&&++c>32?n(N):N===93&&!c--?(t.exit("chunkText"),E(N)):Ee(N)?o?n(N):(t.consume(N),t.exit("chunkText"),y):(t.consume(N),N===92?k:b)}function k(N){return N===91||N===92||N===93?(t.consume(N),u++,b):b(N)}function E(N){return t.exit(s),t.enter(i),t.consume(N),t.exit(i),t.exit(r),e}}function Sk(t,e,n,r){const i=this;return s;function s(u){return sn(u)?(t.enter(r),t.consume(u),o):n(u)}function o(u){return u===45||u===95||Cn(u)?(t.consume(u),o):(t.exit(r),i.previous===45||i.previous===95?n(u):e(u))}}const cH={tokenize:pH,concrete:!0},fH={tokenize:dH,partial:!0},hH={tokenize:mH,partial:!0},Fd={tokenize:gH,partial:!0};function pH(t,e,n){const r=this,i=r.events[r.events.length-1],s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0;let o=0,u;return c;function c(J){return t.enter("directiveContainer"),t.enter("directiveContainerFence"),t.enter("directiveContainerSequence"),h(J)}function h(J){return J===58?(t.consume(J),o++,h):o<3?n(J):(t.exit("directiveContainerSequence"),Sk.call(r,t,d,n,"directiveContainerName")(J))}function d(J){return J===91?t.attempt(fH,g,g)(J):g(J)}function g(J){return J===123?t.attempt(hH,y,y)(J):y(J)}function y(J){return Ge(t,b,"whitespace")(J)}function b(J){return t.exit("directiveContainerFence"),J===null?z(J):Ee(J)?r.interrupt?e(J):t.attempt(Fd,k,z)(J):n(J)}function k(J){return J===null?z(J):Ee(J)?t.check(Fd,F,z)(J):(t.enter("directiveContainerContent"),E(J))}function E(J){return t.attempt({tokenize:G,partial:!0},C,s?Ge(t,N,"linePrefix",s+1):N)(J)}function N(J){return J===null?C(J):Ee(J)?t.check(Fd,P,C)(J):P(J)}function M(J){if(J===null){const K=t.exit("chunkDocument");return r.parser.lazy[K.start.line]=!1,C(J)}return Ee(J)?t.check(Fd,U,_)(J):(t.consume(J),M)}function P(J){const K=t.enter("chunkDocument",{contentType:"document",previous:u});return u&&(u.next=K),u=K,M(J)}function F(J){return t.enter("directiveContainerContent"),E(J)}function U(J){t.consume(J);const K=t.exit("chunkDocument");return r.parser.lazy[K.start.line]=!1,E}function _(J){const K=t.exit("chunkDocument");return r.parser.lazy[K.start.line]=!1,C(J)}function C(J){return t.exit("directiveContainerContent"),z(J)}function z(J){return t.exit("directiveContainer"),e(J)}function G(J,K,de){let ce=0;return Ge(J,ve,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function ve(Q){return J.enter("directiveContainerFence"),J.enter("directiveContainerSequence"),_e(Q)}function _e(Q){return Q===58?(J.consume(Q),ce++,_e):ce<o?de(Q):(J.exit("directiveContainerSequence"),Ge(J,Y,"whitespace")(Q))}function Y(Q){return Q===null||Ee(Q)?(J.exit("directiveContainerFence"),K(Q)):de(Q)}}}function dH(t,e,n){return bk(t,e,n,"directiveContainerLabel","directiveContainerLabelMarker","directiveContainerLabelString",!0)}function mH(t,e,n){return xk(t,e,n,"directiveContainerAttributes","directiveContainerAttributesMarker","directiveContainerAttribute","directiveContainerAttributeId","directiveContainerAttributeClass","directiveContainerAttributeName","directiveContainerAttributeInitializerMarker","directiveContainerAttributeValueLiteral","directiveContainerAttributeValue","directiveContainerAttributeValueMarker","directiveContainerAttributeValueData",!0)}function gH(t,e,n){const r=this;return i;function i(o){return t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s}function s(o){return r.parser.lazy[r.now().line]?n(o):e(o)}}const yH={tokenize:SH},xH={tokenize:vH,partial:!0},bH={tokenize:kH,partial:!0};function SH(t,e,n){const r=this;return i;function i(d){return t.enter("directiveLeaf"),t.enter("directiveLeafSequence"),t.consume(d),s}function s(d){return d===58?(t.consume(d),t.exit("directiveLeafSequence"),Sk.call(r,t,o,n,"directiveLeafName")):n(d)}function o(d){return d===91?t.attempt(xH,u,u)(d):u(d)}function u(d){return d===123?t.attempt(bH,c,c)(d):c(d)}function c(d){return Ge(t,h,"whitespace")(d)}function h(d){return d===null||Ee(d)?(t.exit("directiveLeaf"),e(d)):n(d)}}function vH(t,e,n){return bk(t,e,n,"directiveLeafLabel","directiveLeafLabelMarker","directiveLeafLabelString",!0)}function kH(t,e,n){return xk(t,e,n,"directiveLeafAttributes","directiveLeafAttributesMarker","directiveLeafAttribute","directiveLeafAttributeId","directiveLeafAttributeClass","directiveLeafAttributeName","directiveLeafAttributeInitializerMarker","directiveLeafAttributeValueLiteral","directiveLeafAttributeValue","directiveLeafAttributeValueMarker","directiveLeafAttributeValueData",!0)}const CH={tokenize:NH,previous:AH},wH={tokenize:TH,partial:!0},EH={tokenize:MH,partial:!0};function AH(t){return t!==58||this.events[this.events.length-1][1].type==="characterEscape"}function NH(t,e,n){const r=this;return i;function i(c){return t.enter("directiveText"),t.enter("directiveTextMarker"),t.consume(c),t.exit("directiveTextMarker"),Sk.call(r,t,s,n,"directiveTextName")}function s(c){return c===58?n(c):c===91?t.attempt(wH,o,o)(c):o(c)}function o(c){return c===123?t.attempt(EH,u,u)(c):u(c)}function u(c){return t.exit("directiveText"),e(c)}}function TH(t,e,n){return bk(t,e,n,"directiveTextLabel","directiveTextLabelMarker","directiveTextLabelString")}function MH(t,e,n){return xk(t,e,n,"directiveTextAttributes","directiveTextAttributesMarker","directiveTextAttribute","directiveTextAttributeId","directiveTextAttributeClass","directiveTextAttributeName","directiveTextAttributeInitializerMarker","directiveTextAttributeValueLiteral","directiveTextAttributeValue","directiveTextAttributeValueMarker","directiveTextAttributeValueData")}function OH(){return{text:{58:CH},flow:{58:[cH,yH]}}}const tg="youtube";function RH(t){if(!t||typeof t!="object")return"";const e=Object.entries(t),n=t.id;if(typeof n=="string"&&n)return n;for(const[r,i]of e)if(i===""||i==null)return r;return""}const PI=Ju("youtube",()=>({group:"block",atom:!0,isolating:!0,selectable:!0,draggable:!1,attrs:{videoId:{default:""}},toDOM:t=>["div",{"data-youtube":t.attrs.videoId,class:"youtube-block"}],parseDOM:[{tag:"div[data-youtube]",getAttrs:t=>({videoId:t.getAttribute("data-youtube")||""})}],parseMarkdown:{match:t=>(t.type==="leafDirective"||t.type==="containerDirective"||t.type==="textDirective")&&t.name===tg,runner:(t,e,n)=>{const r=RH(e.attributes);t.addNode(n,{videoId:r})}},toMarkdown:{match:t=>t.type.name==="youtube",runner:(t,e)=>{t.addNode("leafDirective",void 0,void 0,{name:tg,attributes:{id:e.attrs.videoId}})}}}));function DH(t){const e=t.attributes,n=e&&typeof e=="object"?String(e.id??""):"";return`::${tg}{#${n}}`}const IH=function(){const t=this.data("toMarkdownExtensions")??[],e={handlers:{leafDirective:DH}};t.push(e),this.data("toMarkdownExtensions",t)},_H=Ti("remarkYoutubeDirective",()=>IH),jI=qe("insertYoutube",()=>t=>(e,n)=>{if(!t)return!1;const r=e.schema.nodes.youtube;if(!r)return!1;const i=r.create({videoId:t});return n&&n(e.tr.replaceSelectionWith(i).scrollIntoView()),!0}),sS="list",zH=/^[A-Za-z0-9_-]+$/,LH=new Set(["textDirective","leafDirective","containerDirective"]);function Pi(t){if(typeof t!="string")return null;const[e]=t.trim().split(/\s+/);return!e||!zH.test(e)?null:e}function zs(t){return Array.isArray(t?.children)?t.children:null}function vx(t){const e=zs(t);return e&&e.length>0?e[e.length-1]:void 0}function $I(t){return!t.attributes||typeof t.attributes!="object"||Array.isArray(t.attributes)?null:t.attributes}function BH(t){return Pi($I(t)?.class)}function UI(t,e){const n=zs(t);if(t?.type!=="paragraph"||n?.length!==1)return!1;const r=n[0];return r?.type!=="text"||typeof r.value!="string"?!1:e===void 0?!0:r.value===e}function VH(t){if(!UI(t))return null;const e=zs(t)?.[0];return typeof e?.value!="string"?null:/^:::list\{\.([A-Za-z0-9_-]+)\}$/.exec(e.value)?.[1]??null}function sT(t){return t?.type==="list"}function FH(t,e,n){if(UI(e[n],":::"))return e.splice(n,1),!0;const r=vx(t),i=vx(r);if(!i||i.type!=="paragraph")return!1;const s=zs(i),o=vx(i);if(!s||o?.type!=="text"||typeof o.value!="string")return!1;if(o.value===":::")s.pop();else if(o.value.endsWith(`
58
58
  :::`))o.value=o.value.slice(0,-4);else return!1;return s.length===0&&zs(r)?.pop(),!0}function PH(t){return t==="containerDirective"?":::":t==="leafDirective"?"::":":"}function jH(t){if(!t||typeof t!="object"||Array.isArray(t))return"";const e=[];for(const[n,r]of Object.entries(t))if(n==="class"&&typeof r=="string")for(const i of r.split(/\s+/).filter(Boolean))e.push(`.${i}`);else n==="id"&&typeof r=="string"?e.push(`#${r}`):r===""||r==null?e.push(n):e.push(`${n}="${String(r)}"`);return e.length>0?`{${e.join(" ")}}`:""}function Xc(t){return{type:"text",value:t}}function $H(t){const e=PH(t.type),n=typeof t.name=="string"?t.name:"",r=zs(t)??[],i=jH(t.attributes);if(t.type==="textDirective"){const o=[Xc(`${e}${n}`)];return r.length>0&&o.push(Xc("["),...r,Xc("]")),i&&o.push(Xc(i)),o}return[{type:"paragraph",children:[Xc(`${e}${n}${i}`)]},...r]}function JI(t){const e=zs(t);if(e)for(let n=0;n<e.length;n++){const r=e[n];if(!r)continue;if(r.type==="containerDirective"){const o=r,u=o.name===sS?BH(o):null,c=zs(o),h=c?.length===1?c[0]:void 0;if(u&&sT(h)){e[n]={...h,listStyle:u};continue}}const i=VH(r),s=e[n+1];if(i&&sT(s)&&FH(s,e,n+2)){e.splice(n,1),e[n]={...s,listStyle:i};continue}if(JI(r),LH.has(r.type)){if(r.name===tg)continue;const o=r.type==="containerDirective"&&r.name===sS?zs(r)??[]:$H(r);e.splice(n,1,...o),n+=o.length-1}}}function UH(t){return!!(t&&typeof t=="object"&&"containerFlow"in t&&typeof t.containerFlow=="function")}const JH=(t,e,n,r)=>{if(!UH(n))return"";const i=Pi($I(t)?.class),s=n.containerFlow(t,r);return`:::list${i?`{.${i}}`:""}
59
59
  ${s}
60
60
  :::`},qH=function(){const t=this.data("toMarkdownExtensions")??[],e={handlers:{containerDirective:JH}};return t.push(e),this.data("toMarkdownExtensions",t),n=>{JI(n)}},HH=Ti("remarkListDirective",()=>qH),KH=function(){const t=this.data("micromarkExtensions")??[];t.push(OH()),this.data("micromarkExtensions",t);const e=this.data("fromMarkdownExtensions")??[];e.push(iH()),this.data("fromMarkdownExtensions",e)},GH=Ti("remarkDirective",()=>KH);function qI(t){return t&&typeof t=="object"?t:{}}function YH(t){if(t)return{name:sS,attributes:{class:t}}}function HI(t,e,n){const r=Pi(e.attrs.listStyle),i=YH(r);i&&t.openNode("containerDirective",void 0,i),t.openNode("list",void 0,n).next(e.content).closeNode(),i&&t.closeNode()}const WH=gl.extendSchema(t=>e=>{const n=t(e);return{...n,attrs:{...n.attrs,listStyle:{default:null,validate:"string|null"}},parseDOM:[{tag:"ul",getAttrs:r=>{const i=qI(n.parseDOM?.[0]?.getAttrs?.(r)),s=r instanceof HTMLElement?Pi(r.className):null;return{...i,listStyle:s}}}],toDOM:r=>{const i=Pi(r.attrs.listStyle);return["ul",{...e.get(Bg.key)(r),...i?{class:i}:{},"data-spread":r.attrs.spread},0]},parseMarkdown:{match:({type:r,ordered:i})=>r==="list"&&!i,runner:(r,i,s)=>{r.openNode(s,{spread:i.spread===!0,listStyle:Pi(i.listStyle)}).next(i.children).closeNode()}},toMarkdown:{match:r=>r.type.name==="bullet_list",runner:(r,i)=>{HI(r,i,{ordered:!1,spread:i.attrs.spread===!0})}}}}),QH=yl.extendSchema(t=>e=>{const n=t(e);return{...n,attrs:{...n.attrs,listStyle:{default:null,validate:"string|null"}},parseDOM:[{tag:"ol",getAttrs:r=>{const i=qI(n.parseDOM?.[0]?.getAttrs?.(r)),s=r instanceof HTMLElement?Pi(r.className):null;return{...i,listStyle:s}}}],toDOM:r=>{const i=Pi(r.attrs.listStyle);return["ol",{...e.get(Fg.key)(r),...r.attrs.order===1?{}:{start:r.attrs.order},...i?{class:i}:{},"data-spread":r.attrs.spread},0]},parseMarkdown:{match:({type:r,ordered:i})=>r==="list"&&!!i,runner:(r,i,s)=>{r.openNode(s,{order:typeof i.start=="number"?i.start:1,spread:i.spread===!0,listStyle:Pi(i.listStyle)}).next(i.children).closeNode()}},toMarkdown:{match:r=>r.type.name==="ordered_list",runner:(r,i)=>{HI(r,i,{ordered:!0,start:typeof i.attrs.order=="number"?i.attrs.order:1,spread:i.attrs.spread===!0})}}}}),KI=qe("SetListStyle",()=>t=>(e,n)=>{const r=new Set([e.schema.nodes.bullet_list,e.schema.nodes.ordered_list].filter(Boolean));if(r.size===0)return!1;const i=Pi(t),s=new Map,{from:o,to:u,$from:c}=e.selection;for(let h=c.depth;h>0;h--){const d=c.node(h);if(r.has(d.type)){s.set(c.before(h),d);break}}if(e.doc.nodesBetween(o,u,(h,d)=>{r.has(h.type)&&s.set(d,h)}),s.size===0)return!1;if(n){let h=e.tr;for(const[d,g]of s)h=h.setNodeMarkup(d,void 0,{...g.attrs,listStyle:i});n(h.scrollIntoView())}return!0}),XH=[GH,HH,WH,QH,KI].flat(),ZH=/^[A-Za-z0-9_-]{11}$/,eK=/(?:youtu\.be\/|\/(?:embed|shorts|v)\/)([A-Za-z0-9_-]{11})/;function tK(t){const e=t.trim();if(!e)return null;if(ZH.test(e))return e;const n=/[?&]v=([A-Za-z0-9_-]{11})/.exec(e);if(n)return n[1]??null;const r=eK.exec(e);return r?r[1]??null:null}const nK={fontSize:11,color:"#dc2626",whiteSpace:"nowrap"};function rK({onApply:t,onClose:e}){const[n,r]=ae.useState(""),[i,s]=ae.useState(!1),o=()=>{const u=tK(n);if(!u){s(!0);return}t(u)};return D.jsxs("div",{style:gk,"data-mdx-action":"youtube",onMouseDown:u=>u.stopPropagation(),children:[D.jsx("input",{style:eg,autoFocus:!0,placeholder:"YouTube URL or ID",value:n,onChange:u=>{r(u.currentTarget.value),i&&s(!1)},onKeyDown:u=>{u.key==="Enter"&&(u.preventDefault(),o()),u.key==="Escape"&&e()}}),i?D.jsx("span",{style:nK,children:"No video id found"}):null,D.jsx("button",{type:"button",style:{..._h,background:"#2563eb",borderColor:"#2563eb",color:"#fff"},onMouseDown:u=>u.preventDefault(),onClick:o,children:"Insert"}),D.jsx("button",{type:"button",style:_h,onMouseDown:u=>u.preventDefault(),onClick:e,children:"Cancel"})]})}function iK(t){const[e,n]=ae.useState(iS);return ae.useEffect(()=>{if(!t){n(iS);return}return $q(t,n)},[t]),e}function kx(t,e){Fq(t.ctx.get(yn),e)}function aT(t,e){const n=t.ctx.get(yn);Vq(n,e==="bullet"?"bullet_list":"ordered_list")?t.action(Ci(jg.key)):t.action(Ci(e==="bullet"?Vg.key:Pg.key))}function sK(t,e){t.ctx.get(yn).focus(),t.action(Ci(KI.key,e))}function aK(t,e,n,r){t.action(i=>{const s=i.get(yn),o=s.state.schema.nodes.image;o&&(s.focus(),s.dispatch(s.state.tr.replaceSelectionWith(o.create({src:e,alt:n,title:r})).scrollIntoView()))})}function oK(t,e){t.action(Ci(jI.key,e))}const lK={flexShrink:0,position:"sticky",top:0,zIndex:1},uK={display:"flex",flexWrap:"wrap",alignItems:"center",gap:3,padding:"4px 6px",borderBottom:"1px solid #ececed",background:"#fafafa"},Cx={width:1,height:18,background:"#e4e4e7",margin:"0 3px"},GI={border:"1px solid transparent",background:"transparent",borderRadius:4,padding:"2px 7px",font:"inherit",fontSize:12,lineHeight:1.4,cursor:"pointer",color:"#52525b"},cK={...GI,background:"#2563eb",borderColor:"#2563eb",color:"#fff"},fK={border:"1px solid #d4d4d8",borderRadius:4,background:"#fff",color:"#3f3f46",font:"inherit",fontSize:12,lineHeight:1.4,padding:"2px 6px",maxWidth:150};function lr({active:t,title:e,onClick:n,style:r,children:i}){return D.jsx("button",{type:"button",title:e,"data-mdx-action":"format",onMouseDown:s=>s.preventDefault(),onClick:n,style:{...t?cK:GI,...r},children:i})}function YI({editor:t,listStyles:e,media:n,mediaContext:r,field:i,onInsertComponent:s}){const o=iK(t),[u,c]=ae.useState(!1),[h,d]=ae.useState(!1),[g,y]=ae.useState(!1),[b,k]=ae.useState(null),E=t===null,N=(e?.length??0)>0,M=o.bulletList||o.orderedList,P=o.listStyle&&e?.some(_=>_.class===o.listStyle)?o.listStyle:"",F=_=>{if(c(!1),!t)return;t.ctx.get(yn).focus(),t.action(Ci(o.link?iv.key:rv.key,{href:_}))},U=()=>{if(c(!1),!t)return;const _=t.ctx.get(yn);_.focus(),Pq(_)};return D.jsxs("div",{style:lK,children:[D.jsxs("div",{style:uK,children:[D.jsx(lr,{active:o.bold,title:"Bold",onClick:()=>t?.action(Ci(Ig.key)),style:{fontWeight:700},children:"B"}),D.jsx(lr,{active:o.italic,title:"Italic",onClick:()=>t?.action(Ci(Dg.key)),style:{fontStyle:"italic"},children:"I"}),D.jsx(lr,{active:o.strikethrough,title:"Strikethrough",onClick:()=>t?.action(Ci(Kg.key)),style:{textDecoration:"line-through"},children:"S"}),D.jsx("span",{style:Cx}),D.jsx(lr,{active:o.heading===2,title:"Heading 2",onClick:()=>t&&kx(t,2),children:"H2"}),D.jsx(lr,{active:o.heading===3,title:"Heading 3",onClick:()=>t&&kx(t,3),children:"H3"}),D.jsx(lr,{active:o.heading===4,title:"Heading 4",onClick:()=>t&&kx(t,4),children:"H4"}),D.jsx("span",{style:Cx}),D.jsx(lr,{active:o.bulletList,title:"Bullet list",onClick:()=>t&&aT(t,"bullet"),children:"• List"}),D.jsx(lr,{active:o.orderedList,title:"Numbered list",onClick:()=>t&&aT(t,"ordered"),children:"1. List"}),N?D.jsxs("select",{title:"List style","aria-label":"List style",disabled:E||!M,value:P,onChange:_=>{t&&sK(t,_.currentTarget.value||null)},style:{...fK,opacity:E||!M?.55:1,cursor:E||!M?"not-allowed":"default"},children:[D.jsx("option",{value:"",children:"Default"}),e?.map(_=>D.jsx("option",{value:_.class,children:_.label},_.class))]}):null,D.jsx(lr,{active:o.blockquote,title:"Quote",onClick:()=>t?.action(Ci(Lg.key)),children:"❝"}),D.jsx(lr,{title:"Insert table",onClick:()=>t?.action(Ci(ck.key,{row:3,col:3})),children:"▦ Table"}),D.jsx(lr,{active:g,title:"Insert YouTube",onClick:()=>!E&&y(_=>!_),children:"YouTube"}),D.jsx("span",{style:Cx}),D.jsx(lr,{active:o.link||u,title:"Link",onClick:()=>!E&&c(_=>!_),children:"🔗 Link"}),n?D.jsx(lr,{title:"Insert image",onClick:()=>!E&&d(!0),children:"🖼 Image"}):null,s?D.jsxs(D.Fragment,{children:[D.jsx("span",{style:{flex:1}}),D.jsx(lr,{title:"Insert component block",onClick:()=>!E&&s(),style:{border:"1px solid #d4d4d8",color:"#3f3f46"},children:"+ Component"})]}):null]}),u?D.jsx("div",{style:{padding:"0 6px"},children:D.jsx(Sq,{initialUrl:o.linkHref??"https://",isEdit:o.link,onApply:F,onRemove:o.link?U:void 0,onClose:()=>c(!1)})}):null,g?D.jsx("div",{style:{padding:"0 6px"},children:D.jsx(rK,{onApply:_=>{y(!1),t&&oK(t,_)},onClose:()=>y(!1)})}):null,b?D.jsx("div",{style:{padding:"0 6px"},children:D.jsx(kq,{initialAlt:b.alt,onApply:(_,C)=>{const{url:z}=b;k(null),t&&aK(t,z,_,C)},onClose:()=>k(null)})}):null,h&&n?D.jsx(VI,{media:n,context:r,field:i,accept:"image/*",onSelect:(_,C)=>{d(!1),t&&k({url:_,alt:C??""})},onClose:()=>d(!1)}):null]})}function hK(){return{enter:{mdxFlowExpression:dK,mdxTextExpression:mK},exit:{mdxFlowExpression:oT,mdxFlowExpressionChunk:lT,mdxTextExpression:oT,mdxTextExpressionChunk:lT}}}function pK(){return{handlers:{mdxFlowExpression:uT,mdxTextExpression:uT},unsafe:[{character:"{",inConstruct:["phrasing"]},{atBreak:!0,character:"{"}]}}function dK(t){this.enter({type:"mdxFlowExpression",value:""},t),this.buffer()}function mK(t){this.enter({type:"mdxTextExpression",value:""},t),this.buffer()}function oT(t){const e=this.resume(),n=t.estree,r=this.stack[this.stack.length-1];r.type==="mdxFlowExpression"||r.type,this.exit(t),r.value=e,n&&(r.data={estree:n})}function lT(t){this.config.enter.data.call(this,t),this.config.exit.data.call(this,t)}function uT(t,e,n){const r=t.value||"";return"{"+n.indentLines(r,function(s,o,u){return(o===0||u?"":" ")+s})+"}"}const WI=" ";function gK(){return{canContainEols:["mdxJsxTextElement"],enter:{mdxJsxFlowTag:r,mdxJsxFlowTagClosingMarker:i,mdxJsxFlowTagAttribute:g,mdxJsxFlowTagExpressionAttribute:y,mdxJsxFlowTagAttributeValueLiteral:t,mdxJsxFlowTagAttributeValueExpression:t,mdxJsxFlowTagSelfClosingMarker:o,mdxJsxTextTag:r,mdxJsxTextTagClosingMarker:i,mdxJsxTextTagAttribute:g,mdxJsxTextTagExpressionAttribute:y,mdxJsxTextTagAttributeValueLiteral:t,mdxJsxTextTagAttributeValueExpression:t,mdxJsxTextTagSelfClosingMarker:o},exit:{mdxJsxFlowTagClosingMarker:u,mdxJsxFlowTagNamePrimary:c,mdxJsxFlowTagNameMember:h,mdxJsxFlowTagNameLocal:d,mdxJsxFlowTagExpressionAttribute:b,mdxJsxFlowTagExpressionAttributeValue:n,mdxJsxFlowTagAttributeNamePrimary:k,mdxJsxFlowTagAttributeNameLocal:E,mdxJsxFlowTagAttributeValueLiteral:N,mdxJsxFlowTagAttributeValueLiteralValue:n,mdxJsxFlowTagAttributeValueExpression:M,mdxJsxFlowTagAttributeValueExpressionValue:n,mdxJsxFlowTagSelfClosingMarker:P,mdxJsxFlowTag:F,mdxJsxTextTagClosingMarker:u,mdxJsxTextTagNamePrimary:c,mdxJsxTextTagNameMember:h,mdxJsxTextTagNameLocal:d,mdxJsxTextTagExpressionAttribute:b,mdxJsxTextTagExpressionAttributeValue:n,mdxJsxTextTagAttributeNamePrimary:k,mdxJsxTextTagAttributeNameLocal:E,mdxJsxTextTagAttributeValueLiteral:N,mdxJsxTextTagAttributeValueLiteralValue:n,mdxJsxTextTagAttributeValueExpression:M,mdxJsxTextTagAttributeValueExpressionValue:n,mdxJsxTextTagSelfClosingMarker:P,mdxJsxTextTag:F}};function t(){this.buffer()}function e(z){return{line:z.line,column:z.column,offset:z.offset}}function n(z){this.config.enter.data.call(this,z),this.config.exit.data.call(this,z)}function r(z){const G={name:void 0,attributes:[],close:!1,selfClosing:!1,start:z.start,end:z.end};this.data.mdxJsxTagStack||(this.data.mdxJsxTagStack=[]),this.data.mdxJsxTag=G,this.buffer()}function i(z){if(this.data.mdxJsxTagStack.length===0)throw new xt("Unexpected closing slash `/` in tag, expected an open tag first",{start:z.start,end:z.end},"mdast-util-mdx-jsx:unexpected-closing-slash")}function s(z){if(this.data.mdxJsxTag.close)throw new xt("Unexpected attribute in closing tag, expected the end of the tag",{start:z.start,end:z.end},"mdast-util-mdx-jsx:unexpected-attribute")}function o(z){if(this.data.mdxJsxTag.close)throw new xt("Unexpected self-closing slash `/` in closing tag, expected the end of the tag",{start:z.start,end:z.end},"mdast-util-mdx-jsx:unexpected-self-closing-slash")}function u(){const z=this.data.mdxJsxTag;z.close=!0}function c(z){const G=this.data.mdxJsxTag;G.name=this.sliceSerialize(z)}function h(z){const G=this.data.mdxJsxTag;G.name+="."+this.sliceSerialize(z)}function d(z){const G=this.data.mdxJsxTag;G.name+=":"+this.sliceSerialize(z)}function g(z){const G=this.data.mdxJsxTag;s.call(this,z),G.attributes.push({type:"mdxJsxAttribute",name:"",value:null,position:{start:e(z.start),end:void 0}})}function y(z){const G=this.data.mdxJsxTag;s.call(this,z),G.attributes.push({type:"mdxJsxExpressionAttribute",value:"",position:{start:e(z.start),end:void 0}}),this.buffer()}function b(z){const G=this.data.mdxJsxTag,J=G.attributes[G.attributes.length-1];J.type;const K=z.estree;J.value=this.resume(),J.position,J.position.end=e(z.end),K&&(J.data={estree:K})}function k(z){const G=this.data.mdxJsxTag,J=G.attributes[G.attributes.length-1];J.type,J.name=this.sliceSerialize(z),J.position,J.position.end=e(z.end)}function E(z){const G=this.data.mdxJsxTag,J=G.attributes[G.attributes.length-1];J.type,J.name+=":"+this.sliceSerialize(z),J.position,J.position.end=e(z.end)}function N(z){const G=this.data.mdxJsxTag,J=G.attributes[G.attributes.length-1];J.value=Gg(this.resume(),{nonTerminated:!1}),J.position,J.position.end=e(z.end)}function M(z){const G=this.data.mdxJsxTag,J=G.attributes[G.attributes.length-1];J.type;const K={type:"mdxJsxAttributeValueExpression",value:this.resume()},de=z.estree;de&&(K.data={estree:de}),J.value=K,J.position,J.position.end=e(z.end)}function P(){const z=this.data.mdxJsxTag;z.selfClosing=!0}function F(z){const G=this.data.mdxJsxTag,J=this.data.mdxJsxTagStack,K=J[J.length-1];if(G.close&&K.name!==G.name)throw new xt("Unexpected closing tag `"+C(G)+"`, expected corresponding closing tag for `"+C(K)+"` ("+Ms(K)+")",{start:z.start,end:z.end},"mdast-util-mdx-jsx:end-tag-mismatch");this.resume(),G.close?J.pop():this.enter({type:z.type==="mdxJsxTextTag"?"mdxJsxTextElement":"mdxJsxFlowElement",name:G.name||null,attributes:G.attributes,children:[]},z,U),G.selfClosing||G.close?this.exit(z,_):J.push(G)}function U(z,G){const J=this.data.mdxJsxTagStack,K=J[J.length-1],de=z?" before the end of `"+z.type+"`":"",ce=z?{start:z.start,end:z.end}:void 0;throw new xt("Expected a closing tag for `"+C(K)+"` ("+Ms({start:G.start,end:G.end})+")"+de,ce,"mdast-util-mdx-jsx:end-tag-mismatch")}function _(z,G){const J=this.data.mdxJsxTag;throw new xt("Expected the closing tag `"+C(J)+"` either after the end of `"+G.type+"` ("+Ms(G.end)+") or another opening tag after the start of `"+G.type+"` ("+Ms(G.start)+")",{start:z.start,end:z.end},"mdast-util-mdx-jsx:end-tag-mismatch")}function C(z){return"<"+(z.close?"/":"")+(z.name||"")+">"}}function yK(t){const e=t||{},n=e.quote||'"',r=e.quoteSmart||!1,i=e.tightSelfClosing||!1,s=e.printWidth||Number.POSITIVE_INFINITY,o=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize attribute values with `"+n+"` for `options.quote`, expected `\"`, or `'`");return u.peek=bK,{handlers:{mdxJsxFlowElement:u,mdxJsxTextElement:u},unsafe:[{character:"<",inConstruct:["phrasing"]},{atBreak:!0,character:"<"}],fences:!0,resourceLink:!0};function u(c,h,d,g){const y=c.type==="mdxJsxFlowElement",b=c.name?!c.children||c.children.length===0:!1,k=QI(d),E=XI(k),N=d.createTracker(g),M=d.createTracker(g),P=[],F=(y?E:"")+"<"+(c.name||""),U=d.enter(c.type);if(N.move(F),M.move(F),c.attributes&&c.attributes.length>0){if(!c.name)throw new Error("Cannot serialize fragment w/ attributes");let J=-1;for(;++J<c.attributes.length;){const K=c.attributes[J];let de;if(K.type==="mdxJsxExpressionAttribute")de="{"+(K.value||"")+"}";else{if(!K.name)throw new Error("Cannot serialize attribute w/o name");const ce=K.value,ve=K.name;let _e="";if(ce!=null)if(typeof ce=="object")_e="{"+(ce.value||"")+"}";else{const Y=r&&Zm(ce,n)>Zm(ce,o)?o:n;_e=Y+rH(ce,{subset:[Y]})+Y}de=ve+(_e?"=":"")+_e}P.push(de)}}let _=!1;const C=P.join(" ");y&&(/\r?\n|\r/.test(C)||N.current().now.column+C.length+(b?i?2:3:1)>s)&&(_=!0);let z=N,G=F;if(_){z=M;let J=-1;for(;++J<P.length;)P[J]=E+WI+P[J];G+=z.move(`
@@ -8,7 +8,7 @@
8
8
  html, body, #nua-studio-root { height: 100%; margin: 0; }
9
9
  body { background: #f8fafc; }
10
10
  </style>
11
- <script type="module" crossorigin src="./assets/index-BQCG-xJo.js"></script>
11
+ <script type="module" crossorigin src="./assets/index-D34CFBTB.js"></script>
12
12
  <link rel="stylesheet" crossorigin href="./assets/index-GbeaN-XG.css">
13
13
  </head>
14
14
  <body>
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "directory": "packages/cms-studio"
15
15
  },
16
16
  "license": "Apache-2.0",
17
- "version": "0.50.0",
17
+ "version": "0.50.1",
18
18
  "module": "src/index.ts",
19
19
  "types": "src/index.ts",
20
20
  "type": "module",
@@ -29,11 +29,11 @@
29
29
  "cms-studio": "src/cli.ts"
30
30
  },
31
31
  "dependencies": {
32
- "@nuasite/cms-core": "0.50.0",
33
- "@nuasite/cms-sidecar": "0.50.0"
32
+ "@nuasite/cms-core": "0.50.1",
33
+ "@nuasite/cms-sidecar": "0.50.1"
34
34
  },
35
35
  "devDependencies": {
36
- "@nuasite/collections-admin": "0.50.0",
36
+ "@nuasite/collections-admin": "0.50.1",
37
37
  "@types/bun": "1.3.11",
38
38
  "@types/react": "^19.2.7",
39
39
  "@types/react-dom": "^19.2.3",