@creaditor/newsletter-starterkit 1.0.37-preview.2 → 1.0.37-preview.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/creaditor.bundle.js
CHANGED
|
@@ -1727,7 +1727,7 @@
|
|
|
1727
1727
|
.container {
|
|
1728
1728
|
margin: auto;
|
|
1729
1729
|
}
|
|
1730
|
-
`),customElements.get("cdtr-table-cells-editor")||customElements.define("cdtr-table-cells-editor",yt);var At=n(88573),wt=n(27191),vt=n(64652);const _t=At.hj.create({name:"smilieReplacer",addInputRules:()=>[(0,At.DS)({find:/-___- $/,replace:"😑 "}),(0,At.DS)({find:/:'-\) $/,replace:"😂 "}),(0,At.DS)({find:/':-\) $/,replace:"😅 "}),(0,At.DS)({find:/':-D $/,replace:"😅 "}),(0,At.DS)({find:/>:-\) $/,replace:"😆 "}),(0,At.DS)({find:/-__- $/,replace:"😑 "}),(0,At.DS)({find:/':-\( $/,replace:"😓 "}),(0,At.DS)({find:/:'-\( $/,replace:"😢 "}),(0,At.DS)({find:/>:-\( $/,replace:"😠 "}),(0,At.DS)({find:/O:-\) $/,replace:"😇 "}),(0,At.DS)({find:/0:-3 $/,replace:"😇 "}),(0,At.DS)({find:/0:-\) $/,replace:"😇 "}),(0,At.DS)({find:/0;\^\) $/,replace:"😇 "}),(0,At.DS)({find:/O;-\) $/,replace:"😇 "}),(0,At.DS)({find:/0;-\) $/,replace:"😇 "}),(0,At.DS)({find:/O:-3 $/,replace:"😇 "}),(0,At.DS)({find:/:'\) $/,replace:"😂 "}),(0,At.DS)({find:/:-D $/,replace:"😃 "}),(0,At.DS)({find:/':\) $/,replace:"😅 "}),(0,At.DS)({find:/'=\) $/,replace:"😅 "}),(0,At.DS)({find:/':D $/,replace:"😅 "}),(0,At.DS)({find:/'=D $/,replace:"😅 "}),(0,At.DS)({find:/>:\) $/,replace:"😆 "}),(0,At.DS)({find:/>;\) $/,replace:"😆 "}),(0,At.DS)({find:/>=\) $/,replace:"😆 "}),(0,At.DS)({find:/;-\) $/,replace:"😉 "}),(0,At.DS)({find:/\*-\) $/,replace:"😉 "}),(0,At.DS)({find:/;-\] $/,replace:"😉 "}),(0,At.DS)({find:/;\^\) $/,replace:"😉 "}),(0,At.DS)({find:/B-\) $/,replace:"😎 "}),(0,At.DS)({find:/8-\) $/,replace:"😎 "}),(0,At.DS)({find:/B-D $/,replace:"😎 "}),(0,At.DS)({find:/8-D $/,replace:"😎 "}),(0,At.DS)({find:/:-\* $/,replace:"😘 "}),(0,At.DS)({find:/:\^\* $/,replace:"😘 "}),(0,At.DS)({find:/:-\) $/,replace:"🙂 "}),(0,At.DS)({find:/-_- $/,replace:"😑 "}),(0,At.DS)({find:/:-X $/,replace:"😶 "}),(0,At.DS)({find:/:-# $/,replace:"😶 "}),(0,At.DS)({find:/:-x $/,replace:"😶 "}),(0,At.DS)({find:/>.< $/,replace:"😣 "}),(0,At.DS)({find:/:-O $/,replace:"😮 "}),(0,At.DS)({find:/:-o $/,replace:"😮 "}),(0,At.DS)({find:/O_O $/,replace:"😮 "}),(0,At.DS)({find:/>:O $/,replace:"😮 "}),(0,At.DS)({find:/:-P $/,replace:"😛 "}),(0,At.DS)({find:/:-p $/,replace:"😛 "}),(0,At.DS)({find:/:-Þ $/,replace:"😛 "}),(0,At.DS)({find:/:-þ $/,replace:"😛 "}),(0,At.DS)({find:/:-b $/,replace:"😛 "}),(0,At.DS)({find:/>:P $/,replace:"😜 "}),(0,At.DS)({find:/X-P $/,replace:"😜 "}),(0,At.DS)({find:/x-p $/,replace:"😜 "}),(0,At.DS)({find:/':\( $/,replace:"😓 "}),(0,At.DS)({find:/'=\( $/,replace:"😓 "}),(0,At.DS)({find:/>:\\ $/,replace:"😕 "}),(0,At.DS)({find:/>:\/ $/,replace:"😕 "}),(0,At.DS)({find:/:-\/ $/,replace:"😕 "}),(0,At.DS)({find:/:-. $/,replace:"😕 "}),(0,At.DS)({find:/>:\[ $/,replace:"😞 "}),(0,At.DS)({find:/:-\( $/,replace:"😞 "}),(0,At.DS)({find:/:-\[ $/,replace:"😞 "}),(0,At.DS)({find:/:'\( $/,replace:"😢 "}),(0,At.DS)({find:/;-\( $/,replace:"😢 "}),(0,At.DS)({find:/#-\) $/,replace:"😵 "}),(0,At.DS)({find:/%-\) $/,replace:"😵 "}),(0,At.DS)({find:/X-\) $/,replace:"😵 "}),(0,At.DS)({find:/>:\( $/,replace:"😠 "}),(0,At.DS)({find:/0:3 $/,replace:"😇 "}),(0,At.DS)({find:/0:\) $/,replace:"😇 "}),(0,At.DS)({find:/O:\) $/,replace:"😇 "}),(0,At.DS)({find:/O=\) $/,replace:"😇 "}),(0,At.DS)({find:/O:3 $/,replace:"😇 "}),(0,At.DS)({find:/<\/3 $/,replace:"💔 "}),(0,At.DS)({find:/:D $/,replace:"😃 "}),(0,At.DS)({find:/=D $/,replace:"😃 "}),(0,At.DS)({find:/;\) $/,replace:"😉 "}),(0,At.DS)({find:/\*\) $/,replace:"😉 "}),(0,At.DS)({find:/;\] $/,replace:"😉 "}),(0,At.DS)({find:/;D $/,replace:"😉 "}),(0,At.DS)({find:/B\) $/,replace:"😎 "}),(0,At.DS)({find:/8\) $/,replace:"😎 "}),(0,At.DS)({find:/:\* $/,replace:"😘 "}),(0,At.DS)({find:/=\* $/,replace:"😘 "}),(0,At.DS)({find:/:\) $/,replace:"🙂 "}),(0,At.DS)({find:/=\] $/,replace:"🙂 "}),(0,At.DS)({find:/:\] $/,replace:"🙂 "}),(0,At.DS)({find:/:X $/,replace:"😶 "}),(0,At.DS)({find:/:# $/,replace:"😶 "}),(0,At.DS)({find:/=X $/,replace:"😶 "}),(0,At.DS)({find:/=x $/,replace:"😶 "}),(0,At.DS)({find:/:x $/,replace:"😶 "}),(0,At.DS)({find:/=# $/,replace:"😶 "}),(0,At.DS)({find:/:O $/,replace:"😮 "}),(0,At.DS)({find:/:o $/,replace:"😮 "}),(0,At.DS)({find:/:P $/,replace:"😛 "}),(0,At.DS)({find:/=P $/,replace:"😛 "}),(0,At.DS)({find:/:p $/,replace:"😛 "}),(0,At.DS)({find:/=p $/,replace:"😛 "}),(0,At.DS)({find:/:Þ $/,replace:"😛 "}),(0,At.DS)({find:/:þ $/,replace:"😛 "}),(0,At.DS)({find:/:b $/,replace:"😛 "}),(0,At.DS)({find:/d: $/,replace:"😛 "}),(0,At.DS)({find:/:\/ $/,replace:"😕 "}),(0,At.DS)({find:/:\\ $/,replace:"😕 "}),(0,At.DS)({find:/=\/ $/,replace:"😕 "}),(0,At.DS)({find:/=\\ $/,replace:"😕 "}),(0,At.DS)({find:/:L $/,replace:"😕 "}),(0,At.DS)({find:/=L $/,replace:"😕 "}),(0,At.DS)({find:/:\( $/,replace:"😞 "}),(0,At.DS)({find:/:\[ $/,replace:"😞 "}),(0,At.DS)({find:/=\( $/,replace:"😞 "}),(0,At.DS)({find:/;\( $/,replace:"😢 "}),(0,At.DS)({find:/D: $/,replace:"😨 "}),(0,At.DS)({find:/:\$ $/,replace:"😳 "}),(0,At.DS)({find:/=\$ $/,replace:"😳 "}),(0,At.DS)({find:/#\) $/,replace:"😵 "}),(0,At.DS)({find:/%\) $/,replace:"😵 "}),(0,At.DS)({find:/X\) $/,replace:"😵 "}),(0,At.DS)({find:/:@ $/,replace:"😠 "}),(0,At.DS)({find:/=\) $/,replace:"🙂 "}),(0,At.DS)({find:/<3 $/,replace:"❤️ "}),(0,At.DS)({find:/ש”ח $/,replace:"₪ "}),(0,At.DS)({find:/ש״ח $/,replace:"₪ "}),(0,At.DS)({find:/ש"ח $/,replace:"₪ "})]});var xt=n(52780);const kt=function(t){const e=/(#[0-9a-f]{3,6})\b/gi,n=[];return t.descendants(((t,r)=>{t.text&&Array.from(t.text.matchAll(e)).forEach((t=>{const e=t[0],i=t.index||0,o=r+i,s=o+e.length,a=xt.p.inline(o,s,{class:"color",style:`--color: ${e}`});n.push(a)}))})),xt.EH.create(t,n)},Ct=At.hj.create({name:"colorHighlighter",addProseMirrorPlugins:()=>[new wt.Sy({state:{init(t,e){let{doc:n}=e;return kt(n)},apply:(t,e)=>t.docChanged?kt(t.doc):e},props:{decorations(t){return this.getState(t)}}})]}),Et=At.vc.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!1}),parseHTML(){return[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach((t=>{var e,n;const r=t.getAttribute("style"),i=null===(n=null===(e=t.parentElement)||void 0===e?void 0:e.closest("span"))||void 0===n?void 0:n.getAttribute("style");t.setAttribute("style",`${i};${r}`)}))})(t),{})}]},renderHTML({HTMLAttributes:t}){return["span",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,((e,n)=>{if(e.isTextblock)return!0;e.marks.filter((t=>t.type===this.type)).some((t=>Object.values(t.attrs).some((t=>!!t))))||t.removeMark(n,n+e.nodeSize,this.type)})),!0}}}}),St=At.hj.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>{if(t.style&&t.style.fontSize)return t.style.fontSize.replace(/['"]+/g,"");const e=window.getComputedStyle(t);return e&&e.fontSize?e.fontSize.replace(/['"]+/g,""):t.dataset&&t.dataset.fontSize?t.dataset.fontSize.replace(/['"]+/g,""):null},renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:t=>e=>{let{chain:n}=e;return n().setMark("textStyle",{fontSize:t+"px"}).run()},unsetFontSize:()=>t=>{let{chain:e}=t;return e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}),addKeyboardShortcuts(){return{"Mod-]":()=>{let t=parseInt(this.editor.getAttributes("textStyle").fontSize);t||(t=16),this.editor.commands.setFontSize(t+1)},"Mod-[":()=>{let t=parseInt(this.editor.getAttributes("textStyle").fontSize);t||(t=16),this.editor.commands.setFontSize(t-1)}}}});var Bt=n(42626);const Ot=At.NB.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((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML(t){let{node:e,HTMLAttributes:n}=t;const r=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0],i=document.createElement(`h${r}`);return i.style.cssText=n.style,i.style.fontFamily||(i.style.fontFamily="Arial, Helvetica, sans-serif"),n.style=i.style.cssText,[`h${r}`,(0,At.P1)(this.options.HTMLAttributes,n),0]},addCommands(){return{setHeading:t=>e=>{let{commands:n}=e;return!!this.options.levels.includes(t.level)&&n.setNode(this.name,t)},toggleHeading:t=>e=>{let{commands:n}=e;return!!this.options.levels.includes(t.level)&&n.toggleNode(this.name,"paragraph",t)}}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>(0,At.zK)({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}})))}});var $t=n(39615);const Mt=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,It=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Tt=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Lt=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Nt=At.vc.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,At.Cf)({find:Mt,type:this.type}),(0,At.Cf)({find:Tt,type:this.type})]},addPasteRules(){return[(0,At.K9)({find:It,type:this.type}),(0,At.K9)({find:Lt,type:this.type})]}}),Rt=At.vc.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("underline")&&{}}],renderHTML({HTMLAttributes:t}){return["u",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Pt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Dt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,zt=At.vc.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML({HTMLAttributes:t}){return["s",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,At.Cf)({find:Pt,type:this.type})]},addPasteRules(){return[(0,At.K9)({find:Dt,type:this.type})]}}),Ht=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Ut=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,jt=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Zt=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Ft=At.vc.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,At.Cf)({find:Ht,type:this.type}),(0,At.Cf)({find:jt,type:this.type})]},addPasteRules(){return[(0,At.K9)({find:Ut,type:this.type}),(0,At.K9)({find:Zt,type:this.type})]}}),Vt=At.hj.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return null===(e=t.style.color)||void 0===e?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands:()=>({setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),Yt=At.NB.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",(0,At.P1)(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)}}}),Wt=At.hj.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new wt.Sy({key:new wt.H$("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const o=this.editor.isEmpty;return t.descendants(((t,e)=>{const n=r>=e&&r<=e+t.nodeSize,s=!t.isLeaf&&(0,At.bR)(t);if((n||!this.options.showOnlyCurrent)&&s){const r=[this.options.emptyNodeClass];o&&r.push(this.options.emptyEditorClass);const s=xt.p.node(e,e+t.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:e,hasAnchor:n}):this.options.placeholder});i.push(s)}return this.options.includeChildren})),xt.EH.create(t,i)}}})]}});var qt=n(26151);function Xt(t={}){return new wt.Sy({view:e=>new Gt(e,t)})}class Gt{constructor(t,e){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=e.width)&&void 0!==n?n:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map((e=>{let n=t=>{this[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}}))}destroy(){this.handlers.forEach((({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e)))}update(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r=this.editorView.dom,i=r.getBoundingClientRect(),o=i.width/r.offsetWidth,s=i.height/r.offsetHeight;if(n){let n=e.nodeBefore,r=e.nodeAfter;if(n||r){let e=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(e){let i=e.getBoundingClientRect(),o=n?i.bottom:i.top;n&&r&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*s;t={left:i.left,right:i.right,top:o-a,bottom:o+a}}}}if(!t){let e=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*o;t={left:e.left-n,right:e.left+n,top:e.top,bottom:e.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 t=c.getBoundingClientRect(),e=t.width/c.offsetWidth,n=t.height/c.offsetHeight;a=t.left-c.scrollLeft*e,l=t.top-c.scrollTop*n}this.element.style.left=(t.left-a)/o+"px",this.element.style.top=(t.top-l)/s+"px",this.element.style.width=(t.right-t.left)/o+"px",this.element.style.height=(t.bottom-t.top)/s+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,e,t):r;if(e&&!i){let t=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=(0,qt.nj)(this.editorView.state.doc,t,this.editorView.dragging.slice);null!=e&&(t=e)}this.setCursor(t),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}const Kt=At.hj.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[Xt(this.options)]}}),Jt=At.hj.create({name:"direction",addOptions:()=>({types:[],directions:["rtl","ltr"],defaultDirection:"ltr"}),addGlobalAttributes(t){return[{types:this.options.types,attributes:{direction:{default:this.options.defaultDirection,parseHTML:t=>t.style.direction||this.options.defaultDirection,renderHTML:t=>({style:`direction: ${t.direction||this.options.defaultDirection}`})}}}]},addCommands(){return{setDirection:t=>e=>{let{commands:n}=e;return!!this.options.directions.includes(t)&&this.options.types.every((e=>n.updateAttributes(e,{direction:t})))},unsetDirection:()=>t=>{let{commands:e}=t;return this.options.types.every((t=>e.resetAttributes(t,"direction")))}}}}),Qt=At.hj.create({name:"lineHeight",addOptions:()=>({types:[],lineHeight:"1.4",defaultLineHeight:"1.4"}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:this.options.defaultLineHeight,parseHTML:t=>t.style.lineHeight||this.options.defaultLineHeight,renderHTML:t=>({style:`line-height: ${t.lineHeight||this.options.defaultLineHeight}`})}}}]},addCommands(){return{setLineHeight:t=>e=>{let{commands:n}=e;return this.options.types.every((e=>n.updateAttributes(e,{lineHeight:t})))},unsetLineHeight:()=>t=>{let{commands:e}=t;return this.options.types.every((t=>e.resetAttributes(t,"lineHeight")))}}}}),te=At.hj.create({name:"letterSpacing",addOptions:()=>({types:[],letterSpacing:"",defaultLetterSpacing:""}),addGlobalAttributes(){return[{types:this.options.types,attributes:{letterSpacing:{default:this.options.defaultLetterSpacing,parseHTML:t=>t.style.letterSpacing||this.options.defaultLetterSpacing,renderHTML:t=>({style:`letter-spacing: ${t.letterSpacing||this.options.defaultLetterSpacing}`})}}}]},addCommands(){return{setLetterSpacing:t=>e=>{let{commands:n}=e;return this.options.types.every((e=>n.updateAttributes(e,{letterSpacing:t})))},unsetLetterSpacing:()=>t=>{let{commands:e}=t;return this.options.types.every((t=>e.resetAttributes(t,"letterSpacing")))}}}}),ee="textStyle",ne=/^(\d+)\.\s$/,re=At.NB.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return 1===e?["ol",(0,At.P1)(this.options.HTMLAttributes,n),0]:["ol",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(ee)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=(0,At.S0)({find:ne,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,At.S0)({find:ne,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(ee)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[t]}}),ie="customBulletItem";function oe(t){let{width:e=24,height:n=24,fill:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||!t.startsWith("http"))return t;try{const i=new URL(t);return i.searchParams.set("width",String(e)),i.searchParams.set("height",String(n)),r&&i.searchParams.set("color",String(r).replace("#","")),i.toString()}catch{return t}}const se=At.NB.create({name:ie,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:t=>t.width},height:{default:24,parseHTML:t=>t.height},mt:{default:0,parseHTML:t=>t.style.marginTop},fill:{default:"#000",parseHTML:t=>t.style.fill}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML(t){let{node:e,HTMLAttributes:n}=t;return["li",(0,At.P1)(this.options.HTMLAttributes,n,{"data-type":this.name}),["div",["svg"],["span"]],["div",0]]},addCommands(){const t=(t,e)=>{const n={...e},r=t.selection.$from;for(let t=r.depth;t>0;t--){const i=r.node(t);if(i.type.name===ie){Object.assign(n,i.attrs,e);break}}return n.svgIcon?.startsWith("http")&&(n.svgIcon=oe(n.svgIcon,{width:n.width??24,height:n.height??24,fill:n.fill})),n};return{setCustomBulletIcon:e=>n=>{let{commands:r,state:i}=n;return r.updateAttributes(ie,t(i,e)),!0},setCustomBulletStyles:e=>n=>{let{commands:r,state:i}=n;return r.updateAttributes(ie,t(i,e)),!0}}},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return t=>{let{HTMLAttributes:e}=t,n=e.svgIcon;if(n=n.replace(/</g,"<"),-1!==n.indexOf("<svg")){delete e.svgIcon;const t=document.createElement("li");t.classList.add("custom-bullet-item");const r=document.createElement("div");r.innerHTML=n;const i=document.createElement("div"),o=r.firstElementChild;return o.style.width=e.width,o.style.height=e.width,o.style.fill=e.fill,o.style.marginTop=e.mt,Object.entries(this.options.HTMLAttributes).forEach((e=>{let[n,r]=e;t.setAttribute(n,r)})),t.append(r,i),Object.entries(e).forEach((e=>{let[n,r]=e;t.setAttribute(n,r)})),{dom:t,contentDOM:i}}if(n.startsWith("http")){const t=oe(n,{width:e.width??24,height:e.height??24,fill:e.fill});delete e.svgIcon;const r=document.createElement("li");r.classList.add("custom-bullet-item");const i=document.createElement("div");i.innerHTML=`<img src="${t}" height="auto" style="margin-top:${e.mt||"auto"}" width="${e.width}"\n />`;const o=document.createElement("div");i.firstElementChild;return Object.entries(this.options.HTMLAttributes).forEach((t=>{let[e,n]=t;r.setAttribute(e,n)})),r.append(i,o),Object.entries(e).forEach((t=>{let[e,n]=t;r.setAttribute(e,n)})),{dom:r,contentDOM:o}}{delete e.svgIcon;const t=document.createElement("li");t.classList.add("custom-bullet-item");const r=document.createElement("div");r.innerHTML=`<svg fill="${e.fill}" width="${e.width}"\n height="${e.width}"\n xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">${n}</svg>`;const i=document.createElement("div"),o=r.firstElementChild;return o.style.width=e.width,o.style.height=e.width,o.style.marginTop=e.mt,o.style.fill=e.fill,Object.entries(this.options.HTMLAttributes).forEach((e=>{let[n,r]=e;t.setAttribute(n,r)})),t.append(r,i),Object.entries(e).forEach((e=>{let[n,r]=e;t.setAttribute(n,r)})),{dom:t,contentDOM:i}}}}}),ae=At.NB.create({name:"customBulletList",addOptions:()=>({itemTypeName:ie,HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML(t){let{HTMLAttributes:e}=t;return["ul",(0,At.P1)(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addCommands(){return{toggleCustomList:()=>t=>{let{commands:e}=t;return e.toggleList(this.name,this.options.itemTypeName)}}},addKeyboardShortcuts(){return{"Mod-Shift-6":()=>this.editor.commands.toggleCustomList()}}}),le=At.NB.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",(0,At.P1)(this.options.HTMLAttributes,t)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command((()=>{const{selection:t,storedMarks:i}=n;if(t.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,a=i||t.$to.parentOffset&&t.$from.marks();return e().insertContent({type:this.name}).command((({tr:t,dispatch:e})=>{if(e&&a&&o){const e=a.filter((t=>s.includes(t.type.name)));t.ensureMarks(e)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ce=/^\s*(\[([ |x])\])\s$/,de=(At.NB.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{}}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:t=>"true"===t.getAttribute("data-checked"),renderHTML:t=>({"data-checked":t.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML(t){let{node:e,HTMLAttributes:n}=t;return["li",(0,At.P1)(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return t=>{let{node:e,HTMLAttributes:n,getPos:r,editor:i}=t;const o=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input");o.style.display="flex",o.style.alignItems="center",l.style.width="50px";const c=document.createElement("div");return s.contentEditable="false",l.type="checkbox",l.addEventListener("change",(t=>{if(!i.isEditable)return void(l.checked=!l.checked);const{checked:e}=t.target;i.isEditable&&"function"==typeof r&&i.chain().focus(void 0,{scrollIntoView:!1}).command((t=>{let{tr:n}=t;const i=r(),o=n.doc.nodeAt(i);return n.setNodeMarkup(i,void 0,{...o?.attrs,checked:e}),!0})).run()})),Object.entries(this.options.HTMLAttributes).forEach((t=>{let[e,n]=t;o.setAttribute(e,n)})),o.dataset.checked=e.attrs.checked,e.attrs.checked&&l.setAttribute("checked","checked"),s.append(l,a),o.append(s,c),Object.entries(n).forEach((t=>{let[e,n]=t;o.setAttribute(e,n)})),{dom:o,contentDOM:c,update:t=>t.type===this.type&&(o.dataset.checked=t.attrs.checked,t.attrs.checked?l.setAttribute("checked","checked"):l.removeAttribute("checked"),!0)}}},addInputRules(){return[(0,At.S0)({find:ce,type:this.type,getAttributes:t=>({checked:"x"===t[t.length-1]})})]}}),At.NB.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(t){let{HTMLAttributes:e}=t;return["ul",(0,At.P1)(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>t=>{let{commands:e}=t;return e.toggleList(this.name,this.options.itemTypeName)}}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),/^\s*>\s$/),pe=At.NB.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return["blockquote",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,At.S0)({find:de,type:this.type})]}}),he=/^```([a-z]+)?[\s\n]$/,ue=/^~~~([a-z]+)?[\s\n]$/,fe=At.NB.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:t=>{var e;const{languageClassPrefix:n}=this.options,r=[...(null===(e=t.firstElementChild)||void 0===e?void 0:e.classList)||[]].filter((t=>t.startsWith(n))).map((t=>t.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:e}){return["pre",(0,At.P1)(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=1===e.pos;return!(!t||e.parent.type.name!==this.name)&&(!(!n&&e.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!o||!s)&&t.chain().command((({tr:t})=>(t.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type)return!1;if(!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();if(void 0===s)return!1;return r.nodeAt(s)?t.commands.command((({tr:t})=>(t.setSelection(wt.Y1.near(r.resolve(s))),!0))):t.commands.exitCode()}}},addInputRules(){return[(0,At.zK)({find:he,type:this.type,getAttributes:t=>({language:t[1]})}),(0,At.zK)({find:ue,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new wt.Sy({key:new wt.H$("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(wt.Bs.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});function me(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ge(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach((e=>{const n=t[e],r=typeof n;"object"!==r&&"function"!==r||Object.isFrozen(n)||ge(n)})),t}class be{constructor(t){void 0===t.data&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ye(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ae(t,...e){const n=Object.create(null);for(const e in t)n[e]=t[e];return e.forEach((function(t){for(const e in t)n[e]=t[e]})),n}const we=t=>!!t.scope;class ve{constructor(t,e){this.buffer="",this.classPrefix=e.classPrefix,t.walk(this)}addText(t){this.buffer+=ye(t)}openNode(t){if(!we(t))return;const e=((t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${e}${n.shift()}`,...n.map(((t,e)=>`${t}${"_".repeat(e+1)}`))].join(" ")}return`${e}${t}`})(t.scope,{prefix:this.classPrefix});this.span(e)}closeNode(t){we(t)&&(this.buffer+="</span>")}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const _e=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class xe{constructor(){this.rootNode=_e(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const e=_e({scope:t});this.add(e),this.stack.push(e)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,e){return"string"==typeof e?t.addText(e):e.children&&(t.openNode(e),e.children.forEach((e=>this._walk(t,e))),t.closeNode(e)),t}static _collapse(t){"string"!=typeof t&&t.children&&(t.children.every((t=>"string"==typeof t))?t.children=[t.children.join("")]:t.children.forEach((t=>{xe._collapse(t)})))}}class ke extends xe{constructor(t){super(),this.options=t}addText(t){""!==t&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,e){const n=t.root;e&&(n.scope=`language:${e}`),this.add(n)}toHTML(){return new ve(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Ce(t){return t?"string"==typeof t?t:t.source:null}function Ee(t){return Oe("(?=",t,")")}function Se(t){return Oe("(?:",t,")*")}function Be(t){return Oe("(?:",t,")?")}function Oe(...t){return t.map((t=>Ce(t))).join("")}function $e(...t){const e=function(t){const e=t[t.length-1];return"object"==typeof e&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}(t);return"("+(e.capture?"":"?:")+t.map((t=>Ce(t))).join("|")+")"}function Me(t){return new RegExp(t.toString()+"|").exec("").length-1}const Ie=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Te(t,{joinWith:e}){let n=0;return t.map((t=>{n+=1;const e=n;let r=Ce(t),i="";for(;r.length>0;){const t=Ie.exec(r);if(!t){i+=r;break}i+=r.substring(0,t.index),r=r.substring(t.index+t[0].length),"\\"===t[0][0]&&t[1]?i+="\\"+String(Number(t[1])+e):(i+=t[0],"("===t[0]&&n++)}return i})).map((t=>`(${t})`)).join(e)}const Le="[a-zA-Z]\\w*",Ne="[a-zA-Z_]\\w*",Re="\\b\\d+(\\.\\d+)?",Pe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",De="\\b(0b[01]+)",ze={begin:"\\\\[\\s\\S]",relevance:0},He={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ze]},Ue={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ze]},je=function(t,e,n={}){const r=Ae({scope:"comment",begin:t,end:e,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 i=$e("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:Oe(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Ze=je("//","$"),Fe=je("/\\*","\\*/"),Ve=je("#","$"),Ye={scope:"number",begin:Re,relevance:0},We={scope:"number",begin:Pe,relevance:0},qe={scope:"number",begin:De,relevance:0},Xe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ze,{begin:/\[/,end:/\]/,relevance:0,contains:[ze]}]},Ge={scope:"title",begin:Le,relevance:0},Ke={scope:"title",begin:Ne,relevance:0},Je={begin:"\\.\\s*"+Ne,relevance:0};var Qe=Object.freeze({__proto__:null,APOS_STRING_MODE:He,BACKSLASH_ESCAPE:ze,BINARY_NUMBER_MODE:qe,BINARY_NUMBER_RE:De,COMMENT:je,C_BLOCK_COMMENT_MODE:Fe,C_LINE_COMMENT_MODE:Ze,C_NUMBER_MODE:We,C_NUMBER_RE:Pe,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(t,e)=>{e.data._beginMatch=t[1]},"on:end":(t,e)=>{e.data._beginMatch!==t[1]&&e.ignoreMatch()}})},HASH_COMMENT_MODE:Ve,IDENT_RE:Le,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:Je,NUMBER_MODE:Ye,NUMBER_RE:Re,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:Ue,REGEXP_MODE:Xe,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=Oe(e,/.*\b/,t.binary,/\b.*/)),Ae({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,e)=>{0!==t.index&&e.ignoreMatch()}},t)},TITLE_MODE:Ge,UNDERSCORE_IDENT_RE:Ne,UNDERSCORE_TITLE_MODE:Ke});function tn(t,e){"."===t.input[t.index-1]&&e.ignoreMatch()}function en(t,e){void 0!==t.className&&(t.scope=t.className,delete t.className)}function nn(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=tn,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,void 0===t.relevance&&(t.relevance=0))}function rn(t,e){Array.isArray(t.illegal)&&(t.illegal=$e(...t.illegal))}function on(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function sn(t,e){void 0===t.relevance&&(t.relevance=1)}const an=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach((e=>{delete t[e]})),t.keywords=n.keywords,t.begin=Oe(n.beforeMatch,Ee(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},ln=["of","and","for","in","not","or","if","then","parent","list","value"],cn="keyword";function dn(t,e,n=cn){const r=Object.create(null);return"string"==typeof t?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach((function(n){Object.assign(r,dn(t[n],e,n))})),r;function i(t,n){e&&(n=n.map((t=>t.toLowerCase()))),n.forEach((function(e){const n=e.split("|");r[n[0]]=[t,pn(n[0],n[1])]}))}}function pn(t,e){return e?Number(e):function(t){return ln.includes(t.toLowerCase())}(t)?0:1}const hn={},un=t=>{console.error(t)},fn=(t,...e)=>{console.log(`WARN: ${t}`,...e)},mn=(t,e)=>{hn[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),hn[`${t}/${e}`]=!0)},gn=new Error;function bn(t,e,{key:n}){let r=0;const i=t[n],o={},s={};for(let t=1;t<=e.length;t++)s[t+r]=i[t],o[t+r]=!0,r+=Me(e[t-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function yn(t){!function(t){t.scope&&"object"==typeof t.scope&&null!==t.scope&&(t.beginScope=t.scope,delete t.scope)}(t),"string"==typeof t.beginScope&&(t.beginScope={_wrap:t.beginScope}),"string"==typeof t.endScope&&(t.endScope={_wrap:t.endScope}),function(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw un("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),gn;if("object"!=typeof t.beginScope||null===t.beginScope)throw un("beginScope must be object"),gn;bn(t,t.begin,{key:"beginScope"}),t.begin=Te(t.begin,{joinWith:""})}}(t),function(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw un("skip, excludeEnd, returnEnd not compatible with endScope: {}"),gn;if("object"!=typeof t.endScope||null===t.endScope)throw un("endScope must be object"),gn;bn(t,t.end,{key:"endScope"}),t.end=Te(t.end,{joinWith:""})}}(t)}function An(t){function e(e,n){return new RegExp(Ce(e),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(t,e){e.position=this.position++,this.matchIndexes[this.matchAt]=e,this.regexes.push([e,t]),this.matchAt+=Me(t)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const t=this.regexes.map((t=>t[1]));this.matcherRe=e(Te(t,{joinWith:"|"}),!0),this.lastIndex=0}exec(t){this.matcherRe.lastIndex=this.lastIndex;const e=this.matcherRe.exec(t);if(!e)return null;const n=e.findIndex(((t,e)=>e>0&&void 0!==t)),r=this.matchIndexes[n];return e.splice(0,n),Object.assign(e,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(t){if(this.multiRegexes[t])return this.multiRegexes[t];const e=new n;return this.rules.slice(t).forEach((([t,n])=>e.addRule(t,n))),e.compile(),this.multiRegexes[t]=e,e}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(t,e){this.rules.push([t,e]),"begin"===e.type&&this.count++}exec(t){const e=this.getMatcher(this.regexIndex);e.lastIndex=this.lastIndex;let n=e.exec(t);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const e=this.getMatcher(0);e.lastIndex=this.lastIndex+1,n=e.exec(t)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ae(t.classNameAliases||{}),function n(i,o){const s=i;if(i.isCompiled)return s;[en,on,yn,an].forEach((t=>t(i,o))),t.compilerExtensions.forEach((t=>t(i,o))),i.__beforeBegin=null,[nn,rn,sn].forEach((t=>t(i,o))),i.isCompiled=!0;let a=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),a=i.keywords.$pattern,delete i.keywords.$pattern),a=a||/\w+/,i.keywords&&(i.keywords=dn(i.keywords,t.case_insensitive)),s.keywordPatternRe=e(a,!0),o&&(i.begin||(i.begin=/\B|\b/),s.beginRe=e(s.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(s.endRe=e(s.end)),s.terminatorEnd=Ce(s.end)||"",i.endsWithParent&&o.terminatorEnd&&(s.terminatorEnd+=(i.end?"|":"")+o.terminatorEnd)),i.illegal&&(s.illegalRe=e(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(t){return function(t){t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map((function(e){return Ae(t,{variants:null},e)})));if(t.cachedVariants)return t.cachedVariants;if(wn(t))return Ae(t,{starts:t.starts?Ae(t.starts):null});if(Object.isFrozen(t))return Ae(t);return t}("self"===t?i:t)}))),i.contains.forEach((function(t){n(t,s)})),i.starts&&n(i.starts,o),s.matcher=function(t){const e=new r;return t.contains.forEach((t=>e.addRule(t.begin,{rule:t,type:"begin"}))),t.terminatorEnd&&e.addRule(t.terminatorEnd,{type:"end"}),t.illegal&&e.addRule(t.illegal,{type:"illegal"}),e}(s),s}(t)}function wn(t){return!!t&&(t.endsWithParent||wn(t.starts))}class vn extends Error{constructor(t,e){super(t),this.name="HTMLInjectionError",this.html=e}}const _n=ye,xn=Ae,kn=Symbol("nomatch"),Cn=7,En=function(t){const e=Object.create(null),n=Object.create(null),r=[];let i=!0;const o="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:ke};function l(t){return a.noHighlightRe.test(t)}function c(t,e,n){let r="",i="";"object"==typeof e?(r=t,n=e.ignoreIllegals,i=e.language):(mn("10.7.0","highlight(lang, code, ...args) has been deprecated."),mn("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=t,r=e),void 0===n&&(n=!0);const o={code:r,language:i};y("before:highlight",o);const s=o.result?o.result:d(o.language,o.code,n);return s.code=o.code,y("after:highlight",s),s}function d(t,n,r,s){const l=Object.create(null);function c(){if(!C.keywords)return void S.addText(B);let t=0;C.keywordPatternRe.lastIndex=0;let e=C.keywordPatternRe.exec(B),n="";for(;e;){n+=B.substring(t,e.index);const i=_.case_insensitive?e[0].toLowerCase():e[0],o=(r=i,C.keywords[r]);if(o){const[t,r]=o;if(S.addText(n),n="",l[i]=(l[i]||0)+1,l[i]<=Cn&&(O+=r),t.startsWith("_"))n+=e[0];else{const n=_.classNameAliases[t]||t;u(e[0],n)}}else n+=e[0];t=C.keywordPatternRe.lastIndex,e=C.keywordPatternRe.exec(B)}var r;n+=B.substring(t),S.addText(n)}function h(){null!=C.subLanguage?function(){if(""===B)return;let t=null;if("string"==typeof C.subLanguage){if(!e[C.subLanguage])return void S.addText(B);t=d(C.subLanguage,B,!0,E[C.subLanguage]),E[C.subLanguage]=t._top}else t=p(B,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(O+=t.relevance),S.__addSublanguage(t._emitter,t.language)}():c(),B=""}function u(t,e){""!==t&&(S.startScope(e),S.addText(t),S.endScope())}function f(t,e){let n=1;const r=e.length-1;for(;n<=r;){if(!t._emit[n]){n++;continue}const r=_.classNameAliases[t[n]]||t[n],i=e[n];r?u(i,r):(B=i,c(),B=""),n++}}function g(t,e){return t.scope&&"string"==typeof t.scope&&S.openNode(_.classNameAliases[t.scope]||t.scope),t.beginScope&&(t.beginScope._wrap?(u(B,_.classNameAliases[t.beginScope._wrap]||t.beginScope._wrap),B=""):t.beginScope._multi&&(f(t.beginScope,e),B="")),C=Object.create(t,{parent:{value:C}}),C}function b(t,e,n){let r=function(t,e){const n=t&&t.exec(e);return n&&0===n.index}(t.endRe,n);if(r){if(t["on:end"]){const n=new be(t);t["on:end"](e,n),n.isMatchIgnored&&(r=!1)}if(r){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return b(t.parent,e,n)}function y(t){return 0===C.matcher.regexIndex?(B+=t[0],1):(I=!0,0)}function A(t){const e=t[0],r=n.substring(t.index),i=b(C,t,r);if(!i)return kn;const o=C;C.endScope&&C.endScope._wrap?(h(),u(e,C.endScope._wrap)):C.endScope&&C.endScope._multi?(h(),f(C.endScope,t)):o.skip?B+=e:(o.returnEnd||o.excludeEnd||(B+=e),h(),o.excludeEnd&&(B=e));do{C.scope&&S.closeNode(),C.skip||C.subLanguage||(O+=C.relevance),C=C.parent}while(C!==i.parent);return i.starts&&g(i.starts,t),o.returnEnd?0:e.length}let w={};function v(e,o){const s=o&&o[0];if(B+=e,null==s)return h(),0;if("begin"===w.type&&"end"===o.type&&w.index===o.index&&""===s){if(B+=n.slice(o.index,o.index+1),!i){const e=new Error(`0 width match regex (${t})`);throw e.languageName=t,e.badRule=w.rule,e}return 1}if(w=o,"begin"===o.type)return function(t){const e=t[0],n=t.rule,r=new be(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(t,r),r.isMatchIgnored))return y(e);return n.skip?B+=e:(n.excludeBegin&&(B+=e),h(),n.returnBegin||n.excludeBegin||(B=e)),g(n,t),n.returnBegin?0:e.length}(o);if("illegal"===o.type&&!r){const t=new Error('Illegal lexeme "'+s+'" for mode "'+(C.scope||"<unnamed>")+'"');throw t.mode=C,t}if("end"===o.type){const t=A(o);if(t!==kn)return t}if("illegal"===o.type&&""===s)return 1;if(M>1e5&&M>3*o.index){throw new Error("potential infinite loop, way more iterations than matches")}return B+=s,s.length}const _=m(t);if(!_)throw un(o.replace("{}",t)),new Error('Unknown language: "'+t+'"');const x=An(_);let k="",C=s||x;const E={},S=new a.__emitter(a);!function(){const t=[];for(let e=C;e!==_;e=e.parent)e.scope&&t.unshift(e.scope);t.forEach((t=>S.openNode(t)))}();let B="",O=0,$=0,M=0,I=!1;try{if(_.__emitTokens)_.__emitTokens(n,S);else{for(C.matcher.considerAll();;){M++,I?I=!1:C.matcher.considerAll(),C.matcher.lastIndex=$;const t=C.matcher.exec(n);if(!t)break;const e=v(n.substring($,t.index),t);$=t.index+e}v(n.substring($))}return S.finalize(),k=S.toHTML(),{language:t,value:k,relevance:O,illegal:!1,_emitter:S,_top:C}}catch(e){if(e.message&&e.message.includes("Illegal"))return{language:t,value:_n(n),illegal:!0,relevance:0,_illegalBy:{message:e.message,index:$,context:n.slice($-100,$+100),mode:e.mode,resultSoFar:k},_emitter:S};if(i)return{language:t,value:_n(n),illegal:!1,relevance:0,errorRaised:e,_emitter:S,_top:C};throw e}}function p(t,n){n=n||a.languages||Object.keys(e);const r=function(t){const e={value:_n(t),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return e._emitter.addText(t),e}(t),i=n.filter(m).filter(b).map((e=>d(e,t,!1)));i.unshift(r);const o=i.sort(((t,e)=>{if(t.relevance!==e.relevance)return e.relevance-t.relevance;if(t.language&&e.language){if(m(t.language).supersetOf===e.language)return 1;if(m(e.language).supersetOf===t.language)return-1}return 0})),[l,c]=o,p=l;return p.secondBest=c,p}function h(t){let e=null;const r=function(t){let e=t.className+" ";e+=t.parentNode?t.parentNode.className:"";const n=a.languageDetectRe.exec(e);if(n){const e=m(n[1]);return e||(fn(o.replace("{}",n[1])),fn("Falling back to no-highlight mode for this block.",t)),e?n[1]:"no-highlight"}return e.split(/\s+/).find((t=>l(t)||m(t)))}(t);if(l(r))return;if(y("before:highlightElement",{el:t,language:r}),t.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",t);if(t.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(t)),a.throwUnescapedHTML)){throw new vn("One of your code blocks includes unescaped HTML.",t.innerHTML)}e=t;const i=e.textContent,s=r?c(i,{language:r,ignoreIllegals:!0}):p(i);t.innerHTML=s.value,t.dataset.highlighted="yes",function(t,e,r){const i=e&&n[e]||r;t.classList.add("hljs"),t.classList.add(`language-${i}`)}(t,r,s.language),t.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(t.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),y("after:highlightElement",{el:t,result:s,text:i})}let u=!1;function f(){if("loading"===document.readyState)return void(u=!0);document.querySelectorAll(a.cssSelector).forEach(h)}function m(t){return t=(t||"").toLowerCase(),e[t]||e[n[t]]}function g(t,{languageName:e}){"string"==typeof t&&(t=[t]),t.forEach((t=>{n[t.toLowerCase()]=e}))}function b(t){const e=m(t);return e&&!e.disableAutodetect}function y(t,e){const n=t;r.forEach((function(t){t[n]&&t[n](e)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){u&&f()}),!1),Object.assign(t,{highlight:c,highlightAuto:p,highlightAll:f,highlightElement:h,highlightBlock:function(t){return mn("10.7.0","highlightBlock will be removed entirely in v12.0"),mn("10.7.0","Please use highlightElement now."),h(t)},configure:function(t){a=xn(a,t)},initHighlighting:()=>{f(),mn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){f(),mn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let o=null;try{o=r(t)}catch(t){if(un("Language definition for '{}' could not be registered.".replace("{}",n)),!i)throw t;un(t),o=s}o.name||(o.name=n),e[n]=o,o.rawDefinition=r.bind(null,t),o.aliases&&g(o.aliases,{languageName:n})},unregisterLanguage:function(t){delete e[t];for(const e of Object.keys(n))n[e]===t&&delete n[e]},listLanguages:function(){return Object.keys(e)},getLanguage:m,registerAliases:g,autoDetection:b,inherit:xn,addPlugin:function(t){!function(t){t["before:highlightBlock"]&&!t["before:highlightElement"]&&(t["before:highlightElement"]=e=>{t["before:highlightBlock"](Object.assign({block:e.el},e))}),t["after:highlightBlock"]&&!t["after:highlightElement"]&&(t["after:highlightElement"]=e=>{t["after:highlightBlock"](Object.assign({block:e.el},e))})}(t),r.push(t)},removePlugin:function(t){const e=r.indexOf(t);-1!==e&&r.splice(e,1)}}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString="11.10.0",t.regex={concat:Oe,lookahead:Ee,either:$e,optional:Be,anyNumberOfTimes:Se};for(const t in Qe)"object"==typeof Qe[t]&&ge(Qe[t]);return Object.assign(t,Qe),t},Sn=En({});Sn.newInstance=()=>En({});var Bn=Sn;Sn.HighlightJS=Sn,Sn.default=Sn;var On=me(Bn);function $n(t,e=[]){return t.map((t=>{const n=[...e,...t.properties?t.properties.className:[]];return t.children?$n(t.children,n):{text:t.value,classes:n}})).flat()}function Mn(t){return t.value||t.children||[]}function In({doc:t,name:e,lowlight:n,defaultLanguage:r}){const i=[];return(0,At.N2)(t,(t=>t.type.name===e)).forEach((t=>{var e;let o=t.pos+1;const s=t.node.attrs.language||r,a=n.listLanguages();var l;$n(s&&(a.includes(s)||(l=s,Boolean(On.getLanguage(l)))||(null===(e=n.registered)||void 0===e?void 0:e.call(n,s)))?Mn(n.highlight(s,t.node.textContent)):Mn(n.highlightAuto(t.node.textContent))).forEach((t=>{const e=o+t.text.length;if(t.classes.length){const n=xt.p.inline(o,e,{class:t.classes.join(" ")});i.push(n)}o=e}))})),xt.EH.create(t,i)}function Tn({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every((t=>"function"==typeof e[t])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new wt.Sy({key:new wt.H$("lowlight"),state:{init:(r,{doc:i})=>In({doc:i,name:t,lowlight:e,defaultLanguage:n}),apply:(r,i,o,s)=>{const a=o.selection.$head.parent.type.name,l=s.selection.$head.parent.type.name,c=(0,At.N2)(o.doc,(e=>e.type.name===t)),d=(0,At.N2)(s.doc,(e=>e.type.name===t));return r.docChanged&&([a,l].includes(t)||d.length!==c.length||r.steps.some((t=>void 0!==t.from&&void 0!==t.to&&c.some((e=>e.pos>=t.from&&e.pos+e.node.nodeSize<=t.to)))))?In({doc:r.doc,name:t,lowlight:e,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations:t=>r.getState(t)}});return r}const Ln=fe.extend({addOptions(){var t;return{...null===(t=this.parent)||void 0===t?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return[...(null===(t=this.parent)||void 0===t?void 0:t.call(this))||[],Tn({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),Nn={};const Rn=At.hj.create({name:"fontFamily",addOptions:()=>({types:["textStyle"],fonts:[]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily?.replace(/['"]+/g,""),renderHTML:t=>{if(!t.fontFamily)return{style:"font-family:Arial, Helvetica, sans-serif"};return function(t,e){if(!t||!t.length)return;const n=t.find((t=>t.cssRule.trim().replace('"',"").replace("'","")===e.trim().replace('"',"").replace("'","")));n&&!Nn[n.name]&&function(t){if(document.getElementById(t.id))return;const e=document.createElement("link");e.href=t.url,e.id=t.id,e.setAttribute("data-name",t.name),e.rel="stylesheet",e.type="text/css",document.head.appendChild(e),Nn[t.name]=!0}(n)}(this.options.fonts,t.fontFamily),{style:`font-family: ${t.fontFamily.replace(/;/g,"")}`,"data-cdtr-font-name":t.fontFamily}}}}}]},addCommands:()=>({setFontFamily:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=>{let{chain:n}=e;if(!t||"object"!=typeof t)return console.warn("setFontFamily should be { cssRule, name, id, url } "),"string"==typeof t?n().setMark("textStyle",{fontFamily:t}).run():void 0;const{cssRule:r,name:i,id:o,url:s}=t;return n().setMark("textStyle",{fontFamily:r}).run()}},unsetFontFamily:()=>t=>{let{chain:e}=t;return e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}})});const Pn=At.NB.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",draggable:!0,parseHTML:()=>[{tag:"hr"}],renderHTML(t){let{HTMLAttributes:e}=t;return["hr",(0,At.P1)(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>t=>{let{chain:e}=t;return e().insertContent({type:this.name}).command((t=>{let{tr:e,dispatch:n}=t;if(n){const{$to:t}=e.selection,n=t.end();if(t.nodeAfter)e.setSelection(wt.Bs.create(e.doc,t.pos));else{const r=t.parent.type.contentMatch.defaultType?.create();r&&(e.insert(n,r),e.setSelection(wt.Bs.create(e.doc,n)))}e.scrollIntoView()}return!0})).run()}}},addInputRules(){return[(0,At.x2)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var Dn=n(38404),zn=n(52665);class Hn extends wt.Y1{constructor(t){super(t,t)}map(t,e){let n=t.resolve(e.map(this.head));return Hn.valid(n)?new Hn(n):wt.Y1.near(n)}content(){return zn.p2.empty}eq(t){return t instanceof Hn&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new Hn(t.resolve(e.pos))}getBookmark(){return new Un(this.anchor)}static valid(t){let e=t.parent;if(e.isTextblock||!function(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(0!=n)for(let t=r.child(n-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t)||!function(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(let t=r.child(n);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t))return!1;let n=e.type.spec.allowGapCursor;if(null!=n)return n;let r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,e,n=!1){t:for(;;){if(!n&&Hn.valid(t))return t;let r=t.pos,i=null;for(let n=t.depth;;n--){let o=t.node(n);if(e>0?t.indexAfter(n)<o.childCount:t.index(n)>0){i=o.child(e>0?t.indexAfter(n):t.index(n)-1);break}if(0==n)return null;r+=e;let s=t.doc.resolve(r);if(Hn.valid(s))return s}for(;;){let o=e>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!wt.qv.isSelectable(i)){t=t.doc.resolve(r+i.nodeSize*e),n=!1;continue t}break}i=o,r+=e;let s=t.doc.resolve(r);if(Hn.valid(s))return s}return null}}}Hn.prototype.visible=!1,Hn.findFrom=Hn.findGapCursorFrom,wt.Y1.jsonID("gapcursor",Hn);class Un{constructor(t){this.pos=t}map(t){return new Un(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return Hn.valid(e)?new Hn(e):wt.Y1.near(e)}}const jn=(0,Dn.$)({ArrowLeft:Zn("horiz",-1),ArrowRight:Zn("horiz",1),ArrowUp:Zn("vert",-1),ArrowDown:Zn("vert",1)});function Zn(t,e){const n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,i){let o=t.selection,s=e>0?o.$to:o.$from,a=o.empty;if(o instanceof wt.Bs){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=t.doc.resolve(e>0?s.after():s.before())}let l=Hn.findGapCursorFrom(s,e,a);return!!l&&(r&&r(t.tr.setSelection(new Hn(l))),!0)}}function Fn(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Hn.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&wt.qv.isSelectable(t.state.doc.nodeAt(i.inside)))&&(t.dispatch(t.state.tr.setSelection(new Hn(r))),!0)}function Vn(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof Hn))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=zn.HY.empty;for(let t=r.length-1;t>=0;t--)i=zn.HY.from(r[t].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new zn.p2(i,0,0));return o.setSelection(wt.Bs.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function Yn(t){if(!(t.selection instanceof Hn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",xt.EH.create(t.doc,[xt.p.widget(t.selection.head,e,{key:"gapcursor"})])}const Wn=At.hj.create({name:"gapCursor",addProseMirrorPlugins:()=>[new wt.Sy({props:{decorations:Yn,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&Hn.valid(n)?new Hn(n):null,handleClick:Fn,handleKeyDown:jn,handleDOMEvents:{beforeinput:Vn}}})],extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:null!==(e=(0,At.nU)((0,At.Nl)(t,"allowGapCursor",n)))&&void 0!==e?e:null}}}),qn=At.NB.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML(t){const{HTMLAttributes:e}=t,n=document.createElement("p");n.style.cssText=e.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,At.P1)(this.options.HTMLAttributes,{style:r},{dir:"auto"}),0]},addCommands(){return{setParagraph:()=>t=>{let{commands:e}=t;return e.setNode(this.name)}}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Xn="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Gn="ελ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",Kn=(t,e)=>{for(const n in e)t[n]=e[n];return t},Jn="numeric",Qn="ascii",tr="alpha",er="asciinumeric",nr="alphanumeric",rr="domain",ir="emoji",or="scheme",sr="slashscheme",ar="whitespace";function lr(t,e){return t in e||(e[t]=[]),e[t]}function cr(t,e,n){e[Jn]&&(e[er]=!0,e[nr]=!0),e[Qn]&&(e[er]=!0,e[tr]=!0),e[er]&&(e[nr]=!0),e[tr]&&(e[nr]=!0),e[nr]&&(e[rr]=!0),e[ir]&&(e[rr]=!0);for(const r in e){const e=lr(r,n);e.indexOf(t)<0&&e.push(t)}}function dr(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}dr.groups={},dr.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let n=0;n<e.jr.length;n++){const r=e.jr[n][0],i=e.jr[n][1];if(i&&r.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){let i;return r=r||dr.groups,e&&e.j?i=e:(i=new dr(e),n&&r&&cr(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const o=t.length;if(!o)return i;for(let e=0;e<o-1;e++)i=i.tt(t[e]);return i.tt(t[o-1],e,n,r)},tt(t,e,n,r){r=r||dr.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const o=e;let s,a=i.go(t);if(a?(s=new dr,Kn(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new dr,o){if(r)if(s.t&&"string"==typeof s.t){const t=Kn(function(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}(s.t,r),n);cr(o,t,r)}else n&&cr(o,n,r);s.t=o}return i.j[t]=s,s}};const pr=(t,e,n,r,i)=>t.ta(e,n,r,i),hr=(t,e,n,r,i)=>t.tr(e,n,r,i),ur=(t,e,n,r,i)=>t.ts(e,n,r,i),fr=(t,e,n,r,i)=>t.tt(e,n,r,i),mr="WORD",gr="UWORD",br="ASCIINUMERICAL",yr="ALPHANUMERICAL",Ar="LOCALHOST",wr="TLD",vr="UTLD",_r="SCHEME",xr="SLASH_SCHEME",kr="NUM",Cr="WS",Er="NL",Sr="OPENBRACE",Br="CLOSEBRACE",Or="OPENBRACKET",$r="CLOSEBRACKET",Mr="OPENPAREN",Ir="CLOSEPAREN",Tr="OPENANGLEBRACKET",Lr="CLOSEANGLEBRACKET",Nr="FULLWIDTHLEFTPAREN",Rr="FULLWIDTHRIGHTPAREN",Pr="LEFTCORNERBRACKET",Dr="RIGHTCORNERBRACKET",zr="LEFTWHITECORNERBRACKET",Hr="RIGHTWHITECORNERBRACKET",Ur="FULLWIDTHLESSTHAN",jr="FULLWIDTHGREATERTHAN",Zr="AMPERSAND",Fr="APOSTROPHE",Vr="ASTERISK",Yr="AT",Wr="BACKSLASH",qr="BACKTICK",Xr="CARET",Gr="COLON",Kr="COMMA",Jr="DOLLAR",Qr="DOT",ti="EQUALS",ei="EXCLAMATION",ni="HYPHEN",ri="PERCENT",ii="PIPE",oi="PLUS",si="POUND",ai="QUERY",li="QUOTE",ci="FULLWIDTHMIDDLEDOT",di="SEMI",pi="SLASH",hi="TILDE",ui="UNDERSCORE",fi="EMOJI",mi="SYM";var gi=Object.freeze({__proto__:null,WORD:mr,UWORD:gr,ASCIINUMERICAL:br,ALPHANUMERICAL:yr,LOCALHOST:Ar,TLD:wr,UTLD:vr,SCHEME:_r,SLASH_SCHEME:xr,NUM:kr,WS:Cr,NL:Er,OPENBRACE:Sr,CLOSEBRACE:Br,OPENBRACKET:Or,CLOSEBRACKET:$r,OPENPAREN:Mr,CLOSEPAREN:Ir,OPENANGLEBRACKET:Tr,CLOSEANGLEBRACKET:Lr,FULLWIDTHLEFTPAREN:Nr,FULLWIDTHRIGHTPAREN:Rr,LEFTCORNERBRACKET:Pr,RIGHTCORNERBRACKET:Dr,LEFTWHITECORNERBRACKET:zr,RIGHTWHITECORNERBRACKET:Hr,FULLWIDTHLESSTHAN:Ur,FULLWIDTHGREATERTHAN:jr,AMPERSAND:Zr,APOSTROPHE:Fr,ASTERISK:Vr,AT:Yr,BACKSLASH:Wr,BACKTICK:qr,CARET:Xr,COLON:Gr,COMMA:Kr,DOLLAR:Jr,DOT:Qr,EQUALS:ti,EXCLAMATION:ei,HYPHEN:ni,PERCENT:ri,PIPE:ii,PLUS:oi,POUND:si,QUERY:ai,QUOTE:li,FULLWIDTHMIDDLEDOT:ci,SEMI:di,SLASH:pi,TILDE:hi,UNDERSCORE:ui,EMOJI:fi,SYM:mi});const bi=/[a-z]/,yi=/\p{L}/u,Ai=/\p{Emoji}/u,wi=/\d/,vi=/\s/;const _i="\r",xi="\n",ki="️",Ci="",Ei="";let Si=null,Bi=null;function Oi(t,e){const n=function(t){const e=[],n=t.length;let r=0;for(;r<n;){let i,o=t.charCodeAt(r),s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}(e.replace(/[A-Z]/g,(t=>t.toLowerCase()))),r=n.length,i=[];let o=0,s=0;for(;s<r;){let a=t,l=null,c=0,d=null,p=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(p=0,h=0,d=a):p>=0&&(p+=n[s].length,h++),c+=n[s].length,o+=n[s].length,s++;o-=p,s-=h,c-=p,i.push({t:d.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function $i(t,e,n,r,i){let o;const s=e.length;for(let n=0;n<s-1;n++){const s=e[n];t.j[s]?o=t.j[s]:(o=new dr(r),o.jr=i.slice(),t.j[s]=o),t=o}return o=new dr(n),o.jr=i.slice(),t.j[e[s-1]]=o,o}function Mi(t){const e=[],n=[];let r=0;for(;r<t.length;){let i=0;for(;"0123456789".indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let e=parseInt(t.substring(r,r+i),10);e>0;e--)n.pop();r+=i}else n.push(t[r]),r++}return e}const Ii={defaultProtocol:"http",events:null,format:Li,formatHref:Li,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ti(t,e=null){let n=Kn({},Ii);t&&(n=Kn(n,t instanceof Ti?t.o:t));const r=n.ignoreTags,i=[];for(let t=0;t<r.length;t++)i.push(r[t].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}function Li(t){return t}Ti.prototype={o:Ii,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=null!=e;let i=this.o[t];return i?("object"==typeof i?(i=n.t in i?i[n.t]:Ii[t],"function"==typeof i&&r&&(i=i(e,n))):"function"==typeof i&&r&&(i=i(e,n.t,n)),i):i},getObj(t,e,n){let r=this.o[t];return"function"==typeof r&&null!=e&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Ni(t,e){this.t="token",this.v=t,this.tk=e}function Ri(t,e){class n extends Ni{constructor(e,n){super(e,n),this.t=t}}for(const t in e)n.prototype[t]=e[t];return n.t=t,n}Ni.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ii.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Kn(s,d),{tagName:i,attributes:s,content:o,eventListeners:p}}};const Pi=Ri("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Di=Ri("text"),zi=Ri("nl"),Hi=Ri("url",{isLink:!0,toHref(t=Ii.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Ar&&t[1].t===Gr}});const Ui=t=>new dr(t);function ji(t,e,n){const r=n[0].s,i=n[n.length-1].e;return new t(e.slice(r,i),n)}const Zi="undefined"!=typeof console&&console&&console.warn||(()=>{}),Fi="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Vi={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Yi(t,e=!1){if(Vi.initialized&&Zi(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Fi}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))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');Vi.customSchemes.push([t,e])}function Wi(){Vi.scanner=function(t=[]){const e={};dr.groups=e;const n=new dr;null==Si&&(Si=Mi(Xn)),null==Bi&&(Bi=Mi(Gn)),fr(n,"'",Fr),fr(n,"{",Sr),fr(n,"}",Br),fr(n,"[",Or),fr(n,"]",$r),fr(n,"(",Mr),fr(n,")",Ir),fr(n,"<",Tr),fr(n,">",Lr),fr(n,"(",Nr),fr(n,")",Rr),fr(n,"「",Pr),fr(n,"」",Dr),fr(n,"『",zr),fr(n,"』",Hr),fr(n,"<",Ur),fr(n,">",jr),fr(n,"&",Zr),fr(n,"*",Vr),fr(n,"@",Yr),fr(n,"`",qr),fr(n,"^",Xr),fr(n,":",Gr),fr(n,",",Kr),fr(n,"$",Jr),fr(n,".",Qr),fr(n,"=",ti),fr(n,"!",ei),fr(n,"-",ni),fr(n,"%",ri),fr(n,"|",ii),fr(n,"+",oi),fr(n,"#",si),fr(n,"?",ai),fr(n,'"',li),fr(n,"/",pi),fr(n,";",di),fr(n,"~",hi),fr(n,"_",ui),fr(n,"\\",Wr),fr(n,"・",ci);const r=hr(n,wi,kr,{[Jn]:!0});hr(r,wi,r);const i=hr(r,bi,br,{[er]:!0}),o=hr(r,yi,yr,{[nr]:!0}),s=hr(n,bi,mr,{[Qn]:!0});hr(s,wi,i),hr(s,bi,s),hr(i,wi,i),hr(i,bi,i);const a=hr(n,yi,gr,{[tr]:!0});hr(a,bi),hr(a,wi,o),hr(a,yi,a),hr(o,wi,o),hr(o,bi),hr(o,yi,o);const l=fr(n,xi,Er,{[ar]:!0}),c=fr(n,_i,Cr,{[ar]:!0}),d=hr(n,vi,Cr,{[ar]:!0});fr(n,Ei,d),fr(c,xi,l),fr(c,Ei,d),hr(c,vi,d),fr(d,_i),fr(d,xi),hr(d,vi,d),fr(d,Ei,d);const p=hr(n,Ai,fi,{[ir]:!0});fr(p,"#"),hr(p,Ai,p),fr(p,ki,p);const h=fr(p,Ci);fr(h,"#"),hr(h,Ai,p);const u=[[bi,s],[wi,i]],f=[[bi,null],[yi,a],[wi,o]];for(let t=0;t<Si.length;t++)$i(n,Si[t],wr,mr,u);for(let t=0;t<Bi.length;t++)$i(n,Bi[t],vr,gr,f);cr(wr,{tld:!0,ascii:!0},e),cr(vr,{utld:!0,alpha:!0},e),$i(n,"file",_r,mr,u),$i(n,"mailto",_r,mr,u),$i(n,"http",xr,mr,u),$i(n,"https",xr,mr,u),$i(n,"ftp",xr,mr,u),$i(n,"ftps",xr,mr,u),cr(_r,{scheme:!0,ascii:!0},e),cr(xr,{slashscheme:!0,ascii:!0},e),t=t.sort(((t,e)=>t[0]>e[0]?1:-1));for(let e=0;e<t.length;e++){const r=t[e][0],i=t[e][1]?{[or]:!0}:{[sr]:!0};r.indexOf("-")>=0?i[rr]=!0:bi.test(r)?wi.test(r)?i[er]=!0:i[Qn]=!0:i[Jn]=!0,ur(n,r,r,i)}return ur(n,"localhost",Ar,{ascii:!0}),n.jd=new dr(mi),{start:n,tokens:Kn({groups:e},gi)}}(Vi.customSchemes);for(let t=0;t<Vi.tokenQueue.length;t++)Vi.tokenQueue[t][1]({scanner:Vi.scanner});Vi.parser=function({groups:t}){const e=t.domain.concat([Zr,Vr,Yr,Wr,qr,Xr,Jr,ti,ni,kr,ri,ii,oi,si,pi,mi,hi,ui]),n=[Gr,Kr,Qr,ei,ri,ai,li,di,Tr,Lr,Sr,Br,$r,Or,Mr,Ir,Nr,Rr,Pr,Dr,zr,Hr,Ur,jr],r=[Zr,Fr,Vr,Wr,qr,Xr,Jr,ti,ni,Sr,Br,ri,ii,oi,si,ai,pi,mi,hi,ui],i=Ui(),o=fr(i,hi);pr(o,r,o),pr(o,t.domain,o);const s=Ui(),a=Ui(),l=Ui();pr(i,t.domain,s),pr(i,t.scheme,a),pr(i,t.slashscheme,l),pr(s,r,o),pr(s,t.domain,s);const c=fr(s,Yr);fr(o,Yr,c),fr(a,Yr,c),fr(l,Yr,c);const d=fr(o,Qr);pr(d,r,o),pr(d,t.domain,o);const p=Ui();pr(c,t.domain,p),pr(p,t.domain,p);const h=fr(p,Qr);pr(h,t.domain,p);const u=Ui(Pi);pr(h,t.tld,u),pr(h,t.utld,u),fr(c,Ar,u);const f=fr(p,ni);fr(f,ni,f),pr(f,t.domain,p),pr(u,t.domain,p),fr(u,Qr,h),fr(u,ni,f);const m=fr(u,Gr);pr(m,t.numeric,Pi);const g=fr(s,ni),b=fr(s,Qr);fr(g,ni,g),pr(g,t.domain,s),pr(b,r,o),pr(b,t.domain,s);const y=Ui(Hi);pr(b,t.tld,y),pr(b,t.utld,y),pr(y,t.domain,s),pr(y,r,o),fr(y,Qr,b),fr(y,ni,g),fr(y,Yr,c);const A=fr(y,Gr),w=Ui(Hi);pr(A,t.numeric,w);const v=Ui(Hi),_=Ui();pr(v,e,v),pr(v,n,_),pr(_,e,v),pr(_,n,_),fr(y,pi,v),fr(w,pi,v);const x=fr(a,Gr),k=fr(l,Gr),C=fr(k,pi),E=fr(C,pi);pr(a,t.domain,s),fr(a,Qr,b),fr(a,ni,g),pr(l,t.domain,s),fr(l,Qr,b),fr(l,ni,g),pr(x,t.domain,v),fr(x,pi,v),fr(x,ai,v),pr(E,t.domain,v),pr(E,e,v),fr(E,pi,v);const S=[[Sr,Br],[Or,$r],[Mr,Ir],[Tr,Lr],[Nr,Rr],[Pr,Dr],[zr,Hr],[Ur,jr]];for(let t=0;t<S.length;t++){const[r,i]=S[t],o=fr(v,r);fr(_,r,o),fr(o,i,v);const s=Ui(Hi);pr(o,e,s);const a=Ui();pr(o,n),pr(s,e,s),pr(s,n,a),pr(a,e,s),pr(a,n,a),fr(s,i,v),fr(a,i,v)}return fr(i,Ar,y),fr(i,Er,zi),{start:i,tokens:gi}}(Vi.scanner.tokens);for(let t=0;t<Vi.pluginQueue.length;t++)Vi.pluginQueue[t][1]({scanner:Vi.scanner,parser:Vi.parser});return Vi.initialized=!0,Vi}function qi(t){return Vi.initialized||Wi(),function(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let a=t,l=null,c=null,d=0,p=null,h=-1;for(;i<r&&!(l=a.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=l||a.go(n[i].t));)l=null,a=c,a.accepts()?(h=0,p=a):h>=0&&h++,i++,d++;if(h<0)i-=d,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(ji(Di,e,s)),s=[]),i-=h,d-=h;const t=p.t,r=n.slice(i-d,i);o.push(ji(t,e,r))}}return s.length>0&&o.push(ji(Di,e,s)),o}(Vi.parser.start,t,Oi(Vi.scanner.start,t))}function Xi(t,e=null,n=null){if(e&&"object"==typeof e){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Ti(n),i=qi(t),o=[];for(let t=0;t<i.length;t++){const n=i[t];!n.isLink||e&&n.t!==e||!r.check(n)||o.push(n.toFormattedObject(r))}return o}qi.scan=Oi;const Gi=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Ki(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach((t=>{const e="string"==typeof t?t:t.scheme;e&&n.push(e)})),!t||t.replace(Gi,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Ji=At.vc.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((t=>{"string"!=typeof t?Yi(t.scheme,t.optionalSlashes):Yi(t)}))},onDestroy(){dr.groups={},Vi.scanner=null,Vi.parser=null,Vi.tokenQueue=[],Vi.pluginQueue=[],Vi.customSchemes=[],Vi.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:(t,e)=>!!Ki(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}),addAttributes(){return{href:{default:null,parseHTML:t=>t.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:t=>{const e=t.getAttribute("href");return!(!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Ki(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:t=>!!Ki(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,At.P1)(this.options.HTMLAttributes,t),0]:["a",(0,At.P1)(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return!!this.options.isAllowedUri(n,{defaultValidate:t=>!!Ki(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&e().setMark(this.name,t).setMeta("preventAutolink",!0).run()},toggleLink:t=>({chain:e})=>{const{href:n}=t;return!!this.options.isAllowedUri(n,{defaultValidate:t=>!!Ki(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[(0,At.K9)({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=Xi(t).filter((t=>t.isLink&&this.options.isAllowedUri(t.value,{defaultValidate:t=>!!Ki(t,n),protocols:n,defaultProtocol:r})));i.length&&i.forEach((t=>e.push({text:t.value,data:{href:t.href},index:t.start})))}return e},type:this.type,getAttributes:t=>{var e;return{href:null===(e=t.data)||void 0===e?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(function(t){return new wt.Sy({key:new wt.H$("autolink"),appendTransaction:(e,n,r)=>{const i=e.some((t=>t.docChanged))&&!n.doc.eq(r.doc),o=e.some((t=>t.getMeta("preventAutolink")));if(!i||o)return;const{tr:s}=r,a=(0,At.XP)(n.doc,[...e]);return(0,At.QC)(a).forEach((({newRange:e})=>{const n=(0,At.b5)(r.doc,e,(t=>t.isTextblock));let i,o;if(n.length>1?(i=n[0],o=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0," ")):n.length&&r.doc.textBetween(e.from,e.to," "," ").endsWith(" ")&&(i=n[0],o=r.doc.textBetween(i.pos,e.to,void 0," ")),i&&o){const e=o.split(" ").filter((t=>""!==t));if(e.length<=0)return!1;const n=e[e.length-1],l=i.pos+o.lastIndexOf(n);if(!n)return!1;const c=qi(n).map((e=>e.toObject(t.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((t=>t.isLink)).map((t=>({...t,from:l+t.start+1,to:l+t.end+1}))).filter((t=>!r.schema.marks.code||!r.doc.rangeHasMark(t.from,t.to,r.schema.marks.code))).filter((e=>t.validate(e.value))).filter((e=>t.shouldAutoLink(e.value))).forEach((e=>{(0,At.tI)(e.from,e.to,r.doc).some((e=>e.mark.type===t.type))||s.addMark(e.from,e.to,t.type.create({href:e.href}))}))}var a})),s.steps.length?s:void 0}})}({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:t=>this.options.isAllowedUri(t,{defaultValidate:t=>!!Ki(t,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),!0===this.options.openOnClick&&t.push(function(t){return new wt.Sy({key:new wt.H$("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(0!==r.button)return!1;if(!e.editable)return!1;let s=r.target;const a=[];for(;"DIV"!==s.nodeName;)a.push(s),s=s.parentNode;if(!a.find((t=>"A"===t.nodeName)))return!1;const l=(0,At.u9)(e.state,t.type.name),c=r.target,d=null!==(i=null==c?void 0:c.href)&&void 0!==i?i:l.href,p=null!==(o=null==c?void 0:c.target)&&void 0!==o?o:l.target;return!(!c||!d||(window.open(d,p),0))}}})}({type:this.type})),this.options.linkOnPaste&&t.push(function(t){return new wt.Sy({key:new wt.H$("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach((t=>{a+=t.textContent}));const l=Xi(a,{defaultProtocol:t.defaultProtocol}).find((t=>t.isLink&&t.value===a));return!(!a||!l)&&t.editor.commands.setMark(t.type,{href:l.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});let Qi,to;if("undefined"!=typeof WeakMap){let t=new WeakMap;Qi=e=>t.get(e),to=(e,n)=>(t.set(e,n),n)}else{let t=[],e=10,n=0;Qi=e=>{for(let n=0;n<t.length;n+=2)if(t[n]==e)return t[n+1]},to=(r,i)=>(n==e&&(n=0),t[n++]=r,t[n++]=i)}class eo{constructor(t,e,n,r){this.left=t,this.top=e,this.right=n,this.bottom=r}}class no{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){let n=this.map[e];if(n!=t)continue;let r=e%this.width,i=e/this.width|0,o=r+1,s=i+1;for(let t=1;o<this.width&&this.map[e+t]==n;t++)o++;for(let t=1;s<this.height&&this.map[e+this.width*t]==n;t++)s++;return new eo(r,i,o,s)}throw new RangeError("No cell with offset "+t+" found")}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError("No cell with offset "+t+" found")}nextCell(t,e,n){let{left:r,right:i,top:o,bottom:s}=this.findCell(t);return"horiz"==e?(n<0?0==r:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?0==o:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(t,e){let{left:n,right:r,top:i,bottom:o}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return new eo(Math.min(n,s),Math.min(i,l),Math.max(r,a),Math.max(o,c))}cellsInRect(t){let e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){let o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,i==t.left&&i&&this.map[o-1]==s||r==t.top&&r&&this.map[o-this.width]==s||e.push(s))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){let o=i+n.child(r).nodeSize;if(r==t){let n=e+t*this.width,r=(t+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?o-1:this.map[n]}i=o}}static get(t){return Qi(t)||to(t,function(t){if("table"!=t.type.spec.tableRole)throw new RangeError("Not a table node: "+t.type.name);let e=function(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){let i=t.child(r),o=0;if(n)for(let e=0;e<r;e++){let n=t.child(e);for(let t=0;t<n.childCount;t++){let i=n.child(t);e+i.attrs.rowspan>r&&(o+=i.attrs.colspan)}}for(let t=0;t<i.childCount;t++){let e=i.child(t);o+=e.attrs.colspan,e.attrs.rowspan>1&&(n=!0)}-1==e?e=o:e!=o&&(e=Math.max(e,o))}return e}(t),n=t.childCount,r=[],i=0,o=null,s=[];for(let t=0,i=e*n;t<i;t++)r[t]=0;for(let a=0,l=0;a<n;a++){let c=t.child(a);l++;for(let t=0;;t++){for(;i<r.length&&0!=r[i];)i++;if(t==c.childCount)break;let d=c.child(t),{colspan:p,rowspan:h,colwidth:u}=d.attrs;for(let t=0;t<h;t++){if(t+a>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:l,n:h-t});break}let c=i+t*e;for(let t=0;t<p;t++){0==r[c+t]?r[c+t]=l:(o||(o=[])).push({type:"collision",row:a,pos:l,n:p-t});let n=u&&u[t];if(n){let r=(c+t)%e*2,i=s[r];null==i||i!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):i==n&&s[r+1]++}}}i+=p,l+=d.nodeSize}let d=(a+1)*e,p=0;for(;i<d;)0==r[i++]&&p++;p&&(o||(o=[])).push({type:"missing",row:a,n:p}),l++}let a=new no(e,n,r,o),l=!1;for(let t=0;!l&&t<s.length;t+=2)null!=s[t]&&s[t+1]<n&&(l=!0);l&&function(t,e,n){t.problems||(t.problems=[]);for(let r=0,i={};r<t.map.length;r++){let o=t.map[r];if(i[o])continue;i[o]=!0;let s=n.nodeAt(o),a=null;for(let n=0;n<s.attrs.colspan;n++){let i=e[2*((r+n)%t.width)];null==i||s.attrs.colwidth&&s.attrs.colwidth[n]==i||((a||(a=ro(s.attrs)))[n]=i)}a&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:a})}}(a,s,t);return a}(t))}}function ro(t){if(t.colwidth)return t.colwidth.slice();let e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function io(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(let n in t.nodes){let r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}const oo=new wt.H$("selectingCells");function so(t){for(let e=t.depth-1;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}function ao(t){let e=t.selection.$head;for(let t=e.depth;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return!0;return!1}function lo(t){let e=t.selection;return e.$anchorCell?e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell:e.node&&"cell"==e.node.type.spec.tableRole?e.$anchor:so(e.$head)||function(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if("cell"==r||"header_cell"==r)return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if("cell"==r||"header_cell"==r)return t.doc.resolve(n-e.nodeSize)}}(e.$head)}function co(t){return"row"==t.parent.type.spec.tableRole&&t.nodeAfter}function po(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function ho(t,e,n){let r=t.start(-1),i=no.get(t.node(-1)).nextCell(t.pos-r,e,n);return null==i?null:t.node(0).resolve(r+i)}function uo(t,e,n){let r={};for(let e in t)r[e]=t[e];return r[e]=n,r}function fo(t,e,n=1){let r=uo(t,"colspan",t.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some((t=>t>0))||(r.colwidth=null)),r}function mo(t,e,n=1){let r=uo(t,"colspan",t.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(let t=0;t<n;t++)r.colwidth.splice(e,0,0)}return r}class go extends wt.Y1{constructor(t,e=t){let n=t.node(-1),r=no.get(n),i=t.start(-1),o=r.rectBetween(t.pos-i,e.pos-i),s=t.node(0),a=r.cellsInRect(o).filter((t=>t!=e.pos-i));a.unshift(e.pos-i);let l=a.map((t=>{let e=n.nodeAt(t),r=t+i+1;return new wt.xm(s.resolve(r),s.resolve(r+e.content.size))}));super(l[0].$from,l[0].$to,l),this.$anchorCell=t,this.$headCell=e}map(t,e){let n=t.resolve(e.map(this.$anchorCell.pos)),r=t.resolve(e.map(this.$headCell.pos));if(co(n)&&co(r)&&po(n,r)){let t=this.$anchorCell.node(-1)!=n.node(-1);return t&&this.isRowSelection()?go.rowSelection(n,r):t&&this.isColSelection()?go.colSelection(n,r):new go(n,r)}return wt.Bs.between(n,r)}content(){let t=this.$anchorCell.node(-1),e=no.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[];for(let n=r.top;n<r.bottom;n++){let s=[];for(let o=n*e.width+r.left,a=r.left;a<r.right;a++,o++){let n=e.map[o];if(!i[n]){i[n]=!0;let o=e.findCell(n),a=t.nodeAt(n),l=r.left-o.left,c=o.right-r.right;if(l>0||c>0){let t=a.attrs;l>0&&(t=fo(t,0,l)),c>0&&(t=fo(t,t.colspan-c,c)),a=o.left<r.left?a.type.createAndFill(t):a.type.create(t,a.content)}if(o.top<r.top||o.bottom>r.bottom){let t=uo(a.attrs,"rowspan",Math.min(o.bottom,r.bottom)-Math.max(o.top,r.top));a=o.top<r.top?a.type.createAndFill(t):a.type.create(t,a.content)}s.push(a)}}o.push(t.child(n).copy(zn.HY.from(s)))}const s=this.isColSelection()&&this.isRowSelection()?t:o;return new zn.p2(zn.HY.from(s),1,1)}replace(t,e=zn.p2.empty){let n=t.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=t.mapping.slice(n);t.replace(a.map(o.pos),a.map(s.pos),i?zn.p2.empty:e)}let i=wt.Y1.findFrom(t.doc.resolve(t.mapping.slice(n).map(this.to)),-1);i&&t.setSelection(i)}replaceWith(t,e){this.replace(t,new zn.p2(zn.HY.from(e),0,0))}forEachCell(t){let e=this.$anchorCell.node(-1),n=no.get(e),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)t(e.nodeAt(i[n]),r+i[n])}isColSelection(){let t=this.$anchorCell.index(-1),e=this.$headCell.index(-1);if(Math.min(t,e)>0)return!1;let n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,e=t){let n=no.get(t.node(-1)),r=t.start(-1),i=n.findCell(t.pos-r),o=n.findCell(e.pos-r),s=t.node(0);return i.top<=o.top?(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]))):(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]))),new go(t,e)}isRowSelection(){let t=no.get(this.$anchorCell.node(-1)),e=this.$anchorCell.start(-1),n=t.colCount(this.$anchorCell.pos-e),r=t.colCount(this.$headCell.pos-e);if(Math.min(n,r)>0)return!1;let i=n+this.$anchorCell.nodeAfter.attrs.colspan,o=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,o)==t.width}eq(t){return t instanceof go&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,e=t){let n=no.get(t.node(-1)),r=t.start(-1),i=n.findCell(t.pos-r),o=n.findCell(e.pos-r),s=t.node(0);return i.left<=o.left?(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]))):(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]))),new go(t,e)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,e){return new go(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){return new go(t.resolve(e),t.resolve(n))}getBookmark(){return new bo(this.$anchorCell.pos,this.$headCell.pos)}}go.prototype.visible=!1,wt.Y1.jsonID("cell",go);class bo{constructor(t,e){this.anchor=t,this.head=e}map(t){return new bo(t.map(this.anchor),t.map(this.head))}resolve(t){let e=t.resolve(this.anchor),n=t.resolve(this.head);return"row"==e.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&e.index()<e.parent.childCount&&n.index()<n.parent.childCount&&po(e,n)?new go(e,n):wt.Y1.near(n,1)}}function yo(t){if(!(t.selection instanceof go))return null;let e=[];return t.selection.forEachCell(((t,n)=>{e.push(xt.p.node(n,n+t.nodeSize,{class:"selectedCell"}))})),xt.EH.create(t.doc,e)}function Ao(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;1==e.childCount&&(n>0&&r>0||"table"==e.firstChild.type.spec.tableRole);)n--,r--,e=e.firstChild.content;let i=e.firstChild,o=i.type.spec.tableRole,s=i.type.schema,a=[];if("row"==o)for(let t=0;t<e.childCount;t++){let i=e.child(t).content,o=t?0:Math.max(0,n-1),l=t<e.childCount-1?0:Math.max(0,r-1);(o||l)&&(i=wo(io(s).row,new zn.p2(i,o,l)).content),a.push(i)}else{if("cell"!=o&&"header_cell"!=o)return null;a.push(n||r?wo(io(s).row,new zn.p2(e,n,r)).content:e)}return function(t,e){let n=[];for(let t=0;t<e.length;t++){let r=e[t];for(let e=r.childCount-1;e>=0;e--){let{rowspan:i,colspan:o}=r.child(e).attrs;for(let e=t;e<t+i;e++)n[e]=(n[e]||0)+o}}let r=0;for(let t=0;t<n.length;t++)r=Math.max(r,n[t]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(zn.HY.empty),n[i]<r){let o=io(t).cell.createAndFill(),s=[];for(let t=n[i];t<r;t++)s.push(o);e[i]=e[i].append(zn.HY.from(s))}return{height:e.length,width:r,rows:e}}(s,a)}function wo(t,e){let n=t.createAndFill();return new qt.wx(n).replace(0,n.content.size,e).doc}function vo(t,e,n,r,i,o,s,a){if(0==s||s==e.height)return!1;let l=!1;for(let c=i;c<o;c++){let i=s*e.width+c,o=e.map[i];if(e.map[i-e.width]==o){l=!0;let i=n.nodeAt(o),{top:d,left:p}=e.findCell(o);t.setNodeMarkup(t.mapping.slice(a).map(o+r),null,uo(i.attrs,"rowspan",s-d)),t.insert(t.mapping.slice(a).map(e.positionAt(s,p,n)),i.type.createAndFill(uo(i.attrs,"rowspan",d+i.attrs.rowspan-s))),c+=i.attrs.colspan-1}}return l}function _o(t,e,n,r,i,o,s,a){if(0==s||s==e.width)return!1;let l=!1;for(let c=i;c<o;c++){let i=c*e.width+s,o=e.map[i];if(e.map[i-1]==o){l=!0;let i=n.nodeAt(o),d=e.colCount(o),p=t.mapping.slice(a).map(o+r);t.setNodeMarkup(p,null,fo(i.attrs,s-d,i.attrs.colspan-(s-d))),t.insert(p+i.nodeSize,i.type.createAndFill(fo(i.attrs,0,s-d))),c+=i.attrs.rowspan-1}}return l}function xo(t,e,n,r,i){let o=n?t.doc.nodeAt(n-1):t.doc,s=no.get(o),{top:a,left:l}=r,c=l+i.width,d=a+i.height,p=t.tr,h=0;function u(){o=n?p.doc.nodeAt(n-1):p.doc,s=no.get(o),h=p.mapping.maps.length}(function(t,e,n,r,i,o,s){let a,l,c=io(t.doc.type.schema);if(i>e.width)for(let o=0,d=0;o<e.height;o++){let p=n.child(o);d+=p.nodeSize;let h,u=[];h=null==p.lastChild||p.lastChild.type==c.cell?a||(a=c.cell.createAndFill()):l||(l=c.header_cell.createAndFill());for(let t=e.width;t<i;t++)u.push(h);t.insert(t.mapping.slice(s).map(d-1+r),u)}if(o>e.height){let d=[];for(let t=0,r=(e.height-1)*e.width;t<Math.max(e.width,i);t++){let i=!(t>=e.width)&&n.nodeAt(e.map[r+t]).type==c.header_cell;d.push(i?l||(l=c.header_cell.createAndFill()):a||(a=c.cell.createAndFill()))}let p=c.row.create(null,zn.HY.from(d)),h=[];for(let t=e.height;t<o;t++)h.push(p);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),h)}return!(!a&&!l)})(p,s,o,n,c,d,h)&&u(),vo(p,s,o,n,l,c,a,h)&&u(),vo(p,s,o,n,l,c,d,h)&&u(),_o(p,s,o,n,a,d,l,h)&&u(),_o(p,s,o,n,a,d,c,h)&&u();for(let t=a;t<d;t++){let e=s.positionAt(t,l,o),r=s.positionAt(t,c,o);p.replace(p.mapping.slice(h).map(e+n),p.mapping.slice(h).map(r+n),new zn.p2(i.rows[t-a],0,0))}u(),p.setSelection(new go(p.doc.resolve(n+s.positionAt(a,l,o)),p.doc.resolve(n+s.positionAt(d-1,c-1,o)))),e(p)}const ko=(0,Dn.$)({ArrowLeft:Eo("horiz",-1),ArrowRight:Eo("horiz",1),ArrowUp:Eo("vert",-1),ArrowDown:Eo("vert",1),"Shift-ArrowLeft":So("horiz",-1),"Shift-ArrowRight":So("horiz",1),"Shift-ArrowUp":So("vert",-1),"Shift-ArrowDown":So("vert",1),Backspace:Bo,"Mod-Backspace":Bo,Delete:Bo,"Mod-Delete":Bo});function Co(t,e,n){return!n.eq(t.selection)&&(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Eo(t,e){return(n,r,i)=>{let o=n.selection;if(o instanceof go)return Co(n,r,wt.Y1.near(o.$headCell,e));if("horiz"!=t&&!o.empty)return!1;let s=Io(i,t,e);if(null==s)return!1;if("horiz"==t)return Co(n,r,wt.Y1.near(n.doc.resolve(o.head+e),e));{let i,o=n.doc.resolve(s),a=ho(o,t,e);return i=a?wt.Y1.near(a,1):e<0?wt.Y1.near(n.doc.resolve(o.before(-1)),-1):wt.Y1.near(n.doc.resolve(o.after(-1)),1),Co(n,r,i)}}}function So(t,e){return(n,r,i)=>{let o=n.selection;if(!(o instanceof go)){let r=Io(i,t,e);if(null==r)return!1;o=new go(n.doc.resolve(r))}let s=ho(o.$headCell,t,e);return!!s&&Co(n,r,new go(o.$anchorCell,s))}}function Bo(t,e){let n=t.selection;if(!(n instanceof go))return!1;if(e){let r=t.tr,i=io(t.schema).cell.createAndFill().content;n.forEachCell(((t,e)=>{t.content.eq(i)||r.replace(r.mapping.map(e+1),r.mapping.map(e+t.nodeSize-1),new zn.p2(i,0,0))})),r.docChanged&&e(r)}return!0}function Oo(t,e){let n=so(t.state.doc.resolve(e));return!!n&&(t.dispatch(t.state.tr.setSelection(new go(n))),!0)}function $o(t,e,n){if(!ao(t.state))return!1;let r=Ao(n),i=t.state.selection;if(i instanceof go){r||(r={width:1,height:1,rows:[zn.HY.from(wo(io(t.state.schema).cell,n))]});let e=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),s=no.get(e).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=function({width:t,height:e,rows:n},r,i){if(t!=r){let e=[],i=[];for(let t=0;t<n.length;t++){let o=n[t],s=[];for(let n=e[t]||0,i=0;n<r;i++){let a=o.child(i%o.childCount);n+a.attrs.colspan>r&&(a=a.type.create(fo(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++)e[t+n]=(e[t+n]||0)+a.attrs.colspan}i.push(zn.HY.from(s))}n=i,t=r}if(e!=i){let t=[];for(let r=0,o=0;r<i;r++,o++){let s=[],a=n[o%e];for(let t=0;t<a.childCount;t++){let e=a.child(t);r+e.attrs.rowspan>i&&(e=e.type.create(uo(e.attrs,"rowspan",Math.max(1,i-e.attrs.rowspan)),e.content)),s.push(e)}t.push(zn.HY.from(s))}n=t,e=i}return{width:t,height:e,rows:n}}(r,s.right-s.left,s.bottom-s.top),xo(t.state,t.dispatch,o,s,r),!0}if(r){let e=lo(t.state),n=e.start(-1);return xo(t.state,t.dispatch,n,no.get(e.node(-1)).findCell(e.pos-n),r),!0}return!1}function Mo(t,e){if(e.ctrlKey||e.metaKey)return;let n,r=To(t,e.target);if(e.shiftKey&&t.state.selection instanceof go)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&null!=(n=so(t.state.selection.$anchor))&&Lo(t,e).pos!=n.pos)i(n,e),e.preventDefault();else if(!r)return;function i(e,n){let r=Lo(t,n),i=null==oo.getState(t.state);if(!r||!po(e,r)){if(!i)return;r=e}let o=new go(e,r);if(i||!t.state.selection.eq(o)){let n=t.state.tr.setSelection(o);i&&n.setMeta(oo,e.pos),t.dispatch(n)}}function o(){t.root.removeEventListener("mouseup",o),t.root.removeEventListener("dragstart",o),t.root.removeEventListener("mousemove",s),null!=oo.getState(t.state)&&t.dispatch(t.state.tr.setMeta(oo,-1))}function s(n){let s,a=oo.getState(t.state);if(null!=a)s=t.state.doc.resolve(a);else if(To(t,n.target)!=r&&(s=Lo(t,e),!s))return o();s&&i(s,n)}t.root.addEventListener("mouseup",o),t.root.addEventListener("dragstart",o),t.root.addEventListener("mousemove",s)}function Io(t,e,n){if(!(t.state.selection instanceof wt.Bs))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if("cell"==o.type.spec.tableRole||"header_cell"==o.type.spec.tableRole){let o=r.before(i),s="vert"==e?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(s)?o:null}}return null}function To(t,e){for(;e&&e!=t.dom;e=e.parentNode)if("TD"==e.nodeName||"TH"==e.nodeName)return e}function Lo(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?so(t.state.doc.resolve(n.pos)):null}const No=new wt.H$("fix-tables");function Ro(t,e,n,r){let i=t.childCount,o=e.childCount;t:for(let s=0,a=0;s<o;s++){let o=e.child(s);for(let e=a,r=Math.min(i,s+3);e<r;e++)if(t.child(e)==o){a=e+1,n+=o.nodeSize;continue t}r(o,n),a<i&&t.child(a).sameMarkup(o)?Ro(t.child(a),o,n+1,r):o.nodesBetween(0,o.content.size,r,n+1),n+=o.nodeSize}}function Po(t,e){let n,r=(e,r)=>{"table"==e.type.spec.tableRole&&(n=function(t,e,n,r){let i=no.get(e);if(!i.problems)return r;r||(r=t.tr);let o,s,a=[];for(let t=0;t<i.height;t++)a.push(0);for(let t=0;t<i.problems.length;t++){let o=i.problems[t];if("collision"==o.type){let t=e.nodeAt(o.pos);for(let e=0;e<t.attrs.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,fo(t.attrs,t.attrs.colspan-o.n,o.n))}else if("missing"==o.type)a[o.row]+=o.n;else if("overlong_rowspan"==o.type){let t=e.nodeAt(o.pos);r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,uo(t.attrs,"rowspan",t.attrs.rowspan-o.n))}else if("colwidth mismatch"==o.type){let t=e.nodeAt(o.pos);r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,uo(t.attrs,"colwidth",o.colwidth))}}for(let t=0;t<a.length;t++)a[t]&&(null==o&&(o=t),s=t);for(let l=0,c=n+1;l<i.height;l++){let n=e.child(l),i=c+n.nodeSize,d=a[l];if(d>0){let e="cell";n.firstChild&&(e=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<d;n++)a.push(io(t.schema)[e].createAndFill());let p=0!=l&&o!=l-1||s!=l?i-1:c+1;r.insert(r.mapping.map(p),a)}c=i}return r.setMeta(No,{fixTables:!0})}(t,e,r,n))};return e?e.doc!=t.doc&&Ro(e.doc,t.doc,0,r):t.doc.descendants(r),n}function Do(t){let e,n=t.selection,r=lo(t),i=r.node(-1),o=r.start(-1),s=no.get(i);return e=n instanceof go?s.rectBetween(n.$anchorCell.pos-o,n.$headCell.pos-o):s.findCell(r.pos-o),e.tableStart=o,e.map=s,e.table=i,e}function zo(t,{map:e,tableStart:n,table:r},i){let o=i>0?-1:0;(function(t,e,n){let r=io(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0})(e,r,i+o)&&(o=0==i||i==e.width?null:0);for(let s=0;s<e.height;s++){let a=s*e.width+i;if(i>0&&i<e.width&&e.map[a-1]==e.map[a]){let o=e.map[a],l=r.nodeAt(o);t.setNodeMarkup(t.mapping.map(n+o),null,mo(l.attrs,i-e.colCount(o))),s+=l.attrs.rowspan-1}else{let l=null==o?io(r.type.schema).cell:r.nodeAt(e.map[a+o]).type,c=e.positionAt(s,i,r);t.insert(t.mapping.map(n+c),l.createAndFill())}}return t}function Ho(t,{map:e,table:n,tableStart:r},i){let o=t.mapping.maps.length;for(let s=0;s<e.height;){let a=s*e.width+i,l=e.map[a],c=n.nodeAt(l);if(i>0&&e.map[a-1]==l||i<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(o).map(r+l),null,fo(c.attrs,i-e.colCount(l)));else{let e=t.mapping.slice(o).map(r+l);t.delete(e,e+c.nodeSize)}s+=c.attrs.rowspan}}function Uo(t,{map:e,tableStart:n,table:r},i){let o=n;for(let t=0;t<i;t++)o+=r.child(t).nodeSize;let s=[],a=i>0?-1:0;(function(t,e,n){let r=io(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(e.nodeAt(t.map[i+n*t.width]).type!=r)return!1;return!0})(e,r,i+a)&&(a=0==i||i==e.height?null:0);for(let o=0,l=e.width*i;o<e.width;o++,l++)if(i>0&&i<e.height&&e.map[l]==e.map[l-e.width]){let i=e.map[l],s=r.nodeAt(i).attrs;t.setNodeMarkup(n+i,null,uo(s,"rowspan",s.rowspan+1)),o+=s.colspan-1}else{let t=null==a?io(r.type.schema).cell:r.nodeAt(e.map[l+a*e.width]).type;s.push(t.createAndFill())}return t.insert(o,io(r.type.schema).row.create(null,s)),t}function jo(t,{map:e,table:n,tableStart:r},i){let o=0;for(let t=0;t<i;t++)o+=n.child(t).nodeSize;let s=o+n.child(i).nodeSize,a=t.mapping.maps.length;t.delete(o+r,s+r);for(let o=0,s=i*e.width;o<e.width;o++,s++){let l=e.map[s];if(i>0&&l==e.map[s-e.width]){let e=n.nodeAt(l).attrs;t.setNodeMarkup(t.mapping.slice(a).map(l+r),null,uo(e,"rowspan",e.rowspan-1)),o+=e.colspan-1}else if(i<e.width&&l==e.map[s+e.width]){let s=n.nodeAt(l),c=s.type.create(uo(s.attrs,"rowspan",s.attrs.rowspan-1),s.content),d=e.positionAt(i+1,o,n);t.insert(t.mapping.slice(a).map(r+d),c),o+=s.attrs.colspan-1}}}function Zo(t){let e=t.content;return 1==e.childCount&&e.firstChild.isTextblock&&0==e.firstChild.childCount}function Fo(t,e){let n=t.selection;if(!(n instanceof go)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Do(t),{map:i}=r;if(function({width:t,height:e,map:n},r){let i=r.top*t+r.left,o=i,s=(r.bottom-1)*t+r.left,a=i+(r.right-r.left-1);for(let e=r.top;e<r.bottom;e++){if(r.left>0&&n[o]==n[o-1]||r.right<t&&n[a]==n[a+1])return!0;o+=t,a+=t}for(let o=r.left;o<r.right;o++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[s]==n[s+t])return!0;i++,s++}return!1}(i,r))return!1;if(e){let n,o,s=t.tr,a={},l=zn.HY.empty;for(let t=r.top;t<r.bottom;t++)for(let e=r.left;e<r.right;e++){let c=i.map[t*i.width+e],d=r.table.nodeAt(c);if(!a[c])if(a[c]=!0,null==n)n=c,o=d;else{Zo(d)||(l=l.append(d.content));let t=s.mapping.map(c+r.tableStart);s.delete(t,t+d.nodeSize)}}if(s.setNodeMarkup(n+r.tableStart,null,uo(mo(o.attrs,o.attrs.colspan,r.right-r.left-o.attrs.colspan),"rowspan",r.bottom-r.top)),l.size){let t=n+1+o.content.size,e=Zo(o)?n+1:t;s.replaceWith(e+r.tableStart,t+r.tableStart,l)}s.setSelection(new go(s.doc.resolve(n+r.tableStart))),e(s)}return!0}function Vo(t,e){const n=io(t.schema);return(r=({node:t})=>n[t.type.spec.tableRole],(t,e)=>{let n,i,o=t.selection;if(o instanceof go){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;n=o.$anchorCell.nodeAfter,i=o.$anchorCell.pos}else{if(n=function(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if("cell"===n||"header_cell"===n)return t.node(e)}return null}(o.$from),!n)return!1;i=so(o.$from).pos}if(1==n.attrs.colspan&&1==n.attrs.rowspan)return!1;if(e){let s=n.attrs,a=[],l=s.colwidth;s.rowspan>1&&(s=uo(s,"rowspan",1)),s.colspan>1&&(s=uo(s,"colspan",1));let c,d=Do(t),p=t.tr;for(let t=0;t<d.right-d.left;t++)a.push(l?uo(s,"colwidth",l&&l[t]?[l[t]]:null):s);for(let t=d.top;t<d.bottom;t++){let e=d.map.positionAt(t,d.left,d.table);t==d.top&&(e+=n.nodeSize);for(let i=d.left,o=0;i<d.right;i++,o++)i==d.left&&t==d.top||p.insert(c=p.mapping.map(e+d.tableStart,1),r({node:n,row:t,col:i}).createAndFill(a[o]))}p.setNodeMarkup(i,r({node:n,row:d.top,col:d.left}),a[0]),o instanceof go&&p.setSelection(new go(p.doc.resolve(o.$anchorCell.pos),c&&p.doc.resolve(c))),e(p)}return!0})(t,e);var r}function Yo(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:"row"==t?e.map.width:1,bottom:"column"==t?e.map.height:1});for(let t=0;t<r.length;t++){const i=e.table.nodeAt(r[t]);if(i&&i.type!==n.header_cell)return!1}return!0}function Wo(t,e){return(e=e||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(t){return function(e,n){if(!ao(e))return!1;if(n){let r=io(e.schema),i=Do(e),o=e.tr,s=i.map.cellsInRect("column"==t?new eo(i.left,0,i.right,i.map.height):"row"==t?new eo(0,i.top,i.map.width,i.bottom):i),a=s.map((t=>i.table.nodeAt(t)));for(let t=0;t<s.length;t++)a[t].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[t],r.cell,a[t].attrs);if(0==o.steps.length)for(let t=0;t<s.length;t++)o.setNodeMarkup(i.tableStart+s[t],r.header_cell,a[t].attrs);n(o)}return!0}}(t):function(e,n){if(!ao(e))return!1;if(n){let r=io(e.schema),i=Do(e),o=e.tr,s=Yo("row",i,r),a=Yo("column",i,r),l=("column"===t?s:"row"===t&&a)?1:0,c="column"==t?new eo(0,l,1,i.map.height):"row"==t?new eo(l,0,i.map.width,1):i,d="column"==t?a?r.cell:r.header_cell:"row"==t?s?r.cell:r.header_cell:r.cell;i.map.cellsInRect(c).forEach((t=>{const e=t+i.tableStart,n=o.doc.nodeAt(e);n&&o.setNodeMarkup(e,d,n.attrs)})),n(o)}return!0}}Wo("row",{useDeprecatedLogic:!0}),Wo("column",{useDeprecatedLogic:!0});let qo=Wo("cell",{useDeprecatedLogic:!0});function Xo(t){return function(e,n){if(!ao(e))return!1;let r=function(t,e){if(e<0){let e=t.nodeBefore;if(e)return t.pos-e.nodeSize;for(let e=t.index(-1)-1,n=t.before();e>=0;e--){let r=t.node(-1).child(e);if(r.childCount)return n-1-r.lastChild.nodeSize;n-=r.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;let e=t.node(-1);for(let n=t.indexAfter(-1),r=t.after();n<e.childCount;n++){let t=e.child(n);if(t.childCount)return r+1;r+=t.nodeSize}}}(lo(e),t);if(null!=r){if(n){let t=e.doc.resolve(r);n(e.tr.setSelection(wt.Bs.between(t,(i=t,i.node(0).resolve(i.pos+i.nodeAfter.nodeSize)))).scrollIntoView())}var i;return!0}}}class Go{constructor(t,e){this.node=t,this.cellMinWidth=e,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")),Ko(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type==this.node.type&&(this.node=t,Ko(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return"attributes"==t.type&&(t.target==this.table||this.colgroup.contains(t.target))}}function Ko(t,e,n,r,i,o){let s=0,a=!0,l=e.firstChild,c=t.firstChild;for(let t=0,n=0;t<c.childCount;t++){let{colspan:d,colwidth:p}=c.child(t).attrs;for(let t=0;t<d;t++,n++){let c=i==n?o:p&&p[t],d=c?c+"px":"";s+=c||r,c||(a=!1),l?(l.style.width!=d&&(l.style.width=d),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=d}}for(;l;){let t=l.nextSibling;l.parentNode.removeChild(l),l=t}a?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}const Jo=new wt.H$("tableColumnResizing");function Qo({handleWidth:t=5,cellMinWidth:e=25,View:n=Go,lastColumnResizable:r=!0}={}){let i=new wt.Sy({key:Jo,state:{init(t,r){return this.spec.props.nodeViews[io(r.schema).table.name]=(t,r)=>new n(t,e,r),new ts(-1,!1)},apply:(t,e)=>e.apply(t)},props:{attributes:t=>Jo.getState(t).activeHandle>-1?{class:"resize-cursor"}:null,handleDOMEvents:{mousemove(e,n){!function(t,e,n,r,i){let o=Jo.getState(t.state);if(!o.dragging){let r=function(t){for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.classList.contains("ProseMirror")?null:t.parentNode;return t}(e.target),s=-1;if(r){let{left:i,right:o}=r.getBoundingClientRect();e.clientX-i<=n?s=es(t,e,"left"):o-e.clientX<=n&&(s=es(t,e,"right"))}if(s!=o.activeHandle){if(!i&&-1!==s){let e=t.state.doc.resolve(s),n=e.node(-1),r=no.get(n),i=e.start(-1);if(r.colCount(e.pos-i)+e.nodeAfter.attrs.colspan-1==r.width-1)return}rs(t,s)}}}(e,n,t,0,r)},mouseleave(t){!function(t){let e=Jo.getState(t.state);e.activeHandle>-1&&!e.dragging&&rs(t,-1)}(t)},mousedown(t,n){!function(t,e,n){let r=Jo.getState(t.state);if(-1==r.activeHandle||r.dragging)return!1;let i=t.state.doc.nodeAt(r.activeHandle),o=function(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=t.domAtPos(e),s=o.node.childNodes[o.offset].offsetWidth,a=n;if(r)for(let t=0;t<n;t++)r[t]&&(s-=r[t],a--);return s/a}(t,r.activeHandle,i.attrs);function s(e){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);let r=Jo.getState(t.state);r.dragging&&(!function(t,e,n){let r=t.state.doc.resolve(e),i=r.node(-1),o=no.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let t=0;t<o.height;t++){let e=t*o.width+a;if(t&&o.map[e]==o.map[e-o.width])continue;let r=o.map[e],{attrs:c}=i.nodeAt(r),d=1==c.colspan?0:a-o.colCount(r);if(c.colwidth&&c.colwidth[d]==n)continue;let p=c.colwidth?c.colwidth.slice():is(c.colspan);p[d]=n,l.setNodeMarkup(s+r,null,uo(c,"colwidth",p))}l.docChanged&&t.dispatch(l)}(t,r.activeHandle,ns(r.dragging,e,n)),t.dispatch(t.state.tr.setMeta(Jo,{setDragging:null})))}function a(e){if(!e.which)return s(e);let r=Jo.getState(t.state),i=ns(r.dragging,e,n);!function(t,e,n,r){let i=t.state.doc.resolve(e),o=i.node(-1),s=i.start(-1),a=no.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1,l=t.domAtPos(i.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;Ko(o,l.firstChild,l,r,a,n)}(t,r.activeHandle,i,n)}t.dispatch(t.state.tr.setMeta(Jo,{setDragging:{startX:e.clientX,startWidth:o}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),e.preventDefault()}(t,n,e)}},decorations(t){let e=Jo.getState(t);if(e.activeHandle>-1)return function(t,e){let n=[],r=t.doc.resolve(e),i=r.node(-1),o=no.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan;for(let t=0;t<o.height;t++){let e=a+t*o.width-1;if(!(a!=o.width&&o.map[e]==o.map[e+1]||0!=t&&o.map[e-1]==o.map[e-1-o.width])){let t=o.map[e],r=s+t+i.nodeAt(t).nodeSize-1,a=document.createElement("div");a.className="column-resize-handle",n.push(xt.p.widget(r,a))}}return xt.EH.create(t.doc,n)}(t,e.activeHandle)},nodeViews:{}}});return i}class ts{constructor(t,e){this.activeHandle=t,this.dragging=e}apply(t){let e=this,n=t.getMeta(Jo);if(n&&null!=n.setHandle)return new ts(n.setHandle,null);if(n&&void 0!==n.setDragging)return new ts(e.activeHandle,n.setDragging);if(e.activeHandle>-1&&t.docChanged){let n=t.mapping.map(e.activeHandle,-1);co(t.doc.resolve(n))||(n=null),e=new ts(n,e.dragging)}return e}}function es(t,e,n){let r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return-1;let{pos:i}=r,o=so(t.state.doc.resolve(i));if(!o)return-1;if("right"==n)return o.pos;let s=no.get(o.node(-1)),a=o.start(-1),l=s.map.indexOf(o.pos-a);return l%s.width==0?-1:a+s.map[l-1]}function ns(t,e,n){let r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function rs(t,e){t.dispatch(t.state.tr.setMeta(Jo,{setHandle:e}))}function is(t){let e=[];for(let n=0;n<t;n++)e.push(0);return e}function os({allowTableNodeSelection:t=!1}={}){return new wt.Sy({key:oo,state:{init:()=>null,apply(t,e){let n=t.getMeta(oo);if(null!=n)return-1==n?null:n;if(null==e||!t.docChanged)return e;let{deleted:r,pos:i}=t.mapping.mapResult(e);return r?null:i}},props:{decorations:yo,handleDOMEvents:{mousedown:Mo},createSelectionBetween(t){if(null!=oo.getState(t.state))return t.state.selection},handleTripleClick:Oo,handleKeyDown:ko,handlePaste:$o},appendTransaction:(e,n,r)=>function(t,e,n){let r,i,o=(e||t).selection,s=(e||t).doc;if(o instanceof wt.qv&&(i=o.node.type.spec.tableRole)){if("cell"==i||"header_cell"==i)r=go.create(s,o.from);else if("row"==i){let t=s.resolve(o.from+1);r=go.rowSelection(t,t)}else if(!n){let t=no.get(o.node),e=o.from+1,n=e+t.map[t.width*t.height-1];r=go.create(s,e+1,n)}}else o instanceof wt.Bs&&function({$from:t,$to:e}){if(t.pos==e.pos||t.pos<t.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let t=e.depth;t>=0&&!(e.before(t+1)>e.start(t));t--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}(o)?r=wt.Bs.create(s,o.from):o instanceof wt.Bs&&function({$from:t,$to:e}){let n,r;for(let e=t.depth;e>0;e--){let r=t.node(e);if("cell"===r.type.spec.tableRole||"header_cell"===r.type.spec.tableRole){n=r;break}}for(let t=e.depth;t>0;t--){let n=e.node(t);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){r=n;break}}return n!==r&&0===e.parentOffset}(o)&&(r=wt.Bs.create(s,o.$from.start(),o.$from.end()));return r&&(e||(e=t.tr)).setSelection(r),e}(r,Po(r,n),t)})}function ss(t,e){return e?t.createChecked(null,e):t.createAndFill()}function as(t,e,n,r,i){const o=function(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach((n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)})),t.cached.tableNodeTypes=e,e}(t),s=[],a=[];for(let t=0;t<n;t+=1){const t=ss(o.cell,i);if(t&&a.push(t),r){const t=ss(o.header_cell,i);t&&s.push(t)}}const l=[];for(let t=0;t<e;t+=1)l.push(o.row.createChecked(null,r&&0===t?s:a));return o.table.createChecked(null,l)}const ls=t=>{let{editor:e}=t;const{selection:n}=e.state;if(!(n instanceof go))return!1;let r=0;const i=(0,At.qv)(n.ranges[0].$from,(t=>"table"===t.type.name));i?.node.descendants((t=>{if("table"===t.type.name)return!1;["tableCell","tableHeader"].includes(t.type.name)&&(r+=1)}));return r===n.ranges.length&&(e.commands.deleteTable(),!0)};function cs(t,e,n,r,i,o){let s=0,a=!0,l=e.firstChild;const c=t.firstChild;for(let t=0,n=0;t<c.childCount;t+=1){const{colspan:d,colwidth:p}=c.child(t).attrs;for(let t=0;t<d;t+=1,n+=1){const c=i===n?o:p&&p[t],d=c?`${c}px`:"";s+=c||r,c||(a=!1),l?(l.style.width!==d&&(l.style.width=d),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=d}}for(;l;){const t=l.nextSibling;l.parentNode.removeChild(l),l=t}n.style.width="50%"}class ds{constructor(t,e){this.node=t,this.cellMinWidth=e,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")),cs(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type===this.node.type&&(this.node=t,cs(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return"attributes"===t.type&&(t.target===this.table||this.colgroup.contains(t.target))}}function ps(t,e,n,r,i,o){let s=0,a=!0,l=e.firstChild;const c=t.firstChild;for(let t=0,n=0;t<c.childCount;t+=1){const{colspan:d,colwidth:p}=c.child(t).attrs;for(let t=0;t<d;t+=1,n+=1){const c=i===n?o:p&&p[t],d=c?`${c}px`:"";s+=c||r,c||(a=!1),l?(l.style.width!==d&&(l.style.width=d),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=d}}for(;l;){const t=l.nextSibling;l.parentNode.removeChild(l),l=t}}class hs{constructor(t,e,n,r){const{width:i}=r;this.node=t,this.cellMinWidth=e,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=i,this.colgroup=this.table.appendChild(document.createElement("colgroup")),ps(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type===this.node.type&&(this.node=t,ps(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return"attributes"===t.type&&(t.target===this.table||this.colgroup.contains(t.target))}}let us,fs;if("undefined"!=typeof WeakMap){let t=new WeakMap;us=e=>t.get(e),fs=(e,n)=>(t.set(e,n),n)}else{let t=[],e=10,n=0;us=e=>{for(let n=0;n<t.length;n+=2)if(t[n]==e)return t[n+1]},fs=(r,i)=>(n==e&&(n=0),t[n++]=r,t[n++]=i)}class ms{constructor(t,e,n,r){this.left=t,this.top=e,this.right=n,this.bottom=r}}class gs{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){let n=this.map[e];if(n!=t)continue;let r=e%this.width,i=e/this.width|0,o=r+1,s=i+1;for(let t=1;o<this.width&&this.map[e+t]==n;t++)o++;for(let t=1;s<this.height&&this.map[e+this.width*t]==n;t++)s++;return new ms(r,i,o,s)}throw new RangeError("No cell with offset "+t+" found")}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError("No cell with offset "+t+" found")}nextCell(t,e,n){let{left:r,right:i,top:o,bottom:s}=this.findCell(t);return"horiz"==e?(n<0?0==r:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?0==o:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(t,e){let{left:n,right:r,top:i,bottom:o}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return new ms(Math.min(n,s),Math.min(i,l),Math.max(r,a),Math.max(o,c))}cellsInRect(t){let e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){let o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,i==t.left&&i&&this.map[o-1]==s||r==t.top&&r&&this.map[o-this.width]==s||e.push(s))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){let o=i+n.child(r).nodeSize;if(r==t){let n=e+t*this.width,r=(t+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?o-1:this.map[n]}i=o}}static get(t){return us(t)||fs(t,function(t){if("table"!=t.type.spec.tableRole)throw new RangeError("Not a table node: "+t.type.name);let e=function(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){let i=t.child(r),o=0;if(n)for(let e=0;e<r;e++){let n=t.child(e);for(let t=0;t<n.childCount;t++){let i=n.child(t);e+i.attrs.rowspan>r&&(o+=i.attrs.colspan)}}for(let t=0;t<i.childCount;t++){let e=i.child(t);o+=e.attrs.colspan,e.attrs.rowspan>1&&(n=!0)}-1==e?e=o:e!=o&&(e=Math.max(e,o))}return e}(t),n=t.childCount,r=[],i=0,o=null,s=[];for(let t=0,i=e*n;t<i;t++)r[t]=0;for(let a=0,l=0;a<n;a++){let c=t.child(a);l++;for(let t=0;;t++){for(;i<r.length&&0!=r[i];)i++;if(t==c.childCount)break;let d=c.child(t),{colspan:p,rowspan:h,colwidth:u}=d.attrs;for(let t=0;t<h;t++){if(t+a>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:l,n:h-t});break}let c=i+t*e;for(let t=0;t<p;t++){0==r[c+t]?r[c+t]=l:(o||(o=[])).push({type:"collision",row:a,pos:l,n:p-t});let n=u&&u[t];if(n){let r=(c+t)%e*2,i=s[r];null==i||i!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):i==n&&s[r+1]++}}}i+=p,l+=d.nodeSize}let d=(a+1)*e,p=0;for(;i<d;)0==r[i++]&&p++;p&&(o||(o=[])).push({type:"missing",row:a,n:p}),l++}let a=new gs(e,n,r,o),l=!1;for(let t=0;!l&&t<s.length;t+=2)null!=s[t]&&s[t+1]<n&&(l=!0);l&&function(t,e,n){t.problems||(t.problems=[]);for(let r=0,i={};r<t.map.length;r++){let o=t.map[r];if(i[o])continue;i[o]=!0;let s=n.nodeAt(o),a=null;for(let n=0;n<s.attrs.colspan;n++){let i=e[2*((r+n)%t.width)];null==i||s.attrs.colwidth&&s.attrs.colwidth[n]==i||((a||(a=bs(s.attrs)))[n]=i)}a&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:a})}}(a,s,t);return a}(t))}}function bs(t){if(t.colwidth)return t.colwidth.slice();let e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}new wt.H$("selectingCells");function ys(t){for(let e=t.depth-1;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}function As(t,e,n){let r={};for(let e in t)r[e]=t[e];return r[e]=n,r}const ws=new wt.H$("tableColumnSimple");function vs(){let{handleWidth:t=5,cellMinWidth:e=25,width:n="100%",View:r=hs,lastColumnResizable:i=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=new wt.Sy({key:ws,state:{init(t,i){return this.spec.props.nodeViews[function(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(let n in t.nodes){let r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}(i.schema).table.name]=(t,i)=>new r(t,e,i,{width:n}),new _s(-1,!1)},apply:(t,e)=>e.apply(t)},props:{attributes:t=>ws.getState(t).activeHandle>-1?{class:"resize-cursor"}:null,handleDOMEvents:{mousemove(e,n){!function(t,e,n,r,i){let o=ws.getState(t.state);if(!o.dragging){let r=function(t){for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.classList.contains("ProseMirror")?null:t.parentNode;return t}(e.target),s=-1;if(r){let{left:i,right:o}=r.getBoundingClientRect();e.clientX-i<=n?s=xs(t,e,"left"):o-e.clientX<=n&&(s=xs(t,e,"right"))}if(s!=o.activeHandle){if(!i&&-1!==s){let e=t.state.doc.resolve(s),n=e.node(-1),r=gs.get(n),i=e.start(-1);if(r.colCount(e.pos-i)+e.nodeAfter.attrs.colspan-1==r.width-1)return}Cs(t,s)}}}(e,n,t,0,i)},mouseleave(t){!function(t){let e=ws.getState(t.state);e.activeHandle>-1&&!e.dragging&&Cs(t,-1)}(t)},mousedown(t,n){!function(t,e,n){let r=ws.getState(t.state);if(-1==r.activeHandle||r.dragging)return!1;let i=t.state.doc.nodeAt(r.activeHandle),o=function(t,e,n){let{colspan:r,colwidth:i}=n,o=i&&i[i.length-1];if(o)return o;let s=t.domAtPos(e),a=s.node.childNodes[s.offset].offsetWidth,l=r;if(i)for(let t=0;t<r;t++)i[t]&&(a-=i[t],l--);return a/l}(t,r.activeHandle,i.attrs);function s(e){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);let r=ws.getState(t.state);r.dragging&&(!function(t,e,n){let r=t.state.doc.resolve(e),i=r.node(-1),o=gs.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let t=0;t<o.height;t++){let e=t*o.width+a;if(t&&o.map[e]==o.map[e-o.width])continue;let r=o.map[e],{attrs:c}=i.nodeAt(r),d=1==c.colspan?0:a-o.colCount(r);if(c.colwidth&&c.colwidth[d]==n)continue;let p=c.colwidth?c.colwidth.slice():Es(c.colspan);p[d]=n,l.setNodeMarkup(s+r,null,As(c,"colwidth",p))}l.docChanged&&t.dispatch(l)}(t,r.activeHandle,ks(r.dragging,e,n)),t.dispatch(t.state.tr.setMeta(ws,{setDragging:null})))}function a(e){if(!e.which)return s(e);let r=ws.getState(t.state),i=ks(r.dragging,e,n);!function(t,e,n,r){let i=t.state.doc.resolve(e),o=i.node(-1),s=i.start(-1),a=gs.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1,l=t.domAtPos(i.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;ps(o,l.firstChild,0,r,a,n)}(t,r.activeHandle,i,n)}t.dispatch(t.state.tr.setMeta(ws,{setDragging:{startX:e.clientX,startWidth:o}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),e.preventDefault()}(t,n,e)}},decorations(t){let e=ws.getState(t);if(e.activeHandle>-1)return function(t,e){let n=[],r=t.doc.resolve(e),i=r.node(-1),o=gs.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan;for(let t=0;t<o.height;t++){let e=a+t*o.width-1;if(!(a!=o.width&&o.map[e]==o.map[e+1]||0!=t&&o.map[e-1]==o.map[e-1-o.width])){let t=o.map[e],r=s+t+i.nodeAt(t).nodeSize-1,a=document.createElement("div");a.className="column-resize-handle",n.push(xt.p.widget(r,a))}}return xt.EH.create(t.doc,n)}(t,e.activeHandle)},nodeViews:{}}});return o}class _s{constructor(t,e){this.activeHandle=t,this.dragging=e}apply(t){let e=this,n=t.getMeta(ws);if(n&&null!=n.setHandle)return new _s(n.setHandle,null);if(n&&void 0!==n.setDragging)return new _s(e.activeHandle,n.setDragging);if(e.activeHandle>-1&&t.docChanged){let n=t.mapping.map(e.activeHandle,-1);"row"==(r=t.doc.resolve(n)).parent.type.spec.tableRole&&r.nodeAfter||(n=null),e=new _s(n,e.dragging)}var r;return e}}function xs(t,e,n){let r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return-1;let{pos:i}=r,o=ys(t.state.doc.resolve(i));if(!o)return-1;if("right"==n)return o.pos;let s=gs.get(o.node(-1)),a=o.start(-1),l=s.map.indexOf(o.pos-a);return l%s.width==0?-1:a+s.map[l-1]}function ks(t,e,n){let r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function Cs(t,e){t.dispatch(t.state.tr.setMeta(ws,{setHandle:e}))}function Es(t){let e=[];for(let n=0;n<t;n++)e.push(0);return e}const Ss=At.NB.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,color:"red",width:"100%",View:hs,ReiszeView:ds,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML(t){let{HTMLAttributes:e}=t;return["table",(0,At.P1)(this.options.HTMLAttributes,e),["tbody",0]]},addCommands:()=>({insertTable:function(){let{rows:t=3,cols:e=3,withHeaderRow:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r=>{let{tr:i,dispatch:o,editor:s}=r;const a=as(s.schema,t,e,n);if(o){const t=i.selection.anchor+1;i.replaceSelectionWith(a).scrollIntoView().setSelection(wt.Bs.near(i.doc.resolve(t)))}return!0}},addColumnBefore:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){if(!ao(t))return!1;if(e){let n=Do(t);e(zo(t.tr,n,n.left))}return!0}(e,n)},addColumnAfter:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){if(!ao(t))return!1;if(e){let n=Do(t);e(zo(t.tr,n,n.right))}return!0}(e,n)},deleteColumn:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){if(!ao(t))return!1;if(e){let n=Do(t),r=t.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let t=n.right-1;Ho(r,n,t),t!=n.left;t--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=no.get(n.table);e(r)}return!0}(e,n)},addRowBefore:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){if(!ao(t))return!1;if(e){let n=Do(t);e(Uo(t.tr,n,n.top))}return!0}(e,n)},addRowAfter:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){if(!ao(t))return!1;if(e){let n=Do(t);e(Uo(t.tr,n,n.bottom))}return!0}(e,n)},deleteRow:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){if(!ao(t))return!1;if(e){let n=Do(t),r=t.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let t=n.bottom-1;jo(r,n,t),t!=n.top;t--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=no.get(n.table);e(r)}return!0}(e,n)},deleteTable:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){let n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}(e,n)},mergeCells:()=>t=>{let{state:e,dispatch:n}=t;return Fo(e,n)},splitCell:()=>t=>{let{state:e,dispatch:n}=t;return Vo(e,n)},toggleHeaderColumn:()=>t=>{let{state:e,dispatch:n}=t;return Wo("column")(e,n)},toggleHeaderRow:()=>t=>{let{state:e,dispatch:n}=t;return Wo("row")(e,n)},toggleHeaderCell:()=>t=>{let{state:e,dispatch:n}=t;return qo(e,n)},mergeOrSplit:()=>t=>{let{state:e,dispatch:n}=t;return!!Fo(e,n)||Vo(e,n)},setCellAttribute:(t,e)=>n=>{let{state:r,dispatch:i}=n;return function(t,e){return function(n,r){if(!ao(n))return!1;let i=lo(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){let o=n.tr;n.selection instanceof go?n.selection.forEachCell(((n,r)=>{n.attrs[t]!==e&&o.setNodeMarkup(r,null,uo(n.attrs,t,e))})):o.setNodeMarkup(i.pos,null,uo(i.nodeAfter.attrs,t,e)),r(o)}return!0}}(t,e)(r,i)},goToNextCell:()=>t=>{let{state:e,dispatch:n}=t;return Xo(1)(e,n)},goToPreviousCell:()=>t=>{let{state:e,dispatch:n}=t;return Xo(-1)(e,n)},fixTables:()=>t=>{let{state:e,dispatch:n}=t;return n&&Po(e),!0},setCellSelection:t=>e=>{let{tr:n,dispatch:r}=e;if(r){const e=go.create(n.doc,t.anchorCell,t.headCell);n.setSelection(e)}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:ls,"Mod-Backspace":ls,Delete:ls,"Mod-Delete":ls}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Qo({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.ReiszeView,lastColumnResizable:this.options.lastColumnResizable})]:[vs({View:this.options.View,width:this.options.width})],os({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:(0,At.nU)((0,At.Nl)(t,"tableRole",e))}}}),Bs=Ss,Os=At.NB.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:t=>t.width},height:{default:"auto",parseHTML:t=>t.height},background:{default:"#000",parseHTML:t=>t.getAttribute("background")}}),parseHTML:()=>[{tag:"button",priority:51}],renderHTML(t){let{HTMLAttributes:e}=t;return["button",(0,At.P1)(e),0]},addCommands(){return{toggleButton:()=>t=>{let{commands:e,editor:n}=t;return e.insertContent({type:this.name,attrs:this.options}),!0},setButtonStyles:t=>e=>{const{commands:n,editor:r}=e,i=(0,At.P1)({background:this.options.background,width:this.options.width,height:this.options.height},t);return i.style=`\n background: ${i.background};\n width: ${i.width};\n height: ${i.height};`,n.updateAttributes(this.name,i),!0}}},addNodeView:()=>()=>{const t=document.createElement("button");t.contentEditable=!1,t.classList.add("node-view");const e=document.createElement("div");return e.innerHTML="button",e.contentEditable=!0,e.classList.add("content"),t.append(e),{dom:t,contentDOM:e}}}),$s=At.NB.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:t}){return["tr",(0,At.P1)(this.options.HTMLAttributes,t),0]}});const Ms=At.NB.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({borderColor:{default:"#ced4da"},colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML(t){let{HTMLAttributes:e}=t;const n=`border-color:${e.borderColor}`;return e.style=n,["td",(0,At.P1)(this.options.HTMLAttributes,e),0]}}),Is=At.NB.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map((t=>parseInt(t,10))):null}}}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:t}){return["th",(0,At.P1)(this.options.HTMLAttributes,t),0]}}),Ts=At.hj.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>t.style.backgroundColor.replace(/['"]+/g,""),renderHTML:t=>t.backgroundColor?{style:`background: ${t.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:t=>e=>{let{chain:n}=e;return n().setMark("textStyle",{backgroundColor:t}).run()},unsetBackgroundColor:()=>t=>{let{chain:e}=t;return e().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}})}),Ls=At.hj.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:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>({style:`text-align: ${t.textAlign}`})}}}]},addCommands(){return{setTextAlign:t=>e=>{let{commands:n}=e;return!!this.options.alignments.includes(t)&&this.options.types.every((e=>n.updateAttributes(e,{textAlign:t})))},unsetTextAlign:()=>t=>{let{commands:e}=t;return this.options.types.every((t=>e.resetAttributes(t,"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 Ns=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),Rs=["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"],Ps=["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"],Ds=["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"],zs=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Hs=["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 Us="[0-9](_*[0-9])*",js=`\\.(${Us})`,Zs="[0-9a-fA-F](_*[0-9a-fA-F])*",Fs={className:"number",variants:[{begin:`(\\b(${Us})((${js})|\\.)?|(${js}))[eE][+-]?(${Us})[fFdD]?\\b`},{begin:`\\b(${Us})((${js})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${js})[fFdD]?\\b`},{begin:`\\b(${Us})[fFdD]\\b`},{begin:`\\b0[xX]((${Zs})\\.?|(${Zs})?\\.(${Zs}))[pP][+-]?(${Us})[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};function Vs(t,e,n){return-1===n?"":t.replace(e,(r=>Vs(t,e,n-1)))}const Ys="[A-Za-z$_][0-9A-Za-z$_]*",Ws=["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"],qs=["true","false","null","undefined","NaN","Infinity"],Xs=["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"],Gs=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ks=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Js=["arguments","this","super","console","window","document","localStorage","module","global"],Qs=[].concat(Ks,Xs,Gs);var ta="[0-9](_*[0-9])*",ea=`\\.(${ta})`,na="[0-9a-fA-F](_*[0-9a-fA-F])*",ra={className:"number",variants:[{begin:`(\\b(${ta})((${ea})|\\.)?|(${ea}))[eE][+-]?(${ta})[fFdD]?\\b`},{begin:`\\b(${ta})((${ea})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ea})[fFdD]?\\b`},{begin:`\\b(${ta})[fFdD]\\b`},{begin:`\\b0[xX]((${na})\\.?|(${na})?\\.(${na}))[pP][+-]?(${ta})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${na})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};const ia=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),oa=["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"],sa=["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"],aa=["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"],la=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ca=["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(),da=aa.concat(la);const pa=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),ha=["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"],ua=["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"],fa=["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"],ma=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ga=["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 ba(t){return t?"string"==typeof t?t:t.source:null}function ya(t){return Aa("(?=",t,")")}function Aa(...t){return t.map((t=>ba(t))).join("")}function wa(...t){const e=function(t){const e=t[t.length-1];return"object"==typeof e&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}(t);return"("+(e.capture?"":"?:")+t.map((t=>ba(t))).join("|")+")"}const va=t=>Aa(/\b/,t,/\w$/.test(t)?/\b/:/\B/),_a=["Protocol","Type"].map(va),xa=["init","self"].map(va),ka=["Any","Self"],Ca=["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"],Ea=["false","nil","true"],Sa=["assignment","associativity","higherThan","left","lowerThan","none","right"],Ba=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],Oa=["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"],$a=wa(/[/=\-+!*%<>&|^~?]/,/[\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]/),Ma=wa($a,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Ia=Aa($a,Ma,"*"),Ta=wa(/[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]/),La=wa(Ta,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Na=Aa(Ta,La,"*"),Ra=Aa(/[A-Z]/,La,"*"),Pa=["autoclosure",Aa(/convention\(/,wa("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Aa(/objc\(/,Na,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],Da=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];const za="[A-Za-z$_][0-9A-Za-z$_]*",Ha=["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"],Ua=["true","false","null","undefined","NaN","Infinity"],ja=["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"],Za=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Fa=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Va=["arguments","this","super","console","window","document","localStorage","module","global"],Ya=[].concat(Fa,ja,Za);const Wa=n(2947);var qa=n(149);const Xa=Object.assign(Ga(Error),{eval:Ga(EvalError),range:Ga(RangeError),reference:Ga(ReferenceError),syntax:Ga(SyntaxError),type:Ga(TypeError),uri:Ga(URIError)});function Ga(t){return e.displayName=t.displayName||t.name,e;function e(e,...n){const r=e?qa(e,...n):e;return new t(r)}}const Ka={}.hasOwnProperty,Ja="hljs-";function Qa(t,e,n={}){let r=n.prefix;if("string"!=typeof t)throw Xa("Expected `string` for name, got `%s`",t);if(!Wa.getLanguage(t))throw Xa("Unknown language: `%s` is not registered",t);if("string"!=typeof e)throw Xa("Expected `string` for value, got `%s`",e);null==r&&(r=Ja),Wa.configure({__emitter:tl,classPrefix:r});const i=Wa.highlight(e,{language:t,ignoreIllegals:!0});if(Wa.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}class tl{constructor(t){this.options=t,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(t){if(""===t)return;const e=this.stack[this.stack.length-1],n=e.children[e.children.length-1];n&&"text"===n.type?n.value+=t:e.children.push({type:"text",value:t})}addKeyword(t,e){this.openNode(e),this.addText(t),this.closeNode()}addSublanguage(t,e){const n=this.stack[this.stack.length-1],r=t.root.children;e?n.children.push({type:"element",tagName:"span",properties:{className:[e]},children:r}):n.children.push(...r)}openNode(t){const e={type:"element",tagName:"span",properties:{className:t.split(".").map(((t,e)=>e?t+"_".repeat(e):this.options.classPrefix+t))},children:[]};this.stack[this.stack.length-1].children.push(e),this.stack.push(e)}closeNode(){this.stack.pop()}closeAllNodes(){}finalize(){}toHTML(){return""}}const el={highlight:Qa,highlightAuto:function(t,e={}){const n=e.subset||Wa.listLanguages();let r=e.prefix,i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if(null==r&&(r=Ja),"string"!=typeof t)throw Xa("Expected `string` for value, got `%s`",t);for(;++i<n.length;){const r=n[i];if(!Wa.getLanguage(r))continue;const s=Qa(r,t,e);s.data.relevance>o.data.relevance&&(o=s)}return o},registerLanguage:function(t,e){Wa.registerLanguage(t,e)},registered:function(t){return Boolean(Wa.getLanguage(t))},listLanguages:function(){return Wa.listLanguages()},registerAlias:function(t,e){if("string"==typeof t)Wa.registerAliases(e,{languageName:t});else{let e;for(e in t)Ka.call(t,e)&&Wa.registerAliases(t[e],{languageName:e})}}};el.registerLanguage("arduino",(function(t){const e={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(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.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:"."},t.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},t.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",h={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"]},u={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:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},f=[u,c,s,n,t.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:f.concat([{begin:/\(/,end:/\)/,keywords:h,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:h,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:h,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,t.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:h,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,u,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:h,contains:["self",s]},{begin:t.IDENT_RE+"::",keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n})),el.registerLanguage("bash",(function(t){const e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);const a={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},l=t.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:[t.inherit(t.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","in","do","done","case","esac","function"],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,t.SHEBANG(),c,a,t.HASH_COMMENT_MODE,o,{match:/(\/[a-z._-]+)+/},s,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},n]}})),el.registerLanguage("c",(function(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.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:[t.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:"."},t.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},t.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",h={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"},u=[c,s,n,t.C_BLOCK_COMMENT_MODE,l,a],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:u.concat([{begin:/\(/,end:/\)/,keywords:h,contains:u.concat(["self"]),relevance:0}]),relevance:0},m={begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:h,relevance:0},{begin:p,returnBegin:!0,contains:[t.inherit(d,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,t.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:h,disableAutodetect:!0,illegal:"</",contains:[].concat(f,m,u,[c,{begin:t.IDENT_RE+"::",keywords:h},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:c,strings:a,keywords:h}}})),el.registerLanguage("cpp",(function(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.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:"."},t.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},t.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",h={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"]},u={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:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},f=[u,c,s,n,t.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:f.concat([{begin:/\(/,end:/\)/,keywords:h,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:h,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:h,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,t.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:h,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,u,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:h,contains:["self",s]},{begin:t.IDENT_RE+"::",keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}})),el.registerLanguage("csharp",(function(t){const e={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=t.inherit(t.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},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},o=t.inherit(i,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/,keywords:e},a=t.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,a]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},d=t.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]});s.contains=[c,l,i,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,r,t.C_BLOCK_COMMENT_MODE],a.contains=[d,l,o,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,r,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const p={variants:[c,l,i,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},h={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},u=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",f={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:e,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.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,h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,h,t.C_LINE_COMMENT_MODE,t.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:"("+u+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:e,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:e,relevance:0,contains:[p,r,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},f]}})),el.registerLanguage("css",(function(t){const e=t.regex,n=Ns(t),r=[t.APOS_STRING_MODE,t.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:":("+Ds.join("|")+")"},{begin:":(:)?("+zs.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Hs.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:e.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:Ps.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...r,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Rs.join("|")+")\\b"}]}})),el.registerLanguage("diff",(function(t){const e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}})),el.registerLanguage("go",(function(t){const e={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:e,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:t.C_NUMBER_RE+"[i]",relevance:1},t.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,illegal:/["']/}]}]}})),el.registerLanguage("graphql",(function(t){const e=t.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:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.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:e.concat(/[_A-Za-z][_0-9A-Za-z]*/,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}})),el.registerLanguage("ini",(function(t){const e=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},r=t.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,o,i,s,n,"self"],relevance:0},l=e.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:e.concat(l,"(\\s*\\.\\s*",l,")*",e.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[r,a,o,i,s,n]}}]}})),el.registerLanguage("java",(function(t){const e=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Vs("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),i={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"]},o={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.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:[e.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,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[o,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Fs,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Fs,o]}})),el.registerLanguage("javascript",(function(t){const e=t.regex,n=Ys,r="<>",i="</>",o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(t,e)=>{const n=t[0].length+t.index,r=t.input[n];if("<"===r||","===r)return void e.ignoreMatch();let i;">"===r&&(((t,{after:e})=>{const n="</"+t[0].slice(1);return-1!==t.input.indexOf(n,e)})(t,{after:n})||e.ignoreMatch());const o=t.input.substring(n);((i=o.match(/^\s*=/))||(i=o.match(/^\s+extends\s+/))&&0===i.index)&&e.ignoreMatch()}},s={$pattern:Ys,keyword:Ws,literal:qs,built_in:Qs,"variable.language":Js},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:[]},h={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},u={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},f={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},m={className:"comment",variants:[t.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}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},g=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,u,f,{match:/\$\d+/},d];p.contains=g.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(g)});const b=[].concat(m,p.contains),y=b.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(b)}]),A={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y},w={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},v={relevance:0,match:e.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:{_:[...Xs,...Gs]}},_={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[A],illegal:/%/},x={match:e.concat(/\b/,function(t){return e.concat("(?!",t.join("|"),")")}([...Ks,"super","import"]),n,e.lookahead(/\(/)),className:"title.function",relevance:0},k={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[A]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:v},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,u,f,m,{match:/\$\d+/},d,v,{className:"attr",begin:n+e.lookahead(":"),relevance:0},S,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,t.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},x,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,C,{match:/\$[(.]/}]}})),el.registerLanguage("json",(function(t){const e=["true","false","null"],n={scope:"literal",beginKeywords:e.join(" ")};return{name:"JSON",keywords:{literal:e},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},t.QUOTE_STRING_MODE,n,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),el.registerLanguage("kotlin",(function(t){const e={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:t.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,r]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,i,r]}]};r.contains.push(o);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},a={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(o,{className:"string"}),"self"]}]},l=ra,c=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:t.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:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.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:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,t.C_LINE_COMMENT_MODE,c],relevance:0},t.C_LINE_COMMENT_MODE,c,s,a,o,t.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.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]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}})),el.registerLanguage("less",(function(t){const e=ia(t),n=da,r="[\\w-]+",i="("+r+"|@\\{"+r+"\\})",o=[],s=[],a=function(t){return{className:"string",begin:"~?"+t+".*?"+t}},l=function(t,e,n){return{className:t,begin:e,relevance:n}},c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:sa.join(" ")},d={begin:"\\(",end:"\\)",contains:s,keywords:c,relevance:0};s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,a("'"),a('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,d,l("variable","@@?"+r,10),l("variable","@\\{"+r+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const p=s.concat({begin:/\{/,end:/\}/,contains:o}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},u={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ca.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:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,h,l("keyword","all\\b"),l("variable","@\\{"+r+"\\}"),{begin:"\\b("+oa.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,l("selector-tag",i,0),l("selector-id","#"+i),l("selector-class","\\."+i,0),l("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+aa.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+la.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:p},{begin:"!important"},e.FUNCTION_DISPATCH]},b={begin:r+":(:)?"+`(${n.join("|")})`,returnBegin:!0,contains:[g]};return o.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,f,m,b,u,g,h,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:o}})),el.registerLanguage("lua",(function(t){const e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:t.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:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}})),el.registerLanguage("makefile",(function(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},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:[e]},i={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};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:[t.HASH_COMMENT_MODE,e,n,r,i,{className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o]}})),el.registerLanguage("markdown",(function(t){const e={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.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}/}]},i={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},o=t.inherit(r,{contains:[]}),s=t.inherit(i,{contains:[]});r.contains.push(s),i.contains.push(o);let a=[e,n];return[r,i,o,s].forEach((t=>{t.contains=t.contains.concat(a)})),a=a.concat(r,i),{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}]}]},e,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},r,i,{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}]}]}})),el.registerLanguage("objectivec",(function(t){const e=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:e,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:e,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+"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.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},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}})),el.registerLanguage("perl",(function(t){const e=t.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(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},o={begin:/->\{/,end:/\}/},s={variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},a=[t.BACKSLASH_ESCAPE,i,s],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(t,r,i="\\1")=>{const o="\\1"===i?i:e.concat(i,r);return e.concat(e.concat("(?:",t,")"),r,/(?:\\.|[^\\\/])*?/,o,/(?:\\.|[^\\\/])*?/,i,n)},d=(t,r,i)=>e.concat(e.concat("(?:",t,")"),r,/(?:\\.|[^\\\/])*?/,i,n),p=[s,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{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:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.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:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:c("s|tr|y",e.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",e.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:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=p,o.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:p}})),el.registerLanguage("php",(function(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},a=t.inherit(t.APOS_STRING_MODE,{illegal:null}),l="[ \t\n]",c={scope:"string",variants:[t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(s)}),a,t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(s)})]},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"],h=["__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"],u=["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:h,literal:(t=>{const e=[];return t.forEach((t=>{e.push(t),t.toLowerCase()===t?e.push(t.toUpperCase()):e.push(t.toLowerCase())})),e})(p),built_in:u},m=t=>t.map((t=>t.replace(/\|\d+$/,""))),g={variants:[{match:[/new/,e.concat(l,"+"),e.concat("(?!",m(u).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},b=e.concat(r,"\\b(?!\\()"),y={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),b],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),b],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},A={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},w={relevance:0,begin:/\(/,end:/\)/,keywords:f,contains:[A,o,y,t.C_BLOCK_COMMENT_MODE,c,d,g]},v={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",m(h).join("\\b|"),"|",m(u).join("\\b|"),"\\b)"),r,e.concat(l,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(v);const _=[A,y,t.C_BLOCK_COMMENT_MODE,c,d,g];return{case_insensitive:!1,keywords:f,contains:[{begin:e.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:p,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:p,keyword:["new","array"]},contains:["self",..._]},..._,{scope:"meta",match:i}]},t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.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/},o,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"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",o,y,t.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"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},c,d]}})),el.registerLanguage("php-template",(function(t){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},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}})),el.registerLanguage("plaintext",(function(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}})),el.registerLanguage("python",(function(t){const e=t.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"],i={$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"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,o,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,o,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:[t.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,a,s]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",d=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,p=`\\b|${r.join("|")}`,h={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})`}]},u={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:i,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:i,contains:["self",o,h,l,t.HASH_COMMENT_MODE]}]};return s.contains=[l,h,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i,illegal:/(<\/|->|\?)|=>/,contains:[o,h,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},l,u,t.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:[h,f,l]}]}})),el.registerLanguage("python-repl",(function(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}})),el.registerLanguage("r",(function(t){const e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.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]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=e.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:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.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]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}})),el.registerLanguage("ruby",(function(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),o={"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=[t.COMMENT("#","$",{contains:[s]}),t.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},d={className:"string",contains:[t.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:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,c]})]}]},p="[0-9](_?[0-9])*",h={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"}]},u={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},f=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.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:[u]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.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,u.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:o,contains:f}}];return l.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(m).concat(l).concat(f)}})),el.registerLanguage("rust",(function(t){const e=t.regex,n={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let\b)/,t.IDENT_RE,e.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["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!"],o=["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:t.IDENT_RE+"!?",type:o,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:i},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.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+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,t.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:i,type:o}},{className:"punctuation",begin:"->"},n]}})),el.registerLanguage("scss",(function(t){const e=pa(t),n=ma,r=fa,i="@[a-z-]+",o={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+ha.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ga.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:[e.BLOCK_COMMENT,o,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:ua.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}})),el.registerLanguage("shell",(function(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}})),el.registerLanguage("sql",(function(t){const e=t.regex,n=t.COMMENT("--","$"),r=["true","false","unknown"],i=["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"],o=["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=o,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((t=>!o.includes(t))),c={begin:e.concat(/\b/,e.either(...a),/\s*\(/),relevance:0,keywords:{built_in:a}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(t,{exceptions:e,when:n}={}){const r=n;return e=e||[],t.map((t=>t.match(/\|\d+$/)||e.includes(t)?t:r(t)?`${t}|0`:t))}(l,{when:t=>t.length<3}),literal:r,type:i,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:e.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:l.concat(s),literal:r,type:i}},{className:"type",begin:e.either("double precision","large object","with timezone","without timezone")},c,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}})),el.registerLanguage("swift",(function(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,wa(..._a,...xa)],className:{2:"keyword"}},o={match:Aa(/\./,wa(...Ca)),relevance:0},s=Ca.filter((t=>"string"==typeof t)).concat(["_|0"]),a={variants:[{className:"keyword",match:wa(...Ca.filter((t=>"string"!=typeof t)).concat(ka).map(va),...xa)}]},l={$pattern:wa(/\b\w+/,/#\w+/),keyword:s.concat(Ba),literal:Ea},c=[i,o,a],d=[{match:Aa(/\./,wa(...Oa)),relevance:0},{className:"built_in",match:Aa(/\b/,wa(...Oa),/(?=\()/)}],p={match:/->/,relevance:0},h=[p,{className:"operator",relevance:0,variants:[{match:Ia},{match:`\\.(\\.|${Ma})+`}]}],u="([0-9]_*)+",f="([0-9a-fA-F]_*)+",m={className:"number",relevance:0,variants:[{match:`\\b(${u})(\\.(${u}))?([eE][+-]?(${u}))?\\b`},{match:`\\b0x(${f})(\\.(${f}))?([pP][+-]?(${u}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(t="")=>({className:"subst",variants:[{match:Aa(/\\/,t,/[0\\tnr"']/)},{match:Aa(/\\/,t,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(t="")=>({className:"subst",match:Aa(/\\/,t,/[\t ]*(?:[\r\n]|\r\n)/)}),y=(t="")=>({className:"subst",label:"interpol",begin:Aa(/\\/,t,/\(/),end:/\)/}),A=(t="")=>({begin:Aa(t,/"""/),end:Aa(/"""/,t),contains:[g(t),b(t),y(t)]}),w=(t="")=>({begin:Aa(t,/"/),end:Aa(/"/,t),contains:[g(t),y(t)]}),v={className:"string",variants:[A(),A("#"),A("##"),A("###"),w(),w("#"),w("##"),w("###")]},_={match:Aa(/`/,Na,/`/)},x=[_,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${La}+`}],k=[{match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Da,contains:[...h,m,v]}]}},{className:"keyword",match:Aa(/@/,wa(...Pa))},{className:"meta",match:Aa(/@/,Na)}],C={match:ya(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Aa(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,La,"+")},{className:"type",match:Ra,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Aa(/\s+&\s+/,ya(Ra)),relevance:0}]},E={begin:/</,end:/>/,keywords:l,contains:[...r,...c,...k,p,C]};C.contains.push(E);const S={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:Aa(Na,/\s*:/),keywords:"_|0",relevance:0},...r,...c,...d,...h,m,v,...x,...k,C]},B={begin:/</,end:/>/,contains:[...r,C]},O={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:wa(ya(Aa(Na,/\s*:/)),ya(Aa(Na,/\s+/,Na,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Na}]},...r,...c,...h,m,v,...k,C,S],endsParent:!0,illegal:/["']/},$={match:[/func/,/\s+/,wa(_.match,Na,Ia)],className:{1:"keyword",3:"title.function"},contains:[B,O,e],illegal:[/\[/,/%/]},M={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[B,O,e],illegal:/\[|%/},I={match:[/operator/,/\s+/,Ia],className:{1:"keyword",3:"title"}},T={begin:[/precedencegroup/,/\s+/,Ra],className:{1:"keyword",3:"title"},contains:[C],keywords:[...Sa,...Ea],end:/}/};for(const t of v.variants){const e=t.contains.find((t=>"interpol"===t.label));e.keywords=l;const n=[...c,...d,...h,m,v,...x];e.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...r,$,M,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:l,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},I,T,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...c,...d,...h,m,v,...x,...k,C,S]}})),el.registerLanguage("typescript",(function(t){const e=function(t){const e=t.regex,n=za,r="<>",i="</>",o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(t,e)=>{const n=t[0].length+t.index,r=t.input[n];if("<"===r||","===r)return void e.ignoreMatch();let i;">"===r&&(((t,{after:e})=>{const n="</"+t[0].slice(1);return-1!==t.input.indexOf(n,e)})(t,{after:n})||e.ignoreMatch());const o=t.input.substring(n);((i=o.match(/^\s*=/))||(i=o.match(/^\s+extends\s+/))&&0===i.index)&&e.ignoreMatch()}},s={$pattern:za,keyword:Ha,literal:Ua,built_in:Ya,"variable.language":Va},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:[]},h={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},u={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},f={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},m={className:"comment",variants:[t.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}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},g=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,u,f,{match:/\$\d+/},d];p.contains=g.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(g)});const b=[].concat(m,p.contains),y=b.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(b)}]),A={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y},w={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},v={relevance:0,match:e.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:{_:[...ja,...Za]}},_={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[A],illegal:/%/},x={match:e.concat(/\b/,function(t){return e.concat("(?!",t.join("|"),")")}([...Fa,"super","import"]),n,e.lookahead(/\(/)),className:"title.function",relevance:0},k={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[A]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:v},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,u,f,m,{match:/\$\d+/},d,v,{className:"attr",begin:n+e.lookahead(":"),relevance:0},S,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,t.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},x,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,C,{match:/\$[(.]/}]}}(t),n=za,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},s={$pattern:za,keyword:Ha.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:Ua,built_in:Ya.concat(r),"variable.language":Va},a={className:"meta",begin:"@"+n},l=(t,e,n)=>{const r=t.contains.findIndex((t=>t.label===e));if(-1===r)throw new Error("can not find mode to replace");t.contains.splice(r,1,n)};return Object.assign(e.keywords,s),e.exports.PARAMS_CONTAINS.push(a),e.contains=e.contains.concat([a,i,o]),l(e,"shebang",t.SHEBANG()),l(e,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),e.contains.find((t=>"func.def"===t.label)).relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx"]}),e})),el.registerLanguage("vbnet",(function(t){const e=t.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,s={className:"literal",variants:[{begin:e.concat(/# */,e.either(r,n),/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,i,/ *#/)},{begin:e.concat(/# */,e.either(r,n),/ +/,e.either(i,o),/ *#/)}]},a=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=t.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]}]}})),el.registerLanguage("wasm",(function(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);return e.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:[t.COMMENT(/;;/,/$/),e,{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"}},t.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/}]}})),el.registerLanguage("xml",(function(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=t.inherit(i,{begin:/\(/,end:/\)/}),s=t.inherit(t.APOS_STRING_MODE,{className:"string"}),a=t.inherit(t.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:[i,a,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,o,a,s]}]}]},t.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:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),el.registerLanguage("yaml",(function(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=t.inherit(r,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),o={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:e,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:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},o,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},a,l,r],d=[...c];return d.pop(),d.push(i),s.contains=d,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:c}}));const nl=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,rl=At.NB.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,F.Z)()}`},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(t){let{HTMLAttributes:e}=t;return["img",(0,At.P1)(this.options.HTMLAttributes,e)]},addNodeView(){return t=>{let{node:e,editor:n,getPos:r}=t;const i=document.createElement("img"),o=(0,At.P1)(this.options.HTMLAttributes,e.attrs);return Object.entries(o).forEach((t=>{let[e,n]=t;null!=n&&("style"===e&&"object"==typeof n?Object.assign(i.style,n):"style"===e&&"string"==typeof n?i.setAttribute("style",n):i.setAttribute(e,n))})),i.addEventListener("dblclick",(t=>{t.preventDefault(),t.stopPropagation();let e=null;"function"==typeof r&&(e=r());const i=document.createElement("cdtr-gallery");i.opened=!0,i.multi=!0,document.body.append(i),i.addEventListener("file",(t=>{let r=t.detail;if(Array.isArray(r)&&(r=r[0]),null!==e)try{const{view:t}=n,{state:i}=t;if(e<0||e>=i.doc.content.size)return void console.warn("Image position is out of bounds");try{const o=wt.qv.create(i.doc,e),s=i.tr.setSelection(o);t.dispatch(s),n.commands.updateImage({src:r.src})}catch(n){const o=i.doc.resolve(e),s=o.nodeAfter||o.nodeBefore;if(s&&"image"===s.type.name){const n={...s.attrs,src:r.src},o=s.type.create(n),a=e,l=e+s.nodeSize,c=i.tr.replaceWith(a,l,o);t.dispatch(c)}else console.warn("Could not find image node at position:",e)}}catch(t){console.warn("Failed to update image:",t)}i.opened=!1,setTimeout((()=>{i.remove()}),1500)})),i.addEventListener("close",(()=>{i.remove()}))})),{dom:i}}},addCommands(){return{setImage:t=>e=>{let{commands:n}=e;return n.insertContent({type:this.name,attrs:t}),!0},updateImage:t=>e=>{let{dispatch:n,commands:r,editor:i,view:o,tr:s}=e;const{state:a}=o,l=wt.qv.create(a.doc,o.state.selection.from),c={...l.node.attrs,...t},d=this.type.create(c);if(n){const t=(s||a.tr).replaceRangeWith(l.from,l.to,d);o.dispatch(t)}return!0}}},addInputRules(){return[(0,At.x2)({find:nl,type:this.type,getAttributes:t=>{const[,,e,n,r,i,o,s]=t;return{src:n,alt:e,title:r,width:i,height:o,id:s}}})]}}),il=At.NB.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML(t){let{HTMLAttributes:e}=t;return["li",(0,At.P1)(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)}}}),ol=At.vc.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML(t){let{HTMLAttributes:e}=t;return["span",(0,At.P1)(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>t=>{let{state:e,commands:n}=t;const r=(0,At.Jo)(e,this.type);return!!Object.entries(r).some((t=>{let[,e]=t;return!!e}))||n.unsetMark(this.name)}}}}),sl=/^\s*([-+*])\s$/,al=At.NB.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:t=>[{tag:"ul"}],renderHTML(t){let{node:e,HTMLAttributes:n}=t;return["ul",(0,At.P1)(this.options.HTMLAttributes,n,{style:`color:${e.attrs.color}`}),0]},addCommands(){return{changeBulletListColor:t=>{let{color:e}=t;return t=>{let{commands:n,chain:r}=t;return r().updateAttributes(this.name,{color:e}).run()}},toggleBulletList:()=>t=>{let{commands:e,chain:n}=t;return this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(il.name,this.editor.getAttributes(ol.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=(0,At.S0)({find:sl,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,At.S0)({find:sl,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(ol.name),editor:this.editor})),[t]}}),ll=/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{11})(?:\S+)?$/,cl=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)(\/(?:shorts\/|watch\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,dl=/^https?:\/\/(?:www\.)?(?:vimeo\.com|player\.vimeo\.com\/video)\/(\d+)(?:\/[\w-]*)?(?:\?.*)?$/i,pl=/^https?:\/\/(?:www\.)?.+\.mp3(?:\?.*)?$/i,hl=t=>!!t&&!!t.match(ll),ul=t=>!!t&&!!t.match(dl),fl=t=>!!t&&!!t.match(pl),ml=t=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",gl=t=>{let{url:e}=t;return hl(e)?(t=>{const{url:e,allowFullscreen:n,autoplay:r,ccLanguage:i,ccLoadPolicy:o,controls:s,disableKBcontrols:a,enableIFrameApi:l,endTime:c,interfaceLanguage:d,ivLoadPolicy:p,loop:h,modestBranding:u,nocookie:f,origin:m,playlist:g,progressBarColor:b,startAt:y}=t;if(!hl(e))return null;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")){const t=e.split("/").pop();return t?`${ml(f)}${t}`:null}const A=/(?:v=|shorts\/)([-\w]+)/gm.exec(e);if(!A||!A[1])return null;let w=`${ml(f)}${A[1]}`;const v=[];return!1===n&&v.push("fs=0"),r&&v.push("autoplay=1"),i&&v.push(`cc_lang_pref=${i}`),o&&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}`),h&&v.push("loop=1"),u&&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})(t):ul(e)?(t=>{const{url:e}=t;if(!ul(e))return null;const n=(t=>{const e=t.match(dl);return e&&e.find((t=>/^\d+$/.test(t)))||null})(e);if(!n)return null;let r=`https://player.vimeo.com/video/${n}`;const i=[];return t.autoplay&&i.push("autoplay=1"),i.length&&(r+=`?${i.join("&")}`),r})(t):fl(e)?(t=>{const{url:e}=t;return fl(e)?e:null})(t):null},bl=At.NB.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:t=>e=>{let{commands:n}=e;return ul(t.src)||hl(t.src)||fl(t.src)?(t.src=gl({url:t.src}),n.insertContent({type:this.name,attrs:t})):(console.error("Invalid video URL"),!1)}}},addPasteRules(){return this.options.addPasteHandler?[(0,At.Ss)({find:cl,type:this.type,getAttributes:t=>({src:t.input})})]:[]},renderHTML(t){let{HTMLAttributes:e}=t;const n=gl({url:e.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:e.start||0});return e.src=n,["div",{"data-video-cdtr":""},["iframe",(0,At.P1)(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},e)]]}}),yl={addAttributes(){return{...this.parent?.(),style:{parseHTML:t=>{const e=t.getAttribute("width");return e?`width: ${e}px; height: auto; cursor: pointer;max-width: 100%;`:`${t.style.cssText}`}}}},addNodeView(){const t=document.createElement("div");return e=>{let{node:n,editor:r,getPos:i}=e;const{view:o,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",(t=>{t.preventDefault(),t.stopPropagation();const e=l.value;setTimeout((()=>{r.chain().setVideo({src:e,width:n.attrs.width||this.options.width,height:n.attrs.height||this.options.height}).run()}),200)})),t.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 h=()=>{t.classList.add("cdtr-position-controller"),(()=>{const t={...n.attrs,style:`${p.style.cssText}`};o.dispatch(o.state.tr.setNodeMarkup(i(),null,t))})(),d.appendChild(t)};return c.setAttribute("style","display: flex;"),c.appendChild(d),d.classList.add("video-container"),d.appendChild(p),s?(d.addEventListener("click",(t=>{h(),d.setAttribute("style","position: relative; border: 1px dashed #6C6C6C; cursor: pointer;")})),document.addEventListener("click",(e=>{const n=e.target;d.contains(n)||d===n||t.remove()})),{dom:c}):{dom:d}}}},Al=bl.extend(yl);function wl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var vl={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function _l(t){vl=t}var xl={exec:()=>null};function kl(t,e=""){let n="string"==typeof t?t:t.source;const r={replace:(t,e)=>{let i="string"==typeof e?e:e.source;return i=i.replace(Cl.caret,"$1"),n=n.replace(t,i),r},getRegex:()=>new RegExp(n,e)};return r}var Cl={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:t=>new RegExp(`^( {0,3}${t})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},El=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Sl=/(?:[*+-]|\d{1,9}[.)])/,Bl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ol=kl(Bl).replace(/bull/g,Sl).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(),$l=kl(Bl).replace(/bull/g,Sl).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(),Ml=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Il=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Tl=kl(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Il).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ll=kl(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Sl).getRegex(),Nl="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",Rl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pl=kl("^ {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",Rl).replace("tag",Nl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Dl=kl(Ml).replace("hr",El).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",Nl).getRegex(),zl={blockquote:kl(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Dl).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Tl,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:El,html:Pl,lheading:Ol,list:Ll,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Dl,table:xl,text:/^[^\n]+/},Hl=kl("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",El).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",Nl).getRegex(),Ul={...zl,lheading:$l,table:Hl,paragraph:kl(Ml).replace("hr",El).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Hl).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",Nl).getRegex()},jl={...zl,html:kl("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Rl).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:xl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:kl(Ml).replace("hr",El).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Ol).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Zl=/^( {2,}|\\)\n(?!\s*$)/,Fl=/[\p{P}\p{S}]/u,Vl=/[\s\p{P}\p{S}]/u,Yl=/[^\s\p{P}\p{S}]/u,Wl=kl(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Vl).getRegex(),ql=/(?!~)[\p{P}\p{S}]/u,Xl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Gl=kl(Xl,"u").replace(/punct/g,Fl).getRegex(),Kl=kl(Xl,"u").replace(/punct/g,ql).getRegex(),Jl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ql=kl(Jl,"gu").replace(/notPunctSpace/g,Yl).replace(/punctSpace/g,Vl).replace(/punct/g,Fl).getRegex(),tc=kl(Jl,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,ql).getRegex(),ec=kl("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Yl).replace(/punctSpace/g,Vl).replace(/punct/g,Fl).getRegex(),nc=kl(/\\(punct)/,"gu").replace(/punct/g,Fl).getRegex(),rc=kl(/^<(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(),ic=kl(Rl).replace("(?:--\x3e|$)","--\x3e").getRegex(),oc=kl("^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",ic).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),sc=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ac=kl(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",sc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lc=kl(/^!?\[(label)\]\[(ref)\]/).replace("label",sc).replace("ref",Il).getRegex(),cc=kl(/^!?\[(ref)\](?:\[\])?/).replace("ref",Il).getRegex(),dc={_backpedal:xl,anyPunctuation:nc,autolink:rc,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:Zl,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:xl,emStrongLDelim:Gl,emStrongRDelimAst:Ql,emStrongRDelimUnd:ec,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:ac,nolink:cc,punctuation:Wl,reflink:lc,reflinkSearch:kl("reflink|nolink(?!\\()","g").replace("reflink",lc).replace("nolink",cc).getRegex(),tag:oc,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:xl},pc={...dc,link:kl(/^!?\[(label)\]\((.*?)\)/).replace("label",sc).getRegex(),reflink:kl(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",sc).getRegex()},hc={...dc,emStrongRDelimAst:tc,emStrongLDelim:Kl,url:kl(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},uc={...hc,br:kl(Zl).replace("{2,}","*").getRegex(),text:kl(hc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},fc={normal:zl,gfm:Ul,pedantic:jl},mc={normal:dc,gfm:hc,breaks:uc,pedantic:pc},gc={"&":"&","<":"<",">":">",'"':""","'":"'"},bc=t=>gc[t];function yc(t,e){if(e){if(Cl.escapeTest.test(t))return t.replace(Cl.escapeReplace,bc)}else if(Cl.escapeTestNoEncode.test(t))return t.replace(Cl.escapeReplaceNoEncode,bc);return t}function Ac(t){try{t=encodeURI(t).replace(Cl.percentDecode,"%")}catch{return null}return t}function wc(t,e){const n=t.replace(Cl.findPipe,((t,e,n)=>{let r=!1,i=e;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(Cl.splitPipe);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(Cl.slashPipe,"|");return n}function vc(t,e,n){const r=t.length;if(0===r)return"";let i=0;for(;i<r;){const o=t.charAt(r-i-1);if(o!==e||n){if(o===e||!n)break;i++}else i++}return t.slice(0,r-i)}function _c(t,e,n,r,i){const o=e.href,s=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:"!"===t[0].charAt(0)?"image":"link",raw:n,href:o,title:s,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}var xc=class{options;rules;lexer;constructor(t){this.options=t||vl}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:vc(t,"\n")}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0],n=function(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(null===r)return e;const i=r[1];return e.split("\n").map((t=>{const e=t.match(n.other.beginningSpace);if(null===e)return t;const[r]=e;return r.length>=i.length?t.slice(i.length):t})).join("\n")}(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const e=vc(t,"#");this.options.pedantic?t=e.trim():e&&!this.rules.other.endingSpaceChar.test(e)||(t=e.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:vc(e[0],"\n")}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let t=vc(e[0],"\n").split("\n"),n="",r="";const i=[];for(;t.length>0;){let e=!1;const o=[];let s;for(s=0;s<t.length;s++)if(this.rules.other.blockquoteStart.test(t[s]))o.push(t[s]),e=!0;else{if(e)break;o.push(t[s])}t=t.slice(s);const a=o.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,i,!0),this.lexer.state.top=c,0===t.length)break;const d=i.at(-1);if("code"===d?.type)break;if("blockquote"===d?.type){const e=d,o=e.raw+"\n"+t.join("\n"),s=this.blockquote(o);i[i.length-1]=s,n=n.substring(0,n.length-e.raw.length)+s.raw,r=r.substring(0,r.length-e.text.length)+s.text;break}if("list"!==d?.type);else{const e=d,o=e.raw+"\n"+t.join("\n"),s=this.list(o);i[i.length-1]=s,n=n.substring(0,n.length-d.raw.length)+s.raw,r=r.substring(0,r.length-e.raw.length)+s.raw,t=o.substring(i.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const r=n.length>1,i={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 o=this.rules.other.listItemRegex(n);let s=!1;for(;t;){let n=!1,r="",a="";if(!(e=o.exec(t)))break;if(this.rules.block.hr.test(t))break;r=e[0],t=t.substring(r.length);let l=e[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(t=>" ".repeat(3*t.length))),c=t.split("\n",1)[0],d=!l.trim(),p=0;if(this.options.pedantic?(p=2,a=l.trimStart()):d?p=e[1].length+1:(p=e[2].search(this.rules.other.nonSpaceChar),p=p>4?1:p,a=l.slice(p),p+=e[1].length),d&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",t=t.substring(c.length+1),n=!0),!n){const e=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),o=this.rules.other.headingBeginRegex(p),s=this.rules.other.htmlBeginRegex(p);for(;t;){const h=t.split("\n",1)[0];let u;if(c=h,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),u=c):u=c.replace(this.rules.other.tabCharGlobal," "),i.test(c))break;if(o.test(c))break;if(s.test(c))break;if(e.test(c))break;if(n.test(c))break;if(u.search(this.rules.other.nonSpaceChar)>=p||!c.trim())a+="\n"+u.slice(p);else{if(d)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(i.test(l))break;if(o.test(l))break;if(n.test(l))break;a+="\n"+c}d||c.trim()||(d=!0),r+=h+"\n",t=t.substring(h.length+1),l=u.slice(p)}}i.loose||(s?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(s=!0));let h,u=null;this.options.gfm&&(u=this.rules.other.listIsTask.exec(a),u&&(h="[ ] "!==u[0],a=a.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:r,task:!!u,checked:h,loose:!1,text:a,tokens:[]}),i.raw+=r}const a=i.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),i.raw=i.raw.trimEnd();for(let t=0;t<i.items.length;t++)if(this.lexer.state.top=!1,i.items[t].tokens=this.lexer.blockTokens(i.items[t].text,[]),!i.loose){const e=i.items[t].tokens.filter((t=>"space"===t.type)),n=e.length>0&&e.some((t=>this.rules.other.anyLine.test(t.raw)));i.loose=n}if(i.loose)for(let t=0;t<i.items.length;t++)i.items[t].loose=!0;return i}}html(t){const e=this.rules.block.html.exec(t);if(e){return{type:"html",block:!0,raw:e[0],pre:"pre"===e[1]||"script"===e[1]||"style"===e[1],text:e[0]}}}def(t){const e=this.rules.block.def.exec(t);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:n,title:r}}}table(t){const e=this.rules.block.table.exec(t);if(!e)return;if(!this.rules.other.tableDelimiter.test(e[2]))return;const n=wc(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const t of r)this.rules.other.tableAlignRight.test(t)?o.align.push("right"):this.rules.other.tableAlignCenter.test(t)?o.align.push("center"):this.rules.other.tableAlignLeft.test(t)?o.align.push("left"):o.align.push(null);for(let t=0;t<n.length;t++)o.header.push({text:n[t],tokens:this.lexer.inline(n[t]),header:!0,align:o.align[t]});for(const t of i)o.rows.push(wc(t,o.header.length).map(((t,e)=>({text:t,tokens:this.lexer.inline(t),header:!1,align:o.align[e]}))));return o}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const t="\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const e=vc(t.slice(0,-1),"\\");if((t.length-e.length)%2==0)return}else{const t=function(t,e){if(-1===t.indexOf(e[1]))return-1;let n=0;for(let r=0;r<t.length;r++)if("\\"===t[r])r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}(e[2],"()");if(-2===t)return;if(t>-1){const n=(0===e[0].indexOf("!")?5:4)+e[1].length+t;e[2]=e[2].substring(0,t),e[0]=e[0].substring(0,n).trim(),e[3]=""}}let n=e[2],r="";if(this.options.pedantic){const t=this.rules.other.pedanticHrefTitle.exec(n);t&&(n=t[1],r=t[3])}else r=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?n.slice(1):n.slice(1,-1)),_c(e,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const t=e[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!t){const t=n[0].charAt(0);return{type:"text",raw:t,text:t}}return _c(n,t,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);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 i,o,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+n);null!=(r=l.exec(e));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){s+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s+a);const e=[...r[0]][0].length,l=t.slice(0,n+r.index+e+o);if(Math.min(n,o)%2){const t=l.slice(1,-1);return{type:"em",raw:l,text:t,tokens:this.lexer.inlineTokens(t)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return n&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let t,n;return"@"===e[2]?(t=e[1],n="mailto:"+t):(t=e[1],n=t),{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,n;if("@"===e[2])t=e[0],n="mailto:"+t;else{let r;do{r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??""}while(r!==e[0]);t=e[0],n="www."===e[1]?"http://"+e[0]:e[0]}return{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},kc=class t{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||vl,this.options.tokenizer=this.options.tokenizer||new xc,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 e={other:Cl,block:fc.normal,inline:mc.normal};this.options.pedantic?(e.block=fc.pedantic,e.inline=mc.pedantic):this.options.gfm&&(e.block=fc.gfm,this.options.breaks?e.inline=mc.breaks:e.inline=mc.gfm),this.tokenizer.rules=e}static get rules(){return{block:fc,inline:mc}}static lex(e,n){return new t(n).lex(e)}static lexInline(e,n){return new t(n).inlineTokens(e)}lex(t){t=t.replace(Cl.carriageReturn,"\n"),this.blockTokens(t,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],n=!1){for(this.options.pedantic&&(t=t.replace(Cl.tabCharGlobal," ").replace(Cl.spaceLine,""));t;){let r;if(this.options.extensions?.block?.some((n=>!!(r=n.call({lexer:this},t,e))&&(t=t.substring(r.raw.length),e.push(r),!0))))continue;if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length);const n=e.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":e.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length);const n=e.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):e.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length);const n=e.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(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),e.push(r);continue}let i=t;if(this.options.extensions?.startBlock){let e=1/0;const n=t.slice(1);let r;this.options.extensions.startBlock.forEach((t=>{r=t.call({lexer:this},n),"number"==typeof r&&r>=0&&(e=Math.min(e,r))})),e<1/0&&e>=0&&(i=t.substring(0,e+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){const o=e.at(-1);n&&"paragraph"===o?.type?(o.raw+="\n"+r.raw,o.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):e.push(r),n=i.length!==t.length,t=t.substring(r.raw.length)}else if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length);const n=e.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):e.push(r)}else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let n=t,r=null;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)t.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 i=!1,o="";for(;t;){let r;if(i||(o=""),i=!1,this.options.extensions?.inline?.some((n=>!!(r=n.call({lexer:this},t,e))&&(t=t.substring(r.raw.length),e.push(r),!0))))continue;if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length);const n=e.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):e.push(r);continue}if(r=this.tokenizer.emStrong(t,n,o)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.autolink(t)){t=t.substring(r.raw.length),e.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t))){t=t.substring(r.raw.length),e.push(r);continue}let s=t;if(this.options.extensions?.startInline){let e=1/0;const n=t.slice(1);let r;this.options.extensions.startInline.forEach((t=>{r=t.call({lexer:this},n),"number"==typeof r&&r>=0&&(e=Math.min(e,r))})),e<1/0&&e>=0&&(s=t.substring(0,e+1))}if(r=this.tokenizer.inlineText(s)){t=t.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(o=r.raw.slice(-1)),i=!0;const n=e.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):e.push(r)}else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return e}},Cc=class{options;parser;constructor(t){this.options=t||vl}space(t){return""}code({text:t,lang:e,escaped:n}){const r=(e||"").match(Cl.notSpaceStart)?.[0],i=t.replace(Cl.endingNewline,"")+"\n";return r?'<pre><code class="language-'+yc(r)+'">'+(n?i:yc(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:yc(i,!0))+"</code></pre>\n"}blockquote({tokens:t}){return`<blockquote>\n${this.parser.parse(t)}</blockquote>\n`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>\n`}hr(t){return"<hr>\n"}list(t){const e=t.ordered,n=t.start;let r="";for(let e=0;e<t.items.length;e++){const n=t.items[e];r+=this.listitem(n)}const i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(t){let e="";if(t.task){const n=this.checkbox({checked:!!t.checked});t.loose?"paragraph"===t.tokens[0]?.type?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=n+" "+yc(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>\n`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>\n`}table(t){let e="",n="";for(let e=0;e<t.header.length;e++)n+=this.tablecell(t.header[e]);e+=this.tablerow({text:n});let r="";for(let e=0;e<t.rows.length;e++){const i=t.rows[e];n="";for(let t=0;t<i.length;t++)n+=this.tablecell(i[t]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+r+"</table>\n"}tablerow({text:t}){return`<tr>\n${t}</tr>\n`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${yc(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const r=this.parser.parseInline(n),i=Ac(t);if(null===i)return r;let o='<a href="'+(t=i)+'"';return e&&(o+=' title="'+yc(e)+'"'),o+=">"+r+"</a>",o}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const i=Ac(t);if(null===i)return yc(n);let o=`<img src="${t=i}" alt="${n}"`;return e&&(o+=` title="${yc(e)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:yc(t.text)}},Ec=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Sc=class t{options;renderer;textRenderer;constructor(t){this.options=t||vl,this.options.renderer=this.options.renderer||new Cc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ec}static parse(e,n){return new t(n).parse(e)}static parseInline(e,n){return new t(n).parseInline(e)}parse(t,e=!0){let n="";for(let r=0;r<t.length;r++){const i=t[r];if(this.options.extensions?.renderers?.[i.type]){const t=i,e=this.options.extensions.renderers[t.type].call({parser:this},t);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(t.type)){n+=e||"";continue}}const o=i;switch(o.type){case"space":n+=this.renderer.space(o);continue;case"hr":n+=this.renderer.hr(o);continue;case"heading":n+=this.renderer.heading(o);continue;case"code":n+=this.renderer.code(o);continue;case"table":n+=this.renderer.table(o);continue;case"blockquote":n+=this.renderer.blockquote(o);continue;case"list":n+=this.renderer.list(o);continue;case"html":n+=this.renderer.html(o);continue;case"paragraph":n+=this.renderer.paragraph(o);continue;case"text":{let i=o,s=this.renderer.text(i);for(;r+1<t.length&&"text"===t[r+1].type;)i=t[++r],s+="\n"+this.renderer.text(i);n+=e?this.renderer.paragraph({type:"paragraph",raw:s,text:s,tokens:[{type:"text",raw:s,text:s,escaped:!0}]}):s;continue}default:{const t='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return n}parseInline(t,e=this.renderer){let n="";for(let r=0;r<t.length;r++){const i=t[r];if(this.options.extensions?.renderers?.[i.type]){const t=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==t||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=t||"";continue}}const o=i;switch(o.type){case"escape":case"text":n+=e.text(o);break;case"html":n+=e.html(o);break;case"link":n+=e.link(o);break;case"image":n+=e.image(o);break;case"strong":n+=e.strong(o);break;case"em":n+=e.em(o);break;case"codespan":n+=e.codespan(o);break;case"br":n+=e.br(o);break;case"del":n+=e.del(o);break;default:{const t='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return n}},Bc=class{options;block;constructor(t){this.options=t||vl}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?kc.lex:kc.lexInline}provideParser(){return this.block?Sc.parse:Sc.parseInline}},Oc=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=Sc;Renderer=Cc;TextRenderer=Ec;Lexer=kc;Tokenizer=xc;Hooks=Bc;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(const r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{const t=r;for(const r of t.header)n=n.concat(this.walkTokens(r.tokens,e));for(const r of t.rows)for(const t of r)n=n.concat(this.walkTokens(t.tokens,e));break}case"list":{const t=r;n=n.concat(this.walkTokens(t.items,e));break}default:{const t=r;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach((r=>{const i=t[r].flat(1/0);n=n.concat(this.walkTokens(i,e))})):t.tokens&&(n=n.concat(this.walkTokens(t.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach((t=>{const n={...t};if(n.async=this.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const n=e.renderers[t.name];e.renderers[t.name]=n?function(...e){let r=t.renderer.apply(this,e);return!1===r&&(r=n.apply(this,e)),r}:t.renderer}if("tokenizer"in t){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");const n=e[t.level];n?n.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)})),n.extensions=e),t.renderer){const e=this.defaults.renderer||new Cc(this.defaults);for(const n in t.renderer){if(!(n in e))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,i=t.renderer[r],o=e[r];e[r]=(...t)=>{let n=i.apply(e,t);return!1===n&&(n=o.apply(e,t)),n||""}}n.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new xc(this.defaults);for(const n in t.tokenizer){if(!(n in e))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=t.tokenizer[r],o=e[r];e[r]=(...t)=>{let n=i.apply(e,t);return!1===n&&(n=o.apply(e,t)),n}}n.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new Bc;for(const n in t.hooks){if(!(n in e))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;const r=n,i=t.hooks[r],o=e[r];Bc.passThroughHooks.has(n)?e[r]=t=>{if(this.defaults.async)return Promise.resolve(i.call(e,t)).then((t=>o.call(e,t)));const n=i.call(e,t);return o.call(e,n)}:e[r]=(...t)=>{let n=i.apply(e,t);return!1===n&&(n=o.apply(e,t)),n}}n.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens,r=t.walkTokens;n.walkTokens=function(t){let n=[];return n.push(r.call(this,t)),e&&(n=n.concat(e.call(this,t))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return kc.lex(t,e??this.defaults)}parser(t,e){return Sc.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{const r={...n},i={...this.defaults,...r},o=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return o(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==e)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof e)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);const s=i.hooks?i.hooks.provideLexer():t?kc.lex:kc.lexInline,a=i.hooks?i.hooks.provideParser():t?Sc.parse:Sc.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(e):e).then((t=>s(t,i))).then((t=>i.hooks?i.hooks.processAllTokens(t):t)).then((t=>i.walkTokens?Promise.all(this.walkTokens(t,i.walkTokens)).then((()=>t)):t)).then((t=>a(t,i))).then((t=>i.hooks?i.hooks.postprocess(t):t)).catch(o);try{i.hooks&&(e=i.hooks.preprocess(e));let t=s(e,i);i.hooks&&(t=i.hooks.processAllTokens(t)),i.walkTokens&&this.walkTokens(t,i.walkTokens);let n=a(t,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(t){return o(t)}}}onError(t,e){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",t){const t="<p>An error occurred:</p><pre>"+yc(n.message+"",!0)+"</pre>";return e?Promise.resolve(t):t}if(e)return Promise.reject(n);throw n}}};function $c(t,e){return Oc.parse(t,e)}$c.options=$c.setOptions=function(t){return Oc.setOptions(t),$c.defaults=Oc.defaults,_l($c.defaults),$c},$c.getDefaults=wl,$c.defaults=vl,$c.use=function(...t){return Oc.use(...t),$c.defaults=Oc.defaults,_l($c.defaults),$c},$c.walkTokens=function(t,e){return Oc.walkTokens(t,e)},$c.parseInline=Oc.parseInline,$c.Parser=Sc,$c.parser=Sc.parse,$c.Renderer=Cc,$c.TextRenderer=Ec,$c.Lexer=kc,$c.lexer=kc.lex,$c.Tokenizer=xc,$c.Hooks=Bc,$c.parse=$c;$c.options,$c.setOptions,$c.use,$c.walkTokens,$c.parseInline,Sc.parse,kc.lex;const Mc=t=>[/^#{1,6}\s/m,/\*\*.*\*\*/,/__.*__/,/\*.*\*/,/_.*_/,/\[.*\]\(.*\)/,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m,/```[\s\S]*```/,/`[^`]+`/,/^>\s/m,/!\[.*\]\(.*\)/,/^\s*[-*_]{3,}\s*$/m].some((e=>e.test(t))),Ic=At.hj.create({name:"markdownPaste",addOptions:()=>({autoDetect:!0}),addProseMirrorPlugins(){const t=this.editor,e=this.options;return[new wt.Sy({key:new wt.H$("markdownPaste"),props:{handlePaste:(n,r,i)=>{if(!e.autoDetect)return!1;const o=r.clipboardData?.getData("text/plain"),s=r.clipboardData?.getData("text/html");if(console.log("Paste event - text:",o),console.log("Paste event - html:",s),console.log("Is markdown?",Mc(o)),!o||!Mc(o))return console.log("Not markdown or no text, skipping"),!1;if(s&&s.trim()){const t=/<(?!meta|style|link)([\w]+)[^>]*>/i.test(s);if(console.log("Has rich HTML content:",t),t&&!Mc(o))return console.log("Skipping due to rich HTML"),!1}try{let e=$c.parse(o,{async:!1});return console.log("Parsed markdown to HTML:",e),e&&"string"==typeof e&&(e=e.replace(/<a\s+([^>]*?)>/gi,((t,e)=>e.includes("style=")?t.replace(/style="([^"]*)"/i,((t,e)=>e.includes("color:")?t:`style="${e}; color: blue"`)):`<a ${e} style="color: blue">`))),r.preventDefault(),t.commands.insertContent(e),!0}catch(t){return console.error("Error parsing markdown:",t),!1}}}})]}}),Tc=At.hj.create({name:"markdownContent",addCommands:()=>({setMarkdownContent:t=>e=>{let{commands:n,editor:r}=e;try{let e=$c.parse(t,{async:!1});return e&&"string"==typeof e&&(e=e.replace(/<a\s+([^>]*?)>/gi,((t,e)=>e.includes("style=")?t.replace(/style="([^"]*)"/i,((t,e)=>e.includes("color:")?t:`style="${e}; color: blue"`)):`<a ${e} style="color: blue">`))),n.setContent(e)}catch(t){return console.error("Error parsing markdown:",t),!1}},insertMarkdownContent:t=>e=>{let{commands:n,editor:r}=e;try{let e=$c.parse(t,{async:!1});return e&&"string"==typeof e&&(e=e.replace(/<a\s+([^>]*?)>/gi,((t,e)=>e.includes("style=")?t.replace(/style="([^"]*)"/i,((t,e)=>e.includes("color:")?t:`style="${e}; color: blue"`)):`<a ${e} style="color: blue">`))),n.insertContent(e)}catch(t){return console.error("Error parsing markdown:",t),!1}}})}),Lc=At.hj.create({name:"preserveStyle",addStorage:()=>({lastTextStyle:null}),addProseMirrorPlugins(){const t=this;return[new wt.Sy({key:new wt.H$("preserveStyle"),state:{init:()=>null,apply(e,n){const r=e.doc.type.schema.marks.textStyle;if(!r)return n;if(e.storedMarks){const n=e.storedMarks.find((t=>t.type===r));if(n&&n.attrs){const e={};Object.keys(n.attrs).forEach((t=>{null!=n.attrs[t]&&(e[t]=n.attrs[t])})),Object.keys(e).length>0&&(t.storage.lastTextStyle=e)}}return e.steps.forEach((e=>{if("addMark"===e.stepType){const n=e.mark;if(n&&n.type===r&&n.attrs){const e={};Object.keys(n.attrs).forEach((t=>{null!=n.attrs[t]&&(e[t]=n.attrs[t])})),Object.keys(e).length>0&&(t.storage.lastTextStyle=e)}}})),n}}}),new wt.Sy({key:new wt.H$("preserveStyleOnSelection"),appendTransaction(e,n,r){const{selection:i}=r,{$from:o}=i,s=o.parent,a=0===s.content.size,l="paragraph"===s.type.name||"heading"===s.type.name;if(a&&l){const e=r.schema.marks.textStyle;if(!e)return null;const n=o.marks().some((t=>t.type===e)),i=r.storedMarks||[],s=i.some((t=>t.type===e));if(!n&&!s&&t.storage.lastTextStyle){const n=r.tr,o=[e.create(t.storage.lastTextStyle),...i.filter((t=>t.type!==e))];return n.setStoredMarks(o),n}}return null}})]},onUpdate(){const{editor:t}=this,e=t.getAttributes("textStyle");if(e&&Object.keys(e).length>0){const t={};Object.keys(e).forEach((n=>{null!=e[n]&&(t[n]=e[n])})),Object.keys(t).length>0&&(this.storage.lastTextStyle=t)}}}),Nc=At.hj.create({name:"linkUnlinkStyle",addStorage:()=>({styleBeforeLink:null}),addCommands(){return{saveStyleBeforeLinkFromRange:(t,e)=>e=>{let{state:n}=e;const r=n.schema.marks.textStyle;if(!r)return this.storage.styleBeforeLink=null,!0;const i=n.doc.resolve(t).marks().find((t=>t.type===r));if(!i||!i.attrs)return this.storage.styleBeforeLink=null,!0;const o={};return Object.keys(i.attrs).forEach((t=>{null!=i.attrs[t]&&(o[t]=i.attrs[t])})),this.storage.styleBeforeLink=Object.keys(o).length>0?o:null,!0},unLinkWithStyleRestore:()=>t=>{let{state:e,dispatch:n}=t;const{from:r,to:i}=e.selection,o=e.schema,s=o.marks.link,a=o.marks.textStyle;if(!s||!a)return!1;const l=this.storage.styleBeforeLink,c=e.tr;if(c.removeMark(r,i,s),l&&Object.keys(l).length>0)c.removeMark(r,i,a),c.addMark(r,i,a.create(l));else{const t=e.doc.resolve(r).marks().find((t=>t.type===a)),n=t?{...t.attrs,color:null}:{color:null};c.removeMark(r,i,a),c.addMark(r,i,a.create(n))}const d=e.doc.resolve(r).marks().filter((t=>t.type!==a&&t.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}}}}),Rc=t=>{const e=t.defaultDirection||"auto";let n=t.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((t=>t.test(r)))))try{n=$c.parse(n,{async:!1}),n&&"string"==typeof n&&(n=n.replace(/<a\s+([^>]*?)>/gi,((t,e)=>e.includes("style=")?t.replace(/style="([^"]*)"/i,((t,e)=>e.includes("color:")?t:`style="${e}; color: blue"`)):`<a ${e} style="color: blue">`)))}catch(t){console.error("Error parsing markdown content:",t)}var r;const{content:i,...o}=t,s=new At.ML({autofocus:!1,content:n,editorProps:{handleDOMEvents:{drop:(t,e)=>{if(e.dataTransfer&&"move"===e.dataTransfer.effectAllowed&&1===e.dataTransfer.items.length&&"text/plain"===e.dataTransfer.items[0].type){const t=e.dataTransfer.getData("text/plain");"string"!=typeof t||t.trim()||e.preventDefault()}}},handlePaste:(t,e,n)=>{const r=e.clipboardData?.getData("text/plain");if(!r||!(t=>{try{const e=new URL(t);return"http:"===e.protocol||"https:"===e.protocol}catch(e){return/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/i.test(t.trim())}})(r.trim()))return!1;const i=t.state,{from:o,to:s}=i.selection,a=i.doc.textBetween(o,s),l=i.schema.marks.link,c=i.schema.marks.textStyle;if(!l)return!1;let d=r.trim();d.startsWith("http://")||d.startsWith("https://")||(d="https://"+d);const p=a&&(t=>{if(!t||"string"!=typeof t)return!1;const e=t.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(e)})(a);if(p){let e=!1,n=null;if(i.doc.nodesBetween(o,s,((t,r)=>{if(e)return!1;Math.max(o,r),Math.min(s,r+t.nodeSize);return t.marks.forEach((t=>{"link"===t.type.name&&(e=!0,n=t)})),!e})),!e){const t=i.storedMarks?.find((t=>"link"===t.type.name)),r=i.selection.$from.marks().find((t=>"link"===t.type.name)),o=i.selection.$to.marks().find((t=>"link"===t.type.name));n=t||r||o,e=!!n}const r=i.tr;if(e){r.removeMark(o,s,l),r.replaceWith(o,s,i.schema.text(d));const t=o,e=o+d.length;r.addMark(t,e,l.create({href:d})),c&&r.addMark(t,e,c.create({color:"blue"}))}else{r.replaceWith(o,s,i.schema.text(d));const t=o,e=o+d.length;r.addMark(t,e,l.create({href:d})),c&&r.addMark(t,e,c.create({color:"blue"}))}const a=o+d.length;return r.setSelection(wt.Bs.near(r.doc.resolve(a))),t.dispatch(r),!0}{const e=i.tr;if(a&&o!==s){if(e.addMark(o,s,l.create({href:d})),c){let t={};i.doc.nodesBetween(o,s,((e,n)=>{Math.max(o,n),Math.min(s,n+e.nodeSize);e.marks.forEach((e=>{"textStyle"===e.type.name&&(t={...t,...e.attrs})}))}));const n={...t,color:"blue"};e.addMark(o,s,c.create(n))}e.setSelection(wt.Bs.near(e.doc.resolve(s)))}else{e.replaceWith(o,s,i.schema.text(d));const t=o,n=o+d.length;e.addMark(t,n,l.create({href:d})),c&&e.addMark(t,n,c.create({color:"blue"})),e.setSelection(wt.Bs.near(e.doc.resolve(n)))}return t.dispatch(e),!0}},transformPastedHTML:t=>(t&&"string"==typeof t&&(t=(t=t.replace(/style="([^"]*)"/gi,((t,e)=>{let n=e.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,((t,e)=>e.includes("style=")?t.replace(/style="([^"]*)"/i,((t,e)=>e.includes("color:")?t:`style="${e}; color: blue"`)):`<a ${e} style="color: blue">`))),t)},extensions:[Bt.Z,Wt.configure({placeholder:t=>{let{node:e}=t;return"paragraph"===e.type.name?B.h.get("lang","add_content_to_paragraph"):"heading"===e.type.name?B.h.get("lang","add_content_to_heading"):null}}),qn,Ot.configure({HTMLAttributes:{class:"cdtr-heading",style:"font-weight: initial"}}),Al,Pn,$t.Z,Ji.extend({inclusive:!1}).configure({openOnClick:!1,HTMLAttributes:{class:"cdtr-editor-link"}}),pe.configure({draggable:!0}),le.configure({keepMarks:!0}),Ln.configure({lowlight:el,draggable:!0,defaultLanguage:"javascript"}),Rn.configure({fonts:t.fontFamilies}),Nt,Rt,vt.ZP,Ft,Vt,Ts,al,re,Bs.configure({resizable:!1,draggable:!0,lastColumnResizable:!1,HTMLAttributes:{class:"cdtr-table-element"}}),$s.configure({draggable:!0}),Ms,Is,Yt,rl.configure({inline:!1,HTMLAttributes:{"data-type":"inline-image","cdtr-resizable":"true",style:"display: block; margin: 0 auto;"}}),Kt.configure({class:"dropcursor",color:"black",width:2}),te.configure({types:["heading","blockquote","paragraph","taskList","customBulletList","bulletList","orderedList"]}),Qt.configure({types:["heading","blockquote","paragraph","taskList","orderedList"]}),Jt.configure({defaultDirection:e,types:["heading","blockquote","paragraph","taskList","customBulletList","bulletList","orderedList"]}),Ls.configure({types:["heading","paragraph"],defaultAlignment:"rtl"===e?"right":"left"}),St,Et,Lc,Nc,zt,Os,Ct,_t,ae,se,Wn,Ic,Tc],...o});return s};n(35432);var Pc=n(86274),Dc={};Dc.setAttributes=D(),Dc.insert=R().bind(null,"head"),Dc.domAPI=L(),Dc.insertStyleElement=H();I()(Pc.Z,Dc);Pc.Z&&Pc.Z.locals&&Pc.Z.locals;var zc=n(36351);n(9545);const Hc={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},Uc={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"},jc={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 Zc(t){return null!=t&&""!==t}function Fc(t){let e=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(!t)return void console.warn("No editor provided");const i={...Hc,...e},o={...Uc,...n},s={...jc,...r};console.log("Validating default values..."),console.log("Font sizes:",i),console.log("Font families:",o),console.log("Line heights:",s),console.log("=== APPLYING FONT SIZES, FAMILIES, AND LINE HEIGHTS TO TIPTAP DOCUMENT ==="),console.log("Font sizes to apply:",i),console.log("Font families to apply:",o),console.log("Line heights to apply:",s);const{state:a}=t,{doc:l}=a;l.descendants(((e,n)=>{const r=e.type.name;console.log(`Processing node: ${r} at position ${n}`);const a=e.marks?.find((t=>"textStyle"===t.type.name))?.attrs?.fontSize,l=e.marks?.find((t=>"textStyle"===t.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 t=e.attrs.level;a=i[`h${t}`]||i.heading,l=o[`h${t}`]||o.heading,c=s[`h${t}`]||s.heading,console.log(`Heading level ${t}:`,{fontSize:a||"not set",fontFamily:l||"not set",lineHeight:c||"not set"})}else i[r]&&(a=i[r],l=o[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(t,e,n,r,i,o){try{let s=t.chain().focus().setTextSelection({from:e,to:e+n});Zc(r)&&(s=s.setFontSize(r),console.log(`Setting font size: ${r}`)),Zc(i)&&(s=s.setFontFamily(i),console.log(`Setting font family: ${i}`)),Zc(o)&&(s=s.setLineHeight(o),console.log(`Setting line height: ${o}`)),s.run(),console.log(`Applied to node at position ${e}:`,{fontSize:r||"not set",fontFamily:i||"not set",lineHeight:o||"not set"})}catch(t){console.warn(`Failed to apply font and line height to node at position ${e}:`,t)}}(t,n,e.nodeSize,a,l,c)}return!0})),console.log("Font and line height application complete")}function Vc(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];t&&e&&(console.log("=== INSERTING CONTENT AND APPLYING FONT SIZES, FAMILIES, AND LINE HEIGHTS ==="),console.log("Content to insert:",e),console.log("Preserve existing fonts:",o),t.commands.insertContent(e),o||setTimeout((()=>{Fc(t,n,r,i)}),100),t.chain().focus())}const Yc=(0,zc.c)(),Wc="selection-background";function qc(t,e){t?e.classList.add(dt.active):e.classList.remove(dt.active)}!function(){if(document.getElementById("theme-provider-vars"))return;const t=document.createElement("style");t.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(t)}();const Xc=t=>{const{defaultDirection:e,content:n,editable:M,element:I,builder:T=[],language:L,editorWidth:N,onClickMagic:R}=t,P=T.find((t=>"fontFamily"===t.type)),D=Rc({fontFamilies:P?.fonts||[],defaultDirection:e,element:I,editable:M,content:n,language:L}),z=(P?.fonts.length>0&&P.fonts,T.find((t=>"fontSize"===t.type))),H=z?z.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],U={direction:()=>{const t=D.isActive({direction:"rtl"})?"ltr":"rtl";Z.direction.element.innerHTML="ltr"===t?a().outerHTML:(t=>(0,r.Z)("svg",(0,i.Z)({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"}),(0,r.Z)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,r.Z)("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:()=>{qc(D.isActive("bold"),Z.bold.element)},italic:()=>{qc(D.isActive("italic"),Z.italic.element)},link:()=>{qc(D.isActive("link"),Z.link.element)},unLink:()=>{D.isActive("link")?Z.unLink.element.classList.remove(dt.disabled):Z.unLink.element.classList.add(dt.disabled)},underline:()=>{qc(D.isActive("underline"),Z.underline.element)},strike:()=>{qc(D.isActive("strike"),Z.strike.element)},color:()=>{const t=D.getAttributes("textStyle").color||"black";Z.fontColor.element.setAttribute("value",t)},background:()=>{const t=D.getAttributes("textStyle").backgroundColor||"#fff";Z.backcolor.element.setAttribute("value",t)},fontFamily:()=>{const t=D.getAttributes("textStyle").fontFamily?.split(",")[0].replace(/['"]+/g,"");Z.fontFamily.element.value=t||"Arial",Z.fontFamily.element.name=t||"Arial"},table:()=>{qc(D.isActive("table"),Z.table.element)},image:()=>qc(D.isActive("image"),Z.image.element),video:()=>qc(D.isActive("video"),Z.video.element),bulletList:()=>qc(D.isActive("bulletList"),Z.bullet.element),customBulletList:()=>qc(D.isActive("customBulletList"),Z.customList.element),numberedList:()=>{qc(D.isActive("orderedList"),Z.numbered.element)},quotes:()=>qc(D.isActive("blockquote"),Z.quotes.element),horizontalRule:()=>qc(D.isActive("horizontalRule"),Z.horizonRule.element),textAlign:()=>{["justify","center","right","left"].forEach((t=>{qc(D.isActive({textAlign:t}),Z[t].element)}))},fontSize:()=>{D.getAttributes("textStyle").fontSize;Z.fontSize.element.patch(D.getAttributes("textStyle").fontSize||"16px")}},j={removeTable:()=>D.chain().focus().deleteTable().run(),addTable:t=>{const e=(0,r.Z)(at,{style:{width:"220px",padding:"15px"},headerText:"add_table",target:t.target},(0,r.Z)("cdtr-table-cells-editor",{onChange:t=>{let{target:n}=t;const{x:r,y:i}=n.value;e.remove(),D.chain().focus().insertTable({rows:r,cols:i,withHeaderRow:!0}).run()}}));document.body.appendChild(e)},setButton:()=>{D.chain().focus().toggleButton({text:"button",width:"100",height:"100"}).run()},addImage:()=>{D.chain().focus().setImage({src:"https://picsum.photos/100/100",alt:""}).run()},setVideo:()=>{D.chain().focus().setVideo({src:"https://www.youtube.com/watch?v=HUYB8EY09ME",width:"500",height:"300"}).run()},setQuotes:()=>{D.chain().focus().toggleBlockquote().run()},setCode:()=>{D.chain().focus().toggleCodeBlock().run()},setHorizonRule:()=>{D.chain().focus().setHorizontalRule({url:"https://www.youtube.com/watch?v=HUYB8EY09ME",width:"100",height:"100"}).run()},clearFormat:()=>{D.chain().focus().unsetAllMarks().run()},emoji:t=>{},table:()=>D.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),bold:()=>D.chain().focus().toggleBold().run(),italic:()=>D.chain().focus().toggleItalic().run(),underline:()=>D.chain().focus().toggleUnderline().run(),strike:()=>D.chain().focus().toggleStrike().run(),direction:()=>{const t=D.isActive({direction:"rtl"})?"ltr":"rtl";D.chain().focus().setDirection(t).run()},textAlign:t=>D.chain().focus().setTextAlign(t).run(),bullets:()=>D.chain().focus().toggleBulletList().run(),numbered:()=>D.chain().focus().toggleOrderedList().run(),customList:()=>D.chain().focus().toggleCustomList().run(),fontSize:t=>{D.chain().focus().setFontSize(t).run()},fontFamily:t=>D.chain().focus().setFontFamily(t).run(),link:t=>{if(!t)return null;t.target.closest("button");const e=(0,r.Z)("cdtr-link-element",{href:D.getAttributes("link").href||"",protocol:D.getAttributes("link").protocol,target:D.getAttributes("link").target,onBlur:t=>(t=>{const e=D.state,{from:n,to:r}=e.selection;let i=[];e.doc.nodesBetween(n,r,(t=>{i=[...i,...t.marks]}));const o=i.find((t=>"link"===t.type.name)),s=t.target.value;s.getUrlWithParams&&(s.href=s.getUrlWithParams()),o?D.chain().focus().setColor("blue").extendMarkRange("link").updateAttributes("link",s).setTextSelection({from:r,to:r}).unsetColor().focus().run():(D.commands.saveStyleBeforeLinkFromRange(n,r),D.chain().focus().setTextSelection({from:n,to:r}).setColor("blue").setLink(s).setTextSelection({from:r,to:r}).unsetColor().focus().run()),setTimeout((()=>D.chain().setTextSelection({from:r,to:r}).unsetColor().focus().run()),0)})(t)});B.h.get("injectEditor")((0,r.Z)("cdtr-editor-container",null,e))},unLink:()=>D.chain().focus().extendMarkRange("link").unLinkWithStyleRestore().run(),forColor:t=>{D.chain().setColor(t).focus().run()},clearColor:()=>D.chain().focus().unsetColor().run(),clearBackcolor:()=>D.chain().focus().unsetBackgroundColor().run(),backColor:t=>D.chain().focus().setBackgroundColor(t).run(),onClickMagic:()=>{const t={selectAll:()=>(D.chain().focus().selectAll().run(),t),selectNode:e=>(D.chain().focus().selectNode(e).run(),t),selectParentNode:()=>(D.chain().focus().selectParentNode().run(),t),insertContent:e=>(D.commands.insertContent(e),D.chain().focus(),t),insertContentHtml:e=>{const n=$c.parse(e,{async:!1});return Vc(D,n,{},{},{},!0),t},getHTML:()=>D.getHTML(),getText:()=>D.getText(),getJSON:()=>D.getJSON()};R(t)}};let Z={bold:{element:(0,r.Z)(V,{onClick:j.bold},(0,r.Z)(o,null)),className:dt.colBtn,title:"bold"},underline:{element:(0,r.Z)(V,{onClick:j.underline},(0,r.Z)(h,null)),className:dt.colBtn,title:"underline"},italic:{element:(0,r.Z)(V,{onClick:j.italic},(0,r.Z)(p,null)),className:dt.colBtn,title:"italic"},strike:{element:(0,r.Z)(V,{onClick:j.strike},(0,r.Z)(u,null)),className:dt.colBtn,title:"strikeThrough",divider:!0},fontFamily:{element:(0,r.Z)("cdtr-font-family-editor",{light:!0,onChange:t=>{const e=t.target.value;j.fontFamily(e)}}),className:dt.dropdown,title:"fontFamily",divider:!0},fontSize:{element:(0,r.Z)(ft,{style:{fontSize:"13px",boxShadow:"none"},icon:(0,r.Z)(g,null),title:8,className:dt.dropdown},H.map((t=>(0,r.Z)(mt,{style:{fontSize:"13px"},onClick:()=>j.fontSize(t),className:dt.fontSizeItem,value:t+"px"},t,"px")))),className:dt.dropdown,title:"fontSize",divider:!0},left:{element:(0,r.Z)(V,{onClick:()=>j.textAlign("left")},(0,r.Z)(b,null)),className:dt.colBtn,title:"left"},center:{element:(0,r.Z)(V,{onClick:()=>j.textAlign("center")},(0,r.Z)(A,null)),className:dt.colBtn,title:"center"},right:{element:(0,r.Z)(V,{onClick:()=>j.textAlign("right")},(0,r.Z)(y,null)),className:dt.colBtn,title:"right"},justify:{element:(0,r.Z)(V,{onClick:()=>j.textAlign("justify")},(0,r.Z)(w,null)),className:dt.colBtn,title:"justify",divider:!0},direction:{element:(0,r.Z)(V,{onClick:j.direction},(0,r.Z)(a,null)),className:dt.colBtn,title:B.h.get("lang","direction"),divider:!0},fontColor:{element:(0,r.Z)("color-playground",{ref:{onCreate:t=>{t.hasAlpha=!1,t.type="text"}},onChange:t=>{j.forColor(t.target.value),rt({context:{"::selection":{background:"transparent"}},id:Wc}),Yc.run((()=>{document.getElementById(Wc).remove()}),1500)},className:"cdtr-plugin","data-color":!0}),className:dt.colBtn,title:"forecolor"},backcolor:{element:(0,r.Z)("color-playground",{type:"background",ref:{onCreate:t=>{t.hasAlpha=!1}},onChange:t=>{j.backColor(t.target.value),rt({context:{"::selection":{background:"transparent"}},id:Wc}),Yc.run((()=>{document.getElementById(Wc).remove()}),1500)},className:"cdtr-plugin","data-color":!0}),className:dt.colBtn,title:B.h.get("lang","backcolor"),endLine:!0},bullet:{element:(0,r.Z)(V,{onClick:j.bullets},(0,r.Z)(c,null)),className:dt.colBtn,title:"bullets"},numbered:{element:(0,r.Z)(V,{onClick:j.numbered},(0,r.Z)(d,null)),className:dt.colBtn,title:"numbered"},customList:{element:(0,r.Z)(V,{onClick:j.customList},(0,r.Z)(l,null)),className:dt.colBtn,title:"taskList_with_icons",divider:!0},link:{element:(0,r.Z)(V,{onClick:j.link},(0,r.Z)(f,null)),className:dt.colBtn,title:"link"},unLink:{element:(0,r.Z)(V,{onClick:j.unLink},(0,r.Z)(m,null)),className:dt.colBtn,divider:!0,title:"unLink"},emoji:{element:(0,r.Z)(V,{onClick:t=>{const e=(0,r.Z)("cdtr-emoji-picker",null);e.onEmojiClick=(t,e)=>{D.commands.insertContent(e.emoji),D.chain().focus(),n.close()};const n=(0,r.Z)(at,{target:t.target},e);document.body.appendChild(n)}},(0,r.Z)(x,{className:dt.colorBtn})),className:dt.colBtn,title:"emoji",divider:!0},image:{element:(0,r.Z)(V,{onClick:j.addImage},(0,r.Z)(_,{className:dt.colorBtn})),className:dt.colBtn,title:"image"},video:{element:(0,r.Z)(V,{onClick:j.setVideo},(0,r.Z)(v,{className:dt.colorBtn})),className:dt.colBtn,title:"video"},horizonRule:{element:(0,r.Z)(V,{onClick:j.setHorizonRule},(0,r.Z)(k,{className:dt.colorBtn})),className:dt.colBtn,title:"divider"},table:{element:(0,r.Z)(V,{onClick:j.addTable},(0,r.Z)(S,{className:dt.colorBtn})),className:dt.colBtn,title:"table",divider:!0},quotes:{element:(0,r.Z)(V,{onClick:j.setQuotes},(0,r.Z)(C,{className:dt.colorBtn})),className:dt.colBtn,title:"quotes",divider:!0},clearFormat:{element:(0,r.Z)(V,{onClick:j.clearFormat},(0,r.Z)(E,{className:dt.colorBtn})),className:dt.colBtn,title:"clearFormat",divider:!0},magic:{element:(0,r.Z)(V,{onClick:j.onClickMagic},(0,r.Z)(s,null)),className:dt.colBtn,title:"magic",divider:!0},mergeTags:{element:(0,r.Z)("cdtr-merge-tags",{onChange:t=>{D.commands.insertContent(t.target.value),D.chain().focus();const e=document.querySelector("cdtr-drop-modal");e?.remove()}}),title:"mergeTags",divider:!0}};const Y="editor";Y&&Y.textEditor&&Y.textEditor.cmds&&Array.isArray(Y.textEditor.cmds)&&Y.textEditor.cmds.forEach((t=>{const e="function"==typeof t.element?{element:t.element(),title:t.title,className:t.className||""}:{divider:t.divider};Z["extend-"+(0,F.Z)()]=e}));const W=(()=>{const t=[];for(const e in Z)if(Object.hasOwnProperty.call(Z,e)){if(T.find((t=>t.type===e))){const n=Z[e];n&&n.element&&(n.element.classList.add("cdtr-button-cmd"),n.element.classList.add(dt.btn),t.push(n)),n.endLine&&(t.push({endLine:!0}),delete n.endLine),n.divider&&(t.push({divider:!0}),delete n.divider)}}return t})(),q=t=>{let{editor:e}=t;for(const t in U)if(Object.hasOwnProperty.call(U,t)){(0,U[t])()}};return{component:new $({onLoad:()=>{D.off("selectionUpdate",q),D.off("transaction",q),D.on("selectionUpdate",q),D.on("transaction",q),window.removeEventListener("click",q),window.addEventListener("click",q),q({editor:D})},onUnload:()=>{},children:(0,r.Z)("cdtr-row",{style:{width:N||null},justify:"flex-start",alignItems:"center",className:O(dt.textEditor,"cdtr-plugin","cdtr-text-editor-plugin",dt.fadeUp)},W.map(((t,e)=>t.divider?(0,r.Z)("div",{className:dt.dividerY}):t.endLine?(0,r.Z)("cdtr-col",{sm:12}):(0,r.Z)("cdtr-col",{"tooltip-dir":"top",className:t.className},(0,r.Z)("cdtr-tooltip",{placement:"top",content:t.title,delay:"600,0"},t.element," ")," "))),(0,r.Z)("div",{className:dt.dividerX}))}),editor:D}};const Gc=function t(e){e&&e.firstChild&&(e.removeChild(e.firstChild),t(e))},Kc=t=>{const e=(0,r.Z)("div",{style:{zIndex:(0,nt.Z)()+3},className:O(dt.main,"no-select")}),n=t.container,i=t.target,o=t.editor,s=t.offsetTop,a=r=>{window.requestAnimationFrame((()=>{setTimeout((()=>{if(!n)return;const r=t.container,o=t.target?.getBoundingClientRect();if(!o)return void console.error("no block");const a=e.getBoundingClientRect(),l=i.getBoundingClientRect(),c=o.top+r.offsetTop-a.height;let d=l.left+(l.width-a.width)/2+"px";e.style.left=d,n&&r.offsetTop>c-60?(e.classList.contains(dt.withTransition)||e.classList.add(dt.withTransition),e.classList.contains(dt.sticky)||e.classList.add(dt.sticky)):(e.classList.remove(dt.withTransition),e.classList.remove(dt.sticky),e.style.top=Math.abs(o.top)-a.height-s+"px")}),0)}))},l=new $({onUpdate:()=>{if(n){e.appendChild(o),e.style.opacity=0,setTimeout((()=>{e.style.opacity=1}),50);const t=e.getBoundingClientRect(),r=n.getBoundingClientRect();e.style.top=Math.abs(r.top)-t.height+"px"}},onUnload:()=>{Gc(e),n.removeEventListener("scroll",a),document.removeEventListener("scroll",a)},children:e});return l.start=()=>{document.body.appendChild(l),n.addEventListener("scroll",a),window.addEventListener("scroll",a),a()},l};const Jc=new class{constructor(){(0,gt.Z)(this,"events",void 0),this.onDispatchEvent=this.onDispatchEvent.bind(this),this.events={click:[],mouseover:[],mousedown:[],mousemove:[],mouseup:[],keydown:[],keyup:[],scroll:[]}}onDispatchEvent(t){const e=t,n=this;Array.isArray(n.events[t.type])&&requestAnimationFrame((()=>n.events[t.type].forEach(((r,i)=>{"function"==typeof r?r(e):n.events[t.type].splice(i,1)}))))}destroy(){}connect(t,e){const n=this;if(!n.events[t])return void console.error("Can't use this event name",t);0===n.events[t].length&&window.addEventListener(t,this.onDispatchEvent,!1);n.events[t].findIndex((t=>t===e))>-1?console.warn("The event has already been subscribed."):n.events[t].push(e)}disconnect(t,e){const n=this;if(!n.events[t])return void console.error("Can't remove event name",t);0===n.events[t].length&&window.removeEventListener(t,this.onDispatchEvent);const r=n.events[t].findIndex((t=>t===e));r>-1&&Array.from(n.events[t]).splice(r,1)}};Jc.connect("mousemove",(t=>{B.h.set({mouse:{y:t.pageY,x:t.pageX}})}));const Qc=Jc;const td=new class{constructor(){this.selectedRows=[],this.connected=!1,this.onExecute=(t,e)=>{},this.connect=this.connect.bind(this),this.node=(0,r.Z)("cdtr-table-editor",{onChange:this.onExecute}),this.render=this.render.bind(this),Qc.connect("keydown",this.render),Qc.connect("scroll",this.render)}disconnect(){this.connected=!1,this.node.remove()}connect(t,e){this.connected=!0,this.target=t,this.editor=e,this.render()}render(){if(this.connected&&this.target){const t=this.target.getBoundingClientRect();let e=t.top+t.height+5;e+43>window.innerHeight&&(e=window.innerHeight-43),e<t.top&&(e=t.top),this.node.setAttribute("top",e),this.node.setAttribute("left",t.left),this.node.setAttribute("width",t.width),this.node.setAttribute("height",t.height),document.body.appendChild(this.node),this.selectedRows=Array.from(this.target.querySelectorAll(".selectedCell")),this.node.setAttribute("selectedRows",this.selectedRows.length)}}},ed=td;class nd extends bt.oi{constructor(){super(),this.className="cdtr-button-cmd",this.cmds={tdColor:t=>{td.editor.commands.updateAttributes("tableCell",{borderColor:t.target.value})},toggleHeaderColumn:()=>td.editor.chain().focus().toggleHeaderColumn().run(),toggleHeaderCell:()=>td.editor.chain().focus().toggleHeaderCell().run(),mergeOrSplit:()=>td.editor.chain().focus().mergeOrSplit().run(),addRowAfter:()=>td.editor.chain().focus().addRowAfter().run(),addRowBefore:()=>td.editor.chain().focus().addRowBefore().run(),addColumnBefore:()=>td.editor.chain().focus().addColumnBefore().run(),addColumnAfter:()=>td.editor.chain().focus().addColumnAfter().run(),deleteColumn:()=>td.editor.chain().focus().deleteColumn().run(),deleteRow:()=>td.editor.chain().focus().deleteRow().run(),splitCell:()=>td.editor.chain().focus().splitCell().run(),deleteTable:()=>td.editor.chain().focus().deleteTable().run(),mergeCells:()=>td.editor.chain().focus().mergeCells().run(),setWidth:()=>{td.editor.commands.updateAttributes("table",{width:"300px"})}}}render(){return bt.dy`<div
|
|
1730
|
+
`),customElements.get("cdtr-table-cells-editor")||customElements.define("cdtr-table-cells-editor",yt);var At=n(88573),wt=n(27191),vt=n(64652);const _t=At.hj.create({name:"smilieReplacer",addInputRules:()=>[(0,At.DS)({find:/-___- $/,replace:"😑 "}),(0,At.DS)({find:/:'-\) $/,replace:"😂 "}),(0,At.DS)({find:/':-\) $/,replace:"😅 "}),(0,At.DS)({find:/':-D $/,replace:"😅 "}),(0,At.DS)({find:/>:-\) $/,replace:"😆 "}),(0,At.DS)({find:/-__- $/,replace:"😑 "}),(0,At.DS)({find:/':-\( $/,replace:"😓 "}),(0,At.DS)({find:/:'-\( $/,replace:"😢 "}),(0,At.DS)({find:/>:-\( $/,replace:"😠 "}),(0,At.DS)({find:/O:-\) $/,replace:"😇 "}),(0,At.DS)({find:/0:-3 $/,replace:"😇 "}),(0,At.DS)({find:/0:-\) $/,replace:"😇 "}),(0,At.DS)({find:/0;\^\) $/,replace:"😇 "}),(0,At.DS)({find:/O;-\) $/,replace:"😇 "}),(0,At.DS)({find:/0;-\) $/,replace:"😇 "}),(0,At.DS)({find:/O:-3 $/,replace:"😇 "}),(0,At.DS)({find:/:'\) $/,replace:"😂 "}),(0,At.DS)({find:/:-D $/,replace:"😃 "}),(0,At.DS)({find:/':\) $/,replace:"😅 "}),(0,At.DS)({find:/'=\) $/,replace:"😅 "}),(0,At.DS)({find:/':D $/,replace:"😅 "}),(0,At.DS)({find:/'=D $/,replace:"😅 "}),(0,At.DS)({find:/>:\) $/,replace:"😆 "}),(0,At.DS)({find:/>;\) $/,replace:"😆 "}),(0,At.DS)({find:/>=\) $/,replace:"😆 "}),(0,At.DS)({find:/;-\) $/,replace:"😉 "}),(0,At.DS)({find:/\*-\) $/,replace:"😉 "}),(0,At.DS)({find:/;-\] $/,replace:"😉 "}),(0,At.DS)({find:/;\^\) $/,replace:"😉 "}),(0,At.DS)({find:/B-\) $/,replace:"😎 "}),(0,At.DS)({find:/8-\) $/,replace:"😎 "}),(0,At.DS)({find:/B-D $/,replace:"😎 "}),(0,At.DS)({find:/8-D $/,replace:"😎 "}),(0,At.DS)({find:/:-\* $/,replace:"😘 "}),(0,At.DS)({find:/:\^\* $/,replace:"😘 "}),(0,At.DS)({find:/:-\) $/,replace:"🙂 "}),(0,At.DS)({find:/-_- $/,replace:"😑 "}),(0,At.DS)({find:/:-X $/,replace:"😶 "}),(0,At.DS)({find:/:-# $/,replace:"😶 "}),(0,At.DS)({find:/:-x $/,replace:"😶 "}),(0,At.DS)({find:/>.< $/,replace:"😣 "}),(0,At.DS)({find:/:-O $/,replace:"😮 "}),(0,At.DS)({find:/:-o $/,replace:"😮 "}),(0,At.DS)({find:/O_O $/,replace:"😮 "}),(0,At.DS)({find:/>:O $/,replace:"😮 "}),(0,At.DS)({find:/:-P $/,replace:"😛 "}),(0,At.DS)({find:/:-p $/,replace:"😛 "}),(0,At.DS)({find:/:-Þ $/,replace:"😛 "}),(0,At.DS)({find:/:-þ $/,replace:"😛 "}),(0,At.DS)({find:/:-b $/,replace:"😛 "}),(0,At.DS)({find:/>:P $/,replace:"😜 "}),(0,At.DS)({find:/X-P $/,replace:"😜 "}),(0,At.DS)({find:/x-p $/,replace:"😜 "}),(0,At.DS)({find:/':\( $/,replace:"😓 "}),(0,At.DS)({find:/'=\( $/,replace:"😓 "}),(0,At.DS)({find:/>:\\ $/,replace:"😕 "}),(0,At.DS)({find:/>:\/ $/,replace:"😕 "}),(0,At.DS)({find:/:-\/ $/,replace:"😕 "}),(0,At.DS)({find:/:-. $/,replace:"😕 "}),(0,At.DS)({find:/>:\[ $/,replace:"😞 "}),(0,At.DS)({find:/:-\( $/,replace:"😞 "}),(0,At.DS)({find:/:-\[ $/,replace:"😞 "}),(0,At.DS)({find:/:'\( $/,replace:"😢 "}),(0,At.DS)({find:/;-\( $/,replace:"😢 "}),(0,At.DS)({find:/#-\) $/,replace:"😵 "}),(0,At.DS)({find:/%-\) $/,replace:"😵 "}),(0,At.DS)({find:/X-\) $/,replace:"😵 "}),(0,At.DS)({find:/>:\( $/,replace:"😠 "}),(0,At.DS)({find:/0:3 $/,replace:"😇 "}),(0,At.DS)({find:/0:\) $/,replace:"😇 "}),(0,At.DS)({find:/O:\) $/,replace:"😇 "}),(0,At.DS)({find:/O=\) $/,replace:"😇 "}),(0,At.DS)({find:/O:3 $/,replace:"😇 "}),(0,At.DS)({find:/<\/3 $/,replace:"💔 "}),(0,At.DS)({find:/:D $/,replace:"😃 "}),(0,At.DS)({find:/=D $/,replace:"😃 "}),(0,At.DS)({find:/;\) $/,replace:"😉 "}),(0,At.DS)({find:/\*\) $/,replace:"😉 "}),(0,At.DS)({find:/;\] $/,replace:"😉 "}),(0,At.DS)({find:/;D $/,replace:"😉 "}),(0,At.DS)({find:/B\) $/,replace:"😎 "}),(0,At.DS)({find:/8\) $/,replace:"😎 "}),(0,At.DS)({find:/:\* $/,replace:"😘 "}),(0,At.DS)({find:/=\* $/,replace:"😘 "}),(0,At.DS)({find:/:\) $/,replace:"🙂 "}),(0,At.DS)({find:/=\] $/,replace:"🙂 "}),(0,At.DS)({find:/:\] $/,replace:"🙂 "}),(0,At.DS)({find:/:X $/,replace:"😶 "}),(0,At.DS)({find:/:# $/,replace:"😶 "}),(0,At.DS)({find:/=X $/,replace:"😶 "}),(0,At.DS)({find:/=x $/,replace:"😶 "}),(0,At.DS)({find:/:x $/,replace:"😶 "}),(0,At.DS)({find:/=# $/,replace:"😶 "}),(0,At.DS)({find:/:O $/,replace:"😮 "}),(0,At.DS)({find:/:o $/,replace:"😮 "}),(0,At.DS)({find:/:P $/,replace:"😛 "}),(0,At.DS)({find:/=P $/,replace:"😛 "}),(0,At.DS)({find:/:p $/,replace:"😛 "}),(0,At.DS)({find:/=p $/,replace:"😛 "}),(0,At.DS)({find:/:Þ $/,replace:"😛 "}),(0,At.DS)({find:/:þ $/,replace:"😛 "}),(0,At.DS)({find:/:b $/,replace:"😛 "}),(0,At.DS)({find:/d: $/,replace:"😛 "}),(0,At.DS)({find:/:\/ $/,replace:"😕 "}),(0,At.DS)({find:/:\\ $/,replace:"😕 "}),(0,At.DS)({find:/=\/ $/,replace:"😕 "}),(0,At.DS)({find:/=\\ $/,replace:"😕 "}),(0,At.DS)({find:/:L $/,replace:"😕 "}),(0,At.DS)({find:/=L $/,replace:"😕 "}),(0,At.DS)({find:/:\( $/,replace:"😞 "}),(0,At.DS)({find:/:\[ $/,replace:"😞 "}),(0,At.DS)({find:/=\( $/,replace:"😞 "}),(0,At.DS)({find:/;\( $/,replace:"😢 "}),(0,At.DS)({find:/D: $/,replace:"😨 "}),(0,At.DS)({find:/:\$ $/,replace:"😳 "}),(0,At.DS)({find:/=\$ $/,replace:"😳 "}),(0,At.DS)({find:/#\) $/,replace:"😵 "}),(0,At.DS)({find:/%\) $/,replace:"😵 "}),(0,At.DS)({find:/X\) $/,replace:"😵 "}),(0,At.DS)({find:/:@ $/,replace:"😠 "}),(0,At.DS)({find:/=\) $/,replace:"🙂 "}),(0,At.DS)({find:/<3 $/,replace:"❤️ "}),(0,At.DS)({find:/ש”ח $/,replace:"₪ "}),(0,At.DS)({find:/ש״ח $/,replace:"₪ "}),(0,At.DS)({find:/ש"ח $/,replace:"₪ "})]});var xt=n(52780);const kt=function(t){const e=/(#[0-9a-f]{3,6})\b/gi,n=[];return t.descendants(((t,r)=>{t.text&&Array.from(t.text.matchAll(e)).forEach((t=>{const e=t[0],i=t.index||0,o=r+i,s=o+e.length,a=xt.p.inline(o,s,{class:"color",style:`--color: ${e}`});n.push(a)}))})),xt.EH.create(t,n)},Ct=At.hj.create({name:"colorHighlighter",addProseMirrorPlugins:()=>[new wt.Sy({state:{init(t,e){let{doc:n}=e;return kt(n)},apply:(t,e)=>t.docChanged?kt(t.doc):e},props:{decorations(t){return this.getState(t)}}})]}),Et=At.vc.create({name:"textStyle",priority:101,addOptions:()=>({HTMLAttributes:{},mergeNestedSpanStyles:!1}),parseHTML(){return[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&(this.options.mergeNestedSpanStyles&&(t=>{if(!t.children.length)return;const e=t.querySelectorAll("span");e&&e.forEach((t=>{var e,n;const r=t.getAttribute("style"),i=null===(n=null===(e=t.parentElement)||void 0===e?void 0:e.closest("span"))||void 0===n?void 0:n.getAttribute("style");t.setAttribute("style",`${i};${r}`)}))})(t),{})}]},renderHTML({HTMLAttributes:t}){return["span",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{removeEmptyTextStyle:()=>({tr:t})=>{const{selection:e}=t;return t.doc.nodesBetween(e.from,e.to,((e,n)=>{if(e.isTextblock)return!0;e.marks.filter((t=>t.type===this.type)).some((t=>Object.values(t.attrs).some((t=>!!t))))||t.removeMark(n,n+e.nodeSize,this.type)})),!0}}}}),St=At.hj.create({name:"fontSize",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontSize:{default:null,parseHTML:t=>{if(t.style&&t.style.fontSize)return t.style.fontSize.replace(/['"]+/g,"");const e=window.getComputedStyle(t);return e&&e.fontSize?e.fontSize.replace(/['"]+/g,""):t.dataset&&t.dataset.fontSize?t.dataset.fontSize.replace(/['"]+/g,""):null},renderHTML:t=>t.fontSize?{style:`font-size: ${t.fontSize}`}:{}}}}]},addCommands:()=>({setFontSize:t=>e=>{let{chain:n}=e;return n().setMark("textStyle",{fontSize:t+"px"}).run()},unsetFontSize:()=>t=>{let{chain:e}=t;return e().setMark("textStyle",{fontSize:null}).removeEmptyTextStyle().run()}}),addKeyboardShortcuts(){return{"Mod-]":()=>{let t=parseInt(this.editor.getAttributes("textStyle").fontSize);t||(t=16),this.editor.commands.setFontSize(t+1)},"Mod-[":()=>{let t=parseInt(this.editor.getAttributes("textStyle").fontSize);t||(t=16),this.editor.commands.setFontSize(t-1)}}}});var Bt=n(42626);const Ot=At.NB.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((t=>({tag:`h${t}`,attrs:{level:t}})))},renderHTML(t){let{node:e,HTMLAttributes:n}=t;const r=this.options.levels.includes(e.attrs.level)?e.attrs.level:this.options.levels[0],i=document.createElement(`h${r}`);return i.style.cssText=n.style,i.style.fontFamily||(i.style.fontFamily="Arial, Helvetica, sans-serif"),n.style=i.style.cssText,[`h${r}`,(0,At.P1)(this.options.HTMLAttributes,n),0]},addCommands(){return{setHeading:t=>e=>{let{commands:n}=e;return!!this.options.levels.includes(t.level)&&n.setNode(this.name,t)},toggleHeading:t=>e=>{let{commands:n}=e;return!!this.options.levels.includes(t.level)&&n.toggleNode(this.name,"paragraph",t)}}},addKeyboardShortcuts(){return this.options.levels.reduce(((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})})),{})},addInputRules(){return this.options.levels.map((t=>(0,At.zK)({find:new RegExp(`^(#{1,${t}})\\s$`),type:this.type,getAttributes:{level:t}})))}});var $t=n(39615);const Mt=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,It=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))/g,Tt=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,Lt=/(?:^|\s)((?:__)((?:[^__]+))(?:__))/g,Nt=At.vc.create({name:"bold",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"strong"},{tag:"b",getAttrs:t=>"normal"!==t.style.fontWeight&&null},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}],renderHTML({HTMLAttributes:t}){return["strong",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[(0,At.Cf)({find:Mt,type:this.type}),(0,At.Cf)({find:Tt,type:this.type})]},addPasteRules(){return[(0,At.K9)({find:It,type:this.type}),(0,At.K9)({find:Lt,type:this.type})]}}),Rt=At.vc.create({name:"underline",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("underline")&&{}}],renderHTML({HTMLAttributes:t}){return["u",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),Pt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,Dt=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,zt=At.vc.create({name:"strike",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>!!t.includes("line-through")&&{}}],renderHTML({HTMLAttributes:t}){return["s",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[(0,At.Cf)({find:Pt,type:this.type})]},addPasteRules(){return[(0,At.K9)({find:Dt,type:this.type})]}}),Ht=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Ut=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,jt=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Zt=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Ft=At.vc.create({name:"italic",addOptions:()=>({HTMLAttributes:{}}),parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>"normal"!==t.style.fontStyle&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[(0,At.Cf)({find:Ht,type:this.type}),(0,At.Cf)({find:jt,type:this.type})]},addPasteRules(){return[(0,At.K9)({find:Ut,type:this.type}),(0,At.K9)({find:Zt,type:this.type})]}}),Vt=At.hj.create({name:"color",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{color:{default:null,parseHTML:t=>{var e;return null===(e=t.style.color)||void 0===e?void 0:e.replace(/['"]+/g,"")},renderHTML:t=>t.color?{style:`color: ${t.color}`}:{}}}}]},addCommands:()=>({setColor:t=>({chain:e})=>e().setMark("textStyle",{color:t}).run(),unsetColor:()=>({chain:t})=>t().setMark("textStyle",{color:null}).removeEmptyTextStyle().run()})}),Yt=At.NB.create({name:"listItem",addOptions:()=>({HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML({HTMLAttributes:t}){return["li",(0,At.P1)(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)}}}),Wt=At.hj.create({name:"placeholder",addOptions:()=>({emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something …",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}),addProseMirrorPlugins(){return[new wt.Sy({key:new wt.H$("placeholder"),props:{decorations:({doc:t,selection:e})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!n)return null;const o=this.editor.isEmpty;return t.descendants(((t,e)=>{const n=r>=e&&r<=e+t.nodeSize,s=!t.isLeaf&&(0,At.bR)(t);if((n||!this.options.showOnlyCurrent)&&s){const r=[this.options.emptyNodeClass];o&&r.push(this.options.emptyEditorClass);const s=xt.p.node(e,e+t.nodeSize,{class:r.join(" "),"data-placeholder":"function"==typeof this.options.placeholder?this.options.placeholder({editor:this.editor,node:t,pos:e,hasAnchor:n}):this.options.placeholder});i.push(s)}return this.options.includeChildren})),xt.EH.create(t,i)}}})]}});var qt=n(26151);function Xt(t={}){return new wt.Sy({view:e=>new Gt(e,t)})}class Gt{constructor(t,e){var n;this.editorView=t,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=null!==(n=e.width)&&void 0!==n?n:1,this.color=!1===e.color?void 0:e.color||"black",this.class=e.class,this.handlers=["dragover","dragend","drop","dragleave"].map((e=>{let n=t=>{this[e](t)};return t.dom.addEventListener(e,n),{name:e,handler:n}}))}destroy(){this.handlers.forEach((({name:t,handler:e})=>this.editorView.dom.removeEventListener(t,e)))}update(t,e){null!=this.cursorPos&&e.doc!=t.state.doc&&(this.cursorPos>t.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(t){t!=this.cursorPos&&(this.cursorPos=t,null==t?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let t,e=this.editorView.state.doc.resolve(this.cursorPos),n=!e.parent.inlineContent,r=this.editorView.dom,i=r.getBoundingClientRect(),o=i.width/r.offsetWidth,s=i.height/r.offsetHeight;if(n){let n=e.nodeBefore,r=e.nodeAfter;if(n||r){let e=this.editorView.nodeDOM(this.cursorPos-(n?n.nodeSize:0));if(e){let i=e.getBoundingClientRect(),o=n?i.bottom:i.top;n&&r&&(o=(o+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let a=this.width/2*s;t={left:i.left,right:i.right,top:o-a,bottom:o+a}}}}if(!t){let e=this.editorView.coordsAtPos(this.cursorPos),n=this.width/2*o;t={left:e.left-n,right:e.left+n,top:e.top,bottom:e.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 t=c.getBoundingClientRect(),e=t.width/c.offsetWidth,n=t.height/c.offsetHeight;a=t.left-c.scrollLeft*e,l=t.top-c.scrollTop*n}this.element.style.left=(t.left-a)/o+"px",this.element.style.top=(t.top-l)/s+"px",this.element.style.width=(t.right-t.left)/o+"px",this.element.style.height=(t.bottom-t.top)/s+"px"}scheduleRemoval(t){clearTimeout(this.timeout),this.timeout=setTimeout((()=>this.setCursor(null)),t)}dragover(t){if(!this.editorView.editable)return;let e=this.editorView.posAtCoords({left:t.clientX,top:t.clientY}),n=e&&e.inside>=0&&this.editorView.state.doc.nodeAt(e.inside),r=n&&n.type.spec.disableDropCursor,i="function"==typeof r?r(this.editorView,e,t):r;if(e&&!i){let t=e.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let e=(0,qt.nj)(this.editorView.state.doc,t,this.editorView.dragging.slice);null!=e&&(t=e)}this.setCursor(t),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(t){this.editorView.dom.contains(t.relatedTarget)||this.setCursor(null)}}const Kt=At.hj.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:void 0}),addProseMirrorPlugins(){return[Xt(this.options)]}}),Jt=At.hj.create({name:"direction",addOptions:()=>({types:[],directions:["rtl","ltr"],defaultDirection:"ltr"}),addGlobalAttributes(t){return[{types:this.options.types,attributes:{direction:{default:this.options.defaultDirection,parseHTML:t=>t.style.direction||this.options.defaultDirection,renderHTML:t=>({style:`direction: ${t.direction||this.options.defaultDirection}`})}}}]},addCommands(){return{setDirection:t=>e=>{let{commands:n}=e;return!!this.options.directions.includes(t)&&this.options.types.every((e=>n.updateAttributes(e,{direction:t})))},unsetDirection:()=>t=>{let{commands:e}=t;return this.options.types.every((t=>e.resetAttributes(t,"direction")))}}}}),Qt=At.hj.create({name:"lineHeight",addOptions:()=>({types:[],lineHeight:"1.4",defaultLineHeight:"1.4"}),addGlobalAttributes(){return[{types:this.options.types,attributes:{lineHeight:{default:this.options.defaultLineHeight,parseHTML:t=>t.style.lineHeight||this.options.defaultLineHeight,renderHTML:t=>({style:`line-height: ${t.lineHeight||this.options.defaultLineHeight}`})}}}]},addCommands(){return{setLineHeight:t=>e=>{let{commands:n}=e;return this.options.types.every((e=>n.updateAttributes(e,{lineHeight:t})))},unsetLineHeight:()=>t=>{let{commands:e}=t;return this.options.types.every((t=>e.resetAttributes(t,"lineHeight")))}}}}),te=At.hj.create({name:"letterSpacing",addOptions:()=>({types:[],letterSpacing:"",defaultLetterSpacing:""}),addGlobalAttributes(){return[{types:this.options.types,attributes:{letterSpacing:{default:this.options.defaultLetterSpacing,parseHTML:t=>t.style.letterSpacing||this.options.defaultLetterSpacing,renderHTML:t=>({style:`letter-spacing: ${t.letterSpacing||this.options.defaultLetterSpacing}`})}}}]},addCommands(){return{setLetterSpacing:t=>e=>{let{commands:n}=e;return this.options.types.every((e=>n.updateAttributes(e,{letterSpacing:t})))},unsetLetterSpacing:()=>t=>{let{commands:e}=t;return this.options.types.every((t=>e.resetAttributes(t,"letterSpacing")))}}}}),ee="textStyle",ne=/^(\d+)\.\s$/,re=At.NB.create({name:"orderedList",addOptions:()=>({itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}),group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes:()=>({start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}),parseHTML:()=>[{tag:"ol"}],renderHTML({HTMLAttributes:t}){const{start:e,...n}=t;return 1===e?["ol",(0,At.P1)(this.options.HTMLAttributes,n),0]:["ol",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes("listItem",this.editor.getAttributes(ee)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=(0,At.S0)({find:ne,type:this.type,getAttributes:t=>({start:+t[1]}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,At.S0)({find:ne,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:t=>({start:+t[1],...this.editor.getAttributes(ee)}),joinPredicate:(t,e)=>e.childCount+e.attrs.start===+t[1],editor:this.editor})),[t]}}),ie="customBulletItem";function oe(t){let{width:e=24,height:n=24,fill:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||!t.startsWith("http"))return t;try{const i=new URL(t);return i.searchParams.set("width",String(e)),i.searchParams.set("height",String(n)),r&&i.searchParams.set("color",String(r).replace("#","")),i.toString()}catch{return t}}const se=At.NB.create({name:ie,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:t=>t.width},height:{default:24,parseHTML:t=>t.height},mt:{default:0,parseHTML:t=>t.style.marginTop},fill:{default:"#000",parseHTML:t=>t.style.fill}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML(t){let{node:e,HTMLAttributes:n}=t;return["li",(0,At.P1)(this.options.HTMLAttributes,n,{"data-type":this.name}),["div",["svg"],["span"]],["div",0]]},addCommands(){const t=(t,e)=>{const n={...e},r=t.selection.$from;for(let t=r.depth;t>0;t--){const i=r.node(t);if(i.type.name===ie){Object.assign(n,i.attrs,e);break}}return n.svgIcon?.startsWith("http")&&(n.svgIcon=oe(n.svgIcon,{width:n.width??24,height:n.height??24,fill:n.fill})),n};return{setCustomBulletIcon:e=>n=>{let{commands:r,state:i}=n;return r.updateAttributes(ie,t(i,e)),!0},setCustomBulletStyles:e=>n=>{let{commands:r,state:i}=n;return r.updateAttributes(ie,t(i,e)),!0}}},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return t=>{let{HTMLAttributes:e}=t,n=e.svgIcon;if(n=n.replace(/</g,"<"),-1!==n.indexOf("<svg")){delete e.svgIcon;const t=document.createElement("li");t.classList.add("custom-bullet-item");const r=document.createElement("div");r.innerHTML=n;const i=document.createElement("div"),o=r.firstElementChild;return o.style.width=e.width,o.style.height=e.width,o.style.fill=e.fill,o.style.marginTop=e.mt,Object.entries(this.options.HTMLAttributes).forEach((e=>{let[n,r]=e;t.setAttribute(n,r)})),t.append(r,i),Object.entries(e).forEach((e=>{let[n,r]=e;t.setAttribute(n,r)})),{dom:t,contentDOM:i}}if(n.startsWith("http")){const t=oe(n,{width:e.width??24,height:e.height??24,fill:e.fill});delete e.svgIcon;const r=document.createElement("li");r.classList.add("custom-bullet-item");const i=document.createElement("div");i.innerHTML=`<img src="${t}" height="auto" style="margin-top:${e.mt||"auto"}" width="${e.width}"\n />`;const o=document.createElement("div");i.firstElementChild;return Object.entries(this.options.HTMLAttributes).forEach((t=>{let[e,n]=t;r.setAttribute(e,n)})),r.append(i,o),Object.entries(e).forEach((t=>{let[e,n]=t;r.setAttribute(e,n)})),{dom:r,contentDOM:o}}{delete e.svgIcon;const t=document.createElement("li");t.classList.add("custom-bullet-item");const r=document.createElement("div");r.innerHTML=`<svg fill="${e.fill}" width="${e.width}"\n height="${e.width}"\n xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">${n}</svg>`;const i=document.createElement("div"),o=r.firstElementChild;return o.style.width=e.width,o.style.height=e.width,o.style.marginTop=e.mt,o.style.fill=e.fill,Object.entries(this.options.HTMLAttributes).forEach((e=>{let[n,r]=e;t.setAttribute(n,r)})),t.append(r,i),Object.entries(e).forEach((e=>{let[n,r]=e;t.setAttribute(n,r)})),{dom:t,contentDOM:i}}}}}),ae=At.NB.create({name:"customBulletList",addOptions:()=>({itemTypeName:ie,HTMLAttributes:{}}),group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML(t){let{HTMLAttributes:e}=t;return["ul",(0,At.P1)(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addCommands(){return{toggleCustomList:()=>t=>{let{commands:e}=t;return e.toggleList(this.name,this.options.itemTypeName)}}},addKeyboardShortcuts(){return{"Mod-Shift-6":()=>this.editor.commands.toggleCustomList()}}}),le=At.NB.create({name:"hardBreak",addOptions:()=>({keepMarks:!0,HTMLAttributes:{}}),inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML:()=>[{tag:"br"}],renderHTML({HTMLAttributes:t}){return["br",(0,At.P1)(this.options.HTMLAttributes,t)]},renderText:()=>"\n",addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:n,editor:r})=>t.first([()=>t.exitCode(),()=>t.command((()=>{const{selection:t,storedMarks:i}=n;if(t.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:s}=r.extensionManager,a=i||t.$to.parentOffset&&t.$from.marks();return e().insertContent({type:this.name}).command((({tr:t,dispatch:e})=>{if(e&&a&&o){const e=a.filter((t=>s.includes(t.type.name)));t.ensureMarks(e)}return!0})).run()}))])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),ce=/^\s*(\[([ |x])\])\s$/,de=(At.NB.create({name:"taskItem",addOptions:()=>({nested:!1,HTMLAttributes:{}}),content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes:()=>({checked:{default:!1,keepOnSplit:!1,parseHTML:t=>"true"===t.getAttribute("data-checked"),renderHTML:t=>({"data-checked":t.checked})}}),parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML(t){let{node:e,HTMLAttributes:n}=t;return["li",(0,At.P1)(this.options.HTMLAttributes,n,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:e.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return t=>{let{node:e,HTMLAttributes:n,getPos:r,editor:i}=t;const o=document.createElement("li"),s=document.createElement("label"),a=document.createElement("span"),l=document.createElement("input");o.style.display="flex",o.style.alignItems="center",l.style.width="50px";const c=document.createElement("div");return s.contentEditable="false",l.type="checkbox",l.addEventListener("change",(t=>{if(!i.isEditable)return void(l.checked=!l.checked);const{checked:e}=t.target;i.isEditable&&"function"==typeof r&&i.chain().focus(void 0,{scrollIntoView:!1}).command((t=>{let{tr:n}=t;const i=r(),o=n.doc.nodeAt(i);return n.setNodeMarkup(i,void 0,{...o?.attrs,checked:e}),!0})).run()})),Object.entries(this.options.HTMLAttributes).forEach((t=>{let[e,n]=t;o.setAttribute(e,n)})),o.dataset.checked=e.attrs.checked,e.attrs.checked&&l.setAttribute("checked","checked"),s.append(l,a),o.append(s,c),Object.entries(n).forEach((t=>{let[e,n]=t;o.setAttribute(e,n)})),{dom:o,contentDOM:c,update:t=>t.type===this.type&&(o.dataset.checked=t.attrs.checked,t.attrs.checked?l.setAttribute("checked","checked"):l.removeAttribute("checked"),!0)}}},addInputRules(){return[(0,At.S0)({find:ce,type:this.type,getAttributes:t=>({checked:"x"===t[t.length-1]})})]}}),At.NB.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(t){let{HTMLAttributes:e}=t;return["ul",(0,At.P1)(this.options.HTMLAttributes,e,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>t=>{let{commands:e}=t;return e.toggleList(this.name,this.options.itemTypeName)}}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),/^\s*>\s$/),pe=At.NB.create({name:"blockquote",addOptions:()=>({HTMLAttributes:{}}),content:"block+",group:"block",defining:!0,parseHTML:()=>[{tag:"blockquote"}],renderHTML({HTMLAttributes:t}){return["blockquote",(0,At.P1)(this.options.HTMLAttributes,t),0]},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[(0,At.S0)({find:de,type:this.type})]}}),he=/^```([a-z]+)?[\s\n]$/,ue=/^~~~([a-z]+)?[\s\n]$/,fe=At.NB.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:t=>{var e;const{languageClassPrefix:n}=this.options,r=[...(null===(e=t.firstElementChild)||void 0===e?void 0:e.classList)||[]].filter((t=>t.startsWith(n))).map((t=>t.replace(n,"")))[0];return r||null},rendered:!1}}},parseHTML:()=>[{tag:"pre",preserveWhitespace:"full"}],renderHTML({node:t,HTMLAttributes:e}){return["pre",(0,At.P1)(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,n=1===e.pos;return!(!t||e.parent.type.name!==this.name)&&(!(!n&&e.parent.textContent.length)&&this.editor.commands.clearNodes())},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:n}=e,{$from:r,empty:i}=n;if(!i||r.parent.type!==this.type)return!1;const o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith("\n\n");return!(!o||!s)&&t.chain().command((({tr:t})=>(t.delete(r.pos-2,r.pos),!0))).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:n,doc:r}=e,{$from:i,empty:o}=n;if(!o||i.parent.type!==this.type)return!1;if(!(i.parentOffset===i.parent.nodeSize-2))return!1;const s=i.after();if(void 0===s)return!1;return r.nodeAt(s)?t.commands.command((({tr:t})=>(t.setSelection(wt.Y1.near(r.resolve(s))),!0))):t.commands.exitCode()}}},addInputRules(){return[(0,At.zK)({find:he,type:this.type,getAttributes:t=>({language:t[1]})}),(0,At.zK)({find:ue,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new wt.Sy({key:new wt.H$("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData)return!1;if(this.editor.isActive(this.type.name))return!1;const n=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=null==i?void 0:i.mode;if(!n||!o)return!1;const{tr:s,schema:a}=t.state,l=a.text(n.replace(/\r\n?/g,"\n"));return s.replaceSelectionWith(this.type.create({language:o},l)),s.selection.$from.parent.type!==this.type&&s.setSelection(wt.Bs.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),t.dispatch(s),!0}}})]}});function me(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function ge(t){return t instanceof Map?t.clear=t.delete=t.set=function(){throw new Error("map is read-only")}:t instanceof Set&&(t.add=t.clear=t.delete=function(){throw new Error("set is read-only")}),Object.freeze(t),Object.getOwnPropertyNames(t).forEach((e=>{const n=t[e],r=typeof n;"object"!==r&&"function"!==r||Object.isFrozen(n)||ge(n)})),t}class be{constructor(t){void 0===t.data&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function ye(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ae(t,...e){const n=Object.create(null);for(const e in t)n[e]=t[e];return e.forEach((function(t){for(const e in t)n[e]=t[e]})),n}const we=t=>!!t.scope;class ve{constructor(t,e){this.buffer="",this.classPrefix=e.classPrefix,t.walk(this)}addText(t){this.buffer+=ye(t)}openNode(t){if(!we(t))return;const e=((t,{prefix:e})=>{if(t.startsWith("language:"))return t.replace("language:","language-");if(t.includes(".")){const n=t.split(".");return[`${e}${n.shift()}`,...n.map(((t,e)=>`${t}${"_".repeat(e+1)}`))].join(" ")}return`${e}${t}`})(t.scope,{prefix:this.classPrefix});this.span(e)}closeNode(t){we(t)&&(this.buffer+="</span>")}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const _e=(t={})=>{const e={children:[]};return Object.assign(e,t),e};class xe{constructor(){this.rootNode=_e(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const e=_e({scope:t});this.add(e),this.stack.push(e)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,e){return"string"==typeof e?t.addText(e):e.children&&(t.openNode(e),e.children.forEach((e=>this._walk(t,e))),t.closeNode(e)),t}static _collapse(t){"string"!=typeof t&&t.children&&(t.children.every((t=>"string"==typeof t))?t.children=[t.children.join("")]:t.children.forEach((t=>{xe._collapse(t)})))}}class ke extends xe{constructor(t){super(),this.options=t}addText(t){""!==t&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,e){const n=t.root;e&&(n.scope=`language:${e}`),this.add(n)}toHTML(){return new ve(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Ce(t){return t?"string"==typeof t?t:t.source:null}function Ee(t){return Oe("(?=",t,")")}function Se(t){return Oe("(?:",t,")*")}function Be(t){return Oe("(?:",t,")?")}function Oe(...t){return t.map((t=>Ce(t))).join("")}function $e(...t){const e=function(t){const e=t[t.length-1];return"object"==typeof e&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}(t);return"("+(e.capture?"":"?:")+t.map((t=>Ce(t))).join("|")+")"}function Me(t){return new RegExp(t.toString()+"|").exec("").length-1}const Ie=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Te(t,{joinWith:e}){let n=0;return t.map((t=>{n+=1;const e=n;let r=Ce(t),i="";for(;r.length>0;){const t=Ie.exec(r);if(!t){i+=r;break}i+=r.substring(0,t.index),r=r.substring(t.index+t[0].length),"\\"===t[0][0]&&t[1]?i+="\\"+String(Number(t[1])+e):(i+=t[0],"("===t[0]&&n++)}return i})).map((t=>`(${t})`)).join(e)}const Le="[a-zA-Z]\\w*",Ne="[a-zA-Z_]\\w*",Re="\\b\\d+(\\.\\d+)?",Pe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",De="\\b(0b[01]+)",ze={begin:"\\\\[\\s\\S]",relevance:0},He={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[ze]},Ue={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[ze]},je=function(t,e,n={}){const r=Ae({scope:"comment",begin:t,end:e,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 i=$e("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:Oe(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Ze=je("//","$"),Fe=je("/\\*","\\*/"),Ve=je("#","$"),Ye={scope:"number",begin:Re,relevance:0},We={scope:"number",begin:Pe,relevance:0},qe={scope:"number",begin:De,relevance:0},Xe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[ze,{begin:/\[/,end:/\]/,relevance:0,contains:[ze]}]},Ge={scope:"title",begin:Le,relevance:0},Ke={scope:"title",begin:Ne,relevance:0},Je={begin:"\\.\\s*"+Ne,relevance:0};var Qe=Object.freeze({__proto__:null,APOS_STRING_MODE:He,BACKSLASH_ESCAPE:ze,BINARY_NUMBER_MODE:qe,BINARY_NUMBER_RE:De,COMMENT:je,C_BLOCK_COMMENT_MODE:Fe,C_LINE_COMMENT_MODE:Ze,C_NUMBER_MODE:We,C_NUMBER_RE:Pe,END_SAME_AS_BEGIN:function(t){return Object.assign(t,{"on:begin":(t,e)=>{e.data._beginMatch=t[1]},"on:end":(t,e)=>{e.data._beginMatch!==t[1]&&e.ignoreMatch()}})},HASH_COMMENT_MODE:Ve,IDENT_RE:Le,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:Je,NUMBER_MODE:Ye,NUMBER_RE:Re,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:Ue,REGEXP_MODE:Xe,RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(t={})=>{const e=/^#![ ]*\//;return t.binary&&(t.begin=Oe(e,/.*\b/,t.binary,/\b.*/)),Ae({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,e)=>{0!==t.index&&e.ignoreMatch()}},t)},TITLE_MODE:Ge,UNDERSCORE_IDENT_RE:Ne,UNDERSCORE_TITLE_MODE:Ke});function tn(t,e){"."===t.input[t.index-1]&&e.ignoreMatch()}function en(t,e){void 0!==t.className&&(t.scope=t.className,delete t.className)}function nn(t,e){e&&t.beginKeywords&&(t.begin="\\b("+t.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",t.__beforeBegin=tn,t.keywords=t.keywords||t.beginKeywords,delete t.beginKeywords,void 0===t.relevance&&(t.relevance=0))}function rn(t,e){Array.isArray(t.illegal)&&(t.illegal=$e(...t.illegal))}function on(t,e){if(t.match){if(t.begin||t.end)throw new Error("begin & end are not supported with match");t.begin=t.match,delete t.match}}function sn(t,e){void 0===t.relevance&&(t.relevance=1)}const an=(t,e)=>{if(!t.beforeMatch)return;if(t.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},t);Object.keys(t).forEach((e=>{delete t[e]})),t.keywords=n.keywords,t.begin=Oe(n.beforeMatch,Ee(n.begin)),t.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},t.relevance=0,delete n.beforeMatch},ln=["of","and","for","in","not","or","if","then","parent","list","value"],cn="keyword";function dn(t,e,n=cn){const r=Object.create(null);return"string"==typeof t?i(n,t.split(" ")):Array.isArray(t)?i(n,t):Object.keys(t).forEach((function(n){Object.assign(r,dn(t[n],e,n))})),r;function i(t,n){e&&(n=n.map((t=>t.toLowerCase()))),n.forEach((function(e){const n=e.split("|");r[n[0]]=[t,pn(n[0],n[1])]}))}}function pn(t,e){return e?Number(e):function(t){return ln.includes(t.toLowerCase())}(t)?0:1}const hn={},un=t=>{console.error(t)},fn=(t,...e)=>{console.log(`WARN: ${t}`,...e)},mn=(t,e)=>{hn[`${t}/${e}`]||(console.log(`Deprecated as of ${t}. ${e}`),hn[`${t}/${e}`]=!0)},gn=new Error;function bn(t,e,{key:n}){let r=0;const i=t[n],o={},s={};for(let t=1;t<=e.length;t++)s[t+r]=i[t],o[t+r]=!0,r+=Me(e[t-1]);t[n]=s,t[n]._emit=o,t[n]._multi=!0}function yn(t){!function(t){t.scope&&"object"==typeof t.scope&&null!==t.scope&&(t.beginScope=t.scope,delete t.scope)}(t),"string"==typeof t.beginScope&&(t.beginScope={_wrap:t.beginScope}),"string"==typeof t.endScope&&(t.endScope={_wrap:t.endScope}),function(t){if(Array.isArray(t.begin)){if(t.skip||t.excludeBegin||t.returnBegin)throw un("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),gn;if("object"!=typeof t.beginScope||null===t.beginScope)throw un("beginScope must be object"),gn;bn(t,t.begin,{key:"beginScope"}),t.begin=Te(t.begin,{joinWith:""})}}(t),function(t){if(Array.isArray(t.end)){if(t.skip||t.excludeEnd||t.returnEnd)throw un("skip, excludeEnd, returnEnd not compatible with endScope: {}"),gn;if("object"!=typeof t.endScope||null===t.endScope)throw un("endScope must be object"),gn;bn(t,t.end,{key:"endScope"}),t.end=Te(t.end,{joinWith:""})}}(t)}function An(t){function e(e,n){return new RegExp(Ce(e),"m"+(t.case_insensitive?"i":"")+(t.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(t,e){e.position=this.position++,this.matchIndexes[this.matchAt]=e,this.regexes.push([e,t]),this.matchAt+=Me(t)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const t=this.regexes.map((t=>t[1]));this.matcherRe=e(Te(t,{joinWith:"|"}),!0),this.lastIndex=0}exec(t){this.matcherRe.lastIndex=this.lastIndex;const e=this.matcherRe.exec(t);if(!e)return null;const n=e.findIndex(((t,e)=>e>0&&void 0!==t)),r=this.matchIndexes[n];return e.splice(0,n),Object.assign(e,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(t){if(this.multiRegexes[t])return this.multiRegexes[t];const e=new n;return this.rules.slice(t).forEach((([t,n])=>e.addRule(t,n))),e.compile(),this.multiRegexes[t]=e,e}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(t,e){this.rules.push([t,e]),"begin"===e.type&&this.count++}exec(t){const e=this.getMatcher(this.regexIndex);e.lastIndex=this.lastIndex;let n=e.exec(t);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const e=this.getMatcher(0);e.lastIndex=this.lastIndex+1,n=e.exec(t)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(t.compilerExtensions||(t.compilerExtensions=[]),t.contains&&t.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return t.classNameAliases=Ae(t.classNameAliases||{}),function n(i,o){const s=i;if(i.isCompiled)return s;[en,on,yn,an].forEach((t=>t(i,o))),t.compilerExtensions.forEach((t=>t(i,o))),i.__beforeBegin=null,[nn,rn,sn].forEach((t=>t(i,o))),i.isCompiled=!0;let a=null;return"object"==typeof i.keywords&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),a=i.keywords.$pattern,delete i.keywords.$pattern),a=a||/\w+/,i.keywords&&(i.keywords=dn(i.keywords,t.case_insensitive)),s.keywordPatternRe=e(a,!0),o&&(i.begin||(i.begin=/\B|\b/),s.beginRe=e(s.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(s.endRe=e(s.end)),s.terminatorEnd=Ce(s.end)||"",i.endsWithParent&&o.terminatorEnd&&(s.terminatorEnd+=(i.end?"|":"")+o.terminatorEnd)),i.illegal&&(s.illegalRe=e(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map((function(t){return function(t){t.variants&&!t.cachedVariants&&(t.cachedVariants=t.variants.map((function(e){return Ae(t,{variants:null},e)})));if(t.cachedVariants)return t.cachedVariants;if(wn(t))return Ae(t,{starts:t.starts?Ae(t.starts):null});if(Object.isFrozen(t))return Ae(t);return t}("self"===t?i:t)}))),i.contains.forEach((function(t){n(t,s)})),i.starts&&n(i.starts,o),s.matcher=function(t){const e=new r;return t.contains.forEach((t=>e.addRule(t.begin,{rule:t,type:"begin"}))),t.terminatorEnd&&e.addRule(t.terminatorEnd,{type:"end"}),t.illegal&&e.addRule(t.illegal,{type:"illegal"}),e}(s),s}(t)}function wn(t){return!!t&&(t.endsWithParent||wn(t.starts))}class vn extends Error{constructor(t,e){super(t),this.name="HTMLInjectionError",this.html=e}}const _n=ye,xn=Ae,kn=Symbol("nomatch"),Cn=7,En=function(t){const e=Object.create(null),n=Object.create(null),r=[];let i=!0;const o="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:ke};function l(t){return a.noHighlightRe.test(t)}function c(t,e,n){let r="",i="";"object"==typeof e?(r=t,n=e.ignoreIllegals,i=e.language):(mn("10.7.0","highlight(lang, code, ...args) has been deprecated."),mn("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),i=t,r=e),void 0===n&&(n=!0);const o={code:r,language:i};y("before:highlight",o);const s=o.result?o.result:d(o.language,o.code,n);return s.code=o.code,y("after:highlight",s),s}function d(t,n,r,s){const l=Object.create(null);function c(){if(!C.keywords)return void S.addText(B);let t=0;C.keywordPatternRe.lastIndex=0;let e=C.keywordPatternRe.exec(B),n="";for(;e;){n+=B.substring(t,e.index);const i=_.case_insensitive?e[0].toLowerCase():e[0],o=(r=i,C.keywords[r]);if(o){const[t,r]=o;if(S.addText(n),n="",l[i]=(l[i]||0)+1,l[i]<=Cn&&(O+=r),t.startsWith("_"))n+=e[0];else{const n=_.classNameAliases[t]||t;u(e[0],n)}}else n+=e[0];t=C.keywordPatternRe.lastIndex,e=C.keywordPatternRe.exec(B)}var r;n+=B.substring(t),S.addText(n)}function h(){null!=C.subLanguage?function(){if(""===B)return;let t=null;if("string"==typeof C.subLanguage){if(!e[C.subLanguage])return void S.addText(B);t=d(C.subLanguage,B,!0,E[C.subLanguage]),E[C.subLanguage]=t._top}else t=p(B,C.subLanguage.length?C.subLanguage:null);C.relevance>0&&(O+=t.relevance),S.__addSublanguage(t._emitter,t.language)}():c(),B=""}function u(t,e){""!==t&&(S.startScope(e),S.addText(t),S.endScope())}function f(t,e){let n=1;const r=e.length-1;for(;n<=r;){if(!t._emit[n]){n++;continue}const r=_.classNameAliases[t[n]]||t[n],i=e[n];r?u(i,r):(B=i,c(),B=""),n++}}function g(t,e){return t.scope&&"string"==typeof t.scope&&S.openNode(_.classNameAliases[t.scope]||t.scope),t.beginScope&&(t.beginScope._wrap?(u(B,_.classNameAliases[t.beginScope._wrap]||t.beginScope._wrap),B=""):t.beginScope._multi&&(f(t.beginScope,e),B="")),C=Object.create(t,{parent:{value:C}}),C}function b(t,e,n){let r=function(t,e){const n=t&&t.exec(e);return n&&0===n.index}(t.endRe,n);if(r){if(t["on:end"]){const n=new be(t);t["on:end"](e,n),n.isMatchIgnored&&(r=!1)}if(r){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return b(t.parent,e,n)}function y(t){return 0===C.matcher.regexIndex?(B+=t[0],1):(I=!0,0)}function A(t){const e=t[0],r=n.substring(t.index),i=b(C,t,r);if(!i)return kn;const o=C;C.endScope&&C.endScope._wrap?(h(),u(e,C.endScope._wrap)):C.endScope&&C.endScope._multi?(h(),f(C.endScope,t)):o.skip?B+=e:(o.returnEnd||o.excludeEnd||(B+=e),h(),o.excludeEnd&&(B=e));do{C.scope&&S.closeNode(),C.skip||C.subLanguage||(O+=C.relevance),C=C.parent}while(C!==i.parent);return i.starts&&g(i.starts,t),o.returnEnd?0:e.length}let w={};function v(e,o){const s=o&&o[0];if(B+=e,null==s)return h(),0;if("begin"===w.type&&"end"===o.type&&w.index===o.index&&""===s){if(B+=n.slice(o.index,o.index+1),!i){const e=new Error(`0 width match regex (${t})`);throw e.languageName=t,e.badRule=w.rule,e}return 1}if(w=o,"begin"===o.type)return function(t){const e=t[0],n=t.rule,r=new be(n),i=[n.__beforeBegin,n["on:begin"]];for(const n of i)if(n&&(n(t,r),r.isMatchIgnored))return y(e);return n.skip?B+=e:(n.excludeBegin&&(B+=e),h(),n.returnBegin||n.excludeBegin||(B=e)),g(n,t),n.returnBegin?0:e.length}(o);if("illegal"===o.type&&!r){const t=new Error('Illegal lexeme "'+s+'" for mode "'+(C.scope||"<unnamed>")+'"');throw t.mode=C,t}if("end"===o.type){const t=A(o);if(t!==kn)return t}if("illegal"===o.type&&""===s)return 1;if(M>1e5&&M>3*o.index){throw new Error("potential infinite loop, way more iterations than matches")}return B+=s,s.length}const _=m(t);if(!_)throw un(o.replace("{}",t)),new Error('Unknown language: "'+t+'"');const x=An(_);let k="",C=s||x;const E={},S=new a.__emitter(a);!function(){const t=[];for(let e=C;e!==_;e=e.parent)e.scope&&t.unshift(e.scope);t.forEach((t=>S.openNode(t)))}();let B="",O=0,$=0,M=0,I=!1;try{if(_.__emitTokens)_.__emitTokens(n,S);else{for(C.matcher.considerAll();;){M++,I?I=!1:C.matcher.considerAll(),C.matcher.lastIndex=$;const t=C.matcher.exec(n);if(!t)break;const e=v(n.substring($,t.index),t);$=t.index+e}v(n.substring($))}return S.finalize(),k=S.toHTML(),{language:t,value:k,relevance:O,illegal:!1,_emitter:S,_top:C}}catch(e){if(e.message&&e.message.includes("Illegal"))return{language:t,value:_n(n),illegal:!0,relevance:0,_illegalBy:{message:e.message,index:$,context:n.slice($-100,$+100),mode:e.mode,resultSoFar:k},_emitter:S};if(i)return{language:t,value:_n(n),illegal:!1,relevance:0,errorRaised:e,_emitter:S,_top:C};throw e}}function p(t,n){n=n||a.languages||Object.keys(e);const r=function(t){const e={value:_n(t),illegal:!1,relevance:0,_top:s,_emitter:new a.__emitter(a)};return e._emitter.addText(t),e}(t),i=n.filter(m).filter(b).map((e=>d(e,t,!1)));i.unshift(r);const o=i.sort(((t,e)=>{if(t.relevance!==e.relevance)return e.relevance-t.relevance;if(t.language&&e.language){if(m(t.language).supersetOf===e.language)return 1;if(m(e.language).supersetOf===t.language)return-1}return 0})),[l,c]=o,p=l;return p.secondBest=c,p}function h(t){let e=null;const r=function(t){let e=t.className+" ";e+=t.parentNode?t.parentNode.className:"";const n=a.languageDetectRe.exec(e);if(n){const e=m(n[1]);return e||(fn(o.replace("{}",n[1])),fn("Falling back to no-highlight mode for this block.",t)),e?n[1]:"no-highlight"}return e.split(/\s+/).find((t=>l(t)||m(t)))}(t);if(l(r))return;if(y("before:highlightElement",{el:t,language:r}),t.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",t);if(t.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(t)),a.throwUnescapedHTML)){throw new vn("One of your code blocks includes unescaped HTML.",t.innerHTML)}e=t;const i=e.textContent,s=r?c(i,{language:r,ignoreIllegals:!0}):p(i);t.innerHTML=s.value,t.dataset.highlighted="yes",function(t,e,r){const i=e&&n[e]||r;t.classList.add("hljs"),t.classList.add(`language-${i}`)}(t,r,s.language),t.result={language:s.language,re:s.relevance,relevance:s.relevance},s.secondBest&&(t.secondBest={language:s.secondBest.language,relevance:s.secondBest.relevance}),y("after:highlightElement",{el:t,result:s,text:i})}let u=!1;function f(){if("loading"===document.readyState)return void(u=!0);document.querySelectorAll(a.cssSelector).forEach(h)}function m(t){return t=(t||"").toLowerCase(),e[t]||e[n[t]]}function g(t,{languageName:e}){"string"==typeof t&&(t=[t]),t.forEach((t=>{n[t.toLowerCase()]=e}))}function b(t){const e=m(t);return e&&!e.disableAutodetect}function y(t,e){const n=t;r.forEach((function(t){t[n]&&t[n](e)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){u&&f()}),!1),Object.assign(t,{highlight:c,highlightAuto:p,highlightAll:f,highlightElement:h,highlightBlock:function(t){return mn("10.7.0","highlightBlock will be removed entirely in v12.0"),mn("10.7.0","Please use highlightElement now."),h(t)},configure:function(t){a=xn(a,t)},initHighlighting:()=>{f(),mn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){f(),mn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let o=null;try{o=r(t)}catch(t){if(un("Language definition for '{}' could not be registered.".replace("{}",n)),!i)throw t;un(t),o=s}o.name||(o.name=n),e[n]=o,o.rawDefinition=r.bind(null,t),o.aliases&&g(o.aliases,{languageName:n})},unregisterLanguage:function(t){delete e[t];for(const e of Object.keys(n))n[e]===t&&delete n[e]},listLanguages:function(){return Object.keys(e)},getLanguage:m,registerAliases:g,autoDetection:b,inherit:xn,addPlugin:function(t){!function(t){t["before:highlightBlock"]&&!t["before:highlightElement"]&&(t["before:highlightElement"]=e=>{t["before:highlightBlock"](Object.assign({block:e.el},e))}),t["after:highlightBlock"]&&!t["after:highlightElement"]&&(t["after:highlightElement"]=e=>{t["after:highlightBlock"](Object.assign({block:e.el},e))})}(t),r.push(t)},removePlugin:function(t){const e=r.indexOf(t);-1!==e&&r.splice(e,1)}}),t.debugMode=function(){i=!1},t.safeMode=function(){i=!0},t.versionString="11.10.0",t.regex={concat:Oe,lookahead:Ee,either:$e,optional:Be,anyNumberOfTimes:Se};for(const t in Qe)"object"==typeof Qe[t]&&ge(Qe[t]);return Object.assign(t,Qe),t},Sn=En({});Sn.newInstance=()=>En({});var Bn=Sn;Sn.HighlightJS=Sn,Sn.default=Sn;var On=me(Bn);function $n(t,e=[]){return t.map((t=>{const n=[...e,...t.properties?t.properties.className:[]];return t.children?$n(t.children,n):{text:t.value,classes:n}})).flat()}function Mn(t){return t.value||t.children||[]}function In({doc:t,name:e,lowlight:n,defaultLanguage:r}){const i=[];return(0,At.N2)(t,(t=>t.type.name===e)).forEach((t=>{var e;let o=t.pos+1;const s=t.node.attrs.language||r,a=n.listLanguages();var l;$n(s&&(a.includes(s)||(l=s,Boolean(On.getLanguage(l)))||(null===(e=n.registered)||void 0===e?void 0:e.call(n,s)))?Mn(n.highlight(s,t.node.textContent)):Mn(n.highlightAuto(t.node.textContent))).forEach((t=>{const e=o+t.text.length;if(t.classes.length){const n=xt.p.inline(o,e,{class:t.classes.join(" ")});i.push(n)}o=e}))})),xt.EH.create(t,i)}function Tn({name:t,lowlight:e,defaultLanguage:n}){if(!["highlight","highlightAuto","listLanguages"].every((t=>"function"==typeof e[t])))throw Error("You should provide an instance of lowlight to use the code-block-lowlight extension");const r=new wt.Sy({key:new wt.H$("lowlight"),state:{init:(r,{doc:i})=>In({doc:i,name:t,lowlight:e,defaultLanguage:n}),apply:(r,i,o,s)=>{const a=o.selection.$head.parent.type.name,l=s.selection.$head.parent.type.name,c=(0,At.N2)(o.doc,(e=>e.type.name===t)),d=(0,At.N2)(s.doc,(e=>e.type.name===t));return r.docChanged&&([a,l].includes(t)||d.length!==c.length||r.steps.some((t=>void 0!==t.from&&void 0!==t.to&&c.some((e=>e.pos>=t.from&&e.pos+e.node.nodeSize<=t.to)))))?In({doc:r.doc,name:t,lowlight:e,defaultLanguage:n}):i.map(r.mapping,r.doc)}},props:{decorations:t=>r.getState(t)}});return r}const Ln=fe.extend({addOptions(){var t;return{...null===(t=this.parent)||void 0===t?void 0:t.call(this),lowlight:{},languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},addProseMirrorPlugins(){var t;return[...(null===(t=this.parent)||void 0===t?void 0:t.call(this))||[],Tn({name:this.name,lowlight:this.options.lowlight,defaultLanguage:this.options.defaultLanguage})]}}),Nn={};const Rn=At.hj.create({name:"fontFamily",addOptions:()=>({types:["textStyle"],fonts:[]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{fontFamily:{default:null,parseHTML:t=>t.style.fontFamily?.replace(/['"]+/g,""),renderHTML:t=>{if(!t.fontFamily)return{style:"font-family:Arial, Helvetica, sans-serif"};return function(t,e){if(!t||!t.length)return;const n=t.find((t=>t.cssRule.trim().replace('"',"").replace("'","")===e.trim().replace('"',"").replace("'","")));n&&!Nn[n.name]&&function(t){if(document.getElementById(t.id))return;const e=document.createElement("link");e.href=t.url,e.id=t.id,e.setAttribute("data-name",t.name),e.rel="stylesheet",e.type="text/css",document.head.appendChild(e),Nn[t.name]=!0}(n)}(this.options.fonts,t.fontFamily),{style:`font-family: ${t.fontFamily.replace(/;/g,"")}`,"data-cdtr-font-name":t.fontFamily}}}}}]},addCommands:()=>({setFontFamily:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e=>{let{chain:n}=e;if(!t||"object"!=typeof t)return console.warn("setFontFamily should be { cssRule, name, id, url } "),"string"==typeof t?n().setMark("textStyle",{fontFamily:t}).run():void 0;const{cssRule:r,name:i,id:o,url:s}=t;return n().setMark("textStyle",{fontFamily:r}).run()}},unsetFontFamily:()=>t=>{let{chain:e}=t;return e().setMark("textStyle",{fontFamily:null}).removeEmptyTextStyle().run()}})});const Pn=At.NB.create({name:"horizontalRule",addOptions:()=>({HTMLAttributes:{}}),group:"block",draggable:!0,parseHTML:()=>[{tag:"hr"}],renderHTML(t){let{HTMLAttributes:e}=t;return["hr",(0,At.P1)(this.options.HTMLAttributes,e)]},addCommands(){return{setHorizontalRule:()=>t=>{let{chain:e}=t;return e().insertContent({type:this.name}).command((t=>{let{tr:e,dispatch:n}=t;if(n){const{$to:t}=e.selection,n=t.end();if(t.nodeAfter)e.setSelection(wt.Bs.create(e.doc,t.pos));else{const r=t.parent.type.contentMatch.defaultType?.create();r&&(e.insert(n,r),e.setSelection(wt.Bs.create(e.doc,n)))}e.scrollIntoView()}return!0})).run()}}},addInputRules(){return[(0,At.x2)({find:/^(?:---|—-|___\s|\*\*\*\s)$/,type:this.type})]}});var Dn=n(38404),zn=n(52665);class Hn extends wt.Y1{constructor(t){super(t,t)}map(t,e){let n=t.resolve(e.map(this.head));return Hn.valid(n)?new Hn(n):wt.Y1.near(n)}content(){return zn.p2.empty}eq(t){return t instanceof Hn&&t.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(t,e){if("number"!=typeof e.pos)throw new RangeError("Invalid input for GapCursor.fromJSON");return new Hn(t.resolve(e.pos))}getBookmark(){return new Un(this.anchor)}static valid(t){let e=t.parent;if(e.isTextblock||!function(t){for(let e=t.depth;e>=0;e--){let n=t.index(e),r=t.node(e);if(0!=n)for(let t=r.child(n-1);;t=t.lastChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t)||!function(t){for(let e=t.depth;e>=0;e--){let n=t.indexAfter(e),r=t.node(e);if(n!=r.childCount)for(let t=r.child(n);;t=t.firstChild){if(0==t.childCount&&!t.inlineContent||t.isAtom||t.type.spec.isolating)return!0;if(t.inlineContent)return!1}else if(r.type.spec.isolating)return!0}return!0}(t))return!1;let n=e.type.spec.allowGapCursor;if(null!=n)return n;let r=e.contentMatchAt(t.index()).defaultType;return r&&r.isTextblock}static findGapCursorFrom(t,e,n=!1){t:for(;;){if(!n&&Hn.valid(t))return t;let r=t.pos,i=null;for(let n=t.depth;;n--){let o=t.node(n);if(e>0?t.indexAfter(n)<o.childCount:t.index(n)>0){i=o.child(e>0?t.indexAfter(n):t.index(n)-1);break}if(0==n)return null;r+=e;let s=t.doc.resolve(r);if(Hn.valid(s))return s}for(;;){let o=e>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!wt.qv.isSelectable(i)){t=t.doc.resolve(r+i.nodeSize*e),n=!1;continue t}break}i=o,r+=e;let s=t.doc.resolve(r);if(Hn.valid(s))return s}return null}}}Hn.prototype.visible=!1,Hn.findFrom=Hn.findGapCursorFrom,wt.Y1.jsonID("gapcursor",Hn);class Un{constructor(t){this.pos=t}map(t){return new Un(t.map(this.pos))}resolve(t){let e=t.resolve(this.pos);return Hn.valid(e)?new Hn(e):wt.Y1.near(e)}}const jn=(0,Dn.$)({ArrowLeft:Zn("horiz",-1),ArrowRight:Zn("horiz",1),ArrowUp:Zn("vert",-1),ArrowDown:Zn("vert",1)});function Zn(t,e){const n="vert"==t?e>0?"down":"up":e>0?"right":"left";return function(t,r,i){let o=t.selection,s=e>0?o.$to:o.$from,a=o.empty;if(o instanceof wt.Bs){if(!i.endOfTextblock(n)||0==s.depth)return!1;a=!1,s=t.doc.resolve(e>0?s.after():s.before())}let l=Hn.findGapCursorFrom(s,e,a);return!!l&&(r&&r(t.tr.setSelection(new Hn(l))),!0)}}function Fn(t,e,n){if(!t||!t.editable)return!1;let r=t.state.doc.resolve(e);if(!Hn.valid(r))return!1;let i=t.posAtCoords({left:n.clientX,top:n.clientY});return!(i&&i.inside>-1&&wt.qv.isSelectable(t.state.doc.nodeAt(i.inside)))&&(t.dispatch(t.state.tr.setSelection(new Hn(r))),!0)}function Vn(t,e){if("insertCompositionText"!=e.inputType||!(t.state.selection instanceof Hn))return!1;let{$from:n}=t.state.selection,r=n.parent.contentMatchAt(n.index()).findWrapping(t.state.schema.nodes.text);if(!r)return!1;let i=zn.HY.empty;for(let t=r.length-1;t>=0;t--)i=zn.HY.from(r[t].createAndFill(null,i));let o=t.state.tr.replace(n.pos,n.pos,new zn.p2(i,0,0));return o.setSelection(wt.Bs.near(o.doc.resolve(n.pos+1))),t.dispatch(o),!1}function Yn(t){if(!(t.selection instanceof Hn))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",xt.EH.create(t.doc,[xt.p.widget(t.selection.head,e,{key:"gapcursor"})])}const Wn=At.hj.create({name:"gapCursor",addProseMirrorPlugins:()=>[new wt.Sy({props:{decorations:Yn,createSelectionBetween:(t,e,n)=>e.pos==n.pos&&Hn.valid(n)?new Hn(n):null,handleClick:Fn,handleKeyDown:jn,handleDOMEvents:{beforeinput:Vn}}})],extendNodeSchema(t){var e;const n={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:null!==(e=(0,At.nU)((0,At.Nl)(t,"allowGapCursor",n)))&&void 0!==e?e:null}}}),qn=At.NB.create({name:"paragraph",priority:1e3,addOptions:()=>({HTMLAttributes:{}}),group:"block",content:"inline*",parseHTML:()=>[{tag:"p"}],renderHTML(t){const{HTMLAttributes:e}=t,n=document.createElement("p");n.style.cssText=e.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,At.P1)(this.options.HTMLAttributes,{style:r},{dir:"auto"}),0]},addCommands(){return{setParagraph:()=>t=>{let{commands:e}=t;return e.setNode(this.name)}}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),Xn="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2ntley5rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6logistics9properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3ncaster6d0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2psy3ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Gn="ελ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",Kn=(t,e)=>{for(const n in e)t[n]=e[n];return t},Jn="numeric",Qn="ascii",tr="alpha",er="asciinumeric",nr="alphanumeric",rr="domain",ir="emoji",or="scheme",sr="slashscheme",ar="whitespace";function lr(t,e){return t in e||(e[t]=[]),e[t]}function cr(t,e,n){e[Jn]&&(e[er]=!0,e[nr]=!0),e[Qn]&&(e[er]=!0,e[tr]=!0),e[er]&&(e[nr]=!0),e[tr]&&(e[nr]=!0),e[nr]&&(e[rr]=!0),e[ir]&&(e[rr]=!0);for(const r in e){const e=lr(r,n);e.indexOf(t)<0&&e.push(t)}}function dr(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}dr.groups={},dr.prototype={accepts(){return!!this.t},go(t){const e=this,n=e.j[t];if(n)return n;for(let n=0;n<e.jr.length;n++){const r=e.jr[n][0],i=e.jr[n][1];if(i&&r.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,n,r){for(let i=0;i<t.length;i++)this.tt(t[i],e,n,r)},tr(t,e,n,r){let i;return r=r||dr.groups,e&&e.j?i=e:(i=new dr(e),n&&r&&cr(e,n,r)),this.jr.push([t,i]),i},ts(t,e,n,r){let i=this;const o=t.length;if(!o)return i;for(let e=0;e<o-1;e++)i=i.tt(t[e]);return i.tt(t[o-1],e,n,r)},tt(t,e,n,r){r=r||dr.groups;const i=this;if(e&&e.j)return i.j[t]=e,e;const o=e;let s,a=i.go(t);if(a?(s=new dr,Kn(s.j,a.j),s.jr.push.apply(s.jr,a.jr),s.jd=a.jd,s.t=a.t):s=new dr,o){if(r)if(s.t&&"string"==typeof s.t){const t=Kn(function(t,e){const n={};for(const r in e)e[r].indexOf(t)>=0&&(n[r]=!0);return n}(s.t,r),n);cr(o,t,r)}else n&&cr(o,n,r);s.t=o}return i.j[t]=s,s}};const pr=(t,e,n,r,i)=>t.ta(e,n,r,i),hr=(t,e,n,r,i)=>t.tr(e,n,r,i),ur=(t,e,n,r,i)=>t.ts(e,n,r,i),fr=(t,e,n,r,i)=>t.tt(e,n,r,i),mr="WORD",gr="UWORD",br="ASCIINUMERICAL",yr="ALPHANUMERICAL",Ar="LOCALHOST",wr="TLD",vr="UTLD",_r="SCHEME",xr="SLASH_SCHEME",kr="NUM",Cr="WS",Er="NL",Sr="OPENBRACE",Br="CLOSEBRACE",Or="OPENBRACKET",$r="CLOSEBRACKET",Mr="OPENPAREN",Ir="CLOSEPAREN",Tr="OPENANGLEBRACKET",Lr="CLOSEANGLEBRACKET",Nr="FULLWIDTHLEFTPAREN",Rr="FULLWIDTHRIGHTPAREN",Pr="LEFTCORNERBRACKET",Dr="RIGHTCORNERBRACKET",zr="LEFTWHITECORNERBRACKET",Hr="RIGHTWHITECORNERBRACKET",Ur="FULLWIDTHLESSTHAN",jr="FULLWIDTHGREATERTHAN",Zr="AMPERSAND",Fr="APOSTROPHE",Vr="ASTERISK",Yr="AT",Wr="BACKSLASH",qr="BACKTICK",Xr="CARET",Gr="COLON",Kr="COMMA",Jr="DOLLAR",Qr="DOT",ti="EQUALS",ei="EXCLAMATION",ni="HYPHEN",ri="PERCENT",ii="PIPE",oi="PLUS",si="POUND",ai="QUERY",li="QUOTE",ci="FULLWIDTHMIDDLEDOT",di="SEMI",pi="SLASH",hi="TILDE",ui="UNDERSCORE",fi="EMOJI",mi="SYM";var gi=Object.freeze({__proto__:null,WORD:mr,UWORD:gr,ASCIINUMERICAL:br,ALPHANUMERICAL:yr,LOCALHOST:Ar,TLD:wr,UTLD:vr,SCHEME:_r,SLASH_SCHEME:xr,NUM:kr,WS:Cr,NL:Er,OPENBRACE:Sr,CLOSEBRACE:Br,OPENBRACKET:Or,CLOSEBRACKET:$r,OPENPAREN:Mr,CLOSEPAREN:Ir,OPENANGLEBRACKET:Tr,CLOSEANGLEBRACKET:Lr,FULLWIDTHLEFTPAREN:Nr,FULLWIDTHRIGHTPAREN:Rr,LEFTCORNERBRACKET:Pr,RIGHTCORNERBRACKET:Dr,LEFTWHITECORNERBRACKET:zr,RIGHTWHITECORNERBRACKET:Hr,FULLWIDTHLESSTHAN:Ur,FULLWIDTHGREATERTHAN:jr,AMPERSAND:Zr,APOSTROPHE:Fr,ASTERISK:Vr,AT:Yr,BACKSLASH:Wr,BACKTICK:qr,CARET:Xr,COLON:Gr,COMMA:Kr,DOLLAR:Jr,DOT:Qr,EQUALS:ti,EXCLAMATION:ei,HYPHEN:ni,PERCENT:ri,PIPE:ii,PLUS:oi,POUND:si,QUERY:ai,QUOTE:li,FULLWIDTHMIDDLEDOT:ci,SEMI:di,SLASH:pi,TILDE:hi,UNDERSCORE:ui,EMOJI:fi,SYM:mi});const bi=/[a-z]/,yi=/\p{L}/u,Ai=/\p{Emoji}/u,wi=/\d/,vi=/\s/;const _i="\r",xi="\n",ki="️",Ci="",Ei="";let Si=null,Bi=null;function Oi(t,e){const n=function(t){const e=[],n=t.length;let r=0;for(;r<n;){let i,o=t.charCodeAt(r),s=o<55296||o>56319||r+1===n||(i=t.charCodeAt(r+1))<56320||i>57343?t[r]:t.slice(r,r+2);e.push(s),r+=s.length}return e}(e.replace(/[A-Z]/g,(t=>t.toLowerCase()))),r=n.length,i=[];let o=0,s=0;for(;s<r;){let a=t,l=null,c=0,d=null,p=-1,h=-1;for(;s<r&&(l=a.go(n[s]));)a=l,a.accepts()?(p=0,h=0,d=a):p>=0&&(p+=n[s].length,h++),c+=n[s].length,o+=n[s].length,s++;o-=p,s-=h,c-=p,i.push({t:d.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function $i(t,e,n,r,i){let o;const s=e.length;for(let n=0;n<s-1;n++){const s=e[n];t.j[s]?o=t.j[s]:(o=new dr(r),o.jr=i.slice(),t.j[s]=o),t=o}return o=new dr(n),o.jr=i.slice(),t.j[e[s-1]]=o,o}function Mi(t){const e=[],n=[];let r=0;for(;r<t.length;){let i=0;for(;"0123456789".indexOf(t[r+i])>=0;)i++;if(i>0){e.push(n.join(""));for(let e=parseInt(t.substring(r,r+i),10);e>0;e--)n.pop();r+=i}else n.push(t[r]),r++}return e}const Ii={defaultProtocol:"http",events:null,format:Li,formatHref:Li,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ti(t,e=null){let n=Kn({},Ii);t&&(n=Kn(n,t instanceof Ti?t.o:t));const r=n.ignoreTags,i=[];for(let t=0;t<r.length;t++)i.push(r[t].toUpperCase());this.o=n,e&&(this.defaultRender=e),this.ignoreTags=i}function Li(t){return t}Ti.prototype={o:Ii,ignoreTags:[],defaultRender:t=>t,check(t){return this.get("validate",t.toString(),t)},get(t,e,n){const r=null!=e;let i=this.o[t];return i?("object"==typeof i?(i=n.t in i?i[n.t]:Ii[t],"function"==typeof i&&r&&(i=i(e,n))):"function"==typeof i&&r&&(i=i(e,n.t,n)),i):i},getObj(t,e,n){let r=this.o[t];return"function"==typeof r&&null!=e&&(r=r(e,n.t,n)),r},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function Ni(t,e){this.t="token",this.v=t,this.tk=e}function Ri(t,e){class n extends Ni{constructor(e,n){super(e,n),this.t=t}}for(const t in e)n.prototype[t]=e[t];return n.t=t,n}Ni.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),n=t.get("truncate",e,this),r=t.get("format",e,this);return n&&r.length>n?r.substring(0,n)+"…":r},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Ii.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,n=this.toHref(t.get("defaultProtocol")),r=t.get("formatHref",n,this),i=t.get("tagName",n,e),o=this.toFormattedString(t),s={},a=t.get("className",n,e),l=t.get("target",n,e),c=t.get("rel",n,e),d=t.getObj("attributes",n,e),p=t.getObj("events",n,e);return s.href=r,a&&(s.class=a),l&&(s.target=l),c&&(s.rel=c),d&&Kn(s,d),{tagName:i,attributes:s,content:o,eventListeners:p}}};const Pi=Ri("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Di=Ri("text"),zi=Ri("nl"),Hi=Ri("url",{isLink:!0,toHref(t=Ii.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Ar&&t[1].t===Gr}});const Ui=t=>new dr(t);function ji(t,e,n){const r=n[0].s,i=n[n.length-1].e;return new t(e.slice(r,i),n)}const Zi="undefined"!=typeof console&&console&&console.warn||(()=>{}),Fi="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",Vi={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Yi(t,e=!1){if(Vi.initialized&&Zi(`linkifyjs: already initialized - will not register custom scheme "${t}" ${Fi}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))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');Vi.customSchemes.push([t,e])}function Wi(){Vi.scanner=function(t=[]){const e={};dr.groups=e;const n=new dr;null==Si&&(Si=Mi(Xn)),null==Bi&&(Bi=Mi(Gn)),fr(n,"'",Fr),fr(n,"{",Sr),fr(n,"}",Br),fr(n,"[",Or),fr(n,"]",$r),fr(n,"(",Mr),fr(n,")",Ir),fr(n,"<",Tr),fr(n,">",Lr),fr(n,"(",Nr),fr(n,")",Rr),fr(n,"「",Pr),fr(n,"」",Dr),fr(n,"『",zr),fr(n,"』",Hr),fr(n,"<",Ur),fr(n,">",jr),fr(n,"&",Zr),fr(n,"*",Vr),fr(n,"@",Yr),fr(n,"`",qr),fr(n,"^",Xr),fr(n,":",Gr),fr(n,",",Kr),fr(n,"$",Jr),fr(n,".",Qr),fr(n,"=",ti),fr(n,"!",ei),fr(n,"-",ni),fr(n,"%",ri),fr(n,"|",ii),fr(n,"+",oi),fr(n,"#",si),fr(n,"?",ai),fr(n,'"',li),fr(n,"/",pi),fr(n,";",di),fr(n,"~",hi),fr(n,"_",ui),fr(n,"\\",Wr),fr(n,"・",ci);const r=hr(n,wi,kr,{[Jn]:!0});hr(r,wi,r);const i=hr(r,bi,br,{[er]:!0}),o=hr(r,yi,yr,{[nr]:!0}),s=hr(n,bi,mr,{[Qn]:!0});hr(s,wi,i),hr(s,bi,s),hr(i,wi,i),hr(i,bi,i);const a=hr(n,yi,gr,{[tr]:!0});hr(a,bi),hr(a,wi,o),hr(a,yi,a),hr(o,wi,o),hr(o,bi),hr(o,yi,o);const l=fr(n,xi,Er,{[ar]:!0}),c=fr(n,_i,Cr,{[ar]:!0}),d=hr(n,vi,Cr,{[ar]:!0});fr(n,Ei,d),fr(c,xi,l),fr(c,Ei,d),hr(c,vi,d),fr(d,_i),fr(d,xi),hr(d,vi,d),fr(d,Ei,d);const p=hr(n,Ai,fi,{[ir]:!0});fr(p,"#"),hr(p,Ai,p),fr(p,ki,p);const h=fr(p,Ci);fr(h,"#"),hr(h,Ai,p);const u=[[bi,s],[wi,i]],f=[[bi,null],[yi,a],[wi,o]];for(let t=0;t<Si.length;t++)$i(n,Si[t],wr,mr,u);for(let t=0;t<Bi.length;t++)$i(n,Bi[t],vr,gr,f);cr(wr,{tld:!0,ascii:!0},e),cr(vr,{utld:!0,alpha:!0},e),$i(n,"file",_r,mr,u),$i(n,"mailto",_r,mr,u),$i(n,"http",xr,mr,u),$i(n,"https",xr,mr,u),$i(n,"ftp",xr,mr,u),$i(n,"ftps",xr,mr,u),cr(_r,{scheme:!0,ascii:!0},e),cr(xr,{slashscheme:!0,ascii:!0},e),t=t.sort(((t,e)=>t[0]>e[0]?1:-1));for(let e=0;e<t.length;e++){const r=t[e][0],i=t[e][1]?{[or]:!0}:{[sr]:!0};r.indexOf("-")>=0?i[rr]=!0:bi.test(r)?wi.test(r)?i[er]=!0:i[Qn]=!0:i[Jn]=!0,ur(n,r,r,i)}return ur(n,"localhost",Ar,{ascii:!0}),n.jd=new dr(mi),{start:n,tokens:Kn({groups:e},gi)}}(Vi.customSchemes);for(let t=0;t<Vi.tokenQueue.length;t++)Vi.tokenQueue[t][1]({scanner:Vi.scanner});Vi.parser=function({groups:t}){const e=t.domain.concat([Zr,Vr,Yr,Wr,qr,Xr,Jr,ti,ni,kr,ri,ii,oi,si,pi,mi,hi,ui]),n=[Gr,Kr,Qr,ei,ri,ai,li,di,Tr,Lr,Sr,Br,$r,Or,Mr,Ir,Nr,Rr,Pr,Dr,zr,Hr,Ur,jr],r=[Zr,Fr,Vr,Wr,qr,Xr,Jr,ti,ni,Sr,Br,ri,ii,oi,si,ai,pi,mi,hi,ui],i=Ui(),o=fr(i,hi);pr(o,r,o),pr(o,t.domain,o);const s=Ui(),a=Ui(),l=Ui();pr(i,t.domain,s),pr(i,t.scheme,a),pr(i,t.slashscheme,l),pr(s,r,o),pr(s,t.domain,s);const c=fr(s,Yr);fr(o,Yr,c),fr(a,Yr,c),fr(l,Yr,c);const d=fr(o,Qr);pr(d,r,o),pr(d,t.domain,o);const p=Ui();pr(c,t.domain,p),pr(p,t.domain,p);const h=fr(p,Qr);pr(h,t.domain,p);const u=Ui(Pi);pr(h,t.tld,u),pr(h,t.utld,u),fr(c,Ar,u);const f=fr(p,ni);fr(f,ni,f),pr(f,t.domain,p),pr(u,t.domain,p),fr(u,Qr,h),fr(u,ni,f);const m=fr(u,Gr);pr(m,t.numeric,Pi);const g=fr(s,ni),b=fr(s,Qr);fr(g,ni,g),pr(g,t.domain,s),pr(b,r,o),pr(b,t.domain,s);const y=Ui(Hi);pr(b,t.tld,y),pr(b,t.utld,y),pr(y,t.domain,s),pr(y,r,o),fr(y,Qr,b),fr(y,ni,g),fr(y,Yr,c);const A=fr(y,Gr),w=Ui(Hi);pr(A,t.numeric,w);const v=Ui(Hi),_=Ui();pr(v,e,v),pr(v,n,_),pr(_,e,v),pr(_,n,_),fr(y,pi,v),fr(w,pi,v);const x=fr(a,Gr),k=fr(l,Gr),C=fr(k,pi),E=fr(C,pi);pr(a,t.domain,s),fr(a,Qr,b),fr(a,ni,g),pr(l,t.domain,s),fr(l,Qr,b),fr(l,ni,g),pr(x,t.domain,v),fr(x,pi,v),fr(x,ai,v),pr(E,t.domain,v),pr(E,e,v),fr(E,pi,v);const S=[[Sr,Br],[Or,$r],[Mr,Ir],[Tr,Lr],[Nr,Rr],[Pr,Dr],[zr,Hr],[Ur,jr]];for(let t=0;t<S.length;t++){const[r,i]=S[t],o=fr(v,r);fr(_,r,o),fr(o,i,v);const s=Ui(Hi);pr(o,e,s);const a=Ui();pr(o,n),pr(s,e,s),pr(s,n,a),pr(a,e,s),pr(a,n,a),fr(s,i,v),fr(a,i,v)}return fr(i,Ar,y),fr(i,Er,zi),{start:i,tokens:gi}}(Vi.scanner.tokens);for(let t=0;t<Vi.pluginQueue.length;t++)Vi.pluginQueue[t][1]({scanner:Vi.scanner,parser:Vi.parser});return Vi.initialized=!0,Vi}function qi(t){return Vi.initialized||Wi(),function(t,e,n){let r=n.length,i=0,o=[],s=[];for(;i<r;){let a=t,l=null,c=null,d=0,p=null,h=-1;for(;i<r&&!(l=a.go(n[i].t));)s.push(n[i++]);for(;i<r&&(c=l||a.go(n[i].t));)l=null,a=c,a.accepts()?(h=0,p=a):h>=0&&h++,i++,d++;if(h<0)i-=d,i<r&&(s.push(n[i]),i++);else{s.length>0&&(o.push(ji(Di,e,s)),s=[]),i-=h,d-=h;const t=p.t,r=n.slice(i-d,i);o.push(ji(t,e,r))}}return s.length>0&&o.push(ji(Di,e,s)),o}(Vi.parser.start,t,Oi(Vi.scanner.start,t))}function Xi(t,e=null,n=null){if(e&&"object"==typeof e){if(n)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);n=e,e=null}const r=new Ti(n),i=qi(t),o=[];for(let t=0;t<i.length;t++){const n=i[t];!n.isLink||e&&n.t!==e||!r.check(n)||o.push(n.toFormattedObject(r))}return o}qi.scan=Oi;const Gi=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Ki(t,e){const n=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach((t=>{const e="string"==typeof t?t:t.scheme;e&&n.push(e)})),!t||t.replace(Gi,"").match(new RegExp(`^(?:(?:${n.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}const Ji=At.vc.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((t=>{"string"!=typeof t?Yi(t.scheme,t.optionalSlashes):Yi(t)}))},onDestroy(){dr.groups={},Vi.scanner=null,Vi.parser=null,Vi.tokenQueue=[],Vi.pluginQueue=[],Vi.customSchemes=[],Vi.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:(t,e)=>!!Ki(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>!!t}),addAttributes(){return{href:{default:null,parseHTML:t=>t.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:t=>{const e=t.getAttribute("href");return!(!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Ki(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol}))&&null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:t=>!!Ki(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",(0,At.P1)(this.options.HTMLAttributes,t),0]:["a",(0,At.P1)(this.options.HTMLAttributes,{...t,href:""}),0]},addCommands(){return{setLink:t=>({chain:e})=>{const{href:n}=t;return!!this.options.isAllowedUri(n,{defaultValidate:t=>!!Ki(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&e().setMark(this.name,t).setMeta("preventAutolink",!0).run()},toggleLink:t=>({chain:e})=>{const{href:n}=t;return!!this.options.isAllowedUri(n,{defaultValidate:t=>!!Ki(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})&&e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[(0,At.K9)({find:t=>{const e=[];if(t){const{protocols:n,defaultProtocol:r}=this.options,i=Xi(t).filter((t=>t.isLink&&this.options.isAllowedUri(t.value,{defaultValidate:t=>!!Ki(t,n),protocols:n,defaultProtocol:r})));i.length&&i.forEach((t=>e.push({text:t.value,data:{href:t.href},index:t.start})))}return e},type:this.type,getAttributes:t=>{var e;return{href:null===(e=t.data)||void 0===e?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:n}=this.options;return this.options.autolink&&t.push(function(t){return new wt.Sy({key:new wt.H$("autolink"),appendTransaction:(e,n,r)=>{const i=e.some((t=>t.docChanged))&&!n.doc.eq(r.doc),o=e.some((t=>t.getMeta("preventAutolink")));if(!i||o)return;const{tr:s}=r,a=(0,At.XP)(n.doc,[...e]);return(0,At.QC)(a).forEach((({newRange:e})=>{const n=(0,At.b5)(r.doc,e,(t=>t.isTextblock));let i,o;if(n.length>1?(i=n[0],o=r.doc.textBetween(i.pos,i.pos+i.node.nodeSize,void 0," ")):n.length&&r.doc.textBetween(e.from,e.to," "," ").endsWith(" ")&&(i=n[0],o=r.doc.textBetween(i.pos,e.to,void 0," ")),i&&o){const e=o.split(" ").filter((t=>""!==t));if(e.length<=0)return!1;const n=e[e.length-1],l=i.pos+o.lastIndexOf(n);if(!n)return!1;const c=qi(n).map((e=>e.toObject(t.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((t=>t.isLink)).map((t=>({...t,from:l+t.start+1,to:l+t.end+1}))).filter((t=>!r.schema.marks.code||!r.doc.rangeHasMark(t.from,t.to,r.schema.marks.code))).filter((e=>t.validate(e.value))).filter((e=>t.shouldAutoLink(e.value))).forEach((e=>{(0,At.tI)(e.from,e.to,r.doc).some((e=>e.mark.type===t.type))||s.addMark(e.from,e.to,t.type.create({href:e.href}))}))}var a})),s.steps.length?s:void 0}})}({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:t=>this.options.isAllowedUri(t,{defaultValidate:t=>!!Ki(t,e),protocols:e,defaultProtocol:n}),shouldAutoLink:this.options.shouldAutoLink})),!0===this.options.openOnClick&&t.push(function(t){return new wt.Sy({key:new wt.H$("handleClickLink"),props:{handleClick:(e,n,r)=>{var i,o;if(0!==r.button)return!1;if(!e.editable)return!1;let s=r.target;const a=[];for(;"DIV"!==s.nodeName;)a.push(s),s=s.parentNode;if(!a.find((t=>"A"===t.nodeName)))return!1;const l=(0,At.u9)(e.state,t.type.name),c=r.target,d=null!==(i=null==c?void 0:c.href)&&void 0!==i?i:l.href,p=null!==(o=null==c?void 0:c.target)&&void 0!==o?o:l.target;return!(!c||!d||(window.open(d,p),0))}}})}({type:this.type})),this.options.linkOnPaste&&t.push(function(t){return new wt.Sy({key:new wt.H$("handlePasteLink"),props:{handlePaste:(e,n,r)=>{const{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let a="";r.content.forEach((t=>{a+=t.textContent}));const l=Xi(a,{defaultProtocol:t.defaultProtocol}).find((t=>t.isLink&&t.value===a));return!(!a||!l)&&t.editor.commands.setMark(t.type,{href:l.href})}}})}({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),t}});let Qi,to;if("undefined"!=typeof WeakMap){let t=new WeakMap;Qi=e=>t.get(e),to=(e,n)=>(t.set(e,n),n)}else{let t=[],e=10,n=0;Qi=e=>{for(let n=0;n<t.length;n+=2)if(t[n]==e)return t[n+1]},to=(r,i)=>(n==e&&(n=0),t[n++]=r,t[n++]=i)}class eo{constructor(t,e,n,r){this.left=t,this.top=e,this.right=n,this.bottom=r}}class no{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){let n=this.map[e];if(n!=t)continue;let r=e%this.width,i=e/this.width|0,o=r+1,s=i+1;for(let t=1;o<this.width&&this.map[e+t]==n;t++)o++;for(let t=1;s<this.height&&this.map[e+this.width*t]==n;t++)s++;return new eo(r,i,o,s)}throw new RangeError("No cell with offset "+t+" found")}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError("No cell with offset "+t+" found")}nextCell(t,e,n){let{left:r,right:i,top:o,bottom:s}=this.findCell(t);return"horiz"==e?(n<0?0==r:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?0==o:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(t,e){let{left:n,right:r,top:i,bottom:o}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return new eo(Math.min(n,s),Math.min(i,l),Math.max(r,a),Math.max(o,c))}cellsInRect(t){let e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){let o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,i==t.left&&i&&this.map[o-1]==s||r==t.top&&r&&this.map[o-this.width]==s||e.push(s))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){let o=i+n.child(r).nodeSize;if(r==t){let n=e+t*this.width,r=(t+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?o-1:this.map[n]}i=o}}static get(t){return Qi(t)||to(t,function(t){if("table"!=t.type.spec.tableRole)throw new RangeError("Not a table node: "+t.type.name);let e=function(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){let i=t.child(r),o=0;if(n)for(let e=0;e<r;e++){let n=t.child(e);for(let t=0;t<n.childCount;t++){let i=n.child(t);e+i.attrs.rowspan>r&&(o+=i.attrs.colspan)}}for(let t=0;t<i.childCount;t++){let e=i.child(t);o+=e.attrs.colspan,e.attrs.rowspan>1&&(n=!0)}-1==e?e=o:e!=o&&(e=Math.max(e,o))}return e}(t),n=t.childCount,r=[],i=0,o=null,s=[];for(let t=0,i=e*n;t<i;t++)r[t]=0;for(let a=0,l=0;a<n;a++){let c=t.child(a);l++;for(let t=0;;t++){for(;i<r.length&&0!=r[i];)i++;if(t==c.childCount)break;let d=c.child(t),{colspan:p,rowspan:h,colwidth:u}=d.attrs;for(let t=0;t<h;t++){if(t+a>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:l,n:h-t});break}let c=i+t*e;for(let t=0;t<p;t++){0==r[c+t]?r[c+t]=l:(o||(o=[])).push({type:"collision",row:a,pos:l,n:p-t});let n=u&&u[t];if(n){let r=(c+t)%e*2,i=s[r];null==i||i!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):i==n&&s[r+1]++}}}i+=p,l+=d.nodeSize}let d=(a+1)*e,p=0;for(;i<d;)0==r[i++]&&p++;p&&(o||(o=[])).push({type:"missing",row:a,n:p}),l++}let a=new no(e,n,r,o),l=!1;for(let t=0;!l&&t<s.length;t+=2)null!=s[t]&&s[t+1]<n&&(l=!0);l&&function(t,e,n){t.problems||(t.problems=[]);for(let r=0,i={};r<t.map.length;r++){let o=t.map[r];if(i[o])continue;i[o]=!0;let s=n.nodeAt(o),a=null;for(let n=0;n<s.attrs.colspan;n++){let i=e[2*((r+n)%t.width)];null==i||s.attrs.colwidth&&s.attrs.colwidth[n]==i||((a||(a=ro(s.attrs)))[n]=i)}a&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:a})}}(a,s,t);return a}(t))}}function ro(t){if(t.colwidth)return t.colwidth.slice();let e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}function io(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(let n in t.nodes){let r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}const oo=new wt.H$("selectingCells");function so(t){for(let e=t.depth-1;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}function ao(t){let e=t.selection.$head;for(let t=e.depth;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return!0;return!1}function lo(t){let e=t.selection;return e.$anchorCell?e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell:e.node&&"cell"==e.node.type.spec.tableRole?e.$anchor:so(e.$head)||function(t){for(let e=t.nodeAfter,n=t.pos;e;e=e.firstChild,n++){let r=e.type.spec.tableRole;if("cell"==r||"header_cell"==r)return t.doc.resolve(n)}for(let e=t.nodeBefore,n=t.pos;e;e=e.lastChild,n--){let r=e.type.spec.tableRole;if("cell"==r||"header_cell"==r)return t.doc.resolve(n-e.nodeSize)}}(e.$head)}function co(t){return"row"==t.parent.type.spec.tableRole&&t.nodeAfter}function po(t,e){return t.depth==e.depth&&t.pos>=e.start(-1)&&t.pos<=e.end(-1)}function ho(t,e,n){let r=t.start(-1),i=no.get(t.node(-1)).nextCell(t.pos-r,e,n);return null==i?null:t.node(0).resolve(r+i)}function uo(t,e,n){let r={};for(let e in t)r[e]=t[e];return r[e]=n,r}function fo(t,e,n=1){let r=uo(t,"colspan",t.colspan-n);return r.colwidth&&(r.colwidth=r.colwidth.slice(),r.colwidth.splice(e,n),r.colwidth.some((t=>t>0))||(r.colwidth=null)),r}function mo(t,e,n=1){let r=uo(t,"colspan",t.colspan+n);if(r.colwidth){r.colwidth=r.colwidth.slice();for(let t=0;t<n;t++)r.colwidth.splice(e,0,0)}return r}class go extends wt.Y1{constructor(t,e=t){let n=t.node(-1),r=no.get(n),i=t.start(-1),o=r.rectBetween(t.pos-i,e.pos-i),s=t.node(0),a=r.cellsInRect(o).filter((t=>t!=e.pos-i));a.unshift(e.pos-i);let l=a.map((t=>{let e=n.nodeAt(t),r=t+i+1;return new wt.xm(s.resolve(r),s.resolve(r+e.content.size))}));super(l[0].$from,l[0].$to,l),this.$anchorCell=t,this.$headCell=e}map(t,e){let n=t.resolve(e.map(this.$anchorCell.pos)),r=t.resolve(e.map(this.$headCell.pos));if(co(n)&&co(r)&&po(n,r)){let t=this.$anchorCell.node(-1)!=n.node(-1);return t&&this.isRowSelection()?go.rowSelection(n,r):t&&this.isColSelection()?go.colSelection(n,r):new go(n,r)}return wt.Bs.between(n,r)}content(){let t=this.$anchorCell.node(-1),e=no.get(t),n=this.$anchorCell.start(-1),r=e.rectBetween(this.$anchorCell.pos-n,this.$headCell.pos-n),i={},o=[];for(let n=r.top;n<r.bottom;n++){let s=[];for(let o=n*e.width+r.left,a=r.left;a<r.right;a++,o++){let n=e.map[o];if(!i[n]){i[n]=!0;let o=e.findCell(n),a=t.nodeAt(n),l=r.left-o.left,c=o.right-r.right;if(l>0||c>0){let t=a.attrs;l>0&&(t=fo(t,0,l)),c>0&&(t=fo(t,t.colspan-c,c)),a=o.left<r.left?a.type.createAndFill(t):a.type.create(t,a.content)}if(o.top<r.top||o.bottom>r.bottom){let t=uo(a.attrs,"rowspan",Math.min(o.bottom,r.bottom)-Math.max(o.top,r.top));a=o.top<r.top?a.type.createAndFill(t):a.type.create(t,a.content)}s.push(a)}}o.push(t.child(n).copy(zn.HY.from(s)))}const s=this.isColSelection()&&this.isRowSelection()?t:o;return new zn.p2(zn.HY.from(s),1,1)}replace(t,e=zn.p2.empty){let n=t.steps.length,r=this.ranges;for(let i=0;i<r.length;i++){let{$from:o,$to:s}=r[i],a=t.mapping.slice(n);t.replace(a.map(o.pos),a.map(s.pos),i?zn.p2.empty:e)}let i=wt.Y1.findFrom(t.doc.resolve(t.mapping.slice(n).map(this.to)),-1);i&&t.setSelection(i)}replaceWith(t,e){this.replace(t,new zn.p2(zn.HY.from(e),0,0))}forEachCell(t){let e=this.$anchorCell.node(-1),n=no.get(e),r=this.$anchorCell.start(-1),i=n.cellsInRect(n.rectBetween(this.$anchorCell.pos-r,this.$headCell.pos-r));for(let n=0;n<i.length;n++)t(e.nodeAt(i[n]),r+i[n])}isColSelection(){let t=this.$anchorCell.index(-1),e=this.$headCell.index(-1);if(Math.min(t,e)>0)return!1;let n=t+this.$anchorCell.nodeAfter.attrs.rowspan,r=e+this.$headCell.nodeAfter.attrs.rowspan;return Math.max(n,r)==this.$headCell.node(-1).childCount}static colSelection(t,e=t){let n=no.get(t.node(-1)),r=t.start(-1),i=n.findCell(t.pos-r),o=n.findCell(e.pos-r),s=t.node(0);return i.top<=o.top?(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]))):(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]))),new go(t,e)}isRowSelection(){let t=no.get(this.$anchorCell.node(-1)),e=this.$anchorCell.start(-1),n=t.colCount(this.$anchorCell.pos-e),r=t.colCount(this.$headCell.pos-e);if(Math.min(n,r)>0)return!1;let i=n+this.$anchorCell.nodeAfter.attrs.colspan,o=r+this.$headCell.nodeAfter.attrs.colspan;return Math.max(i,o)==t.width}eq(t){return t instanceof go&&t.$anchorCell.pos==this.$anchorCell.pos&&t.$headCell.pos==this.$headCell.pos}static rowSelection(t,e=t){let n=no.get(t.node(-1)),r=t.start(-1),i=n.findCell(t.pos-r),o=n.findCell(e.pos-r),s=t.node(0);return i.left<=o.left?(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]))):(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]))),new go(t,e)}toJSON(){return{type:"cell",anchor:this.$anchorCell.pos,head:this.$headCell.pos}}static fromJSON(t,e){return new go(t.resolve(e.anchor),t.resolve(e.head))}static create(t,e,n=e){return new go(t.resolve(e),t.resolve(n))}getBookmark(){return new bo(this.$anchorCell.pos,this.$headCell.pos)}}go.prototype.visible=!1,wt.Y1.jsonID("cell",go);class bo{constructor(t,e){this.anchor=t,this.head=e}map(t){return new bo(t.map(this.anchor),t.map(this.head))}resolve(t){let e=t.resolve(this.anchor),n=t.resolve(this.head);return"row"==e.parent.type.spec.tableRole&&"row"==n.parent.type.spec.tableRole&&e.index()<e.parent.childCount&&n.index()<n.parent.childCount&&po(e,n)?new go(e,n):wt.Y1.near(n,1)}}function yo(t){if(!(t.selection instanceof go))return null;let e=[];return t.selection.forEachCell(((t,n)=>{e.push(xt.p.node(n,n+t.nodeSize,{class:"selectedCell"}))})),xt.EH.create(t.doc,e)}function Ao(t){if(!t.size)return null;let{content:e,openStart:n,openEnd:r}=t;for(;1==e.childCount&&(n>0&&r>0||"table"==e.firstChild.type.spec.tableRole);)n--,r--,e=e.firstChild.content;let i=e.firstChild,o=i.type.spec.tableRole,s=i.type.schema,a=[];if("row"==o)for(let t=0;t<e.childCount;t++){let i=e.child(t).content,o=t?0:Math.max(0,n-1),l=t<e.childCount-1?0:Math.max(0,r-1);(o||l)&&(i=wo(io(s).row,new zn.p2(i,o,l)).content),a.push(i)}else{if("cell"!=o&&"header_cell"!=o)return null;a.push(n||r?wo(io(s).row,new zn.p2(e,n,r)).content:e)}return function(t,e){let n=[];for(let t=0;t<e.length;t++){let r=e[t];for(let e=r.childCount-1;e>=0;e--){let{rowspan:i,colspan:o}=r.child(e).attrs;for(let e=t;e<t+i;e++)n[e]=(n[e]||0)+o}}let r=0;for(let t=0;t<n.length;t++)r=Math.max(r,n[t]);for(let i=0;i<n.length;i++)if(i>=e.length&&e.push(zn.HY.empty),n[i]<r){let o=io(t).cell.createAndFill(),s=[];for(let t=n[i];t<r;t++)s.push(o);e[i]=e[i].append(zn.HY.from(s))}return{height:e.length,width:r,rows:e}}(s,a)}function wo(t,e){let n=t.createAndFill();return new qt.wx(n).replace(0,n.content.size,e).doc}function vo(t,e,n,r,i,o,s,a){if(0==s||s==e.height)return!1;let l=!1;for(let c=i;c<o;c++){let i=s*e.width+c,o=e.map[i];if(e.map[i-e.width]==o){l=!0;let i=n.nodeAt(o),{top:d,left:p}=e.findCell(o);t.setNodeMarkup(t.mapping.slice(a).map(o+r),null,uo(i.attrs,"rowspan",s-d)),t.insert(t.mapping.slice(a).map(e.positionAt(s,p,n)),i.type.createAndFill(uo(i.attrs,"rowspan",d+i.attrs.rowspan-s))),c+=i.attrs.colspan-1}}return l}function _o(t,e,n,r,i,o,s,a){if(0==s||s==e.width)return!1;let l=!1;for(let c=i;c<o;c++){let i=c*e.width+s,o=e.map[i];if(e.map[i-1]==o){l=!0;let i=n.nodeAt(o),d=e.colCount(o),p=t.mapping.slice(a).map(o+r);t.setNodeMarkup(p,null,fo(i.attrs,s-d,i.attrs.colspan-(s-d))),t.insert(p+i.nodeSize,i.type.createAndFill(fo(i.attrs,0,s-d))),c+=i.attrs.rowspan-1}}return l}function xo(t,e,n,r,i){let o=n?t.doc.nodeAt(n-1):t.doc,s=no.get(o),{top:a,left:l}=r,c=l+i.width,d=a+i.height,p=t.tr,h=0;function u(){o=n?p.doc.nodeAt(n-1):p.doc,s=no.get(o),h=p.mapping.maps.length}(function(t,e,n,r,i,o,s){let a,l,c=io(t.doc.type.schema);if(i>e.width)for(let o=0,d=0;o<e.height;o++){let p=n.child(o);d+=p.nodeSize;let h,u=[];h=null==p.lastChild||p.lastChild.type==c.cell?a||(a=c.cell.createAndFill()):l||(l=c.header_cell.createAndFill());for(let t=e.width;t<i;t++)u.push(h);t.insert(t.mapping.slice(s).map(d-1+r),u)}if(o>e.height){let d=[];for(let t=0,r=(e.height-1)*e.width;t<Math.max(e.width,i);t++){let i=!(t>=e.width)&&n.nodeAt(e.map[r+t]).type==c.header_cell;d.push(i?l||(l=c.header_cell.createAndFill()):a||(a=c.cell.createAndFill()))}let p=c.row.create(null,zn.HY.from(d)),h=[];for(let t=e.height;t<o;t++)h.push(p);t.insert(t.mapping.slice(s).map(r+n.nodeSize-2),h)}return!(!a&&!l)})(p,s,o,n,c,d,h)&&u(),vo(p,s,o,n,l,c,a,h)&&u(),vo(p,s,o,n,l,c,d,h)&&u(),_o(p,s,o,n,a,d,l,h)&&u(),_o(p,s,o,n,a,d,c,h)&&u();for(let t=a;t<d;t++){let e=s.positionAt(t,l,o),r=s.positionAt(t,c,o);p.replace(p.mapping.slice(h).map(e+n),p.mapping.slice(h).map(r+n),new zn.p2(i.rows[t-a],0,0))}u(),p.setSelection(new go(p.doc.resolve(n+s.positionAt(a,l,o)),p.doc.resolve(n+s.positionAt(d-1,c-1,o)))),e(p)}const ko=(0,Dn.$)({ArrowLeft:Eo("horiz",-1),ArrowRight:Eo("horiz",1),ArrowUp:Eo("vert",-1),ArrowDown:Eo("vert",1),"Shift-ArrowLeft":So("horiz",-1),"Shift-ArrowRight":So("horiz",1),"Shift-ArrowUp":So("vert",-1),"Shift-ArrowDown":So("vert",1),Backspace:Bo,"Mod-Backspace":Bo,Delete:Bo,"Mod-Delete":Bo});function Co(t,e,n){return!n.eq(t.selection)&&(e&&e(t.tr.setSelection(n).scrollIntoView()),!0)}function Eo(t,e){return(n,r,i)=>{let o=n.selection;if(o instanceof go)return Co(n,r,wt.Y1.near(o.$headCell,e));if("horiz"!=t&&!o.empty)return!1;let s=Io(i,t,e);if(null==s)return!1;if("horiz"==t)return Co(n,r,wt.Y1.near(n.doc.resolve(o.head+e),e));{let i,o=n.doc.resolve(s),a=ho(o,t,e);return i=a?wt.Y1.near(a,1):e<0?wt.Y1.near(n.doc.resolve(o.before(-1)),-1):wt.Y1.near(n.doc.resolve(o.after(-1)),1),Co(n,r,i)}}}function So(t,e){return(n,r,i)=>{let o=n.selection;if(!(o instanceof go)){let r=Io(i,t,e);if(null==r)return!1;o=new go(n.doc.resolve(r))}let s=ho(o.$headCell,t,e);return!!s&&Co(n,r,new go(o.$anchorCell,s))}}function Bo(t,e){let n=t.selection;if(!(n instanceof go))return!1;if(e){let r=t.tr,i=io(t.schema).cell.createAndFill().content;n.forEachCell(((t,e)=>{t.content.eq(i)||r.replace(r.mapping.map(e+1),r.mapping.map(e+t.nodeSize-1),new zn.p2(i,0,0))})),r.docChanged&&e(r)}return!0}function Oo(t,e){let n=so(t.state.doc.resolve(e));return!!n&&(t.dispatch(t.state.tr.setSelection(new go(n))),!0)}function $o(t,e,n){if(!ao(t.state))return!1;let r=Ao(n),i=t.state.selection;if(i instanceof go){r||(r={width:1,height:1,rows:[zn.HY.from(wo(io(t.state.schema).cell,n))]});let e=i.$anchorCell.node(-1),o=i.$anchorCell.start(-1),s=no.get(e).rectBetween(i.$anchorCell.pos-o,i.$headCell.pos-o);return r=function({width:t,height:e,rows:n},r,i){if(t!=r){let e=[],i=[];for(let t=0;t<n.length;t++){let o=n[t],s=[];for(let n=e[t]||0,i=0;n<r;i++){let a=o.child(i%o.childCount);n+a.attrs.colspan>r&&(a=a.type.create(fo(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++)e[t+n]=(e[t+n]||0)+a.attrs.colspan}i.push(zn.HY.from(s))}n=i,t=r}if(e!=i){let t=[];for(let r=0,o=0;r<i;r++,o++){let s=[],a=n[o%e];for(let t=0;t<a.childCount;t++){let e=a.child(t);r+e.attrs.rowspan>i&&(e=e.type.create(uo(e.attrs,"rowspan",Math.max(1,i-e.attrs.rowspan)),e.content)),s.push(e)}t.push(zn.HY.from(s))}n=t,e=i}return{width:t,height:e,rows:n}}(r,s.right-s.left,s.bottom-s.top),xo(t.state,t.dispatch,o,s,r),!0}if(r){let e=lo(t.state),n=e.start(-1);return xo(t.state,t.dispatch,n,no.get(e.node(-1)).findCell(e.pos-n),r),!0}return!1}function Mo(t,e){if(e.ctrlKey||e.metaKey)return;let n,r=To(t,e.target);if(e.shiftKey&&t.state.selection instanceof go)i(t.state.selection.$anchorCell,e),e.preventDefault();else if(e.shiftKey&&r&&null!=(n=so(t.state.selection.$anchor))&&Lo(t,e).pos!=n.pos)i(n,e),e.preventDefault();else if(!r)return;function i(e,n){let r=Lo(t,n),i=null==oo.getState(t.state);if(!r||!po(e,r)){if(!i)return;r=e}let o=new go(e,r);if(i||!t.state.selection.eq(o)){let n=t.state.tr.setSelection(o);i&&n.setMeta(oo,e.pos),t.dispatch(n)}}function o(){t.root.removeEventListener("mouseup",o),t.root.removeEventListener("dragstart",o),t.root.removeEventListener("mousemove",s),null!=oo.getState(t.state)&&t.dispatch(t.state.tr.setMeta(oo,-1))}function s(n){let s,a=oo.getState(t.state);if(null!=a)s=t.state.doc.resolve(a);else if(To(t,n.target)!=r&&(s=Lo(t,e),!s))return o();s&&i(s,n)}t.root.addEventListener("mouseup",o),t.root.addEventListener("dragstart",o),t.root.addEventListener("mousemove",s)}function Io(t,e,n){if(!(t.state.selection instanceof wt.Bs))return null;let{$head:r}=t.state.selection;for(let i=r.depth-1;i>=0;i--){let o=r.node(i);if((n<0?r.index(i):r.indexAfter(i))!=(n<0?0:o.childCount))return null;if("cell"==o.type.spec.tableRole||"header_cell"==o.type.spec.tableRole){let o=r.before(i),s="vert"==e?n>0?"down":"up":n>0?"right":"left";return t.endOfTextblock(s)?o:null}}return null}function To(t,e){for(;e&&e!=t.dom;e=e.parentNode)if("TD"==e.nodeName||"TH"==e.nodeName)return e}function Lo(t,e){let n=t.posAtCoords({left:e.clientX,top:e.clientY});return n&&n?so(t.state.doc.resolve(n.pos)):null}const No=new wt.H$("fix-tables");function Ro(t,e,n,r){let i=t.childCount,o=e.childCount;t:for(let s=0,a=0;s<o;s++){let o=e.child(s);for(let e=a,r=Math.min(i,s+3);e<r;e++)if(t.child(e)==o){a=e+1,n+=o.nodeSize;continue t}r(o,n),a<i&&t.child(a).sameMarkup(o)?Ro(t.child(a),o,n+1,r):o.nodesBetween(0,o.content.size,r,n+1),n+=o.nodeSize}}function Po(t,e){let n,r=(e,r)=>{"table"==e.type.spec.tableRole&&(n=function(t,e,n,r){let i=no.get(e);if(!i.problems)return r;r||(r=t.tr);let o,s,a=[];for(let t=0;t<i.height;t++)a.push(0);for(let t=0;t<i.problems.length;t++){let o=i.problems[t];if("collision"==o.type){let t=e.nodeAt(o.pos);for(let e=0;e<t.attrs.rowspan;e++)a[o.row+e]+=o.n;r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,fo(t.attrs,t.attrs.colspan-o.n,o.n))}else if("missing"==o.type)a[o.row]+=o.n;else if("overlong_rowspan"==o.type){let t=e.nodeAt(o.pos);r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,uo(t.attrs,"rowspan",t.attrs.rowspan-o.n))}else if("colwidth mismatch"==o.type){let t=e.nodeAt(o.pos);r.setNodeMarkup(r.mapping.map(n+1+o.pos),null,uo(t.attrs,"colwidth",o.colwidth))}}for(let t=0;t<a.length;t++)a[t]&&(null==o&&(o=t),s=t);for(let l=0,c=n+1;l<i.height;l++){let n=e.child(l),i=c+n.nodeSize,d=a[l];if(d>0){let e="cell";n.firstChild&&(e=n.firstChild.type.spec.tableRole);let a=[];for(let n=0;n<d;n++)a.push(io(t.schema)[e].createAndFill());let p=0!=l&&o!=l-1||s!=l?i-1:c+1;r.insert(r.mapping.map(p),a)}c=i}return r.setMeta(No,{fixTables:!0})}(t,e,r,n))};return e?e.doc!=t.doc&&Ro(e.doc,t.doc,0,r):t.doc.descendants(r),n}function Do(t){let e,n=t.selection,r=lo(t),i=r.node(-1),o=r.start(-1),s=no.get(i);return e=n instanceof go?s.rectBetween(n.$anchorCell.pos-o,n.$headCell.pos-o):s.findCell(r.pos-o),e.tableStart=o,e.map=s,e.table=i,e}function zo(t,{map:e,tableStart:n,table:r},i){let o=i>0?-1:0;(function(t,e,n){let r=io(e.type.schema).header_cell;for(let i=0;i<t.height;i++)if(e.nodeAt(t.map[n+i*t.width]).type!=r)return!1;return!0})(e,r,i+o)&&(o=0==i||i==e.width?null:0);for(let s=0;s<e.height;s++){let a=s*e.width+i;if(i>0&&i<e.width&&e.map[a-1]==e.map[a]){let o=e.map[a],l=r.nodeAt(o);t.setNodeMarkup(t.mapping.map(n+o),null,mo(l.attrs,i-e.colCount(o))),s+=l.attrs.rowspan-1}else{let l=null==o?io(r.type.schema).cell:r.nodeAt(e.map[a+o]).type,c=e.positionAt(s,i,r);t.insert(t.mapping.map(n+c),l.createAndFill())}}return t}function Ho(t,{map:e,table:n,tableStart:r},i){let o=t.mapping.maps.length;for(let s=0;s<e.height;){let a=s*e.width+i,l=e.map[a],c=n.nodeAt(l);if(i>0&&e.map[a-1]==l||i<e.width-1&&e.map[a+1]==l)t.setNodeMarkup(t.mapping.slice(o).map(r+l),null,fo(c.attrs,i-e.colCount(l)));else{let e=t.mapping.slice(o).map(r+l);t.delete(e,e+c.nodeSize)}s+=c.attrs.rowspan}}function Uo(t,{map:e,tableStart:n,table:r},i){let o=n;for(let t=0;t<i;t++)o+=r.child(t).nodeSize;let s=[],a=i>0?-1:0;(function(t,e,n){let r=io(e.type.schema).header_cell;for(let i=0;i<t.width;i++)if(e.nodeAt(t.map[i+n*t.width]).type!=r)return!1;return!0})(e,r,i+a)&&(a=0==i||i==e.height?null:0);for(let o=0,l=e.width*i;o<e.width;o++,l++)if(i>0&&i<e.height&&e.map[l]==e.map[l-e.width]){let i=e.map[l],s=r.nodeAt(i).attrs;t.setNodeMarkup(n+i,null,uo(s,"rowspan",s.rowspan+1)),o+=s.colspan-1}else{let t=null==a?io(r.type.schema).cell:r.nodeAt(e.map[l+a*e.width]).type;s.push(t.createAndFill())}return t.insert(o,io(r.type.schema).row.create(null,s)),t}function jo(t,{map:e,table:n,tableStart:r},i){let o=0;for(let t=0;t<i;t++)o+=n.child(t).nodeSize;let s=o+n.child(i).nodeSize,a=t.mapping.maps.length;t.delete(o+r,s+r);for(let o=0,s=i*e.width;o<e.width;o++,s++){let l=e.map[s];if(i>0&&l==e.map[s-e.width]){let e=n.nodeAt(l).attrs;t.setNodeMarkup(t.mapping.slice(a).map(l+r),null,uo(e,"rowspan",e.rowspan-1)),o+=e.colspan-1}else if(i<e.width&&l==e.map[s+e.width]){let s=n.nodeAt(l),c=s.type.create(uo(s.attrs,"rowspan",s.attrs.rowspan-1),s.content),d=e.positionAt(i+1,o,n);t.insert(t.mapping.slice(a).map(r+d),c),o+=s.attrs.colspan-1}}}function Zo(t){let e=t.content;return 1==e.childCount&&e.firstChild.isTextblock&&0==e.firstChild.childCount}function Fo(t,e){let n=t.selection;if(!(n instanceof go)||n.$anchorCell.pos==n.$headCell.pos)return!1;let r=Do(t),{map:i}=r;if(function({width:t,height:e,map:n},r){let i=r.top*t+r.left,o=i,s=(r.bottom-1)*t+r.left,a=i+(r.right-r.left-1);for(let e=r.top;e<r.bottom;e++){if(r.left>0&&n[o]==n[o-1]||r.right<t&&n[a]==n[a+1])return!0;o+=t,a+=t}for(let o=r.left;o<r.right;o++){if(r.top>0&&n[i]==n[i-t]||r.bottom<e&&n[s]==n[s+t])return!0;i++,s++}return!1}(i,r))return!1;if(e){let n,o,s=t.tr,a={},l=zn.HY.empty;for(let t=r.top;t<r.bottom;t++)for(let e=r.left;e<r.right;e++){let c=i.map[t*i.width+e],d=r.table.nodeAt(c);if(!a[c])if(a[c]=!0,null==n)n=c,o=d;else{Zo(d)||(l=l.append(d.content));let t=s.mapping.map(c+r.tableStart);s.delete(t,t+d.nodeSize)}}if(s.setNodeMarkup(n+r.tableStart,null,uo(mo(o.attrs,o.attrs.colspan,r.right-r.left-o.attrs.colspan),"rowspan",r.bottom-r.top)),l.size){let t=n+1+o.content.size,e=Zo(o)?n+1:t;s.replaceWith(e+r.tableStart,t+r.tableStart,l)}s.setSelection(new go(s.doc.resolve(n+r.tableStart))),e(s)}return!0}function Vo(t,e){const n=io(t.schema);return(r=({node:t})=>n[t.type.spec.tableRole],(t,e)=>{let n,i,o=t.selection;if(o instanceof go){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;n=o.$anchorCell.nodeAfter,i=o.$anchorCell.pos}else{if(n=function(t){for(let e=t.depth;e>0;e--){const n=t.node(e).type.spec.tableRole;if("cell"===n||"header_cell"===n)return t.node(e)}return null}(o.$from),!n)return!1;i=so(o.$from).pos}if(1==n.attrs.colspan&&1==n.attrs.rowspan)return!1;if(e){let s=n.attrs,a=[],l=s.colwidth;s.rowspan>1&&(s=uo(s,"rowspan",1)),s.colspan>1&&(s=uo(s,"colspan",1));let c,d=Do(t),p=t.tr;for(let t=0;t<d.right-d.left;t++)a.push(l?uo(s,"colwidth",l&&l[t]?[l[t]]:null):s);for(let t=d.top;t<d.bottom;t++){let e=d.map.positionAt(t,d.left,d.table);t==d.top&&(e+=n.nodeSize);for(let i=d.left,o=0;i<d.right;i++,o++)i==d.left&&t==d.top||p.insert(c=p.mapping.map(e+d.tableStart,1),r({node:n,row:t,col:i}).createAndFill(a[o]))}p.setNodeMarkup(i,r({node:n,row:d.top,col:d.left}),a[0]),o instanceof go&&p.setSelection(new go(p.doc.resolve(o.$anchorCell.pos),c&&p.doc.resolve(c))),e(p)}return!0})(t,e);var r}function Yo(t,e,n){const r=e.map.cellsInRect({left:0,top:0,right:"row"==t?e.map.width:1,bottom:"column"==t?e.map.height:1});for(let t=0;t<r.length;t++){const i=e.table.nodeAt(r[t]);if(i&&i.type!==n.header_cell)return!1}return!0}function Wo(t,e){return(e=e||{useDeprecatedLogic:!1}).useDeprecatedLogic?function(t){return function(e,n){if(!ao(e))return!1;if(n){let r=io(e.schema),i=Do(e),o=e.tr,s=i.map.cellsInRect("column"==t?new eo(i.left,0,i.right,i.map.height):"row"==t?new eo(0,i.top,i.map.width,i.bottom):i),a=s.map((t=>i.table.nodeAt(t)));for(let t=0;t<s.length;t++)a[t].type==r.header_cell&&o.setNodeMarkup(i.tableStart+s[t],r.cell,a[t].attrs);if(0==o.steps.length)for(let t=0;t<s.length;t++)o.setNodeMarkup(i.tableStart+s[t],r.header_cell,a[t].attrs);n(o)}return!0}}(t):function(e,n){if(!ao(e))return!1;if(n){let r=io(e.schema),i=Do(e),o=e.tr,s=Yo("row",i,r),a=Yo("column",i,r),l=("column"===t?s:"row"===t&&a)?1:0,c="column"==t?new eo(0,l,1,i.map.height):"row"==t?new eo(l,0,i.map.width,1):i,d="column"==t?a?r.cell:r.header_cell:"row"==t?s?r.cell:r.header_cell:r.cell;i.map.cellsInRect(c).forEach((t=>{const e=t+i.tableStart,n=o.doc.nodeAt(e);n&&o.setNodeMarkup(e,d,n.attrs)})),n(o)}return!0}}Wo("row",{useDeprecatedLogic:!0}),Wo("column",{useDeprecatedLogic:!0});let qo=Wo("cell",{useDeprecatedLogic:!0});function Xo(t){return function(e,n){if(!ao(e))return!1;let r=function(t,e){if(e<0){let e=t.nodeBefore;if(e)return t.pos-e.nodeSize;for(let e=t.index(-1)-1,n=t.before();e>=0;e--){let r=t.node(-1).child(e);if(r.childCount)return n-1-r.lastChild.nodeSize;n-=r.nodeSize}}else{if(t.index()<t.parent.childCount-1)return t.pos+t.nodeAfter.nodeSize;let e=t.node(-1);for(let n=t.indexAfter(-1),r=t.after();n<e.childCount;n++){let t=e.child(n);if(t.childCount)return r+1;r+=t.nodeSize}}}(lo(e),t);if(null!=r){if(n){let t=e.doc.resolve(r);n(e.tr.setSelection(wt.Bs.between(t,(i=t,i.node(0).resolve(i.pos+i.nodeAfter.nodeSize)))).scrollIntoView())}var i;return!0}}}class Go{constructor(t,e){this.node=t,this.cellMinWidth=e,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")),Ko(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type==this.node.type&&(this.node=t,Ko(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return"attributes"==t.type&&(t.target==this.table||this.colgroup.contains(t.target))}}function Ko(t,e,n,r,i,o){let s=0,a=!0,l=e.firstChild,c=t.firstChild;for(let t=0,n=0;t<c.childCount;t++){let{colspan:d,colwidth:p}=c.child(t).attrs;for(let t=0;t<d;t++,n++){let c=i==n?o:p&&p[t],d=c?c+"px":"";s+=c||r,c||(a=!1),l?(l.style.width!=d&&(l.style.width=d),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=d}}for(;l;){let t=l.nextSibling;l.parentNode.removeChild(l),l=t}a?(n.style.width=s+"px",n.style.minWidth=""):(n.style.width="",n.style.minWidth=s+"px")}const Jo=new wt.H$("tableColumnResizing");function Qo({handleWidth:t=5,cellMinWidth:e=25,View:n=Go,lastColumnResizable:r=!0}={}){let i=new wt.Sy({key:Jo,state:{init(t,r){return this.spec.props.nodeViews[io(r.schema).table.name]=(t,r)=>new n(t,e,r),new ts(-1,!1)},apply:(t,e)=>e.apply(t)},props:{attributes:t=>Jo.getState(t).activeHandle>-1?{class:"resize-cursor"}:null,handleDOMEvents:{mousemove(e,n){!function(t,e,n,r,i){let o=Jo.getState(t.state);if(!o.dragging){let r=function(t){for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.classList.contains("ProseMirror")?null:t.parentNode;return t}(e.target),s=-1;if(r){let{left:i,right:o}=r.getBoundingClientRect();e.clientX-i<=n?s=es(t,e,"left"):o-e.clientX<=n&&(s=es(t,e,"right"))}if(s!=o.activeHandle){if(!i&&-1!==s){let e=t.state.doc.resolve(s),n=e.node(-1),r=no.get(n),i=e.start(-1);if(r.colCount(e.pos-i)+e.nodeAfter.attrs.colspan-1==r.width-1)return}rs(t,s)}}}(e,n,t,0,r)},mouseleave(t){!function(t){let e=Jo.getState(t.state);e.activeHandle>-1&&!e.dragging&&rs(t,-1)}(t)},mousedown(t,n){!function(t,e,n){let r=Jo.getState(t.state);if(-1==r.activeHandle||r.dragging)return!1;let i=t.state.doc.nodeAt(r.activeHandle),o=function(t,e,{colspan:n,colwidth:r}){let i=r&&r[r.length-1];if(i)return i;let o=t.domAtPos(e),s=o.node.childNodes[o.offset].offsetWidth,a=n;if(r)for(let t=0;t<n;t++)r[t]&&(s-=r[t],a--);return s/a}(t,r.activeHandle,i.attrs);function s(e){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);let r=Jo.getState(t.state);r.dragging&&(!function(t,e,n){let r=t.state.doc.resolve(e),i=r.node(-1),o=no.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let t=0;t<o.height;t++){let e=t*o.width+a;if(t&&o.map[e]==o.map[e-o.width])continue;let r=o.map[e],{attrs:c}=i.nodeAt(r),d=1==c.colspan?0:a-o.colCount(r);if(c.colwidth&&c.colwidth[d]==n)continue;let p=c.colwidth?c.colwidth.slice():is(c.colspan);p[d]=n,l.setNodeMarkup(s+r,null,uo(c,"colwidth",p))}l.docChanged&&t.dispatch(l)}(t,r.activeHandle,ns(r.dragging,e,n)),t.dispatch(t.state.tr.setMeta(Jo,{setDragging:null})))}function a(e){if(!e.which)return s(e);let r=Jo.getState(t.state),i=ns(r.dragging,e,n);!function(t,e,n,r){let i=t.state.doc.resolve(e),o=i.node(-1),s=i.start(-1),a=no.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1,l=t.domAtPos(i.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;Ko(o,l.firstChild,l,r,a,n)}(t,r.activeHandle,i,n)}t.dispatch(t.state.tr.setMeta(Jo,{setDragging:{startX:e.clientX,startWidth:o}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),e.preventDefault()}(t,n,e)}},decorations(t){let e=Jo.getState(t);if(e.activeHandle>-1)return function(t,e){let n=[],r=t.doc.resolve(e),i=r.node(-1),o=no.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan;for(let t=0;t<o.height;t++){let e=a+t*o.width-1;if(!(a!=o.width&&o.map[e]==o.map[e+1]||0!=t&&o.map[e-1]==o.map[e-1-o.width])){let t=o.map[e],r=s+t+i.nodeAt(t).nodeSize-1,a=document.createElement("div");a.className="column-resize-handle",n.push(xt.p.widget(r,a))}}return xt.EH.create(t.doc,n)}(t,e.activeHandle)},nodeViews:{}}});return i}class ts{constructor(t,e){this.activeHandle=t,this.dragging=e}apply(t){let e=this,n=t.getMeta(Jo);if(n&&null!=n.setHandle)return new ts(n.setHandle,null);if(n&&void 0!==n.setDragging)return new ts(e.activeHandle,n.setDragging);if(e.activeHandle>-1&&t.docChanged){let n=t.mapping.map(e.activeHandle,-1);co(t.doc.resolve(n))||(n=null),e=new ts(n,e.dragging)}return e}}function es(t,e,n){let r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return-1;let{pos:i}=r,o=so(t.state.doc.resolve(i));if(!o)return-1;if("right"==n)return o.pos;let s=no.get(o.node(-1)),a=o.start(-1),l=s.map.indexOf(o.pos-a);return l%s.width==0?-1:a+s.map[l-1]}function ns(t,e,n){let r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function rs(t,e){t.dispatch(t.state.tr.setMeta(Jo,{setHandle:e}))}function is(t){let e=[];for(let n=0;n<t;n++)e.push(0);return e}function os({allowTableNodeSelection:t=!1}={}){return new wt.Sy({key:oo,state:{init:()=>null,apply(t,e){let n=t.getMeta(oo);if(null!=n)return-1==n?null:n;if(null==e||!t.docChanged)return e;let{deleted:r,pos:i}=t.mapping.mapResult(e);return r?null:i}},props:{decorations:yo,handleDOMEvents:{mousedown:Mo},createSelectionBetween(t){if(null!=oo.getState(t.state))return t.state.selection},handleTripleClick:Oo,handleKeyDown:ko,handlePaste:$o},appendTransaction:(e,n,r)=>function(t,e,n){let r,i,o=(e||t).selection,s=(e||t).doc;if(o instanceof wt.qv&&(i=o.node.type.spec.tableRole)){if("cell"==i||"header_cell"==i)r=go.create(s,o.from);else if("row"==i){let t=s.resolve(o.from+1);r=go.rowSelection(t,t)}else if(!n){let t=no.get(o.node),e=o.from+1,n=e+t.map[t.width*t.height-1];r=go.create(s,e+1,n)}}else o instanceof wt.Bs&&function({$from:t,$to:e}){if(t.pos==e.pos||t.pos<t.pos-6)return!1;let n=t.pos,r=e.pos,i=t.depth;for(;i>=0&&!(t.after(i+1)<t.end(i));i--,n++);for(let t=e.depth;t>=0&&!(e.before(t+1)>e.start(t));t--,r--);return n==r&&/row|table/.test(t.node(i).type.spec.tableRole)}(o)?r=wt.Bs.create(s,o.from):o instanceof wt.Bs&&function({$from:t,$to:e}){let n,r;for(let e=t.depth;e>0;e--){let r=t.node(e);if("cell"===r.type.spec.tableRole||"header_cell"===r.type.spec.tableRole){n=r;break}}for(let t=e.depth;t>0;t--){let n=e.node(t);if("cell"===n.type.spec.tableRole||"header_cell"===n.type.spec.tableRole){r=n;break}}return n!==r&&0===e.parentOffset}(o)&&(r=wt.Bs.create(s,o.$from.start(),o.$from.end()));return r&&(e||(e=t.tr)).setSelection(r),e}(r,Po(r,n),t)})}function ss(t,e){return e?t.createChecked(null,e):t.createAndFill()}function as(t,e,n,r,i){const o=function(t){if(t.cached.tableNodeTypes)return t.cached.tableNodeTypes;const e={};return Object.keys(t.nodes).forEach((n=>{const r=t.nodes[n];r.spec.tableRole&&(e[r.spec.tableRole]=r)})),t.cached.tableNodeTypes=e,e}(t),s=[],a=[];for(let t=0;t<n;t+=1){const t=ss(o.cell,i);if(t&&a.push(t),r){const t=ss(o.header_cell,i);t&&s.push(t)}}const l=[];for(let t=0;t<e;t+=1)l.push(o.row.createChecked(null,r&&0===t?s:a));return o.table.createChecked(null,l)}const ls=t=>{let{editor:e}=t;const{selection:n}=e.state;if(!(n instanceof go))return!1;let r=0;const i=(0,At.qv)(n.ranges[0].$from,(t=>"table"===t.type.name));i?.node.descendants((t=>{if("table"===t.type.name)return!1;["tableCell","tableHeader"].includes(t.type.name)&&(r+=1)}));return r===n.ranges.length&&(e.commands.deleteTable(),!0)};function cs(t,e,n,r,i,o){let s=0,a=!0,l=e.firstChild;const c=t.firstChild;for(let t=0,n=0;t<c.childCount;t+=1){const{colspan:d,colwidth:p}=c.child(t).attrs;for(let t=0;t<d;t+=1,n+=1){const c=i===n?o:p&&p[t],d=c?`${c}px`:"";s+=c||r,c||(a=!1),l?(l.style.width!==d&&(l.style.width=d),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=d}}for(;l;){const t=l.nextSibling;l.parentNode.removeChild(l),l=t}n.style.width="50%"}class ds{constructor(t,e){this.node=t,this.cellMinWidth=e,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")),cs(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type===this.node.type&&(this.node=t,cs(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return"attributes"===t.type&&(t.target===this.table||this.colgroup.contains(t.target))}}function ps(t,e,n,r,i,o){let s=0,a=!0,l=e.firstChild;const c=t.firstChild;for(let t=0,n=0;t<c.childCount;t+=1){const{colspan:d,colwidth:p}=c.child(t).attrs;for(let t=0;t<d;t+=1,n+=1){const c=i===n?o:p&&p[t],d=c?`${c}px`:"";s+=c||r,c||(a=!1),l?(l.style.width!==d&&(l.style.width=d),l=l.nextSibling):e.appendChild(document.createElement("col")).style.width=d}}for(;l;){const t=l.nextSibling;l.parentNode.removeChild(l),l=t}}class hs{constructor(t,e,n,r){const{width:i}=r;this.node=t,this.cellMinWidth=e,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=i,this.colgroup=this.table.appendChild(document.createElement("colgroup")),ps(t,this.colgroup,this.table,e),this.contentDOM=this.table.appendChild(document.createElement("tbody"))}update(t){return t.type===this.node.type&&(this.node=t,ps(t,this.colgroup,this.table,this.cellMinWidth),!0)}ignoreMutation(t){return"attributes"===t.type&&(t.target===this.table||this.colgroup.contains(t.target))}}let us,fs;if("undefined"!=typeof WeakMap){let t=new WeakMap;us=e=>t.get(e),fs=(e,n)=>(t.set(e,n),n)}else{let t=[],e=10,n=0;us=e=>{for(let n=0;n<t.length;n+=2)if(t[n]==e)return t[n+1]},fs=(r,i)=>(n==e&&(n=0),t[n++]=r,t[n++]=i)}class ms{constructor(t,e,n,r){this.left=t,this.top=e,this.right=n,this.bottom=r}}class gs{constructor(t,e,n,r){this.width=t,this.height=e,this.map=n,this.problems=r}findCell(t){for(let e=0;e<this.map.length;e++){let n=this.map[e];if(n!=t)continue;let r=e%this.width,i=e/this.width|0,o=r+1,s=i+1;for(let t=1;o<this.width&&this.map[e+t]==n;t++)o++;for(let t=1;s<this.height&&this.map[e+this.width*t]==n;t++)s++;return new ms(r,i,o,s)}throw new RangeError("No cell with offset "+t+" found")}colCount(t){for(let e=0;e<this.map.length;e++)if(this.map[e]==t)return e%this.width;throw new RangeError("No cell with offset "+t+" found")}nextCell(t,e,n){let{left:r,right:i,top:o,bottom:s}=this.findCell(t);return"horiz"==e?(n<0?0==r:i==this.width)?null:this.map[o*this.width+(n<0?r-1:i)]:(n<0?0==o:s==this.height)?null:this.map[r+this.width*(n<0?o-1:s)]}rectBetween(t,e){let{left:n,right:r,top:i,bottom:o}=this.findCell(t),{left:s,right:a,top:l,bottom:c}=this.findCell(e);return new ms(Math.min(n,s),Math.min(i,l),Math.max(r,a),Math.max(o,c))}cellsInRect(t){let e=[],n={};for(let r=t.top;r<t.bottom;r++)for(let i=t.left;i<t.right;i++){let o=r*this.width+i,s=this.map[o];n[s]||(n[s]=!0,i==t.left&&i&&this.map[o-1]==s||r==t.top&&r&&this.map[o-this.width]==s||e.push(s))}return e}positionAt(t,e,n){for(let r=0,i=0;;r++){let o=i+n.child(r).nodeSize;if(r==t){let n=e+t*this.width,r=(t+1)*this.width;for(;n<r&&this.map[n]<i;)n++;return n==r?o-1:this.map[n]}i=o}}static get(t){return us(t)||fs(t,function(t){if("table"!=t.type.spec.tableRole)throw new RangeError("Not a table node: "+t.type.name);let e=function(t){let e=-1,n=!1;for(let r=0;r<t.childCount;r++){let i=t.child(r),o=0;if(n)for(let e=0;e<r;e++){let n=t.child(e);for(let t=0;t<n.childCount;t++){let i=n.child(t);e+i.attrs.rowspan>r&&(o+=i.attrs.colspan)}}for(let t=0;t<i.childCount;t++){let e=i.child(t);o+=e.attrs.colspan,e.attrs.rowspan>1&&(n=!0)}-1==e?e=o:e!=o&&(e=Math.max(e,o))}return e}(t),n=t.childCount,r=[],i=0,o=null,s=[];for(let t=0,i=e*n;t<i;t++)r[t]=0;for(let a=0,l=0;a<n;a++){let c=t.child(a);l++;for(let t=0;;t++){for(;i<r.length&&0!=r[i];)i++;if(t==c.childCount)break;let d=c.child(t),{colspan:p,rowspan:h,colwidth:u}=d.attrs;for(let t=0;t<h;t++){if(t+a>=n){(o||(o=[])).push({type:"overlong_rowspan",pos:l,n:h-t});break}let c=i+t*e;for(let t=0;t<p;t++){0==r[c+t]?r[c+t]=l:(o||(o=[])).push({type:"collision",row:a,pos:l,n:p-t});let n=u&&u[t];if(n){let r=(c+t)%e*2,i=s[r];null==i||i!=n&&1==s[r+1]?(s[r]=n,s[r+1]=1):i==n&&s[r+1]++}}}i+=p,l+=d.nodeSize}let d=(a+1)*e,p=0;for(;i<d;)0==r[i++]&&p++;p&&(o||(o=[])).push({type:"missing",row:a,n:p}),l++}let a=new gs(e,n,r,o),l=!1;for(let t=0;!l&&t<s.length;t+=2)null!=s[t]&&s[t+1]<n&&(l=!0);l&&function(t,e,n){t.problems||(t.problems=[]);for(let r=0,i={};r<t.map.length;r++){let o=t.map[r];if(i[o])continue;i[o]=!0;let s=n.nodeAt(o),a=null;for(let n=0;n<s.attrs.colspan;n++){let i=e[2*((r+n)%t.width)];null==i||s.attrs.colwidth&&s.attrs.colwidth[n]==i||((a||(a=bs(s.attrs)))[n]=i)}a&&t.problems.unshift({type:"colwidth mismatch",pos:o,colwidth:a})}}(a,s,t);return a}(t))}}function bs(t){if(t.colwidth)return t.colwidth.slice();let e=[];for(let n=0;n<t.colspan;n++)e.push(0);return e}new wt.H$("selectingCells");function ys(t){for(let e=t.depth-1;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return t.node(0).resolve(t.before(e+1));return null}function As(t,e,n){let r={};for(let e in t)r[e]=t[e];return r[e]=n,r}const ws=new wt.H$("tableColumnSimple");function vs(){let{handleWidth:t=5,cellMinWidth:e=25,width:n="100%",View:r=hs,lastColumnResizable:i=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=new wt.Sy({key:ws,state:{init(t,i){return this.spec.props.nodeViews[function(t){let e=t.cached.tableNodeTypes;if(!e){e=t.cached.tableNodeTypes={};for(let n in t.nodes){let r=t.nodes[n],i=r.spec.tableRole;i&&(e[i]=r)}}return e}(i.schema).table.name]=(t,i)=>new r(t,e,i,{width:n}),new _s(-1,!1)},apply:(t,e)=>e.apply(t)},props:{attributes:t=>ws.getState(t).activeHandle>-1?{class:"resize-cursor"}:null,handleDOMEvents:{mousemove(e,n){!function(t,e,n,r,i){let o=ws.getState(t.state);if(!o.dragging){let r=function(t){for(;t&&"TD"!=t.nodeName&&"TH"!=t.nodeName;)t=t.classList.contains("ProseMirror")?null:t.parentNode;return t}(e.target),s=-1;if(r){let{left:i,right:o}=r.getBoundingClientRect();e.clientX-i<=n?s=xs(t,e,"left"):o-e.clientX<=n&&(s=xs(t,e,"right"))}if(s!=o.activeHandle){if(!i&&-1!==s){let e=t.state.doc.resolve(s),n=e.node(-1),r=gs.get(n),i=e.start(-1);if(r.colCount(e.pos-i)+e.nodeAfter.attrs.colspan-1==r.width-1)return}Cs(t,s)}}}(e,n,t,0,i)},mouseleave(t){!function(t){let e=ws.getState(t.state);e.activeHandle>-1&&!e.dragging&&Cs(t,-1)}(t)},mousedown(t,n){!function(t,e,n){let r=ws.getState(t.state);if(-1==r.activeHandle||r.dragging)return!1;let i=t.state.doc.nodeAt(r.activeHandle),o=function(t,e,n){let{colspan:r,colwidth:i}=n,o=i&&i[i.length-1];if(o)return o;let s=t.domAtPos(e),a=s.node.childNodes[s.offset].offsetWidth,l=r;if(i)for(let t=0;t<r;t++)i[t]&&(a-=i[t],l--);return a/l}(t,r.activeHandle,i.attrs);function s(e){window.removeEventListener("mouseup",s),window.removeEventListener("mousemove",a);let r=ws.getState(t.state);r.dragging&&(!function(t,e,n){let r=t.state.doc.resolve(e),i=r.node(-1),o=gs.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan-1,l=t.state.tr;for(let t=0;t<o.height;t++){let e=t*o.width+a;if(t&&o.map[e]==o.map[e-o.width])continue;let r=o.map[e],{attrs:c}=i.nodeAt(r),d=1==c.colspan?0:a-o.colCount(r);if(c.colwidth&&c.colwidth[d]==n)continue;let p=c.colwidth?c.colwidth.slice():Es(c.colspan);p[d]=n,l.setNodeMarkup(s+r,null,As(c,"colwidth",p))}l.docChanged&&t.dispatch(l)}(t,r.activeHandle,ks(r.dragging,e,n)),t.dispatch(t.state.tr.setMeta(ws,{setDragging:null})))}function a(e){if(!e.which)return s(e);let r=ws.getState(t.state),i=ks(r.dragging,e,n);!function(t,e,n,r){let i=t.state.doc.resolve(e),o=i.node(-1),s=i.start(-1),a=gs.get(o).colCount(i.pos-s)+i.nodeAfter.attrs.colspan-1,l=t.domAtPos(i.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;ps(o,l.firstChild,0,r,a,n)}(t,r.activeHandle,i,n)}t.dispatch(t.state.tr.setMeta(ws,{setDragging:{startX:e.clientX,startWidth:o}})),window.addEventListener("mouseup",s),window.addEventListener("mousemove",a),e.preventDefault()}(t,n,e)}},decorations(t){let e=ws.getState(t);if(e.activeHandle>-1)return function(t,e){let n=[],r=t.doc.resolve(e),i=r.node(-1),o=gs.get(i),s=r.start(-1),a=o.colCount(r.pos-s)+r.nodeAfter.attrs.colspan;for(let t=0;t<o.height;t++){let e=a+t*o.width-1;if(!(a!=o.width&&o.map[e]==o.map[e+1]||0!=t&&o.map[e-1]==o.map[e-1-o.width])){let t=o.map[e],r=s+t+i.nodeAt(t).nodeSize-1,a=document.createElement("div");a.className="column-resize-handle",n.push(xt.p.widget(r,a))}}return xt.EH.create(t.doc,n)}(t,e.activeHandle)},nodeViews:{}}});return o}class _s{constructor(t,e){this.activeHandle=t,this.dragging=e}apply(t){let e=this,n=t.getMeta(ws);if(n&&null!=n.setHandle)return new _s(n.setHandle,null);if(n&&void 0!==n.setDragging)return new _s(e.activeHandle,n.setDragging);if(e.activeHandle>-1&&t.docChanged){let n=t.mapping.map(e.activeHandle,-1);"row"==(r=t.doc.resolve(n)).parent.type.spec.tableRole&&r.nodeAfter||(n=null),e=new _s(n,e.dragging)}var r;return e}}function xs(t,e,n){let r=t.posAtCoords({left:e.clientX,top:e.clientY});if(!r)return-1;let{pos:i}=r,o=ys(t.state.doc.resolve(i));if(!o)return-1;if("right"==n)return o.pos;let s=gs.get(o.node(-1)),a=o.start(-1),l=s.map.indexOf(o.pos-a);return l%s.width==0?-1:a+s.map[l-1]}function ks(t,e,n){let r=e.clientX-t.startX;return Math.max(n,t.startWidth+r)}function Cs(t,e){t.dispatch(t.state.tr.setMeta(ws,{setHandle:e}))}function Es(t){let e=[];for(let n=0;n<t;n++)e.push(0);return e}const Ss=At.NB.create({name:"table",addOptions:()=>({HTMLAttributes:{},resizable:!1,handleWidth:5,cellMinWidth:25,color:"red",width:"100%",View:hs,ReiszeView:ds,lastColumnResizable:!0,allowTableNodeSelection:!1}),content:"tableRow+",tableRole:"table",isolating:!0,group:"block",parseHTML:()=>[{tag:"table"}],renderHTML(t){let{HTMLAttributes:e}=t;return["table",(0,At.P1)(this.options.HTMLAttributes,e),["tbody",0]]},addCommands:()=>({insertTable:function(){let{rows:t=3,cols:e=3,withHeaderRow:n=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r=>{let{tr:i,dispatch:o,editor:s}=r;const a=as(s.schema,t,e,n);if(o){const t=i.selection.anchor+1;i.replaceSelectionWith(a).scrollIntoView().setSelection(wt.Bs.near(i.doc.resolve(t)))}return!0}},addColumnBefore:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){if(!ao(t))return!1;if(e){let n=Do(t);e(zo(t.tr,n,n.left))}return!0}(e,n)},addColumnAfter:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){if(!ao(t))return!1;if(e){let n=Do(t);e(zo(t.tr,n,n.right))}return!0}(e,n)},deleteColumn:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){if(!ao(t))return!1;if(e){let n=Do(t),r=t.tr;if(0==n.left&&n.right==n.map.width)return!1;for(let t=n.right-1;Ho(r,n,t),t!=n.left;t--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=no.get(n.table);e(r)}return!0}(e,n)},addRowBefore:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){if(!ao(t))return!1;if(e){let n=Do(t);e(Uo(t.tr,n,n.top))}return!0}(e,n)},addRowAfter:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){if(!ao(t))return!1;if(e){let n=Do(t);e(Uo(t.tr,n,n.bottom))}return!0}(e,n)},deleteRow:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){if(!ao(t))return!1;if(e){let n=Do(t),r=t.tr;if(0==n.top&&n.bottom==n.map.height)return!1;for(let t=n.bottom-1;jo(r,n,t),t!=n.top;t--)n.table=n.tableStart?r.doc.nodeAt(n.tableStart-1):r.doc,n.map=no.get(n.table);e(r)}return!0}(e,n)},deleteTable:()=>t=>{let{state:e,dispatch:n}=t;return function(t,e){let n=t.selection.$anchor;for(let r=n.depth;r>0;r--)if("table"==n.node(r).type.spec.tableRole)return e&&e(t.tr.delete(n.before(r),n.after(r)).scrollIntoView()),!0;return!1}(e,n)},mergeCells:()=>t=>{let{state:e,dispatch:n}=t;return Fo(e,n)},splitCell:()=>t=>{let{state:e,dispatch:n}=t;return Vo(e,n)},toggleHeaderColumn:()=>t=>{let{state:e,dispatch:n}=t;return Wo("column")(e,n)},toggleHeaderRow:()=>t=>{let{state:e,dispatch:n}=t;return Wo("row")(e,n)},toggleHeaderCell:()=>t=>{let{state:e,dispatch:n}=t;return qo(e,n)},mergeOrSplit:()=>t=>{let{state:e,dispatch:n}=t;return!!Fo(e,n)||Vo(e,n)},setCellAttribute:(t,e)=>n=>{let{state:r,dispatch:i}=n;return function(t,e){return function(n,r){if(!ao(n))return!1;let i=lo(n);if(i.nodeAfter.attrs[t]===e)return!1;if(r){let o=n.tr;n.selection instanceof go?n.selection.forEachCell(((n,r)=>{n.attrs[t]!==e&&o.setNodeMarkup(r,null,uo(n.attrs,t,e))})):o.setNodeMarkup(i.pos,null,uo(i.nodeAfter.attrs,t,e)),r(o)}return!0}}(t,e)(r,i)},goToNextCell:()=>t=>{let{state:e,dispatch:n}=t;return Xo(1)(e,n)},goToPreviousCell:()=>t=>{let{state:e,dispatch:n}=t;return Xo(-1)(e,n)},fixTables:()=>t=>{let{state:e,dispatch:n}=t;return n&&Po(e),!0},setCellSelection:t=>e=>{let{tr:n,dispatch:r}=e;if(r){const e=go.create(n.doc,t.anchorCell,t.headCell);n.setSelection(e)}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:ls,"Mod-Backspace":ls,Delete:ls,"Mod-Delete":ls}},addProseMirrorPlugins(){return[...this.options.resizable&&this.editor.isEditable?[Qo({handleWidth:this.options.handleWidth,cellMinWidth:this.options.cellMinWidth,View:this.options.ReiszeView,lastColumnResizable:this.options.lastColumnResizable})]:[vs({View:this.options.View,width:this.options.width})],os({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(t){const e={name:t.name,options:t.options,storage:t.storage};return{tableRole:(0,At.nU)((0,At.Nl)(t,"tableRole",e))}}}),Bs=Ss,Os=At.NB.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:t=>t.width},height:{default:"auto",parseHTML:t=>t.height},background:{default:"#000",parseHTML:t=>t.getAttribute("background")}}),parseHTML:()=>[{tag:"button",priority:51}],renderHTML(t){let{HTMLAttributes:e}=t;return["button",(0,At.P1)(e),0]},addCommands(){return{toggleButton:()=>t=>{let{commands:e,editor:n}=t;return e.insertContent({type:this.name,attrs:this.options}),!0},setButtonStyles:t=>e=>{const{commands:n,editor:r}=e,i=(0,At.P1)({background:this.options.background,width:this.options.width,height:this.options.height},t);return i.style=`\n background: ${i.background};\n width: ${i.width};\n height: ${i.height};`,n.updateAttributes(this.name,i),!0}}},addNodeView:()=>()=>{const t=document.createElement("button");t.contentEditable=!1,t.classList.add("node-view");const e=document.createElement("div");return e.innerHTML="button",e.contentEditable=!0,e.classList.add("content"),t.append(e),{dom:t,contentDOM:e}}}),$s=At.NB.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),content:"(tableCell | tableHeader)*",tableRole:"row",parseHTML:()=>[{tag:"tr"}],renderHTML({HTMLAttributes:t}){return["tr",(0,At.P1)(this.options.HTMLAttributes,t),0]}});const Ms=At.NB.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({borderColor:{default:"#ced4da"},colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?[parseInt(e,10)]:null}}}),tableRole:"cell",isolating:!0,parseHTML:()=>[{tag:"td"}],renderHTML(t){let{HTMLAttributes:e}=t;const n=`border-color:${e.borderColor}`;return e.style=n,["td",(0,At.P1)(this.options.HTMLAttributes,e),0]}}),Is=At.NB.create({name:"tableHeader",addOptions:()=>({HTMLAttributes:{}}),content:"block+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1},colwidth:{default:null,parseHTML:t=>{const e=t.getAttribute("colwidth");return e?e.split(",").map((t=>parseInt(t,10))):null}}}),tableRole:"header_cell",isolating:!0,parseHTML:()=>[{tag:"th"}],renderHTML({HTMLAttributes:t}){return["th",(0,At.P1)(this.options.HTMLAttributes,t),0]}}),Ts=At.hj.create({name:"backgroundColor",addOptions:()=>({types:["textStyle"]}),addGlobalAttributes(){return[{types:this.options.types,attributes:{backgroundColor:{default:null,parseHTML:t=>t.style.backgroundColor.replace(/['"]+/g,""),renderHTML:t=>t.backgroundColor?{style:`background: ${t.backgroundColor}`}:{}}}}]},addCommands:()=>({setBackgroundColor:t=>e=>{let{chain:n}=e;return n().setMark("textStyle",{backgroundColor:t}).run()},unsetBackgroundColor:()=>t=>{let{chain:e}=t;return e().setMark("textStyle",{backgroundColor:null}).removeEmptyTextStyle().run()}})}),Ls=At.hj.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:t=>t.style.textAlign||this.options.defaultAlignment,renderHTML:t=>({style:`text-align: ${t.textAlign}`})}}}]},addCommands(){return{setTextAlign:t=>e=>{let{commands:n}=e;return!!this.options.alignments.includes(t)&&this.options.types.every((e=>n.updateAttributes(e,{textAlign:t})))},unsetTextAlign:()=>t=>{let{commands:e}=t;return this.options.types.every((t=>e.resetAttributes(t,"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 Ns=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),Rs=["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"],Ps=["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"],Ds=["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"],zs=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],Hs=["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 Us="[0-9](_*[0-9])*",js=`\\.(${Us})`,Zs="[0-9a-fA-F](_*[0-9a-fA-F])*",Fs={className:"number",variants:[{begin:`(\\b(${Us})((${js})|\\.)?|(${js}))[eE][+-]?(${Us})[fFdD]?\\b`},{begin:`\\b(${Us})((${js})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${js})[fFdD]?\\b`},{begin:`\\b(${Us})[fFdD]\\b`},{begin:`\\b0[xX]((${Zs})\\.?|(${Zs})?\\.(${Zs}))[pP][+-]?(${Us})[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};function Vs(t,e,n){return-1===n?"":t.replace(e,(r=>Vs(t,e,n-1)))}const Ys="[A-Za-z$_][0-9A-Za-z$_]*",Ws=["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"],qs=["true","false","null","undefined","NaN","Infinity"],Xs=["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"],Gs=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ks=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Js=["arguments","this","super","console","window","document","localStorage","module","global"],Qs=[].concat(Ks,Xs,Gs);var ta="[0-9](_*[0-9])*",ea=`\\.(${ta})`,na="[0-9a-fA-F](_*[0-9a-fA-F])*",ra={className:"number",variants:[{begin:`(\\b(${ta})((${ea})|\\.)?|(${ea}))[eE][+-]?(${ta})[fFdD]?\\b`},{begin:`\\b(${ta})((${ea})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${ea})[fFdD]?\\b`},{begin:`\\b(${ta})[fFdD]\\b`},{begin:`\\b0[xX]((${na})\\.?|(${na})?\\.(${na}))[pP][+-]?(${ta})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${na})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};const ia=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),oa=["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"],sa=["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"],aa=["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"],la=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ca=["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(),da=aa.concat(la);const pa=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.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:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.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_-]*/}}),ha=["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"],ua=["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"],fa=["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"],ma=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"],ga=["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 ba(t){return t?"string"==typeof t?t:t.source:null}function ya(t){return Aa("(?=",t,")")}function Aa(...t){return t.map((t=>ba(t))).join("")}function wa(...t){const e=function(t){const e=t[t.length-1];return"object"==typeof e&&e.constructor===Object?(t.splice(t.length-1,1),e):{}}(t);return"("+(e.capture?"":"?:")+t.map((t=>ba(t))).join("|")+")"}const va=t=>Aa(/\b/,t,/\w$/.test(t)?/\b/:/\B/),_a=["Protocol","Type"].map(va),xa=["init","self"].map(va),ka=["Any","Self"],Ca=["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"],Ea=["false","nil","true"],Sa=["assignment","associativity","higherThan","left","lowerThan","none","right"],Ba=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warn_unqualified_access","#warning"],Oa=["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"],$a=wa(/[/=\-+!*%<>&|^~?]/,/[\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]/),Ma=wa($a,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Ia=Aa($a,Ma,"*"),Ta=wa(/[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]/),La=wa(Ta,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Na=Aa(Ta,La,"*"),Ra=Aa(/[A-Z]/,La,"*"),Pa=["autoclosure",Aa(/convention\(/,wa("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Aa(/objc\(/,Na,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","testable","UIApplicationMain","unknown","usableFromInline"],Da=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];const za="[A-Za-z$_][0-9A-Za-z$_]*",Ha=["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"],Ua=["true","false","null","undefined","NaN","Infinity"],ja=["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"],Za=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Fa=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Va=["arguments","this","super","console","window","document","localStorage","module","global"],Ya=[].concat(Fa,ja,Za);const Wa=n(2947);var qa=n(149);const Xa=Object.assign(Ga(Error),{eval:Ga(EvalError),range:Ga(RangeError),reference:Ga(ReferenceError),syntax:Ga(SyntaxError),type:Ga(TypeError),uri:Ga(URIError)});function Ga(t){return e.displayName=t.displayName||t.name,e;function e(e,...n){const r=e?qa(e,...n):e;return new t(r)}}const Ka={}.hasOwnProperty,Ja="hljs-";function Qa(t,e,n={}){let r=n.prefix;if("string"!=typeof t)throw Xa("Expected `string` for name, got `%s`",t);if(!Wa.getLanguage(t))throw Xa("Unknown language: `%s` is not registered",t);if("string"!=typeof e)throw Xa("Expected `string` for value, got `%s`",e);null==r&&(r=Ja),Wa.configure({__emitter:tl,classPrefix:r});const i=Wa.highlight(e,{language:t,ignoreIllegals:!0});if(Wa.configure({}),i.errorRaised)throw i.errorRaised;return i._emitter.root.data.language=i.language,i._emitter.root.data.relevance=i.relevance,i._emitter.root}class tl{constructor(t){this.options=t,this.root={type:"root",data:{language:null,relevance:0},children:[]},this.stack=[this.root]}addText(t){if(""===t)return;const e=this.stack[this.stack.length-1],n=e.children[e.children.length-1];n&&"text"===n.type?n.value+=t:e.children.push({type:"text",value:t})}addKeyword(t,e){this.openNode(e),this.addText(t),this.closeNode()}addSublanguage(t,e){const n=this.stack[this.stack.length-1],r=t.root.children;e?n.children.push({type:"element",tagName:"span",properties:{className:[e]},children:r}):n.children.push(...r)}openNode(t){const e={type:"element",tagName:"span",properties:{className:t.split(".").map(((t,e)=>e?t+"_".repeat(e):this.options.classPrefix+t))},children:[]};this.stack[this.stack.length-1].children.push(e),this.stack.push(e)}closeNode(){this.stack.pop()}closeAllNodes(){}finalize(){}toHTML(){return""}}const el={highlight:Qa,highlightAuto:function(t,e={}){const n=e.subset||Wa.listLanguages();let r=e.prefix,i=-1,o={type:"root",data:{language:null,relevance:0},children:[]};if(null==r&&(r=Ja),"string"!=typeof t)throw Xa("Expected `string` for value, got `%s`",t);for(;++i<n.length;){const r=n[i];if(!Wa.getLanguage(r))continue;const s=Qa(r,t,e);s.data.relevance>o.data.relevance&&(o=s)}return o},registerLanguage:function(t,e){Wa.registerLanguage(t,e)},registered:function(t){return Boolean(Wa.getLanguage(t))},listLanguages:function(){return Wa.listLanguages()},registerAlias:function(t,e){if("string"==typeof t)Wa.registerAliases(e,{languageName:t});else{let e;for(e in t)Ka.call(t,e)&&Wa.registerAliases(t[e],{languageName:e})}}};el.registerLanguage("arduino",(function(t){const e={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(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.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:"."},t.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},t.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",h={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"]},u={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:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},f=[u,c,s,n,t.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:f.concat([{begin:/\(/,end:/\)/,keywords:h,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:h,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:h,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,t.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:h,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,u,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:h,contains:["self",s]},{begin:t.IDENT_RE+"::",keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}(t),r=n.keywords;return r.type=[...r.type,...e.type],r.literal=[...r.literal,...e.literal],r.built_in=[...r.built_in,...e.built_in],r._hints=e._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n})),el.registerLanguage("bash",(function(t){const e=t.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:e.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const i={className:"subst",begin:/\$\(/,end:/\)/,contains:[t.BACKSLASH_ESCAPE]},o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,n,i]};i.contains.push(s);const a={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},t.NUMBER_MODE,n]},l=t.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:[t.inherit(t.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","in","do","done","case","esac","function"],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,t.SHEBANG(),c,a,t.HASH_COMMENT_MODE,o,{match:/(\/[a-z._-]+)+/},s,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},n]}})),el.registerLanguage("c",(function(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.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:[t.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:"."},t.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},t.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",h={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"},u=[c,s,n,t.C_BLOCK_COMMENT_MODE,l,a],f={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:u.concat([{begin:/\(/,end:/\)/,keywords:h,contains:u.concat(["self"]),relevance:0}]),relevance:0},m={begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:h,relevance:0},{begin:p,returnBegin:!0,contains:[t.inherit(d,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,t.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:h,disableAutodetect:!0,illegal:"</",contains:[].concat(f,m,u,[c,{begin:t.IDENT_RE+"::",keywords:h},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},t.TITLE_MODE]}]),exports:{preprocessor:c,strings:a,keywords:h}}})),el.registerLanguage("cpp",(function(t){const e=t.regex,n=t.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",i="[a-zA-Z_]\\w*::",o="(?!struct)("+r+"|"+e.optional(i)+"[a-zA-Z_]\\w*"+e.optional("<[^<>]+>")+")",s={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[t.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:"."},t.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},t.inherit(a,{className:"string"}),{className:"string",begin:/<.*?>/},n,t.C_BLOCK_COMMENT_MODE]},d={className:"title",begin:e.optional(i)+t.IDENT_RE,relevance:0},p=e.optional(i)+t.IDENT_RE+"\\s*\\(",h={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"]},u={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:e.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,t.IDENT_RE,e.lookahead(/(<[^<>]+>|)\s*\(/))},f=[u,c,s,n,t.C_BLOCK_COMMENT_MODE,l,a],m={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:h,contains:f.concat([{begin:/\(/,end:/\)/,keywords:h,contains:f.concat(["self"]),relevance:0}]),relevance:0},g={className:"function",begin:"("+o+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:h,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:h,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:h,relevance:0,contains:[n,t.C_BLOCK_COMMENT_MODE,a,l,s,{begin:/\(/,end:/\)/,keywords:h,relevance:0,contains:["self",n,t.C_BLOCK_COMMENT_MODE,a,l,s]}]},s,n,t.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:h,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(m,g,u,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:h,contains:["self",s]},{begin:t.IDENT_RE+"::",keywords:h},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}})),el.registerLanguage("csharp",(function(t){const e={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=t.inherit(t.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},i={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},o=t.inherit(i,{illegal:/\n/}),s={className:"subst",begin:/\{/,end:/\}/,keywords:e},a=t.inherit(s,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,a]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]},d=t.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},a]});s.contains=[c,l,i,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,r,t.C_BLOCK_COMMENT_MODE],a.contains=[d,l,o,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,r,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const p={variants:[c,l,i,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},h={begin:"<",end:">",contains:[{beginKeywords:"in out"},n]},u=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",f={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:e,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.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,h,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[n,h,t.C_LINE_COMMENT_MODE,t.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:"("+u+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:e,contains:[{beginKeywords:["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"].join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,h],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:e,relevance:0,contains:[p,r,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},f]}})),el.registerLanguage("css",(function(t){const e=t.regex,n=Ns(t),r=[t.APOS_STRING_MODE,t.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:":("+Ds.join("|")+")"},{begin:":(:)?("+zs.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Hs.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:e.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:Ps.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...r,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Rs.join("|")+")\\b"}]}})),el.registerLanguage("diff",(function(t){const e=t.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:e.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:e.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}})),el.registerLanguage("go",(function(t){const e={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:e,illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"string",variants:[t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{begin:t.C_NUMBER_RE+"[i]",relevance:1},t.C_NUMBER_MODE]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[t.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,illegal:/["']/}]}]}})),el.registerLanguage("graphql",(function(t){const e=t.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:[t.HASH_COMMENT_MODE,t.QUOTE_STRING_MODE,t.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:e.concat(/[_A-Za-z][_0-9A-Za-z]*/,e.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}})),el.registerLanguage("ini",(function(t){const e=t.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:t.NUMBER_RE}]},r=t.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const i={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},s={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},a={begin:/\[/,end:/\]/,contains:[r,o,i,s,n,"self"],relevance:0},l=e.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:e.concat(l,"(\\s*\\.\\s*",l,")*",e.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[r,a,o,i,s,n]}}]}})),el.registerLanguage("java",(function(t){const e=t.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+Vs("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),i={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"]},o={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},s={className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[t.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:i,illegal:/<\/|#/,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[t.BACKSLASH_ESCAPE]},t.APOS_STRING_MODE,t.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:[e.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,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",t.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:i,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:i,relevance:0,contains:[o,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,Fs,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Fs,o]}})),el.registerLanguage("javascript",(function(t){const e=t.regex,n=Ys,r="<>",i="</>",o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(t,e)=>{const n=t[0].length+t.index,r=t.input[n];if("<"===r||","===r)return void e.ignoreMatch();let i;">"===r&&(((t,{after:e})=>{const n="</"+t[0].slice(1);return-1!==t.input.indexOf(n,e)})(t,{after:n})||e.ignoreMatch());const o=t.input.substring(n);((i=o.match(/^\s*=/))||(i=o.match(/^\s+extends\s+/))&&0===i.index)&&e.ignoreMatch()}},s={$pattern:Ys,keyword:Ws,literal:qs,built_in:Qs,"variable.language":Js},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:[]},h={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},u={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},f={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},m={className:"comment",variants:[t.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}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},g=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,u,f,{match:/\$\d+/},d];p.contains=g.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(g)});const b=[].concat(m,p.contains),y=b.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(b)}]),A={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y},w={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},v={relevance:0,match:e.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:{_:[...Xs,...Gs]}},_={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[A],illegal:/%/},x={match:e.concat(/\b/,function(t){return e.concat("(?!",t.join("|"),")")}([...Ks,"super","import"]),n,e.lookahead(/\(/)),className:"title.function",relevance:0},k={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[A]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:v},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,u,f,m,{match:/\$\d+/},d,v,{className:"attr",begin:n+e.lookahead(":"),relevance:0},S,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,t.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},x,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,C,{match:/\$[(.]/}]}})),el.registerLanguage("json",(function(t){const e=["true","false","null"],n={scope:"literal",beginKeywords:e.join(" ")};return{name:"JSON",keywords:{literal:e},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},t.QUOTE_STRING_MODE,n,t.C_NUMBER_MODE,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE],illegal:"\\S"}})),el.registerLanguage("kotlin",(function(t){const e={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:t.UNDERSCORE_IDENT_RE+"@"},r={className:"subst",begin:/\$\{/,end:/\}/,contains:[t.C_NUMBER_MODE]},i={className:"variable",begin:"\\$"+t.UNDERSCORE_IDENT_RE},o={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[i,r]},{begin:"'",end:"'",illegal:/\n/,contains:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[t.BACKSLASH_ESCAPE,i,r]}]};r.contains.push(o);const s={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+t.UNDERSCORE_IDENT_RE+")?"},a={className:"meta",begin:"@"+t.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[t.inherit(o,{className:"string"}),"self"]}]},l=ra,c=t.COMMENT("/\\*","\\*/",{contains:[t.C_BLOCK_COMMENT_MODE]}),d={variants:[{className:"type",begin:t.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:e,contains:[t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),t.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:e,relevance:5,contains:[{begin:t.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[t.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:e,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[d,t.C_LINE_COMMENT_MODE,c],relevance:0},t.C_LINE_COMMENT_MODE,c,s,a,o,t.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,t.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},t.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]},o,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},l]}})),el.registerLanguage("less",(function(t){const e=ia(t),n=da,r="[\\w-]+",i="("+r+"|@\\{"+r+"\\})",o=[],s=[],a=function(t){return{className:"string",begin:"~?"+t+".*?"+t}},l=function(t,e,n){return{className:t,begin:e,relevance:n}},c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:sa.join(" ")},d={begin:"\\(",end:"\\)",contains:s,keywords:c,relevance:0};s.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,a("'"),a('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},e.HEXCOLOR,d,l("variable","@@?"+r,10),l("variable","@\\{"+r+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:r+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},e.IMPORTANT,{beginKeywords:"and not"},e.FUNCTION_DISPATCH);const p=s.concat({begin:/\{/,end:/\}/,contains:o}),h={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},u={begin:i+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ca.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:i,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,h,l("keyword","all\\b"),l("variable","@\\{"+r+"\\}"),{begin:"\\b("+oa.join("|")+")\\b",className:"selector-tag"},e.CSS_NUMBER_MODE,l("selector-tag",i,0),l("selector-id","#"+i),l("selector-class","\\."+i,0),l("selector-tag","&",0),e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+aa.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+la.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:p},{begin:"!important"},e.FUNCTION_DISPATCH]},b={begin:r+":(:)?"+`(${n.join("|")})`,returnBegin:!0,contains:[g]};return o.push(t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,f,m,b,u,g,h,e.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:o}})),el.registerLanguage("lua",(function(t){const e="\\[=*\\[",n="\\]=*\\]",r={begin:e,end:n,contains:["self"]},i=[t.COMMENT("--(?!"+e+")","$"),t.COMMENT("--"+e,n,{contains:[r],relevance:10})];return{name:"Lua",keywords:{$pattern:t.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:i.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[t.inherit(t.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:i}].concat(i)},t.C_NUMBER_MODE,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,{className:"string",begin:e,end:n,contains:[r],relevance:5}])}})),el.registerLanguage("makefile",(function(t){const e={className:"variable",variants:[{begin:"\\$\\("+t.UNDERSCORE_IDENT_RE+"\\)",contains:[t.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,e]},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:[e]},i={begin:"^"+t.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[e]};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:[t.HASH_COMMENT_MODE,e,n,r,i,{className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},o]}})),el.registerLanguage("markdown",(function(t){const e={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},n={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.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}/}]},i={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},o=t.inherit(r,{contains:[]}),s=t.inherit(i,{contains:[]});r.contains.push(s),i.contains.push(o);let a=[e,n];return[r,i,o,s].forEach((t=>{t.contains=t.contains.concat(a)})),a=a.concat(r,i),{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}]}]},e,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},r,i,{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}]}]}})),el.registerLanguage("objectivec",(function(t){const e=/[a-zA-Z@][a-zA-Z0-9_]*/,n={$pattern:e,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:e,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+"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.C_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[t.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},t.inherit(t.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+n.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:n,contains:[t.UNDERSCORE_TITLE_MODE]},{begin:"\\."+t.UNDERSCORE_IDENT_RE,relevance:0}]}})),el.registerLanguage("perl",(function(t){const e=t.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(" ")},i={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:r},o={begin:/->\{/,end:/\}/},s={variants:[{begin:/\$\d/},{begin:e.concat(/[$%@](\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@][^\s\w{]/,relevance:0}]},a=[t.BACKSLASH_ESCAPE,i,s],l=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],c=(t,r,i="\\1")=>{const o="\\1"===i?i:e.concat(i,r);return e.concat(e.concat("(?:",t,")"),r,/(?:\\.|[^\\\/])*?/,o,/(?:\\.|[^\\\/])*?/,i,n)},d=(t,r,i)=>e.concat(e.concat("(?:",t,")"),r,/(?:\\.|[^\\\/])*?/,i,n),p=[s,t.HASH_COMMENT_MODE,t.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),o,{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:[t.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[t.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:"(\\/\\/|"+t.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[t.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:c("s|tr|y",e.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",e.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:[t.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return i.contains=p,o.contains=p,{name:"Perl",aliases:["pl","pm"],keywords:r,contains:p}})),el.registerLanguage("php",(function(t){const e=t.regex,n=/(?![A-Za-z0-9])(?![$])/,r=e.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),i=e.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o={scope:"variable",match:"\\$+"+r},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},a=t.inherit(t.APOS_STRING_MODE,{illegal:null}),l="[ \t\n]",c={scope:"string",variants:[t.inherit(t.QUOTE_STRING_MODE,{illegal:null,contains:t.QUOTE_STRING_MODE.contains.concat(s)}),a,t.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:t.QUOTE_STRING_MODE.contains.concat(s)})]},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"],h=["__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"],u=["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:h,literal:(t=>{const e=[];return t.forEach((t=>{e.push(t),t.toLowerCase()===t?e.push(t.toUpperCase()):e.push(t.toLowerCase())})),e})(p),built_in:u},m=t=>t.map((t=>t.replace(/\|\d+$/,""))),g={variants:[{match:[/new/,e.concat(l,"+"),e.concat("(?!",m(u).join("\\b|"),"\\b)"),i],scope:{1:"keyword",4:"title.class"}}]},b=e.concat(r,"\\b(?!\\()"),y={variants:[{match:[e.concat(/::/,e.lookahead(/(?!class\b)/)),b],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[i,e.concat(/::/,e.lookahead(/(?!class\b)/)),b],scope:{1:"title.class",3:"variable.constant"}},{match:[i,e.concat("::",e.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[i,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},A={scope:"attr",match:e.concat(r,e.lookahead(":"),e.lookahead(/(?!::)/))},w={relevance:0,begin:/\(/,end:/\)/,keywords:f,contains:[A,o,y,t.C_BLOCK_COMMENT_MODE,c,d,g]},v={relevance:0,match:[/\b/,e.concat("(?!fn\\b|function\\b|",m(h).join("\\b|"),"|",m(u).join("\\b|"),"\\b)"),r,e.concat(l,"*"),e.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[w]};w.contains.push(v);const _=[A,y,t.C_BLOCK_COMMENT_MODE,c,d,g];return{case_insensitive:!1,keywords:f,contains:[{begin:e.concat(/#\[\s*/,i),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:p,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:p,keyword:["new","array"]},contains:["self",..._]},..._,{scope:"meta",match:i}]},t.HASH_COMMENT_MODE,t.COMMENT("//","$"),t.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:t.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/},o,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"},t.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",o,y,t.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"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[t.inherit(t.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},t.UNDERSCORE_TITLE_MODE]},c,d]}})),el.registerLanguage("php-template",(function(t){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},t.inherit(t.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),t.inherit(t.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}})),el.registerLanguage("plaintext",(function(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}})),el.registerLanguage("python",(function(t){const e=t.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"],i={$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"]},o={className:"meta",begin:/^(>>>|\.\.\.) /},s={className:"subst",begin:/\{/,end:/\}/,keywords:i,illegal:/#/},a={begin:/\{\{/,relevance:0},l={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,o],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,o,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,o,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:[t.BACKSLASH_ESCAPE,a,s]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,a,s]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",d=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,p=`\\b|${r.join("|")}`,h={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})`}]},u={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:i,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:i,contains:["self",o,h,l,t.HASH_COMMENT_MODE]}]};return s.contains=[l,h,o],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:i,illegal:/(<\/|->|\?)|=>/,contains:[o,h,{begin:/\bself\b/},{beginKeywords:"if",relevance:0},l,u,t.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:[h,f,l]}]}})),el.registerLanguage("python-repl",(function(t){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}})),el.registerLanguage("r",(function(t){const e=t.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=e.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]?/),i=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=e.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:[t.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:e.lookahead(e.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]+/}]}),t.HASH_COMMENT_MODE,{scope:"string",contains:[t.BACKSLASH_ESCAPE],variants:[t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),t.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[i,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:i},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}})),el.registerLanguage("ruby",(function(t){const e=t.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=e.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),i=e.concat(r,/(::\w+)*/),o={"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=[t.COMMENT("#","$",{contains:[s]}),t.COMMENT("^=begin","^=end",{contains:[s],relevance:10}),t.COMMENT("^__END__",t.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:o},d={className:"string",contains:[t.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:e.concat(/<<[-~]?'?/,e.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[t.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[t.BACKSLASH_ESCAPE,c]})]}]},p="[0-9](_?[0-9])*",h={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"}]},u={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:o}]},f=[d,{variants:[{match:[/class\s+/,i,/\s+<\s+/,i]},{match:[/\b(class|module)\s+/,i]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:o},{match:[/(include|extend)\s+/,i],scope:{2:"title.class"},keywords:o},{relevance:0,match:[i,/\.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:[u]},{begin:t.IDENT_RE+"::"},{className:"symbol",begin:t.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[d,{begin:n}],relevance:0},h,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:o},{begin:"("+t.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[t.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,u.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:o,contains:f}}];return l.unshift(a),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:o,illegal:/\/\*/,contains:[t.SHEBANG({binary:"ruby"})].concat(m).concat(l).concat(f)}})),el.registerLanguage("rust",(function(t){const e=t.regex,n={className:"title.function.invoke",relevance:0,begin:e.concat(/\b/,/(?!let\b)/,t.IDENT_RE,e.lookahead(/\s*\(/))},r="([ui](8|16|32|64|128|size)|f(32|64))?",i=["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!"],o=["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:t.IDENT_RE+"!?",type:o,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:i},illegal:"</",contains:[t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*","\\*/",{contains:["self"]}),t.inherit(t.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+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,t.UNDERSCORE_IDENT_RE,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,t.UNDERSCORE_IDENT_RE],className:{1:"keyword",3:"title.class"}},{begin:t.IDENT_RE+"::",keywords:{keyword:"Self",built_in:i,type:o}},{className:"punctuation",begin:"->"},n]}})),el.registerLanguage("scss",(function(t){const e=pa(t),n=ma,r=fa,i="@[a-z-]+",o={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,e.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},e.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+ha.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},o,{begin:/\(/,end:/\)/,contains:[e.CSS_NUMBER_MODE]},e.CSS_VARIABLE,{className:"attribute",begin:"\\b("+ga.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:[e.BLOCK_COMMENT,o,e.HEXCOLOR,e.CSS_NUMBER_MODE,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.IMPORTANT,e.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:i,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:ua.join(" ")},contains:[{begin:i,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},o,t.QUOTE_STRING_MODE,t.APOS_STRING_MODE,e.HEXCOLOR,e.CSS_NUMBER_MODE]},e.FUNCTION_DISPATCH]}})),el.registerLanguage("shell",(function(t){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}})),el.registerLanguage("sql",(function(t){const e=t.regex,n=t.COMMENT("--","$"),r=["true","false","unknown"],i=["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"],o=["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=o,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((t=>!o.includes(t))),c={begin:e.concat(/\b/,e.either(...a),/\s*\(/),relevance:0,keywords:{built_in:a}};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:function(t,{exceptions:e,when:n}={}){const r=n;return e=e||[],t.map((t=>t.match(/\|\d+$/)||e.includes(t)?t:r(t)?`${t}|0`:t))}(l,{when:t=>t.length<3}),literal:r,type:i,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:e.either(...s),relevance:0,keywords:{$pattern:/[\w\.]+/,keyword:l.concat(s),literal:r,type:i}},{className:"type",begin:e.either("double precision","large object","with timezone","without timezone")},c,{className:"variable",begin:/@[a-z0-9]+/},{className:"string",variants:[{begin:/'/,end:/'/,contains:[{begin:/''/}]}]},{begin:/"/,end:/"/,contains:[{begin:/""/}]},t.C_NUMBER_MODE,t.C_BLOCK_COMMENT_MODE,n,{className:"operator",begin:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}})),el.registerLanguage("swift",(function(t){const e={match:/\s+/,relevance:0},n=t.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[t.C_LINE_COMMENT_MODE,n],i={match:[/\./,wa(..._a,...xa)],className:{2:"keyword"}},o={match:Aa(/\./,wa(...Ca)),relevance:0},s=Ca.filter((t=>"string"==typeof t)).concat(["_|0"]),a={variants:[{className:"keyword",match:wa(...Ca.filter((t=>"string"!=typeof t)).concat(ka).map(va),...xa)}]},l={$pattern:wa(/\b\w+/,/#\w+/),keyword:s.concat(Ba),literal:Ea},c=[i,o,a],d=[{match:Aa(/\./,wa(...Oa)),relevance:0},{className:"built_in",match:Aa(/\b/,wa(...Oa),/(?=\()/)}],p={match:/->/,relevance:0},h=[p,{className:"operator",relevance:0,variants:[{match:Ia},{match:`\\.(\\.|${Ma})+`}]}],u="([0-9]_*)+",f="([0-9a-fA-F]_*)+",m={className:"number",relevance:0,variants:[{match:`\\b(${u})(\\.(${u}))?([eE][+-]?(${u}))?\\b`},{match:`\\b0x(${f})(\\.(${f}))?([pP][+-]?(${u}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},g=(t="")=>({className:"subst",variants:[{match:Aa(/\\/,t,/[0\\tnr"']/)},{match:Aa(/\\/,t,/u\{[0-9a-fA-F]{1,8}\}/)}]}),b=(t="")=>({className:"subst",match:Aa(/\\/,t,/[\t ]*(?:[\r\n]|\r\n)/)}),y=(t="")=>({className:"subst",label:"interpol",begin:Aa(/\\/,t,/\(/),end:/\)/}),A=(t="")=>({begin:Aa(t,/"""/),end:Aa(/"""/,t),contains:[g(t),b(t),y(t)]}),w=(t="")=>({begin:Aa(t,/"/),end:Aa(/"/,t),contains:[g(t),y(t)]}),v={className:"string",variants:[A(),A("#"),A("##"),A("###"),w(),w("#"),w("##"),w("###")]},_={match:Aa(/`/,Na,/`/)},x=[_,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${La}+`}],k=[{match:/(@|#(un)?)available/,className:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Da,contains:[...h,m,v]}]}},{className:"keyword",match:Aa(/@/,wa(...Pa))},{className:"meta",match:Aa(/@/,Na)}],C={match:ya(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Aa(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,La,"+")},{className:"type",match:Ra,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Aa(/\s+&\s+/,ya(Ra)),relevance:0}]},E={begin:/</,end:/>/,keywords:l,contains:[...r,...c,...k,p,C]};C.contains.push(E);const S={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:Aa(Na,/\s*:/),keywords:"_|0",relevance:0},...r,...c,...d,...h,m,v,...x,...k,C]},B={begin:/</,end:/>/,contains:[...r,C]},O={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:wa(ya(Aa(Na,/\s*:/)),ya(Aa(Na,/\s+/,Na,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Na}]},...r,...c,...h,m,v,...k,C,S],endsParent:!0,illegal:/["']/},$={match:[/func/,/\s+/,wa(_.match,Na,Ia)],className:{1:"keyword",3:"title.function"},contains:[B,O,e],illegal:[/\[/,/%/]},M={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[B,O,e],illegal:/\[|%/},I={match:[/operator/,/\s+/,Ia],className:{1:"keyword",3:"title"}},T={begin:[/precedencegroup/,/\s+/,Ra],className:{1:"keyword",3:"title"},contains:[C],keywords:[...Sa,...Ea],end:/}/};for(const t of v.variants){const e=t.contains.find((t=>"interpol"===t.label));e.keywords=l;const n=[...c,...d,...h,m,v,...x];e.contains=[...n,{begin:/\(/,end:/\)/,contains:["self",...n]}]}return{name:"Swift",keywords:l,contains:[...r,$,M,{beginKeywords:"struct protocol class extension enum actor",end:"\\{",excludeEnd:!0,keywords:l,contains:[t.inherit(t.TITLE_MODE,{className:"title.class",begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/}),...c]},I,T,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},...c,...d,...h,m,v,...x,...k,C,S]}})),el.registerLanguage("typescript",(function(t){const e=function(t){const e=t.regex,n=za,r="<>",i="</>",o={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(t,e)=>{const n=t[0].length+t.index,r=t.input[n];if("<"===r||","===r)return void e.ignoreMatch();let i;">"===r&&(((t,{after:e})=>{const n="</"+t[0].slice(1);return-1!==t.input.indexOf(n,e)})(t,{after:n})||e.ignoreMatch());const o=t.input.substring(n);((i=o.match(/^\s*=/))||(i=o.match(/^\s+extends\s+/))&&0===i.index)&&e.ignoreMatch()}},s={$pattern:za,keyword:Ha,literal:Ua,built_in:Ya,"variable.language":Va},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:[]},h={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},u={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,p],subLanguage:"css"}},f={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,p]},m={className:"comment",variants:[t.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}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},g=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,u,f,{match:/\$\d+/},d];p.contains=g.concat({begin:/\{/,end:/\}/,keywords:s,contains:["self"].concat(g)});const b=[].concat(m,p.contains),y=b.concat([{begin:/\(/,end:/\)/,keywords:s,contains:["self"].concat(b)}]),A={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y},w={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},v={relevance:0,match:e.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:{_:[...ja,...Za]}},_={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[A],illegal:/%/},x={match:e.concat(/\b/,function(t){return e.concat("(?!",t.join("|"),")")}([...Fa,"super","import"]),n,e.lookahead(/\(/)),className:"title.function",relevance:0},k={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},C={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},A]},E="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",S={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(E)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[A]};return{name:"Javascript",aliases:["js","jsx","mjs","cjs"],keywords:s,exports:{PARAMS_CONTAINS:y,CLASS_REFERENCE:v},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,h,u,f,m,{match:/\$\d+/},d,v,{className:"attr",begin:n+e.lookahead(":"),relevance:0},S,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[m,t.REGEXP_MODE,{className:"function",begin:E,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,contains:y}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:r,end:i},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:o.begin,"on:begin":o.isTrulyOpeningTag,end:o.end}],subLanguage:"xml",contains:[{begin:o.begin,end:o.end,skip:!0,contains:["self"]}]}]},_,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[A,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},k,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[A]},x,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},w,C,{match:/\$[(.]/}]}}(t),n=za,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={beginKeywords:"namespace",end:/\{/,excludeEnd:!0,contains:[e.exports.CLASS_REFERENCE]},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[e.exports.CLASS_REFERENCE]},s={$pattern:za,keyword:Ha.concat(["type","namespace","interface","public","private","protected","implements","declare","abstract","readonly","enum","override"]),literal:Ua,built_in:Ya.concat(r),"variable.language":Va},a={className:"meta",begin:"@"+n},l=(t,e,n)=>{const r=t.contains.findIndex((t=>t.label===e));if(-1===r)throw new Error("can not find mode to replace");t.contains.splice(r,1,n)};return Object.assign(e.keywords,s),e.exports.PARAMS_CONTAINS.push(a),e.contains=e.contains.concat([a,i,o]),l(e,"shebang",t.SHEBANG()),l(e,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),e.contains.find((t=>"func.def"===t.label)).relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx"]}),e})),el.registerLanguage("vbnet",(function(t){const e=t.regex,n=/\d{1,2}\/\d{1,2}\/\d{4}/,r=/\d{4}-\d{1,2}-\d{1,2}/,i=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,o=/\d{1,2}(:\d{1,2}){1,2}/,s={className:"literal",variants:[{begin:e.concat(/# */,e.either(r,n),/ *#/)},{begin:e.concat(/# */,o,/ *#/)},{begin:e.concat(/# */,i,/ *#/)},{begin:e.concat(/# */,e.either(r,n),/ +/,e.either(i,o),/ *#/)}]},a=t.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=t.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]}]}})),el.registerLanguage("wasm",(function(t){t.regex;const e=t.COMMENT(/\(;/,/;\)/);return e.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:[t.COMMENT(/;;/,/$/),e,{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"}},t.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/}]}})),el.registerLanguage("xml",(function(t){const e=t.regex,n=e.concat(/[\p{L}_]/u,e.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},i={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},o=t.inherit(i,{begin:/\(/,end:/\)/}),s=t.inherit(t.APOS_STRING_MODE,{className:"string"}),a=t.inherit(t.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:[i,a,s,o,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[i,o,a,s]}]}]},t.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:e.concat(/</,e.lookahead(e.concat(n,e.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:l}]},{className:"tag",begin:e.concat(/<\//,e.lookahead(e.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}})),el.registerLanguage("yaml",(function(t){const e="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[t.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},i=t.inherit(r,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),o={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:e,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:"&"+t.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+t.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},t.HASH_COMMENT_MODE,{beginKeywords:e,keywords:{literal:e}},o,{className:"number",begin:t.C_NUMBER_RE+"\\b",relevance:0},a,l,r],d=[...c];return d.pop(),d.push(i),s.contains=d,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:c}}));const nl=/(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,rl=At.NB.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,F.Z)()}`},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(t){let{HTMLAttributes:e}=t;return["img",(0,At.P1)(this.options.HTMLAttributes,e)]},addNodeView(){return t=>{let{node:e,editor:n,getPos:r}=t;const i=document.createElement("img"),o=(0,At.P1)(this.options.HTMLAttributes,e.attrs);return Object.entries(o).forEach((t=>{let[e,n]=t;null!=n&&("style"===e&&"object"==typeof n?Object.assign(i.style,n):"style"===e&&"string"==typeof n?i.setAttribute("style",n):i.setAttribute(e,n))})),i.addEventListener("dblclick",(t=>{t.preventDefault(),t.stopPropagation();let e=null;"function"==typeof r&&(e=r());const i=document.createElement("cdtr-gallery");i.opened=!0,i.multi=!0,document.body.append(i),i.addEventListener("file",(t=>{let r=t.detail;if(Array.isArray(r)&&(r=r[0]),null!==e)try{const{view:t}=n,{state:i}=t;if(e<0||e>=i.doc.content.size)return void console.warn("Image position is out of bounds");try{const o=wt.qv.create(i.doc,e),s=i.tr.setSelection(o);t.dispatch(s),n.commands.updateImage({src:r.src})}catch(n){const o=i.doc.resolve(e),s=o.nodeAfter||o.nodeBefore;if(s&&"image"===s.type.name){const n={...s.attrs,src:r.src},o=s.type.create(n),a=e,l=e+s.nodeSize,c=i.tr.replaceWith(a,l,o);t.dispatch(c)}else console.warn("Could not find image node at position:",e)}}catch(t){console.warn("Failed to update image:",t)}i.opened=!1,setTimeout((()=>{i.remove()}),1500)})),i.addEventListener("close",(()=>{i.remove()}))})),{dom:i}}},addCommands(){return{setImage:t=>e=>{let{commands:n}=e;return n.insertContent({type:this.name,attrs:t}),!0},updateImage:t=>e=>{let{dispatch:n,commands:r,editor:i,view:o,tr:s}=e;const{state:a}=o,l=wt.qv.create(a.doc,o.state.selection.from),c={...l.node.attrs,...t},d=this.type.create(c);if(n){const t=(s||a.tr).replaceRangeWith(l.from,l.to,d);o.dispatch(t)}return!0}}},addInputRules(){return[(0,At.x2)({find:nl,type:this.type,getAttributes:t=>{const[,,e,n,r,i,o,s]=t;return{src:n,alt:e,title:r,width:i,height:o,id:s}}})]}}),il=At.NB.create({name:"listItem",addOptions:()=>({HTMLAttributes:{}}),content:"paragraph block*",defining:!0,parseHTML:()=>[{tag:"li"}],renderHTML(t){let{HTMLAttributes:e}=t;return["li",(0,At.P1)(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)}}}),ol=At.vc.create({name:"textStyle",addOptions:()=>({HTMLAttributes:{}}),parseHTML:()=>[{tag:"span",getAttrs:t=>!!t.hasAttribute("style")&&{}}],renderHTML(t){let{HTMLAttributes:e}=t;return["span",(0,At.P1)(this.options.HTMLAttributes,e),0]},addCommands(){return{removeEmptyTextStyle:()=>t=>{let{state:e,commands:n}=t;const r=(0,At.Jo)(e,this.type);return!!Object.entries(r).some((t=>{let[,e]=t;return!!e}))||n.unsetMark(this.name)}}}}),sl=/^\s*([-+*])\s$/,al=At.NB.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:t=>[{tag:"ul"}],renderHTML(t){let{node:e,HTMLAttributes:n}=t;return["ul",(0,At.P1)(this.options.HTMLAttributes,n,{style:`color:${e.attrs.color}`}),0]},addCommands(){return{changeBulletListColor:t=>{let{color:e}=t;return t=>{let{commands:n,chain:r}=t;return r().updateAttributes(this.name,{color:e}).run()}},toggleBulletList:()=>t=>{let{commands:e,chain:n}=t;return this.options.keepAttributes?n().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(il.name,this.editor.getAttributes(ol.name)).run():e.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=(0,At.S0)({find:sl,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=(0,At.S0)({find:sl,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(ol.name),editor:this.editor})),[t]}}),ll=/^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:watch\?v=|embed\/|shorts\/)|youtu\.be\/)([\w-]{11})(?:\S+)?$/,cl=/^((?:https?:)?\/\/)?((?:www|m|music)\.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)(\/(?:shorts\/|watch\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g,dl=/^https?:\/\/(?:www\.)?(?:vimeo\.com|player\.vimeo\.com\/video)\/(\d+)(?:\/[\w-]*)?(?:\?.*)?$/i,pl=/^https?:\/\/(?:www\.)?.+\.mp3(?:\?.*)?$/i,hl=t=>!!t&&!!t.match(ll),ul=t=>!!t&&!!t.match(dl),fl=t=>!!t&&!!t.match(pl),ml=t=>t?"https://www.youtube-nocookie.com/embed/":"https://www.youtube.com/embed/",gl=t=>{let{url:e}=t;return hl(e)?(t=>{const{url:e,allowFullscreen:n,autoplay:r,ccLanguage:i,ccLoadPolicy:o,controls:s,disableKBcontrols:a,enableIFrameApi:l,endTime:c,interfaceLanguage:d,ivLoadPolicy:p,loop:h,modestBranding:u,nocookie:f,origin:m,playlist:g,progressBarColor:b,startAt:y}=t;if(!hl(e))return null;if(e.includes("/embed/"))return e;if(e.includes("youtu.be")){const t=e.split("/").pop();return t?`${ml(f)}${t}`:null}const A=/(?:v=|shorts\/)([-\w]+)/gm.exec(e);if(!A||!A[1])return null;let w=`${ml(f)}${A[1]}`;const v=[];return!1===n&&v.push("fs=0"),r&&v.push("autoplay=1"),i&&v.push(`cc_lang_pref=${i}`),o&&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}`),h&&v.push("loop=1"),u&&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})(t):ul(e)?(t=>{const{url:e}=t;if(!ul(e))return null;const n=(t=>{const e=t.match(dl);return e&&e.find((t=>/^\d+$/.test(t)))||null})(e);if(!n)return null;let r=`https://player.vimeo.com/video/${n}`;const i=[];return t.autoplay&&i.push("autoplay=1"),i.length&&(r+=`?${i.join("&")}`),r})(t):fl(e)?(t=>{const{url:e}=t;return fl(e)?e:null})(t):null},bl=At.NB.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:t=>e=>{let{commands:n}=e;return ul(t.src)||hl(t.src)||fl(t.src)?(t.src=gl({url:t.src}),n.insertContent({type:this.name,attrs:t})):(console.error("Invalid video URL"),!1)}}},addPasteRules(){return this.options.addPasteHandler?[(0,At.Ss)({find:cl,type:this.type,getAttributes:t=>({src:t.input})})]:[]},renderHTML(t){let{HTMLAttributes:e}=t;const n=gl({url:e.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:e.start||0});return e.src=n,["div",{"data-video-cdtr":""},["iframe",(0,At.P1)(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},e)]]}}),yl={addAttributes(){return{...this.parent?.(),style:{parseHTML:t=>{const e=t.getAttribute("width");return e?`width: ${e}px; height: auto; cursor: pointer;max-width: 100%;`:`${t.style.cssText}`}}}},addNodeView(){const t=document.createElement("div");return e=>{let{node:n,editor:r,getPos:i}=e;const{view:o,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",(t=>{t.preventDefault(),t.stopPropagation();const e=l.value;setTimeout((()=>{r.chain().setVideo({src:e,width:n.attrs.width||this.options.width,height:n.attrs.height||this.options.height}).run()}),200)})),t.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 h=()=>{t.classList.add("cdtr-position-controller"),(()=>{const t={...n.attrs,style:`${p.style.cssText}`};o.dispatch(o.state.tr.setNodeMarkup(i(),null,t))})(),d.appendChild(t)};return c.setAttribute("style","display: flex;"),c.appendChild(d),d.classList.add("video-container"),d.appendChild(p),s?(d.addEventListener("click",(t=>{h(),d.setAttribute("style","position: relative; border: 1px dashed #6C6C6C; cursor: pointer;")})),document.addEventListener("click",(e=>{const n=e.target;d.contains(n)||d===n||t.remove()})),{dom:c}):{dom:d}}}},Al=bl.extend(yl);function wl(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var vl={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function _l(t){vl=t}var xl={exec:()=>null};function kl(t,e=""){let n="string"==typeof t?t:t.source;const r={replace:(t,e)=>{let i="string"==typeof e?e:e.source;return i=i.replace(Cl.caret,"$1"),n=n.replace(t,i),r},getRegex:()=>new RegExp(n,e)};return r}var Cl={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:t=>new RegExp(`^( {0,3}${t})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i")},El=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Sl=/(?:[*+-]|\d{1,9}[.)])/,Bl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ol=kl(Bl).replace(/bull/g,Sl).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(),$l=kl(Bl).replace(/bull/g,Sl).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(),Ml=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Il=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Tl=kl(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Il).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ll=kl(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Sl).getRegex(),Nl="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",Rl=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pl=kl("^ {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",Rl).replace("tag",Nl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Dl=kl(Ml).replace("hr",El).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",Nl).getRegex(),zl={blockquote:kl(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Dl).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Tl,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:El,html:Pl,lheading:Ol,list:Ll,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Dl,table:xl,text:/^[^\n]+/},Hl=kl("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",El).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",Nl).getRegex(),Ul={...zl,lheading:$l,table:Hl,paragraph:kl(Ml).replace("hr",El).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Hl).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",Nl).getRegex()},jl={...zl,html:kl("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Rl).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:xl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:kl(Ml).replace("hr",El).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Ol).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Zl=/^( {2,}|\\)\n(?!\s*$)/,Fl=/[\p{P}\p{S}]/u,Vl=/[\s\p{P}\p{S}]/u,Yl=/[^\s\p{P}\p{S}]/u,Wl=kl(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Vl).getRegex(),ql=/(?!~)[\p{P}\p{S}]/u,Xl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Gl=kl(Xl,"u").replace(/punct/g,Fl).getRegex(),Kl=kl(Xl,"u").replace(/punct/g,ql).getRegex(),Jl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ql=kl(Jl,"gu").replace(/notPunctSpace/g,Yl).replace(/punctSpace/g,Vl).replace(/punct/g,Fl).getRegex(),tc=kl(Jl,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,ql).getRegex(),ec=kl("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Yl).replace(/punctSpace/g,Vl).replace(/punct/g,Fl).getRegex(),nc=kl(/\\(punct)/,"gu").replace(/punct/g,Fl).getRegex(),rc=kl(/^<(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(),ic=kl(Rl).replace("(?:--\x3e|$)","--\x3e").getRegex(),oc=kl("^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",ic).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),sc=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ac=kl(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",sc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),lc=kl(/^!?\[(label)\]\[(ref)\]/).replace("label",sc).replace("ref",Il).getRegex(),cc=kl(/^!?\[(ref)\](?:\[\])?/).replace("ref",Il).getRegex(),dc={_backpedal:xl,anyPunctuation:nc,autolink:rc,blockSkip:/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,br:Zl,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:xl,emStrongLDelim:Gl,emStrongRDelimAst:Ql,emStrongRDelimUnd:ec,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:ac,nolink:cc,punctuation:Wl,reflink:lc,reflinkSearch:kl("reflink|nolink(?!\\()","g").replace("reflink",lc).replace("nolink",cc).getRegex(),tag:oc,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:xl},pc={...dc,link:kl(/^!?\[(label)\]\((.*?)\)/).replace("label",sc).getRegex(),reflink:kl(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",sc).getRegex()},hc={...dc,emStrongRDelimAst:tc,emStrongLDelim:Kl,url:kl(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},uc={...hc,br:kl(Zl).replace("{2,}","*").getRegex(),text:kl(hc.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},fc={normal:zl,gfm:Ul,pedantic:jl},mc={normal:dc,gfm:hc,breaks:uc,pedantic:pc},gc={"&":"&","<":"<",">":">",'"':""","'":"'"},bc=t=>gc[t];function yc(t,e){if(e){if(Cl.escapeTest.test(t))return t.replace(Cl.escapeReplace,bc)}else if(Cl.escapeTestNoEncode.test(t))return t.replace(Cl.escapeReplaceNoEncode,bc);return t}function Ac(t){try{t=encodeURI(t).replace(Cl.percentDecode,"%")}catch{return null}return t}function wc(t,e){const n=t.replace(Cl.findPipe,((t,e,n)=>{let r=!1,i=e;for(;--i>=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(Cl.splitPipe);let r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;r<n.length;r++)n[r]=n[r].trim().replace(Cl.slashPipe,"|");return n}function vc(t,e,n){const r=t.length;if(0===r)return"";let i=0;for(;i<r;){const o=t.charAt(r-i-1);if(o!==e||n){if(o===e||!n)break;i++}else i++}return t.slice(0,r-i)}function _c(t,e,n,r,i){const o=e.href,s=e.title||null,a=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;const l={type:"!"===t[0].charAt(0)?"image":"link",raw:n,href:o,title:s,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,l}var xc=class{options;rules;lexer;constructor(t){this.options=t||vl}space(t){const e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){const e=this.rules.block.code.exec(t);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:vc(t,"\n")}}}fences(t){const e=this.rules.block.fences.exec(t);if(e){const t=e[0],n=function(t,e,n){const r=t.match(n.other.indentCodeCompensation);if(null===r)return e;const i=r[1];return e.split("\n").map((t=>{const e=t.match(n.other.beginningSpace);if(null===e)return t;const[r]=e;return r.length>=i.length?t.slice(i.length):t})).join("\n")}(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:n}}}heading(t){const e=this.rules.block.heading.exec(t);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const e=vc(t,"#");this.options.pedantic?t=e.trim():e&&!this.rules.other.endingSpaceChar.test(e)||(t=e.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(t){const e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:vc(e[0],"\n")}}blockquote(t){const e=this.rules.block.blockquote.exec(t);if(e){let t=vc(e[0],"\n").split("\n"),n="",r="";const i=[];for(;t.length>0;){let e=!1;const o=[];let s;for(s=0;s<t.length;s++)if(this.rules.other.blockquoteStart.test(t[s]))o.push(t[s]),e=!0;else{if(e)break;o.push(t[s])}t=t.slice(s);const a=o.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,i,!0),this.lexer.state.top=c,0===t.length)break;const d=i.at(-1);if("code"===d?.type)break;if("blockquote"===d?.type){const e=d,o=e.raw+"\n"+t.join("\n"),s=this.blockquote(o);i[i.length-1]=s,n=n.substring(0,n.length-e.raw.length)+s.raw,r=r.substring(0,r.length-e.text.length)+s.text;break}if("list"!==d?.type);else{const e=d,o=e.raw+"\n"+t.join("\n"),s=this.list(o);i[i.length-1]=s,n=n.substring(0,n.length-d.raw.length)+s.raw,r=r.substring(0,r.length-e.raw.length)+s.raw,t=o.substring(i.at(-1).raw.length).split("\n")}}return{type:"blockquote",raw:n,tokens:i,text:r}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim();const r=n.length>1,i={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 o=this.rules.other.listItemRegex(n);let s=!1;for(;t;){let n=!1,r="",a="";if(!(e=o.exec(t)))break;if(this.rules.block.hr.test(t))break;r=e[0],t=t.substring(r.length);let l=e[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,(t=>" ".repeat(3*t.length))),c=t.split("\n",1)[0],d=!l.trim(),p=0;if(this.options.pedantic?(p=2,a=l.trimStart()):d?p=e[1].length+1:(p=e[2].search(this.rules.other.nonSpaceChar),p=p>4?1:p,a=l.slice(p),p+=e[1].length),d&&this.rules.other.blankLine.test(c)&&(r+=c+"\n",t=t.substring(c.length+1),n=!0),!n){const e=this.rules.other.nextBulletRegex(p),n=this.rules.other.hrRegex(p),i=this.rules.other.fencesBeginRegex(p),o=this.rules.other.headingBeginRegex(p),s=this.rules.other.htmlBeginRegex(p);for(;t;){const h=t.split("\n",1)[0];let u;if(c=h,this.options.pedantic?(c=c.replace(this.rules.other.listReplaceNesting," "),u=c):u=c.replace(this.rules.other.tabCharGlobal," "),i.test(c))break;if(o.test(c))break;if(s.test(c))break;if(e.test(c))break;if(n.test(c))break;if(u.search(this.rules.other.nonSpaceChar)>=p||!c.trim())a+="\n"+u.slice(p);else{if(d)break;if(l.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4)break;if(i.test(l))break;if(o.test(l))break;if(n.test(l))break;a+="\n"+c}d||c.trim()||(d=!0),r+=h+"\n",t=t.substring(h.length+1),l=u.slice(p)}}i.loose||(s?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(s=!0));let h,u=null;this.options.gfm&&(u=this.rules.other.listIsTask.exec(a),u&&(h="[ ] "!==u[0],a=a.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:r,task:!!u,checked:h,loose:!1,text:a,tokens:[]}),i.raw+=r}const a=i.items.at(-1);if(!a)return;a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd(),i.raw=i.raw.trimEnd();for(let t=0;t<i.items.length;t++)if(this.lexer.state.top=!1,i.items[t].tokens=this.lexer.blockTokens(i.items[t].text,[]),!i.loose){const e=i.items[t].tokens.filter((t=>"space"===t.type)),n=e.length>0&&e.some((t=>this.rules.other.anyLine.test(t.raw)));i.loose=n}if(i.loose)for(let t=0;t<i.items.length;t++)i.items[t].loose=!0;return i}}html(t){const e=this.rules.block.html.exec(t);if(e){return{type:"html",block:!0,raw:e[0],pre:"pre"===e[1]||"script"===e[1]||"style"===e[1],text:e[0]}}}def(t){const e=this.rules.block.def.exec(t);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:n,title:r}}}table(t){const e=this.rules.block.table.exec(t);if(!e)return;if(!this.rules.other.tableDelimiter.test(e[2]))return;const n=wc(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],o={type:"table",raw:e[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const t of r)this.rules.other.tableAlignRight.test(t)?o.align.push("right"):this.rules.other.tableAlignCenter.test(t)?o.align.push("center"):this.rules.other.tableAlignLeft.test(t)?o.align.push("left"):o.align.push(null);for(let t=0;t<n.length;t++)o.header.push({text:n[t],tokens:this.lexer.inline(n[t]),header:!0,align:o.align[t]});for(const t of i)o.rows.push(wc(t,o.header.length).map(((t,e)=>({text:t,tokens:this.lexer.inline(t),header:!1,align:o.align[e]}))));return o}}lheading(t){const e=this.rules.block.lheading.exec(t);if(e)return{type:"heading",raw:e[0],depth:"="===e[2].charAt(0)?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(t){const e=this.rules.block.paragraph.exec(t);if(e){const t="\n"===e[1].charAt(e[1].length-1)?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(t){const e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){const e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){const e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){const e=this.rules.inline.link.exec(t);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const e=vc(t.slice(0,-1),"\\");if((t.length-e.length)%2==0)return}else{const t=function(t,e){if(-1===t.indexOf(e[1]))return-1;let n=0;for(let r=0;r<t.length;r++)if("\\"===t[r])r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}(e[2],"()");if(-2===t)return;if(t>-1){const n=(0===e[0].indexOf("!")?5:4)+e[1].length+t;e[2]=e[2].substring(0,t),e[0]=e[0].substring(0,n).trim(),e[3]=""}}let n=e[2],r="";if(this.options.pedantic){const t=this.rules.other.pedanticHrefTitle.exec(n);t&&(n=t[1],r=t[3])}else r=e[3]?e[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?n.slice(1):n.slice(1,-1)),_c(e,{href:n?n.replace(this.rules.inline.anyPunctuation,"$1"):n,title:r?r.replace(this.rules.inline.anyPunctuation,"$1"):r},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){const t=e[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!t){const t=n[0].charAt(0);return{type:"text",raw:t,text:t}}return _c(n,t,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);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 i,o,s=n,a=0;const l="*"===r[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+n);null!=(r=l.exec(e));){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){s+=o;continue}if((r[5]||r[6])&&n%3&&!((n+o)%3)){a+=o;continue}if(s-=o,s>0)continue;o=Math.min(o,o+s+a);const e=[...r[0]][0].length,l=t.slice(0,n+r.index+e+o);if(Math.min(n,o)%2){const t=l.slice(1,-1);return{type:"em",raw:l,text:t,tokens:this.lexer.inlineTokens(t)}}const c=l.slice(2,-2);return{type:"strong",raw:l,text:c,tokens:this.lexer.inlineTokens(c)}}}}codespan(t){const e=this.rules.inline.code.exec(t);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const n=this.rules.other.nonSpaceChar.test(t),r=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return n&&r&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(t){const e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t){const e=this.rules.inline.del.exec(t);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(t){const e=this.rules.inline.autolink.exec(t);if(e){let t,n;return"@"===e[2]?(t=e[1],n="mailto:"+t):(t=e[1],n=t),{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let t,n;if("@"===e[2])t=e[0],n="mailto:"+t;else{let r;do{r=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??""}while(r!==e[0]);t=e[0],n="www."===e[1]?"http://"+e[0]:e[0]}return{type:"link",raw:e[0],text:t,href:n,tokens:[{type:"text",raw:t,text:t}]}}}inlineText(t){const e=this.rules.inline.text.exec(t);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},kc=class t{tokens;options;state;tokenizer;inlineQueue;constructor(t){this.tokens=[],this.tokens.links=Object.create(null),this.options=t||vl,this.options.tokenizer=this.options.tokenizer||new xc,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 e={other:Cl,block:fc.normal,inline:mc.normal};this.options.pedantic?(e.block=fc.pedantic,e.inline=mc.pedantic):this.options.gfm&&(e.block=fc.gfm,this.options.breaks?e.inline=mc.breaks:e.inline=mc.gfm),this.tokenizer.rules=e}static get rules(){return{block:fc,inline:mc}}static lex(e,n){return new t(n).lex(e)}static lexInline(e,n){return new t(n).inlineTokens(e)}lex(t){t=t.replace(Cl.carriageReturn,"\n"),this.blockTokens(t,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const e=this.inlineQueue[t];this.inlineTokens(e.src,e.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],n=!1){for(this.options.pedantic&&(t=t.replace(Cl.tabCharGlobal," ").replace(Cl.spaceLine,""));t;){let r;if(this.options.extensions?.block?.some((n=>!!(r=n.call({lexer:this},t,e))&&(t=t.substring(r.raw.length),e.push(r),!0))))continue;if(r=this.tokenizer.space(t)){t=t.substring(r.raw.length);const n=e.at(-1);1===r.raw.length&&void 0!==n?n.raw+="\n":e.push(r);continue}if(r=this.tokenizer.code(t)){t=t.substring(r.raw.length);const n=e.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):e.push(r);continue}if(r=this.tokenizer.fences(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.heading(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.hr(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.blockquote(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.list(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.html(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.def(t)){t=t.substring(r.raw.length);const n=e.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(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.lheading(t)){t=t.substring(r.raw.length),e.push(r);continue}let i=t;if(this.options.extensions?.startBlock){let e=1/0;const n=t.slice(1);let r;this.options.extensions.startBlock.forEach((t=>{r=t.call({lexer:this},n),"number"==typeof r&&r>=0&&(e=Math.min(e,r))})),e<1/0&&e>=0&&(i=t.substring(0,e+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){const o=e.at(-1);n&&"paragraph"===o?.type?(o.raw+="\n"+r.raw,o.text+="\n"+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):e.push(r),n=i.length!==t.length,t=t.substring(r.raw.length)}else if(r=this.tokenizer.text(t)){t=t.substring(r.raw.length);const n=e.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):e.push(r)}else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){let n=t,r=null;if(this.tokens.links){const t=Object.keys(this.tokens.links);if(t.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(n));)t.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 i=!1,o="";for(;t;){let r;if(i||(o=""),i=!1,this.options.extensions?.inline?.some((n=>!!(r=n.call({lexer:this},t,e))&&(t=t.substring(r.raw.length),e.push(r),!0))))continue;if(r=this.tokenizer.escape(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.tag(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.link(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(r.raw.length);const n=e.at(-1);"text"===r.type&&"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):e.push(r);continue}if(r=this.tokenizer.emStrong(t,n,o)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.codespan(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.br(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.del(t)){t=t.substring(r.raw.length),e.push(r);continue}if(r=this.tokenizer.autolink(t)){t=t.substring(r.raw.length),e.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(t))){t=t.substring(r.raw.length),e.push(r);continue}let s=t;if(this.options.extensions?.startInline){let e=1/0;const n=t.slice(1);let r;this.options.extensions.startInline.forEach((t=>{r=t.call({lexer:this},n),"number"==typeof r&&r>=0&&(e=Math.min(e,r))})),e<1/0&&e>=0&&(s=t.substring(0,e+1))}if(r=this.tokenizer.inlineText(s)){t=t.substring(r.raw.length),"_"!==r.raw.slice(-1)&&(o=r.raw.slice(-1)),i=!0;const n=e.at(-1);"text"===n?.type?(n.raw+=r.raw,n.text+=r.text):e.push(r)}else if(t){const e="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(e);break}throw new Error(e)}}return e}},Cc=class{options;parser;constructor(t){this.options=t||vl}space(t){return""}code({text:t,lang:e,escaped:n}){const r=(e||"").match(Cl.notSpaceStart)?.[0],i=t.replace(Cl.endingNewline,"")+"\n";return r?'<pre><code class="language-'+yc(r)+'">'+(n?i:yc(i,!0))+"</code></pre>\n":"<pre><code>"+(n?i:yc(i,!0))+"</code></pre>\n"}blockquote({tokens:t}){return`<blockquote>\n${this.parser.parse(t)}</blockquote>\n`}html({text:t}){return t}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>\n`}hr(t){return"<hr>\n"}list(t){const e=t.ordered,n=t.start;let r="";for(let e=0;e<t.items.length;e++){const n=t.items[e];r+=this.listitem(n)}const i=e?"ol":"ul";return"<"+i+(e&&1!==n?' start="'+n+'"':"")+">\n"+r+"</"+i+">\n"}listitem(t){let e="";if(t.task){const n=this.checkbox({checked:!!t.checked});t.loose?"paragraph"===t.tokens[0]?.type?(t.tokens[0].text=n+" "+t.tokens[0].text,t.tokens[0].tokens&&t.tokens[0].tokens.length>0&&"text"===t.tokens[0].tokens[0].type&&(t.tokens[0].tokens[0].text=n+" "+yc(t.tokens[0].tokens[0].text),t.tokens[0].tokens[0].escaped=!0)):t.tokens.unshift({type:"text",raw:n+" ",text:n+" ",escaped:!0}):e+=n+" "}return e+=this.parser.parse(t.tokens,!!t.loose),`<li>${e}</li>\n`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>\n`}table(t){let e="",n="";for(let e=0;e<t.header.length;e++)n+=this.tablecell(t.header[e]);e+=this.tablerow({text:n});let r="";for(let e=0;e<t.rows.length;e++){const i=t.rows[e];n="";for(let t=0;t<i.length;t++)n+=this.tablecell(i[t]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+r+"</table>\n"}tablerow({text:t}){return`<tr>\n${t}</tr>\n`}tablecell(t){const e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${yc(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){const r=this.parser.parseInline(n),i=Ac(t);if(null===i)return r;let o='<a href="'+(t=i)+'"';return e&&(o+=' title="'+yc(e)+'"'),o+=">"+r+"</a>",o}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const i=Ac(t);if(null===i)return yc(n);let o=`<img src="${t=i}" alt="${n}"`;return e&&(o+=` title="${yc(e)}"`),o+=">",o}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:yc(t.text)}},Ec=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Sc=class t{options;renderer;textRenderer;constructor(t){this.options=t||vl,this.options.renderer=this.options.renderer||new Cc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ec}static parse(e,n){return new t(n).parse(e)}static parseInline(e,n){return new t(n).parseInline(e)}parse(t,e=!0){let n="";for(let r=0;r<t.length;r++){const i=t[r];if(this.options.extensions?.renderers?.[i.type]){const t=i,e=this.options.extensions.renderers[t.type].call({parser:this},t);if(!1!==e||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(t.type)){n+=e||"";continue}}const o=i;switch(o.type){case"space":n+=this.renderer.space(o);continue;case"hr":n+=this.renderer.hr(o);continue;case"heading":n+=this.renderer.heading(o);continue;case"code":n+=this.renderer.code(o);continue;case"table":n+=this.renderer.table(o);continue;case"blockquote":n+=this.renderer.blockquote(o);continue;case"list":n+=this.renderer.list(o);continue;case"html":n+=this.renderer.html(o);continue;case"paragraph":n+=this.renderer.paragraph(o);continue;case"text":{let i=o,s=this.renderer.text(i);for(;r+1<t.length&&"text"===t[r+1].type;)i=t[++r],s+="\n"+this.renderer.text(i);n+=e?this.renderer.paragraph({type:"paragraph",raw:s,text:s,tokens:[{type:"text",raw:s,text:s,escaped:!0}]}):s;continue}default:{const t='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return n}parseInline(t,e=this.renderer){let n="";for(let r=0;r<t.length;r++){const i=t[r];if(this.options.extensions?.renderers?.[i.type]){const t=this.options.extensions.renderers[i.type].call({parser:this},i);if(!1!==t||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=t||"";continue}}const o=i;switch(o.type){case"escape":case"text":n+=e.text(o);break;case"html":n+=e.html(o);break;case"link":n+=e.link(o);break;case"image":n+=e.image(o);break;case"strong":n+=e.strong(o);break;case"em":n+=e.em(o);break;case"codespan":n+=e.codespan(o);break;case"br":n+=e.br(o);break;case"del":n+=e.del(o);break;default:{const t='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(t),"";throw new Error(t)}}}return n}},Bc=class{options;block;constructor(t){this.options=t||vl}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}provideLexer(){return this.block?kc.lex:kc.lexInline}provideParser(){return this.block?Sc.parse:Sc.parseInline}},Oc=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=Sc;Renderer=Cc;TextRenderer=Ec;Lexer=kc;Tokenizer=xc;Hooks=Bc;constructor(...t){this.use(...t)}walkTokens(t,e){let n=[];for(const r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{const t=r;for(const r of t.header)n=n.concat(this.walkTokens(r.tokens,e));for(const r of t.rows)for(const t of r)n=n.concat(this.walkTokens(t.tokens,e));break}case"list":{const t=r;n=n.concat(this.walkTokens(t.items,e));break}default:{const t=r;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach((r=>{const i=t[r].flat(1/0);n=n.concat(this.walkTokens(i,e))})):t.tokens&&(n=n.concat(this.walkTokens(t.tokens,e)))}}return n}use(...t){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach((t=>{const n={...t};if(n.async=this.defaults.async||n.async||!1,t.extensions&&(t.extensions.forEach((t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){const n=e.renderers[t.name];e.renderers[t.name]=n?function(...e){let r=t.renderer.apply(this,e);return!1===r&&(r=n.apply(this,e)),r}:t.renderer}if("tokenizer"in t){if(!t.level||"block"!==t.level&&"inline"!==t.level)throw new Error("extension level must be 'block' or 'inline'");const n=e[t.level];n?n.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&("block"===t.level?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:"inline"===t.level&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)})),n.extensions=e),t.renderer){const e=this.defaults.renderer||new Cc(this.defaults);for(const n in t.renderer){if(!(n in e))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;const r=n,i=t.renderer[r],o=e[r];e[r]=(...t)=>{let n=i.apply(e,t);return!1===n&&(n=o.apply(e,t)),n||""}}n.renderer=e}if(t.tokenizer){const e=this.defaults.tokenizer||new xc(this.defaults);for(const n in t.tokenizer){if(!(n in e))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;const r=n,i=t.tokenizer[r],o=e[r];e[r]=(...t)=>{let n=i.apply(e,t);return!1===n&&(n=o.apply(e,t)),n}}n.tokenizer=e}if(t.hooks){const e=this.defaults.hooks||new Bc;for(const n in t.hooks){if(!(n in e))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;const r=n,i=t.hooks[r],o=e[r];Bc.passThroughHooks.has(n)?e[r]=t=>{if(this.defaults.async)return Promise.resolve(i.call(e,t)).then((t=>o.call(e,t)));const n=i.call(e,t);return o.call(e,n)}:e[r]=(...t)=>{let n=i.apply(e,t);return!1===n&&(n=o.apply(e,t)),n}}n.hooks=e}if(t.walkTokens){const e=this.defaults.walkTokens,r=t.walkTokens;n.walkTokens=function(t){let n=[];return n.push(r.call(this,t)),e&&(n=n.concat(e.call(this,t))),n}}this.defaults={...this.defaults,...n}})),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return kc.lex(t,e??this.defaults)}parser(t,e){return Sc.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{const r={...n},i={...this.defaults,...r},o=this.onError(!!i.silent,!!i.async);if(!0===this.defaults.async&&!1===r.async)return o(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==e)return o(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof e)return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=t);const s=i.hooks?i.hooks.provideLexer():t?kc.lex:kc.lexInline,a=i.hooks?i.hooks.provideParser():t?Sc.parse:Sc.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(e):e).then((t=>s(t,i))).then((t=>i.hooks?i.hooks.processAllTokens(t):t)).then((t=>i.walkTokens?Promise.all(this.walkTokens(t,i.walkTokens)).then((()=>t)):t)).then((t=>a(t,i))).then((t=>i.hooks?i.hooks.postprocess(t):t)).catch(o);try{i.hooks&&(e=i.hooks.preprocess(e));let t=s(e,i);i.hooks&&(t=i.hooks.processAllTokens(t)),i.walkTokens&&this.walkTokens(t,i.walkTokens);let n=a(t,i);return i.hooks&&(n=i.hooks.postprocess(n)),n}catch(t){return o(t)}}}onError(t,e){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",t){const t="<p>An error occurred:</p><pre>"+yc(n.message+"",!0)+"</pre>";return e?Promise.resolve(t):t}if(e)return Promise.reject(n);throw n}}};function $c(t,e){return Oc.parse(t,e)}$c.options=$c.setOptions=function(t){return Oc.setOptions(t),$c.defaults=Oc.defaults,_l($c.defaults),$c},$c.getDefaults=wl,$c.defaults=vl,$c.use=function(...t){return Oc.use(...t),$c.defaults=Oc.defaults,_l($c.defaults),$c},$c.walkTokens=function(t,e){return Oc.walkTokens(t,e)},$c.parseInline=Oc.parseInline,$c.Parser=Sc,$c.parser=Sc.parse,$c.Renderer=Cc,$c.TextRenderer=Ec,$c.Lexer=kc,$c.lexer=kc.lex,$c.Tokenizer=xc,$c.Hooks=Bc,$c.parse=$c;$c.options,$c.setOptions,$c.use,$c.walkTokens,$c.parseInline,Sc.parse,kc.lex;const Mc=t=>[/^#{1,6}\s/m,/\*\*.*\*\*/,/__.*__/,/\*.*\*/,/_.*_/,/\[.*\]\(.*\)/,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m,/```[\s\S]*```/,/`[^`]+`/,/^>\s/m,/!\[.*\]\(.*\)/,/^\s*[-*_]{3,}\s*$/m].some((e=>e.test(t))),Ic=At.hj.create({name:"markdownPaste",addOptions:()=>({autoDetect:!0}),addProseMirrorPlugins(){const t=this.editor,e=this.options;return[new wt.Sy({key:new wt.H$("markdownPaste"),props:{handlePaste:(n,r,i)=>{if(!e.autoDetect)return!1;const o=r.clipboardData?.getData("text/plain"),s=r.clipboardData?.getData("text/html");if(console.log("Paste event - text:",o),console.log("Paste event - html:",s),console.log("Is markdown?",Mc(o)),!o||!Mc(o))return console.log("Not markdown or no text, skipping"),!1;if(o.includes("\n")&&!(t=>"string"==typeof t&&[/^#{1,6}\s/m,/^\s*[-*+]\s/m,/^\s*\d+\.\s/m,/```[\s\S]*```/,/^>\s/m,/^\s*[-*_]{3,}\s*$/m].some((e=>e.test(t))))(o)){const t=(t=>{const e=(t=>t.replace(/\r\n?/g,"\n"))(t);return e.split(/\n{2,}/).map((t=>`<p>${t.split("\n").map((t=>$c.parseInline(t,{async:!1})||"<br>")).join("<br>")||"<br>"}</p>`)).join("")})(o),e=((t,e)=>{const n=document.createElement("div");return n.innerHTML=e,zn.aw.fromSchema(t).parseSlice(n)})(n.state.schema,t);return r.preventDefault(),n.dispatch(n.state.tr.replaceSelection(e).scrollIntoView()),!0}if(s&&s.trim()){const t=/<(?!meta|style|link)([\w]+)[^>]*>/i.test(s);if(console.log("Has rich HTML content:",t),t&&!Mc(o))return console.log("Skipping due to rich HTML"),!1}try{let e=$c.parse(o,{async:!1});return console.log("Parsed markdown to HTML:",e),e&&"string"==typeof e&&(e=e.replace(/<a\s+([^>]*?)>/gi,((t,e)=>e.includes("style=")?t.replace(/style="([^"]*)"/i,((t,e)=>e.includes("color:")?t:`style="${e}; color: blue"`)):`<a ${e} style="color: blue">`))),r.preventDefault(),t.commands.insertContent(e),!0}catch(t){return console.error("Error parsing markdown:",t),!1}}}})]}}),Tc=At.hj.create({name:"markdownContent",addCommands:()=>({setMarkdownContent:t=>e=>{let{commands:n,editor:r}=e;try{let e=$c.parse(t,{async:!1});return e&&"string"==typeof e&&(e=e.replace(/<a\s+([^>]*?)>/gi,((t,e)=>e.includes("style=")?t.replace(/style="([^"]*)"/i,((t,e)=>e.includes("color:")?t:`style="${e}; color: blue"`)):`<a ${e} style="color: blue">`))),n.setContent(e)}catch(t){return console.error("Error parsing markdown:",t),!1}},insertMarkdownContent:t=>e=>{let{commands:n,editor:r}=e;try{let e=$c.parse(t,{async:!1});return e&&"string"==typeof e&&(e=e.replace(/<a\s+([^>]*?)>/gi,((t,e)=>e.includes("style=")?t.replace(/style="([^"]*)"/i,((t,e)=>e.includes("color:")?t:`style="${e}; color: blue"`)):`<a ${e} style="color: blue">`))),n.insertContent(e)}catch(t){return console.error("Error parsing markdown:",t),!1}}})}),Lc=At.hj.create({name:"preserveStyle",addStorage:()=>({lastTextStyle:null}),addProseMirrorPlugins(){const t=this;return[new wt.Sy({key:new wt.H$("preserveStyle"),state:{init:()=>null,apply(e,n){const r=e.doc.type.schema.marks.textStyle;if(!r)return n;if(e.storedMarks){const n=e.storedMarks.find((t=>t.type===r));if(n&&n.attrs){const e={};Object.keys(n.attrs).forEach((t=>{null!=n.attrs[t]&&(e[t]=n.attrs[t])})),Object.keys(e).length>0&&(t.storage.lastTextStyle=e)}}return e.steps.forEach((e=>{if("addMark"===e.stepType){const n=e.mark;if(n&&n.type===r&&n.attrs){const e={};Object.keys(n.attrs).forEach((t=>{null!=n.attrs[t]&&(e[t]=n.attrs[t])})),Object.keys(e).length>0&&(t.storage.lastTextStyle=e)}}})),n}}}),new wt.Sy({key:new wt.H$("preserveStyleOnSelection"),appendTransaction(e,n,r){const{selection:i}=r,{$from:o}=i,s=o.parent,a=0===s.content.size,l="paragraph"===s.type.name||"heading"===s.type.name;if(a&&l){const e=r.schema.marks.textStyle;if(!e)return null;const n=o.marks().some((t=>t.type===e)),i=r.storedMarks||[],s=i.some((t=>t.type===e));if(!n&&!s&&t.storage.lastTextStyle){const n=r.tr,o=[e.create(t.storage.lastTextStyle),...i.filter((t=>t.type!==e))];return n.setStoredMarks(o),n}}return null}})]},onUpdate(){const{editor:t}=this,e=t.getAttributes("textStyle");if(e&&Object.keys(e).length>0){const t={};Object.keys(e).forEach((n=>{null!=e[n]&&(t[n]=e[n])})),Object.keys(t).length>0&&(this.storage.lastTextStyle=t)}}}),Nc=At.hj.create({name:"linkUnlinkStyle",addStorage:()=>({styleBeforeLink:null}),addCommands(){return{saveStyleBeforeLinkFromRange:(t,e)=>e=>{let{state:n}=e;const r=n.schema.marks.textStyle;if(!r)return this.storage.styleBeforeLink=null,!0;const i=n.doc.resolve(t).marks().find((t=>t.type===r));if(!i||!i.attrs)return this.storage.styleBeforeLink=null,!0;const o={};return Object.keys(i.attrs).forEach((t=>{null!=i.attrs[t]&&(o[t]=i.attrs[t])})),this.storage.styleBeforeLink=Object.keys(o).length>0?o:null,!0},unLinkWithStyleRestore:()=>t=>{let{state:e,dispatch:n}=t;const{from:r,to:i}=e.selection,o=e.schema,s=o.marks.link,a=o.marks.textStyle;if(!s||!a)return!1;const l=this.storage.styleBeforeLink,c=e.tr;if(c.removeMark(r,i,s),l&&Object.keys(l).length>0)c.removeMark(r,i,a),c.addMark(r,i,a.create(l));else{const t=e.doc.resolve(r).marks().find((t=>t.type===a)),n=t?{...t.attrs,color:null}:{color:null};c.removeMark(r,i,a),c.addMark(r,i,a.create(n))}const d=e.doc.resolve(r).marks().filter((t=>t.type!==a&&t.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}}}}),Rc=t=>{const e=t.defaultDirection||"auto";let n=t.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((t=>t.test(r)))))try{n=$c.parse(n,{async:!1}),n&&"string"==typeof n&&(n=n.replace(/<a\s+([^>]*?)>/gi,((t,e)=>e.includes("style=")?t.replace(/style="([^"]*)"/i,((t,e)=>e.includes("color:")?t:`style="${e}; color: blue"`)):`<a ${e} style="color: blue">`)))}catch(t){console.error("Error parsing markdown content:",t)}var r;const{content:i,...o}=t,s=new At.ML({autofocus:!1,content:n,editorProps:{handleDOMEvents:{drop:(t,e)=>{if(e.dataTransfer&&"move"===e.dataTransfer.effectAllowed&&1===e.dataTransfer.items.length&&"text/plain"===e.dataTransfer.items[0].type){const t=e.dataTransfer.getData("text/plain");"string"!=typeof t||t.trim()||e.preventDefault()}}},handlePaste:(t,e,n)=>{const r=e.clipboardData?.getData("text/plain");if(!r||!(t=>{try{const e=new URL(t);return"http:"===e.protocol||"https:"===e.protocol}catch(e){return/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/i.test(t.trim())}})(r.trim()))return!1;const i=t.state,{from:o,to:s}=i.selection,a=i.doc.textBetween(o,s),l=i.schema.marks.link,c=i.schema.marks.textStyle;if(!l)return!1;let d=r.trim();d.startsWith("http://")||d.startsWith("https://")||(d="https://"+d);const p=a&&(t=>{if(!t||"string"!=typeof t)return!1;const e=t.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(e)})(a);if(p){let e=!1,n=null;if(i.doc.nodesBetween(o,s,((t,r)=>{if(e)return!1;Math.max(o,r),Math.min(s,r+t.nodeSize);return t.marks.forEach((t=>{"link"===t.type.name&&(e=!0,n=t)})),!e})),!e){const t=i.storedMarks?.find((t=>"link"===t.type.name)),r=i.selection.$from.marks().find((t=>"link"===t.type.name)),o=i.selection.$to.marks().find((t=>"link"===t.type.name));n=t||r||o,e=!!n}const r=i.tr;if(e){r.removeMark(o,s,l),r.replaceWith(o,s,i.schema.text(d));const t=o,e=o+d.length;r.addMark(t,e,l.create({href:d})),c&&r.addMark(t,e,c.create({color:"blue"}))}else{r.replaceWith(o,s,i.schema.text(d));const t=o,e=o+d.length;r.addMark(t,e,l.create({href:d})),c&&r.addMark(t,e,c.create({color:"blue"}))}const a=o+d.length;return r.setSelection(wt.Bs.near(r.doc.resolve(a))),t.dispatch(r),!0}{const e=i.tr;if(a&&o!==s){if(e.addMark(o,s,l.create({href:d})),c){let t={};i.doc.nodesBetween(o,s,((e,n)=>{Math.max(o,n),Math.min(s,n+e.nodeSize);e.marks.forEach((e=>{"textStyle"===e.type.name&&(t={...t,...e.attrs})}))}));const n={...t,color:"blue"};e.addMark(o,s,c.create(n))}e.setSelection(wt.Bs.near(e.doc.resolve(s)))}else{e.replaceWith(o,s,i.schema.text(d));const t=o,n=o+d.length;e.addMark(t,n,l.create({href:d})),c&&e.addMark(t,n,c.create({color:"blue"})),e.setSelection(wt.Bs.near(e.doc.resolve(n)))}return t.dispatch(e),!0}},transformPastedHTML:t=>(t&&"string"==typeof t&&(t=(t=t.replace(/style="([^"]*)"/gi,((t,e)=>{let n=e.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,((t,e)=>e.includes("style=")?t.replace(/style="([^"]*)"/i,((t,e)=>e.includes("color:")?t:`style="${e}; color: blue"`)):`<a ${e} style="color: blue">`))),t)},extensions:[Bt.Z,Wt.configure({placeholder:t=>{let{node:e}=t;return"paragraph"===e.type.name?B.h.get("lang","add_content_to_paragraph"):"heading"===e.type.name?B.h.get("lang","add_content_to_heading"):null}}),qn,Ot.configure({HTMLAttributes:{class:"cdtr-heading",style:"font-weight: initial"}}),Al,Pn,$t.Z,Ji.extend({inclusive:!1}).configure({openOnClick:!1,HTMLAttributes:{class:"cdtr-editor-link"}}),pe.configure({draggable:!0}),le.configure({keepMarks:!0}),Ln.configure({lowlight:el,draggable:!0,defaultLanguage:"javascript"}),Rn.configure({fonts:t.fontFamilies}),Nt,Rt,vt.ZP,Ft,Vt,Ts,al,re,Bs.configure({resizable:!1,draggable:!0,lastColumnResizable:!1,HTMLAttributes:{class:"cdtr-table-element"}}),$s.configure({draggable:!0}),Ms,Is,Yt,rl.configure({inline:!1,HTMLAttributes:{"data-type":"inline-image","cdtr-resizable":"true",style:"display: block; margin: 0 auto;"}}),Kt.configure({class:"dropcursor",color:"black",width:2}),te.configure({types:["heading","blockquote","paragraph","taskList","customBulletList","bulletList","orderedList"]}),Qt.configure({types:["heading","blockquote","paragraph","taskList","orderedList"]}),Jt.configure({defaultDirection:e,types:["heading","blockquote","paragraph","taskList","customBulletList","bulletList","orderedList"]}),Ls.configure({types:["heading","paragraph"],defaultAlignment:"rtl"===e?"right":"left"}),St,Et,Lc,Nc,zt,Os,Ct,_t,ae,se,Wn,Ic,Tc],...o});return s};n(35432);var Pc=n(86274),Dc={};Dc.setAttributes=D(),Dc.insert=R().bind(null,"head"),Dc.domAPI=L(),Dc.insertStyleElement=H();I()(Pc.Z,Dc);Pc.Z&&Pc.Z.locals&&Pc.Z.locals;var zc=n(36351);n(9545);const Hc={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},Uc={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"},jc={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 Zc(t){return null!=t&&""!==t}function Fc(t){let e=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(!t)return void console.warn("No editor provided");const i={...Hc,...e},o={...Uc,...n},s={...jc,...r};console.log("Validating default values..."),console.log("Font sizes:",i),console.log("Font families:",o),console.log("Line heights:",s),console.log("=== APPLYING FONT SIZES, FAMILIES, AND LINE HEIGHTS TO TIPTAP DOCUMENT ==="),console.log("Font sizes to apply:",i),console.log("Font families to apply:",o),console.log("Line heights to apply:",s);const{state:a}=t,{doc:l}=a;l.descendants(((e,n)=>{const r=e.type.name;console.log(`Processing node: ${r} at position ${n}`);const a=e.marks?.find((t=>"textStyle"===t.type.name))?.attrs?.fontSize,l=e.marks?.find((t=>"textStyle"===t.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 t=e.attrs.level;a=i[`h${t}`]||i.heading,l=o[`h${t}`]||o.heading,c=s[`h${t}`]||s.heading,console.log(`Heading level ${t}:`,{fontSize:a||"not set",fontFamily:l||"not set",lineHeight:c||"not set"})}else i[r]&&(a=i[r],l=o[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(t,e,n,r,i,o){try{let s=t.chain().focus().setTextSelection({from:e,to:e+n});Zc(r)&&(s=s.setFontSize(r),console.log(`Setting font size: ${r}`)),Zc(i)&&(s=s.setFontFamily(i),console.log(`Setting font family: ${i}`)),Zc(o)&&(s=s.setLineHeight(o),console.log(`Setting line height: ${o}`)),s.run(),console.log(`Applied to node at position ${e}:`,{fontSize:r||"not set",fontFamily:i||"not set",lineHeight:o||"not set"})}catch(t){console.warn(`Failed to apply font and line height to node at position ${e}:`,t)}}(t,n,e.nodeSize,a,l,c)}return!0})),console.log("Font and line height application complete")}function Vc(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];t&&e&&(console.log("=== INSERTING CONTENT AND APPLYING FONT SIZES, FAMILIES, AND LINE HEIGHTS ==="),console.log("Content to insert:",e),console.log("Preserve existing fonts:",o),t.commands.insertContent(e),o||setTimeout((()=>{Fc(t,n,r,i)}),100),t.chain().focus())}const Yc=(0,zc.c)(),Wc="selection-background";function qc(t,e){t?e.classList.add(dt.active):e.classList.remove(dt.active)}!function(){if(document.getElementById("theme-provider-vars"))return;const t=document.createElement("style");t.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(t)}();const Xc=t=>{const{defaultDirection:e,content:n,editable:M,element:I,builder:T=[],language:L,editorWidth:N,onClickMagic:R}=t,P=T.find((t=>"fontFamily"===t.type)),D=Rc({fontFamilies:P?.fonts||[],defaultDirection:e,element:I,editable:M,content:n,language:L}),z=(P?.fonts.length>0&&P.fonts,T.find((t=>"fontSize"===t.type))),H=z?z.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],U={direction:()=>{const t=D.isActive({direction:"rtl"})?"ltr":"rtl";Z.direction.element.innerHTML="ltr"===t?a().outerHTML:(t=>(0,r.Z)("svg",(0,i.Z)({},t,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24"}),(0,r.Z)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,r.Z)("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:()=>{qc(D.isActive("bold"),Z.bold.element)},italic:()=>{qc(D.isActive("italic"),Z.italic.element)},link:()=>{qc(D.isActive("link"),Z.link.element)},unLink:()=>{D.isActive("link")?Z.unLink.element.classList.remove(dt.disabled):Z.unLink.element.classList.add(dt.disabled)},underline:()=>{qc(D.isActive("underline"),Z.underline.element)},strike:()=>{qc(D.isActive("strike"),Z.strike.element)},color:()=>{const t=D.getAttributes("textStyle").color||"black";Z.fontColor.element.setAttribute("value",t)},background:()=>{const t=D.getAttributes("textStyle").backgroundColor||"#fff";Z.backcolor.element.setAttribute("value",t)},fontFamily:()=>{const t=D.getAttributes("textStyle").fontFamily?.split(",")[0].replace(/['"]+/g,"");Z.fontFamily.element.value=t||"Arial",Z.fontFamily.element.name=t||"Arial"},table:()=>{qc(D.isActive("table"),Z.table.element)},image:()=>qc(D.isActive("image"),Z.image.element),video:()=>qc(D.isActive("video"),Z.video.element),bulletList:()=>qc(D.isActive("bulletList"),Z.bullet.element),customBulletList:()=>qc(D.isActive("customBulletList"),Z.customList.element),numberedList:()=>{qc(D.isActive("orderedList"),Z.numbered.element)},quotes:()=>qc(D.isActive("blockquote"),Z.quotes.element),horizontalRule:()=>qc(D.isActive("horizontalRule"),Z.horizonRule.element),textAlign:()=>{["justify","center","right","left"].forEach((t=>{qc(D.isActive({textAlign:t}),Z[t].element)}))},fontSize:()=>{D.getAttributes("textStyle").fontSize;Z.fontSize.element.patch(D.getAttributes("textStyle").fontSize||"16px")}},j={removeTable:()=>D.chain().focus().deleteTable().run(),addTable:t=>{const e=(0,r.Z)(at,{style:{width:"220px",padding:"15px"},headerText:"add_table",target:t.target},(0,r.Z)("cdtr-table-cells-editor",{onChange:t=>{let{target:n}=t;const{x:r,y:i}=n.value;e.remove(),D.chain().focus().insertTable({rows:r,cols:i,withHeaderRow:!0}).run()}}));document.body.appendChild(e)},setButton:()=>{D.chain().focus().toggleButton({text:"button",width:"100",height:"100"}).run()},addImage:()=>{D.chain().focus().setImage({src:"https://picsum.photos/100/100",alt:""}).run()},setVideo:()=>{D.chain().focus().setVideo({src:"https://www.youtube.com/watch?v=HUYB8EY09ME",width:"500",height:"300"}).run()},setQuotes:()=>{D.chain().focus().toggleBlockquote().run()},setCode:()=>{D.chain().focus().toggleCodeBlock().run()},setHorizonRule:()=>{D.chain().focus().setHorizontalRule({url:"https://www.youtube.com/watch?v=HUYB8EY09ME",width:"100",height:"100"}).run()},clearFormat:()=>{D.chain().focus().unsetAllMarks().run()},emoji:t=>{},table:()=>D.chain().focus().insertTable({rows:3,cols:3,withHeaderRow:!0}).run(),bold:()=>D.chain().focus().toggleBold().run(),italic:()=>D.chain().focus().toggleItalic().run(),underline:()=>D.chain().focus().toggleUnderline().run(),strike:()=>D.chain().focus().toggleStrike().run(),direction:()=>{const t=D.isActive({direction:"rtl"})?"ltr":"rtl";D.chain().focus().setDirection(t).run()},textAlign:t=>D.chain().focus().setTextAlign(t).run(),bullets:()=>D.chain().focus().toggleBulletList().run(),numbered:()=>D.chain().focus().toggleOrderedList().run(),customList:()=>D.chain().focus().toggleCustomList().run(),fontSize:t=>{D.chain().focus().setFontSize(t).run()},fontFamily:t=>D.chain().focus().setFontFamily(t).run(),link:t=>{if(!t)return null;t.target.closest("button");const e=(0,r.Z)("cdtr-link-element",{href:D.getAttributes("link").href||"",protocol:D.getAttributes("link").protocol,target:D.getAttributes("link").target,onBlur:t=>(t=>{const e=D.state,{from:n,to:r}=e.selection;let i=[];e.doc.nodesBetween(n,r,(t=>{i=[...i,...t.marks]}));const o=i.find((t=>"link"===t.type.name)),s=t.target.value;s.getUrlWithParams&&(s.href=s.getUrlWithParams()),o?D.chain().focus().setColor("blue").extendMarkRange("link").updateAttributes("link",s).setTextSelection({from:r,to:r}).unsetColor().focus().run():(D.commands.saveStyleBeforeLinkFromRange(n,r),D.chain().focus().setTextSelection({from:n,to:r}).setColor("blue").setLink(s).setTextSelection({from:r,to:r}).unsetColor().focus().run()),setTimeout((()=>D.chain().setTextSelection({from:r,to:r}).unsetColor().focus().run()),0)})(t)});B.h.get("injectEditor")((0,r.Z)("cdtr-editor-container",null,e))},unLink:()=>D.chain().focus().extendMarkRange("link").unLinkWithStyleRestore().run(),forColor:t=>{D.chain().setColor(t).focus().run()},clearColor:()=>D.chain().focus().unsetColor().run(),clearBackcolor:()=>D.chain().focus().unsetBackgroundColor().run(),backColor:t=>D.chain().focus().setBackgroundColor(t).run(),onClickMagic:()=>{const t={selectAll:()=>(D.chain().focus().selectAll().run(),t),selectNode:e=>(D.chain().focus().selectNode(e).run(),t),selectParentNode:()=>(D.chain().focus().selectParentNode().run(),t),insertContent:e=>(D.commands.insertContent(e),D.chain().focus(),t),insertContentHtml:e=>{const n=$c.parse(e,{async:!1});return Vc(D,n,{},{},{},!0),t},getHTML:()=>D.getHTML(),getText:()=>D.getText(),getJSON:()=>D.getJSON()};R(t)}};let Z={bold:{element:(0,r.Z)(V,{onClick:j.bold},(0,r.Z)(o,null)),className:dt.colBtn,title:"bold"},underline:{element:(0,r.Z)(V,{onClick:j.underline},(0,r.Z)(h,null)),className:dt.colBtn,title:"underline"},italic:{element:(0,r.Z)(V,{onClick:j.italic},(0,r.Z)(p,null)),className:dt.colBtn,title:"italic"},strike:{element:(0,r.Z)(V,{onClick:j.strike},(0,r.Z)(u,null)),className:dt.colBtn,title:"strikeThrough",divider:!0},fontFamily:{element:(0,r.Z)("cdtr-font-family-editor",{light:!0,onChange:t=>{const e=t.target.value;j.fontFamily(e)}}),className:dt.dropdown,title:"fontFamily",divider:!0},fontSize:{element:(0,r.Z)(ft,{style:{fontSize:"13px",boxShadow:"none"},icon:(0,r.Z)(g,null),title:8,className:dt.dropdown},H.map((t=>(0,r.Z)(mt,{style:{fontSize:"13px"},onClick:()=>j.fontSize(t),className:dt.fontSizeItem,value:t+"px"},t,"px")))),className:dt.dropdown,title:"fontSize",divider:!0},left:{element:(0,r.Z)(V,{onClick:()=>j.textAlign("left")},(0,r.Z)(b,null)),className:dt.colBtn,title:"left"},center:{element:(0,r.Z)(V,{onClick:()=>j.textAlign("center")},(0,r.Z)(A,null)),className:dt.colBtn,title:"center"},right:{element:(0,r.Z)(V,{onClick:()=>j.textAlign("right")},(0,r.Z)(y,null)),className:dt.colBtn,title:"right"},justify:{element:(0,r.Z)(V,{onClick:()=>j.textAlign("justify")},(0,r.Z)(w,null)),className:dt.colBtn,title:"justify",divider:!0},direction:{element:(0,r.Z)(V,{onClick:j.direction},(0,r.Z)(a,null)),className:dt.colBtn,title:B.h.get("lang","direction"),divider:!0},fontColor:{element:(0,r.Z)("color-playground",{ref:{onCreate:t=>{t.hasAlpha=!1,t.type="text"}},onChange:t=>{j.forColor(t.target.value),rt({context:{"::selection":{background:"transparent"}},id:Wc}),Yc.run((()=>{document.getElementById(Wc).remove()}),1500)},className:"cdtr-plugin","data-color":!0}),className:dt.colBtn,title:"forecolor"},backcolor:{element:(0,r.Z)("color-playground",{type:"background",ref:{onCreate:t=>{t.hasAlpha=!1}},onChange:t=>{j.backColor(t.target.value),rt({context:{"::selection":{background:"transparent"}},id:Wc}),Yc.run((()=>{document.getElementById(Wc).remove()}),1500)},className:"cdtr-plugin","data-color":!0}),className:dt.colBtn,title:B.h.get("lang","backcolor"),endLine:!0},bullet:{element:(0,r.Z)(V,{onClick:j.bullets},(0,r.Z)(c,null)),className:dt.colBtn,title:"bullets"},numbered:{element:(0,r.Z)(V,{onClick:j.numbered},(0,r.Z)(d,null)),className:dt.colBtn,title:"numbered"},customList:{element:(0,r.Z)(V,{onClick:j.customList},(0,r.Z)(l,null)),className:dt.colBtn,title:"taskList_with_icons",divider:!0},link:{element:(0,r.Z)(V,{onClick:j.link},(0,r.Z)(f,null)),className:dt.colBtn,title:"link"},unLink:{element:(0,r.Z)(V,{onClick:j.unLink},(0,r.Z)(m,null)),className:dt.colBtn,divider:!0,title:"unLink"},emoji:{element:(0,r.Z)(V,{onClick:t=>{const e=(0,r.Z)("cdtr-emoji-picker",null);e.onEmojiClick=(t,e)=>{D.commands.insertContent(e.emoji),D.chain().focus(),n.close()};const n=(0,r.Z)(at,{target:t.target},e);document.body.appendChild(n)}},(0,r.Z)(x,{className:dt.colorBtn})),className:dt.colBtn,title:"emoji",divider:!0},image:{element:(0,r.Z)(V,{onClick:j.addImage},(0,r.Z)(_,{className:dt.colorBtn})),className:dt.colBtn,title:"image"},video:{element:(0,r.Z)(V,{onClick:j.setVideo},(0,r.Z)(v,{className:dt.colorBtn})),className:dt.colBtn,title:"video"},horizonRule:{element:(0,r.Z)(V,{onClick:j.setHorizonRule},(0,r.Z)(k,{className:dt.colorBtn})),className:dt.colBtn,title:"divider"},table:{element:(0,r.Z)(V,{onClick:j.addTable},(0,r.Z)(S,{className:dt.colorBtn})),className:dt.colBtn,title:"table",divider:!0},quotes:{element:(0,r.Z)(V,{onClick:j.setQuotes},(0,r.Z)(C,{className:dt.colorBtn})),className:dt.colBtn,title:"quotes",divider:!0},clearFormat:{element:(0,r.Z)(V,{onClick:j.clearFormat},(0,r.Z)(E,{className:dt.colorBtn})),className:dt.colBtn,title:"clearFormat",divider:!0},magic:{element:(0,r.Z)(V,{onClick:j.onClickMagic},(0,r.Z)(s,null)),className:dt.colBtn,title:"magic",divider:!0},mergeTags:{element:(0,r.Z)("cdtr-merge-tags",{onChange:t=>{D.commands.insertContent(t.target.value),D.chain().focus();const e=document.querySelector("cdtr-drop-modal");e?.remove()}}),title:"mergeTags",divider:!0}};const Y="editor";Y&&Y.textEditor&&Y.textEditor.cmds&&Array.isArray(Y.textEditor.cmds)&&Y.textEditor.cmds.forEach((t=>{const e="function"==typeof t.element?{element:t.element(),title:t.title,className:t.className||""}:{divider:t.divider};Z["extend-"+(0,F.Z)()]=e}));const W=(()=>{const t=[];for(const e in Z)if(Object.hasOwnProperty.call(Z,e)){if(T.find((t=>t.type===e))){const n=Z[e];n&&n.element&&(n.element.classList.add("cdtr-button-cmd"),n.element.classList.add(dt.btn),t.push(n)),n.endLine&&(t.push({endLine:!0}),delete n.endLine),n.divider&&(t.push({divider:!0}),delete n.divider)}}return t})(),q=t=>{let{editor:e}=t;for(const t in U)if(Object.hasOwnProperty.call(U,t)){(0,U[t])()}};return{component:new $({onLoad:()=>{D.off("selectionUpdate",q),D.off("transaction",q),D.on("selectionUpdate",q),D.on("transaction",q),window.removeEventListener("click",q),window.addEventListener("click",q),q({editor:D})},onUnload:()=>{},children:(0,r.Z)("cdtr-row",{style:{width:N||null},justify:"flex-start",alignItems:"center",className:O(dt.textEditor,"cdtr-plugin","cdtr-text-editor-plugin",dt.fadeUp)},W.map(((t,e)=>t.divider?(0,r.Z)("div",{className:dt.dividerY}):t.endLine?(0,r.Z)("cdtr-col",{sm:12}):(0,r.Z)("cdtr-col",{"tooltip-dir":"top",className:t.className},(0,r.Z)("cdtr-tooltip",{placement:"top",content:t.title,delay:"600,0"},t.element," ")," "))),(0,r.Z)("div",{className:dt.dividerX}))}),editor:D}};const Gc=function t(e){e&&e.firstChild&&(e.removeChild(e.firstChild),t(e))},Kc=t=>{const e=(0,r.Z)("div",{style:{zIndex:(0,nt.Z)()+3},className:O(dt.main,"no-select")}),n=t.container,i=t.target,o=t.editor,s=t.offsetTop,a=r=>{window.requestAnimationFrame((()=>{setTimeout((()=>{if(!n)return;const r=t.container,o=t.target?.getBoundingClientRect();if(!o)return void console.error("no block");const a=e.getBoundingClientRect(),l=i.getBoundingClientRect(),c=o.top+r.offsetTop-a.height;let d=l.left+(l.width-a.width)/2+"px";e.style.left=d,n&&r.offsetTop>c-60?(e.classList.contains(dt.withTransition)||e.classList.add(dt.withTransition),e.classList.contains(dt.sticky)||e.classList.add(dt.sticky)):(e.classList.remove(dt.withTransition),e.classList.remove(dt.sticky),e.style.top=Math.abs(o.top)-a.height-s+"px")}),0)}))},l=new $({onUpdate:()=>{if(n){e.appendChild(o),e.style.opacity=0,setTimeout((()=>{e.style.opacity=1}),50);const t=e.getBoundingClientRect(),r=n.getBoundingClientRect();e.style.top=Math.abs(r.top)-t.height+"px"}},onUnload:()=>{Gc(e),n.removeEventListener("scroll",a),document.removeEventListener("scroll",a)},children:e});return l.start=()=>{document.body.appendChild(l),n.addEventListener("scroll",a),window.addEventListener("scroll",a),a()},l};const Jc=new class{constructor(){(0,gt.Z)(this,"events",void 0),this.onDispatchEvent=this.onDispatchEvent.bind(this),this.events={click:[],mouseover:[],mousedown:[],mousemove:[],mouseup:[],keydown:[],keyup:[],scroll:[]}}onDispatchEvent(t){const e=t,n=this;Array.isArray(n.events[t.type])&&requestAnimationFrame((()=>n.events[t.type].forEach(((r,i)=>{"function"==typeof r?r(e):n.events[t.type].splice(i,1)}))))}destroy(){}connect(t,e){const n=this;if(!n.events[t])return void console.error("Can't use this event name",t);0===n.events[t].length&&window.addEventListener(t,this.onDispatchEvent,!1);n.events[t].findIndex((t=>t===e))>-1?console.warn("The event has already been subscribed."):n.events[t].push(e)}disconnect(t,e){const n=this;if(!n.events[t])return void console.error("Can't remove event name",t);0===n.events[t].length&&window.removeEventListener(t,this.onDispatchEvent);const r=n.events[t].findIndex((t=>t===e));r>-1&&Array.from(n.events[t]).splice(r,1)}};Jc.connect("mousemove",(t=>{B.h.set({mouse:{y:t.pageY,x:t.pageX}})}));const Qc=Jc;const td=new class{constructor(){this.selectedRows=[],this.connected=!1,this.onExecute=(t,e)=>{},this.connect=this.connect.bind(this),this.node=(0,r.Z)("cdtr-table-editor",{onChange:this.onExecute}),this.render=this.render.bind(this),Qc.connect("keydown",this.render),Qc.connect("scroll",this.render)}disconnect(){this.connected=!1,this.node.remove()}connect(t,e){this.connected=!0,this.target=t,this.editor=e,this.render()}render(){if(this.connected&&this.target){const t=this.target.getBoundingClientRect();let e=t.top+t.height+5;e+43>window.innerHeight&&(e=window.innerHeight-43),e<t.top&&(e=t.top),this.node.setAttribute("top",e),this.node.setAttribute("left",t.left),this.node.setAttribute("width",t.width),this.node.setAttribute("height",t.height),document.body.appendChild(this.node),this.selectedRows=Array.from(this.target.querySelectorAll(".selectedCell")),this.node.setAttribute("selectedRows",this.selectedRows.length)}}},ed=td;class nd extends bt.oi{constructor(){super(),this.className="cdtr-button-cmd",this.cmds={tdColor:t=>{td.editor.commands.updateAttributes("tableCell",{borderColor:t.target.value})},toggleHeaderColumn:()=>td.editor.chain().focus().toggleHeaderColumn().run(),toggleHeaderCell:()=>td.editor.chain().focus().toggleHeaderCell().run(),mergeOrSplit:()=>td.editor.chain().focus().mergeOrSplit().run(),addRowAfter:()=>td.editor.chain().focus().addRowAfter().run(),addRowBefore:()=>td.editor.chain().focus().addRowBefore().run(),addColumnBefore:()=>td.editor.chain().focus().addColumnBefore().run(),addColumnAfter:()=>td.editor.chain().focus().addColumnAfter().run(),deleteColumn:()=>td.editor.chain().focus().deleteColumn().run(),deleteRow:()=>td.editor.chain().focus().deleteRow().run(),splitCell:()=>td.editor.chain().focus().splitCell().run(),deleteTable:()=>td.editor.chain().focus().deleteTable().run(),mergeCells:()=>td.editor.chain().focus().mergeCells().run(),setWidth:()=>{td.editor.commands.updateAttributes("table",{width:"300px"})}}}render(){return bt.dy`<div
|
|
1731
1731
|
class="editor cdtr-button-cmd"
|
|
1732
1732
|
style="width:auto;top:${parseInt(this.top)}px;left:${this.left}px"
|
|
1733
1733
|
>
|