@creaditor/newsletter-starterkit 1.0.40 → 1.0.41

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.
@@ -1675,7 +1675,7 @@
1675
1675
  .container {
1676
1676
  margin: auto;
1677
1677
  }
1678
- `),customElements.get("cdtr-table-cells-editor")||customElements.define("cdtr-table-cells-editor",ye);var Ae=n(81318),we=n(81570),ve=n(85194);const xe=Ae.YY.create({name:"smilieReplacer",addInputRules:()=>[(0,Ae.Yp)({find:/-___- $/,replace:"😑 "}),(0,Ae.Yp)({find:/:'-\) $/,replace:"😂 "}),(0,Ae.Yp)({find:/':-\) $/,replace:"😅 "}),(0,Ae.Yp)({find:/':-D $/,replace:"😅 "}),(0,Ae.Yp)({find:/>:-\) $/,replace:"😆 "}),(0,Ae.Yp)({find:/-__- $/,replace:"😑 "}),(0,Ae.Yp)({find:/':-\( $/,replace:"😓 "}),(0,Ae.Yp)({find:/:'-\( $/,replace:"😢 "}),(0,Ae.Yp)({find:/>:-\( $/,replace:"😠 "}),(0,Ae.Yp)({find:/O:-\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/0:-3 $/,replace:"😇 "}),(0,Ae.Yp)({find:/0:-\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/0;\^\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/O;-\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/0;-\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/O:-3 $/,replace:"😇 "}),(0,Ae.Yp)({find:/:'\) $/,replace:"😂 "}),(0,Ae.Yp)({find:/:-D $/,replace:"😃 "}),(0,Ae.Yp)({find:/':\) $/,replace:"😅 "}),(0,Ae.Yp)({find:/'=\) $/,replace:"😅 "}),(0,Ae.Yp)({find:/':D $/,replace:"😅 "}),(0,Ae.Yp)({find:/'=D $/,replace:"😅 "}),(0,Ae.Yp)({find:/>:\) $/,replace:"😆 "}),(0,Ae.Yp)({find:/>;\) $/,replace:"😆 "}),(0,Ae.Yp)({find:/>=\) $/,replace:"😆 "}),(0,Ae.Yp)({find:/;-\) $/,replace:"😉 "}),(0,Ae.Yp)({find:/\*-\) $/,replace:"😉 "}),(0,Ae.Yp)({find:/;-\] $/,replace:"😉 "}),(0,Ae.Yp)({find:/;\^\) $/,replace:"😉 "}),(0,Ae.Yp)({find:/B-\) $/,replace:"😎 "}),(0,Ae.Yp)({find:/8-\) $/,replace:"😎 "}),(0,Ae.Yp)({find:/B-D $/,replace:"😎 "}),(0,Ae.Yp)({find:/8-D $/,replace:"😎 "}),(0,Ae.Yp)({find:/:-\* $/,replace:"😘 "}),(0,Ae.Yp)({find:/:\^\* $/,replace:"😘 "}),(0,Ae.Yp)({find:/:-\) $/,replace:"🙂 "}),(0,Ae.Yp)({find:/-_- $/,replace:"😑 "}),(0,Ae.Yp)({find:/:-X $/,replace:"😶 "}),(0,Ae.Yp)({find:/:-# $/,replace:"😶 "}),(0,Ae.Yp)({find:/:-x $/,replace:"😶 "}),(0,Ae.Yp)({find:/>.< $/,replace:"😣 "}),(0,Ae.Yp)({find:/:-O $/,replace:"😮 "}),(0,Ae.Yp)({find:/:-o $/,replace:"😮 "}),(0,Ae.Yp)({find:/O_O $/,replace:"😮 "}),(0,Ae.Yp)({find:/>:O $/,replace:"😮 "}),(0,Ae.Yp)({find:/:-P $/,replace:"😛 "}),(0,Ae.Yp)({find:/:-p $/,replace:"😛 "}),(0,Ae.Yp)({find:/:-Þ $/,replace:"😛 "}),(0,Ae.Yp)({find:/:-þ $/,replace:"😛 "}),(0,Ae.Yp)({find:/:-b $/,replace:"😛 "}),(0,Ae.Yp)({find:/>:P $/,replace:"😜 "}),(0,Ae.Yp)({find:/X-P $/,replace:"😜 "}),(0,Ae.Yp)({find:/x-p $/,replace:"😜 "}),(0,Ae.Yp)({find:/':\( $/,replace:"😓 "}),(0,Ae.Yp)({find:/'=\( $/,replace:"😓 "}),(0,Ae.Yp)({find:/>:\\ $/,replace:"😕 "}),(0,Ae.Yp)({find:/>:\/ $/,replace:"😕 "}),(0,Ae.Yp)({find:/:-\/ $/,replace:"😕 "}),(0,Ae.Yp)({find:/:-. $/,replace:"😕 "}),(0,Ae.Yp)({find:/>:\[ $/,replace:"😞 "}),(0,Ae.Yp)({find:/:-\( $/,replace:"😞 "}),(0,Ae.Yp)({find:/:-\[ $/,replace:"😞 "}),(0,Ae.Yp)({find:/:'\( $/,replace:"😢 "}),(0,Ae.Yp)({find:/;-\( $/,replace:"😢 "}),(0,Ae.Yp)({find:/#-\) $/,replace:"😵 "}),(0,Ae.Yp)({find:/%-\) $/,replace:"😵 "}),(0,Ae.Yp)({find:/X-\) $/,replace:"😵 "}),(0,Ae.Yp)({find:/>:\( $/,replace:"😠 "}),(0,Ae.Yp)({find:/0:3 $/,replace:"😇 "}),(0,Ae.Yp)({find:/0:\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/O:\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/O=\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/O:3 $/,replace:"😇 "}),(0,Ae.Yp)({find:/<\/3 $/,replace:"💔 "}),(0,Ae.Yp)({find:/:D $/,replace:"😃 "}),(0,Ae.Yp)({find:/=D $/,replace:"😃 "}),(0,Ae.Yp)({find:/;\) $/,replace:"😉 "}),(0,Ae.Yp)({find:/\*\) $/,replace:"😉 "}),(0,Ae.Yp)({find:/;\] $/,replace:"😉 "}),(0,Ae.Yp)({find:/;D $/,replace:"😉 "}),(0,Ae.Yp)({find:/B\) $/,replace:"😎 "}),(0,Ae.Yp)({find:/8\) $/,replace:"😎 "}),(0,Ae.Yp)({find:/:\* $/,replace:"😘 "}),(0,Ae.Yp)({find:/=\* $/,replace:"😘 "}),(0,Ae.Yp)({find:/:\) $/,replace:"🙂 "}),(0,Ae.Yp)({find:/=\] $/,replace:"🙂 "}),(0,Ae.Yp)({find:/:\] $/,replace:"🙂 "}),(0,Ae.Yp)({find:/:X $/,replace:"😶 "}),(0,Ae.Yp)({find:/:# $/,replace:"😶 "}),(0,Ae.Yp)({find:/=X $/,replace:"😶 "}),(0,Ae.Yp)({find:/=x $/,replace:"😶 "}),(0,Ae.Yp)({find:/:x $/,replace:"😶 "}),(0,Ae.Yp)({find:/=# $/,replace:"😶 "}),(0,Ae.Yp)({find:/:O $/,replace:"😮 "}),(0,Ae.Yp)({find:/:o $/,replace:"😮 "}),(0,Ae.Yp)({find:/:P $/,replace:"😛 "}),(0,Ae.Yp)({find:/=P $/,replace:"😛 "}),(0,Ae.Yp)({find:/:p $/,replace:"😛 "}),(0,Ae.Yp)({find:/=p $/,replace:"😛 "}),(0,Ae.Yp)({find:/:Þ $/,replace:"😛 "}),(0,Ae.Yp)({find:/:þ $/,replace:"😛 "}),(0,Ae.Yp)({find:/:b $/,replace:"😛 "}),(0,Ae.Yp)({find:/d: $/,replace:"😛 "}),(0,Ae.Yp)({find:/:\/ $/,replace:"😕 "}),(0,Ae.Yp)({find:/:\\ $/,replace:"😕 "}),(0,Ae.Yp)({find:/=\/ $/,replace:"😕 "}),(0,Ae.Yp)({find:/=\\ $/,replace:"😕 "}),(0,Ae.Yp)({find:/:L $/,replace:"😕 "}),(0,Ae.Yp)({find:/=L $/,replace:"😕 "}),(0,Ae.Yp)({find:/:\( $/,replace:"😞 "}),(0,Ae.Yp)({find:/:\[ $/,replace:"😞 "}),(0,Ae.Yp)({find:/=\( $/,replace:"😞 "}),(0,Ae.Yp)({find:/;\( $/,replace:"😢 "}),(0,Ae.Yp)({find:/D: $/,replace:"😨 "}),(0,Ae.Yp)({find:/:\$ $/,replace:"😳 "}),(0,Ae.Yp)({find:/=\$ $/,replace:"😳 "}),(0,Ae.Yp)({find:/#\) $/,replace:"😵 "}),(0,Ae.Yp)({find:/%\) $/,replace:"😵 "}),(0,Ae.Yp)({find:/X\) $/,replace:"😵 "}),(0,Ae.Yp)({find:/:@ $/,replace:"😠 "}),(0,Ae.Yp)({find:/=\) $/,replace:"🙂 "}),(0,Ae.Yp)({find:/<3 $/,replace:"❤️ "}),(0,Ae.Yp)({find:/ש”ח $/,replace:"₪ "}),(0,Ae.Yp)({find:/ש״ח $/,replace:"₪ "}),(0,Ae.Yp)({find:/ש"ח $/,replace:"₪ "})]});var ke=n(73686);const Ce=function(e){const t=/(#[0-9a-f]{3,6})\b/gi,n=[];return e.descendants((e,r)=>{e.text&&Array.from(e.text.matchAll(t)).forEach(e=>{const t=e[0],o=e.index||0,i=r+o,s=i+t.length,a=ke.NZ.inline(i,s,{class:"color",style:`--color: ${t}`});n.push(a)})}),ke.zF.create(e,n)},_e=Ae.YY.create({name:"colorHighlighter",addProseMirrorPlugins:()=>[new we.k_({state:{init(e,t){let{doc:n}=t;return Ce(n)},apply:(e,t)=>e.docChanged?Ce(e.doc):t},props:{decorations(e){return this.getState(e)}}})]}),Ee=Ae.CU.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!1}),parseHTML(){return[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(e=>{if(!e.children.length)return;const t=e.querySelectorAll("span");t&&t.forEach(e=>{var t,n;const r=e.getAttribute("style"),o=null===(n=null===(t=e.parentElement)||void 0===t?void 0:t.closest("span"))||void 0===n?void 0:n.getAttribute("style");e.setAttribute("style",`${o};${r}`)})})(e),{})}]},renderHTML({HTMLAttributes:e}){return["span",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),Se=Ae.YY.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>{if(e.style&&e.style.fontSize)return e.style.fontSize.replace(/['"]+/g,"");const t=window.getComputedStyle(e);return t&&t.fontSize?t.fontSize.replace(/['"]+/g,""):e.dataset&&e.dataset.fontSize?e.dataset.fontSize.replace(/['"]+/g,""):null},renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:e=>t=>{let{chain:n}=t;return n().setMark("textStyle",{fontSize:e+"px"}).run()},unsetFontSize:()=>e=>{let{chain:t}=e;return t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}),addKeyboardShortcuts(){return{"Mod-]":()=>{let e=parseInt(this.editor.getAttributes("textStyle").fontSize);e||(e=16),this.editor.commands.setFontSize(e+1)},"Mod-[":()=>{let e=parseInt(this.editor.getAttributes("textStyle").fontSize);e||(e=16),this.editor.commands.setFontSize(e-1)}}}});var Be=n(1366);const Me=Ae.bP.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML(e){let{node:t,HTMLAttributes:n}=e;const r=this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0],o=document.createElement(`h${r}`);return o.style.cssText=n.style,o.style.fontFamily||(o.style.fontFamily="Arial, Helvetica, sans-serif"),n.style=o.style.cssText,[`h${r}`,(0,Ae.KV)(this.options.HTMLAttributes,n),0]},addCommands(){return{setHeading:e=>t=>{let{commands:n}=t;return!!this.options.levels.includes(e.level)&&n.setNode(this.name,e)},toggleHeading:e=>t=>{let{commands:n}=t;return!!this.options.levels.includes(e.level)&&n.toggleNode(this.name,"paragraph",e)}}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>(0,Ae.JJ)({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var Oe=n(28396);const Ie=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Te=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Le=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Ne=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Re=Ae.CU.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,Ae.OX)({find:Ie,type:this.type}),(0,Ae.OX)({find:Le,type:this.type})]},addPasteRules(){return[(0,Ae.Zc)({find:Te,type:this.type}),(0,Ae.Zc)({find:Ne,type:this.type})]}}),De=Ae.CU.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),ze=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Pe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,$e=Ae.CU.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,Ae.OX)({find:ze,type:this.type})]},addPasteRules(){return[(0,Ae.Zc)({find:Pe,type:this.type})]}}),He=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,je=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Ue=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Fe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Ve=Ae.CU.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,Ae.OX)({find:He,type:this.type}),(0,Ae.OX)({find:Ue,type:this.type})]},addPasteRules(){return[(0,Ae.Zc)({find:je,type:this.type}),(0,Ae.Zc)({find:Fe,type:this.type})]}}),qe=Ae.YY.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return null===(t=e.style.color)||void 0===t?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),We=Ae.bP.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Ye=Ae.YY.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new we.k_({key:new we.hs("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,o=[];if(!n)return null;const i=this.editor.isEmpty;return e.descendants((e,t)=>{const n=r>=t&&r<=t+e.nodeSize,s=!e.isLeaf&&(0,Ae.Op)(e);if((n||!this.options.showOnlyCurrent)&&s){const r=[this.options.emptyNodeClass];i&&r.push(this.options.emptyEditorClass);const s=ke.NZ.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});o.push(s)}return this.options.includeChildren}),ke.zF.create(e,o)}}})]}});var Xe=n(11329);function Ze(e={}){return new we.k_({view:t=>new Ke(t,e)})}class Ke{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,s=o.height/r.offsetHeight;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let o=t.getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*s;e={left:o.left,right:o.right,top:i-a,bottom:i+a}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*i;e={left:t.left-n,right:t.left+n,top:t.top,bottom:t.bottom}}let a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{let e=c.getBoundingClientRect(),t=e.width/c.offsetWidth,n=e.height/c.offsetHeight;a=e.left-c.scrollLeft*t,l=e.top-c.scrollTop*n}this.element.style.left=(e.left-a)/i+"px",this.element.style.top=(e.top-l)/s+"px",this.element.style.width=(e.right-e.left)/i+"px",this.element.style.height=(e.bottom-e.top)/s+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(t&&!o){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=(0,Xe.Um)(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const Je=Ae.YY.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[Ze(this.options)]}}),Ge=Ae.YY.create({name:"direction",addOptions:()=>({types:[],directions:["rtl","ltr"],defaultDirection:"ltr"}),addGlobalAttributes(e){return[{types:this.options.types,attributes:{direction:{default:this.options.defaultDirection,parseHTML:e=>e.style.direction||this.options.defaultDirection,renderHTML:e=>({style:`direction: ${e.direction||this.options.defaultDirection}`})}}}]},addCommands(){return{setDirection:e=>t=>{let{commands:n}=t;return!!this.options.directions.includes(e)&&this.options.types.every(t=>n.updateAttributes(t,{direction:e}))},unsetDirection:()=>e=>{let{commands:t}=e;return this.options.types.every(e=>t.resetAttributes(e,"direction"))}}}}),Qe=Ae.YY.create({name:"lineHeight",addOptions:()=>({types:[],lineHeight:"1.4",defaultLineHeight:"1.4"}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:this.options.defaultLineHeight,parseHTML:e=>e.style.lineHeight||this.options.defaultLineHeight,renderHTML:e=>({style:`line-height: ${e.lineHeight||this.options.defaultLineHeight}`})}}}]},addCommands(){return{setLineHeight:e=>t=>{let{commands:n}=t;return this.options.types.every(t=>n.updateAttributes(t,{lineHeight:e}))},unsetLineHeight:()=>e=>{let{commands:t}=e;return this.options.types.every(e=>t.resetAttributes(e,"lineHeight"))}}}}),et=Ae.YY.create({name:"letterSpacing",addOptions:()=>({types:[],letterSpacing:"",defaultLetterSpacing:""}),addGlobalAttributes(){return[{types:this.options.types,attributes:{letterSpacing:{default:this.options.defaultLetterSpacing,parseHTML:e=>e.style.letterSpacing||this.options.defaultLetterSpacing,renderHTML:e=>({style:`letter-spacing: ${e.letterSpacing||this.options.defaultLetterSpacing}`})}}}]},addCommands(){return{setLetterSpacing:e=>t=>{let{commands:n}=t;return this.options.types.every(t=>n.updateAttributes(t,{letterSpacing:e}))},unsetLetterSpacing:()=>e=>{let{commands:t}=e;return this.options.types.every(e=>t.resetAttributes(e,"letterSpacing"))}}}}),tt="textStyle",nt=/^(\d+)\.\s$/,rt=Ae.bP.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",(0,Ae.KV)(this.options.HTMLAttributes,n),0]:["ol",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(tt)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=(0,Ae.tG)({find:nt,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,Ae.tG)({find:nt,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(tt)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),ot="customBulletItem";function it(e){let{width:t=24,height:n=24,fill:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||!e.startsWith("http"))return e;try{const o=new URL(e);return o.searchParams.set("width",String(t)),o.searchParams.set("height",String(n)),r&&o.searchParams.set("color",String(r).replace("#","")),o.toString()}catch{return e}}const st=Ae.bP.create({name:ot,addOptions:()=>({nested:!0,HTMLAttributes:{},svgIcon:"",width:"",mt:0,height:"",fill:"",fontSize:""}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({svgIcon:{default:"https://img.creaditor.ai/icons/serve/System/check-fill.png?width=24&height=24&color=000"},width:{default:24,parseHTML:e=>e.width},height:{default:24,parseHTML:e=>e.height},mt:{default:0,parseHTML:e=>e.style.marginTop},fill:{default:"#000",parseHTML:e=>e.style.fill}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["li",(0,Ae.KV)(this.options.HTMLAttributes,n,{"data-type":this.name}),["div",["svg"],["span"]],["div",0]]},addCommands(){const e=(e,t)=>{const n={...t},r=e.selection.$from;for(let e=r.depth;e>0;e--){const o=r.node(e);if(o.type.name===ot){Object.assign(n,o.attrs,t);break}}return n.svgIcon?.startsWith("http")&&(n.svgIcon=it(n.svgIcon,{width:n.width??24,height:n.height??24,fill:n.fill})),n};return{setCustomBulletIcon:t=>n=>{let{commands:r,state:o}=n;return r.updateAttributes(ot,e(o,t)),!0},setCustomBulletStyles:t=>n=>{let{commands:r,state:o}=n;return r.updateAttributes(ot,e(o,t)),!0}}},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return e=>{let{HTMLAttributes:t}=e,n=t.svgIcon;if(n=n.replace(/&lt;/g,"<"),-1!==n.indexOf("<svg")){delete t.svgIcon;const e=document.createElement("li");e.classList.add("custom-bullet-item");const r=document.createElement("div");r.innerHTML=n;const o=document.createElement("div"),i=r.firstElementChild;return i.style.width=t.width,i.style.height=t.width,i.style.fill=t.fill,i.style.marginTop=t.mt,Object.entries(this.options.HTMLAttributes).forEach(t=>{let[n,r]=t;e.setAttribute(n,r)}),e.append(r,o),Object.entries(t).forEach(t=>{let[n,r]=t;e.setAttribute(n,r)}),{dom:e,contentDOM:o}}if(n.startsWith("http")){const e=it(n,{width:t.width??24,height:t.height??24,fill:t.fill});delete t.svgIcon;const r=document.createElement("li");r.classList.add("custom-bullet-item");const o=document.createElement("div");o.innerHTML=`<img src="${e}" height="auto" style="margin-top:${t.mt||"auto"}" width="${t.width}"\n />`;const i=document.createElement("div");o.firstElementChild;return Object.entries(this.options.HTMLAttributes).forEach(e=>{let[t,n]=e;r.setAttribute(t,n)}),r.append(o,i),Object.entries(t).forEach(e=>{let[t,n]=e;r.setAttribute(t,n)}),{dom:r,contentDOM:i}}{delete t.svgIcon;const e=document.createElement("li");e.classList.add("custom-bullet-item");const r=document.createElement("div");r.innerHTML=`<svg fill="${t.fill}" width="${t.width}"\n height="${t.width}"\n xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">${n}</svg>`;const o=document.createElement("div"),i=r.firstElementChild;return i.style.width=t.width,i.style.height=t.width,i.style.marginTop=t.mt,i.style.fill=t.fill,Object.entries(this.options.HTMLAttributes).forEach(t=>{let[n,r]=t;e.setAttribute(n,r)}),e.append(r,o),Object.entries(t).forEach(t=>{let[n,r]=t;e.setAttribute(n,r)}),{dom:e,contentDOM:o}}}}}),at=Ae.bP.create({name:"customBulletList",addOptions:()=>({itemTypeName:ot,HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML(e){let{HTMLAttributes:t}=e;return["ul",(0,Ae.KV)(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleCustomList:()=>e=>{let{commands:t}=e;return t.toggleList(this.name,this.options.itemTypeName)}}},addKeyboardShortcuts(){return{"Mod-Shift-6":()=>this.editor.commands.toggleCustomList()}}}),lt=Ae.bP.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",(0,Ae.KV)(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,a=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&a&&i){const t=a.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ct=/^\s*(\[([ |x])\])\s$/,dt=(Ae.bP.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{}}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>"true"===e.getAttribute("data-checked"),renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["li",(0,Ae.KV)(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return e=>{let{node:t,HTMLAttributes:n,getPos:r,editor:o}=e;const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input");i.style.display="flex",i.style.alignItems="center",l.style.width="50px";const c=document.createElement("div");return s.contentEditable="false",l.type="checkbox",l.addEventListener("change",e=>{if(!o.isEditable)return void(l.checked=!l.checked);const{checked:t}=e.target;o.isEditable&&"function"==typeof r&&o.chain().focus(void 0,{scrollIntoView:!1}).command(e=>{let{tr:n}=e;const o=r(),i=n.doc.nodeAt(o);return n.setNodeMarkup(o,void 0,{...i?.attrs,checked:t}),!0}).run()}),Object.entries(this.options.HTMLAttributes).forEach(e=>{let[t,n]=e;i.setAttribute(t,n)}),i.dataset.checked=t.attrs.checked,t.attrs.checked&&l.setAttribute("checked","checked"),s.append(l,a),i.append(s,c),Object.entries(n).forEach(e=>{let[t,n]=e;i.setAttribute(t,n)}),{dom:i,contentDOM:c,update:e=>e.type===this.type&&(i.dataset.checked=e.attrs.checked,e.attrs.checked?l.setAttribute("checked","checked"):l.removeAttribute("checked"),!0)}}},addInputRules(){return[(0,Ae.tG)({find:ct,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),Ae.bP.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML(e){let{HTMLAttributes:t}=e;return["ul",(0,Ae.KV)(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>e=>{let{commands:t}=e;return t.toggleList(this.name,this.options.itemTypeName)}}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),/^\s*>\s$/),pt=Ae.bP.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,Ae.tG)({find:dt,type:this.type})]}}),ut=/^```([a-z]+)?[\s\n]$/,ht=/^~~~([a-z]+)?[\s\n]$/,ft=Ae.bP.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,r=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",(0,Ae.KV)(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!i||!s)&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type)return!1;if(!(o.parentOffset===o.parent.nodeSize-2))return!1;const s=o.after();if(void 0===s)return!1;return r.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(we.LN.near(r.resolve(s))),!0)):e.commands.exitCode()}}},addInputRules(){return[(0,Ae.JJ)({find:ut,type:this.type,getAttributes:e=>({language:e[1]})}),(0,Ae.JJ)({find:ht,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new we.k_({key:new we.hs("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=null==o?void 0:o.mode;if(!n||!i)return!1;const{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(we.U3.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}});function mt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gt(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;"object"!==r&&"function"!==r||Object.isFrozen(n)||gt(n)}),e}class bt{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function yt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function At(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach(function(e){for(const t in e)n[t]=e[t]}),n}const wt=e=>!!e.scope;class vt{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=yt(e)}openNode(e){if(!wt(e))return;const t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){wt(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const xt=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class kt{constructor(){this.rootNode=xt(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=xt({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{kt._collapse(e)}))}}class Ct extends kt{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new vt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function _t(e){return e?"string"==typeof e?e:e.source:null}function Et(e){return Mt("(?=",e,")")}function St(e){return Mt("(?:",e,")*")}function Bt(e){return Mt("(?:",e,")?")}function Mt(...e){return e.map(e=>_t(e)).join("")}function Ot(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map(e=>_t(e)).join("|")+")"}function It(e){return new RegExp(e.toString()+"|").exec("").length-1}const Tt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Lt(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;const t=n;let r=_t(e),o="";for(;r.length>0;){const e=Tt.exec(r);if(!e){o+=r;break}o+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?o+="\\"+String(Number(e[1])+t):(o+=e[0],"("===e[0]&&n++)}return o}).map(e=>`(${e})`).join(t)}const Nt="[a-zA-Z]\\w*",Rt="[a-zA-Z_]\\w*",Dt="\\b\\d+(\\.\\d+)?",zt="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Pt="\\b(0b[01]+)",$t={begin:"\\\\[\\s\\S]",relevance:0},Ht={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[$t]},jt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[$t]},Ut=function(e,t,n={}){const r=At({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=Ot("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Mt(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Ft=Ut("//","$"),Vt=Ut("/\\*","\\*/"),qt=Ut("#","$"),Wt={scope:"number",begin:Dt,relevance:0},Yt={scope:"number",begin:zt,relevance:0},Xt={scope:"number",begin:Pt,relevance:0},Zt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[$t,{begin:/\[/,end:/\]/,relevance:0,contains:[$t]}]},Kt={scope:"title",begin:Nt,relevance:0},Jt={scope:"title",begin:Rt,relevance:0},Gt={begin:"\\.\\s*"+Rt,relevance:0};var Qt=Object.freeze({__proto__:null,APOS_STRING_MODE:Ht,BACKSLASH_ESCAPE:$t,BINARY_NUMBER_MODE:Xt,BINARY_NUMBER_RE:Pt,COMMENT:Ut,C_BLOCK_COMMENT_MODE:Vt,C_LINE_COMMENT_MODE:Ft,C_NUMBER_MODE:Yt,C_NUMBER_RE:zt,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:qt,IDENT_RE:Nt,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:Gt,NUMBER_MODE:Wt,NUMBER_RE:Dt,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:jt,REGEXP_MODE:Zt,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Mt(t,/.*\b/,e.binary,/\b.*/)),At({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:Kt,UNDERSCORE_IDENT_RE:Rt,UNDERSCORE_TITLE_MODE:Jt});function en(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function tn(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function nn(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=en,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function rn(e,t){Array.isArray(e.illegal)&&(e.illegal=Ot(...e.illegal))}function on(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function sn(e,t){void 0===e.relevance&&(e.relevance=1)}const an=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=Mt(n.beforeMatch,Et(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ln=["of","and","for","in","not","or","if","then","parent","list","value"];function cn(e,t,n="keyword"){const r=Object.create(null);return"string"==typeof e?o(n,e.split(" ")):Array.isArray(e)?o(n,e):Object.keys(e).forEach(function(n){Object.assign(r,cn(e[n],t,n))}),r;function o(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){const n=t.split("|");r[n[0]]=[e,dn(n[0],n[1])]})}}function dn(e,t){return t?Number(t):function(e){return ln.includes(e.toLowerCase())}(e)?0:1}const pn={},un=e=>{console.error(e)},hn=(e,...t)=>{console.log(`WARN: ${e}`,...t)},fn=(e,t)=>{pn[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),pn[`${e}/${t}`]=!0)},mn=new Error;function gn(e,t,{key:n}){let r=0;const o=e[n],i={},s={};for(let e=1;e<=t.length;e++)s[e+r]=o[e],i[e+r]=!0,r+=It(t[e-1]);e[n]=s,e[n]._emit=i,e[n]._multi=!0}function bn(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw un("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),mn;if("object"!=typeof e.beginScope||null===e.beginScope)throw un("beginScope must be object"),mn;gn(e,e.begin,{key:"beginScope"}),e.begin=Lt(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw un("skip, excludeEnd, returnEnd not compatible with endScope: {}"),mn;if("object"!=typeof e.endScope||null===e.endScope)throw un("endScope must be object"),mn;gn(e,e.end,{key:"endScope"}),e.end=Lt(e.end,{joinWith:""})}}(e)}function yn(e){function t(t,n){return new RegExp(_t(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=It(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=t(Lt(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=At(e.classNameAliases||{}),function n(o,i){const s=o;if(o.isCompiled)return s;[tn,on,bn,an].forEach(e=>e(o,i)),e.compilerExtensions.forEach(e=>e(o,i)),o.__beforeBegin=null,[nn,rn,sn].forEach(e=>e(o,i)),o.isCompiled=!0;let a=null;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),a=o.keywords.$pattern,delete o.keywords.$pattern),a=a||/\w+/,o.keywords&&(o.keywords=cn(o.keywords,e.case_insensitive)),s.keywordPatternRe=t(a,!0),i&&(o.begin||(o.begin=/\B|\b/),s.beginRe=t(s.begin),o.end||o.endsWithParent||(o.end=/\B|\b/),o.end&&(s.endRe=t(s.end)),s.terminatorEnd=_t(s.end)||"",o.endsWithParent&&i.terminatorEnd&&(s.terminatorEnd+=(o.end?"|":"")+i.terminatorEnd)),o.illegal&&(s.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return At(e,{variants:null},t)}));if(e.cachedVariants)return e.cachedVariants;if(An(e))return At(e,{starts:e.starts?At(e.starts):null});if(Object.isFrozen(e))return At(e);return e}("self"===e?o:e)})),o.contains.forEach(function(e){n(e,s)}),o.starts&&n(o.starts,i),s.matcher=function(e){const t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(s),s}(e)}function An(e){return!!e&&(e.endsWithParent||An(e.starts))}class wn extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const vn=yt,xn=At,kn=Symbol("nomatch"),Cn=function(e){const t=Object.create(null),n=Object.create(null),r=[];let o=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Ct};function l(e){return a.noHighlightRe.test(e)}function c(e,t,n){let r="",o="";"object"==typeof t?(r=e,n=t.ignoreIllegals,o=t.language):(fn("10.7.0","highlight(lang, code, ...args) has been deprecated."),fn("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),o=e,r=t),void 0===n&&(n=!0);const i={code:r,language:o};y("before:highlight",i);const s=i.result?i.result:d(i.language,i.code,n);return s.code=i.code,y("after:highlight",s),s}function d(e,n,r,s){const l=Object.create(null);function c(e,t){return e.keywords[t]}function u(){if(!E.keywords)return void B.addText(M);let e=0;E.keywordPatternRe.lastIndex=0;let t=E.keywordPatternRe.exec(M),n="";for(;t;){n+=M.substring(e,t.index);const r=k.case_insensitive?t[0].toLowerCase():t[0],o=c(E,r);if(o){const[e,i]=o;if(B.addText(n),n="",l[r]=(l[r]||0)+1,l[r]<=7&&(O+=i),e.startsWith("_"))n+=t[0];else{const n=k.classNameAliases[e]||e;f(t[0],n)}}else n+=t[0];e=E.keywordPatternRe.lastIndex,t=E.keywordPatternRe.exec(M)}n+=M.substring(e),B.addText(n)}function h(){null!=E.subLanguage?function(){if(""===M)return;let e=null;if("string"==typeof E.subLanguage){if(!t[E.subLanguage])return void B.addText(M);e=d(E.subLanguage,M,!0,S[E.subLanguage]),S[E.subLanguage]=e._top}else e=p(M,E.subLanguage.length?E.subLanguage:null);E.relevance>0&&(O+=e.relevance),B.__addSublanguage(e._emitter,e.language)}():u(),M=""}function f(e,t){""!==e&&(B.startScope(t),B.addText(e),B.endScope())}function g(e,t){let n=1;const r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}const r=k.classNameAliases[e[n]]||e[n],o=t[n];r?f(o,r):(M=o,u(),M=""),n++}}function b(e,t){return e.scope&&"string"==typeof e.scope&&B.openNode(k.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(f(M,k.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),M=""):e.beginScope._multi&&(g(e.beginScope,t),M="")),E=Object.create(e,{parent:{value:E}}),E}function y(e,t,n){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(r){if(e["on:end"]){const n=new bt(e);e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return y(e.parent,t,n)}function A(e){return 0===E.matcher.regexIndex?(M+=e[0],1):(L=!0,0)}function w(e){const t=e[0],r=n.substring(e.index),o=y(E,e,r);if(!o)return kn;const i=E;E.endScope&&E.endScope._wrap?(h(),f(t,E.endScope._wrap)):E.endScope&&E.endScope._multi?(h(),g(E.endScope,e)):i.skip?M+=t:(i.returnEnd||i.excludeEnd||(M+=t),h(),i.excludeEnd&&(M=t));do{E.scope&&B.closeNode(),E.skip||E.subLanguage||(O+=E.relevance),E=E.parent}while(E!==o.parent);return o.starts&&b(o.starts,e),i.returnEnd?0:t.length}let v={};function x(t,i){const s=i&&i[0];if(M+=t,null==s)return h(),0;if("begin"===v.type&&"end"===i.type&&v.index===i.index&&""===s){if(M+=n.slice(i.index,i.index+1),!o){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=i,"begin"===i.type)return function(e){const t=e[0],n=e.rule,r=new bt(n),o=[n.__beforeBegin,n["on:begin"]];for(const n of o)if(n&&(n(e,r),r.isMatchIgnored))return A(t);return n.skip?M+=t:(n.excludeBegin&&(M+=t),h(),n.returnBegin||n.excludeBegin||(M=t)),b(n,e),n.returnBegin?0:t.length}(i);if("illegal"===i.type&&!r){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(E.scope||"<unnamed>")+'"');throw e.mode=E,e}if("end"===i.type){const e=w(i);if(e!==kn)return e}if("illegal"===i.type&&""===s)return 1;if(T>1e5&&T>3*i.index){throw new Error("potential infinite loop, way more iterations than matches")}return M+=s,s.length}const k=m(e);if(!k)throw un(i.replace("{}",e)),new Error('Unknown language: "'+e+'"');const C=yn(k);let _="",E=s||C;const S={},B=new a.__emitter(a);!function(){const e=[];for(let t=E;t!==k;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>B.openNode(e))}();let M="",O=0,I=0,T=0,L=!1;try{if(k.__emitTokens)k.__emitTokens(n,B);else{for(E.matcher.considerAll();;){T++,L?L=!1:E.matcher.considerAll(),E.matcher.lastIndex=I;const e=E.matcher.exec(n);if(!e)break;const t=x(n.substring(I,e.index),e);I=e.index+t}x(n.substring(I))}return B.finalize(),_=B.toHTML(),{language:e,value:_,relevance:O,illegal:!1,_emitter:B,_top:E}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:vn(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:_},_emitter:B};if(o)return{language:e,value:vn(n),illegal:!1,relevance:0,errorRaised:t,_emitter:B,_top:E};throw t}}function p(e,n){n=n||a.languages||Object.keys(t);const r=function(e){const t={value:vn(e),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return t._emitter.addText(e),t}(e),o=n.filter(m).filter(b).map(t=>d(t,e,!1));o.unshift(r);const i=o.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(m(e.language).supersetOf===t.language)return 1;if(m(t.language).supersetOf===e.language)return-1}return 0}),[l,c]=i,p=l;return p.secondBest=c,p}function u(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=a.languageDetectRe.exec(t);if(n){const t=m(n[1]);return t||(hn(i.replace("{}",n[1])),hn("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>l(e)||m(e))}(e);if(l(r))return;if(y("before:highlightElement",{el:e,language:r}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),a.throwUnescapedHTML)){throw new wn("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const o=t.textContent,s=r?c(o,{language:r,ignoreIllegals:!0}):p(o);e.innerHTML=s.value,e.dataset.highlighted="yes",function(e,t,r){const o=t&&n[t]||r;e.classList.add("hljs"),e.classList.add(`language-${o}`)}(e,r,s.language),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),y("after:highlightElement",{el:e,result:s,text:o})}let h=!1;function f(){if("loading"===document.readyState)return void(h=!0);document.querySelectorAll(a.cssSelector).forEach(u)}function m(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function g(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function b(e){const t=m(e);return t&&!t.disableAutodetect}function y(e,t){const n=e;r.forEach(function(e){e[n]&&e[n](t)})}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",function(){h&&f()},!1),Object.assign(e,{highlight:c,highlightAuto:p,highlightAll:f,highlightElement:u,highlightBlock:function(e){return fn("10.7.0","highlightBlock will be removed entirely in v12.0"),fn("10.7.0","Please use highlightElement now."),u(e)},configure:function(e){a=xn(a,e)},initHighlighting:()=>{f(),fn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){f(),fn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let i=null;try{i=r(e)}catch(e){if(un("Language definition for '{}' could not be registered.".replace("{}",n)),!o)throw e;un(e),i=s}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&g(i.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:m,registerAliases:g,autoDetection:b,inherit:xn,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)},removePlugin:function(e){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString="11.10.0",e.regex={concat:Mt,lookahead:Et,either:Ot,optional:Bt,anyNumberOfTimes:St};for(const e in Qt)"object"==typeof Qt[e]&&gt(Qt[e]);return Object.assign(e,Qt),e},_n=Cn({});_n.newInstance=()=>Cn({});var En=_n;_n.HighlightJS=_n,_n.default=_n;var Sn=mt(En);function Bn(e,t=[]){return e.map(e=>{const n=[...t,...e.properties?e.properties.className:[]];return e.children?Bn(e.children,n):{text:e.value,classes:n}}).flat()}function Mn(e){return e.value||e.children||[]}function On({doc:e,name:t,lowlight:n,defaultLanguage:r}){const o=[];return(0,Ae.xe)(e,e=>e.type.name===t).forEach(e=>{var t;let i=e.pos+1;const s=e.node.attrs.language||r,a=n.listLanguages();var l;Bn(s&&(a.includes(s)||(l=s,Boolean(Sn.getLanguage(l)))||(null===(t=n.registered)||void 0===t?void 0:t.call(n,s)))?Mn(n.highlight(s,e.node.textContent)):Mn(n.highlightAuto(e.node.textContent))).forEach(e=>{const t=i+e.text.length;if(e.classes.length){const n=ke.NZ.inline(i,t,{class:e.classes.join(" ")});o.push(n)}i=t})}),ke.zF.create(e,o)}function In({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(e=>"function"==typeof t[e]))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new we.k_({key:new we.hs("lowlight"),state:{init:(r,{doc:o})=>On({doc:o,name:e,lowlight:t,defaultLanguage:n}),apply:(r,o,i,s)=>{const a=i.selection.$head.parent.type.name,l=s.selection.$head.parent.type.name,c=(0,Ae.xe)(i.doc,t=>t.type.name===e),d=(0,Ae.xe)(s.doc,t=>t.type.name===e);return r.docChanged&&([a,l].includes(e)||d.length!==c.length||r.steps.some(e=>void 0!==e.from&&void 0!==e.to&&c.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?On({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):o.map(r.mapping,r.doc)}},props:{decorations:e=>r.getState(e)}});return r}const Tn=ft.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],In({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),Ln={};const Nn=Ae.YY.create({name:"fontFamily",addOptions:()=>({types:["textStyle"],fonts:[]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>e.style.fontFamily?.replace(/['"]+/g,""),renderHTML:e=>{if(!e.fontFamily)return{style:"font-family:Arial, Helvetica, sans-serif"};return function(e,t){if(!e||!e.length)return;const n=e.find(e=>e.cssRule.trim().replace('"',"").replace("'","")===t.trim().replace('"',"").replace("'",""));n&&!Ln[n.name]&&function(e){if(document.getElementById(e.id))return;const t=document.createElement("link");t.href=e.url,t.id=e.id,t.setAttribute("data-name",e.name),t.rel="stylesheet",t.type="text/css",document.head.appendChild(t),Ln[e.name]=!0}(n)}(this.options.fonts,e.fontFamily),{style:`font-family: ${e.fontFamily.replace(/;/g,"")}`,"data-cdtr-font-name":e.fontFamily}}}}}]},addCommands:()=>({setFontFamily:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let{chain:n}=t;if(!e||"object"!=typeof e)return console.warn("setFontFamily should be { cssRule, name, id, url } "),"string"==typeof e?n().setMark("textStyle",{fontFamily:e}).run():void 0;const{cssRule:r,name:o,id:i,url:s}=e;return n().setMark("textStyle",{fontFamily:r}).run()}},unsetFontFamily:()=>e=>{let{chain:t}=e;return t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}})});const Rn=Ae.bP.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",draggable:!0,parseHTML:()=>[{tag:"hr"}],renderHTML(e){let{HTMLAttributes:t}=e;return["hr",(0,Ae.KV)(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>e=>{let{chain:t}=e;return t().insertContent({type:this.name}).command(e=>{let{tr:t,dispatch:n}=e;if(n){const{$to:e}=t.selection,n=e.end();if(e.nodeAfter)t.setSelection(we.U3.create(t.doc,e.pos));else{const r=e.parent.type.contentMatch.defaultType?.create();r&&(t.insert(n,r),t.setSelection(we.U3.create(t.doc,n)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[(0,Ae.jT)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var Dn=n(15939),zn=n(16090);class Pn extends we.LN{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Pn.valid(n)?new Pn(n):we.LN.near(n)}content(){return zn.Ji.empty}eq(e){return e instanceof Pn&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new Pn(e.resolve(t.pos))}getBookmark(){return new $n(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||Hn(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||Hn(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Pn.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(Pn.valid(s))return s}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!we.nh.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=i,r+=t;let s=e.doc.resolve(r);if(Pn.valid(s))return s}return null}}}Pn.prototype.visible=!1,Pn.findFrom=Pn.findGapCursorFrom,we.LN.jsonID("gapcursor",Pn);class $n{constructor(e){this.pos=e}map(e){return new $n(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Pn.valid(t)?new Pn(t):we.LN.near(t)}}function Hn(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}const jn=(0,Dn.K)({ArrowLeft:Un("horiz",-1),ArrowRight:Un("horiz",1),ArrowUp:Un("vert",-1),ArrowDown:Un("vert",1)});function Un(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,s=t>0?i.$to:i.$from,a=i.empty;if(i instanceof we.U3){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=Pn.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new Pn(l))),!0)}}function Fn(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Pn.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&we.nh.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new Pn(r))),!0)}function Vn(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof Pn))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=zn.FK.empty;for(let e=r.length-1;e>=0;e--)o=zn.FK.from(r[e].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new zn.Ji(o,0,0));return i.setSelection(we.U3.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function qn(e){if(!(e.selection instanceof Pn))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",ke.zF.create(e.doc,[ke.NZ.widget(e.selection.head,t,{key:"gapcursor"})])}const Wn=Ae.YY.create({name:"gapCursor",addProseMirrorPlugins:()=>[new we.k_({props:{decorations:qn,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&Pn.valid(n)?new Pn(n):null,handleClick:Fn,handleKeyDown:jn,handleDOMEvents:{beforeinput:Vn}}})],extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!==(t=(0,Ae.gk)((0,Ae.iI)(e,"allowGapCursor",n)))&&void 0!==t?t:null}}}),Yn=Ae.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML(e){const{HTMLAttributes:t}=e,n=document.createElement("p");n.style.cssText=t.style,n.style.fontSize||(n.style.fontSize="16px"),n.style.fontFamily||(n.style.fontFamily="Arial, Helvetica, sans-serif");const r=n.style.cssText;return["p",(0,Ae.KV)(this.options.HTMLAttributes,{style:r},{dir:"auto"}),0]},addCommands(){return{setParagraph:()=>e=>{let{commands:t}=e;return t.setNode(this.name)}}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Xn="numeric",Zn="ascii",Kn="alpha",Jn="asciinumeric",Gn="alphanumeric",Qn="domain",er="emoji",tr="scheme",nr="slashscheme",rr="whitespace";function or(e,t){return e in t||(t[e]=[]),t[e]}function ir(e,t,n){t[Xn]&&(t[Jn]=!0,t[Gn]=!0),t[Zn]&&(t[Jn]=!0,t[Kn]=!0),t[Jn]&&(t[Gn]=!0),t[Kn]&&(t[Gn]=!0),t[Gn]&&(t[Qn]=!0),t[er]&&(t[Qn]=!0);for(const r in t){const t=or(r,n);t.indexOf(e)<0&&t.push(e)}}function sr(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}sr.groups={},sr.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){const r=t.jr[n][0],o=t.jr[n][1];if(o&&r.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){let o;return r=r||sr.groups,t&&t.j?o=t:(o=new sr(t),n&&r&&ir(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const i=e.length;if(!i)return o;for(let t=0;t<i-1;t++)o=o.tt(e[t]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||sr.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const i=t;let s,a=o.go(e);if(a?(s=new sr,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new sr,i){if(r)if(s.t&&"string"==typeof s.t){const e=Object.assign(function(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(s.t,r),n);ir(i,e,r)}else n&&ir(i,n,r);s.t=i}return o.j[e]=s,s}};const ar=(e,t,n,r,o)=>e.ta(t,n,r,o),lr=(e,t,n,r,o)=>e.tr(t,n,r,o),cr=(e,t,n,r,o)=>e.ts(t,n,r,o),dr=(e,t,n,r,o)=>e.tt(t,n,r,o),pr="WORD",ur="UWORD",hr="ASCIINUMERICAL",fr="ALPHANUMERICAL",mr="LOCALHOST",gr="TLD",br="UTLD",yr="SCHEME",Ar="SLASH_SCHEME",wr="NUM",vr="WS",xr="NL",kr="OPENBRACE",Cr="CLOSEBRACE",_r="OPENBRACKET",Er="CLOSEBRACKET",Sr="OPENPAREN",Br="CLOSEPAREN",Mr="OPENANGLEBRACKET",Or="CLOSEANGLEBRACKET",Ir="FULLWIDTHLEFTPAREN",Tr="FULLWIDTHRIGHTPAREN",Lr="LEFTCORNERBRACKET",Nr="RIGHTCORNERBRACKET",Rr="LEFTWHITECORNERBRACKET",Dr="RIGHTWHITECORNERBRACKET",zr="FULLWIDTHLESSTHAN",Pr="FULLWIDTHGREATERTHAN",$r="AMPERSAND",Hr="APOSTROPHE",jr="ASTERISK",Ur="AT",Fr="BACKSLASH",Vr="BACKTICK",qr="CARET",Wr="COLON",Yr="COMMA",Xr="DOLLAR",Zr="DOT",Kr="EQUALS",Jr="EXCLAMATION",Gr="HYPHEN",Qr="PERCENT",eo="PIPE",to="PLUS",no="POUND",ro="QUERY",oo="QUOTE",io="FULLWIDTHMIDDLEDOT",so="SEMI",ao="SLASH",lo="TILDE",co="UNDERSCORE",po="EMOJI",uo="SYM";var ho=Object.freeze({__proto__:null,ALPHANUMERICAL:fr,AMPERSAND:$r,APOSTROPHE:Hr,ASCIINUMERICAL:hr,ASTERISK:jr,AT:Ur,BACKSLASH:Fr,BACKTICK:Vr,CARET:qr,CLOSEANGLEBRACKET:Or,CLOSEBRACE:Cr,CLOSEBRACKET:Er,CLOSEPAREN:Br,COLON:Wr,COMMA:Yr,DOLLAR:Xr,DOT:Zr,EMOJI:po,EQUALS:Kr,EXCLAMATION:Jr,FULLWIDTHGREATERTHAN:Pr,FULLWIDTHLEFTPAREN:Ir,FULLWIDTHLESSTHAN:zr,FULLWIDTHMIDDLEDOT:io,FULLWIDTHRIGHTPAREN:Tr,HYPHEN:Gr,LEFTCORNERBRACKET:Lr,LEFTWHITECORNERBRACKET:Rr,LOCALHOST:mr,NL:xr,NUM:wr,OPENANGLEBRACKET:Mr,OPENBRACE:kr,OPENBRACKET:_r,OPENPAREN:Sr,PERCENT:Qr,PIPE:eo,PLUS:to,POUND:no,QUERY:ro,QUOTE:oo,RIGHTCORNERBRACKET:Nr,RIGHTWHITECORNERBRACKET:Dr,SCHEME:yr,SEMI:so,SLASH:ao,SLASH_SCHEME:Ar,SYM:uo,TILDE:lo,TLD:gr,UNDERSCORE:co,UTLD:br,UWORD:ur,WORD:pr,WS:vr});const fo=/[a-z]/,mo=/\p{L}/u,go=/\p{Emoji}/u,bo=/\d/,yo=/\s/;let Ao=null,wo=null;function vo(e,t){const n=function(e){const t=[],n=e.length;let r=0;for(;r<n;){let o,i=e.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=e,l=null,c=0,d=null,p=-1,u=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(p=0,u=0,d=a):p>=0&&(p+=n[s].length,u++),c+=n[s].length,i+=n[s].length,s++;i-=p,s-=u,c-=p,o.push({t:d.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}function xo(e,t,n,r,o){let i;const s=t.length;for(let n=0;n<s-1;n++){const s=t[n];e.j[s]?i=e.j[s]:(i=new sr(r),i.jr=o.slice(),e.j[s]=i),e=i}return i=new sr(n),i.jr=o.slice(),e.j[t[s-1]]=i,i}function ko(e){const t=[],n=[];let r=0;for(;r<e.length;){let o=0;for(;"0123456789".indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+o),10);t>0;t--)n.pop();r+=o}else n.push(e[r]),r++}return t}const Co={defaultProtocol:"http",events:null,format:Eo,formatHref:Eo,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function _o(e,t=null){let n=Object.assign({},Co);e&&(n=Object.assign(n,e instanceof _o?e.o:e));const r=n.ignoreTags,o=[];for(let e=0;e<r.length;e++)o.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function Eo(e){return e}_o.prototype={o:Co,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=null!=t;let o=this.o[e];return o?("object"==typeof o?(o=n.t in o?o[n.t]:Co[e],"function"==typeof o&&r&&(o=o(t,n))):"function"==typeof o&&r&&(o=o(t,n.t,n)),o):o},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function So(e,t){this.t="token",this.v=e,this.tk=t}function Bo(e,t){class n extends So{constructor(t,n){super(t,n),this.t=e}}for(const e in t)n.prototype[e]=t[e];return n.t=e,n}So.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Co.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),s={},a=e.get("className",n,t),l=e.get("target",n,t),c=e.get("rel",n,t),d=e.getObj("attributes",n,t),p=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:o,attributes:s,content:i,eventListeners:p}}};const Mo=Bo("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Oo=Bo("text"),Io=Bo("nl"),To=Bo("url",{isLink:!0,toHref(e=Co.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==mr&&e[1].t===Wr}});const Lo=e=>new sr(e);function No(e,t,n){const r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}const Ro="undefined"!=typeof console&&console&&console.warn||(()=>{}),Do="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",zo={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Po(e,t=!1){if(zo.initialized&&Ro(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Do}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');zo.customSchemes.push([e,t])}function $o(){zo.scanner=function(e=[]){const t={};sr.groups=t;const n=new sr;null==Ao&&(Ao=ko("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==wo&&(wo=ko("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),dr(n,"'",Hr),dr(n,"{",kr),dr(n,"}",Cr),dr(n,"[",_r),dr(n,"]",Er),dr(n,"(",Sr),dr(n,")",Br),dr(n,"<",Mr),dr(n,">",Or),dr(n,"(",Ir),dr(n,")",Tr),dr(n,"「",Lr),dr(n,"」",Nr),dr(n,"『",Rr),dr(n,"』",Dr),dr(n,"<",zr),dr(n,">",Pr),dr(n,"&",$r),dr(n,"*",jr),dr(n,"@",Ur),dr(n,"`",Vr),dr(n,"^",qr),dr(n,":",Wr),dr(n,",",Yr),dr(n,"$",Xr),dr(n,".",Zr),dr(n,"=",Kr),dr(n,"!",Jr),dr(n,"-",Gr),dr(n,"%",Qr),dr(n,"|",eo),dr(n,"+",to),dr(n,"#",no),dr(n,"?",ro),dr(n,'"',oo),dr(n,"/",ao),dr(n,";",so),dr(n,"~",lo),dr(n,"_",co),dr(n,"\\",Fr),dr(n,"・",io);const r=lr(n,bo,wr,{[Xn]:!0});lr(r,bo,r);const o=lr(r,fo,hr,{[Jn]:!0}),i=lr(r,mo,fr,{[Gn]:!0}),s=lr(n,fo,pr,{[Zn]:!0});lr(s,bo,o),lr(s,fo,s),lr(o,bo,o),lr(o,fo,o);const a=lr(n,mo,ur,{[Kn]:!0});lr(a,fo),lr(a,bo,i),lr(a,mo,a),lr(i,bo,i),lr(i,fo),lr(i,mo,i);const l=dr(n,"\n",xr,{[rr]:!0}),c=dr(n,"\r",vr,{[rr]:!0}),d=lr(n,yo,vr,{[rr]:!0});dr(n,"",d),dr(c,"\n",l),dr(c,"",d),lr(c,yo,d),dr(d,"\r"),dr(d,"\n"),lr(d,yo,d),dr(d,"",d);const p=lr(n,go,po,{[er]:!0});dr(p,"#"),lr(p,go,p),dr(p,"️",p);const u=dr(p,"‍");dr(u,"#"),lr(u,go,p);const h=[[fo,s],[bo,o]],f=[[fo,null],[mo,a],[bo,i]];for(let e=0;e<Ao.length;e++)xo(n,Ao[e],gr,pr,h);for(let e=0;e<wo.length;e++)xo(n,wo[e],br,ur,f);ir(gr,{tld:!0,ascii:!0},t),ir(br,{utld:!0,alpha:!0},t),xo(n,"file",yr,pr,h),xo(n,"mailto",yr,pr,h),xo(n,"http",Ar,pr,h),xo(n,"https",Ar,pr,h),xo(n,"ftp",Ar,pr,h),xo(n,"ftps",Ar,pr,h),ir(yr,{scheme:!0,ascii:!0},t),ir(Ar,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){const r=e[t][0],o=e[t][1]?{[tr]:!0}:{[nr]:!0};r.indexOf("-")>=0?o[Qn]=!0:fo.test(r)?bo.test(r)?o[Jn]=!0:o[Zn]=!0:o[Xn]=!0,cr(n,r,r,o)}return cr(n,"localhost",mr,{ascii:!0}),n.jd=new sr(uo),{start:n,tokens:Object.assign({groups:t},ho)}}(zo.customSchemes);for(let e=0;e<zo.tokenQueue.length;e++)zo.tokenQueue[e][1]({scanner:zo.scanner});zo.parser=function({groups:e}){const t=e.domain.concat([$r,jr,Ur,Fr,Vr,qr,Xr,Kr,Gr,wr,Qr,eo,to,no,ao,uo,lo,co]),n=[Hr,Wr,Yr,Zr,Jr,Qr,ro,oo,so,Mr,Or,kr,Cr,Er,_r,Sr,Br,Ir,Tr,Lr,Nr,Rr,Dr,zr,Pr],r=[$r,Hr,jr,Fr,Vr,qr,Xr,Kr,Gr,kr,Cr,Qr,eo,to,no,ro,ao,uo,lo,co],o=Lo(),i=dr(o,lo);ar(i,r,i),ar(i,e.domain,i);const s=Lo(),a=Lo(),l=Lo();ar(o,e.domain,s),ar(o,e.scheme,a),ar(o,e.slashscheme,l),ar(s,r,i),ar(s,e.domain,s);const c=dr(s,Ur);dr(i,Ur,c),dr(a,Ur,c),dr(l,Ur,c);const d=dr(i,Zr);ar(d,r,i),ar(d,e.domain,i);const p=Lo();ar(c,e.domain,p),ar(p,e.domain,p);const u=dr(p,Zr);ar(u,e.domain,p);const h=Lo(Mo);ar(u,e.tld,h),ar(u,e.utld,h),dr(c,mr,h);const f=dr(p,Gr);dr(f,Gr,f),ar(f,e.domain,p),ar(h,e.domain,p),dr(h,Zr,u),dr(h,Gr,f);const m=dr(h,Wr);ar(m,e.numeric,Mo);const g=dr(s,Gr),b=dr(s,Zr);dr(g,Gr,g),ar(g,e.domain,s),ar(b,r,i),ar(b,e.domain,s);const y=Lo(To);ar(b,e.tld,y),ar(b,e.utld,y),ar(y,e.domain,s),ar(y,r,i),dr(y,Zr,b),dr(y,Gr,g),dr(y,Ur,c);const A=dr(y,Wr),w=Lo(To);ar(A,e.numeric,w);const v=Lo(To),x=Lo();ar(v,t,v),ar(v,n,x),ar(x,t,v),ar(x,n,x),dr(y,ao,v),dr(w,ao,v);const k=dr(a,Wr),C=dr(l,Wr),_=dr(C,ao),E=dr(_,ao);ar(a,e.domain,s),dr(a,Zr,b),dr(a,Gr,g),ar(l,e.domain,s),dr(l,Zr,b),dr(l,Gr,g),ar(k,e.domain,v),dr(k,ao,v),dr(k,ro,v),ar(E,e.domain,v),ar(E,t,v),dr(E,ao,v);const S=[[kr,Cr],[_r,Er],[Sr,Br],[Mr,Or],[Ir,Tr],[Lr,Nr],[Rr,Dr],[zr,Pr]];for(let e=0;e<S.length;e++){const[r,o]=S[e],i=dr(v,r);dr(x,r,i),dr(i,o,v);const s=Lo(To);ar(i,t,s);const a=Lo();ar(i,n),ar(s,t,s),ar(s,n,a),ar(a,t,s),ar(a,n,a),dr(s,o,v),dr(a,o,v)}return dr(o,mr,y),dr(o,xr,Io),{start:o,tokens:ho}}(zo.scanner.tokens);for(let e=0;e<zo.pluginQueue.length;e++)zo.pluginQueue[e][1]({scanner:zo.scanner,parser:zo.parser});return zo.initialized=!0,zo}function Ho(e){return zo.initialized||$o(),function(e,t,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=e,l=null,c=null,d=0,p=null,u=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(u=0,p=a):u>=0&&u++,o++,d++;if(u<0)o-=d,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(No(Oo,t,s)),s=[]),o-=u,d-=u;const e=p.t,r=n.slice(o-d,o);i.push(No(e,t,r))}}return s.length>0&&i.push(No(Oo,t,s)),i}(zo.parser.start,e,vo(zo.scanner.start,e))}function jo(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new _o(n),o=Ho(e),i=[];for(let e=0;e<o.length;e++){const n=o[e];!n.isLink||t&&n.t!==t||!r.check(n)||i.push(n.toFormattedObject(r))}return i}Ho.scan=vo;const Uo="[\0-   ᠎ -\u2029  ]",Fo=new RegExp(Uo),Vo=new RegExp(`${Uo}$`),qo=new RegExp(Uo,"g");function Wo(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(e=>{const t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(qo,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Yo=Ae.CU.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{"string"!=typeof e?Po(e.scheme,e.optionalSlashes):Po(e)})},onDestroy(){sr.groups={},zo.scanner=null,zo.parser=null,zo.tokenQueue=[],zo.pluginQueue=[],zo.customSchemes=[],zo.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Wo(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!(!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!Wo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!Wo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,Ae.KV)(this.options.HTMLAttributes,e),0]:["a",(0,Ae.KV)(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!Wo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!Wo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[(0,Ae.Zc)({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=jo(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!Wo(e,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(e=>t.push({text:e.value,data:{href:e.href},index:e.start}))}return t},type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(function(e){return new we.k_({key:new we.hs("autolink"),appendTransaction:(t,n,r)=>{const o=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),i=t.some(e=>e.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=(0,Ae.T7)(n.doc,[...t]);return(0,Ae.FF)(a).forEach(({newRange:t})=>{const n=(0,Ae.Nx)(r.doc,t,e=>e.isTextblock);let o,i;if(n.length>1)o=n[0],i=r.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ");else if(n.length){const e=r.doc.textBetween(t.from,t.to," "," ");if(!Vo.test(e))return;o=n[0],i=r.doc.textBetween(o.pos,t.to,void 0," ")}if(o&&i){const t=i.split(Fo).filter(Boolean);if(t.length<=0)return!1;const n=t[t.length-1],l=o.pos+i.lastIndexOf(n);if(!n)return!1;const c=Ho(n).map(t=>t.toObject(e.defaultProtocol));if(!(1===(a=c).length?a[0].isLink:3===a.length&&a[1].isLink&&["()","[]"].includes(a[0].value+a[2].value)))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:l+e.start+1,to:l+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{(0,Ae.hO)(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||s.addMark(t.from,t.to,e.type.create({href:t.href}))})}var a}),s.steps.length?s:void 0}})}({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!Wo(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),!0===this.options.openOnClick&&e.push(function(e){return new we.k_({key:new we.hs("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(0!==r.button)return!1;if(!t.editable)return!1;let s=r.target;const a=[];for(;"DIV"!==s.nodeName;)a.push(s),s=s.parentNode;if(!a.find(e=>"A"===e.nodeName))return!1;const l=(0,Ae.gu)(t.state,e.type.name),c=r.target,d=null!==(o=null==c?void 0:c.href)&&void 0!==o?o:l.href,p=null!==(i=null==c?void 0:c.target)&&void 0!==i?i:l.target;return!(!c||!d||(window.open(d,p),0))}}})}({type:this.type})),this.options.linkOnPaste&&e.push(function(e){return new we.k_({key:new we.hs("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:o}=t,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach(e=>{a+=e.textContent});const l=jo(a,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===a);return!(!a||!l)&&e.editor.commands.setMark(e.type,{href:l.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}});let Xo,Zo;if("undefined"!=typeof WeakMap){let e=new WeakMap;Xo=t=>e.get(t),Zo=(t,n)=>(e.set(t,n),n)}else{let e=[],t=10,n=0;Xo=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},Zo=(r,o)=>(n==t&&(n=0),e[n++]=r,e[n++]=o)}class Ko{constructor(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r}}class Jo{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,o=t/this.width|0,i=r+1,s=o+1;for(let e=1;i<this.width&&this.map[t+e]==n;e++)i++;for(let e=1;s<this.height&&this.map[t+this.width*e]==n;e++)s++;return new Ko(r,o,i,s)}throw new RangeError("No cell with offset "+e+" found")}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError("No cell with offset "+e+" found")}nextCell(e,t,n){let{left:r,right:o,top:i,bottom:s}=this.findCell(e);return"horiz"==t?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:s==this.height)?null:this.map[r+this.width*(n<0?i-1:s)]}rectBetween(e,t){let{left:n,right:r,top:o,bottom:i}=this.findCell(e),{left:s,right:a,top:l,bottom:c}=this.findCell(t);return new Ko(Math.min(n,s),Math.min(o,l),Math.max(r,a),Math.max(i,c))}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let o=e.left;o<e.right;o++){let i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,o==e.left&&o&&this.map[i-1]==s||r==e.top&&r&&this.map[i-this.width]==s||t.push(s))}return t}positionAt(e,t,n){for(let r=0,o=0;;r++){let i=o+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<o;)n++;return n==r?i-1:this.map[n]}o=i}}static get(e){return Xo(e)||Zo(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);let t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let o=e.child(r),i=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let o=n.child(e);t+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){let t=o.child(e);i+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,s=[];for(let e=0,o=t*n;e<o;e++)r[e]=0;for(let a=0,l=0;a<n;a++){let c=e.child(a);l++;for(let e=0;;e++){for(;o<r.length&&0!=r[o];)o++;if(e==c.childCount)break;let d=c.child(e),{colspan:p,rowspan:u,colwidth:h}=d.attrs;for(let e=0;e<u;e++){if(e+a>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:l,n:u-e});break}let c=o+e*t;for(let e=0;e<p;e++){0==r[c+e]?r[c+e]=l:(i||(i=[])).push({type:"collision",row:a,pos:l,n:p-e});let n=h&&h[e];if(n){let r=(c+e)%t*2,o=s[r];null==o||o!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):o==n&&s[r+1]++}}}o+=p,l+=d.nodeSize}let d=(a+1)*t,p=0;for(;o<d;)0==r[o++]&&p++;p&&(i||(i=[])).push({type:"missing",row:a,n:p}),l++}let a=new Jo(t,n,r,i),l=!1;for(let e=0;!l&&e<s.length;e+=2)null!=s[e]&&s[e+1]<n&&(l=!0);l&&function(e,t,n){e.problems||(e.problems=[]);for(let r=0,o={};r<e.map.length;r++){let i=e.map[r];if(o[i])continue;o[i]=!0;let s=n.nodeAt(i),a=null;for(let n=0;n<s.attrs.colspan;n++){let o=t[2*((r+n)%e.width)];null==o||s.attrs.colwidth&&s.attrs.colwidth[n]==o||((a||(a=Go(s.attrs)))[n]=o)}a&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}(a,s,e);return a}(e))}}function Go(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function Qo(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}}return t}const ei=new we.hs("selectingCells");function ti(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function ni(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function ri(e){let t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:ti(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head)}function oi(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function ii(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function si(e,t,n){let r=e.start(-1),o=Jo.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==o?null:e.node(0).resolve(r+o)}function ai(e,t,n){let r={};for(let t in e)r[t]=e[t];return r[t]=n,r}function li(e,t,n=1){let r=ai(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function ci(e,t,n=1){let r=ai(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}class di extends we.LN{constructor(e,t=e){let n=e.node(-1),r=Jo.get(n),o=e.start(-1),i=r.rectBetween(e.pos-o,t.pos-o),s=e.node(0),a=r.cellsInRect(i).filter(e=>e!=t.pos-o);a.unshift(t.pos-o);let l=a.map(e=>{let t=n.nodeAt(e),r=e+o+1;return new we.yn(s.resolve(r),s.resolve(r+t.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=e,this.$headCell=t}map(e,t){let n=e.resolve(t.map(this.$anchorCell.pos)),r=e.resolve(t.map(this.$headCell.pos));if(oi(n)&&oi(r)&&ii(n,r)){let e=this.$anchorCell.node(-1)!=n.node(-1);return e&&this.isRowSelection()?di.rowSelection(n,r):e&&this.isColSelection()?di.colSelection(n,r):new di(n,r)}return we.U3.between(n,r)}content(){let e=this.$anchorCell.node(-1),t=Jo.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[];for(let n=r.top;n<r.bottom;n++){let s=[];for(let i=n*t.width+r.left,a=r.left;a<r.right;a++,i++){let n=t.map[i];if(!o[n]){o[n]=!0;let i=t.findCell(n),a=e.nodeAt(n),l=r.left-i.left,c=i.right-r.right;if(l>0||c>0){let e=a.attrs;l>0&&(e=li(e,0,l)),c>0&&(e=li(e,e.colspan-c,c)),a=i.left<r.left?a.type.createAndFill(e):a.type.create(e,a.content)}if(i.top<r.top||i.bottom>r.bottom){let e=ai(a.attrs,"rowspan",Math.min(i.bottom,r.bottom)-Math.max(i.top,r.top));a=i.top<r.top?a.type.createAndFill(e):a.type.create(e,a.content)}s.push(a)}}i.push(e.child(n).copy(zn.FK.from(s)))}const s=this.isColSelection()&&this.isRowSelection()?e:i;return new zn.Ji(zn.FK.from(s),1,1)}replace(e,t=zn.Ji.empty){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=e.mapping.slice(n);e.replace(a.map(i.pos),a.map(s.pos),o?zn.Ji.empty:t)}let o=we.LN.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,t){this.replace(e,new zn.Ji(zn.FK.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=Jo.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<o.length;n++)e(t.nodeAt(o[n]),r+o[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){let n=Jo.get(e.node(-1)),r=e.start(-1),o=n.findCell(e.pos-r),i=n.findCell(t.pos-r),s=e.node(0);return o.top<=i.top?(o.top>0&&(e=s.resolve(r+n.map[o.left])),i.bottom<n.height&&(t=s.resolve(r+n.map[n.width*(n.height-1)+i.right-1]))):(i.top>0&&(t=s.resolve(r+n.map[i.left])),o.bottom<n.height&&(e=s.resolve(r+n.map[n.width*(n.height-1)+o.right-1]))),new di(e,t)}isRowSelection(){let e=Jo.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),r=e.colCount(this.$headCell.pos-t);if(Math.min(n,r)>0)return!1;let o=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,i)==e.width}eq(e){return e instanceof di&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){let n=Jo.get(e.node(-1)),r=e.start(-1),o=n.findCell(e.pos-r),i=n.findCell(t.pos-r),s=e.node(0);return o.left<=i.left?(o.left>0&&(e=s.resolve(r+n.map[o.top*n.width])),i.right<n.width&&(t=s.resolve(r+n.map[n.width*(i.top+1)-1]))):(i.left>0&&(t=s.resolve(r+n.map[i.top*n.width])),o.right<n.width&&(e=s.resolve(r+n.map[n.width*(o.top+1)-1]))),new di(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new di(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){return new di(e.resolve(t),e.resolve(n))}getBookmark(){return new pi(this.$anchorCell.pos,this.$headCell.pos)}}di.prototype.visible=!1,we.LN.jsonID("cell",di);class pi{constructor(e,t){this.anchor=e,this.head=t}map(e){return new pi(e.map(this.anchor),e.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&ii(t,n)?new di(t,n):we.LN.near(n,1)}}function ui(e){if(!(e.selection instanceof di))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(ke.NZ.node(n,n+e.nodeSize,{class:"selectedCell"}))}),ke.zF.create(e.doc,t)}function hi(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;1==t.childCount&&(n>0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;let o=t.firstChild,i=o.type.spec.tableRole,s=o.type.schema,a=[];if("row"==i)for(let e=0;e<t.childCount;e++){let o=t.child(e).content,i=e?0:Math.max(0,n-1),l=e<t.childCount-1?0:Math.max(0,r-1);(i||l)&&(o=fi(Qo(s).row,new zn.Ji(o,i,l)).content),a.push(o)}else{if("cell"!=i&&"header_cell"!=i)return null;a.push(n||r?fi(Qo(s).row,new zn.Ji(t,n,r)).content:t)}return function(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:o,colspan:i}=r.child(t).attrs;for(let t=e;t<e+o;t++)n[t]=(n[t]||0)+i}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let o=0;o<n.length;o++)if(o>=t.length&&t.push(zn.FK.empty),n[o]<r){let i=Qo(e).cell.createAndFill(),s=[];for(let e=n[o];e<r;e++)s.push(i);t[o]=t[o].append(zn.FK.from(s))}return{height:t.length,width:r,rows:t}}(s,a)}function fi(e,t){let n=e.createAndFill();return new Xe.dL(n).replace(0,n.content.size,t).doc}function mi(e,t,n,r,o,i,s,a){if(0==s||s==t.height)return!1;let l=!1;for(let c=o;c<i;c++){let o=s*t.width+c,i=t.map[o];if(t.map[o-t.width]==i){l=!0;let o=n.nodeAt(i),{top:d,left:p}=t.findCell(i);e.setNodeMarkup(e.mapping.slice(a).map(i+r),null,ai(o.attrs,"rowspan",s-d)),e.insert(e.mapping.slice(a).map(t.positionAt(s,p,n)),o.type.createAndFill(ai(o.attrs,"rowspan",d+o.attrs.rowspan-s))),c+=o.attrs.colspan-1}}return l}function gi(e,t,n,r,o,i,s,a){if(0==s||s==t.width)return!1;let l=!1;for(let c=o;c<i;c++){let o=c*t.width+s,i=t.map[o];if(t.map[o-1]==i){l=!0;let o=n.nodeAt(i),d=t.colCount(i),p=e.mapping.slice(a).map(i+r);e.setNodeMarkup(p,null,li(o.attrs,s-d,o.attrs.colspan-(s-d))),e.insert(p+o.nodeSize,o.type.createAndFill(li(o.attrs,0,s-d))),c+=o.attrs.rowspan-1}}return l}function bi(e,t,n,r,o){let i=n?e.doc.nodeAt(n-1):e.doc,s=Jo.get(i),{top:a,left:l}=r,c=l+o.width,d=a+o.height,p=e.tr,u=0;function h(){i=n?p.doc.nodeAt(n-1):p.doc,s=Jo.get(i),u=p.mapping.maps.length}(function(e,t,n,r,o,i,s){let a,l,c=Qo(e.doc.type.schema);if(o>t.width)for(let i=0,d=0;i<t.height;i++){let p=n.child(i);d+=p.nodeSize;let u,h=[];u=null==p.lastChild||p.lastChild.type==c.cell?a||(a=c.cell.createAndFill()):l||(l=c.header_cell.createAndFill());for(let e=t.width;e<o;e++)h.push(u);e.insert(e.mapping.slice(s).map(d-1+r),h)}if(i>t.height){let d=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,o);e++){let o=!(e>=t.width)&&n.nodeAt(t.map[r+e]).type==c.header_cell;d.push(o?l||(l=c.header_cell.createAndFill()):a||(a=c.cell.createAndFill()))}let p=c.row.create(null,zn.FK.from(d)),u=[];for(let e=t.height;e<i;e++)u.push(p);e.insert(e.mapping.slice(s).map(r+n.nodeSize-2),u)}return!(!a&&!l)})(p,s,i,n,c,d,u)&&h(),mi(p,s,i,n,l,c,a,u)&&h(),mi(p,s,i,n,l,c,d,u)&&h(),gi(p,s,i,n,a,d,l,u)&&h(),gi(p,s,i,n,a,d,c,u)&&h();for(let e=a;e<d;e++){let t=s.positionAt(e,l,i),r=s.positionAt(e,c,i);p.replace(p.mapping.slice(u).map(t+n),p.mapping.slice(u).map(r+n),new zn.Ji(o.rows[e-a],0,0))}h(),p.setSelection(new di(p.doc.resolve(n+s.positionAt(a,l,i)),p.doc.resolve(n+s.positionAt(d-1,c-1,i)))),t(p)}const yi=(0,Dn.K)({ArrowLeft:wi("horiz",-1),ArrowRight:wi("horiz",1),ArrowUp:wi("vert",-1),ArrowDown:wi("vert",1),"Shift-ArrowLeft":vi("horiz",-1),"Shift-ArrowRight":vi("horiz",1),"Shift-ArrowUp":vi("vert",-1),"Shift-ArrowDown":vi("vert",1),Backspace:xi,"Mod-Backspace":xi,Delete:xi,"Mod-Delete":xi});function Ai(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function wi(e,t){return(n,r,o)=>{let i=n.selection;if(i instanceof di)return Ai(n,r,we.LN.near(i.$headCell,t));if("horiz"!=e&&!i.empty)return!1;let s=Ei(o,e,t);if(null==s)return!1;if("horiz"==e)return Ai(n,r,we.LN.near(n.doc.resolve(i.head+t),t));{let o,i=n.doc.resolve(s),a=si(i,e,t);return o=a?we.LN.near(a,1):t<0?we.LN.near(n.doc.resolve(i.before(-1)),-1):we.LN.near(n.doc.resolve(i.after(-1)),1),Ai(n,r,o)}}}function vi(e,t){return(n,r,o)=>{let i=n.selection;if(!(i instanceof di)){let r=Ei(o,e,t);if(null==r)return!1;i=new di(n.doc.resolve(r))}let s=si(i.$headCell,e,t);return!!s&&Ai(n,r,new di(i.$anchorCell,s))}}function xi(e,t){let n=e.selection;if(!(n instanceof di))return!1;if(t){let r=e.tr,o=Qo(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new zn.Ji(o,0,0))}),r.docChanged&&t(r)}return!0}function ki(e,t){let n=ti(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new di(n))),!0)}function Ci(e,t,n){if(!ni(e.state))return!1;let r=hi(n),o=e.state.selection;if(o instanceof di){r||(r={width:1,height:1,rows:[zn.FK.from(fi(Qo(e.state.schema).cell,n))]});let t=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),s=Jo.get(t).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=function({width:e,height:t,rows:n},r,o){if(e!=r){let t=[],o=[];for(let e=0;e<n.length;e++){let i=n[e],s=[];for(let n=t[e]||0,o=0;n<r;o++){let a=i.child(o%i.childCount);n+a.attrs.colspan>r&&(a=a.type.create(li(a.attrs,a.attrs.colspan,n+a.attrs.colspan-r),a.content)),s.push(a),n+=a.attrs.colspan;for(let n=1;n<a.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+a.attrs.colspan}o.push(zn.FK.from(s))}n=o,e=r}if(t!=o){let e=[];for(let r=0,i=0;r<o;r++,i++){let s=[],a=n[i%t];for(let e=0;e<a.childCount;e++){let t=a.child(e);r+t.attrs.rowspan>o&&(t=t.type.create(ai(t.attrs,"rowspan",Math.max(1,o-t.attrs.rowspan)),t.content)),s.push(t)}e.push(zn.FK.from(s))}n=e,t=o}return{width:e,height:t,rows:n}}(r,s.right-s.left,s.bottom-s.top),bi(e.state,e.dispatch,i,s,r),!0}if(r){let t=ri(e.state),n=t.start(-1);return bi(e.state,e.dispatch,n,Jo.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function _i(e,t){if(t.ctrlKey||t.metaKey)return;let n,r=Si(e,t.target);if(t.shiftKey&&e.state.selection instanceof di)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(n=ti(e.state.selection.$anchor))&&Bi(e,t).pos!=n.pos)o(n,t),t.preventDefault();else if(!r)return;function o(t,n){let r=Bi(e,n),o=null==ei.getState(e.state);if(!r||!ii(t,r)){if(!o)return;r=t}let i=new di(t,r);if(o||!e.state.selection.eq(i)){let n=e.state.tr.setSelection(i);o&&n.setMeta(ei,t.pos),e.dispatch(n)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",s),null!=ei.getState(e.state)&&e.dispatch(e.state.tr.setMeta(ei,-1))}function s(n){let s,a=ei.getState(e.state);if(null!=a)s=e.state.doc.resolve(a);else if(Si(e,n.target)!=r&&(s=Bi(e,t),!s))return i();s&&o(s,n)}e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",s)}function Ei(e,t,n){if(!(e.state.selection instanceof we.U3))return null;let{$head:r}=e.state.selection;for(let o=r.depth-1;o>=0;o--){let i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){let i=r.before(o),s="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?i:null}}return null}function Si(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function Bi(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?ti(e.state.doc.resolve(n.pos)):null}const Mi=new we.hs("fix-tables");function Oi(e,t,n,r){let o=e.childCount,i=t.childCount;e:for(let s=0,a=0;s<i;s++){let i=t.child(s);for(let t=a,r=Math.min(o,s+3);t<r;t++)if(e.child(t)==i){a=t+1,n+=i.nodeSize;continue e}r(i,n),a<o&&e.child(a).sameMarkup(i)?Oi(e.child(a),i,n+1,r):i.nodesBetween(0,i.content.size,r,n+1),n+=i.nodeSize}}function Ii(e,t){let n,r=(t,r)=>{"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){let o=Jo.get(t);if(!o.problems)return r;r||(r=e.tr);let i,s,a=[];for(let e=0;e<o.height;e++)a.push(0);for(let e=0;e<o.problems.length;e++){let i=o.problems[e];if("collision"==i.type){let e=t.nodeAt(i.pos);for(let t=0;t<e.attrs.rowspan;t++)a[i.row+t]+=i.n;r.setNodeMarkup(r.mapping.map(n+1+i.pos),null,li(e.attrs,e.attrs.colspan-i.n,i.n))}else if("missing"==i.type)a[i.row]+=i.n;else if("overlong_rowspan"==i.type){let e=t.nodeAt(i.pos);r.setNodeMarkup(r.mapping.map(n+1+i.pos),null,ai(e.attrs,"rowspan",e.attrs.rowspan-i.n))}else if("colwidth mismatch"==i.type){let e=t.nodeAt(i.pos);r.setNodeMarkup(r.mapping.map(n+1+i.pos),null,ai(e.attrs,"colwidth",i.colwidth))}}for(let e=0;e<a.length;e++)a[e]&&(null==i&&(i=e),s=e);for(let l=0,c=n+1;l<o.height;l++){let n=t.child(l),o=c+n.nodeSize,d=a[l];if(d>0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<d;n++)a.push(Qo(e.schema)[t].createAndFill());let p=0!=l&&i!=l-1||s!=l?o-1:c+1;r.insert(r.mapping.map(p),a)}c=o}return r.setMeta(Mi,{fixTables:!0})}(e,t,r,n))};return t?t.doc!=e.doc&&Oi(t.doc,e.doc,0,r):e.doc.descendants(r),n}function Ti(e){let t,n=e.selection,r=ri(e),o=r.node(-1),i=r.start(-1),s=Jo.get(o);return t=n instanceof di?s.rectBetween(n.$anchorCell.pos-i,n.$headCell.pos-i):s.findCell(r.pos-i),t.tableStart=i,t.map=s,t.table=o,t}function Li(e,{map:t,tableStart:n,table:r},o){let i=o>0?-1:0;(function(e,t,n){let r=Qo(t.type.schema).header_cell;for(let o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0})(t,r,o+i)&&(i=0==o||o==t.width?null:0);for(let s=0;s<t.height;s++){let a=s*t.width+o;if(o>0&&o<t.width&&t.map[a-1]==t.map[a]){let i=t.map[a],l=r.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,ci(l.attrs,o-t.colCount(i))),s+=l.attrs.rowspan-1}else{let l=null==i?Qo(r.type.schema).cell:r.nodeAt(t.map[a+i]).type,c=t.positionAt(s,o,r);e.insert(e.mapping.map(n+c),l.createAndFill())}}return e}function Ni(e,{map:t,table:n,tableStart:r},o){let i=e.mapping.maps.length;for(let s=0;s<t.height;){let a=s*t.width+o,l=t.map[a],c=n.nodeAt(l);if(o>0&&t.map[a-1]==l||o<t.width-1&&t.map[a+1]==l)e.setNodeMarkup(e.mapping.slice(i).map(r+l),null,li(c.attrs,o-t.colCount(l)));else{let t=e.mapping.slice(i).map(r+l);e.delete(t,t+c.nodeSize)}s+=c.attrs.rowspan}}function Ri(e,{map:t,tableStart:n,table:r},o){let i=n;for(let e=0;e<o;e++)i+=r.child(e).nodeSize;let s=[],a=o>0?-1:0;(function(e,t,n){let r=Qo(t.type.schema).header_cell;for(let o=0;o<e.width;o++)if(t.nodeAt(e.map[o+n*e.width]).type!=r)return!1;return!0})(t,r,o+a)&&(a=0==o||o==t.height?null:0);for(let i=0,l=t.width*o;i<t.width;i++,l++)if(o>0&&o<t.height&&t.map[l]==t.map[l-t.width]){let o=t.map[l],s=r.nodeAt(o).attrs;e.setNodeMarkup(n+o,null,ai(s,"rowspan",s.rowspan+1)),i+=s.colspan-1}else{let e=null==a?Qo(r.type.schema).cell:r.nodeAt(t.map[l+a*t.width]).type;s.push(e.createAndFill())}return e.insert(i,Qo(r.type.schema).row.create(null,s)),e}function Di(e,{map:t,table:n,tableStart:r},o){let i=0;for(let e=0;e<o;e++)i+=n.child(e).nodeSize;let s=i+n.child(o).nodeSize,a=e.mapping.maps.length;e.delete(i+r,s+r);for(let i=0,s=o*t.width;i<t.width;i++,s++){let l=t.map[s];if(o>0&&l==t.map[s-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(a).map(l+r),null,ai(t,"rowspan",t.rowspan-1)),i+=t.colspan-1}else if(o<t.width&&l==t.map[s+t.width]){let s=n.nodeAt(l),c=s.type.create(ai(s.attrs,"rowspan",s.attrs.rowspan-1),s.content),d=t.positionAt(o+1,i,n);e.insert(e.mapping.slice(a).map(r+d),c),i+=s.attrs.colspan-1}}}function zi(e){let t=e.content;return 1==t.childCount&&t.firstChild.isTextblock&&0==t.firstChild.childCount}function Pi(e,t){let n=e.selection;if(!(n instanceof di)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Ti(e),{map:o}=r;if(function({width:e,height:t,map:n},r){let o=r.top*e+r.left,i=o,s=(r.bottom-1)*e+r.left,a=o+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[i]==n[i-1]||r.right<e&&n[a]==n[a+1])return!0;i+=e,a+=e}for(let i=r.left;i<r.right;i++){if(r.top>0&&n[o]==n[o-e]||r.bottom<t&&n[s]==n[s+e])return!0;o++,s++}return!1}(o,r))return!1;if(t){let n,i,s=e.tr,a={},l=zn.FK.empty;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let c=o.map[e*o.width+t],d=r.table.nodeAt(c);if(!a[c])if(a[c]=!0,null==n)n=c,i=d;else{zi(d)||(l=l.append(d.content));let e=s.mapping.map(c+r.tableStart);s.delete(e,e+d.nodeSize)}}if(s.setNodeMarkup(n+r.tableStart,null,ai(ci(i.attrs,i.attrs.colspan,r.right-r.left-i.attrs.colspan),"rowspan",r.bottom-r.top)),l.size){let e=n+1+i.content.size,t=zi(i)?n+1:e;s.replaceWith(t+r.tableStart,e+r.tableStart,l)}s.setSelection(new di(s.doc.resolve(n+r.tableStart))),t(s)}return!0}function $i(e,t){const n=Qo(e.schema);return(r=({node:e})=>n[e.type.spec.tableRole],(e,t)=>{let n,o,i=e.selection;if(i instanceof di){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;n=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{if(n=function(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(i.$from),!n)return!1;o=ti(i.$from).pos}if(1==n.attrs.colspan&&1==n.attrs.rowspan)return!1;if(t){let s=n.attrs,a=[],l=s.colwidth;s.rowspan>1&&(s=ai(s,"rowspan",1)),s.colspan>1&&(s=ai(s,"colspan",1));let c,d=Ti(e),p=e.tr;for(let e=0;e<d.right-d.left;e++)a.push(l?ai(s,"colwidth",l&&l[e]?[l[e]]:null):s);for(let e=d.top;e<d.bottom;e++){let t=d.map.positionAt(e,d.left,d.table);e==d.top&&(t+=n.nodeSize);for(let o=d.left,i=0;o<d.right;o++,i++)o==d.left&&e==d.top||p.insert(c=p.mapping.map(t+d.tableStart,1),r({node:n,row:e,col:o}).createAndFill(a[i]))}p.setNodeMarkup(o,r({node:n,row:d.top,col:d.left}),a[0]),i instanceof di&&p.setSelection(new di(p.doc.resolve(i.$anchorCell.pos),c&&p.doc.resolve(c))),t(p)}return!0})(e,t);var r}function Hi(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;e<r.length;e++){const o=t.table.nodeAt(r[e]);if(o&&o.type!==n.header_cell)return!1}return!0}function ji(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!ni(t))return!1;if(n){let r=Qo(t.schema),o=Ti(t),i=t.tr,s=o.map.cellsInRect("column"==e?new Ko(o.left,0,o.right,o.map.height):"row"==e?new Ko(0,o.top,o.map.width,o.bottom):o),a=s.map(e=>o.table.nodeAt(e));for(let e=0;e<s.length;e++)a[e].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[e],r.cell,a[e].attrs);if(0==i.steps.length)for(let e=0;e<s.length;e++)i.setNodeMarkup(o.tableStart+s[e],r.header_cell,a[e].attrs);n(i)}return!0}}(e):function(t,n){if(!ni(t))return!1;if(n){let r=Qo(t.schema),o=Ti(t),i=t.tr,s=Hi("row",o,r),a=Hi("column",o,r),l=("column"===e?s:"row"===e&&a)?1:0,c="column"==e?new Ko(0,l,1,o.map.height):"row"==e?new Ko(l,0,o.map.width,1):o,d="column"==e?a?r.cell:r.header_cell:"row"==e?s?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach(e=>{const t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,d,n.attrs)}),n(i)}return!0}}ji("row",{useDeprecatedLogic:!0}),ji("column",{useDeprecatedLogic:!0});let Ui=ji("cell",{useDeprecatedLogic:!0});function Fi(e){return function(t,n){if(!ni(t))return!1;let r=function(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t);if(r.childCount)return n-1-r.lastChild.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}}(ri(t),e);if(null!=r){if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(we.U3.between(e,(o=e,o.node(0).resolve(o.pos+o.nodeAfter.nodeSize)))).scrollIntoView())}var o;return!0}}}class Vi{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),qi(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,qi(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}}function qi(e,t,n,r,o,i){let s=0,a=!0,l=t.firstChild,c=e.firstChild;for(let e=0,n=0;e<c.childCount;e++){let{colspan:d,colwidth:p}=c.child(e).attrs;for(let e=0;e<d;e++,n++){let c=o==n?i:p&&p[e],d=c?c+"px":"";s+=c||r,c||(a=!1),l?(l.style.width!=d&&(l.style.width=d),l=l.nextSibling):t.appendChild(document.createElement("col")).style.width=d}}for(;l;){let e=l.nextSibling;l.parentNode.removeChild(l),l=e}a?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}const Wi=new we.hs("tableColumnResizing");function Yi({handleWidth:e=5,cellMinWidth:t=25,View:n=Vi,lastColumnResizable:r=!0}={}){let o=new we.k_({key:Wi,state:{init(e,r){return this.spec.props.nodeViews[Qo(r.schema).table.name]=(e,r)=>new n(e,t,r),new Xi(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>Wi.getState(e).activeHandle>-1?{class:"resize-cursor"}:null,handleDOMEvents:{mousemove(t,n){!function(e,t,n,r,o){let i=Wi.getState(e.state);if(!i.dragging){let r=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),s=-1;if(r){let{left:o,right:i}=r.getBoundingClientRect();t.clientX-o<=n?s=Zi(e,t,"left"):i-t.clientX<=n&&(s=Zi(e,t,"right"))}if(s!=i.activeHandle){if(!o&&-1!==s){let t=e.state.doc.resolve(s),n=t.node(-1),r=Jo.get(n),o=t.start(-1);if(r.colCount(t.pos-o)+t.nodeAfter.attrs.colspan-1==r.width-1)return}Ji(e,s)}}}(t,n,e,0,r)},mouseleave(e){!function(e){let t=Wi.getState(e.state);t.activeHandle>-1&&!t.dragging&&Ji(e,-1)}(e)},mousedown(e,n){!function(e,t,n){let r=Wi.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;let o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,{colspan:n,colwidth:r}){let o=r&&r[r.length-1];if(o)return o;let i=e.domAtPos(t),s=i.node.childNodes[i.offset],a=s.offsetWidth,l=n;if(r)for(let e=0;e<n;e++)r[e]&&(a-=r[e],l--);return a/l}(e,r.activeHandle,o.attrs);function s(t){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);let r=Wi.getState(e.state);r.dragging&&(!function(e,t,n){let r=e.state.doc.resolve(t),o=r.node(-1),i=Jo.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let e=0;e<i.height;e++){let t=e*i.width+a;if(e&&i.map[t]==i.map[t-i.width])continue;let r=i.map[t],{attrs:c}=o.nodeAt(r),d=1==c.colspan?0:a-i.colCount(r);if(c.colwidth&&c.colwidth[d]==n)continue;let p=c.colwidth?c.colwidth.slice():Gi(c.colspan);p[d]=n,l.setNodeMarkup(s+r,null,ai(c,"colwidth",p))}l.docChanged&&e.dispatch(l)}(e,r.activeHandle,Ki(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Wi,{setDragging:null})))}function a(t){if(!t.which)return s(t);let r=Wi.getState(e.state),o=Ki(r.dragging,t,n);!function(e,t,n,r){let o=e.state.doc.resolve(t),i=o.node(-1),s=o.start(-1),a=Jo.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,l=e.domAtPos(o.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;qi(i,l.firstChild,l,r,a,n)}(e,r.activeHandle,o,n)}e.dispatch(e.state.tr.setMeta(Wi,{setDragging:{startX:t.clientX,startWidth:i}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),t.preventDefault()}(e,n,t)}},decorations(e){let t=Wi.getState(e);if(t.activeHandle>-1)return function(e,t){let n=[],r=e.doc.resolve(t),o=r.node(-1),i=Jo.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan;for(let e=0;e<i.height;e++){let t=a+e*i.width-1;if(!(a!=i.width&&i.map[t]==i.map[t+1]||0!=e&&i.map[t-1]==i.map[t-1-i.width])){let e=i.map[t],r=s+e+o.nodeAt(e).nodeSize-1,a=document.createElement("div");a.className="column-resize-handle",n.push(ke.NZ.widget(r,a))}}return ke.zF.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}});return o}class Xi{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){let t=this,n=e.getMeta(Wi);if(n&&null!=n.setHandle)return new Xi(n.setHandle,null);if(n&&void 0!==n.setDragging)return new Xi(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){let n=e.mapping.map(t.activeHandle,-1);oi(e.doc.resolve(n))||(n=null),t=new Xi(n,t.dragging)}return t}}function Zi(e,t,n){let r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;let{pos:o}=r,i=ti(e.state.doc.resolve(o));if(!i)return-1;if("right"==n)return i.pos;let s=Jo.get(i.node(-1)),a=i.start(-1),l=s.map.indexOf(i.pos-a);return l%s.width==0?-1:a+s.map[l-1]}function Ki(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function Ji(e,t){e.dispatch(e.state.tr.setMeta(Wi,{setHandle:t}))}function Gi(e){let t=[];for(let n=0;n<e;n++)t.push(0);return t}function Qi({allowTableNodeSelection:e=!1}={}){return new we.k_({key:ei,state:{init:()=>null,apply(e,t){let n=e.getMeta(ei);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;let{deleted:r,pos:o}=e.mapping.mapResult(t);return r?null:o}},props:{decorations:ui,handleDOMEvents:{mousedown:_i},createSelectionBetween(e){if(null!=ei.getState(e.state))return e.state.selection},handleTripleClick:ki,handleKeyDown:yi,handlePaste:Ci},appendTransaction:(t,n,r)=>function(e,t,n){let r,o,i=(t||e).selection,s=(t||e).doc;if(i instanceof we.nh&&(o=i.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)r=di.create(s,i.from);else if("row"==o){let e=s.resolve(i.from+1);r=di.rowSelection(e,e)}else if(!n){let e=Jo.get(i.node),t=i.from+1,n=t+e.map[e.width*e.height-1];r=di.create(s,t+1,n)}}else i instanceof we.U3&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos<e.pos-6)return!1;let n=e.pos,r=t.pos,o=e.depth;for(;o>=0&&!(e.after(o+1)<e.end(o));o--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(o).type.spec.tableRole)}(i)?r=we.U3.create(s,i.from):i instanceof we.U3&&function({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if("cell"===r.type.spec.tableRole||"header_cell"===r.type.spec.tableRole){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){r=n;break}}return n!==r&&0===t.parentOffset}(i)&&(r=we.U3.create(s,i.$from.start(),i.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,Ii(r,n),e)})}function es(e,t){return t?e.createChecked(null,t):e.createAndFill()}function ts(e,t,n,r,o){const i=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}(e),s=[],a=[];for(let e=0;e<n;e+=1){const e=es(i.cell,o);if(e&&a.push(e),r){const e=es(i.header_cell,o);e&&s.push(e)}}const l=[];for(let e=0;e<t;e+=1)l.push(i.row.createChecked(null,r&&0===e?s:a));return i.table.createChecked(null,l)}const ns=e=>{let{editor:t}=e;const{selection:n}=t.state;if(!(n instanceof di))return!1;let r=0;const o=(0,Ae.eL)(n.ranges[0].$from,e=>"table"===e.type.name);o?.node.descendants(e=>{if("table"===e.type.name)return!1;["tableCell","tableHeader"].includes(e.type.name)&&(r+=1)});return r===n.ranges.length&&(t.commands.deleteTable(),!0)};function rs(e,t,n,r,o,i){let s=0,a=!0,l=t.firstChild;const c=e.firstChild;for(let e=0,n=0;e<c.childCount;e+=1){const{colspan:d,colwidth:p}=c.child(e).attrs;for(let e=0;e<d;e+=1,n+=1){const c=o===n?i:p&&p[e],d=c?`${c}px`:"";s+=c||r,c||(a=!1),l?(l.style.width!==d&&(l.style.width=d),l=l.nextSibling):t.appendChild(document.createElement("col")).style.width=d}}for(;l;){const e=l.nextSibling;l.parentNode.removeChild(l),l=e}n.style.width="50%"}class os{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.margin="auto",this.colgroup=this.table.appendChild(document.createElement("colgroup")),rs(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type===this.node.type&&(this.node=e,rs(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return"attributes"===e.type&&(e.target===this.table||this.colgroup.contains(e.target))}}function is(e,t,n,r,o,i){let s=0,a=!0,l=t.firstChild;const c=e.firstChild;for(let e=0,n=0;e<c.childCount;e+=1){const{colspan:d,colwidth:p}=c.child(e).attrs;for(let e=0;e<d;e+=1,n+=1){const c=o===n?i:p&&p[e],d=c?`${c}px`:"";s+=c||r,c||(a=!1),l?(l.style.width!==d&&(l.style.width=d),l=l.nextSibling):t.appendChild(document.createElement("col")).style.width=d}}for(;l;){const e=l.nextSibling;l.parentNode.removeChild(l),l=e}}class ss{constructor(e,t,n,r){const{width:o}=r;this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.classList.add("cdtr-table-element"),this.table.style.margin="auto",this.table.style.width=o,this.colgroup=this.table.appendChild(document.createElement("colgroup")),is(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type===this.node.type&&(this.node=e,is(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return"attributes"===e.type&&(e.target===this.table||this.colgroup.contains(e.target))}}let as,ls;if("undefined"!=typeof WeakMap){let e=new WeakMap;as=t=>e.get(t),ls=(t,n)=>(e.set(t,n),n)}else{let e=[],t=10,n=0;as=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},ls=(r,o)=>(n==t&&(n=0),e[n++]=r,e[n++]=o)}class cs{constructor(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r}}class ds{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,o=t/this.width|0,i=r+1,s=o+1;for(let e=1;i<this.width&&this.map[t+e]==n;e++)i++;for(let e=1;s<this.height&&this.map[t+this.width*e]==n;e++)s++;return new cs(r,o,i,s)}throw new RangeError("No cell with offset "+e+" found")}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError("No cell with offset "+e+" found")}nextCell(e,t,n){let{left:r,right:o,top:i,bottom:s}=this.findCell(e);return"horiz"==t?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:s==this.height)?null:this.map[r+this.width*(n<0?i-1:s)]}rectBetween(e,t){let{left:n,right:r,top:o,bottom:i}=this.findCell(e),{left:s,right:a,top:l,bottom:c}=this.findCell(t);return new cs(Math.min(n,s),Math.min(o,l),Math.max(r,a),Math.max(i,c))}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let o=e.left;o<e.right;o++){let i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,o==e.left&&o&&this.map[i-1]==s||r==e.top&&r&&this.map[i-this.width]==s||t.push(s))}return t}positionAt(e,t,n){for(let r=0,o=0;;r++){let i=o+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<o;)n++;return n==r?i-1:this.map[n]}o=i}}static get(e){return as(e)||ls(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);let t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let o=e.child(r),i=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let o=n.child(e);t+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){let t=o.child(e);i+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,s=[];for(let e=0,o=t*n;e<o;e++)r[e]=0;for(let a=0,l=0;a<n;a++){let c=e.child(a);l++;for(let e=0;;e++){for(;o<r.length&&0!=r[o];)o++;if(e==c.childCount)break;let d=c.child(e),{colspan:p,rowspan:u,colwidth:h}=d.attrs;for(let e=0;e<u;e++){if(e+a>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:l,n:u-e});break}let c=o+e*t;for(let e=0;e<p;e++){0==r[c+e]?r[c+e]=l:(i||(i=[])).push({type:"collision",row:a,pos:l,n:p-e});let n=h&&h[e];if(n){let r=(c+e)%t*2,o=s[r];null==o||o!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):o==n&&s[r+1]++}}}o+=p,l+=d.nodeSize}let d=(a+1)*t,p=0;for(;o<d;)0==r[o++]&&p++;p&&(i||(i=[])).push({type:"missing",row:a,n:p}),l++}let a=new ds(t,n,r,i),l=!1;for(let e=0;!l&&e<s.length;e+=2)null!=s[e]&&s[e+1]<n&&(l=!0);l&&function(e,t,n){e.problems||(e.problems=[]);for(let r=0,o={};r<e.map.length;r++){let i=e.map[r];if(o[i])continue;o[i]=!0;let s=n.nodeAt(i),a=null;for(let n=0;n<s.attrs.colspan;n++){let o=t[2*((r+n)%e.width)];null==o||s.attrs.colwidth&&s.attrs.colwidth[n]==o||((a||(a=ps(s.attrs)))[n]=o)}a&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}(a,s,e);return a}(e))}}function ps(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}new we.hs("selectingCells");function us(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function hs(e,t,n){let r={};for(let t in e)r[t]=e[t];return r[t]=n,r}const fs=new we.hs("tableColumnSimple");function ms(){let{handleWidth:e=5,cellMinWidth:t=25,width:n="100%",View:r=ss,lastColumnResizable:o=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=new we.k_({key:fs,state:{init(e,o){return this.spec.props.nodeViews[function(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}}return t}(o.schema).table.name]=(e,o)=>new r(e,t,o,{width:n}),new gs(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>fs.getState(e).activeHandle>-1?{class:"resize-cursor"}:null,handleDOMEvents:{mousemove(t,n){!function(e,t,n,r,o){let i=fs.getState(e.state);if(!i.dragging){let r=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),s=-1;if(r){let{left:o,right:i}=r.getBoundingClientRect();t.clientX-o<=n?s=bs(e,t,"left"):i-t.clientX<=n&&(s=bs(e,t,"right"))}if(s!=i.activeHandle){if(!o&&-1!==s){let t=e.state.doc.resolve(s),n=t.node(-1),r=ds.get(n),o=t.start(-1);if(r.colCount(t.pos-o)+t.nodeAfter.attrs.colspan-1==r.width-1)return}As(e,s)}}}(t,n,e,0,o)},mouseleave(e){!function(e){let t=fs.getState(e.state);t.activeHandle>-1&&!t.dragging&&As(e,-1)}(e)},mousedown(e,n){!function(e,t,n){let r=fs.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;let o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,n){let{colspan:r,colwidth:o}=n,i=o&&o[o.length-1];if(i)return i;let s=e.domAtPos(t),a=s.node.childNodes[s.offset],l=a.offsetWidth,c=r;if(o)for(let e=0;e<r;e++)o[e]&&(l-=o[e],c--);return l/c}(e,r.activeHandle,o.attrs);function s(t){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);let r=fs.getState(e.state);r.dragging&&(!function(e,t,n){let r=e.state.doc.resolve(t),o=r.node(-1),i=ds.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let e=0;e<i.height;e++){let t=e*i.width+a;if(e&&i.map[t]==i.map[t-i.width])continue;let r=i.map[t],{attrs:c}=o.nodeAt(r),d=1==c.colspan?0:a-i.colCount(r);if(c.colwidth&&c.colwidth[d]==n)continue;let p=c.colwidth?c.colwidth.slice():ws(c.colspan);p[d]=n,l.setNodeMarkup(s+r,null,hs(c,"colwidth",p))}l.docChanged&&e.dispatch(l)}(e,r.activeHandle,ys(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(fs,{setDragging:null})))}function a(t){if(!t.which)return s(t);let r=fs.getState(e.state),o=ys(r.dragging,t,n);!function(e,t,n,r){let o=e.state.doc.resolve(t),i=o.node(-1),s=o.start(-1),a=ds.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,l=e.domAtPos(o.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;is(i,l.firstChild,0,r,a,n)}(e,r.activeHandle,o,n)}e.dispatch(e.state.tr.setMeta(fs,{setDragging:{startX:t.clientX,startWidth:i}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),t.preventDefault()}(e,n,t)}},decorations(e){let t=fs.getState(e);if(t.activeHandle>-1)return function(e,t){let n=[],r=e.doc.resolve(t),o=r.node(-1),i=ds.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan;for(let e=0;e<i.height;e++){let t=a+e*i.width-1;if(!(a!=i.width&&i.map[t]==i.map[t+1]||0!=e&&i.map[t-1]==i.map[t-1-i.width])){let e=i.map[t],r=s+e+o.nodeAt(e).nodeSize-1,a=document.createElement("div");a.className="column-resize-handle",n.push(ke.NZ.widget(r,a))}}return ke.zF.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}});return i}class gs{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){let t=this,n=e.getMeta(fs);if(n&&null!=n.setHandle)return new gs(n.setHandle,null);if(n&&void 0!==n.setDragging)return new gs(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){let n=e.mapping.map(t.activeHandle,-1);"row"==(r=e.doc.resolve(n)).parent.type.spec.tableRole&&r.nodeAfter||(n=null),t=new gs(n,t.dragging)}var r;return t}}function bs(e,t,n){let r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;let{pos:o}=r,i=us(e.state.doc.resolve(o));if(!i)return-1;if("right"==n)return i.pos;let s=ds.get(i.node(-1)),a=i.start(-1),l=s.map.indexOf(i.pos-a);return l%s.width==0?-1:a+s.map[l-1]}function ys(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function As(e,t){e.dispatch(e.state.tr.setMeta(fs,{setHandle:t}))}function ws(e){let t=[];for(let n=0;n<e;n++)t.push(0);return t}const vs=Ae.bP.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,color:"red",width:"100%",View:ss,ReiszeView:os,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML(e){let{HTMLAttributes:t}=e;return["table",(0,Ae.KV)(this.options.HTMLAttributes,t),["tbody",0]]},addCommands:()=>({insertTable:function(){let{rows:e=3,cols:t=3,withHeaderRow:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r=>{let{tr:o,dispatch:i,editor:s}=r;const a=ts(s.schema,e,t,n);if(i){const e=o.selection.anchor+1;o.replaceSelectionWith(a).scrollIntoView().setSelection(we.U3.near(o.doc.resolve(e)))}return!0}},addColumnBefore:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){if(!ni(e))return!1;if(t){let n=Ti(e);t(Li(e.tr,n,n.left))}return!0}(t,n)},addColumnAfter:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){if(!ni(e))return!1;if(t){let n=Ti(e);t(Li(e.tr,n,n.right))}return!0}(t,n)},deleteColumn:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){if(!ni(e))return!1;if(t){let n=Ti(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let e=n.right-1;Ni(r,n,e),e!=n.left;e--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=Jo.get(n.table);t(r)}return!0}(t,n)},addRowBefore:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){if(!ni(e))return!1;if(t){let n=Ti(e);t(Ri(e.tr,n,n.top))}return!0}(t,n)},addRowAfter:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){if(!ni(e))return!1;if(t){let n=Ti(e);t(Ri(e.tr,n,n.bottom))}return!0}(t,n)},deleteRow:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){if(!ni(e))return!1;if(t){let n=Ti(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Di(r,n,e),e!=n.top;e--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=Jo.get(n.table);t(r)}return!0}(t,n)},deleteTable:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}(t,n)},mergeCells:()=>e=>{let{state:t,dispatch:n}=e;return Pi(t,n)},splitCell:()=>e=>{let{state:t,dispatch:n}=e;return $i(t,n)},toggleHeaderColumn:()=>e=>{let{state:t,dispatch:n}=e;return ji("column")(t,n)},toggleHeaderRow:()=>e=>{let{state:t,dispatch:n}=e;return ji("row")(t,n)},toggleHeaderCell:()=>e=>{let{state:t,dispatch:n}=e;return Ui(t,n)},mergeOrSplit:()=>e=>{let{state:t,dispatch:n}=e;return!!Pi(t,n)||$i(t,n)},setCellAttribute:(e,t)=>n=>{let{state:r,dispatch:o}=n;return function(e,t){return function(n,r){if(!ni(n))return!1;let o=ri(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){let i=n.tr;n.selection instanceof di?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&i.setNodeMarkup(r,null,ai(n.attrs,e,t))}):i.setNodeMarkup(o.pos,null,ai(o.nodeAfter.attrs,e,t)),r(i)}return!0}}(e,t)(r,o)},goToNextCell:()=>e=>{let{state:t,dispatch:n}=e;return Fi(1)(t,n)},goToPreviousCell:()=>e=>{let{state:t,dispatch:n}=e;return Fi(-1)(t,n)},fixTables:()=>e=>{let{state:t,dispatch:n}=e;return n&&Ii(t),!0},setCellSelection:e=>t=>{let{tr:n,dispatch:r}=t;if(r){const t=di.create(n.doc,e.anchorCell,e.headCell);n.setSelection(t)}return!0}}),addKeyboardShortcuts(){return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:ns,"Mod-Backspace":ns,Delete:ns,"Mod-Delete":ns}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Yi({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.ReiszeView,lastColumnResizable:this.options.lastColumnResizable})]:[ms({View:this.options.View,width:this.options.width})],Qi({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:(0,Ae.gk)((0,Ae.iI)(e,"tableRole",t))}}}),xs=vs,ks=Ae.bP.create({name:"button",draggable:!1,group:"inline",atom:!0,inline:!0,addOptions:()=>({id:null,background:"red",height:"auto",width:"auto",HTMLAttributes:{class:"inline-button"}}),addAttributes:()=>({width:{default:"auto",parseHTML:e=>e.width},height:{default:"auto",parseHTML:e=>e.height},background:{default:"#000",parseHTML:e=>e.getAttribute("background")}}),parseHTML:()=>[{tag:"button",priority:51}],renderHTML(e){let{HTMLAttributes:t}=e;return["button",(0,Ae.KV)(t),0]},addCommands(){return{toggleButton:()=>e=>{let{commands:t,editor:n}=e;return t.insertContent({type:this.name,attrs:this.options}),!0},setButtonStyles:e=>t=>{const{commands:n,editor:r}=t,o=(0,Ae.KV)({background:this.options.background,width:this.options.width,height:this.options.height},e);return o.style=`\n background: ${o.background};\n width: ${o.width};\n height: ${o.height};`,n.updateAttributes(this.name,o),!0}}},addNodeView:()=>()=>{const e=document.createElement("button");e.contentEditable=!1,e.classList.add("node-view");const t=document.createElement("div");return t.innerHTML="button",t.contentEditable=!0,t.classList.add("content"),e.append(t),{dom:e,contentDOM:t}}}),Cs=Ae.bP.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:e}){return["tr",(0,Ae.KV)(this.options.HTMLAttributes,e),0]}});const _s=Ae.bP.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({borderColor:{default:"#ced4da"},colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?[parseInt(t,10)]:null}}}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML(e){let{HTMLAttributes:t}=e;const n=`border-color:${t.borderColor}`;return t.style=n,["td",(0,Ae.KV)(this.options.HTMLAttributes,t),0]}}),Es=Ae.bP.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(e=>parseInt(e,10)):null}}}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:e}){return["th",(0,Ae.KV)(this.options.HTMLAttributes,e),0]}}),Ss=Ae.YY.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>e.style.backgroundColor.replace(/['"]+/g,""),renderHTML:e=>e.backgroundColor?{style:`background: ${e.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:e=>t=>{let{chain:n}=t;return n().setMark("textStyle",{backgroundColor:e}).run()},unsetBackgroundColor:()=>e=>{let{chain:t}=e;return t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}})}),Bs=Ae.YY.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>e.style.textAlign||this.options.defaultAlignment,renderHTML:e=>({style:`text-align: ${e.textAlign}`})}}}]},addCommands(){return{setTextAlign:e=>t=>{let{commands:n}=t;return!!this.options.alignments.includes(e)&&this.options.types.every(t=>n.updateAttributes(t,{textAlign:e}))},unsetTextAlign:()=>e=>{let{commands:t}=e;return this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});const Ms=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Os=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Is=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Ts=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Ls=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();var Ns="[0-9](_*[0-9])*",Rs=`\\.(${Ns})`,Ds="[0-9a-fA-F](_*[0-9a-fA-F])*",zs={className:"number",variants:[{begin:`(\\b(${Ns})((${Rs})|\\.)?|(${Rs}))[eE][+-]?(${Ns})[fFdD]?\\b`},{begin:`\\b(${Ns})((${Rs})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Rs})[fFdD]?\\b`},{begin:`\\b(${Ns})[fFdD]\\b`},{begin:`\\b0[xX]((${Ds})\\.?|(${Ds})?\\.(${Ds}))[pP][+-]?(${Ns})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ds})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Ps(e,t,n){return-1===n?"":e.replace(t,r=>Ps(e,t,n-1))}const $s="[A-Za-z$_][0-9A-Za-z$_]*",Hs=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],js=["true","false","null","undefined","NaN","Infinity"],Us=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Fs=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Vs=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],qs=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ws=[].concat(Vs,Us,Fs);var Ys="[0-9](_*[0-9])*",Xs=`\\.(${Ys})`,Zs="[0-9a-fA-F](_*[0-9a-fA-F])*",Ks={className:"number",variants:[{begin:`(\\b(${Ys})((${Xs})|\\.)?|(${Xs}))[eE][+-]?(${Ys})[fFdD]?\\b`},{begin:`\\b(${Ys})((${Xs})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Xs})[fFdD]?\\b`},{begin:`\\b(${Ys})[fFdD]\\b`},{begin:`\\b0[xX]((${Zs})\\.?|(${Zs})?\\.(${Zs}))[pP][+-]?(${Ys})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Zs})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};const Js=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Gs=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Qs=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],ea=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ta=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),na=Qs.concat(ea);const ra=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],oa=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],ia=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],sa=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],aa=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function la(e){return e?"string"==typeof e?e:e.source:null}function ca(e){return da("(?=",e,")")}function da(...e){return e.map(e=>la(e)).join("")}function pa(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map(e=>la(e)).join("|")+")"}const ua=e=>da(/\b/,e,/\w$/.test(e)?/\b/:/\B/),ha=["Protocol","Type"].map(ua),fa=["init","self"].map(ua),ma=["Any","Self"],ga=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],ba=["false","nil","true"],ya=["assignment","associativity","higherThan","left","lowerThan","none","right"],Aa=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],wa=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],va=pa(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),xa=pa(va,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ka=da(va,xa,"*"),Ca=pa(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),_a=pa(Ca,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ea=da(Ca,_a,"*"),Sa=da(/[A-Z]/,_a,"*"),Ba=["autoclosure",da(/convention\(/,pa("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",da(/objc\(/,Ea,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],Ma=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];const Oa="[A-Za-z$_][0-9A-Za-z$_]*",Ia=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Ta=["true","false","null","undefined","NaN","Infinity"],La=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Na=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ra=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Da=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],za=[].concat(Ra,La,Na);const Pa=n(14523);var $a=n(86638);const Ha=Object.assign(ja(Error),{eval:ja(EvalError),range:ja(RangeError),reference:ja(ReferenceError),syntax:ja(SyntaxError),type:ja(TypeError),uri:ja(URIError)});function ja(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){const r=t?$a(t,...n):t;return new e(r)}}const Ua={}.hasOwnProperty,Fa="hljs-";function Va(e,t,n={}){let r=n.prefix;if("string"!=typeof e)throw Ha("Expected `string` for name, got `%s`",e);if(!Pa.getLanguage(e))throw Ha("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw Ha("Expected `string` for value, got `%s`",t);null==r&&(r=Fa),Pa.configure({__emitter:qa,classPrefix:r});const o=Pa.highlight(t,{language:e,ignoreIllegals:!0});if(Pa.configure({}),o.errorRaised)throw o.errorRaised;return o._emitter.root.data.language=o.language,o._emitter.root.data.relevance=o.relevance,o._emitter.root}class qa{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(""===e)return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){const n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){const t={type:"element",tagName:"span",properties:{className:e.split(".").map((e,t)=>t?e+"_".repeat(t):this.options.classPrefix+e)},children:[]};this.stack[this.stack.length-1].children.push(t),this.stack.push(t)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Wa={highlight:Va,highlightAuto:function(e,t={}){const n=t.subset||Pa.listLanguages();let r=t.prefix,o=-1,i={type:"root",data:{language:null,relevance:0},children:[]};if(null==r&&(r=Fa),"string"!=typeof e)throw Ha("Expected `string` for value, got `%s`",e);for(;++o<n.length;){const r=n[o];if(!Pa.getLanguage(r))continue;const s=Va(r,e,t);s.data.relevance>i.data.relevance&&(i=s)}return i},registerLanguage:function(e,t){Pa.registerLanguage(e,t)},registered:function(e){return Boolean(Pa.getLanguage(e))},listLanguages:function(){return Pa.listLanguages()},registerAlias:function(e,t){if("string"==typeof e)Pa.registerAliases(t,{languageName:e});else{let t;for(t in e)Ua.call(e,t)&&Pa.registerAliases(e[t],{languageName:t})}}};Wa.registerLanguage("arduino",function(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",i="(?!struct)("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},p=t.optional(o)+e.IDENT_RE+"\\s*\\(",u={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[h,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:u,contains:f.concat([{begin:/\(/,end:/\)/,keywords:u,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+i+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:u,relevance:0},{begin:p,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:u,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,h,f,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:u,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:u},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}),Wa.registerLanguage("bash",function(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,o]};o.contains.push(s);const a={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},l=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[l,e.SHEBANG(),c,a,e.HASH_COMMENT_MODE,i,{match:/(\/[a-z._-]+)+/},s,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},n]}}),Wa.registerLanguage("c",function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",i="("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},p=t.optional(o)+e.IDENT_RE+"\\s*\\(",u={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},h=[c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:u,contains:h.concat([{begin:/\(/,end:/\)/,keywords:u,contains:h.concat(["self"]),relevance:0}]),relevance:0},m={begin:"("+i+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:u,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(d,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:u,disableAutodetect:!0,illegal:"</",contains:[].concat(f,m,h,[c,{begin:e.IDENT_RE+"::",keywords:u},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:a,keywords:u}}}),Wa.registerLanguage("cpp",function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",i="(?!struct)("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},p=t.optional(o)+e.IDENT_RE+"\\s*\\(",u={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[h,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:u,contains:f.concat([{begin:/\(/,end:/\)/,keywords:u,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+i+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:u,relevance:0},{begin:p,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:u,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,h,f,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:u,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:u},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}),Wa.registerLanguage("csharp",function(e){const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),r={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},o={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},i=e.inherit(o,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/,keywords:t},a=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,a]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},d=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]});s.contains=[c,l,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_BLOCK_COMMENT_MODE],a.contains=[d,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const p={variants:[c,l,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},u={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},h=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",f={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},p,r,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+h+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,u],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[p,r,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},f]}}),Wa.registerLanguage("css",function(e){const t=e.regex,n=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),r=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Is.join("|")+")"},{begin:":(:)?("+Ts.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ls.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...r,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...r,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Os.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...r,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ms.join("|")+")\\b"}]}}),Wa.registerLanguage("diff",function(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}),Wa.registerLanguage("go",function(e){const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:e.C_NUMBER_RE+"[i]",relevance:1},e.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}),Wa.registerLanguage("graphql",function(e){const t=e.regex;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}),Wa.registerLanguage("ini",function(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},i={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,i,o,s,n,"self"],relevance:0},l=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:t.concat(l,"(\\s*\\.\\s*",l,")*",t.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[r,a,i,o,s,n]}}]}}),Wa.registerLanguage("java",function(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Ps("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),o={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},i={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:o,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:o,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,zs,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},zs,i]}}),Wa.registerLanguage("javascript",function(e){const t=e.regex,n=$s,r="<>",o="</>",i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let o;">"===r&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());const i=e.input.substring(n);((o=i.match(/^\s*=/))||(o=i.match(/^\s+extends\s+/))&&0===o.index)&&t.ignoreMatch()}},s={$pattern:$s,keyword:Hs,literal:js,built_in:Ws,"variable.language":qs},a="[0-9](_?[0-9])*",l=`\\.(${a})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},u={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},f={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},g={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,f,m,{match:/\$\d+/},d];p.contains=b.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(b)});const y=[].concat(g,p.contains),A=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:A},v={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},x={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Us,...Fs]}},k={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},C={match:t.concat(/\b/,function(e){return t.concat("(?!",e.join("|"),")")}([...Vs,"super","import"]),n,t.lookahead(/\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",B={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,f,m,g,{match:/\$\d+/},d,x,{className:"attr",begin:n+t.lookahead(":"),relevance:0},B,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[g,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:o},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},C,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},v,E,{match:/\$[(.]/}]}}),Wa.registerLanguage("json",function(e){const t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}),Wa.registerLanguage("kotlin",function(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},i={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,r]}]};r.contains.push(i);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},a={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(i,{className:"string"}),"self"]}]},l=Ks,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},p=d;return p.variants[1].contains=[d],d.variants[1].contains=[p],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,s,a,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,s,a,i,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,a]},i,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}}),Wa.registerLanguage("less",function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),n=na,r="[\\w-]+",o="("+r+"|@\\{"+r+"\\})",i=[],s=[],a=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},l=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Gs.join(" ")},d={begin:"\\(",end:"\\)",contains:s,keywords:c,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a("'"),a('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,d,l("variable","@@?"+r,10),l("variable","@\\{"+r+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const p=s.concat({begin:/\{/,end:/\}/,contains:i}),u={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},h={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ta.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},f={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:s,relevance:0}},m={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:p}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,u,l("keyword","all\\b"),l("variable","@\\{"+r+"\\}"),{begin:"\\b("+Js.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",o,0),l("selector-id","#"+o),l("selector-class","\\."+o,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Qs.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+ea.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:p},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:r+":(:)?"+`(${n.join("|")})`,returnBegin:!0,contains:[g]};return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,m,b,h,g,u,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:i}}),Wa.registerLanguage("lua",function(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},o=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}),Wa.registerLanguage("makefile",function(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t]},o={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},i={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,o,{className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},i]}}),Wa.registerLanguage("markdown",function(e){const t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},r={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},o={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},i=e.inherit(r,{contains:[]}),s=e.inherit(o,{contains:[]});r.contains.push(s),o.contains.push(i);let a=[t,n];return[r,o,i,s].forEach(e=>{e.contains=e.contains.concat(a)}),a=a.concat(r,o),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:a},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:a}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},r,o,{className:"quote",begin:"^>\\s+",contains:a,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}),Wa.registerLanguage("objectivec",function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"</",contains:[{className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}),Wa.registerLanguage("perl",function(e){const t=e.regex,n=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"].join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},i={begin:/->\{/,end:/\}/},s={variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},a=[e.BACKSLASH_ESCAPE,o,s],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(e,r,o="\\1")=>{const i="\\1"===o?o:t.concat(o,r);return t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,i,/(?:\\.|[^\\\/])*?/,o,n)},d=(e,r,o)=>t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,o,n),p=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),i,{className:"string",contains:a,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:c("s|tr|y",t.either(...l,{capture:!0}))},{begin:c("s|tr|y","\\(","\\)")},{begin:c("s|tr|y","\\[","\\]")},{begin:c("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",t.either(...l,{capture:!0}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=p,i.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:p}}),Wa.registerLanguage("php",function(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),o=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i={scope:"variable",match:"\\$+"+r},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},a=e.inherit(e.APOS_STRING_MODE,{illegal:null}),l="[ \t\n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),a,{begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/})]},d={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},p=["false","null","true"],u=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],h=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],f={keyword:u,literal:(e=>{const t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(p),built_in:h},m=e=>e.map(e=>e.replace(/\|\d+$/,"")),g={variants:[{match:[/new/,t.concat(l,"+"),t.concat("(?!",m(h).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},b=t.concat(r,"\\b(?!\\()"),y={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{1:"title.class",3:"variable.constant"}},{match:[o,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},A={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},w={relevance:0,begin:/\(/,end:/\)/,keywords:f,contains:[A,i,y,e.C_BLOCK_COMMENT_MODE,c,d,g]},v={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",m(u).join("\\b|"),"|",m(h).join("\\b|"),"\\b)"),r,t.concat(l,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(v);const x=[A,y,e.C_BLOCK_COMMENT_MODE,c,d,g];return{case_insensitive:!1,keywords:f,contains:[{begin:t.concat(/#\[\s*/,o),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:p,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:p,keyword:["new","array"]},contains:["self",...x]},...x,{scope:"meta",match:o}]},e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},i,v,y,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},g,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",i,y,e.C_BLOCK_COMMENT_MODE,c,d]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},c,d]}}),Wa.registerLanguage("php-template",function(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}),Wa.registerLanguage("plaintext",function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}),Wa.registerLanguage("python",function(e){const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},i={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,i],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,i],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,i,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,i,a,s]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",d=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,p=`\\b|${r.join("|")}`,u={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${d}))[eE][+-]?(${c})[jJ]?(?=${p})`},{begin:`(${d})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${c})[jJ](?=${p})`}]},h={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",i,u,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,u,i],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[i,u,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},l,h,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[f]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[u,f,l]}]}}),Wa.registerLanguage("python-repl",function(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}),Wa.registerLanguage("r",function(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[i,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}),Wa.registerLanguage("ruby",function(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(r,/(::\w+)*/),i={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:i},d={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},p="[0-9](_?[0-9])*",u={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:i}]},f=[d,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:i},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:i},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},u,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:i},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,l),relevance:0}].concat(a,l);c.contains=f,h.contains=f;const m=[{begin:/^\s*=>/,starts:{end:"$",contains:f}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:i,contains:f}}];return l.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:i,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(m).concat(l).concat(f)}}),Wa.registerLanguage("rust",function(e){const t=e.regex,n={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",o=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],i=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:i,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:o},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+r},{begin:"\\b0o([0-7_]+)"+r},{begin:"\\b0x([A-Fa-f0-9_]+)"+r},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+r}],relevance:0},{begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,e.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:o,type:i}},{className:"punctuation",begin:"->"},n]}}),Wa.registerLanguage("scss",function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),n=sa,r=ia,o="@[a-z-]+",i={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+ra.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},i,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+aa.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,i,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:oa.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},i,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}),Wa.registerLanguage("shell",function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}),Wa.registerLanguage("sql",function(e){const t=e.regex,n=e.COMMENT("--","$"),r=["true","false","unknown"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],i=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],a=i,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter(e=>!i.includes(e)),c={begin:t.concat(/\b/,t.either(...a),/\s*\(/),relevance:0,keywords:{built_in:a}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){const r=n;return t=t||[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}(l,{when:e=>e.length<3}),literal:r,type:o,built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{begin:t.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:l.concat(s),literal:r,type:o}},{className:"type",begin:t.either("double precision","large object","with timezone","without timezone")},c,{className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}),Wa.registerLanguage("swift",function(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],o={match:[/\./,pa(...ha,...fa)],className:{2:"keyword"}},i={match:da(/\./,pa(...ga)),relevance:0},s=ga.filter(e=>"string"==typeof e).concat(["_|0"]),a={variants:[{className:"keyword",match:pa(...ga.filter(e=>"string"!=typeof e).concat(ma).map(ua),...fa)}]},l={$pattern:pa(/\b\w+/,/#\w+/),keyword:s.concat(Aa),literal:ba},c=[o,i,a],d=[{match:da(/\./,pa(...wa)),relevance:0},{className:"built_in",match:da(/\b/,pa(...wa),/(?=\()/)}],p={match:/->/,relevance:0},u=[p,{className:"operator",relevance:0,variants:[{match:ka},{match:`\\.(\\.|${xa})+`}]}],h="([0-9]_*)+",f="([0-9a-fA-F]_*)+",m={className:"number",relevance:0,variants:[{match:`\\b(${h})(\\.(${h}))?([eE][+-]?(${h}))?\\b`},{match:`\\b0x(${f})(\\.(${f}))?([pP][+-]?(${h}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e="")=>({className:"subst",variants:[{match:da(/\\/,e,/[0\\tnr"']/)},{match:da(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(e="")=>({className:"subst",match:da(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),y=(e="")=>({className:"subst",label:"interpol",begin:da(/\\/,e,/\(/),end:/\)/}),A=(e="")=>({begin:da(e,/"""/),end:da(/"""/,e),contains:[g(e),b(e),y(e)]}),w=(e="")=>({begin:da(e,/"/),end:da(/"/,e),contains:[g(e),y(e)]}),v={className:"string",variants:[A(),A("#"),A("##"),A("###"),w(),w("#"),w("##"),w("###")]},x={match:da(/`/,Ea,/`/)},k=[x,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${_a}+`}],C=[{match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Ma,contains:[...u,m,v]}]}},{className:"keyword",match:da(/@/,pa(...Ba))},{className:"meta",match:da(/@/,Ea)}],_={match:ca(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:da(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,_a,"+")},{className:"type",match:Sa,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:da(/\s+&\s+/,ca(Sa)),relevance:0}]},E={begin:/</,end:/>/,keywords:l,contains:[...r,...c,...C,p,_]};_.contains.push(E);const S={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:da(Ea,/\s*:/),keywords:"_|0",relevance:0},...r,...c,...d,...u,m,v,...k,...C,_]},B={begin:/</,end:/>/,contains:[...r,_]},M={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:pa(ca(da(Ea,/\s*:/)),ca(da(Ea,/\s+/,Ea,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ea}]},...r,...c,...u,m,v,...C,_,S],endsParent:!0,illegal:/["']/},O={match:[/func/,/\s+/,pa(x.match,Ea,ka)],className:{1:"keyword",3:"title.function"},contains:[B,M,t],illegal:[/\[/,/%/]},I={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[B,M,t],illegal:/\[|%/},T={match:[/operator/,/\s+/,ka],className:{1:"keyword",3:"title"}},L={begin:[/precedencegroup/,/\s+/,Sa],className:{1:"keyword",3:"title"},contains:[_],keywords:[...ya,...ba],end:/}/};for(const e of v.variants){const t=e.contains.find(e=>"interpol"===e.label);t.keywords=l;const n=[...c,...d,...u,m,v,...k];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...r,O,I,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},T,L,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...c,...d,...u,m,v,...k,...C,_,S]}}),Wa.registerLanguage("typescript",function(e){const t=function(e){const t=e.regex,n=Oa,r="<>",o="</>",i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let o;">"===r&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());const i=e.input.substring(n);((o=i.match(/^\s*=/))||(o=i.match(/^\s+extends\s+/))&&0===o.index)&&t.ignoreMatch()}},s={$pattern:Oa,keyword:Ia,literal:Ta,built_in:za,"variable.language":Da},a="[0-9](_?[0-9])*",l=`\\.(${a})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},u={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},f={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},g={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,f,m,{match:/\$\d+/},d];p.contains=b.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(b)});const y=[].concat(g,p.contains),A=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:A},v={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},x={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...La,...Na]}},k={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},C={match:t.concat(/\b/,function(e){return t.concat("(?!",e.join("|"),")")}([...Ra,"super","import"]),n,t.lookahead(/\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",B={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,f,m,g,{match:/\$\d+/},d,x,{className:"attr",begin:n+t.lookahead(":"),relevance:0},B,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[g,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:o},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},C,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},v,E,{match:/\$[(.]/}]}}(e),n=Oa,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},i={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[t.exports.CLASS_REFERENCE]},s={$pattern:Oa,keyword:Ia.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:Ta,built_in:za.concat(r),"variable.language":Da},a={className:"meta",begin:"@"+n},l=(e,t,n)=>{const r=e.contains.findIndex(e=>e.label===t);if(-1===r)throw new Error("can not find mode to replace");e.contains.splice(r,1,n)};return Object.assign(t.keywords,s),t.exports.PARAMS_CONTAINS.push(a),t.contains=t.contains.concat([a,o,i]),l(t,"shebang",e.SHEBANG()),l(t,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),t.contains.find(e=>"func.def"===e.label).relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t}),Wa.registerLanguage("vbnet",function(e){const t=e.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,i=/\d{1,2}(:\d{1,2}){1,2}/,s={className:"literal",variants:[{begin:t.concat(/# */,t.either(r,n),/ *#/)},{begin:t.concat(/# */,i,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(r,n),/ +/,t.either(o,i),/ *#/)}]},a=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},a,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}}),Wa.registerLanguage("wasm",function(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);return t.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"]},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},{className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}}),Wa.registerLanguage("xml",function(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},i=e.inherit(o,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,a,s,i,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,i,a,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}),Wa.registerLanguage("yaml",function(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},o=e.inherit(r,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),i={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},s={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},a={begin:/\{/,end:/\}/,contains:[s],illegal:"\\n",relevance:0},l={begin:"\\[",end:"\\]",contains:[s],illegal:"\\n",relevance:0},c=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},i,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},a,l,r],d=[...c];return d.pop(),d.push(o),s.contains=d,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:c}});const Ya=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Xa=Ae.bP.create({name:"image",addOptions:()=>({id:null,inline:!0,allowBase64:!1,width:"200px",height:"200px",HTMLAttributes:{},"data-target":"_blank","data-href":""}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{id:{default:`inline-image-${(0,V.A)()}`},src:{default:null},alt:{default:null},title:{default:null},width:{default:this.options.width||"500px"},height:{default:this.options.height||"500px"},"data-href":{default:this.options["data-href"]},"data-target":{default:this.options["data-target"]}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML(e){let{HTMLAttributes:t}=e;return["img",(0,Ae.KV)(this.options.HTMLAttributes,t)]},addNodeView(){return e=>{let{node:t,editor:n,getPos:r}=e;const o=document.createElement("img"),i=(0,Ae.KV)(this.options.HTMLAttributes,t.attrs);return Object.entries(i).forEach(e=>{let[t,n]=e;null!=n&&("style"===t&&"object"==typeof n?Object.assign(o.style,n):"style"===t&&"string"==typeof n?o.setAttribute("style",n):o.setAttribute(t,n))}),o.addEventListener("dblclick",e=>{e.preventDefault(),e.stopPropagation();let t=null;"function"==typeof r&&(t=r());const o=document.createElement("cdtr-gallery");o.opened=!0,o.multi=!0,document.body.append(o),o.addEventListener("file",e=>{let r=e.detail;if(Array.isArray(r)&&(r=r[0]),null!==t)try{const{view:e}=n,{state:o}=e;if(t<0||t>=o.doc.content.size)return void console.warn("Image position is out of bounds");try{const i=we.nh.create(o.doc,t),s=o.tr.setSelection(i);e.dispatch(s),n.commands.updateImage({src:r.src})}catch(n){const i=o.doc.resolve(t),s=i.nodeAfter||i.nodeBefore;if(s&&"image"===s.type.name){const n={...s.attrs,src:r.src},i=s.type.create(n),a=t,l=t+s.nodeSize,c=o.tr.replaceWith(a,l,i);e.dispatch(c)}else console.warn("Could not find image node at position:",t)}}catch(e){console.warn("Failed to update image:",e)}o.opened=!1,setTimeout(()=>{o.remove()},1500)}),o.addEventListener("close",()=>{o.remove()})}),{dom:o}}},addCommands(){return{setImage:e=>t=>{let{commands:n}=t;return n.insertContent({type:this.name,attrs:e}),!0},updateImage:e=>t=>{let{dispatch:n,commands:r,editor:o,view:i,tr:s}=t;const{state:a}=i,l=we.nh.create(a.doc,i.state.selection.from),c={...l.node.attrs,...e},d=this.type.create(c);if(n){const e=(s||a.tr).replaceRangeWith(l.from,l.to,d);i.dispatch(e)}return!0}}},addInputRules(){return[(0,Ae.jT)({find:Ya,type:this.type,getAttributes:e=>{const[,,t,n,r,o,i,s]=e;return{src:n,alt:t,title:r,width:o,height:i,id:s}}})]}});const Za=Ae.bP.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML(e){let{HTMLAttributes:t}=e;return["li",(0,Ae.KV)(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Ka=Ae.CU.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML(e){let{HTMLAttributes:t}=e;return["span",(0,Ae.KV)(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>e=>{let{state:t,commands:n}=e;const r=(0,Ae.z6)(t,this.type);return!!Object.entries(r).some(e=>{let[,t]=e;return!!t})||n.unsetMark(this.name)}}}}),Ja=/^\s*([-+*])\s$/,Ga=Ae.bP.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1,color:"#000"}),addAttributes:()=>({color:{default:"#000"}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:e=>[{tag:"ul"}],renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["ul",(0,Ae.KV)(this.options.HTMLAttributes,n,{style:`color:${t.attrs.color}`}),0]},addCommands(){return{changeBulletListColor:e=>{let{color:t}=e;return e=>{let{commands:n,chain:r}=e;return r().updateAttributes(this.name,{color:t}).run()}},toggleBulletList:()=>e=>{let{commands:t,chain:n}=e;return this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Za.name,this.editor.getAttributes(Ka.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=(0,Ae.tG)({find:Ja,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,Ae.tG)({find:Ja,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Ka.name),editor:this.editor})),[e]}}),Qa=/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{11})(?:\S+)?$/,el=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)(\/(?:shorts\/|watch\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,tl=/^https?:\/\/(?:www\.)?(?:vimeo\.com|player\.vimeo\.com\/video)\/(\d+)(?:\/[\w-]*)?(?:\?.*)?$/i,nl=/^https?:\/\/(?:www\.)?.+\.mp3(?:\?.*)?$/i,rl=e=>!!e&&!!e.match(Qa),ol=e=>!!e&&!!e.match(tl),il=e=>!!e&&!!e.match(nl),sl=e=>e?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",al=e=>{let{url:t}=e;return rl(t)?(e=>{const{url:t,allowFullscreen:n,autoplay:r,ccLanguage:o,ccLoadPolicy:i,controls:s,disableKBcontrols:a,enableIFrameApi:l,endTime:c,interfaceLanguage:d,ivLoadPolicy:p,loop:u,modestBranding:h,nocookie:f,origin:m,playlist:g,progressBarColor:b,startAt:y}=e;if(!rl(t))return null;if(t.includes("/embed/"))return t;if(t.includes("youtu.be")){const e=t.split("/").pop();return e?`${sl(f)}${e}`:null}const A=/(?:v=|shorts\/)([-\w]+)/gm.exec(t);if(!A||!A[1])return null;let w=`${sl(f)}${A[1]}`;const v=[];return!1===n&&v.push("fs=0"),r&&v.push("autoplay=1"),o&&v.push(`cc_lang_pref=${o}`),i&&v.push("cc_load_policy=1"),s||v.push("controls=0"),a&&v.push("disablekb=1"),l&&v.push("enablejsapi=1"),c&&v.push(`end=${c}`),d&&v.push(`hl=${d}`),p&&v.push(`iv_load_policy=${p}`),u&&v.push("loop=1"),h&&v.push("modestbranding=1"),m&&v.push(`origin=${m}`),g&&v.push(`playlist=${g}`),y&&v.push(`start=${y}`),b&&v.push(`color=${b}`),v.length&&(w+=`?${v.join("&")}`),w})(e):ol(t)?(e=>{const{url:t}=e;if(!ol(t))return null;const n=(e=>{const t=e.match(tl);return t&&t.find(e=>/^\d+$/.test(e))||null})(t);if(!n)return null;let r=`https://player.vimeo.com/video/${n}`;const o=[];return e.autoplay&&o.push("autoplay=1"),o.length&&(r+=`?${o.join("&")}`),r})(e):il(t)?(e=>{const{url:t}=e;return il(t)?t:null})(e):null},ll=Ae.bP.create({name:"video",addOptions:()=>({addPasteHandler:!0,allowFullscreen:!0,autoplay:!1,ccLanguage:void 0,ccLoadPolicy:void 0,controls:!0,disableKBcontrols:!1,enableIFrameApi:!1,endTime:0,height:480,interfaceLanguage:void 0,ivLoadPolicy:0,loop:!1,modestBranding:!1,HTMLAttributes:{},inline:!1,nocookie:!1,origin:"",playlist:"",progressBarColor:void 0,width:640}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},start:{default:0},width:{default:this.options.width},height:{default:this.options.height}}},parseHTML:()=>[{tag:"div[data-video-cdtr] iframe"}],addCommands(){return{setVideo:e=>t=>{let{commands:n}=t;return ol(e.src)||rl(e.src)||il(e.src)?(e.src=al({url:e.src}),n.insertContent({type:this.name,attrs:e})):(console.error("Invalid video URL"),!1)}}},addPasteRules(){return this.options.addPasteHandler?[(0,Ae.gg)({find:el,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML(e){let{HTMLAttributes:t}=e;const n=al({url:t.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,controls:this.options.controls,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,nocookie:this.options.nocookie,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,startAt:t.start||0});return t.src=n,["div",{"data-video-cdtr":""},["iframe",(0,Ae.KV)(this.options.HTMLAttributes,{style:"max-width: 100%;",width:this.options.width,height:this.options.height,allowfullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor},t)]]}}),cl={addAttributes(){return{...this.parent?.(),style:{parseHTML:e=>{const t=e.getAttribute("width");return t?`width: ${t}px; height: auto; cursor: pointer;max-width: 100%;`:`${e.style.cssText}`}}}},addNodeView(){const e=document.createElement("div");return t=>{let{node:n,editor:r,getPos:o}=t;const{view:i,options:{editable:s}}=r,a=document.createElement("iframe");a.src="about:blank",a.style.border="none",a.width="100%",a.height="30px";const l=document.createElement("input");l.style.height="30px",l.style.width="100%",l.value=n.attrs.src,a.addEventListener("load",()=>{a.contentDocument.body.style.margin="0",a.contentDocument.body.style.padding="0",a.contentDocument.body.style.overflow="hidden",a.contentDocument.body.appendChild(l)}),l.addEventListener("input",e=>{e.preventDefault(),e.stopPropagation();const t=l.value;setTimeout(()=>{r.chain().setVideo({src:t,width:n.attrs.width||this.options.width,height:n.attrs.height||this.options.height}).run()},200)}),e.appendChild(a);const c=document.createElement("div");c.setAttribute("data-video-cdtr","");const d=document.createElement("div");d.classList.add("cdtr-video-container");const p=document.createElement("iframe");d.style.width="100%",p.style.maxWidth="100%",p.setAttribute("src",n.attrs.src),p.setAttribute("width",n.attrs.width),p.setAttribute("height",n.attrs.height),p.setAttribute("frameborder","0"),p.setAttribute("allowfullscreen","true"),p.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture");const u=()=>{e.classList.add("cdtr-position-controller"),(()=>{const e={...n.attrs,style:`${p.style.cssText}`};i.dispatch(i.state.tr.setNodeMarkup(o(),null,e))})(),d.appendChild(e)};return c.setAttribute("style","display: flex;"),c.appendChild(d),d.classList.add("video-container"),d.appendChild(p),s?(d.addEventListener("click",e=>{u(),d.setAttribute("style","position: relative; border: 1px dashed #6C6C6C; cursor: pointer;")}),document.addEventListener("click",t=>{const n=t.target;d.contains(n)||d===n||e.remove()}),{dom:c}):{dom:d}}}},dl=ll.extend(cl);function pl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ul={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function hl(e){ul=e}var fl={exec:()=>null};function ml(e,t=""){let n="string"==typeof e?e:e.source;const r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(gl.caret,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}var gl={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},bl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,yl=/(?:[*+-]|\d{1,9}[.)])/,Al=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,wl=ml(Al).replace(/bull/g,yl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),vl=ml(Al).replace(/bull/g,yl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,kl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Cl=ml(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",kl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_l=ml(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yl).getRegex(),El="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Sl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Bl=ml("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Sl).replace("tag",El).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ml=ml(xl).replace("hr",bl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",El).getRegex(),Ol={blockquote:ml(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ml).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Cl,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:bl,html:Bl,lheading:wl,list:_l,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Ml,table:fl,text:/^[^\n]+/},Il=ml("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",bl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",El).getRegex(),Tl={...Ol,lheading:vl,table:Il,paragraph:ml(xl).replace("hr",bl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Il).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",El).getRegex()},Ll={...Ol,html:ml("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Sl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:fl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ml(xl).replace("hr",bl).replace("heading"," *#{1,6} *[^\n]").replace("lheading",wl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Nl=/^( {2,}|\\)\n(?!\s*$)/,Rl=/[\p{P}\p{S}]/u,Dl=/[\s\p{P}\p{S}]/u,zl=/[^\s\p{P}\p{S}]/u,Pl=ml(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Dl).getRegex(),$l=/(?!~)[\p{P}\p{S}]/u,Hl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,jl=ml(Hl,"u").replace(/punct/g,Rl).getRegex(),Ul=ml(Hl,"u").replace(/punct/g,$l).getRegex(),Fl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Vl=ml(Fl,"gu").replace(/notPunctSpace/g,zl).replace(/punctSpace/g,Dl).replace(/punct/g,Rl).getRegex(),ql=ml(Fl,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,$l).getRegex(),Wl=ml("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,zl).replace(/punctSpace/g,Dl).replace(/punct/g,Rl).getRegex(),Yl=ml(/\\(punct)/,"gu").replace(/punct/g,Rl).getRegex(),Xl=ml(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Zl=ml(Sl).replace("(?:--\x3e|$)","--\x3e").getRegex(),Kl=ml("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Zl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Jl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Gl=ml(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Jl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ql=ml(/^!?\[(label)\]\[(ref)\]/).replace("label",Jl).replace("ref",kl).getRegex(),ec=ml(/^!?\[(ref)\](?:\[\])?/).replace("ref",kl).getRegex(),tc={_backpedal:fl,anyPunctuation:Yl,autolink:Xl,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:Nl,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:fl,emStrongLDelim:jl,emStrongRDelimAst:Vl,emStrongRDelimUnd:Wl,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Gl,nolink:ec,punctuation:Pl,reflink:Ql,reflinkSearch:ml("reflink|nolink(?!\\()","g").replace("reflink",Ql).replace("nolink",ec).getRegex(),tag:Kl,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:fl},nc={...tc,link:ml(/^!?\[(label)\]\((.*?)\)/).replace("label",Jl).getRegex(),reflink:ml(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jl).getRegex()},rc={...tc,emStrongRDelimAst:ql,emStrongLDelim:Ul,url:ml(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oc={...rc,br:ml(Nl).replace("{2,}","*").getRegex(),text:ml(rc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ic={normal:Ol,gfm:Tl,pedantic:Ll},sc={normal:tc,gfm:rc,breaks:oc,pedantic:nc},ac={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},lc=e=>ac[e];function cc(e,t){if(t){if(gl.escapeTest.test(e))return e.replace(gl.escapeReplace,lc)}else if(gl.escapeTestNoEncode.test(e))return e.replace(gl.escapeReplaceNoEncode,lc);return e}function dc(e){try{e=encodeURI(e).replace(gl.percentDecode,"%")}catch{return null}return e}function pc(e,t){const n=e.replace(gl.findPipe,(e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(gl.splitPipe);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(gl.slashPipe,"|");return n}function uc(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i!==t||n){if(i===t||!n)break;o++}else o++}return e.slice(0,r-o)}function hc(e,t,n,r,o){const i=t.href,s=t.title||null,a=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:i,title:s,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}var fc=class{options;rules;lexer;constructor(e){this.options=e||ul}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:uc(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(null===r)return t;const o=r[1];return t.split("\n").map(e=>{const t=e.match(n.other.beginningSpace);if(null===t)return e;const[r]=t;return r.length>=o.length?e.slice(o.length):e}).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){const t=uc(e,"#");this.options.pedantic?e=t.trim():t&&!this.rules.other.endingSpaceChar.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:uc(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=uc(t[0],"\n").split("\n"),n="",r="";const o=[];for(;e.length>0;){let t=!1;const i=[];let s;for(s=0;s<e.length;s++)if(this.rules.other.blockquoteStart.test(e[s]))i.push(e[s]),t=!0;else{if(t)break;i.push(e[s])}e=e.slice(s);const a=i.join("\n"),l=a.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${l}`:l;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,o,!0),this.lexer.state.top=c,0===e.length)break;const d=o.at(-1);if("code"===d?.type)break;if("blockquote"===d?.type){const t=d,i=t.raw+"\n"+e.join("\n"),s=this.blockquote(i);o[o.length-1]=s,n=n.substring(0,n.length-t.raw.length)+s.raw,r=r.substring(0,r.length-t.text.length)+s.text;break}if("list"===d?.type){const t=d,i=t.raw+"\n"+e.join("\n"),s=this.list(i);o[o.length-1]=s,n=n.substring(0,n.length-d.raw.length)+s.raw,r=r.substring(0,r.length-t.raw.length)+s.raw,e=i.substring(o.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let s=!1;for(;e;){let n=!1,r="",a="";if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),c=e.split("\n",1)[0],d=!l.trim(),p=0;if(this.options.pedantic?(p=2,a=l.trimStart()):d?p=t[1].length+1:(p=t[2].search(this.rules.other.nonSpaceChar),p=p>4?1:p,a=l.slice(p),p+=t[1].length),d&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),o=this.rules.other.fencesBeginRegex(p),i=this.rules.other.headingBeginRegex(p),s=this.rules.other.htmlBeginRegex(p);for(;e;){const u=e.split("\n",1)[0];let h;if(c=u,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),h=c):h=c.replace(this.rules.other.tabCharGlobal," "),o.test(c))break;if(i.test(c))break;if(s.test(c))break;if(t.test(c))break;if(n.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=p||!c.trim())a+="\n"+h.slice(p);else{if(d)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(o.test(l))break;if(i.test(l))break;if(n.test(l))break;a+="\n"+c}d||c.trim()||(d=!0),r+=u+"\n",e=e.substring(u.length+1),l=h.slice(p)}}o.loose||(s?o.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(s=!0));let u,h=null;this.options.gfm&&(h=this.rules.other.listIsTask.exec(a),h&&(u="[ ] "!==h[0],a=a.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:r,task:!!h,checked:u,loose:!1,text:a,tokens:[]}),o.raw+=r}const a=o.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),o.raw=o.raw.trimEnd();for(let e=0;e<o.items.length;e++)if(this.lexer.state.top=!1,o.items[e].tokens=this.lexer.blockTokens(o.items[e].text,[]),!o.loose){const t=o.items[e].tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));o.loose=n}if(o.loose)for(let e=0;e<o.items.length;e++)o.items[e].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!this.rules.other.tableDelimiter.test(t[2]))return;const n=pc(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)this.rules.other.tableAlignRight.test(e)?i.align.push("right"):this.rules.other.tableAlignCenter.test(e)?i.align.push("center"):this.rules.other.tableAlignLeft.test(e)?i.align.push("left"):i.align.push(null);for(let e=0;e<n.length;e++)i.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:i.align[e]});for(const e of o)i.rows.push(pc(e,i.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:i.align[t]})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const t=uc(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),hc(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return hc(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let o,i,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=[...o].length,r[3]||r[4]){s+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+a);const t=[...r[0]][0].length,l=e.slice(0,n+r.index+t+i);if(Math.min(n,i)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},mc=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ul,this.options.tokenizer=this.options.tokenizer||new fc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:gl,block:ic.normal,inline:sc.normal};this.options.pedantic?(t.block=ic.pedantic,t.inline=sc.pedantic):this.options.gfm&&(t.block=ic.gfm,this.options.breaks?t.inline=sc.breaks:t.inline=sc.gfm),this.tokenizer.rules=t}static get rules(){return{block:ic,inline:sc}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(gl.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(gl.tabCharGlobal," ").replace(gl.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);const n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);const n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);const n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){const i=t.at(-1);n&&"paragraph"===i?.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(r),n=o.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);const n=t.at(-1);"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let o=!1,i="";for(;e;){let r;if(o||(i=""),o=!1,this.options.extensions?.inline?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);const n=t.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,i)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(s)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(i=r.raw.slice(-1)),o=!0;const n=t.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},gc=class{options;parser;constructor(e){this.options=e||ul}space(e){return""}code({text:e,lang:t,escaped:n}){const r=(t||"").match(gl.notSpaceStart)?.[0],o=e.replace(gl.endingNewline,"")+"\n";return r?'<pre><code class="language-'+cc(r)+'">'+(n?o:cc(o,!0))+"</code></pre>\n":"<pre><code>"+(n?o:cc(o,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,n=e.start;let r="";for(let t=0;t<e.items.length;t++){const n=e.items[t];r+=this.listitem(n)}const o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+o+">\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===e.tokens[0]?.type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+cc(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){const o=e.rows[t];n="";for(let e=0;e<o.length;e++)n+=this.tablecell(o[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${cc(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),o=dc(e);if(null===o)return r;let i='<a href="'+(e=o)+'"';return t&&(i+=' title="'+cc(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const o=dc(e);if(null===o)return cc(n);let i=`<img src="${e=o}" alt="${n}"`;return t&&(i+=` title="${cc(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:cc(e.text)}},bc=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},yc=class e{options;renderer;textRenderer;constructor(e){this.options=e||ul,this.options.renderer=this.options.renderer||new gc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new bc}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions?.renderers?.[o.type]){const e=o,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}const i=o;switch(i.type){case"space":n+=this.renderer.space(i);continue;case"hr":n+=this.renderer.hr(i);continue;case"heading":n+=this.renderer.heading(i);continue;case"code":n+=this.renderer.code(i);continue;case"table":n+=this.renderer.table(i);continue;case"blockquote":n+=this.renderer.blockquote(i);continue;case"list":n+=this.renderer.list(i);continue;case"html":n+=this.renderer.html(i);continue;case"paragraph":n+=this.renderer.paragraph(i);continue;case"text":{let o=i,s=this.renderer.text(o);for(;r+1<e.length&&"text"===e[r+1].type;)o=e[++r],s+="\n"+this.renderer.text(o);n+=t?this.renderer.paragraph({type:"paragraph",raw:s,text:s,tokens:[{type:"text",raw:s,text:s,escaped:!0}]}):s;continue}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t=this.renderer){let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions?.renderers?.[o.type]){const e=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=e||"";continue}}const i=o;switch(i.type){case"escape":case"text":n+=t.text(i);break;case"html":n+=t.html(i);break;case"link":n+=t.link(i);break;case"image":n+=t.image(i);break;case"strong":n+=t.strong(i);break;case"em":n+=t.em(i);break;case"codespan":n+=t.codespan(i);break;case"br":n+=t.br(i);break;case"del":n+=t.del(i);break;default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},Ac=class{options;block;constructor(e){this.options=e||ul}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?mc.lex:mc.lexInline}provideParser(){return this.block?yc.parse:yc.parseInline}},wc=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=yc;Renderer=gc;TextRenderer=bc;Lexer=mc;Tokenizer=fc;Hooks=Ac;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{const o=e[r].flat(1/0);n=n.concat(this.walkTokens(o,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){const t=this.defaults.renderer||new gc(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,o=e.renderer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new fc(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,o=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Ac;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;const r=n,o=e.hooks[r],i=t[r];Ac.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then(e=>i.call(t,e));const n=o.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return mc.lex(e,t??this.defaults)}parser(e,t){return yc.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{const r={...n},o={...this.defaults,...r},i=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===r.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==t)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const s=o.hooks?o.hooks.provideLexer():e?mc.lex:mc.lexInline,a=o.hooks?o.hooks.provideParser():e?yc.parse:yc.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(t):t).then(e=>s(e,o)).then(e=>o.hooks?o.hooks.processAllTokens(e):e).then(e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then(()=>e):e).then(e=>a(e,o)).then(e=>o.hooks?o.hooks.postprocess(e):e).catch(i);try{o.hooks&&(t=o.hooks.preprocess(t));let e=s(t,o);o.hooks&&(e=o.hooks.processAllTokens(e)),o.walkTokens&&this.walkTokens(e,o.walkTokens);let n=a(e,o);return o.hooks&&(n=o.hooks.postprocess(n)),n}catch(e){return i(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+cc(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function vc(e,t){return wc.parse(e,t)}vc.options=vc.setOptions=function(e){return wc.setOptions(e),vc.defaults=wc.defaults,hl(vc.defaults),vc},vc.getDefaults=pl,vc.defaults=ul,vc.use=function(...e){return wc.use(...e),vc.defaults=wc.defaults,hl(vc.defaults),vc},vc.walkTokens=function(e,t){return wc.walkTokens(e,t)},vc.parseInline=wc.parseInline,vc.Parser=yc,vc.parser=yc.parse,vc.Renderer=gc,vc.TextRenderer=bc,vc.Lexer=mc,vc.lexer=mc.lex,vc.Tokenizer=fc,vc.Hooks=Ac,vc.parse=vc;vc.options,vc.setOptions,vc.use,vc.walkTokens,vc.parseInline,yc.parse,mc.lex;const xc=e=>[/^#{1,6}\s/m,/\*\*.*\*\*/,/__.*__/,/\*.*\*/,/_.*_/,/\[.*\]\(.*\)/,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m,/```[\s\S]*```/,/`[^`]+`/,/^>\s/m,/!\[.*\]\(.*\)/,/^\s*[-*_]{3,}\s*$/m].some(t=>t.test(e)),kc=Ae.YY.create({name:"markdownPaste",addOptions:()=>({autoDetect:!0}),addProseMirrorPlugins(){const e=this.editor,t=this.options;return[new we.k_({key:new we.hs("markdownPaste"),props:{handlePaste:(n,r,o)=>{if(!t.autoDetect)return!1;const i=r.clipboardData?.getData("text/plain"),s=r.clipboardData?.getData("text/html");if(console.log("Paste event - text:",i),console.log("Paste event - html:",s),console.log("Is markdown?",xc(i)),!i||!xc(i))return console.log("Not markdown or no text, skipping"),!1;if(i.includes("\n")&&!(e=>"string"==typeof e&&[/^#{1,6}\s/m,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m,/```[\s\S]*```/,/^>\s/m,/^\s*[-*_]{3,}\s*$/m].some(t=>t.test(e)))(i)){const e=(e=>{const t=(e=>e.replace(/\r\n?/g,"\n"))(e);return t.split(/\n{2,}/).map(e=>`<p>${e.split("\n").map(e=>vc.parseInline(e,{async:!1})||"<br>").join("<br>")||"<br>"}</p>`).join("")})(i),t=((e,t)=>{const n=document.createElement("div");return n.innerHTML=t,zn.S4.fromSchema(e).parseSlice(n)})(n.state.schema,e);return r.preventDefault(),n.dispatch(n.state.tr.replaceSelection(t).scrollIntoView()),!0}if(s&&s.trim()){const e=/<(?!meta|style|link)([\w]+)[^>]*>/i.test(s);if(console.log("Has rich HTML content:",e),e&&!xc(i))return console.log("Skipping due to rich HTML"),!1}try{let t=vc.parse(i,{async:!1});return console.log("Parsed markdown to HTML:",t),t&&"string"==typeof t&&(t=t.replace(/<a\s+([^>]*?)>/gi,(e,t)=>t.includes("style=")?e.replace(/style="([^"]*)"/i,(e,t)=>t.includes("color:")?e:`style="${t}; color: blue"`):`<a ${t} style="color: blue">`)),r.preventDefault(),e.commands.insertContent(t),!0}catch(e){return console.error("Error parsing markdown:",e),!1}}}})]}}),Cc=Ae.YY.create({name:"markdownContent",addCommands:()=>({setMarkdownContent:e=>t=>{let{commands:n,editor:r}=t;try{let t=vc.parse(e,{async:!1});return t&&"string"==typeof t&&(t=t.replace(/<a\s+([^>]*?)>/gi,(e,t)=>t.includes("style=")?e.replace(/style="([^"]*)"/i,(e,t)=>t.includes("color:")?e:`style="${t}; color: blue"`):`<a ${t} style="color: blue">`)),n.setContent(t)}catch(e){return console.error("Error parsing markdown:",e),!1}},insertMarkdownContent:e=>t=>{let{commands:n,editor:r}=t;try{let t=vc.parse(e,{async:!1});return t&&"string"==typeof t&&(t=t.replace(/<a\s+([^>]*?)>/gi,(e,t)=>t.includes("style=")?e.replace(/style="([^"]*)"/i,(e,t)=>t.includes("color:")?e:`style="${t}; color: blue"`):`<a ${t} style="color: blue">`)),n.insertContent(t)}catch(e){return console.error("Error parsing markdown:",e),!1}}})}),_c=Ae.YY.create({name:"preserveStyle",addStorage:()=>({lastTextStyle:null}),addProseMirrorPlugins(){const e=this;return[new we.k_({key:new we.hs("preserveStyle"),state:{init:()=>null,apply(t,n){const r=t.doc.type.schema.marks.textStyle;if(!r)return n;if(t.storedMarks){const n=t.storedMarks.find(e=>e.type===r);if(n&&n.attrs){const t={};Object.keys(n.attrs).forEach(e=>{null!=n.attrs[e]&&(t[e]=n.attrs[e])}),Object.keys(t).length>0&&(e.storage.lastTextStyle=t)}}return t.steps.forEach(t=>{if("addMark"===t.stepType){const n=t.mark;if(n&&n.type===r&&n.attrs){const t={};Object.keys(n.attrs).forEach(e=>{null!=n.attrs[e]&&(t[e]=n.attrs[e])}),Object.keys(t).length>0&&(e.storage.lastTextStyle=t)}}}),n}}}),new we.k_({key:new we.hs("preserveStyleOnSelection"),appendTransaction(t,n,r){const{selection:o}=r,{$from:i}=o,s=i.parent,a=0===s.content.size,l="paragraph"===s.type.name||"heading"===s.type.name;if(a&&l){const t=r.schema.marks.textStyle;if(!t)return null;const n=i.marks().some(e=>e.type===t),o=r.storedMarks||[],s=o.some(e=>e.type===t);if(!n&&!s&&e.storage.lastTextStyle){const n=r.tr,i=[t.create(e.storage.lastTextStyle),...o.filter(e=>e.type!==t)];return n.setStoredMarks(i),n}}return null}})]},onUpdate(){const{editor:e}=this,t=e.getAttributes("textStyle");if(t&&Object.keys(t).length>0){const e={};Object.keys(t).forEach(n=>{null!=t[n]&&(e[n]=t[n])}),Object.keys(e).length>0&&(this.storage.lastTextStyle=e)}}}),Ec=Ae.YY.create({name:"linkUnlinkStyle",addStorage:()=>({styleBeforeLink:null}),addCommands(){return{saveStyleBeforeLinkFromRange:(e,t)=>t=>{let{state:n}=t;const r=n.schema.marks.textStyle;if(!r)return this.storage.styleBeforeLink=null,!0;const o=n.doc.resolve(e).marks().find(e=>e.type===r);if(!o||!o.attrs)return this.storage.styleBeforeLink=null,!0;const i={};return Object.keys(o.attrs).forEach(e=>{null!=o.attrs[e]&&(i[e]=o.attrs[e])}),this.storage.styleBeforeLink=Object.keys(i).length>0?i:null,!0},unLinkWithStyleRestore:()=>e=>{let{state:t,dispatch:n}=e;const{from:r,to:o}=t.selection,i=t.schema,s=i.marks.link,a=i.marks.textStyle;if(!s||!a)return!1;const l=this.storage.styleBeforeLink,c=t.tr;if(c.removeMark(r,o,s),l&&Object.keys(l).length>0)c.removeMark(r,o,a),c.addMark(r,o,a.create(l));else{const e=t.doc.resolve(r).marks().find(e=>e.type===a),n=e?{...e.attrs,color:null}:{color:null};c.removeMark(r,o,a),c.addMark(r,o,a.create(n))}const d=t.doc.resolve(r).marks().filter(e=>e.type!==a&&e.type!==s),p=l&&Object.keys(l).length>0?a.create(l):a.create({color:null});return c.setStoredMarks([...d,p]),this.storage.styleBeforeLink=null,n&&n(c),!0}}}}),Sc=e=>{const t=e.defaultDirection||"auto";let n=e.content;if(n&&("string"==typeof(r=n)&&[/^#{1,6}\s/m,/\*\*.*\*\*/,/__.*__/,/\*.*\*/,/_.*_/,/\[.*\]\(.*\)/,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m,/```[\s\S]*```/,/`[^`]+`/,/^>\s/m,/!\[.*\]\(.*\)/,/^\s*[-*_]{3,}\s*$/m].some(e=>e.test(r))))try{n=vc.parse(n,{async:!1}),n&&"string"==typeof n&&(n=n.replace(/<a\s+([^>]*?)>/gi,(e,t)=>t.includes("style=")?e.replace(/style="([^"]*)"/i,(e,t)=>t.includes("color:")?e:`style="${t}; color: blue"`):`<a ${t} style="color: blue">`))}catch(e){console.error("Error parsing markdown content:",e)}var r;n&&"object"==typeof n&&"doc"===n.type&&Array.isArray(n.content)&&(n={...n,content:n.content.filter(e=>"text"!==e.type)});const{content:o,...i}=e,s=new Ae.KE({autofocus:!1,content:n,editorProps:{handleDOMEvents:{drop:(e,t)=>{if(t.dataTransfer&&"move"===t.dataTransfer.effectAllowed&&1===t.dataTransfer.items.length&&"text/plain"===t.dataTransfer.items[0].type){const e=t.dataTransfer.getData("text/plain");"string"!=typeof e||e.trim()||t.preventDefault()}}},handlePaste:(e,t,n)=>{const r=t.clipboardData?.getData("text/plain");if(!r||!(e=>{try{const t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch(t){return/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/i.test(e.trim())}})(r.trim()))return!1;const o=e.state,{from:i,to:s}=o.selection,a=o.doc.textBetween(i,s),l=o.schema.marks.link,c=o.schema.marks.textStyle;if(!l)return!1;let d=r.trim();d.startsWith("http://")||d.startsWith("https://")||(d="https://"+d);const p=a&&(e=>{if(!e||"string"!=typeof e)return!1;const t=e.trim();return/^(https?:\/\/|www\.|[\w-]+\.(com|org|net|io|co|edu|gov|mil|int|biz|info|name|pro|museum|aero|coop|travel|jobs|mobi|asia|tel|xxx|[\w]{2,}))[\w\.\/\-\?\=\&\#\@\%\+\~]*/i.test(t)})(a);if(p){let t=!1,n=null;if(o.doc.nodesBetween(i,s,(e,r)=>{if(t)return!1;Math.max(i,r),Math.min(s,r+e.nodeSize);return e.marks.forEach(e=>{"link"===e.type.name&&(t=!0,n=e)}),!t}),!t){const e=o.storedMarks?.find(e=>"link"===e.type.name),r=o.selection.$from.marks().find(e=>"link"===e.type.name),i=o.selection.$to.marks().find(e=>"link"===e.type.name);n=e||r||i,t=!!n}const r=o.tr;if(t){r.removeMark(i,s,l),r.replaceWith(i,s,o.schema.text(d));const e=i,t=i+d.length;r.addMark(e,t,l.create({href:d})),c&&r.addMark(e,t,c.create({color:"blue"}))}else{r.replaceWith(i,s,o.schema.text(d));const e=i,t=i+d.length;r.addMark(e,t,l.create({href:d})),c&&r.addMark(e,t,c.create({color:"blue"}))}const a=i+d.length;return r.setSelection(we.U3.near(r.doc.resolve(a))),e.dispatch(r),!0}{const t=o.tr;if(a&&i!==s){if(t.addMark(i,s,l.create({href:d})),c){let e={};o.doc.nodesBetween(i,s,(t,n)=>{Math.max(i,n),Math.min(s,n+t.nodeSize);t.marks.forEach(t=>{"textStyle"===t.type.name&&(e={...e,...t.attrs})})});const n={...e,color:"blue"};t.addMark(i,s,c.create(n))}t.setSelection(we.U3.near(t.doc.resolve(s)))}else{t.replaceWith(i,s,o.schema.text(d));const e=i,n=i+d.length;t.addMark(e,n,l.create({href:d})),c&&t.addMark(e,n,c.create({color:"blue"})),t.setSelection(we.U3.near(t.doc.resolve(n)))}return e.dispatch(t),!0}},transformPastedHTML:e=>(e&&"string"==typeof e&&(e=(e=e.replace(/style="([^"]*)"/gi,(e,t)=>{let n=t.replace(/line-height\s*:\s*[^;]*(px|em|rem|pt|pc|in|cm|mm|ex|ch|vw|vh|vmin|vmax|%)[^;]*;?/gi,"");return n=n.replace(/;;+/g,";").replace(/^;\s*|;\s*$/g,"").trim(),`style="${n}"`})).replace(/<a\s+([^>]*?)>/gi,(e,t)=>t.includes("style=")?e.replace(/style="([^"]*)"/i,(e,t)=>t.includes("color:")?e:`style="${t}; color: blue"`):`<a ${t} style="color: blue">`)),e)},extensions:[Be.A,Ye.configure({placeholder:e=>{let{node:t}=e;return"paragraph"===t.type.name?B.M.get("lang","add_content_to_paragraph"):"heading"===t.type.name?B.M.get("lang","add_content_to_heading"):null}}),Yn,Me.configure({HTMLAttributes:{class:"cdtr-heading",style:"font-weight: initial"}}),dl,Rn,Oe.A,Yo.extend({inclusive:!1}).configure({openOnClick:!1,HTMLAttributes:{class:"cdtr-editor-link"}}),pt.configure({draggable:!0}),lt.configure({keepMarks:!0}),Tn.configure({lowlight:Wa,draggable:!0,defaultLanguage:"javascript"}),Nn.configure({fonts:e.fontFamilies}),Re,De,ve.Ay,Ve,qe,Ss,Ga,rt,xs.configure({resizable:!1,draggable:!0,lastColumnResizable:!1,HTMLAttributes:{class:"cdtr-table-element"}}),Cs.configure({draggable:!0}),_s,Es,We,Xa.configure({inline:!1,HTMLAttributes:{"data-type":"inline-image","cdtr-resizable":"true",style:"display: block; margin: 0 auto;"}}),Je.configure({class:"dropcursor",color:"black",width:2}),et.configure({types:["heading","blockquote","paragraph","taskList","customBulletList","bulletList","orderedList"]}),Qe.configure({types:["heading","blockquote","paragraph","taskList","orderedList"]}),Ge.configure({defaultDirection:t,types:["heading","blockquote","paragraph","taskList","customBulletList","bulletList","orderedList"]}),Bs.configure({types:["heading","paragraph"],defaultAlignment:"rtl"===t?"right":"left"}),Se,Ee,_c,Ec,$e,ks,_e,xe,at,st,Wn,kc,Cc],...i});return s};n(15305);var Bc=n(83263),Mc={};Mc.setAttributes=P(),Mc.insert=D().bind(null,"head"),Mc.domAPI=N(),Mc.insertStyleElement=H();T()(Bc.A,Mc);Bc.A&&Bc.A.locals&&Bc.A.locals;var Oc=n(91597);n(64569);const Ic={paragraph:16,heading:32,h1:32,h2:28,h3:24,h4:20,h5:18,h6:16,listItem:16,tableCell:16,tableHeader:16,blockquote:18,codeBlock:14,text:16,span:16,div:16,li:16,td:16,th:16,p:16},Tc={paragraph:"Arial",heading:"Arial",h1:"Arial",h2:"Arial",h3:"Arial",h4:"Arial",h5:"Arial",h6:"Arial",listItem:"Arial",tableCell:"Arial",tableHeader:"Arial",blockquote:"Arial",codeBlock:"Courier New",text:"Arial",span:"Arial",div:"Arial",li:"Arial",td:"Arial",th:"Arial",p:"Arial"},Lc={paragraph:1.4,heading:1.2,h1:1.2,h2:1.2,h3:1.2,h4:1.2,h5:1.2,h6:1.2,listItem:1.4,tableCell:1.4,tableHeader:1.4,blockquote:1.4,codeBlock:1.4,text:1.4,span:1.4,div:1.4,li:1.4,td:1.4,th:1.4,p:1.4};function Nc(e){return null!=e&&""!==e}function Rc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e)return void console.warn("No editor provided");const o={...Ic,...t},i={...Tc,...n},s={...Lc,...r};console.log("Validating default values..."),console.log("Font sizes:",o),console.log("Font families:",i),console.log("Line heights:",s),console.log("=== APPLYING FONT SIZES, FAMILIES, AND LINE HEIGHTS TO TIPTAP DOCUMENT ==="),console.log("Font sizes to apply:",o),console.log("Font families to apply:",i),console.log("Line heights to apply:",s);const{state:a}=e,{doc:l}=a;l.descendants((t,n)=>{const r=t.type.name;console.log(`Processing node: ${r} at position ${n}`);const a=t.marks?.find(e=>"textStyle"===e.type.name)?.attrs?.fontSize,l=t.marks?.find(e=>"textStyle"===e.type.name)?.attrs?.fontFamily;if(a||l)console.log(`Node at position ${n} already has font attributes:`,{fontSize:a||"not set",fontFamily:l||"not set"});else{let a=null,l=null,c=null;if("heading"===r){const e=t.attrs.level;a=o[`h${e}`]||o.heading,l=i[`h${e}`]||i.heading,c=s[`h${e}`]||s.heading,console.log(`Heading level ${e}:`,{fontSize:a||"not set",fontFamily:l||"not set",lineHeight:c||"not set"})}else o[r]&&(a=o[r],l=i[r],c=s[r],console.log(`Node type ${r}:`,{fontSize:a||"not set",fontFamily:l||"not set",lineHeight:c||"not set"}));(a||l||c)&&function(e,t,n,r,o,i){try{let s=e.chain().focus().setTextSelection({from:t,to:t+n});Nc(r)&&(s=s.setFontSize(r),console.log(`Setting font size: ${r}`)),Nc(o)&&(s=s.setFontFamily(o),console.log(`Setting font family: ${o}`)),Nc(i)&&(s=s.setLineHeight(i),console.log(`Setting line height: ${i}`)),s.run(),console.log(`Applied to node at position ${t}:`,{fontSize:r||"not set",fontFamily:o||"not set",lineHeight:i||"not set"})}catch(e){console.warn(`Failed to apply font and line height to node at position ${t}:`,e)}}(e,n,t.nodeSize,a,l,c)}return!0}),console.log("Font and line height application complete")}function Dc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];e&&t&&(console.log("=== INSERTING CONTENT AND APPLYING FONT SIZES, FAMILIES, AND LINE HEIGHTS ==="),console.log("Content to insert:",t),console.log("Preserve existing fonts:",i),e.commands.insertContent(t),i||setTimeout(()=>{Rc(e,n,r,o)},100),e.chain().focus())}const zc=(0,Oc.S)(),Pc="selection-background";function $c(e,t){e?t.classList.add(de.active):t.classList.remove(de.active)}!function(){if(document.getElementById("theme-provider-vars"))return;const e=document.createElement("style");e.innerHTML='#input-iframe--v1, :root {\n --radius: 20px;\n --sm-radius: .25rem;\n --secondary: #0a0a0a;\n --dark: #002d5c; /* Darker blue shade */\n --sidebar-color: #1a73e8; /* Sidebar primary color */\n --sidebar-icon-color: #fff;\n --primary: #4285f4; /* Primary theme color */\n --primaryText: #ffffff; /* Text on primary color */\n --primary-text: #ffffff; /* Text on primary color */\n --resizer-color: #c1c1c1; /* Light gray resizer */\n --alpha: 0.8; /* Example alpha transparency */\n --micro-info-color: #7d7d7d;\n --bgPrimary: #f5f5f5; /* Background primary color */\n --secondary: #808080; /* Secondary color */\n --disabled: #d3d3d3; /* Disabled element color */\n --icon-color: #000000; /* Black for icons */\n --error-color: rgba(165, 16, 16, 0.877); \n --input-border-color: #9EADBD;\n --font-family: "Arial, sans-serif"; /* Example font family */\n --cdtr-font-family: "Arial, sans-serif"; /* Same as above */\n --layout-holder-color: #e0e0e0; /* Light gray background */\n --justify-content: center; /* Example alignment */\n --row-direction: row; /* Default row direction */\n --medium-box-shadow: 0 2px 10px 0 rgb(0 6 36 / 20%);\n --section-padding: 10px;\n --add-padding-row: 25px 0 25px 0;\n --section-padding-top: 6px;\n --section-padding-bottom: 6px;\n --margin-top: 1rem;\n --divider-color: #00000026;\n --focus-shadow: 0 0 0 0.15rem rgb(13 110 253 / 10%);\n --text-align-locale: left; /* Example locale text alignment */\n --direction-locale: rtl; /* Left-to-right direction */\n --direction: rtl; /* Left-to-right direction */\n --section-hover: #f0f0f048;\n --spacing-sm: .1rem;\n --paper-font-subhead_-_font-size: 13px;\n --editor-font-size: 13px;\n --paper-item-min-height: 30px;\n --element-border-color: rgba(0, 0, 0, 0.116);\n --editor-input-height: 30px;\n --title-block-height: 50px;\n --text-dark-color: #000000;\n} ',document.head.appendChild(e)}();const Hc=e=>{const{defaultDirection:t,content:n,editable:I,element:T,builder:L=[],language:N,editorWidth:R,onClickMagic:D}=e,z=L.find(e=>"fontFamily"===e.type),P=Sc({fontFamilies:z?.fonts||[],defaultDirection:t,element:T,editable:I,content:n,language:N}),$=(z?.fonts.length>0&&z.fonts,L.find(e=>"fontSize"===e.type)),H=$?$.sizes:[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174],j={direction:()=>{const e=P.isActive({direction:"rtl"})?"ltr":"rtl";F.direction.element.innerHTML="ltr"===e?a().outerHTML:(e=>(0,r.A)("svg",(0,o.A)({},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"}),(0,r.A)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,r.A)("path",{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zm8 12v-2.5l4 3.5-4 3.5V19H5v-2h12z"})))().outerHTML},fontWeight:()=>{$c(P.isActive("bold"),F.bold.element)},italic:()=>{$c(P.isActive("italic"),F.italic.element)},link:()=>{$c(P.isActive("link"),F.link.element)},unLink:()=>{P.isActive("link")?F.unLink.element.classList.remove(de.disabled):F.unLink.element.classList.add(de.disabled)},underline:()=>{$c(P.isActive("underline"),F.underline.element)},strike:()=>{$c(P.isActive("strike"),F.strike.element)},color:()=>{const e=P.getAttributes("textStyle").color||"black";F.fontColor.element.setAttribute("value",e)},background:()=>{const e=P.getAttributes("textStyle").backgroundColor||"#fff";F.backcolor.element.setAttribute("value",e)},fontFamily:()=>{const e=P.getAttributes("textStyle").fontFamily?.split(",")[0].replace(/['"]+/g,"");F.fontFamily.element.value=e||"Arial",F.fontFamily.element.name=e||"Arial"},table:()=>{$c(P.isActive("table"),F.table.element)},image:()=>$c(P.isActive("image"),F.image.element),video:()=>$c(P.isActive("video"),F.video.element),bulletList:()=>$c(P.isActive("bulletList"),F.bullet.element),customBulletList:()=>$c(P.isActive("customBulletList"),F.customList.element),numberedList:()=>{$c(P.isActive("orderedList"),F.numbered.element)},quotes:()=>$c(P.isActive("blockquote"),F.quotes.element),horizontalRule:()=>$c(P.isActive("horizontalRule"),F.horizonRule.element),textAlign:()=>{["justify","center","right","left"].forEach(e=>{$c(P.isActive({textAlign:e}),F[e].element)})},fontSize:()=>{P.getAttributes("textStyle").fontSize;F.fontSize.element.patch(P.getAttributes("textStyle").fontSize||"16px")}},U={removeTable:()=>P.chain().focus().deleteTable().run(),addTable:e=>{const t=(0,r.A)(ae,{style:{width:"220px",padding:"15px"},headerText:"add_table",target:e.target},(0,r.A)("cdtr-table-cells-editor",{onChange:e=>{let{target:n}=e;const{x:r,y:o}=n.value;t.remove(),P.chain().focus().insertTable({rows:r,cols:o,withHeaderRow:!0}).run()}}));document.body.appendChild(t)},setButton:()=>{P.chain().focus().toggleButton({text:"button",width:"100",height:"100"}).run()},addImage:()=>{P.chain().focus().setImage({src:"https://picsum.photos/100/100",alt:""}).run()},setVideo:()=>{P.chain().focus().setVideo({src:"https://www.youtube.com/watch?v=HUYB8EY09ME",width:"500",height:"300"}).run()},setQuotes:()=>{P.chain().focus().toggleBlockquote().run()},setCode:()=>{P.chain().focus().toggleCodeBlock().run()},setHorizonRule:()=>{P.chain().focus().setHorizontalRule({url:"https://www.youtube.com/watch?v=HUYB8EY09ME",width:"100",height:"100"}).run()},clearFormat:()=>{P.chain().focus().unsetAllMarks().run()},emoji:e=>{},table:()=>P.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),bold:()=>P.chain().focus().toggleBold().run(),italic:()=>P.chain().focus().toggleItalic().run(),underline:()=>P.chain().focus().toggleUnderline().run(),strike:()=>P.chain().focus().toggleStrike().run(),direction:()=>{const e=P.isActive({direction:"rtl"})?"ltr":"rtl";P.chain().focus().setDirection(e).run()},textAlign:e=>P.chain().focus().setTextAlign(e).run(),bullets:()=>P.chain().focus().toggleBulletList().run(),numbered:()=>P.chain().focus().toggleOrderedList().run(),customList:()=>P.chain().focus().toggleCustomList().run(),fontSize:e=>{P.chain().focus().setFontSize(e).run()},fontFamily:e=>P.chain().focus().setFontFamily(e).run(),link:e=>{if(!e)return null;e.target.closest("button");const t=(0,r.A)("cdtr-link-element",{href:P.getAttributes("link").href||"",protocol:P.getAttributes("link").protocol,target:P.getAttributes("link").target,onBlur:e=>(e=>{const t=P.state,{from:n,to:r}=t.selection;let o=[];t.doc.nodesBetween(n,r,e=>{o=[...o,...e.marks]});const i=o.find(e=>"link"===e.type.name),s=e.target.value;s.getUrlWithParams&&(s.href=s.getUrlWithParams()),i?P.chain().focus().setColor("blue").extendMarkRange("link").updateAttributes("link",s).setTextSelection({from:r,to:r}).unsetColor().focus().run():(P.commands.saveStyleBeforeLinkFromRange(n,r),P.chain().focus().setTextSelection({from:n,to:r}).setColor("blue").setLink(s).setTextSelection({from:r,to:r}).unsetColor().focus().run()),setTimeout(()=>P.chain().setTextSelection({from:r,to:r}).unsetColor().focus().run(),0)})(e)});B.M.get("injectEditor")((0,r.A)("cdtr-editor-container",null,t))},unLink:()=>P.chain().focus().extendMarkRange("link").unLinkWithStyleRestore().run(),forColor:e=>{P.chain().setColor(e).focus().run()},clearColor:()=>P.chain().focus().unsetColor().run(),clearBackcolor:()=>P.chain().focus().unsetBackgroundColor().run(),backColor:e=>P.chain().focus().setBackgroundColor(e).run(),onClickMagic:()=>{const e={selectAll:()=>(P.chain().focus().selectAll().run(),e),selectNode:t=>(P.chain().focus().selectNode(t).run(),e),selectParentNode:()=>(P.chain().focus().selectParentNode().run(),e),insertContent:t=>(P.commands.insertContent(t),P.chain().focus(),e),insertContentHtml:t=>{const n=vc.parse(t,{async:!1});return Dc(P,n,{},{},{},!0),e},getHTML:()=>P.getHTML(),getText:()=>P.getText(),getJSON:()=>P.getJSON()};D(e)}};let F={bold:{element:(0,r.A)(q,{onClick:U.bold},(0,r.A)(i,null)),className:de.colBtn,title:"bold"},underline:{element:(0,r.A)(q,{onClick:U.underline},(0,r.A)(u,null)),className:de.colBtn,title:"underline"},italic:{element:(0,r.A)(q,{onClick:U.italic},(0,r.A)(p,null)),className:de.colBtn,title:"italic"},strike:{element:(0,r.A)(q,{onClick:U.strike},(0,r.A)(h,null)),className:de.colBtn,title:"strikeThrough",divider:!0},fontFamily:{element:(0,r.A)("cdtr-font-family-editor",{light:!0,onChange:e=>{const t=e.target.value;U.fontFamily(t)}}),className:de.dropdown,title:"fontFamily",divider:!0},fontSize:{element:(0,r.A)(fe,{style:{fontSize:"13px",boxShadow:"none"},icon:(0,r.A)(g,null),title:8,className:de.dropdown},H.map(e=>(0,r.A)(me,{style:{fontSize:"13px"},onClick:()=>U.fontSize(e),className:de.fontSizeItem,value:e+"px"},e,"px"))),className:de.dropdown,title:"fontSize",divider:!0},left:{element:(0,r.A)(q,{onClick:()=>U.textAlign("left")},(0,r.A)(b,null)),className:de.colBtn,title:"left"},center:{element:(0,r.A)(q,{onClick:()=>U.textAlign("center")},(0,r.A)(A,null)),className:de.colBtn,title:"center"},right:{element:(0,r.A)(q,{onClick:()=>U.textAlign("right")},(0,r.A)(y,null)),className:de.colBtn,title:"right"},justify:{element:(0,r.A)(q,{onClick:()=>U.textAlign("justify")},(0,r.A)(w,null)),className:de.colBtn,title:"justify",divider:!0},direction:{element:(0,r.A)(q,{onClick:U.direction},(0,r.A)(a,null)),className:de.colBtn,title:B.M.get("lang","direction"),divider:!0},fontColor:{element:(0,r.A)("color-playground",{ref:{onCreate:e=>{e.hasAlpha=!1,e.type="text"}},onChange:e=>{U.forColor(e.target.value),re({context:{"::selection":{background:"transparent"}},id:Pc}),zc.run(()=>{document.getElementById(Pc).remove()},1500)},className:"cdtr-plugin","data-color":!0}),className:de.colBtn,title:"forecolor"},backcolor:{element:(0,r.A)("color-playground",{type:"background",ref:{onCreate:e=>{e.hasAlpha=!1}},onChange:e=>{U.backColor(e.target.value),re({context:{"::selection":{background:"transparent"}},id:Pc}),zc.run(()=>{document.getElementById(Pc).remove()},1500)},className:"cdtr-plugin","data-color":!0}),className:de.colBtn,title:B.M.get("lang","backcolor"),endLine:!0},bullet:{element:(0,r.A)(q,{onClick:U.bullets},(0,r.A)(c,null)),className:de.colBtn,title:"bullets"},numbered:{element:(0,r.A)(q,{onClick:U.numbered},(0,r.A)(d,null)),className:de.colBtn,title:"numbered"},customList:{element:(0,r.A)(q,{onClick:U.customList},(0,r.A)(l,null)),className:de.colBtn,title:"taskList_with_icons",divider:!0},link:{element:(0,r.A)(q,{onClick:U.link},(0,r.A)(f,null)),className:de.colBtn,title:"link"},unLink:{element:(0,r.A)(q,{onClick:U.unLink},(0,r.A)(m,null)),className:de.colBtn,divider:!0,title:"unLink"},emoji:{element:(0,r.A)(q,{onClick:e=>{const t=(0,r.A)("cdtr-emoji-picker",null);t.onEmojiClick=(e,t)=>{P.commands.insertContent(t.emoji),P.chain().focus(),n.close()};const n=(0,r.A)(ae,{target:e.target},t);document.body.appendChild(n)}},(0,r.A)(k,{className:de.colorBtn})),className:de.colBtn,title:"emoji",divider:!0},image:{element:(0,r.A)(q,{onClick:U.addImage},(0,r.A)(x,{className:de.colorBtn})),className:de.colBtn,title:"image"},video:{element:(0,r.A)(q,{onClick:U.setVideo},(0,r.A)(v,{className:de.colorBtn})),className:de.colBtn,title:"video"},horizonRule:{element:(0,r.A)(q,{onClick:U.setHorizonRule},(0,r.A)(C,{className:de.colorBtn})),className:de.colBtn,title:"divider"},table:{element:(0,r.A)(q,{onClick:U.addTable},(0,r.A)(S,{className:de.colorBtn})),className:de.colBtn,title:"table",divider:!0},quotes:{element:(0,r.A)(q,{onClick:U.setQuotes},(0,r.A)(_,{className:de.colorBtn})),className:de.colBtn,title:"quotes",divider:!0},clearFormat:{element:(0,r.A)(q,{onClick:U.clearFormat},(0,r.A)(E,{className:de.colorBtn})),className:de.colBtn,title:"clearFormat",divider:!0},magic:{element:(0,r.A)(q,{onClick:U.onClickMagic},(0,r.A)(s,null)),className:de.colBtn,title:"magic",divider:!0},mergeTags:{element:(0,r.A)("cdtr-merge-tags",{onChange:e=>{P.commands.insertContent(e.target.value),P.chain().focus();const t=document.querySelector("cdtr-drop-modal");t?.remove()}}),title:"mergeTags",divider:!0}};const W="editor";W&&W.textEditor&&W.textEditor.cmds&&Array.isArray(W.textEditor.cmds)&&W.textEditor.cmds.forEach(e=>{const t="function"==typeof e.element?{element:e.element(),title:e.title,className:e.className||""}:{divider:e.divider};F["extend-"+(0,V.A)()]=t});const Y=(()=>{const e=[];for(const t in F)if(Object.hasOwnProperty.call(F,t)){if(L.find(e=>e.type===t)){const n=F[t];n&&n.element&&(n.element.classList.add("cdtr-button-cmd"),n.element.classList.add(de.btn),e.push(n)),n.endLine&&(e.push({endLine:!0}),delete n.endLine),n.divider&&(e.push({divider:!0}),delete n.divider)}}return e})(),X=e=>{let{editor:t}=e;for(const e in j)if(Object.hasOwnProperty.call(j,e)){(0,j[e])()}};return{component:new O({onLoad:()=>{P.off("selectionUpdate",X),P.off("transaction",X),P.on("selectionUpdate",X),P.on("transaction",X),window.removeEventListener("click",X),window.addEventListener("click",X),X({editor:P})},onUnload:()=>{},children:(0,r.A)("cdtr-row",{style:{width:R||null},justify:"flex-start",alignItems:"center",className:M(de.textEditor,"cdtr-plugin","cdtr-text-editor-plugin",de.fadeUp)},Y.map((e,t)=>e.divider?(0,r.A)("div",{className:de.dividerY}):e.endLine?(0,r.A)("cdtr-col",{sm:12}):(0,r.A)("cdtr-col",{"tooltip-dir":"top",className:e.className},(0,r.A)("cdtr-tooltip",{placement:"top",content:e.title,delay:"600,0"},e.element," ")," ")),(0,r.A)("div",{className:de.dividerX}))}),editor:P}};const jc=function e(t){t&&t.firstChild&&(t.removeChild(t.firstChild),e(t))},Uc=["click","mouseover","mousedown","mousemove","mouseup","keydown","keyup","scroll"];const Fc=new class{constructor(){this.onDispatchEvent=this.onDispatchEvent.bind(this),this.events=Object.fromEntries(Uc.map(e=>[e,[]]))}onDispatchEvent(e){const t=this.events[e.type];Array.isArray(t)&&requestAnimationFrame(()=>{for(let n=t.length-1;n>=0;n--){const r=t[n];"function"==typeof r?r(e):t.splice(n,1)}})}destroy(){Uc.forEach(e=>{this.events[e]?.length>0&&(window.removeEventListener(e,this.onDispatchEvent),this.events[e]=[])})}connect(e,t){this.events[e]?(0===this.events[e].length&&window.addEventListener(e,this.onDispatchEvent,!1),this.events[e].includes(t)?console.warn("domevents: callback already subscribed to",e):this.events[e].push(t)):console.error("domevents: unsupported event name",e)}disconnect(e,t){if(!this.events[e])return void console.error("domevents: unsupported event name",e);const n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0===this.events[e].length&&window.removeEventListener(e,this.onDispatchEvent))}};Fc.connect("mousemove",e=>{B.M.set({mouse:{x:e.pageX,y:e.pageY}})});const Vc=Fc;const qc=new class{constructor(){this.selectedRows=[],this.connected=!1,this.onExecute=(e,t)=>{},this.connect=this.connect.bind(this),this.node=(0,r.A)("cdtr-table-editor",{onChange:this.onExecute}),this.render=this.render.bind(this),Vc.connect("keydown",this.render),Vc.connect("scroll",this.render)}disconnect(){this.connected=!1,this.node.remove()}connect(e,t){this.connected=!0,this.target=e,this.editor=t,this.render()}render(){if(this.connected&&this.target){const e=this.target.getBoundingClientRect();let t=e.top+e.height+5;t+43>window.innerHeight&&(t=window.innerHeight-43),t<e.top&&(t=e.top),this.node.setAttribute("top",t),this.node.setAttribute("left",e.left),this.node.setAttribute("width",e.width),this.node.setAttribute("height",e.height),document.body.appendChild(this.node),this.selectedRows=Array.from(this.target.querySelectorAll(".selectedCell")),this.node.setAttribute("selectedRows",this.selectedRows.length)}}},Wc=qc;class Yc extends be.WF{constructor(){super(),this.className="cdtr-button-cmd",this.cmds={tdColor:e=>{qc.editor.commands.updateAttributes("tableCell",{borderColor:e.target.value})},toggleHeaderColumn:()=>qc.editor.chain().focus().toggleHeaderColumn().run(),toggleHeaderCell:()=>qc.editor.chain().focus().toggleHeaderCell().run(),mergeOrSplit:()=>qc.editor.chain().focus().mergeOrSplit().run(),addRowAfter:()=>qc.editor.chain().focus().addRowAfter().run(),addRowBefore:()=>qc.editor.chain().focus().addRowBefore().run(),addColumnBefore:()=>qc.editor.chain().focus().addColumnBefore().run(),addColumnAfter:()=>qc.editor.chain().focus().addColumnAfter().run(),deleteColumn:()=>qc.editor.chain().focus().deleteColumn().run(),deleteRow:()=>qc.editor.chain().focus().deleteRow().run(),splitCell:()=>qc.editor.chain().focus().splitCell().run(),deleteTable:()=>qc.editor.chain().focus().deleteTable().run(),mergeCells:()=>qc.editor.chain().focus().mergeCells().run(),setWidth:()=>{qc.editor.commands.updateAttributes("table",{width:"300px"})}}}render(){return be.qy`<div
1678
+ `),customElements.get("cdtr-table-cells-editor")||customElements.define("cdtr-table-cells-editor",ye);var Ae=n(81318),we=n(81570),ve=n(85194);const xe=Ae.YY.create({name:"smilieReplacer",addInputRules:()=>[(0,Ae.Yp)({find:/-___- $/,replace:"😑 "}),(0,Ae.Yp)({find:/:'-\) $/,replace:"😂 "}),(0,Ae.Yp)({find:/':-\) $/,replace:"😅 "}),(0,Ae.Yp)({find:/':-D $/,replace:"😅 "}),(0,Ae.Yp)({find:/>:-\) $/,replace:"😆 "}),(0,Ae.Yp)({find:/-__- $/,replace:"😑 "}),(0,Ae.Yp)({find:/':-\( $/,replace:"😓 "}),(0,Ae.Yp)({find:/:'-\( $/,replace:"😢 "}),(0,Ae.Yp)({find:/>:-\( $/,replace:"😠 "}),(0,Ae.Yp)({find:/O:-\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/0:-3 $/,replace:"😇 "}),(0,Ae.Yp)({find:/0:-\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/0;\^\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/O;-\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/0;-\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/O:-3 $/,replace:"😇 "}),(0,Ae.Yp)({find:/:'\) $/,replace:"😂 "}),(0,Ae.Yp)({find:/:-D $/,replace:"😃 "}),(0,Ae.Yp)({find:/':\) $/,replace:"😅 "}),(0,Ae.Yp)({find:/'=\) $/,replace:"😅 "}),(0,Ae.Yp)({find:/':D $/,replace:"😅 "}),(0,Ae.Yp)({find:/'=D $/,replace:"😅 "}),(0,Ae.Yp)({find:/>:\) $/,replace:"😆 "}),(0,Ae.Yp)({find:/>;\) $/,replace:"😆 "}),(0,Ae.Yp)({find:/>=\) $/,replace:"😆 "}),(0,Ae.Yp)({find:/;-\) $/,replace:"😉 "}),(0,Ae.Yp)({find:/\*-\) $/,replace:"😉 "}),(0,Ae.Yp)({find:/;-\] $/,replace:"😉 "}),(0,Ae.Yp)({find:/;\^\) $/,replace:"😉 "}),(0,Ae.Yp)({find:/B-\) $/,replace:"😎 "}),(0,Ae.Yp)({find:/8-\) $/,replace:"😎 "}),(0,Ae.Yp)({find:/B-D $/,replace:"😎 "}),(0,Ae.Yp)({find:/8-D $/,replace:"😎 "}),(0,Ae.Yp)({find:/:-\* $/,replace:"😘 "}),(0,Ae.Yp)({find:/:\^\* $/,replace:"😘 "}),(0,Ae.Yp)({find:/:-\) $/,replace:"🙂 "}),(0,Ae.Yp)({find:/-_- $/,replace:"😑 "}),(0,Ae.Yp)({find:/:-X $/,replace:"😶 "}),(0,Ae.Yp)({find:/:-# $/,replace:"😶 "}),(0,Ae.Yp)({find:/:-x $/,replace:"😶 "}),(0,Ae.Yp)({find:/>.< $/,replace:"😣 "}),(0,Ae.Yp)({find:/:-O $/,replace:"😮 "}),(0,Ae.Yp)({find:/:-o $/,replace:"😮 "}),(0,Ae.Yp)({find:/O_O $/,replace:"😮 "}),(0,Ae.Yp)({find:/>:O $/,replace:"😮 "}),(0,Ae.Yp)({find:/:-P $/,replace:"😛 "}),(0,Ae.Yp)({find:/:-p $/,replace:"😛 "}),(0,Ae.Yp)({find:/:-Þ $/,replace:"😛 "}),(0,Ae.Yp)({find:/:-þ $/,replace:"😛 "}),(0,Ae.Yp)({find:/:-b $/,replace:"😛 "}),(0,Ae.Yp)({find:/>:P $/,replace:"😜 "}),(0,Ae.Yp)({find:/X-P $/,replace:"😜 "}),(0,Ae.Yp)({find:/x-p $/,replace:"😜 "}),(0,Ae.Yp)({find:/':\( $/,replace:"😓 "}),(0,Ae.Yp)({find:/'=\( $/,replace:"😓 "}),(0,Ae.Yp)({find:/>:\\ $/,replace:"😕 "}),(0,Ae.Yp)({find:/>:\/ $/,replace:"😕 "}),(0,Ae.Yp)({find:/:-\/ $/,replace:"😕 "}),(0,Ae.Yp)({find:/:-. $/,replace:"😕 "}),(0,Ae.Yp)({find:/>:\[ $/,replace:"😞 "}),(0,Ae.Yp)({find:/:-\( $/,replace:"😞 "}),(0,Ae.Yp)({find:/:-\[ $/,replace:"😞 "}),(0,Ae.Yp)({find:/:'\( $/,replace:"😢 "}),(0,Ae.Yp)({find:/;-\( $/,replace:"😢 "}),(0,Ae.Yp)({find:/#-\) $/,replace:"😵 "}),(0,Ae.Yp)({find:/%-\) $/,replace:"😵 "}),(0,Ae.Yp)({find:/X-\) $/,replace:"😵 "}),(0,Ae.Yp)({find:/>:\( $/,replace:"😠 "}),(0,Ae.Yp)({find:/0:3 $/,replace:"😇 "}),(0,Ae.Yp)({find:/0:\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/O:\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/O=\) $/,replace:"😇 "}),(0,Ae.Yp)({find:/O:3 $/,replace:"😇 "}),(0,Ae.Yp)({find:/<\/3 $/,replace:"💔 "}),(0,Ae.Yp)({find:/:D $/,replace:"😃 "}),(0,Ae.Yp)({find:/=D $/,replace:"😃 "}),(0,Ae.Yp)({find:/;\) $/,replace:"😉 "}),(0,Ae.Yp)({find:/\*\) $/,replace:"😉 "}),(0,Ae.Yp)({find:/;\] $/,replace:"😉 "}),(0,Ae.Yp)({find:/;D $/,replace:"😉 "}),(0,Ae.Yp)({find:/B\) $/,replace:"😎 "}),(0,Ae.Yp)({find:/8\) $/,replace:"😎 "}),(0,Ae.Yp)({find:/:\* $/,replace:"😘 "}),(0,Ae.Yp)({find:/=\* $/,replace:"😘 "}),(0,Ae.Yp)({find:/:\) $/,replace:"🙂 "}),(0,Ae.Yp)({find:/=\] $/,replace:"🙂 "}),(0,Ae.Yp)({find:/:\] $/,replace:"🙂 "}),(0,Ae.Yp)({find:/:X $/,replace:"😶 "}),(0,Ae.Yp)({find:/:# $/,replace:"😶 "}),(0,Ae.Yp)({find:/=X $/,replace:"😶 "}),(0,Ae.Yp)({find:/=x $/,replace:"😶 "}),(0,Ae.Yp)({find:/:x $/,replace:"😶 "}),(0,Ae.Yp)({find:/=# $/,replace:"😶 "}),(0,Ae.Yp)({find:/:O $/,replace:"😮 "}),(0,Ae.Yp)({find:/:o $/,replace:"😮 "}),(0,Ae.Yp)({find:/:P $/,replace:"😛 "}),(0,Ae.Yp)({find:/=P $/,replace:"😛 "}),(0,Ae.Yp)({find:/:p $/,replace:"😛 "}),(0,Ae.Yp)({find:/=p $/,replace:"😛 "}),(0,Ae.Yp)({find:/:Þ $/,replace:"😛 "}),(0,Ae.Yp)({find:/:þ $/,replace:"😛 "}),(0,Ae.Yp)({find:/:b $/,replace:"😛 "}),(0,Ae.Yp)({find:/d: $/,replace:"😛 "}),(0,Ae.Yp)({find:/:\/ $/,replace:"😕 "}),(0,Ae.Yp)({find:/:\\ $/,replace:"😕 "}),(0,Ae.Yp)({find:/=\/ $/,replace:"😕 "}),(0,Ae.Yp)({find:/=\\ $/,replace:"😕 "}),(0,Ae.Yp)({find:/:L $/,replace:"😕 "}),(0,Ae.Yp)({find:/=L $/,replace:"😕 "}),(0,Ae.Yp)({find:/:\( $/,replace:"😞 "}),(0,Ae.Yp)({find:/:\[ $/,replace:"😞 "}),(0,Ae.Yp)({find:/=\( $/,replace:"😞 "}),(0,Ae.Yp)({find:/;\( $/,replace:"😢 "}),(0,Ae.Yp)({find:/D: $/,replace:"😨 "}),(0,Ae.Yp)({find:/:\$ $/,replace:"😳 "}),(0,Ae.Yp)({find:/=\$ $/,replace:"😳 "}),(0,Ae.Yp)({find:/#\) $/,replace:"😵 "}),(0,Ae.Yp)({find:/%\) $/,replace:"😵 "}),(0,Ae.Yp)({find:/X\) $/,replace:"😵 "}),(0,Ae.Yp)({find:/:@ $/,replace:"😠 "}),(0,Ae.Yp)({find:/=\) $/,replace:"🙂 "}),(0,Ae.Yp)({find:/<3 $/,replace:"❤️ "}),(0,Ae.Yp)({find:/ש”ח $/,replace:"₪ "}),(0,Ae.Yp)({find:/ש״ח $/,replace:"₪ "}),(0,Ae.Yp)({find:/ש"ח $/,replace:"₪ "})]});var ke=n(73686);const Ce=function(e){const t=/(#[0-9a-f]{3,6})\b/gi,n=[];return e.descendants((e,r)=>{e.text&&Array.from(e.text.matchAll(t)).forEach(e=>{const t=e[0],o=e.index||0,i=r+o,s=i+t.length,a=ke.NZ.inline(i,s,{class:"color",style:`--color: ${t}`});n.push(a)})}),ke.zF.create(e,n)},_e=Ae.YY.create({name:"colorHighlighter",addProseMirrorPlugins:()=>[new we.k_({state:{init(e,t){let{doc:n}=t;return Ce(n)},apply:(e,t)=>e.docChanged?Ce(e.doc):t},props:{decorations(e){return this.getState(e)}}})]}),Ee=Ae.CU.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!1}),parseHTML(){return[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(e=>{if(!e.children.length)return;const t=e.querySelectorAll("span");t&&t.forEach(e=>{var t,n;const r=e.getAttribute("style"),o=null===(n=null===(t=e.parentElement)||void 0===t?void 0:t.closest("span"))||void 0===n?void 0:n.getAttribute("style");e.setAttribute("style",`${o};${r}`)})})(e),{})}]},renderHTML({HTMLAttributes:e}){return["span",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:e})=>{const{selection:t}=e;return e.doc.nodesBetween(t.from,t.to,(t,n)=>{if(t.isTextblock)return!0;t.marks.filter(e=>e.type===this.type).some(e=>Object.values(e.attrs).some(e=>!!e))||e.removeMark(n,n+t.nodeSize,this.type)}),!0}}}}),Se=Ae.YY.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:e=>{if(e.style&&e.style.fontSize)return e.style.fontSize.replace(/['"]+/g,"");const t=window.getComputedStyle(e);return t&&t.fontSize?t.fontSize.replace(/['"]+/g,""):e.dataset&&e.dataset.fontSize?e.dataset.fontSize.replace(/['"]+/g,""):null},renderHTML:e=>e.fontSize?{style:`font-size: ${e.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:e=>t=>{let{chain:n}=t;return n().setMark("textStyle",{fontSize:e+"px"}).run()},unsetFontSize:()=>e=>{let{chain:t}=e;return t().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}),addKeyboardShortcuts(){return{"Mod-]":()=>{let e=parseInt(this.editor.getAttributes("textStyle").fontSize);e||(e=16),this.editor.commands.setFontSize(e+1)},"Mod-[":()=>{let e=parseInt(this.editor.getAttributes("textStyle").fontSize);e||(e=16),this.editor.commands.setFontSize(e-1)}}}});var Be=n(1366);const Me=Ae.bP.create({name:"heading",addOptions:()=>({levels:[1,2,3,4,5,6],HTMLAttributes:{}}),content:"inline*",group:"block",defining:!0,addAttributes:()=>({level:{default:1,rendered:!1}}),parseHTML(){return this.options.levels.map(e=>({tag:`h${e}`,attrs:{level:e}}))},renderHTML(e){let{node:t,HTMLAttributes:n}=e;const r=this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0],o=document.createElement(`h${r}`);return o.style.cssText=n.style,o.style.fontFamily||(o.style.fontFamily="Arial, Helvetica, sans-serif"),n.style=o.style.cssText,[`h${r}`,(0,Ae.KV)(this.options.HTMLAttributes,n),0]},addCommands(){return{setHeading:e=>t=>{let{commands:n}=t;return!!this.options.levels.includes(e.level)&&n.setNode(this.name,e)},toggleHeading:e=>t=>{let{commands:n}=t;return!!this.options.levels.includes(e.level)&&n.toggleNode(this.name,"paragraph",e)}}},addKeyboardShortcuts(){return this.options.levels.reduce((e,t)=>({...e,[`Mod-Alt-${t}`]:()=>this.editor.commands.toggleHeading({level:t})}),{})},addInputRules(){return this.options.levels.map(e=>(0,Ae.JJ)({find:new RegExp(`^(#{1,${e}})\\s$`),type:this.type,getAttributes:{level:e}}))}});var Oe=n(28396);const Ie=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,Te=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,Le=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,Ne=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Re=Ae.CU.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:e=>"normal"!==e.style.fontWeight&&null},{style:"font-weight=400",clearMark:e=>e.type.name===this.name},{style:"font-weight",getAttrs:e=>/^(bold(er)?|[5-9]\d{2,})$/.test(e)&&null}]},renderHTML({HTMLAttributes:e}){return["strong",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setBold:()=>({commands:e})=>e.setMark(this.name),toggleBold:()=>({commands:e})=>e.toggleMark(this.name),unsetBold:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,Ae.OX)({find:Ie,type:this.type}),(0,Ae.OX)({find:Le,type:this.type})]},addPasteRules(){return[(0,Ae.Zc)({find:Te,type:this.type}),(0,Ae.Zc)({find:Ne,type:this.type})]}}),De=Ae.CU.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("underline")&&{}}],renderHTML({HTMLAttributes:e}){return["u",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setUnderline:()=>({commands:e})=>e.setMark(this.name),toggleUnderline:()=>({commands:e})=>e.toggleMark(this.name),unsetUnderline:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),ze=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Pe=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,$e=Ae.CU.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:e=>!!e.includes("line-through")&&{}}],renderHTML({HTMLAttributes:e}){return["s",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setStrike:()=>({commands:e})=>e.setMark(this.name),toggleStrike:()=>({commands:e})=>e.toggleMark(this.name),unsetStrike:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,Ae.OX)({find:ze,type:this.type})]},addPasteRules(){return[(0,Ae.Zc)({find:Pe,type:this.type})]}}),He=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,je=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Ue=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Fe=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Ve=Ae.CU.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:e=>"normal"!==e.style.fontStyle&&null},{style:"font-style=normal",clearMark:e=>e.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:e}){return["em",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setItalic:()=>({commands:e})=>e.setMark(this.name),toggleItalic:()=>({commands:e})=>e.toggleMark(this.name),unsetItalic:()=>({commands:e})=>e.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,Ae.OX)({find:He,type:this.type}),(0,Ae.OX)({find:Ue,type:this.type})]},addPasteRules(){return[(0,Ae.Zc)({find:je,type:this.type}),(0,Ae.Zc)({find:Fe,type:this.type})]}}),qe=Ae.YY.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:e=>{var t;return null===(t=e.style.color)||void 0===t?void 0:t.replace(/['"]+/g,"")},renderHTML:e=>e.color?{style:`color: ${e.color}`}:{}}}}]},addCommands:()=>({setColor:e=>({chain:t})=>t().setMark("textStyle",{color:e}).run(),unsetColor:()=>({chain:e})=>e().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),We=Ae.bP.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:e}){return["li",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Ye=Ae.YY.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new we.k_({key:new we.hs("placeholder"),props:{decorations:({doc:e,selection:t})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=t,o=[];if(!n)return null;const i=this.editor.isEmpty;return e.descendants((e,t)=>{const n=r>=t&&r<=t+e.nodeSize,s=!e.isLeaf&&(0,Ae.Op)(e);if((n||!this.options.showOnlyCurrent)&&s){const r=[this.options.emptyNodeClass];i&&r.push(this.options.emptyEditorClass);const s=ke.NZ.node(t,t+e.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:e,pos:t,hasAnchor:n}):this.options.placeholder});o.push(s)}return this.options.includeChildren}),ke.zF.create(e,o)}}})]}});var Xe=n(11329);function Ze(e={}){return new we.k_({view:t=>new Ke(t,e)})}class Ke{constructor(e,t){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=t.width)&&void 0!==n?n:1,this.color=!1===t.color?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let n=e=>{this[t](e)};return e.dom.addEventListener(t,n),{name:t,handler:n}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){null!=this.cursorPos&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,null==e?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e,t=this.editorView.state.doc.resolve(this.cursorPos),n=!t.parent.inlineContent,r=this.editorView.dom,o=r.getBoundingClientRect(),i=o.width/r.offsetWidth,s=o.height/r.offsetHeight;if(n){let n=t.nodeBefore,r=t.nodeAfter;if(n||r){let t=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(t){let o=t.getBoundingClientRect(),i=n?o.bottom:o.top;n&&r&&(i=(i+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*s;e={left:o.left,right:o.right,top:i-a,bottom:i+a}}}}if(!e){let t=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*i;e={left:t.left-n,right:t.left+n,top:t.top,bottom:t.bottom}}let a,l,c=this.editorView.dom.offsetParent;if(this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",n),this.element.classList.toggle("prosemirror-dropcursor-inline",!n),!c||c==document.body&&"static"==getComputedStyle(c).position)a=-pageXOffset,l=-pageYOffset;else{let e=c.getBoundingClientRect(),t=e.width/c.offsetWidth,n=e.height/c.offsetHeight;a=e.left-c.scrollLeft*t,l=e.top-c.scrollTop*n}this.element.style.left=(e.left-a)/i+"px",this.element.style.top=(e.top-l)/s+"px",this.element.style.width=(e.right-e.left)/i+"px",this.element.style.height=(e.bottom-e.top)/s+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),r=n&&n.type.spec.disableDropCursor,o="function"==typeof r?r(this.editorView,t,e):r;if(t&&!o){let e=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let t=(0,Xe.Um)(this.editorView.state.doc,e,this.editorView.dragging.slice);null!=t&&(e=t)}this.setCursor(e),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}const Je=Ae.YY.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[Ze(this.options)]}}),Ge=Ae.YY.create({name:"direction",addOptions:()=>({types:[],directions:["rtl","ltr"],defaultDirection:"ltr"}),addGlobalAttributes(e){return[{types:this.options.types,attributes:{direction:{default:this.options.defaultDirection,parseHTML:e=>e.style.direction||this.options.defaultDirection,renderHTML:e=>({style:`direction: ${e.direction||this.options.defaultDirection}`})}}}]},addCommands(){return{setDirection:e=>t=>{let{commands:n}=t;return!!this.options.directions.includes(e)&&this.options.types.every(t=>n.updateAttributes(t,{direction:e}))},unsetDirection:()=>e=>{let{commands:t}=e;return this.options.types.every(e=>t.resetAttributes(e,"direction"))}}}}),Qe=Ae.YY.create({name:"lineHeight",addOptions:()=>({types:[],lineHeight:"1.4",defaultLineHeight:"1.4"}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:this.options.defaultLineHeight,parseHTML:e=>e.style.lineHeight||this.options.defaultLineHeight,renderHTML:e=>({style:`line-height: ${e.lineHeight||this.options.defaultLineHeight}`})}}}]},addCommands(){return{setLineHeight:e=>t=>{let{commands:n}=t;return this.options.types.every(t=>n.updateAttributes(t,{lineHeight:e}))},unsetLineHeight:()=>e=>{let{commands:t}=e;return this.options.types.every(e=>t.resetAttributes(e,"lineHeight"))}}}}),et=Ae.YY.create({name:"letterSpacing",addOptions:()=>({types:[],letterSpacing:"",defaultLetterSpacing:""}),addGlobalAttributes(){return[{types:this.options.types,attributes:{letterSpacing:{default:this.options.defaultLetterSpacing,parseHTML:e=>e.style.letterSpacing||this.options.defaultLetterSpacing,renderHTML:e=>({style:`letter-spacing: ${e.letterSpacing||this.options.defaultLetterSpacing}`})}}}]},addCommands(){return{setLetterSpacing:e=>t=>{let{commands:n}=t;return this.options.types.every(t=>n.updateAttributes(t,{letterSpacing:e}))},unsetLetterSpacing:()=>e=>{let{commands:t}=e;return this.options.types.every(e=>t.resetAttributes(e,"letterSpacing"))}}}}),tt="textStyle",nt=/^(\d+)\.\s$/,rt=Ae.bP.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:e=>e.hasAttribute("start")?parseInt(e.getAttribute("start")||"",10):1},type:{default:null,parseHTML:e=>e.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:e}){const{start:t,...n}=e;return 1===t?["ol",(0,Ae.KV)(this.options.HTMLAttributes,n),0]:["ol",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{toggleOrderedList:()=>({commands:e,chain:t})=>this.options.keepAttributes?t().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(tt)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let e=(0,Ae.tG)({find:nt,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,Ae.tG)({find:nt,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(tt)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[e]}}),ot="customBulletItem";function it(e){let{width:t=24,height:n=24,fill:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e||!e.startsWith("http"))return e;try{const o=new URL(e);return o.searchParams.set("width",String(t)),o.searchParams.set("height",String(n)),r&&o.searchParams.set("color",String(r).replace("#","")),o.toString()}catch{return e}}const st=Ae.bP.create({name:ot,addOptions:()=>({nested:!0,HTMLAttributes:{},svgIcon:"",width:"",mt:0,height:"",fill:"",fontSize:""}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({svgIcon:{default:"https://img.creaditor.ai/icons/serve/System/check-fill.png?width=24&height=24&color=000"},width:{default:24,parseHTML:e=>e.width},height:{default:24,parseHTML:e=>e.height},mt:{default:0,parseHTML:e=>e.style.marginTop},fill:{default:"#000",parseHTML:e=>e.style.fill}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["li",(0,Ae.KV)(this.options.HTMLAttributes,n,{"data-type":this.name}),["div",["svg"],["span"]],["div",0]]},addCommands(){const e=(e,t)=>{const n={...t},r=e.selection.$from;for(let e=r.depth;e>0;e--){const o=r.node(e);if(o.type.name===ot){Object.assign(n,o.attrs,t);break}}return n.svgIcon?.startsWith("http")&&(n.svgIcon=it(n.svgIcon,{width:n.width??24,height:n.height??24,fill:n.fill})),n};return{setCustomBulletIcon:t=>n=>{let{commands:r,state:o}=n;return r.updateAttributes(ot,e(o,t)),!0},setCustomBulletStyles:t=>n=>{let{commands:r,state:o}=n;return r.updateAttributes(ot,e(o,t)),!0}}},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return e=>{let{HTMLAttributes:t}=e,n=t.svgIcon;if(n=n.replace(/&lt;/g,"<"),-1!==n.indexOf("<svg")){delete t.svgIcon;const e=document.createElement("li");e.classList.add("custom-bullet-item");const r=document.createElement("div");r.innerHTML=n;const o=document.createElement("div"),i=r.firstElementChild;return i.style.width=t.width,i.style.height=t.width,i.style.fill=t.fill,i.style.marginTop=t.mt,Object.entries(this.options.HTMLAttributes).forEach(t=>{let[n,r]=t;e.setAttribute(n,r)}),e.append(r,o),Object.entries(t).forEach(t=>{let[n,r]=t;e.setAttribute(n,r)}),{dom:e,contentDOM:o}}if(n.startsWith("http")){const e=it(n,{width:t.width??24,height:t.height??24,fill:t.fill});delete t.svgIcon;const r=document.createElement("li");r.classList.add("custom-bullet-item");const o=document.createElement("div");o.innerHTML=`<img src="${e}" height="auto" style="margin-top:${t.mt||"auto"}" width="${t.width}"\n />`;const i=document.createElement("div");o.firstElementChild;return Object.entries(this.options.HTMLAttributes).forEach(e=>{let[t,n]=e;r.setAttribute(t,n)}),r.append(o,i),Object.entries(t).forEach(e=>{let[t,n]=e;r.setAttribute(t,n)}),{dom:r,contentDOM:i}}{delete t.svgIcon;const e=document.createElement("li");e.classList.add("custom-bullet-item");const r=document.createElement("div");r.innerHTML=`<svg fill="${t.fill}" width="${t.width}"\n height="${t.width}"\n xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">${n}</svg>`;const o=document.createElement("div"),i=r.firstElementChild;return i.style.width=t.width,i.style.height=t.width,i.style.marginTop=t.mt,i.style.fill=t.fill,Object.entries(this.options.HTMLAttributes).forEach(t=>{let[n,r]=t;e.setAttribute(n,r)}),e.append(r,o),Object.entries(t).forEach(t=>{let[n,r]=t;e.setAttribute(n,r)}),{dom:e,contentDOM:o}}}}}),at=Ae.bP.create({name:"customBulletList",addOptions:()=>({itemTypeName:ot,HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML(e){let{HTMLAttributes:t}=e;return["ul",(0,Ae.KV)(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleCustomList:()=>e=>{let{commands:t}=e;return t.toggleList(this.name,this.options.itemTypeName)}}},addKeyboardShortcuts(){return{"Mod-Shift-6":()=>this.editor.commands.toggleCustomList()}}}),lt=Ae.bP.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:e}){return["br",(0,Ae.KV)(this.options.HTMLAttributes,e)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:e,chain:t,state:n,editor:r})=>e.first([()=>e.exitCode(),()=>e.command(()=>{const{selection:e,storedMarks:o}=n;if(e.$from.parent.type.spec.isolating)return!1;const{keepMarks:i}=this.options,{splittableMarks:s}=r.extensionManager,a=o||e.$to.parentOffset&&e.$from.marks();return t().insertContent({type:this.name}).command(({tr:e,dispatch:t})=>{if(t&&a&&i){const t=a.filter(e=>s.includes(e.type.name));e.ensureMarks(t)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ct=/^\s*(\[([ |x])\])\s$/,dt=(Ae.bP.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{}}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:e=>"true"===e.getAttribute("data-checked"),renderHTML:e=>({"data-checked":e.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["li",(0,Ae.KV)(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const e={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...e,Tab:()=>this.editor.commands.sinkListItem(this.name)}:e},addNodeView(){return e=>{let{node:t,HTMLAttributes:n,getPos:r,editor:o}=e;const i=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input");i.style.display="flex",i.style.alignItems="center",l.style.width="50px";const c=document.createElement("div");return s.contentEditable="false",l.type="checkbox",l.addEventListener("change",e=>{if(!o.isEditable)return void(l.checked=!l.checked);const{checked:t}=e.target;o.isEditable&&"function"==typeof r&&o.chain().focus(void 0,{scrollIntoView:!1}).command(e=>{let{tr:n}=e;const o=r(),i=n.doc.nodeAt(o);return n.setNodeMarkup(o,void 0,{...i?.attrs,checked:t}),!0}).run()}),Object.entries(this.options.HTMLAttributes).forEach(e=>{let[t,n]=e;i.setAttribute(t,n)}),i.dataset.checked=t.attrs.checked,t.attrs.checked&&l.setAttribute("checked","checked"),s.append(l,a),i.append(s,c),Object.entries(n).forEach(e=>{let[t,n]=e;i.setAttribute(t,n)}),{dom:i,contentDOM:c,update:e=>e.type===this.type&&(i.dataset.checked=e.attrs.checked,e.attrs.checked?l.setAttribute("checked","checked"):l.removeAttribute("checked"),!0)}}},addInputRules(){return[(0,Ae.tG)({find:ct,type:this.type,getAttributes:e=>({checked:"x"===e[e.length-1]})})]}}),Ae.bP.create({name:"taskList",addOptions:()=>({itemTypeName:"taskItem",HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML(e){let{HTMLAttributes:t}=e;return["ul",(0,Ae.KV)(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>e=>{let{commands:t}=e;return t.toggleList(this.name,this.options.itemTypeName)}}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),/^\s*>\s$/),pt=Ae.bP.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:e}){return["blockquote",(0,Ae.KV)(this.options.HTMLAttributes,e),0]},addCommands(){return{setBlockquote:()=>({commands:e})=>e.wrapIn(this.name),toggleBlockquote:()=>({commands:e})=>e.toggleWrap(this.name),unsetBlockquote:()=>({commands:e})=>e.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,Ae.tG)({find:dt,type:this.type})]}}),ut=/^```([a-z]+)?[\s\n]$/,ht=/^~~~([a-z]+)?[\s\n]$/,ft=Ae.bP.create({name:"codeBlock",addOptions:()=>({languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}),content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:e=>{var t;const{languageClassPrefix:n}=this.options,r=[...(null===(t=e.firstElementChild)||void 0===t?void 0:t.classList)||[]].filter(e=>e.startsWith(n)).map(e=>e.replace(n,""))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:e,HTMLAttributes:t}){return["pre",(0,Ae.KV)(this.options.HTMLAttributes,t),["code",{class:e.attrs.language?this.options.languageClassPrefix+e.attrs.language:null},0]]},addCommands(){return{setCodeBlock:e=>({commands:t})=>t.setNode(this.name,e),toggleCodeBlock:e=>({commands:t})=>t.toggleNode(this.name,"paragraph",e)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:e,$anchor:t}=this.editor.state.selection,n=1===t.pos;return!(!e||t.parent.type.name!==this.name)&&(!(!n&&t.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:e})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:t}=e,{selection:n}=t,{$from:r,empty:o}=n;if(!o||r.parent.type!==this.type)return!1;const i=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!i||!s)&&e.chain().command(({tr:e})=>(e.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:e})=>{if(!this.options.exitOnArrowDown)return!1;const{state:t}=e,{selection:n,doc:r}=t,{$from:o,empty:i}=n;if(!i||o.parent.type!==this.type)return!1;if(!(o.parentOffset===o.parent.nodeSize-2))return!1;const s=o.after();if(void 0===s)return!1;return r.nodeAt(s)?e.commands.command(({tr:e})=>(e.setSelection(we.LN.near(r.resolve(s))),!0)):e.commands.exitCode()}}},addInputRules(){return[(0,Ae.JJ)({find:ut,type:this.type,getAttributes:e=>({language:e[1]})}),(0,Ae.JJ)({find:ht,type:this.type,getAttributes:e=>({language:e[1]})})]},addProseMirrorPlugins(){return[new we.k_({key:new we.hs("codeBlockVSCodeHandler"),props:{handlePaste:(e,t)=>{if(!t.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=t.clipboardData.getData("text/plain"),r=t.clipboardData.getData("vscode-editor-data"),o=r?JSON.parse(r):void 0,i=null==o?void 0:o.mode;if(!n||!i)return!1;const{tr:s,schema:a}=e.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:i},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(we.U3.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),e.dispatch(s),!0}}})]}});function mt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gt(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;"object"!==r&&"function"!==r||Object.isFrozen(n)||gt(n)}),e}class bt{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function yt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function At(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach(function(e){for(const t in e)n[t]=e[t]}),n}const wt=e=>!!e.scope;class vt{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=yt(e)}openNode(e){if(!wt(e))return;const t=((e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((e,t)=>`${e}${"_".repeat(t+1)}`)].join(" ")}return`${t}${e}`})(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){wt(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}const xt=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class kt{constructor(){this.rootNode=xt(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=xt({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(t=>this._walk(e,t)),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{kt._collapse(e)}))}}class Ct extends kt{constructor(e){super(),this.options=e}addText(e){""!==e&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new vt(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function _t(e){return e?"string"==typeof e?e:e.source:null}function Et(e){return Mt("(?=",e,")")}function St(e){return Mt("(?:",e,")*")}function Bt(e){return Mt("(?:",e,")?")}function Mt(...e){return e.map(e=>_t(e)).join("")}function Ot(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map(e=>_t(e)).join("|")+")"}function It(e){return new RegExp(e.toString()+"|").exec("").length-1}const Tt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Lt(e,{joinWith:t}){let n=0;return e.map(e=>{n+=1;const t=n;let r=_t(e),o="";for(;r.length>0;){const e=Tt.exec(r);if(!e){o+=r;break}o+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?o+="\\"+String(Number(e[1])+t):(o+=e[0],"("===e[0]&&n++)}return o}).map(e=>`(${e})`).join(t)}const Nt="[a-zA-Z]\\w*",Rt="[a-zA-Z_]\\w*",Dt="\\b\\d+(\\.\\d+)?",zt="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Pt="\\b(0b[01]+)",$t={begin:"\\\\[\\s\\S]",relevance:0},Ht={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[$t]},jt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[$t]},Ut=function(e,t,n={}){const r=At({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=Ot("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Mt(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Ft=Ut("//","$"),Vt=Ut("/\\*","\\*/"),qt=Ut("#","$"),Wt={scope:"number",begin:Dt,relevance:0},Yt={scope:"number",begin:zt,relevance:0},Xt={scope:"number",begin:Pt,relevance:0},Zt={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[$t,{begin:/\[/,end:/\]/,relevance:0,contains:[$t]}]},Kt={scope:"title",begin:Nt,relevance:0},Jt={scope:"title",begin:Rt,relevance:0},Gt={begin:"\\.\\s*"+Rt,relevance:0};var Qt=Object.freeze({__proto__:null,APOS_STRING_MODE:Ht,BACKSLASH_ESCAPE:$t,BINARY_NUMBER_MODE:Xt,BINARY_NUMBER_RE:Pt,COMMENT:Ut,C_BLOCK_COMMENT_MODE:Vt,C_LINE_COMMENT_MODE:Ft,C_NUMBER_MODE:Yt,C_NUMBER_RE:zt,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:qt,IDENT_RE:Nt,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:Gt,NUMBER_MODE:Wt,NUMBER_RE:Dt,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:jt,REGEXP_MODE:Zt,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Mt(t,/.*\b/,e.binary,/\b.*/)),At({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},TITLE_MODE:Kt,UNDERSCORE_IDENT_RE:Rt,UNDERSCORE_TITLE_MODE:Jt});function en(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function tn(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function nn(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=en,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function rn(e,t){Array.isArray(e.illegal)&&(e.illegal=Ot(...e.illegal))}function on(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function sn(e,t){void 0===e.relevance&&(e.relevance=1)}const an=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(t=>{delete e[t]}),e.keywords=n.keywords,e.begin=Mt(n.beforeMatch,Et(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},ln=["of","and","for","in","not","or","if","then","parent","list","value"];function cn(e,t,n="keyword"){const r=Object.create(null);return"string"==typeof e?o(n,e.split(" ")):Array.isArray(e)?o(n,e):Object.keys(e).forEach(function(n){Object.assign(r,cn(e[n],t,n))}),r;function o(e,n){t&&(n=n.map(e=>e.toLowerCase())),n.forEach(function(t){const n=t.split("|");r[n[0]]=[e,dn(n[0],n[1])]})}}function dn(e,t){return t?Number(t):function(e){return ln.includes(e.toLowerCase())}(e)?0:1}const pn={},un=e=>{console.error(e)},hn=(e,...t)=>{console.log(`WARN: ${e}`,...t)},fn=(e,t)=>{pn[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),pn[`${e}/${t}`]=!0)},mn=new Error;function gn(e,t,{key:n}){let r=0;const o=e[n],i={},s={};for(let e=1;e<=t.length;e++)s[e+r]=o[e],i[e+r]=!0,r+=It(t[e-1]);e[n]=s,e[n]._emit=i,e[n]._multi=!0}function bn(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw un("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),mn;if("object"!=typeof e.beginScope||null===e.beginScope)throw un("beginScope must be object"),mn;gn(e,e.begin,{key:"beginScope"}),e.begin=Lt(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw un("skip, excludeEnd, returnEnd not compatible with endScope: {}"),mn;if("object"!=typeof e.endScope||null===e.endScope)throw un("endScope must be object"),mn;gn(e,e.end,{key:"endScope"}),e.end=Lt(e.end,{joinWith:""})}}(e)}function yn(e){function t(t,n){return new RegExp(_t(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=It(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=t(Lt(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex((e,t)=>t>0&&void 0!==e),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach(([e,n])=>t.addRule(e,n)),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=At(e.classNameAliases||{}),function n(o,i){const s=o;if(o.isCompiled)return s;[tn,on,bn,an].forEach(e=>e(o,i)),e.compilerExtensions.forEach(e=>e(o,i)),o.__beforeBegin=null,[nn,rn,sn].forEach(e=>e(o,i)),o.isCompiled=!0;let a=null;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),a=o.keywords.$pattern,delete o.keywords.$pattern),a=a||/\w+/,o.keywords&&(o.keywords=cn(o.keywords,e.case_insensitive)),s.keywordPatternRe=t(a,!0),i&&(o.begin||(o.begin=/\B|\b/),s.beginRe=t(s.begin),o.end||o.endsWithParent||(o.end=/\B|\b/),o.end&&(s.endRe=t(s.end)),s.terminatorEnd=_t(s.end)||"",o.endsWithParent&&i.terminatorEnd&&(s.terminatorEnd+=(o.end?"|":"")+i.terminatorEnd)),o.illegal&&(s.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return At(e,{variants:null},t)}));if(e.cachedVariants)return e.cachedVariants;if(An(e))return At(e,{starts:e.starts?At(e.starts):null});if(Object.isFrozen(e))return At(e);return e}("self"===e?o:e)})),o.contains.forEach(function(e){n(e,s)}),o.starts&&n(o.starts,i),s.matcher=function(e){const t=new r;return e.contains.forEach(e=>t.addRule(e.begin,{rule:e,type:"begin"})),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(s),s}(e)}function An(e){return!!e&&(e.endsWithParent||An(e.starts))}class wn extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const vn=yt,xn=At,kn=Symbol("nomatch"),Cn=function(e){const t=Object.create(null),n=Object.create(null),r=[];let o=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",s={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Ct};function l(e){return a.noHighlightRe.test(e)}function c(e,t,n){let r="",o="";"object"==typeof t?(r=e,n=t.ignoreIllegals,o=t.language):(fn("10.7.0","highlight(lang, code, ...args) has been deprecated."),fn("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),o=e,r=t),void 0===n&&(n=!0);const i={code:r,language:o};y("before:highlight",i);const s=i.result?i.result:d(i.language,i.code,n);return s.code=i.code,y("after:highlight",s),s}function d(e,n,r,s){const l=Object.create(null);function c(e,t){return e.keywords[t]}function u(){if(!E.keywords)return void B.addText(M);let e=0;E.keywordPatternRe.lastIndex=0;let t=E.keywordPatternRe.exec(M),n="";for(;t;){n+=M.substring(e,t.index);const r=k.case_insensitive?t[0].toLowerCase():t[0],o=c(E,r);if(o){const[e,i]=o;if(B.addText(n),n="",l[r]=(l[r]||0)+1,l[r]<=7&&(O+=i),e.startsWith("_"))n+=t[0];else{const n=k.classNameAliases[e]||e;f(t[0],n)}}else n+=t[0];e=E.keywordPatternRe.lastIndex,t=E.keywordPatternRe.exec(M)}n+=M.substring(e),B.addText(n)}function h(){null!=E.subLanguage?function(){if(""===M)return;let e=null;if("string"==typeof E.subLanguage){if(!t[E.subLanguage])return void B.addText(M);e=d(E.subLanguage,M,!0,S[E.subLanguage]),S[E.subLanguage]=e._top}else e=p(M,E.subLanguage.length?E.subLanguage:null);E.relevance>0&&(O+=e.relevance),B.__addSublanguage(e._emitter,e.language)}():u(),M=""}function f(e,t){""!==e&&(B.startScope(t),B.addText(e),B.endScope())}function g(e,t){let n=1;const r=t.length-1;for(;n<=r;){if(!e._emit[n]){n++;continue}const r=k.classNameAliases[e[n]]||e[n],o=t[n];r?f(o,r):(M=o,u(),M=""),n++}}function b(e,t){return e.scope&&"string"==typeof e.scope&&B.openNode(k.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(f(M,k.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),M=""):e.beginScope._multi&&(g(e.beginScope,t),M="")),E=Object.create(e,{parent:{value:E}}),E}function y(e,t,n){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(r){if(e["on:end"]){const n=new bt(e);e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return y(e.parent,t,n)}function A(e){return 0===E.matcher.regexIndex?(M+=e[0],1):(L=!0,0)}function w(e){const t=e[0],r=n.substring(e.index),o=y(E,e,r);if(!o)return kn;const i=E;E.endScope&&E.endScope._wrap?(h(),f(t,E.endScope._wrap)):E.endScope&&E.endScope._multi?(h(),g(E.endScope,e)):i.skip?M+=t:(i.returnEnd||i.excludeEnd||(M+=t),h(),i.excludeEnd&&(M=t));do{E.scope&&B.closeNode(),E.skip||E.subLanguage||(O+=E.relevance),E=E.parent}while(E!==o.parent);return o.starts&&b(o.starts,e),i.returnEnd?0:t.length}let v={};function x(t,i){const s=i&&i[0];if(M+=t,null==s)return h(),0;if("begin"===v.type&&"end"===i.type&&v.index===i.index&&""===s){if(M+=n.slice(i.index,i.index+1),!o){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=i,"begin"===i.type)return function(e){const t=e[0],n=e.rule,r=new bt(n),o=[n.__beforeBegin,n["on:begin"]];for(const n of o)if(n&&(n(e,r),r.isMatchIgnored))return A(t);return n.skip?M+=t:(n.excludeBegin&&(M+=t),h(),n.returnBegin||n.excludeBegin||(M=t)),b(n,e),n.returnBegin?0:t.length}(i);if("illegal"===i.type&&!r){const e=new Error('Illegal lexeme "'+s+'" for mode "'+(E.scope||"<unnamed>")+'"');throw e.mode=E,e}if("end"===i.type){const e=w(i);if(e!==kn)return e}if("illegal"===i.type&&""===s)return 1;if(T>1e5&&T>3*i.index){throw new Error("potential infinite loop, way more iterations than matches")}return M+=s,s.length}const k=m(e);if(!k)throw un(i.replace("{}",e)),new Error('Unknown language: "'+e+'"');const C=yn(k);let _="",E=s||C;const S={},B=new a.__emitter(a);!function(){const e=[];for(let t=E;t!==k;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach(e=>B.openNode(e))}();let M="",O=0,I=0,T=0,L=!1;try{if(k.__emitTokens)k.__emitTokens(n,B);else{for(E.matcher.considerAll();;){T++,L?L=!1:E.matcher.considerAll(),E.matcher.lastIndex=I;const e=E.matcher.exec(n);if(!e)break;const t=x(n.substring(I,e.index),e);I=e.index+t}x(n.substring(I))}return B.finalize(),_=B.toHTML(),{language:e,value:_,relevance:O,illegal:!1,_emitter:B,_top:E}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:vn(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:I,context:n.slice(I-100,I+100),mode:t.mode,resultSoFar:_},_emitter:B};if(o)return{language:e,value:vn(n),illegal:!1,relevance:0,errorRaised:t,_emitter:B,_top:E};throw t}}function p(e,n){n=n||a.languages||Object.keys(t);const r=function(e){const t={value:vn(e),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return t._emitter.addText(e),t}(e),o=n.filter(m).filter(b).map(t=>d(t,e,!1));o.unshift(r);const i=o.sort((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(m(e.language).supersetOf===t.language)return 1;if(m(t.language).supersetOf===e.language)return-1}return 0}),[l,c]=i,p=l;return p.secondBest=c,p}function u(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=a.languageDetectRe.exec(t);if(n){const t=m(n[1]);return t||(hn(i.replace("{}",n[1])),hn("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find(e=>l(e)||m(e))}(e);if(l(r))return;if(y("before:highlightElement",{el:e,language:r}),e.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",e);if(e.children.length>0&&(a.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),a.throwUnescapedHTML)){throw new wn("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const o=t.textContent,s=r?c(o,{language:r,ignoreIllegals:!0}):p(o);e.innerHTML=s.value,e.dataset.highlighted="yes",function(e,t,r){const o=t&&n[t]||r;e.classList.add("hljs"),e.classList.add(`language-${o}`)}(e,r,s.language),e.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(e.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),y("after:highlightElement",{el:e,result:s,text:o})}let h=!1;function f(){if("loading"===document.readyState)return void(h=!0);document.querySelectorAll(a.cssSelector).forEach(u)}function m(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function g(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach(e=>{n[e.toLowerCase()]=t})}function b(e){const t=m(e);return t&&!t.disableAutodetect}function y(e,t){const n=e;r.forEach(function(e){e[n]&&e[n](t)})}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",function(){h&&f()},!1),Object.assign(e,{highlight:c,highlightAuto:p,highlightAll:f,highlightElement:u,highlightBlock:function(e){return fn("10.7.0","highlightBlock will be removed entirely in v12.0"),fn("10.7.0","Please use highlightElement now."),u(e)},configure:function(e){a=xn(a,e)},initHighlighting:()=>{f(),fn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){f(),fn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let i=null;try{i=r(e)}catch(e){if(un("Language definition for '{}' could not be registered.".replace("{}",n)),!o)throw e;un(e),i=s}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&g(i.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:m,registerAliases:g,autoDetection:b,inherit:xn,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)},removePlugin:function(e){const t=r.indexOf(e);-1!==t&&r.splice(t,1)}}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString="11.10.0",e.regex={concat:Mt,lookahead:Et,either:Ot,optional:Bt,anyNumberOfTimes:St};for(const e in Qt)"object"==typeof Qt[e]&&gt(Qt[e]);return Object.assign(e,Qt),e},_n=Cn({});_n.newInstance=()=>Cn({});var En=_n;_n.HighlightJS=_n,_n.default=_n;var Sn=mt(En);function Bn(e,t=[]){return e.map(e=>{const n=[...t,...e.properties?e.properties.className:[]];return e.children?Bn(e.children,n):{text:e.value,classes:n}}).flat()}function Mn(e){return e.value||e.children||[]}function On({doc:e,name:t,lowlight:n,defaultLanguage:r}){const o=[];return(0,Ae.xe)(e,e=>e.type.name===t).forEach(e=>{var t;let i=e.pos+1;const s=e.node.attrs.language||r,a=n.listLanguages();var l;Bn(s&&(a.includes(s)||(l=s,Boolean(Sn.getLanguage(l)))||(null===(t=n.registered)||void 0===t?void 0:t.call(n,s)))?Mn(n.highlight(s,e.node.textContent)):Mn(n.highlightAuto(e.node.textContent))).forEach(e=>{const t=i+e.text.length;if(e.classes.length){const n=ke.NZ.inline(i,t,{class:e.classes.join(" ")});o.push(n)}i=t})}),ke.zF.create(e,o)}function In({name:e,lowlight:t,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every(e=>"function"==typeof t[e]))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new we.k_({key:new we.hs("lowlight"),state:{init:(r,{doc:o})=>On({doc:o,name:e,lowlight:t,defaultLanguage:n}),apply:(r,o,i,s)=>{const a=i.selection.$head.parent.type.name,l=s.selection.$head.parent.type.name,c=(0,Ae.xe)(i.doc,t=>t.type.name===e),d=(0,Ae.xe)(s.doc,t=>t.type.name===e);return r.docChanged&&([a,l].includes(e)||d.length!==c.length||r.steps.some(e=>void 0!==e.from&&void 0!==e.to&&c.some(t=>t.pos>=e.from&&t.pos+t.node.nodeSize<=e.to)))?On({doc:r.doc,name:e,lowlight:t,defaultLanguage:n}):o.map(r.mapping,r.doc)}},props:{decorations:e=>r.getState(e)}});return r}const Tn=ft.extend({addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var e;return[...(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[],In({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),Ln={};const Nn=Ae.YY.create({name:"fontFamily",addOptions:()=>({types:["textStyle"],fonts:[]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:e=>e.style.fontFamily?.replace(/['"]+/g,""),renderHTML:e=>{if(!e.fontFamily)return{style:"font-family:Arial, Helvetica, sans-serif"};return function(e,t){if(!e||!e.length)return;const n=e.find(e=>e.cssRule.trim().replace('"',"").replace("'","")===t.trim().replace('"',"").replace("'",""));n&&!Ln[n.name]&&function(e){if(document.getElementById(e.id))return;const t=document.createElement("link");t.href=e.url,t.id=e.id,t.setAttribute("data-name",e.name),t.rel="stylesheet",t.type="text/css",document.head.appendChild(t),Ln[e.name]=!0}(n)}(this.options.fonts,e.fontFamily),{style:`font-family: ${e.fontFamily.replace(/;/g,"")}`,"data-cdtr-font-name":e.fontFamily}}}}}]},addCommands:()=>({setFontFamily:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{let{chain:n}=t;if(!e||"object"!=typeof e)return console.warn("setFontFamily should be { cssRule, name, id, url } "),"string"==typeof e?n().setMark("textStyle",{fontFamily:e}).run():void 0;const{cssRule:r,name:o,id:i,url:s}=e;return n().setMark("textStyle",{fontFamily:r}).run()}},unsetFontFamily:()=>e=>{let{chain:t}=e;return t().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}})});const Rn=Ae.bP.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",draggable:!0,parseHTML:()=>[{tag:"hr"}],renderHTML(e){let{HTMLAttributes:t}=e;return["hr",(0,Ae.KV)(this.options.HTMLAttributes,t)]},addCommands(){return{setHorizontalRule:()=>e=>{let{chain:t}=e;return t().insertContent({type:this.name}).command(e=>{let{tr:t,dispatch:n}=e;if(n){const{$to:e}=t.selection,n=e.end();if(e.nodeAfter)t.setSelection(we.U3.create(t.doc,e.pos));else{const r=e.parent.type.contentMatch.defaultType?.create();r&&(t.insert(n,r),t.setSelection(we.U3.create(t.doc,n)))}t.scrollIntoView()}return!0}).run()}}},addInputRules(){return[(0,Ae.jT)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var Dn=n(15939),zn=n(16090);class Pn extends we.LN{constructor(e){super(e,e)}map(e,t){let n=e.resolve(t.map(this.head));return Pn.valid(n)?new Pn(n):we.LN.near(n)}content(){return zn.Ji.empty}eq(e){return e instanceof Pn&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if("number"!=typeof t.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new Pn(e.resolve(t.pos))}getBookmark(){return new $n(this.anchor)}static valid(e){let t=e.parent;if(t.inlineContent||!function(e){for(let t=e.depth;t>=0;t--){let n=e.index(t),r=e.node(t);if(0!=n)for(let e=r.child(n-1);;e=e.lastChild){if(0==e.childCount&&!e.inlineContent||Hn(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e)||!function(e){for(let t=e.depth;t>=0;t--){let n=e.indexAfter(t),r=e.node(t);if(n!=r.childCount)for(let e=r.child(n);;e=e.firstChild){if(0==e.childCount&&!e.inlineContent||Hn(e.type))return!0;if(e.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(e))return!1;let n=t.type.spec.allowGapCursor;if(null!=n)return n;let r=t.contentMatchAt(e.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(e,t,n=!1){e:for(;;){if(!n&&Pn.valid(e))return e;let r=e.pos,o=null;for(let n=e.depth;;n--){let i=e.node(n);if(t>0?e.indexAfter(n)<i.childCount:e.index(n)>0){o=i.child(t>0?e.indexAfter(n):e.index(n)-1);break}if(0==n)return null;r+=t;let s=e.doc.resolve(r);if(Pn.valid(s))return s}for(;;){let i=t>0?o.firstChild:o.lastChild;if(!i){if(o.isAtom&&!o.isText&&!we.nh.isSelectable(o)){e=e.doc.resolve(r+o.nodeSize*t),n=!1;continue e}break}o=i,r+=t;let s=e.doc.resolve(r);if(Pn.valid(s))return s}return null}}}Pn.prototype.visible=!1,Pn.findFrom=Pn.findGapCursorFrom,we.LN.jsonID("gapcursor",Pn);class $n{constructor(e){this.pos=e}map(e){return new $n(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return Pn.valid(t)?new Pn(t):we.LN.near(t)}}function Hn(e){return e.isAtom||e.spec.isolating||e.spec.createGapCursor}const jn=(0,Dn.K)({ArrowLeft:Un("horiz",-1),ArrowRight:Un("horiz",1),ArrowUp:Un("vert",-1),ArrowDown:Un("vert",1)});function Un(e,t){const n="vert"==e?t>0?"down":"up":t>0?"right":"left";return function(e,r,o){let i=e.selection,s=t>0?i.$to:i.$from,a=i.empty;if(i instanceof we.U3){if(!o.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=e.doc.resolve(t>0?s.after():s.before())}let l=Pn.findGapCursorFrom(s,t,a);return!!l&&(r&&r(e.tr.setSelection(new Pn(l))),!0)}}function Fn(e,t,n){if(!e||!e.editable)return!1;let r=e.state.doc.resolve(t);if(!Pn.valid(r))return!1;let o=e.posAtCoords({left:n.clientX,top:n.clientY});return!(o&&o.inside>-1&&we.nh.isSelectable(e.state.doc.nodeAt(o.inside)))&&(e.dispatch(e.state.tr.setSelection(new Pn(r))),!0)}function Vn(e,t){if("insertCompositionText"!=t.inputType||!(e.state.selection instanceof Pn))return!1;let{$from:n}=e.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);if(!r)return!1;let o=zn.FK.empty;for(let e=r.length-1;e>=0;e--)o=zn.FK.from(r[e].createAndFill(null,o));let i=e.state.tr.replace(n.pos,n.pos,new zn.Ji(o,0,0));return i.setSelection(we.U3.near(i.doc.resolve(n.pos+1))),e.dispatch(i),!1}function qn(e){if(!(e.selection instanceof Pn))return null;let t=document.createElement("div");return t.className="ProseMirror-gapcursor",ke.zF.create(e.doc,[ke.NZ.widget(e.selection.head,t,{key:"gapcursor"})])}const Wn=Ae.YY.create({name:"gapCursor",addProseMirrorPlugins:()=>[new we.k_({props:{decorations:qn,createSelectionBetween:(e,t,n)=>t.pos==n.pos&&Pn.valid(n)?new Pn(n):null,handleClick:Fn,handleKeyDown:jn,handleDOMEvents:{beforeinput:Vn}}})],extendNodeSchema(e){var t;const n={name:e.name,options:e.options,storage:e.storage};return{allowGapCursor:null!==(t=(0,Ae.gk)((0,Ae.iI)(e,"allowGapCursor",n)))&&void 0!==t?t:null}}}),Yn=Ae.bP.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML(e){const{HTMLAttributes:t}=e,n=document.createElement("p");n.style.cssText=t.style,n.style.fontSize||(n.style.fontSize="16px"),n.style.fontFamily||(n.style.fontFamily="Arial, Helvetica, sans-serif");const r=n.style.cssText;return["p",(0,Ae.KV)(this.options.HTMLAttributes,{style:r},{dir:"auto"}),0]},addCommands(){return{setParagraph:()=>e=>{let{commands:t}=e;return t.setNode(this.name)}}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Xn="numeric",Zn="ascii",Kn="alpha",Jn="asciinumeric",Gn="alphanumeric",Qn="domain",er="emoji",tr="scheme",nr="slashscheme",rr="whitespace";function or(e,t){return e in t||(t[e]=[]),t[e]}function ir(e,t,n){t[Xn]&&(t[Jn]=!0,t[Gn]=!0),t[Zn]&&(t[Jn]=!0,t[Kn]=!0),t[Jn]&&(t[Gn]=!0),t[Kn]&&(t[Gn]=!0),t[Gn]&&(t[Qn]=!0),t[er]&&(t[Qn]=!0);for(const r in t){const t=or(r,n);t.indexOf(e)<0&&t.push(e)}}function sr(e=null){this.j={},this.jr=[],this.jd=null,this.t=e}sr.groups={},sr.prototype={accepts(){return!!this.t},go(e){const t=this,n=t.j[e];if(n)return n;for(let n=0;n<t.jr.length;n++){const r=t.jr[n][0],o=t.jr[n][1];if(o&&r.test(e))return o}return t.jd},has(e,t=!1){return t?e in this.j:!!this.go(e)},ta(e,t,n,r){for(let o=0;o<e.length;o++)this.tt(e[o],t,n,r)},tr(e,t,n,r){let o;return r=r||sr.groups,t&&t.j?o=t:(o=new sr(t),n&&r&&ir(t,n,r)),this.jr.push([e,o]),o},ts(e,t,n,r){let o=this;const i=e.length;if(!i)return o;for(let t=0;t<i-1;t++)o=o.tt(e[t]);return o.tt(e[i-1],t,n,r)},tt(e,t,n,r){r=r||sr.groups;const o=this;if(t&&t.j)return o.j[e]=t,t;const i=t;let s,a=o.go(e);if(a?(s=new sr,Object.assign(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new sr,i){if(r)if(s.t&&"string"==typeof s.t){const e=Object.assign(function(e,t){const n={};for(const r in t)t[r].indexOf(e)>=0&&(n[r]=!0);return n}(s.t,r),n);ir(i,e,r)}else n&&ir(i,n,r);s.t=i}return o.j[e]=s,s}};const ar=(e,t,n,r,o)=>e.ta(t,n,r,o),lr=(e,t,n,r,o)=>e.tr(t,n,r,o),cr=(e,t,n,r,o)=>e.ts(t,n,r,o),dr=(e,t,n,r,o)=>e.tt(t,n,r,o),pr="WORD",ur="UWORD",hr="ASCIINUMERICAL",fr="ALPHANUMERICAL",mr="LOCALHOST",gr="TLD",br="UTLD",yr="SCHEME",Ar="SLASH_SCHEME",wr="NUM",vr="WS",xr="NL",kr="OPENBRACE",Cr="CLOSEBRACE",_r="OPENBRACKET",Er="CLOSEBRACKET",Sr="OPENPAREN",Br="CLOSEPAREN",Mr="OPENANGLEBRACKET",Or="CLOSEANGLEBRACKET",Ir="FULLWIDTHLEFTPAREN",Tr="FULLWIDTHRIGHTPAREN",Lr="LEFTCORNERBRACKET",Nr="RIGHTCORNERBRACKET",Rr="LEFTWHITECORNERBRACKET",Dr="RIGHTWHITECORNERBRACKET",zr="FULLWIDTHLESSTHAN",Pr="FULLWIDTHGREATERTHAN",$r="AMPERSAND",Hr="APOSTROPHE",jr="ASTERISK",Ur="AT",Fr="BACKSLASH",Vr="BACKTICK",qr="CARET",Wr="COLON",Yr="COMMA",Xr="DOLLAR",Zr="DOT",Kr="EQUALS",Jr="EXCLAMATION",Gr="HYPHEN",Qr="PERCENT",eo="PIPE",to="PLUS",no="POUND",ro="QUERY",oo="QUOTE",io="FULLWIDTHMIDDLEDOT",so="SEMI",ao="SLASH",lo="TILDE",co="UNDERSCORE",po="EMOJI",uo="SYM";var ho=Object.freeze({__proto__:null,ALPHANUMERICAL:fr,AMPERSAND:$r,APOSTROPHE:Hr,ASCIINUMERICAL:hr,ASTERISK:jr,AT:Ur,BACKSLASH:Fr,BACKTICK:Vr,CARET:qr,CLOSEANGLEBRACKET:Or,CLOSEBRACE:Cr,CLOSEBRACKET:Er,CLOSEPAREN:Br,COLON:Wr,COMMA:Yr,DOLLAR:Xr,DOT:Zr,EMOJI:po,EQUALS:Kr,EXCLAMATION:Jr,FULLWIDTHGREATERTHAN:Pr,FULLWIDTHLEFTPAREN:Ir,FULLWIDTHLESSTHAN:zr,FULLWIDTHMIDDLEDOT:io,FULLWIDTHRIGHTPAREN:Tr,HYPHEN:Gr,LEFTCORNERBRACKET:Lr,LEFTWHITECORNERBRACKET:Rr,LOCALHOST:mr,NL:xr,NUM:wr,OPENANGLEBRACKET:Mr,OPENBRACE:kr,OPENBRACKET:_r,OPENPAREN:Sr,PERCENT:Qr,PIPE:eo,PLUS:to,POUND:no,QUERY:ro,QUOTE:oo,RIGHTCORNERBRACKET:Nr,RIGHTWHITECORNERBRACKET:Dr,SCHEME:yr,SEMI:so,SLASH:ao,SLASH_SCHEME:Ar,SYM:uo,TILDE:lo,TLD:gr,UNDERSCORE:co,UTLD:br,UWORD:ur,WORD:pr,WS:vr});const fo=/[a-z]/,mo=/\p{L}/u,go=/\p{Emoji}/u,bo=/\d/,yo=/\s/;let Ao=null,wo=null;function vo(e,t){const n=function(e){const t=[],n=e.length;let r=0;for(;r<n;){let o,i=e.charCodeAt(r),s=i<55296||i>56319||r+1===n||(o=e.charCodeAt(r+1))<56320||o>57343?e[r]:e.slice(r,r+2);t.push(s),r+=s.length}return t}(t.replace(/[A-Z]/g,e=>e.toLowerCase())),r=n.length,o=[];let i=0,s=0;for(;s<r;){let a=e,l=null,c=0,d=null,p=-1,u=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(p=0,u=0,d=a):p>=0&&(p+=n[s].length,u++),c+=n[s].length,i+=n[s].length,s++;i-=p,s-=u,c-=p,o.push({t:d.t,v:t.slice(i-c,i),s:i-c,e:i})}return o}function xo(e,t,n,r,o){let i;const s=t.length;for(let n=0;n<s-1;n++){const s=t[n];e.j[s]?i=e.j[s]:(i=new sr(r),i.jr=o.slice(),e.j[s]=i),e=i}return i=new sr(n),i.jr=o.slice(),e.j[t[s-1]]=i,i}function ko(e){const t=[],n=[];let r=0;for(;r<e.length;){let o=0;for(;"0123456789".indexOf(e[r+o])>=0;)o++;if(o>0){t.push(n.join(""));for(let t=parseInt(e.substring(r,r+o),10);t>0;t--)n.pop();r+=o}else n.push(e[r]),r++}return t}const Co={defaultProtocol:"http",events:null,format:Eo,formatHref:Eo,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function _o(e,t=null){let n=Object.assign({},Co);e&&(n=Object.assign(n,e instanceof _o?e.o:e));const r=n.ignoreTags,o=[];for(let e=0;e<r.length;e++)o.push(r[e].toUpperCase());this.o=n,t&&(this.defaultRender=t),this.ignoreTags=o}function Eo(e){return e}_o.prototype={o:Co,ignoreTags:[],defaultRender:e=>e,check(e){return this.get("validate",e.toString(),e)},get(e,t,n){const r=null!=t;let o=this.o[e];return o?("object"==typeof o?(o=n.t in o?o[n.t]:Co[e],"function"==typeof o&&r&&(o=o(t,n))):"function"==typeof o&&r&&(o=o(t,n.t,n)),o):o},getObj(e,t,n){let r=this.o[e];return"function"==typeof r&&null!=t&&(r=r(t,n.t,n)),r},render(e){const t=e.render(this);return(this.get("render",null,e)||this.defaultRender)(t,e.t,e)}};function So(e,t){this.t="token",this.v=e,this.tk=t}function Bo(e,t){class n extends So{constructor(t,n){super(t,n),this.t=e}}for(const e in t)n.prototype[e]=t[e];return n.t=e,n}So.prototype={isLink:!1,toString(){return this.v},toHref(e){return this.toString()},toFormattedString(e){const t=this.toString(),n=e.get("truncate",t,this),r=e.get("format",t,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(e){return e.get("formatHref",this.toHref(e.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(e=Co.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(e),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(e){return{type:this.t,value:this.toFormattedString(e),isLink:this.isLink,href:this.toFormattedHref(e),start:this.startIndex(),end:this.endIndex()}},validate(e){return e.get("validate",this.toString(),this)},render(e){const t=this,n=this.toHref(e.get("defaultProtocol")),r=e.get("formatHref",n,this),o=e.get("tagName",n,t),i=this.toFormattedString(e),s={},a=e.get("className",n,t),l=e.get("target",n,t),c=e.get("rel",n,t),d=e.getObj("attributes",n,t),p=e.getObj("events",n,t);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Object.assign(s,d),{tagName:o,attributes:s,content:i,eventListeners:p}}};const Mo=Bo("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Oo=Bo("text"),Io=Bo("nl"),To=Bo("url",{isLink:!0,toHref(e=Co.defaultProtocol){return this.hasProtocol()?this.v:`${e}://${this.v}`},hasProtocol(){const e=this.tk;return e.length>=2&&e[0].t!==mr&&e[1].t===Wr}});const Lo=e=>new sr(e);function No(e,t,n){const r=n[0].s,o=n[n.length-1].e;return new e(t.slice(r,o),n)}const Ro="undefined"!=typeof console&&console&&console.warn||(()=>{}),Do="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",zo={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Po(e,t=!1){if(zo.initialized&&Ro(`linkifyjs: already initialized - will not register custom scheme "${e}" ${Do}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(e))throw new Error('linkifyjs: incorrect scheme format.\n1. Must only contain digits, lowercase ASCII letters or "-"\n2. Cannot start or end with "-"\n3. "-" cannot repeat');zo.customSchemes.push([e,t])}function $o(){zo.scanner=function(e=[]){const t={};sr.groups=t;const n=new sr;null==Ao&&(Ao=ko("aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2")),null==wo&&(wo=ko("ελ1υ2бг1ел3дети4ею2католик6ом3мкд2он1сква6онлайн5рг3рус2ф2сайт3рб3укр3қаз3հայ3ישראל5קום3ابوظبي5رامكو5لاردن4بحرين5جزائر5سعودية6عليان5مغرب5مارات5یران5بارت2زار4يتك3ھارت5تونس4سودان3رية5شبكة4عراق2ب2مان4فلسطين6قطر3كاثوليك6وم3مصر2ليسيا5وريتانيا7قع4همراه5پاکستان7ڀارت4कॉम3नेट3भारत0म्3ोत5संगठन5বাংলা5ভারত2ৰত4ਭਾਰਤ4ભારત4ଭାରତ4இந்தியா6லங்கை6சிங்கப்பூர்11భారత్5ಭಾರತ4ഭാരതം5ලංකා4คอม3ไทย3ລາວ3გე2みんな3アマゾン4クラウド4グーグル4コム2ストア3セール3ファッション6ポイント4世界2中信1国1國1文网3亚马逊3企业2佛山2信息2健康2八卦2公司1益2台湾1灣2商城1店1标2嘉里0大酒店5在线2大拿2天主教3娱乐2家電2广东2微博2慈善2我爱你3手机2招聘2政务1府2新加坡2闻2时尚2書籍2机构2淡马锡3游戏2澳門2点看2移动2组织机构4网址1店1站1络2联通2谷歌2购物2通販2集团2電訊盈科4飞利浦3食品2餐厅2香格里拉3港2닷넷1컴2삼성2한국2")),dr(n,"'",Hr),dr(n,"{",kr),dr(n,"}",Cr),dr(n,"[",_r),dr(n,"]",Er),dr(n,"(",Sr),dr(n,")",Br),dr(n,"<",Mr),dr(n,">",Or),dr(n,"(",Ir),dr(n,")",Tr),dr(n,"「",Lr),dr(n,"」",Nr),dr(n,"『",Rr),dr(n,"』",Dr),dr(n,"<",zr),dr(n,">",Pr),dr(n,"&",$r),dr(n,"*",jr),dr(n,"@",Ur),dr(n,"`",Vr),dr(n,"^",qr),dr(n,":",Wr),dr(n,",",Yr),dr(n,"$",Xr),dr(n,".",Zr),dr(n,"=",Kr),dr(n,"!",Jr),dr(n,"-",Gr),dr(n,"%",Qr),dr(n,"|",eo),dr(n,"+",to),dr(n,"#",no),dr(n,"?",ro),dr(n,'"',oo),dr(n,"/",ao),dr(n,";",so),dr(n,"~",lo),dr(n,"_",co),dr(n,"\\",Fr),dr(n,"・",io);const r=lr(n,bo,wr,{[Xn]:!0});lr(r,bo,r);const o=lr(r,fo,hr,{[Jn]:!0}),i=lr(r,mo,fr,{[Gn]:!0}),s=lr(n,fo,pr,{[Zn]:!0});lr(s,bo,o),lr(s,fo,s),lr(o,bo,o),lr(o,fo,o);const a=lr(n,mo,ur,{[Kn]:!0});lr(a,fo),lr(a,bo,i),lr(a,mo,a),lr(i,bo,i),lr(i,fo),lr(i,mo,i);const l=dr(n,"\n",xr,{[rr]:!0}),c=dr(n,"\r",vr,{[rr]:!0}),d=lr(n,yo,vr,{[rr]:!0});dr(n,"",d),dr(c,"\n",l),dr(c,"",d),lr(c,yo,d),dr(d,"\r"),dr(d,"\n"),lr(d,yo,d),dr(d,"",d);const p=lr(n,go,po,{[er]:!0});dr(p,"#"),lr(p,go,p),dr(p,"️",p);const u=dr(p,"‍");dr(u,"#"),lr(u,go,p);const h=[[fo,s],[bo,o]],f=[[fo,null],[mo,a],[bo,i]];for(let e=0;e<Ao.length;e++)xo(n,Ao[e],gr,pr,h);for(let e=0;e<wo.length;e++)xo(n,wo[e],br,ur,f);ir(gr,{tld:!0,ascii:!0},t),ir(br,{utld:!0,alpha:!0},t),xo(n,"file",yr,pr,h),xo(n,"mailto",yr,pr,h),xo(n,"http",Ar,pr,h),xo(n,"https",Ar,pr,h),xo(n,"ftp",Ar,pr,h),xo(n,"ftps",Ar,pr,h),ir(yr,{scheme:!0,ascii:!0},t),ir(Ar,{slashscheme:!0,ascii:!0},t),e=e.sort((e,t)=>e[0]>t[0]?1:-1);for(let t=0;t<e.length;t++){const r=e[t][0],o=e[t][1]?{[tr]:!0}:{[nr]:!0};r.indexOf("-")>=0?o[Qn]=!0:fo.test(r)?bo.test(r)?o[Jn]=!0:o[Zn]=!0:o[Xn]=!0,cr(n,r,r,o)}return cr(n,"localhost",mr,{ascii:!0}),n.jd=new sr(uo),{start:n,tokens:Object.assign({groups:t},ho)}}(zo.customSchemes);for(let e=0;e<zo.tokenQueue.length;e++)zo.tokenQueue[e][1]({scanner:zo.scanner});zo.parser=function({groups:e}){const t=e.domain.concat([$r,jr,Ur,Fr,Vr,qr,Xr,Kr,Gr,wr,Qr,eo,to,no,ao,uo,lo,co]),n=[Hr,Wr,Yr,Zr,Jr,Qr,ro,oo,so,Mr,Or,kr,Cr,Er,_r,Sr,Br,Ir,Tr,Lr,Nr,Rr,Dr,zr,Pr],r=[$r,Hr,jr,Fr,Vr,qr,Xr,Kr,Gr,kr,Cr,Qr,eo,to,no,ro,ao,uo,lo,co],o=Lo(),i=dr(o,lo);ar(i,r,i),ar(i,e.domain,i);const s=Lo(),a=Lo(),l=Lo();ar(o,e.domain,s),ar(o,e.scheme,a),ar(o,e.slashscheme,l),ar(s,r,i),ar(s,e.domain,s);const c=dr(s,Ur);dr(i,Ur,c),dr(a,Ur,c),dr(l,Ur,c);const d=dr(i,Zr);ar(d,r,i),ar(d,e.domain,i);const p=Lo();ar(c,e.domain,p),ar(p,e.domain,p);const u=dr(p,Zr);ar(u,e.domain,p);const h=Lo(Mo);ar(u,e.tld,h),ar(u,e.utld,h),dr(c,mr,h);const f=dr(p,Gr);dr(f,Gr,f),ar(f,e.domain,p),ar(h,e.domain,p),dr(h,Zr,u),dr(h,Gr,f);const m=dr(h,Wr);ar(m,e.numeric,Mo);const g=dr(s,Gr),b=dr(s,Zr);dr(g,Gr,g),ar(g,e.domain,s),ar(b,r,i),ar(b,e.domain,s);const y=Lo(To);ar(b,e.tld,y),ar(b,e.utld,y),ar(y,e.domain,s),ar(y,r,i),dr(y,Zr,b),dr(y,Gr,g),dr(y,Ur,c);const A=dr(y,Wr),w=Lo(To);ar(A,e.numeric,w);const v=Lo(To),x=Lo();ar(v,t,v),ar(v,n,x),ar(x,t,v),ar(x,n,x),dr(y,ao,v),dr(w,ao,v);const k=dr(a,Wr),C=dr(l,Wr),_=dr(C,ao),E=dr(_,ao);ar(a,e.domain,s),dr(a,Zr,b),dr(a,Gr,g),ar(l,e.domain,s),dr(l,Zr,b),dr(l,Gr,g),ar(k,e.domain,v),dr(k,ao,v),dr(k,ro,v),ar(E,e.domain,v),ar(E,t,v),dr(E,ao,v);const S=[[kr,Cr],[_r,Er],[Sr,Br],[Mr,Or],[Ir,Tr],[Lr,Nr],[Rr,Dr],[zr,Pr]];for(let e=0;e<S.length;e++){const[r,o]=S[e],i=dr(v,r);dr(x,r,i),dr(i,o,v);const s=Lo(To);ar(i,t,s);const a=Lo();ar(i,n),ar(s,t,s),ar(s,n,a),ar(a,t,s),ar(a,n,a),dr(s,o,v),dr(a,o,v)}return dr(o,mr,y),dr(o,xr,Io),{start:o,tokens:ho}}(zo.scanner.tokens);for(let e=0;e<zo.pluginQueue.length;e++)zo.pluginQueue[e][1]({scanner:zo.scanner,parser:zo.parser});return zo.initialized=!0,zo}function Ho(e){return zo.initialized||$o(),function(e,t,n){let r=n.length,o=0,i=[],s=[];for(;o<r;){let a=e,l=null,c=null,d=0,p=null,u=-1;for(;o<r&&!(l=a.go(n[o].t));)s.push(n[o++]);for(;o<r&&(c=l||a.go(n[o].t));)l=null,a=c,a.accepts()?(u=0,p=a):u>=0&&u++,o++,d++;if(u<0)o-=d,o<r&&(s.push(n[o]),o++);else{s.length>0&&(i.push(No(Oo,t,s)),s=[]),o-=u,d-=u;const e=p.t,r=n.slice(o-d,o);i.push(No(e,t,r))}}return s.length>0&&i.push(No(Oo,t,s)),i}(zo.parser.start,e,vo(zo.scanner.start,e))}function jo(e,t=null,n=null){if(t&&"object"==typeof t){if(n)throw Error(`linkifyjs: Invalid link type ${t}; must be a string`);n=t,t=null}const r=new _o(n),o=Ho(e),i=[];for(let e=0;e<o.length;e++){const n=o[e];!n.isLink||t&&n.t!==t||!r.check(n)||i.push(n.toFormattedObject(r))}return i}Ho.scan=vo;const Uo="[\0-   ᠎ -\u2029  ]",Fo=new RegExp(Uo),Vo=new RegExp(`${Uo}$`),qo=new RegExp(Uo,"g");function Wo(e,t){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return t&&t.forEach(e=>{const t="string"==typeof e?e:e.scheme;t&&n.push(t)}),!e||e.replace(qo,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Yo=Ae.CU.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(e=>{"string"!=typeof e?Po(e.scheme,e.optionalSlashes):Po(e)})},onDestroy(){sr.groups={},zo.scanner=null,zo.parser=null,zo.tokenQueue=[],zo.pluginQueue=[],zo.customSchemes=[],zo.initialized=!1},inclusive(){return this.options.autolink},addOptions:()=>({openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(e,t)=>!!Wo(e,t.protocols),validate:e=>!!e,shouldAutoLink:e=>!!e}),addAttributes(){return{href:{default:null,parseHTML:e=>e.getAttribute("href")},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:e=>{const t=e.getAttribute("href");return!(!t||!this.options.isAllowedUri(t,{defaultValidate:e=>!!Wo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:e}){return this.options.isAllowedUri(e.href,{defaultValidate:e=>!!Wo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,Ae.KV)(this.options.HTMLAttributes,e),0]:["a",(0,Ae.KV)(this.options.HTMLAttributes,{...e,href:""}),0]},addCommands(){return{setLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!Wo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().setMark(this.name,e).setMeta("preventAutolink",!0).run()},toggleLink:e=>({chain:t})=>{const{href:n}=e;return!!this.options.isAllowedUri(n,{defaultValidate:e=>!!Wo(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&t().toggleMark(this.name,e,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:e})=>e().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[(0,Ae.Zc)({find:e=>{const t=[];if(e){const{protocols:n,defaultProtocol:r}=this.options,o=jo(e).filter(e=>e.isLink&&this.options.isAllowedUri(e.value,{defaultValidate:e=>!!Wo(e,n),protocols:n,defaultProtocol:r}));o.length&&o.forEach(e=>t.push({text:e.value,data:{href:e.href},index:e.start}))}return t},type:this.type,getAttributes:e=>{var t;return{href:null===(t=e.data)||void 0===t?void 0:t.href}}})]},addProseMirrorPlugins(){const e=[],{protocols:t,defaultProtocol:n}=this.options;return this.options.autolink&&e.push(function(e){return new we.k_({key:new we.hs("autolink"),appendTransaction:(t,n,r)=>{const o=t.some(e=>e.docChanged)&&!n.doc.eq(r.doc),i=t.some(e=>e.getMeta("preventAutolink"));if(!o||i)return;const{tr:s}=r,a=(0,Ae.T7)(n.doc,[...t]);return(0,Ae.FF)(a).forEach(({newRange:t})=>{const n=(0,Ae.Nx)(r.doc,t,e=>e.isTextblock);let o,i;if(n.length>1)o=n[0],i=r.doc.textBetween(o.pos,o.pos+o.node.nodeSize,void 0," ");else if(n.length){const e=r.doc.textBetween(t.from,t.to," "," ");if(!Vo.test(e))return;o=n[0],i=r.doc.textBetween(o.pos,t.to,void 0," ")}if(o&&i){const t=i.split(Fo).filter(Boolean);if(t.length<=0)return!1;const n=t[t.length-1],l=o.pos+i.lastIndexOf(n);if(!n)return!1;const c=Ho(n).map(t=>t.toObject(e.defaultProtocol));if(!(1===(a=c).length?a[0].isLink:3===a.length&&a[1].isLink&&["()","[]"].includes(a[0].value+a[2].value)))return!1;c.filter(e=>e.isLink).map(e=>({...e,from:l+e.start+1,to:l+e.end+1})).filter(e=>!r.schema.marks.code||!r.doc.rangeHasMark(e.from,e.to,r.schema.marks.code)).filter(t=>e.validate(t.value)).filter(t=>e.shouldAutoLink(t.value)).forEach(t=>{(0,Ae.hO)(t.from,t.to,r.doc).some(t=>t.mark.type===e.type)||s.addMark(t.from,t.to,e.type.create({href:t.href}))})}var a}),s.steps.length?s:void 0}})}({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:e=>this.options.isAllowedUri(e,{defaultValidate:e=>!!Wo(e,t),protocols:t,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),!0===this.options.openOnClick&&e.push(function(e){return new we.k_({key:new we.hs("handleClickLink"),props:{handleClick:(t,n,r)=>{var o,i;if(0!==r.button)return!1;if(!t.editable)return!1;let s=r.target;const a=[];for(;"DIV"!==s.nodeName;)a.push(s),s=s.parentNode;if(!a.find(e=>"A"===e.nodeName))return!1;const l=(0,Ae.gu)(t.state,e.type.name),c=r.target,d=null!==(o=null==c?void 0:c.href)&&void 0!==o?o:l.href,p=null!==(i=null==c?void 0:c.target)&&void 0!==i?i:l.target;return!(!c||!d||(window.open(d,p),0))}}})}({type:this.type})),this.options.linkOnPaste&&e.push(function(e){return new we.k_({key:new we.hs("handlePasteLink"),props:{handlePaste:(t,n,r)=>{const{state:o}=t,{selection:i}=o,{empty:s}=i;if(s)return!1;let a="";r.content.forEach(e=>{a+=e.textContent});const l=jo(a,{defaultProtocol:e.defaultProtocol}).find(e=>e.isLink&&e.value===a);return!(!a||!l)&&e.editor.commands.setMark(e.type,{href:l.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),e}});let Xo,Zo;if("undefined"!=typeof WeakMap){let e=new WeakMap;Xo=t=>e.get(t),Zo=(t,n)=>(e.set(t,n),n)}else{let e=[],t=10,n=0;Xo=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},Zo=(r,o)=>(n==t&&(n=0),e[n++]=r,e[n++]=o)}class Ko{constructor(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r}}class Jo{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,o=t/this.width|0,i=r+1,s=o+1;for(let e=1;i<this.width&&this.map[t+e]==n;e++)i++;for(let e=1;s<this.height&&this.map[t+this.width*e]==n;e++)s++;return new Ko(r,o,i,s)}throw new RangeError("No cell with offset "+e+" found")}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError("No cell with offset "+e+" found")}nextCell(e,t,n){let{left:r,right:o,top:i,bottom:s}=this.findCell(e);return"horiz"==t?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:s==this.height)?null:this.map[r+this.width*(n<0?i-1:s)]}rectBetween(e,t){let{left:n,right:r,top:o,bottom:i}=this.findCell(e),{left:s,right:a,top:l,bottom:c}=this.findCell(t);return new Ko(Math.min(n,s),Math.min(o,l),Math.max(r,a),Math.max(i,c))}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let o=e.left;o<e.right;o++){let i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,o==e.left&&o&&this.map[i-1]==s||r==e.top&&r&&this.map[i-this.width]==s||t.push(s))}return t}positionAt(e,t,n){for(let r=0,o=0;;r++){let i=o+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<o;)n++;return n==r?i-1:this.map[n]}o=i}}static get(e){return Xo(e)||Zo(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);let t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let o=e.child(r),i=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let o=n.child(e);t+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){let t=o.child(e);i+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,s=[];for(let e=0,o=t*n;e<o;e++)r[e]=0;for(let a=0,l=0;a<n;a++){let c=e.child(a);l++;for(let e=0;;e++){for(;o<r.length&&0!=r[o];)o++;if(e==c.childCount)break;let d=c.child(e),{colspan:p,rowspan:u,colwidth:h}=d.attrs;for(let e=0;e<u;e++){if(e+a>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:l,n:u-e});break}let c=o+e*t;for(let e=0;e<p;e++){0==r[c+e]?r[c+e]=l:(i||(i=[])).push({type:"collision",row:a,pos:l,n:p-e});let n=h&&h[e];if(n){let r=(c+e)%t*2,o=s[r];null==o||o!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):o==n&&s[r+1]++}}}o+=p,l+=d.nodeSize}let d=(a+1)*t,p=0;for(;o<d;)0==r[o++]&&p++;p&&(i||(i=[])).push({type:"missing",row:a,n:p}),l++}let a=new Jo(t,n,r,i),l=!1;for(let e=0;!l&&e<s.length;e+=2)null!=s[e]&&s[e+1]<n&&(l=!0);l&&function(e,t,n){e.problems||(e.problems=[]);for(let r=0,o={};r<e.map.length;r++){let i=e.map[r];if(o[i])continue;o[i]=!0;let s=n.nodeAt(i),a=null;for(let n=0;n<s.attrs.colspan;n++){let o=t[2*((r+n)%e.width)];null==o||s.attrs.colwidth&&s.attrs.colwidth[n]==o||((a||(a=Go(s.attrs)))[n]=o)}a&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}(a,s,e);return a}(e))}}function Go(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}function Qo(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}}return t}const ei=new we.hs("selectingCells");function ti(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function ni(e){let t=e.selection.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function ri(e){let t=e.selection;return t.$anchorCell?t.$anchorCell.pos>t.$headCell.pos?t.$anchorCell:t.$headCell:t.node&&"cell"==t.node.type.spec.tableRole?t.$anchor:ti(t.$head)||function(e){for(let t=e.nodeAfter,n=e.pos;t;t=t.firstChild,n++){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n)}for(let t=e.nodeBefore,n=e.pos;t;t=t.lastChild,n--){let r=t.type.spec.tableRole;if("cell"==r||"header_cell"==r)return e.doc.resolve(n-t.nodeSize)}}(t.$head)}function oi(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function ii(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function si(e,t,n){let r=e.start(-1),o=Jo.get(e.node(-1)).nextCell(e.pos-r,t,n);return null==o?null:e.node(0).resolve(r+o)}function ai(e,t,n){let r={};for(let t in e)r[t]=e[t];return r[t]=n,r}function li(e,t,n=1){let r=ai(e,"colspan",e.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(t,n),r.colwidth.some(e=>e>0)||(r.colwidth=null)),r}function ci(e,t,n=1){let r=ai(e,"colspan",e.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(let e=0;e<n;e++)r.colwidth.splice(t,0,0)}return r}class di extends we.LN{constructor(e,t=e){let n=e.node(-1),r=Jo.get(n),o=e.start(-1),i=r.rectBetween(e.pos-o,t.pos-o),s=e.node(0),a=r.cellsInRect(i).filter(e=>e!=t.pos-o);a.unshift(t.pos-o);let l=a.map(e=>{let t=n.nodeAt(e),r=e+o+1;return new we.yn(s.resolve(r),s.resolve(r+t.content.size))});super(l[0].$from,l[0].$to,l),this.$anchorCell=e,this.$headCell=t}map(e,t){let n=e.resolve(t.map(this.$anchorCell.pos)),r=e.resolve(t.map(this.$headCell.pos));if(oi(n)&&oi(r)&&ii(n,r)){let e=this.$anchorCell.node(-1)!=n.node(-1);return e&&this.isRowSelection()?di.rowSelection(n,r):e&&this.isColSelection()?di.colSelection(n,r):new di(n,r)}return we.U3.between(n,r)}content(){let e=this.$anchorCell.node(-1),t=Jo.get(e),n=this.$anchorCell.start(-1),r=t.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),o={},i=[];for(let n=r.top;n<r.bottom;n++){let s=[];for(let i=n*t.width+r.left,a=r.left;a<r.right;a++,i++){let n=t.map[i];if(!o[n]){o[n]=!0;let i=t.findCell(n),a=e.nodeAt(n),l=r.left-i.left,c=i.right-r.right;if(l>0||c>0){let e=a.attrs;l>0&&(e=li(e,0,l)),c>0&&(e=li(e,e.colspan-c,c)),a=i.left<r.left?a.type.createAndFill(e):a.type.create(e,a.content)}if(i.top<r.top||i.bottom>r.bottom){let e=ai(a.attrs,"rowspan",Math.min(i.bottom,r.bottom)-Math.max(i.top,r.top));a=i.top<r.top?a.type.createAndFill(e):a.type.create(e,a.content)}s.push(a)}}i.push(e.child(n).copy(zn.FK.from(s)))}const s=this.isColSelection()&&this.isRowSelection()?e:i;return new zn.Ji(zn.FK.from(s),1,1)}replace(e,t=zn.Ji.empty){let n=e.steps.length,r=this.ranges;for(let o=0;o<r.length;o++){let{$from:i,$to:s}=r[o],a=e.mapping.slice(n);e.replace(a.map(i.pos),a.map(s.pos),o?zn.Ji.empty:t)}let o=we.LN.findFrom(e.doc.resolve(e.mapping.slice(n).map(this.to)),-1);o&&e.setSelection(o)}replaceWith(e,t){this.replace(e,new zn.Ji(zn.FK.from(t),0,0))}forEachCell(e){let t=this.$anchorCell.node(-1),n=Jo.get(t),r=this.$anchorCell.start(-1),o=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<o.length;n++)e(t.nodeAt(o[n]),r+o[n])}isColSelection(){let e=this.$anchorCell.index(-1),t=this.$headCell.index(-1);if(Math.min(e,t)>0)return!1;let n=e+this.$anchorCell.nodeAfter.attrs.rowspan,r=t+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(e,t=e){let n=Jo.get(e.node(-1)),r=e.start(-1),o=n.findCell(e.pos-r),i=n.findCell(t.pos-r),s=e.node(0);return o.top<=i.top?(o.top>0&&(e=s.resolve(r+n.map[o.left])),i.bottom<n.height&&(t=s.resolve(r+n.map[n.width*(n.height-1)+i.right-1]))):(i.top>0&&(t=s.resolve(r+n.map[i.left])),o.bottom<n.height&&(e=s.resolve(r+n.map[n.width*(n.height-1)+o.right-1]))),new di(e,t)}isRowSelection(){let e=Jo.get(this.$anchorCell.node(-1)),t=this.$anchorCell.start(-1),n=e.colCount(this.$anchorCell.pos-t),r=e.colCount(this.$headCell.pos-t);if(Math.min(n,r)>0)return!1;let o=n+this.$anchorCell.nodeAfter.attrs.colspan,i=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(o,i)==e.width}eq(e){return e instanceof di&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e,t=e){let n=Jo.get(e.node(-1)),r=e.start(-1),o=n.findCell(e.pos-r),i=n.findCell(t.pos-r),s=e.node(0);return o.left<=i.left?(o.left>0&&(e=s.resolve(r+n.map[o.top*n.width])),i.right<n.width&&(t=s.resolve(r+n.map[n.width*(i.top+1)-1]))):(i.left>0&&(t=s.resolve(r+n.map[i.top*n.width])),o.right<n.width&&(e=s.resolve(r+n.map[n.width*(o.top+1)-1]))),new di(e,t)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(e,t){return new di(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,n=t){return new di(e.resolve(t),e.resolve(n))}getBookmark(){return new pi(this.$anchorCell.pos,this.$headCell.pos)}}di.prototype.visible=!1,we.LN.jsonID("cell",di);class pi{constructor(e,t){this.anchor=e,this.head=t}map(e){return new pi(e.map(this.anchor),e.map(this.head))}resolve(e){let t=e.resolve(this.anchor),n=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&t.index()<t.parent.childCount&&n.index()<n.parent.childCount&&ii(t,n)?new di(t,n):we.LN.near(n,1)}}function ui(e){if(!(e.selection instanceof di))return null;let t=[];return e.selection.forEachCell((e,n)=>{t.push(ke.NZ.node(n,n+e.nodeSize,{class:"selectedCell"}))}),ke.zF.create(e.doc,t)}function hi(e){if(!e.size)return null;let{content:t,openStart:n,openEnd:r}=e;for(;1==t.childCount&&(n>0&&r>0||"table"==t.firstChild.type.spec.tableRole);)n--,r--,t=t.firstChild.content;let o=t.firstChild,i=o.type.spec.tableRole,s=o.type.schema,a=[];if("row"==i)for(let e=0;e<t.childCount;e++){let o=t.child(e).content,i=e?0:Math.max(0,n-1),l=e<t.childCount-1?0:Math.max(0,r-1);(i||l)&&(o=fi(Qo(s).row,new zn.Ji(o,i,l)).content),a.push(o)}else{if("cell"!=i&&"header_cell"!=i)return null;a.push(n||r?fi(Qo(s).row,new zn.Ji(t,n,r)).content:t)}return function(e,t){let n=[];for(let e=0;e<t.length;e++){let r=t[e];for(let t=r.childCount-1;t>=0;t--){let{rowspan:o,colspan:i}=r.child(t).attrs;for(let t=e;t<e+o;t++)n[t]=(n[t]||0)+i}}let r=0;for(let e=0;e<n.length;e++)r=Math.max(r,n[e]);for(let o=0;o<n.length;o++)if(o>=t.length&&t.push(zn.FK.empty),n[o]<r){let i=Qo(e).cell.createAndFill(),s=[];for(let e=n[o];e<r;e++)s.push(i);t[o]=t[o].append(zn.FK.from(s))}return{height:t.length,width:r,rows:t}}(s,a)}function fi(e,t){let n=e.createAndFill();return new Xe.dL(n).replace(0,n.content.size,t).doc}function mi(e,t,n,r,o,i,s,a){if(0==s||s==t.height)return!1;let l=!1;for(let c=o;c<i;c++){let o=s*t.width+c,i=t.map[o];if(t.map[o-t.width]==i){l=!0;let o=n.nodeAt(i),{top:d,left:p}=t.findCell(i);e.setNodeMarkup(e.mapping.slice(a).map(i+r),null,ai(o.attrs,"rowspan",s-d)),e.insert(e.mapping.slice(a).map(t.positionAt(s,p,n)),o.type.createAndFill(ai(o.attrs,"rowspan",d+o.attrs.rowspan-s))),c+=o.attrs.colspan-1}}return l}function gi(e,t,n,r,o,i,s,a){if(0==s||s==t.width)return!1;let l=!1;for(let c=o;c<i;c++){let o=c*t.width+s,i=t.map[o];if(t.map[o-1]==i){l=!0;let o=n.nodeAt(i),d=t.colCount(i),p=e.mapping.slice(a).map(i+r);e.setNodeMarkup(p,null,li(o.attrs,s-d,o.attrs.colspan-(s-d))),e.insert(p+o.nodeSize,o.type.createAndFill(li(o.attrs,0,s-d))),c+=o.attrs.rowspan-1}}return l}function bi(e,t,n,r,o){let i=n?e.doc.nodeAt(n-1):e.doc,s=Jo.get(i),{top:a,left:l}=r,c=l+o.width,d=a+o.height,p=e.tr,u=0;function h(){i=n?p.doc.nodeAt(n-1):p.doc,s=Jo.get(i),u=p.mapping.maps.length}(function(e,t,n,r,o,i,s){let a,l,c=Qo(e.doc.type.schema);if(o>t.width)for(let i=0,d=0;i<t.height;i++){let p=n.child(i);d+=p.nodeSize;let u,h=[];u=null==p.lastChild||p.lastChild.type==c.cell?a||(a=c.cell.createAndFill()):l||(l=c.header_cell.createAndFill());for(let e=t.width;e<o;e++)h.push(u);e.insert(e.mapping.slice(s).map(d-1+r),h)}if(i>t.height){let d=[];for(let e=0,r=(t.height-1)*t.width;e<Math.max(t.width,o);e++){let o=!(e>=t.width)&&n.nodeAt(t.map[r+e]).type==c.header_cell;d.push(o?l||(l=c.header_cell.createAndFill()):a||(a=c.cell.createAndFill()))}let p=c.row.create(null,zn.FK.from(d)),u=[];for(let e=t.height;e<i;e++)u.push(p);e.insert(e.mapping.slice(s).map(r+n.nodeSize-2),u)}return!(!a&&!l)})(p,s,i,n,c,d,u)&&h(),mi(p,s,i,n,l,c,a,u)&&h(),mi(p,s,i,n,l,c,d,u)&&h(),gi(p,s,i,n,a,d,l,u)&&h(),gi(p,s,i,n,a,d,c,u)&&h();for(let e=a;e<d;e++){let t=s.positionAt(e,l,i),r=s.positionAt(e,c,i);p.replace(p.mapping.slice(u).map(t+n),p.mapping.slice(u).map(r+n),new zn.Ji(o.rows[e-a],0,0))}h(),p.setSelection(new di(p.doc.resolve(n+s.positionAt(a,l,i)),p.doc.resolve(n+s.positionAt(d-1,c-1,i)))),t(p)}const yi=(0,Dn.K)({ArrowLeft:wi("horiz",-1),ArrowRight:wi("horiz",1),ArrowUp:wi("vert",-1),ArrowDown:wi("vert",1),"Shift-ArrowLeft":vi("horiz",-1),"Shift-ArrowRight":vi("horiz",1),"Shift-ArrowUp":vi("vert",-1),"Shift-ArrowDown":vi("vert",1),Backspace:xi,"Mod-Backspace":xi,Delete:xi,"Mod-Delete":xi});function Ai(e,t,n){return!n.eq(e.selection)&&(t&&t(e.tr.setSelection(n).scrollIntoView()),!0)}function wi(e,t){return(n,r,o)=>{let i=n.selection;if(i instanceof di)return Ai(n,r,we.LN.near(i.$headCell,t));if("horiz"!=e&&!i.empty)return!1;let s=Ei(o,e,t);if(null==s)return!1;if("horiz"==e)return Ai(n,r,we.LN.near(n.doc.resolve(i.head+t),t));{let o,i=n.doc.resolve(s),a=si(i,e,t);return o=a?we.LN.near(a,1):t<0?we.LN.near(n.doc.resolve(i.before(-1)),-1):we.LN.near(n.doc.resolve(i.after(-1)),1),Ai(n,r,o)}}}function vi(e,t){return(n,r,o)=>{let i=n.selection;if(!(i instanceof di)){let r=Ei(o,e,t);if(null==r)return!1;i=new di(n.doc.resolve(r))}let s=si(i.$headCell,e,t);return!!s&&Ai(n,r,new di(i.$anchorCell,s))}}function xi(e,t){let n=e.selection;if(!(n instanceof di))return!1;if(t){let r=e.tr,o=Qo(e.schema).cell.createAndFill().content;n.forEachCell((e,t)=>{e.content.eq(o)||r.replace(r.mapping.map(t+1),r.mapping.map(t+e.nodeSize-1),new zn.Ji(o,0,0))}),r.docChanged&&t(r)}return!0}function ki(e,t){let n=ti(e.state.doc.resolve(t));return!!n&&(e.dispatch(e.state.tr.setSelection(new di(n))),!0)}function Ci(e,t,n){if(!ni(e.state))return!1;let r=hi(n),o=e.state.selection;if(o instanceof di){r||(r={width:1,height:1,rows:[zn.FK.from(fi(Qo(e.state.schema).cell,n))]});let t=o.$anchorCell.node(-1),i=o.$anchorCell.start(-1),s=Jo.get(t).rectBetween(o.$anchorCell.pos-i,o.$headCell.pos-i);return r=function({width:e,height:t,rows:n},r,o){if(e!=r){let t=[],o=[];for(let e=0;e<n.length;e++){let i=n[e],s=[];for(let n=t[e]||0,o=0;n<r;o++){let a=i.child(o%i.childCount);n+a.attrs.colspan>r&&(a=a.type.create(li(a.attrs,a.attrs.colspan,n+a.attrs.colspan-r),a.content)),s.push(a),n+=a.attrs.colspan;for(let n=1;n<a.attrs.rowspan;n++)t[e+n]=(t[e+n]||0)+a.attrs.colspan}o.push(zn.FK.from(s))}n=o,e=r}if(t!=o){let e=[];for(let r=0,i=0;r<o;r++,i++){let s=[],a=n[i%t];for(let e=0;e<a.childCount;e++){let t=a.child(e);r+t.attrs.rowspan>o&&(t=t.type.create(ai(t.attrs,"rowspan",Math.max(1,o-t.attrs.rowspan)),t.content)),s.push(t)}e.push(zn.FK.from(s))}n=e,t=o}return{width:e,height:t,rows:n}}(r,s.right-s.left,s.bottom-s.top),bi(e.state,e.dispatch,i,s,r),!0}if(r){let t=ri(e.state),n=t.start(-1);return bi(e.state,e.dispatch,n,Jo.get(t.node(-1)).findCell(t.pos-n),r),!0}return!1}function _i(e,t){if(t.ctrlKey||t.metaKey)return;let n,r=Si(e,t.target);if(t.shiftKey&&e.state.selection instanceof di)o(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&r&&null!=(n=ti(e.state.selection.$anchor))&&Bi(e,t).pos!=n.pos)o(n,t),t.preventDefault();else if(!r)return;function o(t,n){let r=Bi(e,n),o=null==ei.getState(e.state);if(!r||!ii(t,r)){if(!o)return;r=t}let i=new di(t,r);if(o||!e.state.selection.eq(i)){let n=e.state.tr.setSelection(i);o&&n.setMeta(ei,t.pos),e.dispatch(n)}}function i(){e.root.removeEventListener("mouseup",i),e.root.removeEventListener("dragstart",i),e.root.removeEventListener("mousemove",s),null!=ei.getState(e.state)&&e.dispatch(e.state.tr.setMeta(ei,-1))}function s(n){let s,a=ei.getState(e.state);if(null!=a)s=e.state.doc.resolve(a);else if(Si(e,n.target)!=r&&(s=Bi(e,t),!s))return i();s&&o(s,n)}e.root.addEventListener("mouseup",i),e.root.addEventListener("dragstart",i),e.root.addEventListener("mousemove",s)}function Ei(e,t,n){if(!(e.state.selection instanceof we.U3))return null;let{$head:r}=e.state.selection;for(let o=r.depth-1;o>=0;o--){let i=r.node(o);if((n<0?r.index(o):r.indexAfter(o))!=(n<0?0:i.childCount))return null;if("cell"==i.type.spec.tableRole||"header_cell"==i.type.spec.tableRole){let i=r.before(o),s="vert"==t?n>0?"down":"up":n>0?"right":"left";return e.endOfTextblock(s)?i:null}}return null}function Si(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function Bi(e,t){let n=e.posAtCoords({left:t.clientX,top:t.clientY});return n&&n?ti(e.state.doc.resolve(n.pos)):null}const Mi=new we.hs("fix-tables");function Oi(e,t,n,r){let o=e.childCount,i=t.childCount;e:for(let s=0,a=0;s<i;s++){let i=t.child(s);for(let t=a,r=Math.min(o,s+3);t<r;t++)if(e.child(t)==i){a=t+1,n+=i.nodeSize;continue e}r(i,n),a<o&&e.child(a).sameMarkup(i)?Oi(e.child(a),i,n+1,r):i.nodesBetween(0,i.content.size,r,n+1),n+=i.nodeSize}}function Ii(e,t){let n,r=(t,r)=>{"table"==t.type.spec.tableRole&&(n=function(e,t,n,r){let o=Jo.get(t);if(!o.problems)return r;r||(r=e.tr);let i,s,a=[];for(let e=0;e<o.height;e++)a.push(0);for(let e=0;e<o.problems.length;e++){let i=o.problems[e];if("collision"==i.type){let e=t.nodeAt(i.pos);for(let t=0;t<e.attrs.rowspan;t++)a[i.row+t]+=i.n;r.setNodeMarkup(r.mapping.map(n+1+i.pos),null,li(e.attrs,e.attrs.colspan-i.n,i.n))}else if("missing"==i.type)a[i.row]+=i.n;else if("overlong_rowspan"==i.type){let e=t.nodeAt(i.pos);r.setNodeMarkup(r.mapping.map(n+1+i.pos),null,ai(e.attrs,"rowspan",e.attrs.rowspan-i.n))}else if("colwidth mismatch"==i.type){let e=t.nodeAt(i.pos);r.setNodeMarkup(r.mapping.map(n+1+i.pos),null,ai(e.attrs,"colwidth",i.colwidth))}}for(let e=0;e<a.length;e++)a[e]&&(null==i&&(i=e),s=e);for(let l=0,c=n+1;l<o.height;l++){let n=t.child(l),o=c+n.nodeSize,d=a[l];if(d>0){let t="cell";n.firstChild&&(t=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<d;n++)a.push(Qo(e.schema)[t].createAndFill());let p=0!=l&&i!=l-1||s!=l?o-1:c+1;r.insert(r.mapping.map(p),a)}c=o}return r.setMeta(Mi,{fixTables:!0})}(e,t,r,n))};return t?t.doc!=e.doc&&Oi(t.doc,e.doc,0,r):e.doc.descendants(r),n}function Ti(e){let t,n=e.selection,r=ri(e),o=r.node(-1),i=r.start(-1),s=Jo.get(o);return t=n instanceof di?s.rectBetween(n.$anchorCell.pos-i,n.$headCell.pos-i):s.findCell(r.pos-i),t.tableStart=i,t.map=s,t.table=o,t}function Li(e,{map:t,tableStart:n,table:r},o){let i=o>0?-1:0;(function(e,t,n){let r=Qo(t.type.schema).header_cell;for(let o=0;o<e.height;o++)if(t.nodeAt(e.map[n+o*e.width]).type!=r)return!1;return!0})(t,r,o+i)&&(i=0==o||o==t.width?null:0);for(let s=0;s<t.height;s++){let a=s*t.width+o;if(o>0&&o<t.width&&t.map[a-1]==t.map[a]){let i=t.map[a],l=r.nodeAt(i);e.setNodeMarkup(e.mapping.map(n+i),null,ci(l.attrs,o-t.colCount(i))),s+=l.attrs.rowspan-1}else{let l=null==i?Qo(r.type.schema).cell:r.nodeAt(t.map[a+i]).type,c=t.positionAt(s,o,r);e.insert(e.mapping.map(n+c),l.createAndFill())}}return e}function Ni(e,{map:t,table:n,tableStart:r},o){let i=e.mapping.maps.length;for(let s=0;s<t.height;){let a=s*t.width+o,l=t.map[a],c=n.nodeAt(l);if(o>0&&t.map[a-1]==l||o<t.width-1&&t.map[a+1]==l)e.setNodeMarkup(e.mapping.slice(i).map(r+l),null,li(c.attrs,o-t.colCount(l)));else{let t=e.mapping.slice(i).map(r+l);e.delete(t,t+c.nodeSize)}s+=c.attrs.rowspan}}function Ri(e,{map:t,tableStart:n,table:r},o){let i=n;for(let e=0;e<o;e++)i+=r.child(e).nodeSize;let s=[],a=o>0?-1:0;(function(e,t,n){let r=Qo(t.type.schema).header_cell;for(let o=0;o<e.width;o++)if(t.nodeAt(e.map[o+n*e.width]).type!=r)return!1;return!0})(t,r,o+a)&&(a=0==o||o==t.height?null:0);for(let i=0,l=t.width*o;i<t.width;i++,l++)if(o>0&&o<t.height&&t.map[l]==t.map[l-t.width]){let o=t.map[l],s=r.nodeAt(o).attrs;e.setNodeMarkup(n+o,null,ai(s,"rowspan",s.rowspan+1)),i+=s.colspan-1}else{let e=null==a?Qo(r.type.schema).cell:r.nodeAt(t.map[l+a*t.width]).type;s.push(e.createAndFill())}return e.insert(i,Qo(r.type.schema).row.create(null,s)),e}function Di(e,{map:t,table:n,tableStart:r},o){let i=0;for(let e=0;e<o;e++)i+=n.child(e).nodeSize;let s=i+n.child(o).nodeSize,a=e.mapping.maps.length;e.delete(i+r,s+r);for(let i=0,s=o*t.width;i<t.width;i++,s++){let l=t.map[s];if(o>0&&l==t.map[s-t.width]){let t=n.nodeAt(l).attrs;e.setNodeMarkup(e.mapping.slice(a).map(l+r),null,ai(t,"rowspan",t.rowspan-1)),i+=t.colspan-1}else if(o<t.width&&l==t.map[s+t.width]){let s=n.nodeAt(l),c=s.type.create(ai(s.attrs,"rowspan",s.attrs.rowspan-1),s.content),d=t.positionAt(o+1,i,n);e.insert(e.mapping.slice(a).map(r+d),c),i+=s.attrs.colspan-1}}}function zi(e){let t=e.content;return 1==t.childCount&&t.firstChild.isTextblock&&0==t.firstChild.childCount}function Pi(e,t){let n=e.selection;if(!(n instanceof di)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Ti(e),{map:o}=r;if(function({width:e,height:t,map:n},r){let o=r.top*e+r.left,i=o,s=(r.bottom-1)*e+r.left,a=o+(r.right-r.left-1);for(let t=r.top;t<r.bottom;t++){if(r.left>0&&n[i]==n[i-1]||r.right<e&&n[a]==n[a+1])return!0;i+=e,a+=e}for(let i=r.left;i<r.right;i++){if(r.top>0&&n[o]==n[o-e]||r.bottom<t&&n[s]==n[s+e])return!0;o++,s++}return!1}(o,r))return!1;if(t){let n,i,s=e.tr,a={},l=zn.FK.empty;for(let e=r.top;e<r.bottom;e++)for(let t=r.left;t<r.right;t++){let c=o.map[e*o.width+t],d=r.table.nodeAt(c);if(!a[c])if(a[c]=!0,null==n)n=c,i=d;else{zi(d)||(l=l.append(d.content));let e=s.mapping.map(c+r.tableStart);s.delete(e,e+d.nodeSize)}}if(s.setNodeMarkup(n+r.tableStart,null,ai(ci(i.attrs,i.attrs.colspan,r.right-r.left-i.attrs.colspan),"rowspan",r.bottom-r.top)),l.size){let e=n+1+i.content.size,t=zi(i)?n+1:e;s.replaceWith(t+r.tableStart,e+r.tableStart,l)}s.setSelection(new di(s.doc.resolve(n+r.tableStart))),t(s)}return!0}function $i(e,t){const n=Qo(e.schema);return(r=({node:e})=>n[e.type.spec.tableRole],(e,t)=>{let n,o,i=e.selection;if(i instanceof di){if(i.$anchorCell.pos!=i.$headCell.pos)return!1;n=i.$anchorCell.nodeAfter,o=i.$anchorCell.pos}else{if(n=function(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.spec.tableRole;if("cell"===n||"header_cell"===n)return e.node(t)}return null}(i.$from),!n)return!1;o=ti(i.$from).pos}if(1==n.attrs.colspan&&1==n.attrs.rowspan)return!1;if(t){let s=n.attrs,a=[],l=s.colwidth;s.rowspan>1&&(s=ai(s,"rowspan",1)),s.colspan>1&&(s=ai(s,"colspan",1));let c,d=Ti(e),p=e.tr;for(let e=0;e<d.right-d.left;e++)a.push(l?ai(s,"colwidth",l&&l[e]?[l[e]]:null):s);for(let e=d.top;e<d.bottom;e++){let t=d.map.positionAt(e,d.left,d.table);e==d.top&&(t+=n.nodeSize);for(let o=d.left,i=0;o<d.right;o++,i++)o==d.left&&e==d.top||p.insert(c=p.mapping.map(t+d.tableStart,1),r({node:n,row:e,col:o}).createAndFill(a[i]))}p.setNodeMarkup(o,r({node:n,row:d.top,col:d.left}),a[0]),i instanceof di&&p.setSelection(new di(p.doc.resolve(i.$anchorCell.pos),c&&p.doc.resolve(c))),t(p)}return!0})(e,t);var r}function Hi(e,t,n){const r=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;e<r.length;e++){const o=t.table.nodeAt(r[e]);if(o&&o.type!==n.header_cell)return!1}return!0}function ji(e,t){return(t=t||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(e){return function(t,n){if(!ni(t))return!1;if(n){let r=Qo(t.schema),o=Ti(t),i=t.tr,s=o.map.cellsInRect("column"==e?new Ko(o.left,0,o.right,o.map.height):"row"==e?new Ko(0,o.top,o.map.width,o.bottom):o),a=s.map(e=>o.table.nodeAt(e));for(let e=0;e<s.length;e++)a[e].type==r.header_cell&&i.setNodeMarkup(o.tableStart+s[e],r.cell,a[e].attrs);if(0==i.steps.length)for(let e=0;e<s.length;e++)i.setNodeMarkup(o.tableStart+s[e],r.header_cell,a[e].attrs);n(i)}return!0}}(e):function(t,n){if(!ni(t))return!1;if(n){let r=Qo(t.schema),o=Ti(t),i=t.tr,s=Hi("row",o,r),a=Hi("column",o,r),l=("column"===e?s:"row"===e&&a)?1:0,c="column"==e?new Ko(0,l,1,o.map.height):"row"==e?new Ko(l,0,o.map.width,1):o,d="column"==e?a?r.cell:r.header_cell:"row"==e?s?r.cell:r.header_cell:r.cell;o.map.cellsInRect(c).forEach(e=>{const t=e+o.tableStart,n=i.doc.nodeAt(t);n&&i.setNodeMarkup(t,d,n.attrs)}),n(i)}return!0}}ji("row",{useDeprecatedLogic:!0}),ji("column",{useDeprecatedLogic:!0});let Ui=ji("cell",{useDeprecatedLogic:!0});function Fi(e){return function(t,n){if(!ni(t))return!1;let r=function(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,n=e.before();t>=0;t--){let r=e.node(-1).child(t);if(r.childCount)return n-1-r.lastChild.nodeSize;n-=r.nodeSize}}else{if(e.index()<e.parent.childCount-1)return e.pos+e.nodeAfter.nodeSize;let t=e.node(-1);for(let n=e.indexAfter(-1),r=e.after();n<t.childCount;n++){let e=t.child(n);if(e.childCount)return r+1;r+=e.nodeSize}}}(ri(t),e);if(null!=r){if(n){let e=t.doc.resolve(r);n(t.tr.setSelection(we.U3.between(e,(o=e,o.node(0).resolve(o.pos+o.nodeAfter.nodeSize)))).scrollIntoView())}var o;return!0}}}class Vi{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.colgroup=this.table.appendChild(document.createElement("colgroup")),qi(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type==this.node.type&&(this.node=e,qi(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return"attributes"==e.type&&(e.target==this.table||this.colgroup.contains(e.target))}}function qi(e,t,n,r,o,i){let s=0,a=!0,l=t.firstChild,c=e.firstChild;for(let e=0,n=0;e<c.childCount;e++){let{colspan:d,colwidth:p}=c.child(e).attrs;for(let e=0;e<d;e++,n++){let c=o==n?i:p&&p[e],d=c?c+"px":"";s+=c||r,c||(a=!1),l?(l.style.width!=d&&(l.style.width=d),l=l.nextSibling):t.appendChild(document.createElement("col")).style.width=d}}for(;l;){let e=l.nextSibling;l.parentNode.removeChild(l),l=e}a?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}const Wi=new we.hs("tableColumnResizing");function Yi({handleWidth:e=5,cellMinWidth:t=25,View:n=Vi,lastColumnResizable:r=!0}={}){let o=new we.k_({key:Wi,state:{init(e,r){return this.spec.props.nodeViews[Qo(r.schema).table.name]=(e,r)=>new n(e,t,r),new Xi(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>Wi.getState(e).activeHandle>-1?{class:"resize-cursor"}:null,handleDOMEvents:{mousemove(t,n){!function(e,t,n,r,o){let i=Wi.getState(e.state);if(!i.dragging){let r=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),s=-1;if(r){let{left:o,right:i}=r.getBoundingClientRect();t.clientX-o<=n?s=Zi(e,t,"left"):i-t.clientX<=n&&(s=Zi(e,t,"right"))}if(s!=i.activeHandle){if(!o&&-1!==s){let t=e.state.doc.resolve(s),n=t.node(-1),r=Jo.get(n),o=t.start(-1);if(r.colCount(t.pos-o)+t.nodeAfter.attrs.colspan-1==r.width-1)return}Ji(e,s)}}}(t,n,e,0,r)},mouseleave(e){!function(e){let t=Wi.getState(e.state);t.activeHandle>-1&&!t.dragging&&Ji(e,-1)}(e)},mousedown(e,n){!function(e,t,n){let r=Wi.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;let o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,{colspan:n,colwidth:r}){let o=r&&r[r.length-1];if(o)return o;let i=e.domAtPos(t),s=i.node.childNodes[i.offset],a=s.offsetWidth,l=n;if(r)for(let e=0;e<n;e++)r[e]&&(a-=r[e],l--);return a/l}(e,r.activeHandle,o.attrs);function s(t){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);let r=Wi.getState(e.state);r.dragging&&(!function(e,t,n){let r=e.state.doc.resolve(t),o=r.node(-1),i=Jo.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let e=0;e<i.height;e++){let t=e*i.width+a;if(e&&i.map[t]==i.map[t-i.width])continue;let r=i.map[t],{attrs:c}=o.nodeAt(r),d=1==c.colspan?0:a-i.colCount(r);if(c.colwidth&&c.colwidth[d]==n)continue;let p=c.colwidth?c.colwidth.slice():Gi(c.colspan);p[d]=n,l.setNodeMarkup(s+r,null,ai(c,"colwidth",p))}l.docChanged&&e.dispatch(l)}(e,r.activeHandle,Ki(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(Wi,{setDragging:null})))}function a(t){if(!t.which)return s(t);let r=Wi.getState(e.state),o=Ki(r.dragging,t,n);!function(e,t,n,r){let o=e.state.doc.resolve(t),i=o.node(-1),s=o.start(-1),a=Jo.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,l=e.domAtPos(o.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;qi(i,l.firstChild,l,r,a,n)}(e,r.activeHandle,o,n)}e.dispatch(e.state.tr.setMeta(Wi,{setDragging:{startX:t.clientX,startWidth:i}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),t.preventDefault()}(e,n,t)}},decorations(e){let t=Wi.getState(e);if(t.activeHandle>-1)return function(e,t){let n=[],r=e.doc.resolve(t),o=r.node(-1),i=Jo.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan;for(let e=0;e<i.height;e++){let t=a+e*i.width-1;if(!(a!=i.width&&i.map[t]==i.map[t+1]||0!=e&&i.map[t-1]==i.map[t-1-i.width])){let e=i.map[t],r=s+e+o.nodeAt(e).nodeSize-1,a=document.createElement("div");a.className="column-resize-handle",n.push(ke.NZ.widget(r,a))}}return ke.zF.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}});return o}class Xi{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){let t=this,n=e.getMeta(Wi);if(n&&null!=n.setHandle)return new Xi(n.setHandle,null);if(n&&void 0!==n.setDragging)return new Xi(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){let n=e.mapping.map(t.activeHandle,-1);oi(e.doc.resolve(n))||(n=null),t=new Xi(n,t.dragging)}return t}}function Zi(e,t,n){let r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;let{pos:o}=r,i=ti(e.state.doc.resolve(o));if(!i)return-1;if("right"==n)return i.pos;let s=Jo.get(i.node(-1)),a=i.start(-1),l=s.map.indexOf(i.pos-a);return l%s.width==0?-1:a+s.map[l-1]}function Ki(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function Ji(e,t){e.dispatch(e.state.tr.setMeta(Wi,{setHandle:t}))}function Gi(e){let t=[];for(let n=0;n<e;n++)t.push(0);return t}function Qi({allowTableNodeSelection:e=!1}={}){return new we.k_({key:ei,state:{init:()=>null,apply(e,t){let n=e.getMeta(ei);if(null!=n)return-1==n?null:n;if(null==t||!e.docChanged)return t;let{deleted:r,pos:o}=e.mapping.mapResult(t);return r?null:o}},props:{decorations:ui,handleDOMEvents:{mousedown:_i},createSelectionBetween(e){if(null!=ei.getState(e.state))return e.state.selection},handleTripleClick:ki,handleKeyDown:yi,handlePaste:Ci},appendTransaction:(t,n,r)=>function(e,t,n){let r,o,i=(t||e).selection,s=(t||e).doc;if(i instanceof we.nh&&(o=i.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)r=di.create(s,i.from);else if("row"==o){let e=s.resolve(i.from+1);r=di.rowSelection(e,e)}else if(!n){let e=Jo.get(i.node),t=i.from+1,n=t+e.map[e.width*e.height-1];r=di.create(s,t+1,n)}}else i instanceof we.U3&&function({$from:e,$to:t}){if(e.pos==t.pos||e.pos<e.pos-6)return!1;let n=e.pos,r=t.pos,o=e.depth;for(;o>=0&&!(e.after(o+1)<e.end(o));o--,n++);for(let e=t.depth;e>=0&&!(t.before(e+1)>t.start(e));e--,r--);return n==r&&/row|table/.test(e.node(o).type.spec.tableRole)}(i)?r=we.U3.create(s,i.from):i instanceof we.U3&&function({$from:e,$to:t}){let n,r;for(let t=e.depth;t>0;t--){let r=e.node(t);if("cell"===r.type.spec.tableRole||"header_cell"===r.type.spec.tableRole){n=r;break}}for(let e=t.depth;e>0;e--){let n=t.node(e);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){r=n;break}}return n!==r&&0===t.parentOffset}(i)&&(r=we.U3.create(s,i.$from.start(),i.$from.end()));return r&&(t||(t=e.tr)).setSelection(r),t}(r,Ii(r,n),e)})}function es(e,t){return t?e.createChecked(null,t):e.createAndFill()}function ts(e,t,n,r,o){const i=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;const t={};return Object.keys(e.nodes).forEach(n=>{const r=e.nodes[n];r.spec.tableRole&&(t[r.spec.tableRole]=r)}),e.cached.tableNodeTypes=t,t}(e),s=[],a=[];for(let e=0;e<n;e+=1){const e=es(i.cell,o);if(e&&a.push(e),r){const e=es(i.header_cell,o);e&&s.push(e)}}const l=[];for(let e=0;e<t;e+=1)l.push(i.row.createChecked(null,r&&0===e?s:a));return i.table.createChecked(null,l)}const ns=e=>{let{editor:t}=e;const{selection:n}=t.state;if(!(n instanceof di))return!1;let r=0;const o=(0,Ae.eL)(n.ranges[0].$from,e=>"table"===e.type.name);o?.node.descendants(e=>{if("table"===e.type.name)return!1;["tableCell","tableHeader"].includes(e.type.name)&&(r+=1)});return r===n.ranges.length&&(t.commands.deleteTable(),!0)};function rs(e,t,n,r,o,i){let s=0,a=!0,l=t.firstChild;const c=e.firstChild;for(let e=0,n=0;e<c.childCount;e+=1){const{colspan:d,colwidth:p}=c.child(e).attrs;for(let e=0;e<d;e+=1,n+=1){const c=o===n?i:p&&p[e],d=c?`${c}px`:"";s+=c||r,c||(a=!1),l?(l.style.width!==d&&(l.style.width=d),l=l.nextSibling):t.appendChild(document.createElement("col")).style.width=d}}for(;l;){const e=l.nextSibling;l.parentNode.removeChild(l),l=e}n.style.width="50%"}class os{constructor(e,t){this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.style.margin="auto",this.colgroup=this.table.appendChild(document.createElement("colgroup")),rs(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type===this.node.type&&(this.node=e,rs(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return"attributes"===e.type&&(e.target===this.table||this.colgroup.contains(e.target))}}function is(e,t,n,r,o,i){let s=0,a=!0,l=t.firstChild;const c=e.firstChild;for(let e=0,n=0;e<c.childCount;e+=1){const{colspan:d,colwidth:p}=c.child(e).attrs;for(let e=0;e<d;e+=1,n+=1){const c=o===n?i:p&&p[e],d=c?`${c}px`:"";s+=c||r,c||(a=!1),l?(l.style.width!==d&&(l.style.width=d),l=l.nextSibling):t.appendChild(document.createElement("col")).style.width=d}}for(;l;){const e=l.nextSibling;l.parentNode.removeChild(l),l=e}}class ss{constructor(e,t,n,r){const{width:o}=r;this.node=e,this.cellMinWidth=t,this.dom=document.createElement("div"),this.dom.className="tableWrapper",this.table=this.dom.appendChild(document.createElement("table")),this.table.classList.add("cdtr-table-element"),this.table.style.margin="auto",this.table.style.width=o,this.colgroup=this.table.appendChild(document.createElement("colgroup")),is(e,this.colgroup,this.table,t),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(e){return e.type===this.node.type&&(this.node=e,is(e,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(e){return"attributes"===e.type&&(e.target===this.table||this.colgroup.contains(e.target))}}let as,ls;if("undefined"!=typeof WeakMap){let e=new WeakMap;as=t=>e.get(t),ls=(t,n)=>(e.set(t,n),n)}else{let e=[],t=10,n=0;as=t=>{for(let n=0;n<e.length;n+=2)if(e[n]==t)return e[n+1]},ls=(r,o)=>(n==t&&(n=0),e[n++]=r,e[n++]=o)}class cs{constructor(e,t,n,r){this.left=e,this.top=t,this.right=n,this.bottom=r}}class ds{constructor(e,t,n,r){this.width=e,this.height=t,this.map=n,this.problems=r}findCell(e){for(let t=0;t<this.map.length;t++){let n=this.map[t];if(n!=e)continue;let r=t%this.width,o=t/this.width|0,i=r+1,s=o+1;for(let e=1;i<this.width&&this.map[t+e]==n;e++)i++;for(let e=1;s<this.height&&this.map[t+this.width*e]==n;e++)s++;return new cs(r,o,i,s)}throw new RangeError("No cell with offset "+e+" found")}colCount(e){for(let t=0;t<this.map.length;t++)if(this.map[t]==e)return t%this.width;throw new RangeError("No cell with offset "+e+" found")}nextCell(e,t,n){let{left:r,right:o,top:i,bottom:s}=this.findCell(e);return"horiz"==t?(n<0?0==r:o==this.width)?null:this.map[i*this.width+(n<0?r-1:o)]:(n<0?0==i:s==this.height)?null:this.map[r+this.width*(n<0?i-1:s)]}rectBetween(e,t){let{left:n,right:r,top:o,bottom:i}=this.findCell(e),{left:s,right:a,top:l,bottom:c}=this.findCell(t);return new cs(Math.min(n,s),Math.min(o,l),Math.max(r,a),Math.max(i,c))}cellsInRect(e){let t=[],n={};for(let r=e.top;r<e.bottom;r++)for(let o=e.left;o<e.right;o++){let i=r*this.width+o,s=this.map[i];n[s]||(n[s]=!0,o==e.left&&o&&this.map[i-1]==s||r==e.top&&r&&this.map[i-this.width]==s||t.push(s))}return t}positionAt(e,t,n){for(let r=0,o=0;;r++){let i=o+n.child(r).nodeSize;if(r==e){let n=t+e*this.width,r=(e+1)*this.width;for(;n<r&&this.map[n]<o;)n++;return n==r?i-1:this.map[n]}o=i}}static get(e){return as(e)||ls(e,function(e){if("table"!=e.type.spec.tableRole)throw new RangeError("Not a table node: "+e.type.name);let t=function(e){let t=-1,n=!1;for(let r=0;r<e.childCount;r++){let o=e.child(r),i=0;if(n)for(let t=0;t<r;t++){let n=e.child(t);for(let e=0;e<n.childCount;e++){let o=n.child(e);t+o.attrs.rowspan>r&&(i+=o.attrs.colspan)}}for(let e=0;e<o.childCount;e++){let t=o.child(e);i+=t.attrs.colspan,t.attrs.rowspan>1&&(n=!0)}-1==t?t=i:t!=i&&(t=Math.max(t,i))}return t}(e),n=e.childCount,r=[],o=0,i=null,s=[];for(let e=0,o=t*n;e<o;e++)r[e]=0;for(let a=0,l=0;a<n;a++){let c=e.child(a);l++;for(let e=0;;e++){for(;o<r.length&&0!=r[o];)o++;if(e==c.childCount)break;let d=c.child(e),{colspan:p,rowspan:u,colwidth:h}=d.attrs;for(let e=0;e<u;e++){if(e+a>=n){(i||(i=[])).push({type:"overlong_rowspan",pos:l,n:u-e});break}let c=o+e*t;for(let e=0;e<p;e++){0==r[c+e]?r[c+e]=l:(i||(i=[])).push({type:"collision",row:a,pos:l,n:p-e});let n=h&&h[e];if(n){let r=(c+e)%t*2,o=s[r];null==o||o!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):o==n&&s[r+1]++}}}o+=p,l+=d.nodeSize}let d=(a+1)*t,p=0;for(;o<d;)0==r[o++]&&p++;p&&(i||(i=[])).push({type:"missing",row:a,n:p}),l++}let a=new ds(t,n,r,i),l=!1;for(let e=0;!l&&e<s.length;e+=2)null!=s[e]&&s[e+1]<n&&(l=!0);l&&function(e,t,n){e.problems||(e.problems=[]);for(let r=0,o={};r<e.map.length;r++){let i=e.map[r];if(o[i])continue;o[i]=!0;let s=n.nodeAt(i),a=null;for(let n=0;n<s.attrs.colspan;n++){let o=t[2*((r+n)%e.width)];null==o||s.attrs.colwidth&&s.attrs.colwidth[n]==o||((a||(a=ps(s.attrs)))[n]=o)}a&&e.problems.unshift({type:"colwidth mismatch",pos:i,colwidth:a})}}(a,s,e);return a}(e))}}function ps(e){if(e.colwidth)return e.colwidth.slice();let t=[];for(let n=0;n<e.colspan;n++)t.push(0);return t}new we.hs("selectingCells");function us(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function hs(e,t,n){let r={};for(let t in e)r[t]=e[t];return r[t]=n,r}const fs=new we.hs("tableColumnSimple");function ms(){let{handleWidth:e=5,cellMinWidth:t=25,width:n="100%",View:r=ss,lastColumnResizable:o=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=new we.k_({key:fs,state:{init(e,o){return this.spec.props.nodeViews[function(e){let t=e.cached.tableNodeTypes;if(!t){t=e.cached.tableNodeTypes={};for(let n in e.nodes){let r=e.nodes[n],o=r.spec.tableRole;o&&(t[o]=r)}}return t}(o.schema).table.name]=(e,o)=>new r(e,t,o,{width:n}),new gs(-1,!1)},apply:(e,t)=>t.apply(e)},props:{attributes:e=>fs.getState(e).activeHandle>-1?{class:"resize-cursor"}:null,handleDOMEvents:{mousemove(t,n){!function(e,t,n,r,o){let i=fs.getState(e.state);if(!i.dragging){let r=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),s=-1;if(r){let{left:o,right:i}=r.getBoundingClientRect();t.clientX-o<=n?s=bs(e,t,"left"):i-t.clientX<=n&&(s=bs(e,t,"right"))}if(s!=i.activeHandle){if(!o&&-1!==s){let t=e.state.doc.resolve(s),n=t.node(-1),r=ds.get(n),o=t.start(-1);if(r.colCount(t.pos-o)+t.nodeAfter.attrs.colspan-1==r.width-1)return}As(e,s)}}}(t,n,e,0,o)},mouseleave(e){!function(e){let t=fs.getState(e.state);t.activeHandle>-1&&!t.dragging&&As(e,-1)}(e)},mousedown(e,n){!function(e,t,n){let r=fs.getState(e.state);if(-1==r.activeHandle||r.dragging)return!1;let o=e.state.doc.nodeAt(r.activeHandle),i=function(e,t,n){let{colspan:r,colwidth:o}=n,i=o&&o[o.length-1];if(i)return i;let s=e.domAtPos(t),a=s.node.childNodes[s.offset],l=a.offsetWidth,c=r;if(o)for(let e=0;e<r;e++)o[e]&&(l-=o[e],c--);return l/c}(e,r.activeHandle,o.attrs);function s(t){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);let r=fs.getState(e.state);r.dragging&&(!function(e,t,n){let r=e.state.doc.resolve(t),o=r.node(-1),i=ds.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=e.state.tr;for(let e=0;e<i.height;e++){let t=e*i.width+a;if(e&&i.map[t]==i.map[t-i.width])continue;let r=i.map[t],{attrs:c}=o.nodeAt(r),d=1==c.colspan?0:a-i.colCount(r);if(c.colwidth&&c.colwidth[d]==n)continue;let p=c.colwidth?c.colwidth.slice():ws(c.colspan);p[d]=n,l.setNodeMarkup(s+r,null,hs(c,"colwidth",p))}l.docChanged&&e.dispatch(l)}(e,r.activeHandle,ys(r.dragging,t,n)),e.dispatch(e.state.tr.setMeta(fs,{setDragging:null})))}function a(t){if(!t.which)return s(t);let r=fs.getState(e.state),o=ys(r.dragging,t,n);!function(e,t,n,r){let o=e.state.doc.resolve(t),i=o.node(-1),s=o.start(-1),a=ds.get(i).colCount(o.pos-s)+o.nodeAfter.attrs.colspan-1,l=e.domAtPos(o.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;is(i,l.firstChild,0,r,a,n)}(e,r.activeHandle,o,n)}e.dispatch(e.state.tr.setMeta(fs,{setDragging:{startX:t.clientX,startWidth:i}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),t.preventDefault()}(e,n,t)}},decorations(e){let t=fs.getState(e);if(t.activeHandle>-1)return function(e,t){let n=[],r=e.doc.resolve(t),o=r.node(-1),i=ds.get(o),s=r.start(-1),a=i.colCount(r.pos-s)+r.nodeAfter.attrs.colspan;for(let e=0;e<i.height;e++){let t=a+e*i.width-1;if(!(a!=i.width&&i.map[t]==i.map[t+1]||0!=e&&i.map[t-1]==i.map[t-1-i.width])){let e=i.map[t],r=s+e+o.nodeAt(e).nodeSize-1,a=document.createElement("div");a.className="column-resize-handle",n.push(ke.NZ.widget(r,a))}}return ke.zF.create(e.doc,n)}(e,t.activeHandle)},nodeViews:{}}});return i}class gs{constructor(e,t){this.activeHandle=e,this.dragging=t}apply(e){let t=this,n=e.getMeta(fs);if(n&&null!=n.setHandle)return new gs(n.setHandle,null);if(n&&void 0!==n.setDragging)return new gs(t.activeHandle,n.setDragging);if(t.activeHandle>-1&&e.docChanged){let n=e.mapping.map(t.activeHandle,-1);"row"==(r=e.doc.resolve(n)).parent.type.spec.tableRole&&r.nodeAfter||(n=null),t=new gs(n,t.dragging)}var r;return t}}function bs(e,t,n){let r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r)return-1;let{pos:o}=r,i=us(e.state.doc.resolve(o));if(!i)return-1;if("right"==n)return i.pos;let s=ds.get(i.node(-1)),a=i.start(-1),l=s.map.indexOf(i.pos-a);return l%s.width==0?-1:a+s.map[l-1]}function ys(e,t,n){let r=t.clientX-e.startX;return Math.max(n,e.startWidth+r)}function As(e,t){e.dispatch(e.state.tr.setMeta(fs,{setHandle:t}))}function ws(e){let t=[];for(let n=0;n<e;n++)t.push(0);return t}const vs=Ae.bP.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,color:"red",width:"100%",View:ss,ReiszeView:os,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML(e){let{HTMLAttributes:t}=e;return["table",(0,Ae.KV)(this.options.HTMLAttributes,t),["tbody",0]]},addCommands:()=>({insertTable:function(){let{rows:e=3,cols:t=3,withHeaderRow:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r=>{let{tr:o,dispatch:i,editor:s}=r;const a=ts(s.schema,e,t,n);if(i){const e=o.selection.anchor+1;o.replaceSelectionWith(a).scrollIntoView().setSelection(we.U3.near(o.doc.resolve(e)))}return!0}},addColumnBefore:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){if(!ni(e))return!1;if(t){let n=Ti(e);t(Li(e.tr,n,n.left))}return!0}(t,n)},addColumnAfter:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){if(!ni(e))return!1;if(t){let n=Ti(e);t(Li(e.tr,n,n.right))}return!0}(t,n)},deleteColumn:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){if(!ni(e))return!1;if(t){let n=Ti(e),r=e.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let e=n.right-1;Ni(r,n,e),e!=n.left;e--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=Jo.get(n.table);t(r)}return!0}(t,n)},addRowBefore:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){if(!ni(e))return!1;if(t){let n=Ti(e);t(Ri(e.tr,n,n.top))}return!0}(t,n)},addRowAfter:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){if(!ni(e))return!1;if(t){let n=Ti(e);t(Ri(e.tr,n,n.bottom))}return!0}(t,n)},deleteRow:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){if(!ni(e))return!1;if(t){let n=Ti(e),r=e.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let e=n.bottom-1;Di(r,n,e),e!=n.top;e--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=Jo.get(n.table);t(r)}return!0}(t,n)},deleteTable:()=>e=>{let{state:t,dispatch:n}=e;return function(e,t){let n=e.selection.$anchor;for(let r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return t&&t(e.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}(t,n)},mergeCells:()=>e=>{let{state:t,dispatch:n}=e;return Pi(t,n)},splitCell:()=>e=>{let{state:t,dispatch:n}=e;return $i(t,n)},toggleHeaderColumn:()=>e=>{let{state:t,dispatch:n}=e;return ji("column")(t,n)},toggleHeaderRow:()=>e=>{let{state:t,dispatch:n}=e;return ji("row")(t,n)},toggleHeaderCell:()=>e=>{let{state:t,dispatch:n}=e;return Ui(t,n)},mergeOrSplit:()=>e=>{let{state:t,dispatch:n}=e;return!!Pi(t,n)||$i(t,n)},setCellAttribute:(e,t)=>n=>{let{state:r,dispatch:o}=n;return function(e,t){return function(n,r){if(!ni(n))return!1;let o=ri(n);if(o.nodeAfter.attrs[e]===t)return!1;if(r){let i=n.tr;n.selection instanceof di?n.selection.forEachCell((n,r)=>{n.attrs[e]!==t&&i.setNodeMarkup(r,null,ai(n.attrs,e,t))}):i.setNodeMarkup(o.pos,null,ai(o.nodeAfter.attrs,e,t)),r(i)}return!0}}(e,t)(r,o)},goToNextCell:()=>e=>{let{state:t,dispatch:n}=e;return Fi(1)(t,n)},goToPreviousCell:()=>e=>{let{state:t,dispatch:n}=e;return Fi(-1)(t,n)},fixTables:()=>e=>{let{state:t,dispatch:n}=e;return n&&Ii(t),!0},setCellSelection:e=>t=>{let{tr:n,dispatch:r}=t;if(r){const t=di.create(n.doc,e.anchorCell,e.headCell);n.setSelection(t)}return!0}}),addKeyboardShortcuts(){return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:ns,"Mod-Backspace":ns,Delete:ns,"Mod-Delete":ns}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Yi({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.ReiszeView,lastColumnResizable:this.options.lastColumnResizable})]:[ms({View:this.options.View,width:this.options.width})],Qi({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){const t={name:e.name,options:e.options,storage:e.storage};return{tableRole:(0,Ae.gk)((0,Ae.iI)(e,"tableRole",t))}}}),xs=vs,ks=Ae.bP.create({name:"button",draggable:!1,group:"inline",atom:!0,inline:!0,addOptions:()=>({id:null,background:"red",height:"auto",width:"auto",HTMLAttributes:{class:"inline-button"}}),addAttributes:()=>({width:{default:"auto",parseHTML:e=>e.width},height:{default:"auto",parseHTML:e=>e.height},background:{default:"#000",parseHTML:e=>e.getAttribute("background")}}),parseHTML:()=>[{tag:"button",priority:51}],renderHTML(e){let{HTMLAttributes:t}=e;return["button",(0,Ae.KV)(t)]},addCommands(){return{toggleButton:()=>e=>{let{commands:t,editor:n}=e;return t.insertContent({type:this.name,attrs:this.options}),!0},setButtonStyles:e=>t=>{const{commands:n,editor:r}=t,o=(0,Ae.KV)({background:this.options.background,width:this.options.width,height:this.options.height},e);return o.style=`\n background: ${o.background};\n width: ${o.width};\n height: ${o.height};`,n.updateAttributes(this.name,o),!0}}},addNodeView:()=>()=>{const e=document.createElement("button");e.contentEditable=!1,e.classList.add("node-view");const t=document.createElement("div");return t.innerHTML="button",t.classList.add("content"),e.append(t),{dom:e}}}),Cs=Ae.bP.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:e}){return["tr",(0,Ae.KV)(this.options.HTMLAttributes,e),0]}});const _s=Ae.bP.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({borderColor:{default:"#ced4da"},colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?[parseInt(t,10)]:null}}}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML(e){let{HTMLAttributes:t}=e;const n=`border-color:${t.borderColor}`;return t.style=n,["td",(0,Ae.KV)(this.options.HTMLAttributes,t),0]}}),Es=Ae.bP.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:e=>{const t=e.getAttribute("colwidth");return t?t.split(",").map(e=>parseInt(e,10)):null}}}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:e}){return["th",(0,Ae.KV)(this.options.HTMLAttributes,e),0]}}),Ss=Ae.YY.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:e=>e.style.backgroundColor.replace(/['"]+/g,""),renderHTML:e=>e.backgroundColor?{style:`background: ${e.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:e=>t=>{let{chain:n}=t;return n().setMark("textStyle",{backgroundColor:e}).run()},unsetBackgroundColor:()=>e=>{let{chain:t}=e;return t().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}})}),Bs=Ae.YY.create({name:"textAlign",addOptions:()=>({types:[],alignments:["left","center","right","justify"],defaultAlignment:"left"}),addGlobalAttributes(){return[{types:this.options.types,attributes:{textAlign:{default:this.options.defaultAlignment,parseHTML:e=>e.style.textAlign||this.options.defaultAlignment,renderHTML:e=>({style:`text-align: ${e.textAlign}`})}}}]},addCommands(){return{setTextAlign:e=>t=>{let{commands:n}=t;return!!this.options.alignments.includes(e)&&this.options.types.every(t=>n.updateAttributes(t,{textAlign:e}))},unsetTextAlign:()=>e=>{let{commands:t}=e;return this.options.types.every(e=>t.resetAttributes(e,"textAlign"))}}},addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.setTextAlign("left"),"Mod-Shift-e":()=>this.editor.commands.setTextAlign("center"),"Mod-Shift-r":()=>this.editor.commands.setTextAlign("right"),"Mod-Shift-j":()=>this.editor.commands.setTextAlign("justify")}}});const Ms=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Os=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Is=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],Ts=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Ls=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();var Ns="[0-9](_*[0-9])*",Rs=`\\.(${Ns})`,Ds="[0-9a-fA-F](_*[0-9a-fA-F])*",zs={className:"number",variants:[{begin:`(\\b(${Ns})((${Rs})|\\.)?|(${Rs}))[eE][+-]?(${Ns})[fFdD]?\\b`},{begin:`\\b(${Ns})((${Rs})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Rs})[fFdD]?\\b`},{begin:`\\b(${Ns})[fFdD]\\b`},{begin:`\\b0[xX]((${Ds})\\.?|(${Ds})?\\.(${Ds}))[pP][+-]?(${Ns})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ds})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Ps(e,t,n){return-1===n?"":e.replace(t,r=>Ps(e,t,n-1))}const $s="[A-Za-z$_][0-9A-Za-z$_]*",Hs=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],js=["true","false","null","undefined","NaN","Infinity"],Us=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Fs=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Vs=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],qs=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Ws=[].concat(Vs,Us,Fs);var Ys="[0-9](_*[0-9])*",Xs=`\\.(${Ys})`,Zs="[0-9a-fA-F](_*[0-9a-fA-F])*",Ks={className:"number",variants:[{begin:`(\\b(${Ys})((${Xs})|\\.)?|(${Xs}))[eE][+-]?(${Ys})[fFdD]?\\b`},{begin:`\\b(${Ys})((${Xs})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Xs})[fFdD]?\\b`},{begin:`\\b(${Ys})[fFdD]\\b`},{begin:`\\b0[xX]((${Zs})\\.?|(${Zs})?\\.(${Zs}))[pP][+-]?(${Ys})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Zs})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};const Js=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Gs=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Qs=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],ea=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ta=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse(),na=Qs.concat(ea);const ra=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],oa=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],ia=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"],sa=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],aa=["align-content","align-items","align-self","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","empty-cells","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","isolation","justify-content","left","letter-spacing","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","resize","rest","rest-after","rest-before","right","row-gap","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","speak","speak-as","src","tab-size","table-layout","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","z-index"].reverse();function la(e){return e?"string"==typeof e?e:e.source:null}function ca(e){return da("(?=",e,")")}function da(...e){return e.map(e=>la(e)).join("")}function pa(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map(e=>la(e)).join("|")+")"}const ua=e=>da(/\b/,e,/\w$/.test(e)?/\b/:/\B/),ha=["Protocol","Type"].map(ua),fa=["init","self"].map(ua),ma=["Any","Self"],ga=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","break","case","catch","class","continue","convenience","default","defer","deinit","didSet","distributed","do","dynamic","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],ba=["false","nil","true"],ya=["assignment","associativity","higherThan","left","lowerThan","none","right"],Aa=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],wa=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],va=pa(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),xa=pa(va,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ka=da(va,xa,"*"),Ca=pa(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),_a=pa(Ca,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Ea=da(Ca,_a,"*"),Sa=da(/[A-Z]/,_a,"*"),Ba=["autoclosure",da(/convention\(/,pa("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",da(/objc\(/,Ea,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],Ma=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];const Oa="[A-Za-z$_][0-9A-Za-z$_]*",Ia=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],Ta=["true","false","null","undefined","NaN","Infinity"],La=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Na=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ra=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Da=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],za=[].concat(Ra,La,Na);const Pa=n(14523);var $a=n(86638);const Ha=Object.assign(ja(Error),{eval:ja(EvalError),range:ja(RangeError),reference:ja(ReferenceError),syntax:ja(SyntaxError),type:ja(TypeError),uri:ja(URIError)});function ja(e){return t.displayName=e.displayName||e.name,t;function t(t,...n){const r=t?$a(t,...n):t;return new e(r)}}const Ua={}.hasOwnProperty,Fa="hljs-";function Va(e,t,n={}){let r=n.prefix;if("string"!=typeof e)throw Ha("Expected `string` for name, got `%s`",e);if(!Pa.getLanguage(e))throw Ha("Unknown language: `%s` is not registered",e);if("string"!=typeof t)throw Ha("Expected `string` for value, got `%s`",t);null==r&&(r=Fa),Pa.configure({__emitter:qa,classPrefix:r});const o=Pa.highlight(t,{language:e,ignoreIllegals:!0});if(Pa.configure({}),o.errorRaised)throw o.errorRaised;return o._emitter.root.data.language=o.language,o._emitter.root.data.relevance=o.relevance,o._emitter.root}class qa{constructor(e){this.options=e,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(e){if(""===e)return;const t=this.stack[this.stack.length-1],n=t.children[t.children.length-1];n&&"text"===n.type?n.value+=e:t.children.push({type:"text",value:e})}startScope(e){this.openNode(String(e))}endScope(){this.closeNode()}__addSublanguage(e,t){const n=this.stack[this.stack.length-1],r=e.root.children;t?n.children.push({type:"element",tagName:"span",properties:{className:[t]},children:r}):n.children.push(...r)}openNode(e){const t={type:"element",tagName:"span",properties:{className:e.split(".").map((e,t)=>t?e+"_".repeat(t):this.options.classPrefix+e)},children:[]};this.stack[this.stack.length-1].children.push(t),this.stack.push(t)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const Wa={highlight:Va,highlightAuto:function(e,t={}){const n=t.subset||Pa.listLanguages();let r=t.prefix,o=-1,i={type:"root",data:{language:null,relevance:0},children:[]};if(null==r&&(r=Fa),"string"!=typeof e)throw Ha("Expected `string` for value, got `%s`",e);for(;++o<n.length;){const r=n[o];if(!Pa.getLanguage(r))continue;const s=Va(r,e,t);s.data.relevance>i.data.relevance&&(i=s)}return i},registerLanguage:function(e,t){Pa.registerLanguage(e,t)},registered:function(e){return Boolean(Pa.getLanguage(e))},listLanguages:function(){return Pa.listLanguages()},registerAlias:function(e,t){if("string"==typeof e)Pa.registerAliases(t,{languageName:e});else{let t;for(t in e)Ua.call(e,t)&&Pa.registerAliases(e[t],{languageName:t})}}};Wa.registerLanguage("arduino",function(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",i="(?!struct)("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},p=t.optional(o)+e.IDENT_RE+"\\s*\\(",u={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[h,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:u,contains:f.concat([{begin:/\(/,end:/\)/,keywords:u,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+i+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:u,relevance:0},{begin:p,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:u,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,h,f,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:u,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:u},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}),Wa.registerLanguage("bash",function(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,o]};o.contains.push(s);const a={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},l=e.SHEBANG({binary:`(${["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"].join("|")})`,relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","for","while","until","in","do","done","case","esac","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[l,e.SHEBANG(),c,a,e.HASH_COMMENT_MODE,i,{match:/(\/[a-z._-]+)+/},s,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},n]}}),Wa.registerLanguage("c",function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",i="("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},p=t.optional(o)+e.IDENT_RE+"\\s*\\(",u={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal128","const","static","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},h=[c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:u,contains:h.concat([{begin:/\(/,end:/\)/,keywords:u,contains:h.concat(["self"]),relevance:0}]),relevance:0},m={begin:"("+i+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:u,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(d,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:u,disableAutodetect:!0,illegal:"</",contains:[].concat(f,m,h,[c,{begin:e.IDENT_RE+"::",keywords:u},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:a,keywords:u}}}),Wa.registerLanguage("cpp",function(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",o="[a-zA-Z_]\\w*::",i="(?!struct)("+r+"|"+t.optional(o)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:t.optional(o)+e.IDENT_RE,relevance:0},p=t.optional(o)+e.IDENT_RE+"\\s*\\(",u={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},h={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},f=[h,c,s,n,e.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:u,contains:f.concat([{begin:/\(/,end:/\)/,keywords:u,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+i+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:u,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:u,relevance:0},{begin:p,returnBegin:!0,contains:[d],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[a,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:u,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:u,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,h,f,[c,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)",end:">",keywords:u,contains:["self",s]},{begin:e.IDENT_RE+"::",keywords:u},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}),Wa.registerLanguage("csharp",function(e){const t={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},n=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),r={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},o={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},i=e.inherit(o,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/,keywords:t},a=e.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,a]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},d=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]});s.contains=[c,l,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.C_BLOCK_COMMENT_MODE],a.contains=[d,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,r,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const p={variants:[c,l,o,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},u={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},h=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",f={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:t,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},p,r,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},n,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,u,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+h+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:t,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,u],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,relevance:0,contains:[p,r,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},f]}}),Wa.registerLanguage("css",function(e){const t=e.regex,n=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),r=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Is.join("|")+")"},{begin:":(:)?("+Ts.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Ls.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...r,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...r,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Os.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...r,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ms.join("|")+")\\b"}]}}),Wa.registerLanguage("diff",function(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}),Wa.registerLanguage("go",function(e){const t={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:t,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:e.C_NUMBER_RE+"[i]",relevance:1},e.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,illegal:/["']/}]}]}}),Wa.registerLanguage("graphql",function(e){const t=e.regex;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(/[_A-Za-z][_0-9A-Za-z]*/,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}),Wa.registerLanguage("ini",function(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const o={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},i={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,i,o,s,n,"self"],relevance:0},l=t.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:t.concat(l,"(\\s*\\.\\s*",l,")*",t.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[r,a,i,o,s,n]}}]}}),Wa.registerLanguage("java",function(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Ps("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),o={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},i={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:o,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[s,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:o,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:o,relevance:0,contains:[i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,zs,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},zs,i]}}),Wa.registerLanguage("javascript",function(e){const t=e.regex,n=$s,r="<>",o="</>",i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let o;">"===r&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());const i=e.input.substring(n);((o=i.match(/^\s*=/))||(o=i.match(/^\s+extends\s+/))&&0===o.index)&&t.ignoreMatch()}},s={$pattern:$s,keyword:Hs,literal:js,built_in:Ws,"variable.language":qs},a="[0-9](_?[0-9])*",l=`\\.(${a})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},u={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},f={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},g={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,f,m,{match:/\$\d+/},d];p.contains=b.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(b)});const y=[].concat(g,p.contains),A=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:A},v={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},x={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Us,...Fs]}},k={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},C={match:t.concat(/\b/,function(e){return t.concat("(?!",e.join("|"),")")}([...Vs,"super","import"]),n,t.lookahead(/\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",B={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,f,m,g,{match:/\$\d+/},d,x,{className:"attr",begin:n+t.lookahead(":"),relevance:0},B,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[g,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:o},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},C,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},v,E,{match:/\$[(.]/}]}}),Wa.registerLanguage("json",function(e){const t=["true","false","null"],n={scope:"literal",beginKeywords:t.join(" ")};return{name:"JSON",keywords:{literal:t},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,n,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}),Wa.registerLanguage("kotlin",function(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},i={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,r]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,r]}]};r.contains.push(i);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},a={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(i,{className:"string"}),"self"]}]},l=Ks,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},p=d;return p.variants[1].contains=[d],d.variants[1].contains=[p],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},n,s,a,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,s,a,i,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},s,a]},i,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}}),Wa.registerLanguage("less",function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),n=na,r="[\\w-]+",o="("+r+"|@\\{"+r+"\\})",i=[],s=[],a=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},l=function(e,t,n){return{className:e,begin:t,relevance:n}},c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Gs.join(" ")},d={begin:"\\(",end:"\\)",contains:s,keywords:c,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a("'"),a('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,d,l("variable","@@?"+r,10),l("variable","@\\{"+r+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const p=s.concat({begin:/\{/,end:/\}/,contains:i}),u={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},h={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ta.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},f={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:s,relevance:0}},m={className:"variable",variants:[{begin:"@"+r+"\\s*:",relevance:15},{begin:"@"+r}],starts:{end:"[;}]",returnEnd:!0,contains:p}},g={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,u,l("keyword","all\\b"),l("variable","@\\{"+r+"\\}"),{begin:"\\b("+Js.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,l("selector-tag",o,0),l("selector-id","#"+o),l("selector-class","\\."+o,0),l("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Qs.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+ea.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:p},{begin:"!important"},t.FUNCTION_DISPATCH]},b={begin:r+":(:)?"+`(${n.join("|")})`,returnBegin:!0,contains:[g]};return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f,m,b,h,g,u,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:i}}),Wa.registerLanguage("lua",function(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},o=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:o.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:o}].concat(o)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}),Wa.registerLanguage("makefile",function(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t]},o={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},i={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,o,{className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},i]}}),Wa.registerLanguage("markdown",function(e){const t={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},r={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},o={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},i=e.inherit(r,{contains:[]}),s=e.inherit(o,{contains:[]});r.contains.push(s),o.contains.push(i);let a=[t,n];return[r,o,i,s].forEach(e=>{e.contains=e.contains.concat(a)}),a=a.concat(r,o),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:a},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:a}]}]},t,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},r,o,{className:"quote",begin:"^>\\s+",contains:a,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},n,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}),Wa.registerLanguage("objectivec",function(e){const t=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:t,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:t,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"</",contains:[{className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}),Wa.registerLanguage("perl",function(e){const t=e.regex,n=/[dualxmsipngr]{0,12}/,r={$pattern:/[\w.]+/,keyword:["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"].join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},i={begin:/->\{/,end:/\}/},s={variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},a=[e.BACKSLASH_ESCAPE,o,s],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(e,r,o="\\1")=>{const i="\\1"===o?o:t.concat(o,r);return t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,i,/(?:\\.|[^\\\/])*?/,o,n)},d=(e,r,o)=>t.concat(t.concat("(?:",e,")"),r,/(?:\\.|[^\\\/])*?/,o,n),p=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),i,{className:"string",contains:a,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:c("s|tr|y",t.either(...l,{capture:!0}))},{begin:c("s|tr|y","\\(","\\)")},{begin:c("s|tr|y","\\[","\\]")},{begin:c("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:d("(?:m|qr)?",/\//,/\//)},{begin:d("m|qr",t.either(...l,{capture:!0}),/\1/)},{begin:d("m|qr",/\(/,/\)/)},{begin:d("m|qr",/\[/,/\]/)},{begin:d("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=p,i.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:p}}),Wa.registerLanguage("php",function(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),o=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),i={scope:"variable",match:"\\$+"+r},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},a=e.inherit(e.APOS_STRING_MODE,{illegal:null}),l="[ \t\n]",c={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),a,{begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s),"on:begin":(e,t)=>{t.data._beginMatch=e[1]||e[2]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}},e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/})]},d={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},p=["false","null","true"],u=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],h=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],f={keyword:u,literal:(e=>{const t=[];return e.forEach(e=>{t.push(e),e.toLowerCase()===e?t.push(e.toUpperCase()):t.push(e.toLowerCase())}),t})(p),built_in:h},m=e=>e.map(e=>e.replace(/\|\d+$/,"")),g={variants:[{match:[/new/,t.concat(l,"+"),t.concat("(?!",m(h).join("\\b|"),"\\b)"),o],scope:{1:"keyword",4:"title.class"}}]},b=t.concat(r,"\\b(?!\\()"),y={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[o,t.concat(/::/,t.lookahead(/(?!class\b)/)),b],scope:{1:"title.class",3:"variable.constant"}},{match:[o,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[o,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},A={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},w={relevance:0,begin:/\(/,end:/\)/,keywords:f,contains:[A,i,y,e.C_BLOCK_COMMENT_MODE,c,d,g]},v={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",m(u).join("\\b|"),"|",m(h).join("\\b|"),"\\b)"),r,t.concat(l,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(v);const x=[A,y,e.C_BLOCK_COMMENT_MODE,c,d,g];return{case_insensitive:!1,keywords:f,contains:[{begin:t.concat(/#\[\s*/,o),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:p,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:p,keyword:["new","array"]},contains:["self",...x]},...x,{scope:"meta",match:o}]},e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},i,v,y,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},g,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",i,y,e.C_BLOCK_COMMENT_MODE,c,d]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},c,d]}}),Wa.registerLanguage("php-template",function(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}),Wa.registerLanguage("plaintext",function(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}),Wa.registerLanguage("python",function(e){const t=e.regex,n=/[\p{XID_Start}_]\p{XID_Continue}*/u,r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},i={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,i],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,i],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,i,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,i,a,s]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,a,s]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",d=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,p=`\\b|${r.join("|")}`,u={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${d}))[eE][+-]?(${c})[jJ]?(?=${p})`},{begin:`(${d})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${c})[jJ](?=${p})`}]},h={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},f={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",i,u,l,e.HASH_COMMENT_MODE]}]};return s.contains=[l,u,i],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[i,u,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},l,h,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[f]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[u,f,l]}]}}),Wa.registerLanguage("python-repl",function(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}),Wa.registerLanguage("r",function(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),o=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[o,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[i,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:o},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}),Wa.registerLanguage("ruby",function(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),o=t.concat(r,/(::\w+)*/),i={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},s={className:"doctag",begin:"@[A-Za-z]+"},a={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:i},d={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},p="[0-9](_?[0-9])*",u={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},h={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:i}]},f=[d,{variants:[{match:[/class\s+/,o,/\s+<\s+/,o]},{match:[/\b(class|module)\s+/,o]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:i},{match:[/(include|extend)\s+/,o],scope:{2:"title.class"},keywords:i},{relevance:0,match:[o,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[h]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},u,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:i},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(a,l),relevance:0}].concat(a,l);c.contains=f,h.contains=f;const m=[{begin:/^\s*=>/,starts:{end:"$",contains:f}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:i,contains:f}}];return l.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:i,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(m).concat(l).concat(f)}}),Wa.registerLanguage("rust",function(e){const t=e.regex,n={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let\b)/,e.IDENT_RE,t.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",o=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],i=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:i,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:o},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'\\?(x\w{2}|u\w{4}|U\w{8}|.)'/}]},{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*/},{className:"number",variants:[{begin:"\\b0b([01_]+)"+r},{begin:"\\b0o([0-7_]+)"+r},{begin:"\\b0x([A-Fa-f0-9_]+)"+r},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+r}],relevance:0},{begin:[/fn/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,e.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,e.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:o,type:i}},{className:"punctuation",begin:"->"},n]}}),Wa.registerLanguage("scss",function(e){const t=(e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z][A-Za-z0-9_-]*/}}))(e),n=sa,r=ia,o="@[a-z-]+",i={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+ra.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},i,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+aa.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,i,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:o,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:oa.join(" ")},contains:[{begin:o,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},i,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}),Wa.registerLanguage("shell",function(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}),Wa.registerLanguage("sql",function(e){const t=e.regex,n=e.COMMENT("--","$"),r=["true","false","unknown"],o=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],i=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],s=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],a=i,l=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter(e=>!i.includes(e)),c={begin:t.concat(/\b/,t.either(...a),/\s*\(/),relevance:0,keywords:{built_in:a}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(e,{exceptions:t,when:n}={}){const r=n;return t=t||[],e.map(e=>e.match(/\|\d+$/)||t.includes(e)?e:r(e)?`${e}|0`:e)}(l,{when:e=>e.length<3}),literal:r,type:o,built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{begin:t.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:l.concat(s),literal:r,type:o}},{className:"type",begin:t.either("double precision","large object","with timezone","without timezone")},c,{className:"variable",begin:/@[a-z0-9][a-z0-9_]*/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}}),Wa.registerLanguage("swift",function(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],o={match:[/\./,pa(...ha,...fa)],className:{2:"keyword"}},i={match:da(/\./,pa(...ga)),relevance:0},s=ga.filter(e=>"string"==typeof e).concat(["_|0"]),a={variants:[{className:"keyword",match:pa(...ga.filter(e=>"string"!=typeof e).concat(ma).map(ua),...fa)}]},l={$pattern:pa(/\b\w+/,/#\w+/),keyword:s.concat(Aa),literal:ba},c=[o,i,a],d=[{match:da(/\./,pa(...wa)),relevance:0},{className:"built_in",match:da(/\b/,pa(...wa),/(?=\()/)}],p={match:/->/,relevance:0},u=[p,{className:"operator",relevance:0,variants:[{match:ka},{match:`\\.(\\.|${xa})+`}]}],h="([0-9]_*)+",f="([0-9a-fA-F]_*)+",m={className:"number",relevance:0,variants:[{match:`\\b(${h})(\\.(${h}))?([eE][+-]?(${h}))?\\b`},{match:`\\b0x(${f})(\\.(${f}))?([pP][+-]?(${h}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(e="")=>({className:"subst",variants:[{match:da(/\\/,e,/[0\\tnr"']/)},{match:da(/\\/,e,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(e="")=>({className:"subst",match:da(/\\/,e,/[\t ]*(?:[\r\n]|\r\n)/)}),y=(e="")=>({className:"subst",label:"interpol",begin:da(/\\/,e,/\(/),end:/\)/}),A=(e="")=>({begin:da(e,/"""/),end:da(/"""/,e),contains:[g(e),b(e),y(e)]}),w=(e="")=>({begin:da(e,/"/),end:da(/"/,e),contains:[g(e),y(e)]}),v={className:"string",variants:[A(),A("#"),A("##"),A("###"),w(),w("#"),w("##"),w("###")]},x={match:da(/`/,Ea,/`/)},k=[x,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${_a}+`}],C=[{match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Ma,contains:[...u,m,v]}]}},{className:"keyword",match:da(/@/,pa(...Ba))},{className:"meta",match:da(/@/,Ea)}],_={match:ca(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:da(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,_a,"+")},{className:"type",match:Sa,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:da(/\s+&\s+/,ca(Sa)),relevance:0}]},E={begin:/</,end:/>/,keywords:l,contains:[...r,...c,...C,p,_]};_.contains.push(E);const S={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:da(Ea,/\s*:/),keywords:"_|0",relevance:0},...r,...c,...d,...u,m,v,...k,...C,_]},B={begin:/</,end:/>/,contains:[...r,_]},M={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:pa(ca(da(Ea,/\s*:/)),ca(da(Ea,/\s+/,Ea,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Ea}]},...r,...c,...u,m,v,...C,_,S],endsParent:!0,illegal:/["']/},O={match:[/func/,/\s+/,pa(x.match,Ea,ka)],className:{1:"keyword",3:"title.function"},contains:[B,M,t],illegal:[/\[/,/%/]},I={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[B,M,t],illegal:/\[|%/},T={match:[/operator/,/\s+/,ka],className:{1:"keyword",3:"title"}},L={begin:[/precedencegroup/,/\s+/,Sa],className:{1:"keyword",3:"title"},contains:[_],keywords:[...ya,...ba],end:/}/};for(const e of v.variants){const t=e.contains.find(e=>"interpol"===e.label);t.keywords=l;const n=[...c,...d,...u,m,v,...k];t.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...r,O,I,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:l,contains:[e.inherit(e.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},T,L,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...c,...d,...u,m,v,...k,...C,_,S]}}),Wa.registerLanguage("typescript",function(e){const t=function(e){const t=e.regex,n=Oa,r="<>",o="</>",i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(e,t)=>{const n=e[0].length+e.index,r=e.input[n];if("<"===r||","===r)return void t.ignoreMatch();let o;">"===r&&(((e,{after:t})=>{const n="</"+e[0].slice(1);return-1!==e.input.indexOf(n,t)})(e,{after:n})||t.ignoreMatch());const i=e.input.substring(n);((o=i.match(/^\s*=/))||(o=i.match(/^\s+extends\s+/))&&0===o.index)&&t.ignoreMatch()}},s={$pattern:Oa,keyword:Ia,literal:Ta,built_in:za,"variable.language":Da},a="[0-9](_?[0-9])*",l=`\\.(${a})`,c="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${c})((${l})|\\.)?|(${l}))[eE][+-]?(${a})\\b`},{begin:`\\b(${c})\\b((${l})\\b|\\.)?|(${l})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:s,contains:[]},u={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},h={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},f={begin:"gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},m={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},g={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,f,m,{match:/\$\d+/},d];p.contains=b.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(b)});const y=[].concat(g,p.contains),A=y.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(y)}]),w={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:A},v={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,t.concat(n,"(",t.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},x={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...La,...Na]}},k={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},C={match:t.concat(/\b/,function(e){return t.concat("(?!",e.join("|"),")")}([...Ra,"super","import"]),n,t.lookahead(/\(/)),className:"title.function",relevance:0},_={begin:t.concat(/\./,t.lookahead(t.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},E={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",B={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:A,CLASS_REFERENCE:x},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,h,f,m,g,{match:/\$\d+/},d,x,{className:"attr",begin:n+t.lookahead(":"),relevance:0},B,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[g,e.REGEXP_MODE,{className:"function",begin:S,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:A}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:o},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},k,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},_,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},C,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},v,E,{match:/\$[(.]/}]}}(e),n=Oa,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[t.exports.CLASS_REFERENCE]},i={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[t.exports.CLASS_REFERENCE]},s={$pattern:Oa,keyword:Ia.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:Ta,built_in:za.concat(r),"variable.language":Da},a={className:"meta",begin:"@"+n},l=(e,t,n)=>{const r=e.contains.findIndex(e=>e.label===t);if(-1===r)throw new Error("can not find mode to replace");e.contains.splice(r,1,n)};return Object.assign(t.keywords,s),t.exports.PARAMS_CONTAINS.push(a),t.contains=t.contains.concat([a,o,i]),l(t,"shebang",e.SHEBANG()),l(t,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),t.contains.find(e=>"func.def"===e.label).relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t}),Wa.registerLanguage("vbnet",function(e){const t=e.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,o=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,i=/\d{1,2}(:\d{1,2}){1,2}/,s={className:"literal",variants:[{begin:t.concat(/# */,t.either(r,n),/ *#/)},{begin:t.concat(/# */,i,/ *#/)},{begin:t.concat(/# */,o,/ *#/)},{begin:t.concat(/# */,t.either(r,n),/ +/,t.either(o,i),/ *#/)}]},a=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},s,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},a,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}}),Wa.registerLanguage("wasm",function(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);return t.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"]},contains:[e.COMMENT(/;;/,/$/),t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},{className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}}),Wa.registerLanguage("xml",function(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},i=e.inherit(o,{begin:/\(/,end:/\)/}),s=e.inherit(e.APOS_STRING_MODE,{className:"string"}),a=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:/[\p{L}0-9._:-]+/u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[r]},{begin:/'/,end:/'/,contains:[r]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,a,s,i,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,i,a,s]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},r,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[a]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}),Wa.registerLanguage("yaml",function(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},o=e.inherit(r,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),i={className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},s={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},a={begin:/\{/,end:/\}/,contains:[s],illegal:"\\n",relevance:0},l={begin:"\\[",end:"\\]",contains:[s],illegal:"\\n",relevance:0},c=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},i,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},a,l,r],d=[...c];return d.pop(),d.push(o),s.contains=d,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:c}});const Ya=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Xa=Ae.bP.create({name:"image",addOptions:()=>({id:null,inline:!0,allowBase64:!1,width:"200px",height:"200px",HTMLAttributes:{},"data-target":"_blank","data-href":""}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{id:{default:`inline-image-${(0,V.A)()}`},src:{default:null},alt:{default:null},title:{default:null},width:{default:this.options.width||"500px"},height:{default:this.options.height||"500px"},"data-href":{default:this.options["data-href"]},"data-target":{default:this.options["data-target"]}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML(e){let{HTMLAttributes:t}=e;return["img",(0,Ae.KV)(this.options.HTMLAttributes,t)]},addNodeView(){return e=>{let{node:t,editor:n,getPos:r}=e;const o=document.createElement("img"),i=(0,Ae.KV)(this.options.HTMLAttributes,t.attrs);return Object.entries(i).forEach(e=>{let[t,n]=e;null!=n&&("style"===t&&"object"==typeof n?Object.assign(o.style,n):"style"===t&&"string"==typeof n?o.setAttribute("style",n):o.setAttribute(t,n))}),o.addEventListener("dblclick",e=>{e.preventDefault(),e.stopPropagation();let t=null;"function"==typeof r&&(t=r());const o=document.createElement("cdtr-gallery");o.opened=!0,o.multi=!0,document.body.append(o),o.addEventListener("file",e=>{let r=e.detail;if(Array.isArray(r)&&(r=r[0]),null!==t)try{const{view:e}=n,{state:o}=e;if(t<0||t>=o.doc.content.size)return void console.warn("Image position is out of bounds");try{const i=we.nh.create(o.doc,t),s=o.tr.setSelection(i);e.dispatch(s),n.commands.updateImage({src:r.src})}catch(n){const i=o.doc.resolve(t),s=i.nodeAfter||i.nodeBefore;if(s&&"image"===s.type.name){const n={...s.attrs,src:r.src},i=s.type.create(n),a=t,l=t+s.nodeSize,c=o.tr.replaceWith(a,l,i);e.dispatch(c)}else console.warn("Could not find image node at position:",t)}}catch(e){console.warn("Failed to update image:",e)}o.opened=!1,setTimeout(()=>{o.remove()},1500)}),o.addEventListener("close",()=>{o.remove()})}),{dom:o}}},addCommands(){return{setImage:e=>t=>{let{commands:n}=t;return n.insertContent({type:this.name,attrs:e}),!0},updateImage:e=>t=>{let{dispatch:n,commands:r,editor:o,view:i,tr:s}=t;const{state:a}=i,l=we.nh.create(a.doc,i.state.selection.from),c={...l.node.attrs,...e},d=this.type.create(c);if(n){const e=(s||a.tr).replaceRangeWith(l.from,l.to,d);i.dispatch(e)}return!0}}},addInputRules(){return[(0,Ae.jT)({find:Ya,type:this.type,getAttributes:e=>{const[,,t,n,r,o,i,s]=e;return{src:n,alt:t,title:r,width:o,height:i,id:s}}})]}});const Za=Ae.bP.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML(e){let{HTMLAttributes:t}=e;return["li",(0,Ae.KV)(this.options.HTMLAttributes,t),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),Ka=Ae.CU.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:e=>!!e.hasAttribute("style")&&{}}],renderHTML(e){let{HTMLAttributes:t}=e;return["span",(0,Ae.KV)(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>e=>{let{state:t,commands:n}=e;const r=(0,Ae.z6)(t,this.type);return!!Object.entries(r).some(e=>{let[,t]=e;return!!t})||n.unsetMark(this.name)}}}}),Ja=/^\s*([-+*])\s$/,Ga=Ae.bP.create({name:"bulletList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1,color:"#000"}),addAttributes:()=>({color:{default:"#000"}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML:e=>[{tag:"ul"}],renderHTML(e){let{node:t,HTMLAttributes:n}=e;return["ul",(0,Ae.KV)(this.options.HTMLAttributes,n,{style:`color:${t.attrs.color}`}),0]},addCommands(){return{changeBulletListColor:e=>{let{color:t}=e;return e=>{let{commands:n,chain:r}=e;return r().updateAttributes(this.name,{color:t}).run()}},toggleBulletList:()=>e=>{let{commands:t,chain:n}=e;return this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(Za.name,this.editor.getAttributes(Ka.name)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let e=(0,Ae.tG)({find:Ja,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(e=(0,Ae.tG)({find:Ja,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Ka.name),editor:this.editor})),[e]}}),Qa=/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{11})(?:\S+)?$/,el=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)(\/(?:shorts\/|watch\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,tl=/^https?:\/\/(?:www\.)?(?:vimeo\.com|player\.vimeo\.com\/video)\/(\d+)(?:\/[\w-]*)?(?:\?.*)?$/i,nl=/^https?:\/\/(?:www\.)?.+\.mp3(?:\?.*)?$/i,rl=e=>!!e&&!!e.match(Qa),ol=e=>!!e&&!!e.match(tl),il=e=>!!e&&!!e.match(nl),sl=e=>e?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",al=e=>{let{url:t}=e;return rl(t)?(e=>{const{url:t,allowFullscreen:n,autoplay:r,ccLanguage:o,ccLoadPolicy:i,controls:s,disableKBcontrols:a,enableIFrameApi:l,endTime:c,interfaceLanguage:d,ivLoadPolicy:p,loop:u,modestBranding:h,nocookie:f,origin:m,playlist:g,progressBarColor:b,startAt:y}=e;if(!rl(t))return null;if(t.includes("/embed/"))return t;if(t.includes("youtu.be")){const e=t.split("/").pop();return e?`${sl(f)}${e}`:null}const A=/(?:v=|shorts\/)([-\w]+)/gm.exec(t);if(!A||!A[1])return null;let w=`${sl(f)}${A[1]}`;const v=[];return!1===n&&v.push("fs=0"),r&&v.push("autoplay=1"),o&&v.push(`cc_lang_pref=${o}`),i&&v.push("cc_load_policy=1"),s||v.push("controls=0"),a&&v.push("disablekb=1"),l&&v.push("enablejsapi=1"),c&&v.push(`end=${c}`),d&&v.push(`hl=${d}`),p&&v.push(`iv_load_policy=${p}`),u&&v.push("loop=1"),h&&v.push("modestbranding=1"),m&&v.push(`origin=${m}`),g&&v.push(`playlist=${g}`),y&&v.push(`start=${y}`),b&&v.push(`color=${b}`),v.length&&(w+=`?${v.join("&")}`),w})(e):ol(t)?(e=>{const{url:t}=e;if(!ol(t))return null;const n=(e=>{const t=e.match(tl);return t&&t.find(e=>/^\d+$/.test(e))||null})(t);if(!n)return null;let r=`https://player.vimeo.com/video/${n}`;const o=[];return e.autoplay&&o.push("autoplay=1"),o.length&&(r+=`?${o.join("&")}`),r})(e):il(t)?(e=>{const{url:t}=e;return il(t)?t:null})(e):null},ll=Ae.bP.create({name:"video",addOptions:()=>({addPasteHandler:!0,allowFullscreen:!0,autoplay:!1,ccLanguage:void 0,ccLoadPolicy:void 0,controls:!0,disableKBcontrols:!1,enableIFrameApi:!1,endTime:0,height:480,interfaceLanguage:void 0,ivLoadPolicy:0,loop:!1,modestBranding:!1,HTMLAttributes:{},inline:!1,nocookie:!1,origin:"",playlist:"",progressBarColor:void 0,width:640}),inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},start:{default:0},width:{default:this.options.width},height:{default:this.options.height}}},parseHTML:()=>[{tag:"div[data-video-cdtr] iframe"}],addCommands(){return{setVideo:e=>t=>{let{commands:n}=t;return ol(e.src)||rl(e.src)||il(e.src)?(e.src=al({url:e.src}),n.insertContent({type:this.name,attrs:e})):(console.error("Invalid video URL"),!1)}}},addPasteRules(){return this.options.addPasteHandler?[(0,Ae.gg)({find:el,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML(e){let{HTMLAttributes:t}=e;const n=al({url:t.src,allowFullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,controls:this.options.controls,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,nocookie:this.options.nocookie,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor,startAt:t.start||0});return t.src=n,["div",{"data-video-cdtr":""},["iframe",(0,Ae.KV)(this.options.HTMLAttributes,{style:"max-width: 100%;",width:this.options.width,height:this.options.height,allowfullscreen:this.options.allowFullscreen,autoplay:this.options.autoplay,ccLanguage:this.options.ccLanguage,ccLoadPolicy:this.options.ccLoadPolicy,disableKBcontrols:this.options.disableKBcontrols,enableIFrameApi:this.options.enableIFrameApi,endTime:this.options.endTime,interfaceLanguage:this.options.interfaceLanguage,ivLoadPolicy:this.options.ivLoadPolicy,loop:this.options.loop,modestBranding:this.options.modestBranding,origin:this.options.origin,playlist:this.options.playlist,progressBarColor:this.options.progressBarColor},t)]]}}),cl={addAttributes(){return{...this.parent?.(),style:{parseHTML:e=>{const t=e.getAttribute("width");return t?`width: ${t}px; height: auto; cursor: pointer;max-width: 100%;`:`${e.style.cssText}`}}}},addNodeView(){const e=document.createElement("div");return t=>{let{node:n,editor:r,getPos:o}=t;const{view:i,options:{editable:s}}=r,a=document.createElement("iframe");a.src="about:blank",a.style.border="none",a.width="100%",a.height="30px";const l=document.createElement("input");l.style.height="30px",l.style.width="100%",l.value=n.attrs.src,a.addEventListener("load",()=>{a.contentDocument.body.style.margin="0",a.contentDocument.body.style.padding="0",a.contentDocument.body.style.overflow="hidden",a.contentDocument.body.appendChild(l)}),l.addEventListener("input",e=>{e.preventDefault(),e.stopPropagation();const t=l.value;setTimeout(()=>{r.chain().setVideo({src:t,width:n.attrs.width||this.options.width,height:n.attrs.height||this.options.height}).run()},200)}),e.appendChild(a);const c=document.createElement("div");c.setAttribute("data-video-cdtr","");const d=document.createElement("div");d.classList.add("cdtr-video-container");const p=document.createElement("iframe");d.style.width="100%",p.style.maxWidth="100%",p.setAttribute("src",n.attrs.src),p.setAttribute("width",n.attrs.width),p.setAttribute("height",n.attrs.height),p.setAttribute("frameborder","0"),p.setAttribute("allowfullscreen","true"),p.setAttribute("allow","accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture");const u=()=>{e.classList.add("cdtr-position-controller"),(()=>{const e={...n.attrs,style:`${p.style.cssText}`};i.dispatch(i.state.tr.setNodeMarkup(o(),null,e))})(),d.appendChild(e)};return c.setAttribute("style","display: flex;"),c.appendChild(d),d.classList.add("video-container"),d.appendChild(p),s?(d.addEventListener("click",e=>{u(),d.setAttribute("style","position: relative; border: 1px dashed #6C6C6C; cursor: pointer;")}),document.addEventListener("click",t=>{const n=t.target;d.contains(n)||d===n||e.remove()}),{dom:c}):{dom:d}}}},dl=ll.extend(cl);function pl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ul={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function hl(e){ul=e}var fl={exec:()=>null};function ml(e,t=""){let n="string"==typeof e?e:e.source;const r={replace:(e,t)=>{let o="string"==typeof t?t:t.source;return o=o.replace(gl.caret,"$1"),n=n.replace(e,o),r},getRegex:()=>new RegExp(n,t)};return r}var gl={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},bl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,yl=/(?:[*+-]|\d{1,9}[.)])/,Al=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,wl=ml(Al).replace(/bull/g,yl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),vl=ml(Al).replace(/bull/g,yl).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),xl=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,kl=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Cl=ml(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",kl).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),_l=ml(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yl).getRegex(),El="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Sl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Bl=ml("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Sl).replace("tag",El).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ml=ml(xl).replace("hr",bl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",El).getRegex(),Ol={blockquote:ml(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ml).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Cl,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:bl,html:Bl,lheading:wl,list:_l,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Ml,table:fl,text:/^[^\n]+/},Il=ml("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",bl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",El).getRegex(),Tl={...Ol,lheading:vl,table:Il,paragraph:ml(xl).replace("hr",bl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Il).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",El).getRegex()},Ll={...Ol,html:ml("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Sl).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:fl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ml(xl).replace("hr",bl).replace("heading"," *#{1,6} *[^\n]").replace("lheading",wl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Nl=/^( {2,}|\\)\n(?!\s*$)/,Rl=/[\p{P}\p{S}]/u,Dl=/[\s\p{P}\p{S}]/u,zl=/[^\s\p{P}\p{S}]/u,Pl=ml(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Dl).getRegex(),$l=/(?!~)[\p{P}\p{S}]/u,Hl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,jl=ml(Hl,"u").replace(/punct/g,Rl).getRegex(),Ul=ml(Hl,"u").replace(/punct/g,$l).getRegex(),Fl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Vl=ml(Fl,"gu").replace(/notPunctSpace/g,zl).replace(/punctSpace/g,Dl).replace(/punct/g,Rl).getRegex(),ql=ml(Fl,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,$l).getRegex(),Wl=ml("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,zl).replace(/punctSpace/g,Dl).replace(/punct/g,Rl).getRegex(),Yl=ml(/\\(punct)/,"gu").replace(/punct/g,Rl).getRegex(),Xl=ml(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Zl=ml(Sl).replace("(?:--\x3e|$)","--\x3e").getRegex(),Kl=ml("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Zl).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Jl=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Gl=ml(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Jl).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Ql=ml(/^!?\[(label)\]\[(ref)\]/).replace("label",Jl).replace("ref",kl).getRegex(),ec=ml(/^!?\[(ref)\](?:\[\])?/).replace("ref",kl).getRegex(),tc={_backpedal:fl,anyPunctuation:Yl,autolink:Xl,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:Nl,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:fl,emStrongLDelim:jl,emStrongRDelimAst:Vl,emStrongRDelimUnd:Wl,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:Gl,nolink:ec,punctuation:Pl,reflink:Ql,reflinkSearch:ml("reflink|nolink(?!\\()","g").replace("reflink",Ql).replace("nolink",ec).getRegex(),tag:Kl,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:fl},nc={...tc,link:ml(/^!?\[(label)\]\((.*?)\)/).replace("label",Jl).getRegex(),reflink:ml(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Jl).getRegex()},rc={...tc,emStrongRDelimAst:ql,emStrongLDelim:Ul,url:ml(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},oc={...rc,br:ml(Nl).replace("{2,}","*").getRegex(),text:ml(rc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ic={normal:Ol,gfm:Tl,pedantic:Ll},sc={normal:tc,gfm:rc,breaks:oc,pedantic:nc},ac={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},lc=e=>ac[e];function cc(e,t){if(t){if(gl.escapeTest.test(e))return e.replace(gl.escapeReplace,lc)}else if(gl.escapeTestNoEncode.test(e))return e.replace(gl.escapeReplaceNoEncode,lc);return e}function dc(e){try{e=encodeURI(e).replace(gl.percentDecode,"%")}catch{return null}return e}function pc(e,t){const n=e.replace(gl.findPipe,(e,t,n)=>{let r=!1,o=t;for(;--o>=0&&"\\"===n[o];)r=!r;return r?"|":" |"}).split(gl.splitPipe);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(gl.slashPipe,"|");return n}function uc(e,t,n){const r=e.length;if(0===r)return"";let o=0;for(;o<r;){const i=e.charAt(r-o-1);if(i!==t||n){if(i===t||!n)break;o++}else o++}return e.slice(0,r-o)}function hc(e,t,n,r,o){const i=t.href,s=t.title||null,a=e[1].replace(o.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:i,title:s,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}var fc=class{options;rules;lexer;constructor(e){this.options=e||ul}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:uc(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(null===r)return t;const o=r[1];return t.split("\n").map(e=>{const t=e.match(n.other.beginningSpace);if(null===t)return e;const[r]=t;return r.length>=o.length?e.slice(o.length):e}).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){const t=uc(e,"#");this.options.pedantic?e=t.trim():t&&!this.rules.other.endingSpaceChar.test(t)||(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:uc(t[0],"\n")}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let e=uc(t[0],"\n").split("\n"),n="",r="";const o=[];for(;e.length>0;){let t=!1;const i=[];let s;for(s=0;s<e.length;s++)if(this.rules.other.blockquoteStart.test(e[s]))i.push(e[s]),t=!0;else{if(t)break;i.push(e[s])}e=e.slice(s);const a=i.join("\n"),l=a.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${a}`:a,r=r?`${r}\n${l}`:l;const c=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(l,o,!0),this.lexer.state.top=c,0===e.length)break;const d=o.at(-1);if("code"===d?.type)break;if("blockquote"===d?.type){const t=d,i=t.raw+"\n"+e.join("\n"),s=this.blockquote(i);o[o.length-1]=s,n=n.substring(0,n.length-t.raw.length)+s.raw,r=r.substring(0,r.length-t.text.length)+s.text;break}if("list"===d?.type){const t=d,i=t.raw+"\n"+e.join("\n"),s=this.list(i);o[o.length-1]=s,n=n.substring(0,n.length-d.raw.length)+s.raw,r=r.substring(0,r.length-t.raw.length)+s.raw,e=i.substring(o.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:n,tokens:o,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,o={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let s=!1;for(;e;){let n=!1,r="",a="";if(!(t=i.exec(e)))break;if(this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let l=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),c=e.split("\n",1)[0],d=!l.trim(),p=0;if(this.options.pedantic?(p=2,a=l.trimStart()):d?p=t[1].length+1:(p=t[2].search(this.rules.other.nonSpaceChar),p=p>4?1:p,a=l.slice(p),p+=t[1].length),d&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",e=e.substring(c.length+1),n=!0),!n){const t=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),o=this.rules.other.fencesBeginRegex(p),i=this.rules.other.headingBeginRegex(p),s=this.rules.other.htmlBeginRegex(p);for(;e;){const u=e.split("\n",1)[0];let h;if(c=u,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),h=c):h=c.replace(this.rules.other.tabCharGlobal," "),o.test(c))break;if(i.test(c))break;if(s.test(c))break;if(t.test(c))break;if(n.test(c))break;if(h.search(this.rules.other.nonSpaceChar)>=p||!c.trim())a+="\n"+h.slice(p);else{if(d)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(o.test(l))break;if(i.test(l))break;if(n.test(l))break;a+="\n"+c}d||c.trim()||(d=!0),r+=u+"\n",e=e.substring(u.length+1),l=h.slice(p)}}o.loose||(s?o.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(s=!0));let u,h=null;this.options.gfm&&(h=this.rules.other.listIsTask.exec(a),h&&(u="[ ] "!==h[0],a=a.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:r,task:!!h,checked:u,loose:!1,text:a,tokens:[]}),o.raw+=r}const a=o.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),o.raw=o.raw.trimEnd();for(let e=0;e<o.items.length;e++)if(this.lexer.state.top=!1,o.items[e].tokens=this.lexer.blockTokens(o.items[e].text,[]),!o.loose){const t=o.items[e].tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));o.loose=n}if(o.loose)for(let e=0;e<o.items.length;e++)o.items[e].loose=!0;return o}}html(e){const t=this.rules.block.html.exec(e);if(t){return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}}def(e){const t=this.rules.block.def.exec(e);if(t){const e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:r}}}table(e){const t=this.rules.block.table.exec(e);if(!t)return;if(!this.rules.other.tableDelimiter.test(t[2]))return;const n=pc(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const e of r)this.rules.other.tableAlignRight.test(e)?i.align.push("right"):this.rules.other.tableAlignCenter.test(e)?i.align.push("center"):this.rules.other.tableAlignLeft.test(e)?i.align.push("left"):i.align.push(null);for(let e=0;e<n.length;e++)i.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:i.align[e]});for(const e of o)i.rows.push(pc(e,i.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:i.align[t]})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;const t=uc(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let r=0;r<e.length;r++)if("\\"===e[r])r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],r="";if(this.options.pedantic){const e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),hc(t,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return hc(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r)return;if(r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const n=[...r[0]].length-1;let o,i,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,t=t.slice(-1*e.length+n);null!=(r=l.exec(t));){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(i=[...o].length,r[3]||r[4]){s+=i;continue}if((r[5]||r[6])&&n%3&&!((n+i)%3)){a+=i;continue}if(s-=i,s>0)continue;i=Math.min(i,i+s+a);const t=[...r[0]][0].length,l=e.slice(0,n+r.index+t+i);if(Math.min(n,i)%2){const e=l.slice(1,-1);return{type:"em",raw:l,text:e,tokens:this.lexer.inlineTokens(e)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let r;do{r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(r!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},mc=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ul,this.options.tokenizer=this.options.tokenizer||new fc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:gl,block:ic.normal,inline:sc.normal};this.options.pedantic?(t.block=ic.pedantic,t.inline=sc.pedantic):this.options.gfm&&(t.block=ic.gfm,this.options.breaks?t.inline=sc.breaks:t.inline=sc.gfm),this.tokenizer.rules=t}static get rules(){return{block:ic,inline:sc}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(gl.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){const t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(gl.tabCharGlobal," ").replace(gl.spaceLine,""));e;){let r;if(this.options.extensions?.block?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);const n=t.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);const n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);const n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title});continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let o=e;if(this.options.extensions?.startBlock){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(o=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(o))){const i=t.at(-1);n&&"paragraph"===i?.type?(i.raw+="\n"+r.raw,i.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):t.push(r),n=o.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);const n=t.at(-1);"text"===n?.type?(n.raw+="\n"+r.raw,n.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n=e,r=null;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)e.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.anyPunctuation.exec(n));)n=n.slice(0,r.index)+"++"+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(n));)n=n.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let o=!1,i="";for(;e;){let r;if(o||(i=""),o=!1,this.options.extensions?.inline?.some(n=>!!(r=n.call({lexer:this},e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);const n=t.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,i)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let s=e;if(this.options.extensions?.startInline){let t=1/0;const n=e.slice(1);let r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),"number"==typeof r&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(s=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(s)){e=e.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(i=r.raw.slice(-1)),o=!0;const n=t.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},gc=class{options;parser;constructor(e){this.options=e||ul}space(e){return""}code({text:e,lang:t,escaped:n}){const r=(t||"").match(gl.notSpaceStart)?.[0],o=e.replace(gl.endingNewline,"")+"\n";return r?'<pre><code class="language-'+cc(r)+'">'+(n?o:cc(o,!0))+"</code></pre>\n":"<pre><code>"+(n?o:cc(o,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){const t=e.ordered,n=e.start;let r="";for(let t=0;t<e.items.length;t++){const n=e.items[t];r+=this.listitem(n)}const o=t?"ol":"ul";return"<"+o+(t&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+o+">\n"}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?"paragraph"===e.tokens[0]?.type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+cc(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r="";for(let t=0;t<e.rows.length;t++){const o=e.rows[t];n="";for(let e=0;e<o.length;e++)n+=this.tablecell(o[e]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+r+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${cc(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const r=this.parser.parseInline(n),o=dc(e);if(null===o)return r;let i='<a href="'+(e=o)+'"';return t&&(i+=' title="'+cc(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const o=dc(e);if(null===o)return cc(n);let i=`<img src="${e=o}" alt="${n}"`;return t&&(i+=` title="${cc(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:cc(e.text)}},bc=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},yc=class e{options;renderer;textRenderer;constructor(e){this.options=e||ul,this.options.renderer=this.options.renderer||new gc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new bc}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions?.renderers?.[o.type]){const e=o,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==t||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(e.type)){n+=t||"";continue}}const i=o;switch(i.type){case"space":n+=this.renderer.space(i);continue;case"hr":n+=this.renderer.hr(i);continue;case"heading":n+=this.renderer.heading(i);continue;case"code":n+=this.renderer.code(i);continue;case"table":n+=this.renderer.table(i);continue;case"blockquote":n+=this.renderer.blockquote(i);continue;case"list":n+=this.renderer.list(i);continue;case"html":n+=this.renderer.html(i);continue;case"paragraph":n+=this.renderer.paragraph(i);continue;case"text":{let o=i,s=this.renderer.text(o);for(;r+1<e.length&&"text"===e[r+1].type;)o=e[++r],s+="\n"+this.renderer.text(o);n+=t?this.renderer.paragraph({type:"paragraph",raw:s,text:s,tokens:[{type:"text",raw:s,text:s,escaped:!0}]}):s;continue}default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}parseInline(e,t=this.renderer){let n="";for(let r=0;r<e.length;r++){const o=e[r];if(this.options.extensions?.renderers?.[o.type]){const e=this.options.extensions.renderers[o.type].call({parser:this},o);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){n+=e||"";continue}}const i=o;switch(i.type){case"escape":case"text":n+=t.text(i);break;case"html":n+=t.html(i);break;case"link":n+=t.link(i);break;case"image":n+=t.image(i);break;case"strong":n+=t.strong(i);break;case"em":n+=t.em(i);break;case"codespan":n+=t.codespan(i);break;case"br":n+=t.br(i);break;case"del":n+=t.del(i);break;default:{const e='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},Ac=class{options;block;constructor(e){this.options=e||ul}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?mc.lex:mc.lexInline}provideParser(){return this.block?yc.parse:yc.parseInline}},wc=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=yc;Renderer=gc;TextRenderer=bc;Lexer=mc;Tokenizer=fc;Hooks=Ac;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(const r of e)switch(n=n.concat(t.call(this,r)),r.type){case"table":{const e=r;for(const r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(const r of e.rows)for(const e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{const e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{const e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{const o=e[r].flat(1/0);n=n.concat(this.walkTokens(o,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{const n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){const n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let r=e.renderer.apply(this,t);return!1===r&&(r=n.apply(this,t)),r}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");const n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){const t=this.defaults.renderer||new gc(this.defaults);for(const n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,o=e.renderer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){const t=this.defaults.tokenizer||new fc(this.defaults);for(const n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,o=e.tokenizer[r],i=t[r];t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){const t=this.defaults.hooks||new Ac;for(const n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;const r=n,o=e.hooks[r],i=t[r];Ac.passThroughHooks.has(n)?t[r]=e=>{if(this.defaults.async)return Promise.resolve(o.call(t,e)).then(e=>i.call(t,e));const n=o.call(t,e);return i.call(t,n)}:t[r]=(...e)=>{let n=o.apply(t,e);return!1===n&&(n=i.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){const t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return mc.lex(e,t??this.defaults)}parser(e,t){return yc.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{const r={...n},o={...this.defaults,...r},i=this.onError(!!o.silent,!!o.async);if(!0===this.defaults.async&&!1===r.async)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(null==t)return i(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const s=o.hooks?o.hooks.provideLexer():e?mc.lex:mc.lexInline,a=o.hooks?o.hooks.provideParser():e?yc.parse:yc.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(t):t).then(e=>s(e,o)).then(e=>o.hooks?o.hooks.processAllTokens(e):e).then(e=>o.walkTokens?Promise.all(this.walkTokens(e,o.walkTokens)).then(()=>e):e).then(e=>a(e,o)).then(e=>o.hooks?o.hooks.postprocess(e):e).catch(i);try{o.hooks&&(t=o.hooks.preprocess(t));let e=s(t,o);o.hooks&&(e=o.hooks.processAllTokens(e)),o.walkTokens&&this.walkTokens(e,o.walkTokens);let n=a(e,o);return o.hooks&&(n=o.hooks.postprocess(n)),n}catch(e){return i(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){const e="<p>An error occurred:</p><pre>"+cc(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function vc(e,t){return wc.parse(e,t)}vc.options=vc.setOptions=function(e){return wc.setOptions(e),vc.defaults=wc.defaults,hl(vc.defaults),vc},vc.getDefaults=pl,vc.defaults=ul,vc.use=function(...e){return wc.use(...e),vc.defaults=wc.defaults,hl(vc.defaults),vc},vc.walkTokens=function(e,t){return wc.walkTokens(e,t)},vc.parseInline=wc.parseInline,vc.Parser=yc,vc.parser=yc.parse,vc.Renderer=gc,vc.TextRenderer=bc,vc.Lexer=mc,vc.lexer=mc.lex,vc.Tokenizer=fc,vc.Hooks=Ac,vc.parse=vc;vc.options,vc.setOptions,vc.use,vc.walkTokens,vc.parseInline,yc.parse,mc.lex;const xc=e=>[/^#{1,6}\s/m,/\*\*.*\*\*/,/__.*__/,/\*.*\*/,/_.*_/,/\[.*\]\(.*\)/,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m,/```[\s\S]*```/,/`[^`]+`/,/^>\s/m,/!\[.*\]\(.*\)/,/^\s*[-*_]{3,}\s*$/m].some(t=>t.test(e)),kc=Ae.YY.create({name:"markdownPaste",addOptions:()=>({autoDetect:!0}),addProseMirrorPlugins(){const e=this.editor,t=this.options;return[new we.k_({key:new we.hs("markdownPaste"),props:{handlePaste:(n,r,o)=>{if(!t.autoDetect)return!1;const i=r.clipboardData?.getData("text/plain"),s=r.clipboardData?.getData("text/html");if(console.log("Paste event - text:",i),console.log("Paste event - html:",s),console.log("Is markdown?",xc(i)),!i||!xc(i))return console.log("Not markdown or no text, skipping"),!1;if(i.includes("\n")&&!(e=>"string"==typeof e&&[/^#{1,6}\s/m,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m,/```[\s\S]*```/,/^>\s/m,/^\s*[-*_]{3,}\s*$/m].some(t=>t.test(e)))(i)){const e=(e=>{const t=(e=>e.replace(/\r\n?/g,"\n"))(e);return t.split(/\n{2,}/).map(e=>`<p>${e.split("\n").map(e=>vc.parseInline(e,{async:!1})||"<br>").join("<br>")||"<br>"}</p>`).join("")})(i),t=((e,t)=>{const n=document.createElement("div");return n.innerHTML=t,zn.S4.fromSchema(e).parseSlice(n)})(n.state.schema,e);return r.preventDefault(),n.dispatch(n.state.tr.replaceSelection(t).scrollIntoView()),!0}if(s&&s.trim()){const e=/<(?!meta|style|link)([\w]+)[^>]*>/i.test(s);if(console.log("Has rich HTML content:",e),e&&!xc(i))return console.log("Skipping due to rich HTML"),!1}try{let t=vc.parse(i,{async:!1});return console.log("Parsed markdown to HTML:",t),t&&"string"==typeof t&&(t=t.replace(/<a\s+([^>]*?)>/gi,(e,t)=>t.includes("style=")?e.replace(/style="([^"]*)"/i,(e,t)=>t.includes("color:")?e:`style="${t}; color: blue"`):`<a ${t} style="color: blue">`)),r.preventDefault(),e.commands.insertContent(t),!0}catch(e){return console.error("Error parsing markdown:",e),!1}}}})]}}),Cc=Ae.YY.create({name:"markdownContent",addCommands:()=>({setMarkdownContent:e=>t=>{let{commands:n,editor:r}=t;try{let t=vc.parse(e,{async:!1});return t&&"string"==typeof t&&(t=t.replace(/<a\s+([^>]*?)>/gi,(e,t)=>t.includes("style=")?e.replace(/style="([^"]*)"/i,(e,t)=>t.includes("color:")?e:`style="${t}; color: blue"`):`<a ${t} style="color: blue">`)),n.setContent(t)}catch(e){return console.error("Error parsing markdown:",e),!1}},insertMarkdownContent:e=>t=>{let{commands:n,editor:r}=t;try{let t=vc.parse(e,{async:!1});return t&&"string"==typeof t&&(t=t.replace(/<a\s+([^>]*?)>/gi,(e,t)=>t.includes("style=")?e.replace(/style="([^"]*)"/i,(e,t)=>t.includes("color:")?e:`style="${t}; color: blue"`):`<a ${t} style="color: blue">`)),n.insertContent(t)}catch(e){return console.error("Error parsing markdown:",e),!1}}})}),_c=Ae.YY.create({name:"preserveStyle",addStorage:()=>({lastTextStyle:null}),addProseMirrorPlugins(){const e=this;return[new we.k_({key:new we.hs("preserveStyle"),state:{init:()=>null,apply(t,n){const r=t.doc.type.schema.marks.textStyle;if(!r)return n;if(t.storedMarks){const n=t.storedMarks.find(e=>e.type===r);if(n&&n.attrs){const t={};Object.keys(n.attrs).forEach(e=>{null!=n.attrs[e]&&(t[e]=n.attrs[e])}),Object.keys(t).length>0&&(e.storage.lastTextStyle=t)}}return t.steps.forEach(t=>{if("addMark"===t.stepType){const n=t.mark;if(n&&n.type===r&&n.attrs){const t={};Object.keys(n.attrs).forEach(e=>{null!=n.attrs[e]&&(t[e]=n.attrs[e])}),Object.keys(t).length>0&&(e.storage.lastTextStyle=t)}}}),n}}}),new we.k_({key:new we.hs("preserveStyleOnSelection"),appendTransaction(t,n,r){const{selection:o}=r,{$from:i}=o,s=i.parent,a=0===s.content.size,l="paragraph"===s.type.name||"heading"===s.type.name;if(a&&l){const t=r.schema.marks.textStyle;if(!t)return null;const n=i.marks().some(e=>e.type===t),o=r.storedMarks||[],s=o.some(e=>e.type===t);if(!n&&!s&&e.storage.lastTextStyle){const n=r.tr,i=[t.create(e.storage.lastTextStyle),...o.filter(e=>e.type!==t)];return n.setStoredMarks(i),n}}return null}})]},onUpdate(){const{editor:e}=this,t=e.getAttributes("textStyle");if(t&&Object.keys(t).length>0){const e={};Object.keys(t).forEach(n=>{null!=t[n]&&(e[n]=t[n])}),Object.keys(e).length>0&&(this.storage.lastTextStyle=e)}}}),Ec=Ae.YY.create({name:"linkUnlinkStyle",addStorage:()=>({styleBeforeLink:null}),addCommands(){return{saveStyleBeforeLinkFromRange:(e,t)=>t=>{let{state:n}=t;const r=n.schema.marks.textStyle;if(!r)return this.storage.styleBeforeLink=null,!0;const o=n.doc.resolve(e).marks().find(e=>e.type===r);if(!o||!o.attrs)return this.storage.styleBeforeLink=null,!0;const i={};return Object.keys(o.attrs).forEach(e=>{null!=o.attrs[e]&&(i[e]=o.attrs[e])}),this.storage.styleBeforeLink=Object.keys(i).length>0?i:null,!0},unLinkWithStyleRestore:()=>e=>{let{state:t,dispatch:n}=e;const{from:r,to:o}=t.selection,i=t.schema,s=i.marks.link,a=i.marks.textStyle;if(!s||!a)return!1;const l=this.storage.styleBeforeLink,c=t.tr;if(c.removeMark(r,o,s),l&&Object.keys(l).length>0)c.removeMark(r,o,a),c.addMark(r,o,a.create(l));else{const e=t.doc.resolve(r).marks().find(e=>e.type===a),n=e?{...e.attrs,color:null}:{color:null};c.removeMark(r,o,a),c.addMark(r,o,a.create(n))}const d=t.doc.resolve(r).marks().filter(e=>e.type!==a&&e.type!==s),p=l&&Object.keys(l).length>0?a.create(l):a.create({color:null});return c.setStoredMarks([...d,p]),this.storage.styleBeforeLink=null,n&&n(c),!0}}}}),Sc=e=>{const t=e.defaultDirection||"auto";let n=e.content;if(n&&("string"==typeof(r=n)&&[/^#{1,6}\s/m,/\*\*.*\*\*/,/__.*__/,/\*.*\*/,/_.*_/,/\[.*\]\(.*\)/,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m,/```[\s\S]*```/,/`[^`]+`/,/^>\s/m,/!\[.*\]\(.*\)/,/^\s*[-*_]{3,}\s*$/m].some(e=>e.test(r))))try{n=vc.parse(n,{async:!1}),n&&"string"==typeof n&&(n=n.replace(/<a\s+([^>]*?)>/gi,(e,t)=>t.includes("style=")?e.replace(/style="([^"]*)"/i,(e,t)=>t.includes("color:")?e:`style="${t}; color: blue"`):`<a ${t} style="color: blue">`))}catch(e){console.error("Error parsing markdown content:",e)}var r;if(n&&"object"==typeof n&&"doc"===n.type&&Array.isArray(n.content)){const e=new Set(["text","hardBreak","button"]),t=new Set(["listItem","customBulletItem","blockquote"]),r=n=>{if(!n||"object"!=typeof n)return n;if(!Array.isArray(n.content))return n;let o=n.content.map(r);if("doc"===n.type){const e=new Set(["text","hardBreak","button"]);o=o.filter(t=>!e.has(t.type))}else if(t.has(n.type)&&o.length>0){let t=0;for(;t<o.length&&e.has(o[t].type);)t++;t>0&&(o=[{type:"paragraph",content:o.slice(0,t)},...o.slice(t)])}return{...n,content:o}};n=r(n)}const{content:o,...i}=e,s=new Ae.KE({autofocus:!1,content:n,editorProps:{handleDOMEvents:{drop:(e,t)=>{if(t.dataTransfer&&"move"===t.dataTransfer.effectAllowed&&1===t.dataTransfer.items.length&&"text/plain"===t.dataTransfer.items[0].type){const e=t.dataTransfer.getData("text/plain");"string"!=typeof e||e.trim()||t.preventDefault()}}},handlePaste:(e,t,n)=>{const r=t.clipboardData?.getData("text/plain");if(!r||!(e=>{try{const t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch(t){return/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/i.test(e.trim())}})(r.trim()))return!1;const o=e.state,{from:i,to:s}=o.selection,a=o.doc.textBetween(i,s),l=o.schema.marks.link,c=o.schema.marks.textStyle;if(!l)return!1;let d=r.trim();d.startsWith("http://")||d.startsWith("https://")||(d="https://"+d);const p=a&&(e=>{if(!e||"string"!=typeof e)return!1;const t=e.trim();return/^(https?:\/\/|www\.|[\w-]+\.(com|org|net|io|co|edu|gov|mil|int|biz|info|name|pro|museum|aero|coop|travel|jobs|mobi|asia|tel|xxx|[\w]{2,}))[\w\.\/\-\?\=\&\#\@\%\+\~]*/i.test(t)})(a);if(p){let t=!1,n=null;if(o.doc.nodesBetween(i,s,(e,r)=>{if(t)return!1;Math.max(i,r),Math.min(s,r+e.nodeSize);return e.marks.forEach(e=>{"link"===e.type.name&&(t=!0,n=e)}),!t}),!t){const e=o.storedMarks?.find(e=>"link"===e.type.name),r=o.selection.$from.marks().find(e=>"link"===e.type.name),i=o.selection.$to.marks().find(e=>"link"===e.type.name);n=e||r||i,t=!!n}const r=o.tr;if(t){r.removeMark(i,s,l),r.replaceWith(i,s,o.schema.text(d));const e=i,t=i+d.length;r.addMark(e,t,l.create({href:d})),c&&r.addMark(e,t,c.create({color:"blue"}))}else{r.replaceWith(i,s,o.schema.text(d));const e=i,t=i+d.length;r.addMark(e,t,l.create({href:d})),c&&r.addMark(e,t,c.create({color:"blue"}))}const a=i+d.length;return r.setSelection(we.U3.near(r.doc.resolve(a))),e.dispatch(r),!0}{const t=o.tr;if(a&&i!==s){if(t.addMark(i,s,l.create({href:d})),c){let e={};o.doc.nodesBetween(i,s,(t,n)=>{Math.max(i,n),Math.min(s,n+t.nodeSize);t.marks.forEach(t=>{"textStyle"===t.type.name&&(e={...e,...t.attrs})})});const n={...e,color:"blue"};t.addMark(i,s,c.create(n))}t.setSelection(we.U3.near(t.doc.resolve(s)))}else{t.replaceWith(i,s,o.schema.text(d));const e=i,n=i+d.length;t.addMark(e,n,l.create({href:d})),c&&t.addMark(e,n,c.create({color:"blue"})),t.setSelection(we.U3.near(t.doc.resolve(n)))}return e.dispatch(t),!0}},transformPastedHTML:e=>(e&&"string"==typeof e&&(e=(e=e.replace(/style="([^"]*)"/gi,(e,t)=>{let n=t.replace(/line-height\s*:\s*[^;]*(px|em|rem|pt|pc|in|cm|mm|ex|ch|vw|vh|vmin|vmax|%)[^;]*;?/gi,"");return n=n.replace(/;;+/g,";").replace(/^;\s*|;\s*$/g,"").trim(),`style="${n}"`})).replace(/<a\s+([^>]*?)>/gi,(e,t)=>t.includes("style=")?e.replace(/style="([^"]*)"/i,(e,t)=>t.includes("color:")?e:`style="${t}; color: blue"`):`<a ${t} style="color: blue">`)),e)},extensions:[Be.A,Ye.configure({placeholder:e=>{let{node:t}=e;return"paragraph"===t.type.name?B.M.get("lang","add_content_to_paragraph"):"heading"===t.type.name?B.M.get("lang","add_content_to_heading"):null}}),Yn,Me.configure({HTMLAttributes:{class:"cdtr-heading",style:"font-weight: initial"}}),dl,Rn,Oe.A,Yo.extend({inclusive:!1}).configure({openOnClick:!1,HTMLAttributes:{class:"cdtr-editor-link"}}),pt.configure({draggable:!0}),lt.configure({keepMarks:!0}),Tn.configure({lowlight:Wa,draggable:!0,defaultLanguage:"javascript"}),Nn.configure({fonts:e.fontFamilies}),Re,De,ve.Ay,Ve,qe,Ss,Ga,rt,xs.configure({resizable:!1,draggable:!0,lastColumnResizable:!1,HTMLAttributes:{class:"cdtr-table-element"}}),Cs.configure({draggable:!0}),_s,Es,We,Xa.configure({inline:!1,HTMLAttributes:{"data-type":"inline-image","cdtr-resizable":"true",style:"display: block; margin: 0 auto;"}}),Je.configure({class:"dropcursor",color:"black",width:2}),et.configure({types:["heading","blockquote","paragraph","taskList","customBulletList","bulletList","orderedList"]}),Qe.configure({types:["heading","blockquote","paragraph","taskList","orderedList"]}),Ge.configure({defaultDirection:t,types:["heading","blockquote","paragraph","taskList","customBulletList","bulletList","orderedList"]}),Bs.configure({types:["heading","paragraph"],defaultAlignment:"rtl"===t?"right":"left"}),Se,Ee,_c,Ec,$e,ks,_e,xe,at,st,Wn,kc,Cc],...i});return s};n(15305);var Bc=n(83263),Mc={};Mc.setAttributes=P(),Mc.insert=D().bind(null,"head"),Mc.domAPI=N(),Mc.insertStyleElement=H();T()(Bc.A,Mc);Bc.A&&Bc.A.locals&&Bc.A.locals;var Oc=n(91597);n(64569);const Ic={paragraph:16,heading:32,h1:32,h2:28,h3:24,h4:20,h5:18,h6:16,listItem:16,tableCell:16,tableHeader:16,blockquote:18,codeBlock:14,text:16,span:16,div:16,li:16,td:16,th:16,p:16},Tc={paragraph:"Arial",heading:"Arial",h1:"Arial",h2:"Arial",h3:"Arial",h4:"Arial",h5:"Arial",h6:"Arial",listItem:"Arial",tableCell:"Arial",tableHeader:"Arial",blockquote:"Arial",codeBlock:"Courier New",text:"Arial",span:"Arial",div:"Arial",li:"Arial",td:"Arial",th:"Arial",p:"Arial"},Lc={paragraph:1.4,heading:1.2,h1:1.2,h2:1.2,h3:1.2,h4:1.2,h5:1.2,h6:1.2,listItem:1.4,tableCell:1.4,tableHeader:1.4,blockquote:1.4,codeBlock:1.4,text:1.4,span:1.4,div:1.4,li:1.4,td:1.4,th:1.4,p:1.4};function Nc(e){return null!=e&&""!==e}function Rc(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e)return void console.warn("No editor provided");const o={...Ic,...t},i={...Tc,...n},s={...Lc,...r};console.log("Validating default values..."),console.log("Font sizes:",o),console.log("Font families:",i),console.log("Line heights:",s),console.log("=== APPLYING FONT SIZES, FAMILIES, AND LINE HEIGHTS TO TIPTAP DOCUMENT ==="),console.log("Font sizes to apply:",o),console.log("Font families to apply:",i),console.log("Line heights to apply:",s);const{state:a}=e,{doc:l}=a;l.descendants((t,n)=>{const r=t.type.name;console.log(`Processing node: ${r} at position ${n}`);const a=t.marks?.find(e=>"textStyle"===e.type.name)?.attrs?.fontSize,l=t.marks?.find(e=>"textStyle"===e.type.name)?.attrs?.fontFamily;if(a||l)console.log(`Node at position ${n} already has font attributes:`,{fontSize:a||"not set",fontFamily:l||"not set"});else{let a=null,l=null,c=null;if("heading"===r){const e=t.attrs.level;a=o[`h${e}`]||o.heading,l=i[`h${e}`]||i.heading,c=s[`h${e}`]||s.heading,console.log(`Heading level ${e}:`,{fontSize:a||"not set",fontFamily:l||"not set",lineHeight:c||"not set"})}else o[r]&&(a=o[r],l=i[r],c=s[r],console.log(`Node type ${r}:`,{fontSize:a||"not set",fontFamily:l||"not set",lineHeight:c||"not set"}));(a||l||c)&&function(e,t,n,r,o,i){try{let s=e.chain().focus().setTextSelection({from:t,to:t+n});Nc(r)&&(s=s.setFontSize(r),console.log(`Setting font size: ${r}`)),Nc(o)&&(s=s.setFontFamily(o),console.log(`Setting font family: ${o}`)),Nc(i)&&(s=s.setLineHeight(i),console.log(`Setting line height: ${i}`)),s.run(),console.log(`Applied to node at position ${t}:`,{fontSize:r||"not set",fontFamily:o||"not set",lineHeight:i||"not set"})}catch(e){console.warn(`Failed to apply font and line height to node at position ${t}:`,e)}}(e,n,t.nodeSize,a,l,c)}return!0}),console.log("Font and line height application complete")}function Dc(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];e&&t&&(console.log("=== INSERTING CONTENT AND APPLYING FONT SIZES, FAMILIES, AND LINE HEIGHTS ==="),console.log("Content to insert:",t),console.log("Preserve existing fonts:",i),e.commands.insertContent(t),i||setTimeout(()=>{Rc(e,n,r,o)},100),e.chain().focus())}const zc=(0,Oc.S)(),Pc="selection-background";function $c(e,t){e?t.classList.add(de.active):t.classList.remove(de.active)}!function(){if(document.getElementById("theme-provider-vars"))return;const e=document.createElement("style");e.innerHTML='#input-iframe--v1, :root {\n --radius: 20px;\n --sm-radius: .25rem;\n --secondary: #0a0a0a;\n --dark: #002d5c; /* Darker blue shade */\n --sidebar-color: #1a73e8; /* Sidebar primary color */\n --sidebar-icon-color: #fff;\n --primary: #4285f4; /* Primary theme color */\n --primaryText: #ffffff; /* Text on primary color */\n --primary-text: #ffffff; /* Text on primary color */\n --resizer-color: #c1c1c1; /* Light gray resizer */\n --alpha: 0.8; /* Example alpha transparency */\n --micro-info-color: #7d7d7d;\n --bgPrimary: #f5f5f5; /* Background primary color */\n --secondary: #808080; /* Secondary color */\n --disabled: #d3d3d3; /* Disabled element color */\n --icon-color: #000000; /* Black for icons */\n --error-color: rgba(165, 16, 16, 0.877); \n --input-border-color: #9EADBD;\n --font-family: "Arial, sans-serif"; /* Example font family */\n --cdtr-font-family: "Arial, sans-serif"; /* Same as above */\n --layout-holder-color: #e0e0e0; /* Light gray background */\n --justify-content: center; /* Example alignment */\n --row-direction: row; /* Default row direction */\n --medium-box-shadow: 0 2px 10px 0 rgb(0 6 36 / 20%);\n --section-padding: 10px;\n --add-padding-row: 25px 0 25px 0;\n --section-padding-top: 6px;\n --section-padding-bottom: 6px;\n --margin-top: 1rem;\n --divider-color: #00000026;\n --focus-shadow: 0 0 0 0.15rem rgb(13 110 253 / 10%);\n --text-align-locale: left; /* Example locale text alignment */\n --direction-locale: rtl; /* Left-to-right direction */\n --direction: rtl; /* Left-to-right direction */\n --section-hover: #f0f0f048;\n --spacing-sm: .1rem;\n --paper-font-subhead_-_font-size: 13px;\n --editor-font-size: 13px;\n --paper-item-min-height: 30px;\n --element-border-color: rgba(0, 0, 0, 0.116);\n --editor-input-height: 30px;\n --title-block-height: 50px;\n --text-dark-color: #000000;\n} ',document.head.appendChild(e)}();const Hc=e=>{const{defaultDirection:t,content:n,editable:I,element:T,builder:L=[],language:N,editorWidth:R,onClickMagic:D}=e,z=L.find(e=>"fontFamily"===e.type),P=Sc({fontFamilies:z?.fonts||[],defaultDirection:t,element:T,editable:I,content:n,language:N}),$=(z?.fonts.length>0&&z.fonts,L.find(e=>"fontSize"===e.type)),H=$?$.sizes:[8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174],j={direction:()=>{const e=P.isActive({direction:"rtl"})?"ltr":"rtl";F.direction.element.innerHTML="ltr"===e?a().outerHTML:(e=>(0,r.A)("svg",(0,o.A)({},e,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"}),(0,r.A)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,r.A)("path",{d:"M11 5v10H9v-4a4 4 0 1 1 0-8h8v2h-2v10h-2V5h-2zM9 5a2 2 0 1 0 0 4V5zm8 12v-2.5l4 3.5-4 3.5V19H5v-2h12z"})))().outerHTML},fontWeight:()=>{$c(P.isActive("bold"),F.bold.element)},italic:()=>{$c(P.isActive("italic"),F.italic.element)},link:()=>{$c(P.isActive("link"),F.link.element)},unLink:()=>{P.isActive("link")?F.unLink.element.classList.remove(de.disabled):F.unLink.element.classList.add(de.disabled)},underline:()=>{$c(P.isActive("underline"),F.underline.element)},strike:()=>{$c(P.isActive("strike"),F.strike.element)},color:()=>{const e=P.getAttributes("textStyle").color||"black";F.fontColor.element.setAttribute("value",e)},background:()=>{const e=P.getAttributes("textStyle").backgroundColor||"#fff";F.backcolor.element.setAttribute("value",e)},fontFamily:()=>{const e=P.getAttributes("textStyle").fontFamily?.split(",")[0].replace(/['"]+/g,"");F.fontFamily.element.value=e||"Arial",F.fontFamily.element.name=e||"Arial"},table:()=>{$c(P.isActive("table"),F.table.element)},image:()=>$c(P.isActive("image"),F.image.element),video:()=>$c(P.isActive("video"),F.video.element),bulletList:()=>$c(P.isActive("bulletList"),F.bullet.element),customBulletList:()=>$c(P.isActive("customBulletList"),F.customList.element),numberedList:()=>{$c(P.isActive("orderedList"),F.numbered.element)},quotes:()=>$c(P.isActive("blockquote"),F.quotes.element),horizontalRule:()=>$c(P.isActive("horizontalRule"),F.horizonRule.element),textAlign:()=>{["justify","center","right","left"].forEach(e=>{$c(P.isActive({textAlign:e}),F[e].element)})},fontSize:()=>{P.getAttributes("textStyle").fontSize;F.fontSize.element.patch(P.getAttributes("textStyle").fontSize||"16px")}},U={removeTable:()=>P.chain().focus().deleteTable().run(),addTable:e=>{const t=(0,r.A)(ae,{style:{width:"220px",padding:"15px"},headerText:"add_table",target:e.target},(0,r.A)("cdtr-table-cells-editor",{onChange:e=>{let{target:n}=e;const{x:r,y:o}=n.value;t.remove(),P.chain().focus().insertTable({rows:r,cols:o,withHeaderRow:!0}).run()}}));document.body.appendChild(t)},setButton:()=>{P.chain().focus().toggleButton({text:"button",width:"100",height:"100"}).run()},addImage:()=>{P.chain().focus().setImage({src:"https://picsum.photos/100/100",alt:""}).run()},setVideo:()=>{P.chain().focus().setVideo({src:"https://www.youtube.com/watch?v=HUYB8EY09ME",width:"500",height:"300"}).run()},setQuotes:()=>{P.chain().focus().toggleBlockquote().run()},setCode:()=>{P.chain().focus().toggleCodeBlock().run()},setHorizonRule:()=>{P.chain().focus().setHorizontalRule({url:"https://www.youtube.com/watch?v=HUYB8EY09ME",width:"100",height:"100"}).run()},clearFormat:()=>{P.chain().focus().unsetAllMarks().run()},emoji:e=>{},table:()=>P.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),bold:()=>P.chain().focus().toggleBold().run(),italic:()=>P.chain().focus().toggleItalic().run(),underline:()=>P.chain().focus().toggleUnderline().run(),strike:()=>P.chain().focus().toggleStrike().run(),direction:()=>{const e=P.isActive({direction:"rtl"})?"ltr":"rtl";P.chain().focus().setDirection(e).run()},textAlign:e=>P.chain().focus().setTextAlign(e).run(),bullets:()=>P.chain().focus().toggleBulletList().run(),numbered:()=>P.chain().focus().toggleOrderedList().run(),customList:()=>P.chain().focus().toggleCustomList().run(),fontSize:e=>{P.chain().focus().setFontSize(e).run()},fontFamily:e=>P.chain().focus().setFontFamily(e).run(),link:e=>{if(!e)return null;e.target.closest("button");const t=(0,r.A)("cdtr-link-element",{href:P.getAttributes("link").href||"",protocol:P.getAttributes("link").protocol,target:P.getAttributes("link").target,onBlur:e=>(e=>{const t=P.state,{from:n,to:r}=t.selection;let o=[];t.doc.nodesBetween(n,r,e=>{o=[...o,...e.marks]});const i=o.find(e=>"link"===e.type.name),s=e.target.value;s.getUrlWithParams&&(s.href=s.getUrlWithParams()),i?P.chain().focus().setColor("blue").extendMarkRange("link").updateAttributes("link",s).setTextSelection({from:r,to:r}).unsetColor().focus().run():(P.commands.saveStyleBeforeLinkFromRange(n,r),P.chain().focus().setTextSelection({from:n,to:r}).setColor("blue").setLink(s).setTextSelection({from:r,to:r}).unsetColor().focus().run()),setTimeout(()=>P.chain().setTextSelection({from:r,to:r}).unsetColor().focus().run(),0)})(e)});B.M.get("injectEditor")((0,r.A)("cdtr-editor-container",null,t))},unLink:()=>P.chain().focus().extendMarkRange("link").unLinkWithStyleRestore().run(),forColor:e=>{P.chain().setColor(e).focus().run()},clearColor:()=>P.chain().focus().unsetColor().run(),clearBackcolor:()=>P.chain().focus().unsetBackgroundColor().run(),backColor:e=>P.chain().focus().setBackgroundColor(e).run(),onClickMagic:()=>{const e={selectAll:()=>(P.chain().focus().selectAll().run(),e),selectNode:t=>(P.chain().focus().selectNode(t).run(),e),selectParentNode:()=>(P.chain().focus().selectParentNode().run(),e),insertContent:t=>(P.commands.insertContent(t),P.chain().focus(),e),insertContentHtml:t=>{const n=vc.parse(t,{async:!1});return Dc(P,n,{},{},{},!0),e},getHTML:()=>P.getHTML(),getText:()=>P.getText(),getJSON:()=>P.getJSON()};D(e)}};let F={bold:{element:(0,r.A)(q,{onClick:U.bold},(0,r.A)(i,null)),className:de.colBtn,title:"bold"},underline:{element:(0,r.A)(q,{onClick:U.underline},(0,r.A)(u,null)),className:de.colBtn,title:"underline"},italic:{element:(0,r.A)(q,{onClick:U.italic},(0,r.A)(p,null)),className:de.colBtn,title:"italic"},strike:{element:(0,r.A)(q,{onClick:U.strike},(0,r.A)(h,null)),className:de.colBtn,title:"strikeThrough",divider:!0},fontFamily:{element:(0,r.A)("cdtr-font-family-editor",{light:!0,onChange:e=>{const t=e.target.value;U.fontFamily(t)}}),className:de.dropdown,title:"fontFamily",divider:!0},fontSize:{element:(0,r.A)(fe,{style:{fontSize:"13px",boxShadow:"none"},icon:(0,r.A)(g,null),title:8,className:de.dropdown},H.map(e=>(0,r.A)(me,{style:{fontSize:"13px"},onClick:()=>U.fontSize(e),className:de.fontSizeItem,value:e+"px"},e,"px"))),className:de.dropdown,title:"fontSize",divider:!0},left:{element:(0,r.A)(q,{onClick:()=>U.textAlign("left")},(0,r.A)(b,null)),className:de.colBtn,title:"left"},center:{element:(0,r.A)(q,{onClick:()=>U.textAlign("center")},(0,r.A)(A,null)),className:de.colBtn,title:"center"},right:{element:(0,r.A)(q,{onClick:()=>U.textAlign("right")},(0,r.A)(y,null)),className:de.colBtn,title:"right"},justify:{element:(0,r.A)(q,{onClick:()=>U.textAlign("justify")},(0,r.A)(w,null)),className:de.colBtn,title:"justify",divider:!0},direction:{element:(0,r.A)(q,{onClick:U.direction},(0,r.A)(a,null)),className:de.colBtn,title:B.M.get("lang","direction"),divider:!0},fontColor:{element:(0,r.A)("color-playground",{ref:{onCreate:e=>{e.hasAlpha=!1,e.type="text"}},onChange:e=>{U.forColor(e.target.value),re({context:{"::selection":{background:"transparent"}},id:Pc}),zc.run(()=>{document.getElementById(Pc).remove()},1500)},className:"cdtr-plugin","data-color":!0}),className:de.colBtn,title:"forecolor"},backcolor:{element:(0,r.A)("color-playground",{type:"background",ref:{onCreate:e=>{e.hasAlpha=!1}},onChange:e=>{U.backColor(e.target.value),re({context:{"::selection":{background:"transparent"}},id:Pc}),zc.run(()=>{document.getElementById(Pc).remove()},1500)},className:"cdtr-plugin","data-color":!0}),className:de.colBtn,title:B.M.get("lang","backcolor"),endLine:!0},bullet:{element:(0,r.A)(q,{onClick:U.bullets},(0,r.A)(c,null)),className:de.colBtn,title:"bullets"},numbered:{element:(0,r.A)(q,{onClick:U.numbered},(0,r.A)(d,null)),className:de.colBtn,title:"numbered"},customList:{element:(0,r.A)(q,{onClick:U.customList},(0,r.A)(l,null)),className:de.colBtn,title:"taskList_with_icons",divider:!0},link:{element:(0,r.A)(q,{onClick:U.link},(0,r.A)(f,null)),className:de.colBtn,title:"link"},unLink:{element:(0,r.A)(q,{onClick:U.unLink},(0,r.A)(m,null)),className:de.colBtn,divider:!0,title:"unLink"},emoji:{element:(0,r.A)(q,{onClick:e=>{const t=(0,r.A)("cdtr-emoji-picker",null);t.onEmojiClick=(e,t)=>{P.commands.insertContent(t.emoji),P.chain().focus(),n.close()};const n=(0,r.A)(ae,{target:e.target},t);document.body.appendChild(n)}},(0,r.A)(k,{className:de.colorBtn})),className:de.colBtn,title:"emoji",divider:!0},image:{element:(0,r.A)(q,{onClick:U.addImage},(0,r.A)(x,{className:de.colorBtn})),className:de.colBtn,title:"image"},video:{element:(0,r.A)(q,{onClick:U.setVideo},(0,r.A)(v,{className:de.colorBtn})),className:de.colBtn,title:"video"},horizonRule:{element:(0,r.A)(q,{onClick:U.setHorizonRule},(0,r.A)(C,{className:de.colorBtn})),className:de.colBtn,title:"divider"},table:{element:(0,r.A)(q,{onClick:U.addTable},(0,r.A)(S,{className:de.colorBtn})),className:de.colBtn,title:"table",divider:!0},quotes:{element:(0,r.A)(q,{onClick:U.setQuotes},(0,r.A)(_,{className:de.colorBtn})),className:de.colBtn,title:"quotes",divider:!0},clearFormat:{element:(0,r.A)(q,{onClick:U.clearFormat},(0,r.A)(E,{className:de.colorBtn})),className:de.colBtn,title:"clearFormat",divider:!0},magic:{element:(0,r.A)(q,{onClick:U.onClickMagic},(0,r.A)(s,null)),className:de.colBtn,title:"magic",divider:!0},mergeTags:{element:(0,r.A)("cdtr-merge-tags",{onChange:e=>{P.commands.insertContent(e.target.value),P.chain().focus();const t=document.querySelector("cdtr-drop-modal");t?.remove()}}),title:"mergeTags",divider:!0}};const W="editor";W&&W.textEditor&&W.textEditor.cmds&&Array.isArray(W.textEditor.cmds)&&W.textEditor.cmds.forEach(e=>{const t="function"==typeof e.element?{element:e.element(),title:e.title,className:e.className||""}:{divider:e.divider};F["extend-"+(0,V.A)()]=t});const Y=(()=>{const e=[];for(const t in F)if(Object.hasOwnProperty.call(F,t)){if(L.find(e=>e.type===t)){const n=F[t];n&&n.element&&(n.element.classList.add("cdtr-button-cmd"),n.element.classList.add(de.btn),e.push(n)),n.endLine&&(e.push({endLine:!0}),delete n.endLine),n.divider&&(e.push({divider:!0}),delete n.divider)}}return e})(),X=e=>{let{editor:t}=e;for(const e in j)if(Object.hasOwnProperty.call(j,e)){(0,j[e])()}};return{component:new O({onLoad:()=>{P.off("selectionUpdate",X),P.off("transaction",X),P.on("selectionUpdate",X),P.on("transaction",X),window.removeEventListener("click",X),window.addEventListener("click",X),X({editor:P})},onUnload:()=>{},children:(0,r.A)("cdtr-row",{style:{width:R||null},justify:"flex-start",alignItems:"center",className:M(de.textEditor,"cdtr-plugin","cdtr-text-editor-plugin",de.fadeUp)},Y.map((e,t)=>e.divider?(0,r.A)("div",{className:de.dividerY}):e.endLine?(0,r.A)("cdtr-col",{sm:12}):(0,r.A)("cdtr-col",{"tooltip-dir":"top",className:e.className},(0,r.A)("cdtr-tooltip",{placement:"top",content:e.title,delay:"600,0"},e.element," ")," ")),(0,r.A)("div",{className:de.dividerX}))}),editor:P}};const jc=function e(t){t&&t.firstChild&&(t.removeChild(t.firstChild),e(t))},Uc=["click","mouseover","mousedown","mousemove","mouseup","keydown","keyup","scroll"];const Fc=new class{constructor(){this.onDispatchEvent=this.onDispatchEvent.bind(this),this.events=Object.fromEntries(Uc.map(e=>[e,[]]))}onDispatchEvent(e){const t=this.events[e.type];Array.isArray(t)&&requestAnimationFrame(()=>{for(let n=t.length-1;n>=0;n--){const r=t[n];"function"==typeof r?r(e):t.splice(n,1)}})}destroy(){Uc.forEach(e=>{this.events[e]?.length>0&&(window.removeEventListener(e,this.onDispatchEvent),this.events[e]=[])})}connect(e,t){this.events[e]?(0===this.events[e].length&&window.addEventListener(e,this.onDispatchEvent,!1),this.events[e].includes(t)?console.warn("domevents: callback already subscribed to",e):this.events[e].push(t)):console.error("domevents: unsupported event name",e)}disconnect(e,t){if(!this.events[e])return void console.error("domevents: unsupported event name",e);const n=this.events[e].indexOf(t);-1!==n&&(this.events[e].splice(n,1),0===this.events[e].length&&window.removeEventListener(e,this.onDispatchEvent))}};Fc.connect("mousemove",e=>{B.M.set({mouse:{x:e.pageX,y:e.pageY}})});const Vc=Fc;const qc=new class{constructor(){this.selectedRows=[],this.connected=!1,this.onExecute=(e,t)=>{},this.connect=this.connect.bind(this),this.node=(0,r.A)("cdtr-table-editor",{onChange:this.onExecute}),this.render=this.render.bind(this),Vc.connect("keydown",this.render),Vc.connect("scroll",this.render)}disconnect(){this.connected=!1,this.node.remove()}connect(e,t){this.connected=!0,this.target=e,this.editor=t,this.render()}render(){if(this.connected&&this.target){const e=this.target.getBoundingClientRect();let t=e.top+e.height+5;t+43>window.innerHeight&&(t=window.innerHeight-43),t<e.top&&(t=e.top),this.node.setAttribute("top",t),this.node.setAttribute("left",e.left),this.node.setAttribute("width",e.width),this.node.setAttribute("height",e.height),document.body.appendChild(this.node),this.selectedRows=Array.from(this.target.querySelectorAll(".selectedCell")),this.node.setAttribute("selectedRows",this.selectedRows.length)}}},Wc=qc;class Yc extends be.WF{constructor(){super(),this.className="cdtr-button-cmd",this.cmds={tdColor:e=>{qc.editor.commands.updateAttributes("tableCell",{borderColor:e.target.value})},toggleHeaderColumn:()=>qc.editor.chain().focus().toggleHeaderColumn().run(),toggleHeaderCell:()=>qc.editor.chain().focus().toggleHeaderCell().run(),mergeOrSplit:()=>qc.editor.chain().focus().mergeOrSplit().run(),addRowAfter:()=>qc.editor.chain().focus().addRowAfter().run(),addRowBefore:()=>qc.editor.chain().focus().addRowBefore().run(),addColumnBefore:()=>qc.editor.chain().focus().addColumnBefore().run(),addColumnAfter:()=>qc.editor.chain().focus().addColumnAfter().run(),deleteColumn:()=>qc.editor.chain().focus().deleteColumn().run(),deleteRow:()=>qc.editor.chain().focus().deleteRow().run(),splitCell:()=>qc.editor.chain().focus().splitCell().run(),deleteTable:()=>qc.editor.chain().focus().deleteTable().run(),mergeCells:()=>qc.editor.chain().focus().mergeCells().run(),setWidth:()=>{qc.editor.commands.updateAttributes("table",{width:"300px"})}}}render(){return be.qy`<div
1679
1679
  class="editor cdtr-button-cmd"
1680
1680
  style="width:auto;top:${parseInt(this.top)}px;left:${this.left}px"
1681
1681
  >